[petsc-users] The multiplication of the transpose of a dense matrix(A^T) and a large sparse matrix(X1)

Joon hee Choi choi240 at purdue.edu
Tue Jun 4 01:56:32 CDT 2013


Hello,

I am trying to multiply the transpose of a dense matrix(A) and a large sparse matrix(X1). That is, A^T x X1.

X1 is a 26Mil x 1200Tril, 144Mil non-zeros sparse matrix and A is a 26Mil x 10 dense matrix.

I know that sparse x dense is faster than dense x sparse when using MatMatMult.  Thus, I tried to implement the following code:

        ierr = MatTranspose(X1, MAT_INITIAL_MATRIX, &tempX1); CHKERRQ(ierr);
        ierr = MatMatMult(tempX1, A, MAT_INITIAL_MATRIX, 1.0, &MT);
        ierr = MatDestroy(&tempX1); CHKERRQ(ierr);
        ierr = MatTranspose(MT, MAT_INITIAL_MATRIX, &M); CHKERRQ(ierr);
        ierr = MatDestroy(&MT); CHKERRQ(ierr);

However, I got the "out-of-memory" error when implementing MatTranspose().  I think this is because the number of columns of X1 is much larger than that of rows of X1.  If there is a fast way to calculate M = A^T x X1, I would appreciate your feedback on this.  Please help!

Thank you,
Joon


More information about the petsc-users mailing list