SPAWN(3PVM)

πŸ“¦ version 3.4.6, in debian bookworm, ubuntu jammy

πŸ’– SPAWN(3PVM) πŸ’–

okay bestie, welcome to pvm_spawn β€” the PVM 3.4 era glow-up that literally starts new PVM processes for you. it's giving "mom, can we get more tasks" and the answer is yes. let's go 🫢


✨ NAME ✨

pvm_spawn β€” Starts new PVM processes. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

C girlies:

int numt = pvm_spawn( char *task, char **argv, int flag,
char *where, int ntask, int *tids )

Fortran girlies:

call pvmfspawn( task, flag, where, ntask, tids, numt )

πŸŽ€ PARAMETERS πŸŽ€

  • task β€” a character string, aka the executable file name of the PVM process you wanna start. important: the executable has to already be chilling on the host where it's gonna start. the name can be a file in the PVM search path or an absolute path. the default PVM search path is $HOME/pvm3/bin/$PVM_ARCH/.
  • argv β€” pointer to an array of arguments for the executable (if that's supported on the target machine), not including the executable name, and the end of the array is marked by NULL. argv[0] of the spawned task gets set to the executable path relative to the PVM working directory (or absolute if you specified an absolute filename). if your executable needs no arguments, then the second argument to pvm_spawn is just NULL. simple as πŸ“
  • flag β€” integer that specifies the spawn options. no cap, this is where the lore is:

In C, flag should be the sum of:

  • PvmTaskDefault 0 β€” PVM can choose any machine to start task
  • PvmTaskHost 1 β€” where specifies a particular host
  • PvmTaskArch 2 β€” where specifies a type of architecture
  • PvmTaskDebug 4 β€” Start up processes under debugger
  • PvmTaskTrace 8 β€” Processes will generate PVM trace data. *
  • PvmMppFront 16 β€” Start process on MPP front-end.
  • PvmHostCompl 32 β€” Use complement host set

In Fortran, flag should be the sum of:

  • PVMDEFAULT 0 β€” PVM can choose any machine to start task
  • PVMHOST 1 β€” where specifies a particular host
  • PVMARCH 2 β€” where specifies a type of architecture
  • PVMDEBUG 4 β€” Start up processes under debugger
  • PVMTRACE 8 β€” Processes will generate PVM trace data. *
* future extension πŸ‘€ (yes, the asterisk is doing all that work, iconic behavior)
  • where β€” character string saying where to start the PVM process. depending on the value of flag, where can be a host name like "ibm1.epm.ornl.gov" or a PVM architecture class like "SUN4". also!! the host name "." is taken as the localhost. and if flag is 0, then where is ignored when determining the target host or architecture, and PVM will select the most appropriate host. main character energy honestly.

the where argument can also be used to specify a custom working directory for each given spawn command. you do this by appending a ':' and the desired working directory path to the where string, i.e.:

"ibm1.epm.ornl.gov:/home/user/project/foo"

PVM will temporarily change the working directory to spawn the given task(s), and will then reset to the default working directory after the spawn is executed. this option need not be used in conjunction with either the PvmTaskHost or PvmTaskArch flags, because the working directory path is stripped off prior to parsing any host or architecture name. so a valid specification for where is therefore:

":/home/user/project/foo"

the working directory can be either an absolute path name or can be relative to the current default working directory. flexible queen πŸ’œ

  • ntask β€” integer specifying the number of copies of the executable to start.
  • tids β€” integer array of length ntask returning the tids of the PVM processes started by this pvm_spawn call.
  • numt β€” integer returning the actual number of tasks started. values less than zero indicate a system error 😭. a positive value less than ntask indicates a partial failure. in this case the user should check the tids array for the error code(s).

πŸ¦‹ DESCRIPTION πŸ¦‹

the routine pvm_spawn starts ntask copies of the executable named task. on systems that support environment, spawn passes selected variables from parent environment to children tasks. if set, the envar PVM_EXPORT is passed. if PVM_EXPORT contains other names (separated by ':') they will be passed too. this is useful for e.g.:

setenv DISPLAY myworkstation:0.0
setenv MYSTERYVAR 13
setenv PVM_EXPORT DISPLAY:MYSTERYVAR

the hosts on which the PVM processes are started are determined by the flag and where arguments. on return the array tids contains the PVM task identifiers for each process started.

if pvm_spawn starts one or more tasks, numt will be the actual number of tasks started. if a system error occurs then numt will be < 0. if numt is less than ntask then some executables have failed to start and the user should check the last ntask - numt locations in the tids array which will contain error codes (see below for meaning). the first numt tids in the array are always valid. ✨

when flag is set to 0 and where is set to NULL (or "*" in Fortran) a heuristic (round-robin assignment) is used to distribute the ntask processes across the virtual machine. she's just rotating through hosts like it's a fit check πŸ”₯

if the PvmHostCompl flag is set, the resulting host set gets complemented. given that the TaskHost host name "." is taken as localhost, these can be used together, for example, to request n - 1 tasks on host "." but with flags TaskHost|HostCompl to spawn n - 1 tasks on hosts other than the localhost.

in the special case where a multiprocessor is specified by where, pvm_spawn will start all ntask copies on this single machine using the vendor's underlying routines.

the spawned task will have argv[0] set to the the executable path relative to its inherited working directory (or possibly an absolute path), so the base filename can be got by using:

char *p;
p = (p = rindex(argv[0], '/')) ? p + 1 : argv[0];

if PvmTaskDebug is set, then the pvmd will start the task(s) under debugger(s). in this case, instead of executing pvm3/bin/ARCH/task args it executes pvm3/lib/debugger pvm3/bin/ARCH/task args. debugger is a shell script that the users can modify to their individual tastes. presently the script starts an xterm with dbx or comparable debugger in it. ngl that's kinda cute πŸŽ€


🌈 EXAMPLES 🌈

C besties:

numt = pvm_spawn( "host", 0, PvmTaskHost, "sparky", 1, &tid[0] );
numt = pvm_spawn( "host", 0, (PvmTaskHost+PvmTaskDebug),
               "sparky", 1, &tid[0] );
numt = pvm_spawn( "node", 0, PvmTaskArch, "RIOS", 1, &tid[i] );

char *args[] = { "12", "60" , (char*)0 };
numt = pvm_spawn( "FEM1", args, 0, 0, 16, tids );

numt = pvm_spawn( "pde", 0, PvmTaskHost, "paragon.ornl", 512, tids );

Fortran besties:

FLAG = PVMARCH + PVMDEBUG
CALL PVMFSPAWN( 'node', FLAG, 'SUN4', 1, TID(3), NUMT )
CALL PVMFSPAWN( 'FEM1', PVMDEFAULT, '*', 16, TIDS, NUMT )
CALL PVMFSPAWN( 'TBMD', PVMHOST, 'cm5.utk.edu', 32, TIDS, NUMT )

πŸ’€ ERRORS πŸ’€

these error conditions can be returned by pvm_spawn either in numt or in the tids array. keep an eye out πŸ‘‘

  • PvmBadParam β€” giving an invalid argument value.
  • PvmNoHost β€” Specified host is not in the virtual machine.
  • PvmNoFile β€” Specified executable cannot be found. The default location PVM looks in is ~/pvm3/bin/ARCH, where ARCH is a PVM architecture name.
  • PvmNoMem β€” Malloc failed. Not enough memory on host.
  • PvmSysErr β€” pvmd not responding.
  • PvmOutOfRes β€” out of resources.

πŸ‘‘ SEE ALSO πŸ‘‘

pvm_export(3PVM) β€” go read her too, she's iconic πŸ’–


okay that's the whole page bestie, you're officially a pvm_spawn girlie now. this was PVM Version 3.4, dated 30 August, 1993 β€” vintage, but she ate and left no crumbs. slay, bye πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from