Hi Xin,
Since it is not Open MPI specific, you might want to try to work with
the SciNet guys first. The "SciNet Research Computing Consulting
Clinic" is specifically formed to help U of T students & researchers
develop and design compute-intensive programs.
http://www.scinet.utoronto.ca/
http://www.scinet.utoronto.ca/support/Research_Computing_Consulting_Clinic.htm
The service is free, so just send them an email... Of course, they
can't help you with your coursework! :-D
Rayson
=================================
Grid Engine / Open Grid Scheduler
http://gridscheduler.sourceforge.net
On Tue, Sep 13, 2011 at 12:49 PM, Xin Tong Utoronto <x.tong_at_[hidden]> wrote:
> I am new to openmpi. I am not sure whether my logic below will work or not.
> Can someone please confirm for me on that ? Basically, what this does is
> trying to check whether there are anything to send, if there are, send it
> right away and set sentinit to true. Then check whether there are anything
> to receive, if there are receive it. I am running this on a client-server
> model (2 nodes sending and receiving data between each other)
> for (;;) {
> if (sendinit && MPI_Test(&sendreq, &sendcomplete,
> &sendstatus)) {
> if (sendcomplete) {
> if (pollv[1].revents & POLLIN) {
> printf("Trying to send in rank %d\n", rank);
> nx=vde_recv(conn,sendbuff,BUFSIZE-2,0);
> vdestream_mpisend(vdestream,sendbuff, nx,
> GET_PAIR_RANK(rank), &sendreq);
> } else {
> // no in-flight request.
> sendinit = false;
> }
> }
> } else {
> // no in-flight request. try to start one
> if (!sendinit && pollv[1].revents & POLLIN) {
> nx=vde_recv(conn,sendbuff,BUFSIZE-2,0);
> printf("Trying to send in rank %d\n", rank );
> vdestream_mpisend(vdestream,sendbuff, nx,
> GET_PAIR_RANK(rank), &sendreq);
> sendinit = true;
> }
> }
>
> if (recvinit && MPI_Test(&recvreq, &recvcomplete,
> &recvstatus)) {
> if (recvcomplete) {
> printf("Receive completed\n");
> // get the actual number of byet received.
> MPI_Get_count(&recvstatus, MPI_CHAR, &recvcount);
> vdestream_recv(vdestream, recvbuff, recvcount);
> // no more in-flight recv.
> recvinit = false;
> }
> } else {
> if (!recvinit) {
> printf("Trying to receive in rank %d\n", rank);
> // no in-flight recv. try to start one.
> vdestream_mpirecv(vdestream, recvbuff, BUFSIZE-2,
> GET_PAIR_RANK(rank), &recvreq);
> recvinit = true;
> }
> }
> }
>
> --
> Kind Regards
>
> Xin Tong
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users
>
|