Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] How to check if Send was made or not before performing a recv
From: Alaukik Aggarwal (alaukik.aggarwal_at_[hidden])
Date: 2010-12-11 21:51:35


Thanks for your reply. I used this to solve the problem.

But I think there should be an in-built construct for this.

Alaukik

On Sat, Dec 11, 2010 at 10:28 AM, Eugene Loh <eugene.loh_at_[hidden]> wrote:
> Alaukik Aggarwal wrote:
>
>> Hi,
>>
>> I am using Open MPI 1.4.3.
>>
>> I have to perform a receive operation from processes that are sending
>> data. It might happen that some of the processes don't send data
>> (might have completed in-fact).
>>
>> So, how do I perform check on which processes to receive data from and
>> which processes to skip?
>>
>> [code]
>> if(id != master)
>>       MPI::COMM_WORLD.Send(&dist, NUM_VERTEX, MPI_LONG, master, 1234);
>> if(id == master)
>> {
>>       for(int eachId = 1; eachId<procs ; eachId++)
>>       MPI::COMM_WORLD.Recv(&dist1, NUM_VERTEX, MPI_LONG, eachId, 1234);
>> }
>> [/code]
>>
>
> One option is to have each non-master process send a "forget about me"
> message.  In practice, what this means is that every non-master process
> does, in fact, send a message, with that message either containing data or
> an indication that there is no data to send.
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users
>