In our example code five (
NPROCS) copies of the
executable file ``
worker'' will be spawned by the master
No arguments are to be sent and we are allowing PVM to choose which
machines will be used to execute the worker code.
The task ids will be placed in the array
To send a message from one task to another, a send buffer is created
to hold the data.
pvm_initsend() creates and clears the buffer and
returns a buffer identifier.
int bufid = pvm_initsend(int encoding)If a single buffer is used,
pvm_initsend()must be called each time a new message is to be sent, otherwise the new message will be appended to the message already in the send buffer.
encoding parameter can be either PvmDataDefault or
The former option will use XDR
encoding of message data if the virtual
machine configuration is determined to be heterogeneous, else no
encoding is done.
The latter option does no encoding of the message data.