Hi,

I am trying to distribute a matrix on root process to other processes. In order to do that, I choose scalapack subrouinte pdgemr2d,

It works for some cases, but it sometimes gives error, which is as follows

"xxmr2d:out of memory"

I checked all allocation very carefully and it does correctly, but it is still problematic for some cases,

has anybody encontoured this kind of problem when using pdgemr2d subroutine,

I have copied important part of my applications which is written in C++,

sl_init( &ictxt, nprow, npcol );

bool isRootNode = false;

if ( myrow == 0 && mycol == 0 ) isRootNode = true;

//loaad matrix on root node and create desc for it

int descA0[9], lm_a0, info, rsrc = 0, csrc = 0;

if ( isRootNode ) {

lm_a0 = numroc( M, M, myrow, rsrc, nprow);

assert( input->getVecSpaceTimeMtrx().at(dim).rows() == lm_a0 );

descinit( descA0, M, N, M, N, rsrc, csrc, rootNodeContext, std::max(1,lm_a0), &info );

assert( !info );

} else {

for ( int i = 0; i < 9; i++ ) descA0[i] = 0;

descA0[1] = -1;

}

//create desc for distributed matrix

int lm_a, ln_a;

rsrc = 0; csrc = 0;

lm_a = numroc( M, block_size, myrow, rsrc, nprow);

ln_a = numroc( N, block_size, mycol, csrc, npcol);

assert( input->getLocalVecSpaceTimeMtrx().at(dim).rows() == lm_a );

assert( input->getLocalVecSpaceTimeMtrx().at(dim).cols() == ln_a );

descinit( descA.at(dim).data(), M, N, block_size, block_size, rsrc, csrc, ictxt, std::max(1,lm_a), &info);

assert( !info );

}

//distribute data

int IA = 1, JA = 1, IB = 1, JB = 1;

pdgemr2d( M, N, input->getVecSpaceTimeMtrxP(dim), IA, JA, descA0, input->getLocalVecSpaceTimeMtrxP(dim),

IB, JB, descA.at(dim).data(), descA.at(dim)(1));

I hope that you can help me out,

thanks anyway,