[OMPI users] How to check if Send was made or not before performing a recv
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
Re: [OMPI users] How to check if Send was made or not before performing a recv
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 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.
Re: [OMPI users] cannot restrict port numbers using btl_tcp_port_min_v4 and btl_tcp_port_range_v4
Hmmmwell, that stinks. I did some digging and there is indeed a bug in the 1.4 series - forgot to convert the port number to network-byte order. Will file a patch and add you to the ticket so you can see when it gets applied. If you wouldn't mind testing the release candidate, that would be appreciated. Thanks! Ralph On Dec 10, 2010, at 3:58 PM, Tang, Hsiu-Khuern wrote: > Hi Ralph, > > I did try the corresponding oob_* parameters (sorry for not mentioning that). > Here's what I tried: > > > mpirun --host host1,host2 -np 2 --mca btl_tcp_port_min_v4 1 --mca > btl_tcp_port_range_v4 10 --mca oob_tcp_port_min_v4 1 --mca > oob_tcp_port_range_v4 10 sleep 100 > > > In another window while the above is running: > > $ sudo netstat -plnt > > tcp0 0 0.0.0.0:41350.0.0.0:* > LISTEN 9714/mpirun > tcp0 0 :::58600:::* > LISTEN 9714/mpirun > ... > > -- > Best, > Hsiu-Khuern. > > > * On Fri 03:49PM -0700, 10 Dec 2010, Ralph Castain (r...@open-mpi.org) wrote: >> mpirun is not an MPI process, and so it doesn't obey the btl port params. To >> control mpirun's ports (and those used by the ORTE daemons), use the >> oob_tcp_port... params >> >> >> On Dec 10, 2010, at 3:29 PM, Tang, Hsiu-Khuern wrote: >> >>> >>> Hi, >>> >>> I am trying to understand how to control the range of ports used by Open >>> MPI. >>> I tried setting the parameters btl_tcp_port_min_v4 and >>> btl_tcp_port_range_v4, >>> but they don't seem to have an effect. >>> >>> I am using Open MPI 1.4.2 from Debian sid, but get the same result on RHEL5. >>> >>> When I run a program like >>> >>> mpirun --host host1,host2 -np 2 --mca btl_tcp_port_min_v4 1 --mca >>> btl_tcp_port_range_v4 10 sleep 100 >>> >>> and then in another terminal run "netstat -plnt", should I expect to see >>> mpirun >>> listening on one or more ports between 1 and 10009? I don't -- mpirun >>> is >>> invariably listening on some other ports. >>> >>> Thanks! >>> >>> -- >>> Best, >>> Hsiu-Khuern. >>> ___ >>> users mailing list >>> us...@open-mpi.org >>> http://www.open-mpi.org/mailman/listinfo.cgi/users >>
Re: [OMPI users] How to check if Send was made or not before performing a recv
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 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> 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 > us...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/users >