1SETTMASK(3PVM) PVM Version 3.4 SETTMASK(3PVM)
2
3
4
6 pvm_gettmask, pvm_settmask - Get or set trace mask of a task or its
7 children.
8
9
11 C #include <pvm3.h>
12 #include <pvmtev.h>
13
14 int info = pvm_gettmask( int who, Pvmtmask mask )
15 int info = pvm_settmask( int who, Pvmtmask mask )
16
17 Fortran Not Available
18
19
21 who Specifies which trace mask to get or set:
22 PvmTaskSelf The current task
23 PvmTaskChild Children tasks to be spawned
24
25 mask Trace mask (owned by caller), which is filled in with the cur‐
26 rent trace vector on calling pvm_gettmask or used to set the
27 current trace vector on calling pvm_settmask.
28
29 info Status code returned. Values less than zero indicate an error.
30
31
33 Each task has a trace mask, which can be used to individually enable
34 tracing of each libpvm function. The mask is inherited from its parent
35 task (or initially all cleared if the task has no parent). When calls
36 are made to functions in libpvm, the parameters and results are sent in
37 messages to the trace sink of the task (variable PvmTraceTid set by
38 calling pvm_setopt - see man page).
39
40 The PVM console and XPVM use this system to get trace data from appli‐
41 cation programs.
42
43 A task can get or set either its own trace mask, or the mask passed to
44 children it spawns. Note the mask must be set before the spawn call;
45 setting the child trace mask has no effect on already-running children.
46
47 The trace mask can be kept in a temporary variable, declared as:
48
49 Pvmtmask mymask;
50
51 Right now, this is a character array with approximately 80 bits.
52
53 There are four macros defined to manipulate trace masks. Along with
54 the functions, these allow a program to get the current trace mask,
55 modify or save it, and put it back:
56
57 TEV_INIT_MASK(mask)
58 TEV_SET_MASK(mask, kind)
59 TEV_UNSET_MASK(mask, kind)
60 TEV_CHECK_MASK(mask, kind)
61
62 TEV_INIT_MASK initializes a mask to all bits cleared and must be used
63 to initialize a trace mask (unless that is done by setting it from
64 pvm_gettmask). TEV_SET_MASK sets a bit in a mask. Bit values are
65 defined in <pvmtev.h>. Likewise, TEV_UNSET_MASK clears a single bit
66 and TEV_CHECK_MASK checks to see if a bit is set, returning nonzero if
67 true.
68
69 Note: Most events in the trace mask come in pairs, the first (ending in
70 ...0) is generated on entry to a function and the second (...1) on
71 exit. The trace mask has only half as many bits as there are events;
72 events are enabled in pairs. In other words, if you select TEV_SEND0,
73 you'll also get TEV_SEND1.
74
75 The trace mask is deliberately kept as a printable (and null-termi‐
76 nated) string, for two reasons. First, it is passed through the envi‐
77 ronment between tasks, in the form:
78
79 PVMTMASK=@@AAOG@@NO@L@@@@@@@@
80
81 so the pvmd doesn't have to explicitly manage it. Second, the mask
82 variables can be passed between tasks using pvm_pkstr() or otherwise
83 manipulated as strings.
84
85 pvm_gettmask and pvm_settmask return PvmOk on success, else a negative
86 value.
87
88
90 C:
91 #include <pvm3.h>
92 #include <pvmtev.h>
93
94 Pvmtmask m;
95
96 pvm_gettmask( PvmTaskChild, m );
97 TEV_SET_MASK(m, TEV_ADDHOSTS0 );
98 pvm_settmask( PvmTaskChild, m );
99 pvm_spawn( "worker", (char **)0, PvmTaskDefault, "", 1, (int *)0);
100
101
103 The following error condition can be returned by pvm_gettmask or
104 pvm_settmask:
105
106 PvmBadParam
107 invalid value for who argument.
108
110 pvm(1PVM), pvm_getopt(3PVM), pvm_setopt(3PVM)
111
112
113
114 16 March, 1994 SETTMASK(3PVM)