From: jonesbr@roger.ecn.purdue.edu (Brian R. Jones) Newsgroups: comp.parallel.mpi Subject: [Q] Out-of-order calls in MPI vs. PVM Date: 25 Jun 1999 21:59:00 GMT Organization: Purdue University, School of AAE Message-Id: <7l0u34$q9g$1@mozo.cc.purdue.edu> Xref: ukc comp.parallel.mpi:5250 Hello! [Short version at the end] Background: I am in the process of converting a Fortran 77 3D CFD code from PVM to MPI. The ability to compile with PVM or MPI is a requirement, thus I can not (extensively) modify the structure of the code. I realize that this limits the extent to which I can exploit the added capability of MPI. Eventually, PVM will be dropped and a more effective MPI rewrite will occur. That said, I currently have a direct translation completed (meaning pvmfsend mapped to MPI_Send, etc.) and even managed to sidestep the PVM spawning process in MPI. I am having problems, however, with the data exchange between "blocks" of the 3D computational grid. In the PVM version of the code, the process for each node looks like this: 1) perform computation on current block 2) pass data (via pvmfsend/MPI_Send) at interface between current block and neighboring blocks to corresponding nodes. 3) wait for interface data from neighboring nodes/blocks (via pvmfrecv/MPI_Recv) Note that there is no synchronization here.... if all the nodes had an equal computational burden, they would all send their data at the same time and then all receive data at the same time. While I have had a bit of exposure to MPI, I'm new to PVM. From what I can tell, however, pvmfsend and pvmfrecv equate to MPI_Send and MPI_Recv (i.e. both are blocking). Dismissing that possibility, I'm now working on why the program hangs. I'm guessing that the PVM daemon is handling the out-of-order communication that I will need to explicitly address in MPI. The short version: A node has a message pending for receipt, but can't post the receive until after sending off another message. The buffering supplied by the PVM daemon will allow this behavior, while the MPI code must be structured to handle the MPI commands in the order that they occur. Am I interpreting this correctly? Is the simple (but ugly) solution to add MPI_Probe commands before each send to test for a pending receive?