Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] openMPI, transfer data from multiple sources to one destination
From: Biagio Lucini (B.Lucini_at_[hidden])
Date: 2008-12-29 05:32:00

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.


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