IMPI commands contain the following payload:
typedef union {
IMPI_Int4 rank; // rank of this client in IMPI job
IMPI_Int4 size; // total # of clients in IMPI job
} IMPI_Impi;
The IMPI command informs the server that this client wishes to join an IMPI job. For the client-to-server packet, the payload consists of the rank of the client. After every client in the job has connected to the server and sent its own rank, the server will send back to each client the size, that is, the total number of clients in the job.
Example: Consider an IMPI job built from three clients:
| client 0 : | 3 hosts, each with 2 processes per host |
| client 1 : | 2 hosts, each with 3 processes per host |
| client 2 : | 2 hosts, each with 4 processes per host |
The exchange of messages for the IMPI command is shown in Figure 2.1. Each client will first send a single IMPI_Cmd containing the fields {IMPI_CMD_IMPI, 4}. The clients will then each send a single IMPI_Impi, with the following fields:
| client 0 : | { rank = 0 } |
| client 1 : | { rank = 1 } |
| client 2 : | { rank = 2 } |
After collecting all of the above, the server will send the following IMPI_Impi struct back to each client:
IMPI_Int4 cmd = IMPI_CMD_IMPI
IMPI_Int4 len = 4
IMPI_Int4 size = 3