SETTMASK(3PVM)
π SETTMASK β the pvm_gettmask / pvm_settmask era
okay so bestie, welcome to PVM Version 3.4, page SETTMASK(3PVM). this is the one about β¨trace masksβ¨, aka the little permission slips that decide which libpvm functions get to spill their tea to the trace sink. iconic behavior honestly.
πΈ NAME πΈ
pvm_gettmask, pvm_settmask β get or set the trace mask of a task or its children, fr fr.
β¨ SYNOPSIS β¨
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 π« sorry babes, it's just not.
π PARAMETERS π
whoβ tells the function which trace mask we're getting or setting, and it's giving very specific options:PvmTaskSelfβ the current task, me, myself and I πPvmTaskChildβ children tasks to be spawned, the little ones πΆ
maskβ the trace mask, and it's owned by the caller. onpvm_gettmaskit gets filled in with the current trace vector; onpvm_settmaskit's the thing you're using to set the current trace vector. no cap.infoβ the status code that comes back. anything less than zero means error, and yes we're gonna talk about that later π
π¦ DESCRIPTION π¦
so every task has a trace mask, right? and that mask is how you individually enable tracing of each and every libpvm function. it gets inherited from its parent task β or, if the task has no parent, it starts out initially all cleared (a clean slate, main character origin story energy).
when calls get made to functions in libpvm, the parameters and results are sent in messages to the trace sink of the task. that sink lives in the variable PvmTraceTid, which you set by calling pvm_setopt β see that man page, iykyk.
the PVM console and XPVM use this whole system to get trace data from application programs. yeah. they're obsessed with your traces.
a task can get or set either its own trace mask or the mask passed to the children it spawns. β οΈ but listen: the mask has to be set before the spawn call. setting the child trace mask has no effect on already-running children. it's giving "too late babe, they already left the group chat."
the trace mask can be kept in a temporary variable, declared like:
Pvmtmask mymask;
right now, this is a character array with approximately 80 bits. tiny but mighty π§
there are four macros defined to manipulate trace masks. along with the functions, these let a program 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 it must be used to initialize a trace mask β unless that's done by setting it from pvm_gettmask, obviously. 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. slay.
Note: most events in the trace mask come in pairs π the first one (ending in...0) is generated on entry to a function, and the second one (...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 selectTEV_SEND0, you'll also getTEV_SEND1. they're a package deal, no splitting them up.
the trace mask is deliberately kept as a printable (and null-terminated) string, for two reasons:
- it's passed through the environment between tasks, in the form:
PVMTMASK=@@AAOG@@NO@L@@@@@@@@
so the pvmd doesn't have to explicitly manage it. king behavior honestly π
- 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. that's the whole vibe check.
π EXAMPLES π
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);
look at her go. get the child mask, flip on a bit, set it back, then spawn. order matters bestie π«Ά
π ERRORS π
the following error condition can be returned by pvm_gettmask or pvm_settmask:
PvmBadParamβ invalid value for thewhoargument. you gave it something it doesn't recognize. not me accidentally passing garbage towhoπ
β SEE ALSO β
pvm(1PVM), pvm_getopt(3PVM), pvm_setopt(3PVM)
and that's the page!! π brought to you by PVM Version 3.4, dated 16 March, 1994 β yeah she's vintage, she's a classic, she ate and left no crumbs. go forth and trace responsibly β¨ππ¦
π¦ where this page comes from
- debian bookworm: pvm-dev 3.4.6-5
- ubuntu jammy: pvm-dev 3.4.6-3.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms