C #include <pvm3.h> #include <pvmtev.h> int info = pvm_gettmask( int who, Pvmtmask mask )
int info = pvm_settmask( int who, Pvmtmask mask )
Fortran Not Available
PvmTaskSelf The current task PvmTaskChild Children tasks to be spawned
The PVM console and XPVM use this system to get trace data from application programs.
A task can get or set either its own trace mask, or the mask passed to children it spawns. Note the mask must be set before the spawn call; setting the child trace mask has no effect on already-running children.
The trace mask can be kept in a temporary variable, declared as:
Right now, this is a character array with approximately 80 bits.
There are four macros defined to manipulate trace masks. Along with the functions, these allow a program to get the current trace mask, modify or save it, and put it back:
TEV_INIT_MASK(mask) TEV_SET_MASK(mask, kind) TEV_UNSET_MASK(mask, kind) TEV_CHECK_MASK(mask, kind)
TEV_INIT_MASK initializes a mask to all bits cleared and must be used to initialize a trace mask (unless that is done by setting it from pvm_gettmask). TEV_SET_MASK sets a bit in a mask. Bit values are defined in <pvmtev.h>. Likewise, TEV_UNSET_MASK clears a single bit and TEV_CHECK_MASK checks to see if a bit is set, returning nonzero if true.
Note: Most events in the trace mask come in pairs, the first (ending in ...0) is generated on entry to a function and the second (...1) on exit. The trace mask has only half as many bits as there are events; events are enabled in pairs. In other words, if you select TEV_SEND0, you'll also get TEV_SEND1.
The trace mask is deliberately kept as a printable (and null-terminated) string, for two reasons. First, it is passed through the environment between tasks, in the form:
so the pvmd doesn't have to explicitly manage it. Second, the mask variables can be passed between tasks using pvm_pkstr() or otherwise manipulated as strings.
pvm_gettmask and pvm_settmask return PvmOk on success, else a negative value.
C: #include <pvm3.h> #include <pvmtev.h> Pvmtmask m; pvm_gettmask( PvmTaskChild, m ); TEV_SET_MASK(m, TEV_ADDHOSTS0 ); pvm_settmask( PvmTaskChild, m ); pvm_spawn( "worker", (char **)0, PvmTaskDefault, "", 1, (int *)0);