[petsc-users] Gathering distributed dense matrix only on rank 0

Roland Richter roland.richter at ntnu.no
Mon Jan 25 03:40:24 CST 2021


Hei,

is there a way to gather a distributed dense matrix only on rank 0, not
on the other ranks? My matrix processing/storage routines in my program
currently are single-threaded and only operate on rank 0, and therefore
I assume that I can ignore all other ranks. This should also save a bit
time, I hope (MatCreateRedundantMatrix is currently the by far most
expensive part of my program).

When executing MatCreateRedundantMatrix(A, size, MPI_COMM_NULL,
MAT_INITIAL_MATRIX, &B), usually all ranks get the full matrices,
something I would like to avoid. Therefore, is there another way of
handling this?

Thanks!

Regards,

Roland Richter



More information about the petsc-users mailing list