After the program is enrolled in the virtual machine, the master
program initializes the data that is to be summed up.
Next, the worker processes are spawned.
The routine to spawn worker processes is
call pvmfspawn(task, flag, where, ntask, tids, numt)
The first parameter,
task, is a string containing the name of
the executable file that is to be used.
flag parameter is used to determine the specific machine or
type of architecture the spawned task is to be run on.
Possible values for
wherestring argument specifies the particular machine.
wherestring indicates the architecture type.
ntaskparameter specifies the number of copies of the task to be spawned and
tidsis an integer array that is to contain the task ids of all tasks successfully spawned. The routine returns the number of tasks that were successfully created through the
numtparameter. If some tasks could not be started, the last ( ntask - numt) positions of
tidswill contain error codes for the unspawned tasks.
In our example code five (
NPROCS) copies of the
executable file ``
worker'' will be spawned by the master
We allow PVM to choose which
machines will be used to execute the worker code.
The task ids will be placed in the array