Jack Bryan wrote:
HI,

I need to transfer data from multiple sources to one destination.
[...]

Probably it is not the best solution, but what I did was the following:

a) the receiver listen for transmitters ready to send data with MPI_IRECV. The message overwrites a logical array, which is initialised to false. If some transmitter is ready, then the corresponding entry in the array is updated to true b) when ready, a transmitter send a true (with MPI_SEND) to the receiver and open a communication channel for the data, with another call to MPI_SEND c) after having checked for availability of all the transmitters, the receiver cycles over the transmitters that are ready to communicate (entry of the logical array equal to true) and open a communication channel in blocking mode (MPI_RECV) with each of them, in turn d) the transmitter reinitialise the logical array to false and goes back to (a) above

This implementation assumes that you do not need the data in any particular order.

Hope it works for you.

Biagio

--
=========================================================

Dr. Biagio Lucini                               
Department of Physics, Swansea University
Singleton Park, SA2 8PP Swansea (UK)
Tel. +44 (0)1792 602284

=========================================================

Reply via email to