Hi all,

I'm writing an algorithm using PETSc that requires part of an (N x k)
matrix, where k << N. Specifically, my algorithm loops from j = 1 to k, and
uses j columns of the matrix of a time. I've been creating a new matrix for
each iteration, and use MatGetColumnVector to get the values for each
column vector, scatter them into a new vector, and then use MatSetValue to
populate my matrix. MatGetColumnVector is very slow, and I was thinking of
using MatCreateSubMatrix. However, I'm not entirely sure how to get the
correct IS that would allow me to create a submatrix using the first j
columns of the matrix at a time. I'm running in parallel, and the matrix is
an MPIAIJ matrix. I've looked at examples of MatCreateSubMatrix as well as
examples including the use of IS, but I'm still not very sure how to use
them.

Thanks,

Rakesh

Reply via email to