A server makes itself available with two routines. First it must call MPI_OPEN_PORT to establish a port at which it may be contacted. Secondly it must call MPI_COMM_ACCEPT to accept connections from clients.
MPI_OPEN_PORT(info, port_name)
MPI_OPEN_PORT(INFO, PORT_NAME, IERROR)CHARACTER*(*) PORT_NAME
INTEGER INFO, IERROR
int MPI::Open_port(const MPI::Info& info, char* port_name)
void
This function establishes a network address, encoded in the port_name string, at which the server will be able to accept connections from clients. port_name is supplied by the system, possibly using information in the info argument.
MPI-/ copies a system-supplied port name into port_name. port_name identifies the newly opened port and can be used by a client to contact the server. The maximum size string that may be supplied by the system is MPI_MAX_PORT_NAME.
port_name is essentially a network address. It is unique within the communication universe to which it belongs (determined by the implementation), and may be used by any client within that communication universe. For instance, if it is an internet (host:port) address, it will be unique on the internet. If it is a low level switch address on an IBM SP, it will be unique to that SP.
info may be used to tell the implementation how to establish the address. It may, and usually will, be MPI_INFO_NULL in order to get the implementation defaults.
MPI_CLOSE_PORT(PORT_NAME, IERROR)CHARACTER*(*) PORT_NAME
INTEGER IERROR
int MPI::Close_port(const char* port_name)
void
This function releases the network address represented by
port_name.
MPI_COMM_ACCEPT(port_name, info, root, comm, newcomm)
MPI_COMM_ACCEPT(PORT_NAME, INFO, ROOT, COMM, NEWCOMM, IERROR)CHARACTER*(*) PORT_NAME
INTEGER INFO, ROOT, COMM, NEWCOMM, IERROR
int MPI::Intracomm::Accept(const char* port_name, const MPI::Info& info, int root) const
MPI::Intercomm
MPI_COMM_ACCEPT establishes communication with a client. It is collective over the calling communicator. It returns an intercommunicator that allows communication with the client.
The port_name must have been established through a call to MPI_OPEN_PORT.
info is a implementation-defined string that may allow fine control over the ACCEPT call.
MPI-Standard for MARMOT