I get an error if I try
Activity
CWillberg commentedon Apr 30, 2026
using MPI
MPI.Init()
using HPCSparseArrays
using SparseArrays
Create a sparse matrix (must be identical on all ranks)
A_global = sprand(1000, 1000, 0.01)
A = HPCSparseMatrix{Float64}(A_global)
Create a vector
x_global = rand(1000)
x = HPCVector(x_global)
Matrix-vector multiplication
y = A * x
Matrix-matrix multiplication
B_global = sprand(1000, 500, 0.01)
B = HPCSparseMatrix{Float64}(B_global)
C = A * B
Transpose operations
At = transpose(A)
D = At * B # Materializes transpose as needed
Solve linear systems
using LinearAlgebra
A_sym = A + transpose(A) + 10I # Make symmetric positive definite
A_sym_dist = HPCSparseMatrix{Float64}(A_sym)
F = ldlt(A_sym_dist) # LDLT factorization
x_sol = solve(F, y) # Solve A_sym * x_sol = y