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 function to spawn worker processes is
int numt = pvm_spawn( char *task, char **argv, int flag, char *where, int ntask, int *tids)
The first parameter is a string containing the name of the executable
file that is to be used.
Any arguments that must be sent to this program are in an array
pointed to by
If no arguments are required by the task, then the
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.
The fifth parameter,
ntask, specifies the number of copies of
the task to be spawned and
tids is a pointer to an integer
array that returns the task ids of all tasks spawned.
The function returns the number of tasks that were successfully created.
If some tasks could not be started, the last ( ntask - numt) positions
tids will contain error codes for the unsuccessful tasks.