Example
Simplest Example---Completely Portable.
The following example shows the simplest way to use the client/server interface. It does not use service names at all.
On the server side:
The server prints out the port name to the terminal and the user must type it in when starting up the client (assuming the MPI implementation supports stdin such that this works). On the client side:
Example
Ocean/Atmosphere---Relies on Name Publishing
In this example, the ``ocean'' application is the ``server'' side of a coupled ocean-atmosphere climate model. It assumes that the MPI implementation publishes names.
On the client side:
Example
Simple Client-Server Example
This is a simple example; the server accepts only a single connection at a time and serves that connection until the client requests to be disconnected. The server is a single process.
Here is the server. It accepts a single connection and then processes data until it receives a message with tag 1. A message with tag 0 tells the server to exit.
Here is the client.