next up previous contents
Next: pvm Up: Message passing mechanism and Previous: Message passing mechanism and   Contents

Example of message passing mechanism

A very simple master program using pvm may be found in the ALIAS distribution under the name
MasterGeneralSolve.C while the corresponding slave program is SlaveGeneralSolve.C: these programs are used by Maple for creating the parallel implementation of the GeneralSolve procedure. Here we use text message passing:

This buffer is then sent to a slave computer with the pvm_pkstr procedure. As soon as a buffer is received by the slave computer the value of the box to be processed is extracted from the message using the ALIAS procedure ALIAS_Read_Buffer (which also update the value of ALIAS_Parallel_Max_Bisection and ALIAS_Parallel_Max_Box. As soon as the slave computer has terminated its computation it send back to the master in a text buffer:

For the algorithms using the derivatives the jacobian matrix is also transferred to the slaves. For large system this may slow down considerably the communication between the slaves and the master. Hence it may be a good policy to inhibit the transfer of the jacobian by setting the variable `ALIAS/transmit_gradient` to 0.


next up previous contents
Next: pvm Up: Message passing mechanism and Previous: Message passing mechanism and   Contents
Jean-Pierre Merlet 2012-12-20