Hello,

This might be an ignorant question, but I couldn't find an explicit answer anywhere:

Is there a function/routine that can perform the distribution of a dense (symmetric) matrix into the block-cyclic format?

I did find PxGEMR2D but this seems to assume that a matrix is already distributed. What I am looking for, is a function that for each process gives the mapping between the indices (i_loc,j_loc) of the local data array and the global one (i,j). Like this (i_loc,j_loc) <-> (i,j).

INDXG2L and INDXL2G seem to be intended for that, but when I loop over the global indices it returns values on all processes, while I would think for each (i,j) there is exactly one process which holds (i_loc,j_loc). For example this (n is the dimension of the global matrix):

do i=1,n

do j=1,n

i_loc=INDXG2L(i,NB,0,0,NPROW)

j_loc=INDXG2L(j,NB,0,0,NPCOL)

enddo

enddo

This returns values on all processes, while on each process only some (i,j) have a valid local correspondence. How can I decide which (i_loc,j_loc) is an actual local index pair?

Is this the right strategy for the distribution? It seems to me, that this si THE standard problem everyone faces when using scalapack.

Thank you for your help!