There is only one routine on the client side.
MPI_COMM_CONNECT(port_name, info, root, comm, newcomm) | |
IN port_name | network address (string, significant only at root) |
IN info | implementation-dependent information (handle, significant only at root) |
IN root | rank of root in comm (integer) |
IN comm | intra-communicator over which call is collective (handle) |
OUT newcomm | inter-communicator with server as remote group (handle) |
This routine establishes communication with a server specified by port_name. It is collective over the calling communicator and returns an inter-communicator in which the remote group participated in an MPI_COMM_ACCEPT.
If the named port does not exist (or has been closed), MPI_COMM_CONNECT raises an error of class MPI_ERR_PORT.
If the port exists, but does not have a pending MPI_COMM_ACCEPT, the connection attempt will eventually time out after an implementation-defined time, or succeed when the server calls MPI_COMM_ACCEPT. In the case of a time out, MPI_COMM_CONNECT raises an error of class MPI_ERR_PORT.
Advice
to implementors.
The time out period may be arbitrarily short or long. However, a high-quality
implementation will try to queue connection attempts so that a
server can handle simultaneous requests from several clients. A high-quality
implementation may also provide a mechanism, through the info
arguments to MPI_OPEN_PORT, MPI_COMM_ACCEPT, and/or
MPI_COMM_CONNECT, for the user to
control timeout and queuing behavior.
( End of advice to implementors.)
MPI provides no guarantee of fairness in servicing connection
attempts. That is, connection attempts are not necessarily satisfied
in the order they were initiated and competition from other
connection attempts may prevent a particular connection attempt
from being satisfied.
port_name is the address of the server. It must be the same as the name returned by MPI_OPEN_PORT on the server. Some freedom is allowed here. If there are equivalent forms of port_name, an implementation may accept them as well. For instance, if port_name is ( hostname:port), an implementation may accept ( ip_address:port) as well.