Using the PSPort interface

In order to actually utilize the low level ParaStation MPI communication interfaces the PSPort library has to be used. The PSPort library supplies fast and reliable point to point connections to the user.

To make use of these connections first of all a port has to be opened. All further communication operations will act towards this port.

Furthermore information about all the ports of the other processes building the parallel task has to be gathered in order to be able to send data to this processes. Within the example program this problem is solved in the following way:

  1. Initialize the PSPort interface using the PSP_Init(3) function within every process.

  2. Open a port using the PSP_OpenPort(3) function call. The local port number and the ParaStation MPI node ID are determined via PSP_GetPortNo(3) and PSP_GetNodeID(3) respectively. This has to be done within every process, too.

  3. The master process, i.e. the process with rank 0, which has spawned all other processes, is going to receive information concerning the local node ID and port number from the client processes. Therefore it has passed its own node ID and port number to the clients through the PSE_spawnTasks(3) function as discussed within the last section.

  4. The client processes send the information concerning their local ports, i.e. port number and node ID, to the master process. Therefore they have to determine the node ID and port number of the master process before. This is done by using the PSE_getMasterNode(3) and PSE_getMasterPort(3) function calls, respectively, as discussed above.

  5. When the master process has completed to receive the information from the client processes it redistributes the collected port and node numbers to all processes.

Now each process has information about the port number of all other processes. These information can then be used in order to do communication operations on a point-to-point basis between all the processes forming the parallel task.

The actual communication operations utilizing the low level PSPort interface are initiated using the PSP_ISend(3) and PSP_IReceive(3) functions. All communication within PSPort is nonblocking. Therefore each communication operation has to be tested upon completion. This is done via the PSP_Wait(3) function.