Setting and Getting Options<A NAME=568> </A> <A NAME=569> </A>



next up previous contents index
Next: Message Passing Up: PVM User Interface Previous: Signaling

Setting and Getting Options   

int oldval = pvm_setopt( int what, int val )
int val = pvm_getopt( int what )
call pvmfsetopt( what, val, oldval )
call pvmfgetopt( what, val )

The routine pvm_setopt is a general-purpose function that allows the user to set or get options in the PVM system. In PVM 3, pvm_setopt can be used to set several options, including automatic error message printing, debugging level, and communication routing method for all subsequent PVM calls. pvm_setopt returns the previous value of set in oldval. The PVM 3.3 what can have the following values:

     Option Value         Meaning
------------------------------------------------------------------
PvmRoute            1     routing policy
PvmDebugMask        2     debugmask
PvmAutoErr          3     auto error reporting
PvmOutputTid        4     stdout destination for children
PvmOutputCode       5     output msgtag
PvmTraceTid         6     trace destination for children
PvmTraceCode        7     trace msgtag
PvmFragSize         8     message fragment size
PvmResvTids         9     allow messages to reserved tags and tids
PvmSelfOutputTid   10     stdout destination for self
PvmSelfOutputCode  11     output msgtag
PvmSelfTraceTid    12     trace destination for self
PvmSelfTraceCode   13     trace msgtag
------------------------------------------------------------------
See Appendix B for allowable values for these options. Future expansions to this list are planned.

The most popular use of pvm_setopt is to enable direct route communication between PVM tasks. As a general rule of thumb, PVM communication bandwidth over a network doubles by calling

pvm_setopt( PvmRoute, PvmRouteDirect );
The drawback is that this faster communication method is not scalable under Unix; hence, it may not work if the application involves over 60 tasks that communicate randomly with each other. If it doesn't work, PVM automatically switches back to the default communication method. It can be called multiple times during an application to selectively set up direct task-to-task communication links, but typical use is to call it once after the initial call to pvm_mytid().