Next: pvm
Up: Message passing mechanism and
Previous: Message passing mechanism and
Contents
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:
- the master program send a box with
unknowns by writing in a text buffer the keyword B followed by
reals which are the extremity of the box ranges for each
unknown.
- then it append to this message the value N of
ALIAS_Parallel_Max_Bisection with the keyword SP (hence
SP N is appended to the buffer. If N is negative then the
value M of ALIAS_Parallel_Max_Box is appended to the
buffer by appending the text P I M (the value of
ALIAS_Parallel_Max_Bisection is computed by the master program:
if the box is large a positive value is chosen while for
small box a negative value is given).
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:
- the boxes still to be processed (using the keywords
B for each box or N is no box remain
to be processed)
- the solution that have been eventually found (using the keyword
S followed by the reals)
- a failure code if the slave has not been able to process the
box (using the keyword F followed by the error code)
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: pvm
Up: Message passing mechanism and
Previous: Message passing mechanism and
Contents
Jean-Pierre Merlet
2012-12-20