[petsc-users] Preallocation for regtangular matrix

Pham Van pham_ha at yahoo.com
Sat Apr 28 03:32:48 CDT 2012


Dear list,

I am trying to create matrices for a rectangular matrix with number of rows is much bigger than number of columns.

I create 2 matrices together one square and one rectangular with the same number of rows. To my surprise the smaller matrix (rectangular) creation take much more time than the bigger one (rectangular). I did preallocate for both matrices with predefine number of diagonal and off-diagonal entries. But then again I did not know how to define diagonal part of a rectangular matrix. Only a very small top part of the matrix is "diagonal".

I have try both method: the first one to set diagonal and off-diagonal part as it was a square matrix; and second to set only a small top part of the matrix diagonal. Both method does not work.

Does anyone know how to preallocate a rectangular matrix.

By the way, the same code run pretty fast when I run with single process and painfully slow when 2 processes employed.

Thank you in advance.

Kind regards,
Pham Van Ha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120428/9d782e4d/attachment.htm>


More information about the petsc-users mailing list