
17 Mar
2010
17 Mar
'10
6:36 p.m.
AMDG alev mutlu wrote:
int arraySize = 7; <snip> int main(int argc, char* argv[]) { <snip>
if (world.rank() == MASTER){ scatter(world, C, relMyValues, w_mySize, 0); } else{ scatter(world, C, relMyValues, w_mySize, 0); } }
I don't know much about MPI, so this may be totally off, but the implementation seems to assume that you're going to send an equal number of elements to each process. If arraySize is not evenly divisible by world.size(), this could cause MPI_Scatter to read uninitialized memory, which would explain your problem. In Christ, Steven Watanabe