LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   MPI Programming: Problem with sending different sized array to other nodes (https://www.linuxquestions.org/questions/programming-9/mpi-programming-problem-with-sending-different-sized-array-to-other-nodes-761523/)

ajitup 10-13-2009 12:03 AM

MPI Programming: Problem with sending different sized array to other nodes
 
Hi!

I am developing a parallel C++ code under suse linux 11.0 using MPICH2.

In this code, each node generates a dynamic array of different size which has to be shared to all other nodes (including the root node).

e.g.
node 0 generates an array with 8 elements
node 1 generates an array with 24 elements
node 2 generates an array with 15 elements
node 3 generates an array with 17 elements

before MPI_Finalize, every nodes should pass-on its dynamic array to all other nodes for putting all the elements received in a single dynamic array (for performing certain calculations).

I have looked at all the MPI_Functions (http://mpi.deino.net/mpi_functions/index.htm) but am not able to find out any function which can handle different array size for a "gather" type operation.

I tried MPI_Gather but the array size must be same on all nodes. MPI_AllGather has another problem, If I run it from all nodes, all nodes try to run this at the same time and so there is a race-around situation and program hangs.

Can anybody help?

thanks and regards,
ajitup


All times are GMT -5. The time now is 01:54 AM.