PVM_SHMD(1PVM)
π PVM_SHMD β PVM shared memory (2) daemon π
okay bestie, pull up a chair, because this is the manual page for pvm_shmd, and it lives in the PVM Version 3.4 manual, section 1PVM. she's a daemon and she's iconic β¨
πΈ SYNOPSIS πΈ
pvm_shmd [ -options ] [ hostfile ]
π¦ DESCRIPTION π¦
So. pvm_shmd is a daemon process, and her whole job β her entire main character arc β is maintaining and handling the usage of shared memory resources on one particular PVM host. And when I say shared memory resources I mean memory segments, semaphores, and message queues. The whole trio. π
One pvm_shmd must run on each host in a virtual machine that wants to use the shmd shared memory message passing layer. That's not a vibe suggestion, that's a requirement, fr fr.
Now, the shmd message passing layer lets local processes on a host use shared memory for message passing on that host ONLY. ONLY. Like, do not try to make it reach across hosts, that is not her job and she will not be doing that. π Check the shmd directory README for further notes and restrictions, bestie, there's lore in there.
The daemon can be started manually, same as with any other PVM task. Only one pvm_shmd can be active per host. And the way that she handles competition? If the pvm_shmd detects another pvm_shmd, it will shutdown. Not a fight, just an exit. Very demure. π
The pvm_shmd can be killed from the PVM console by using the reset command. And local and remote pvm_shmds can also be started from the PVM console program pvm. Slay. β¨
The name of the daemon executable is pvm_shmd. (Yes bestie, that's the name. It's giving "the name is the name".)
π Shared Resource Usage π
The pvm_shmd will attempt to create upto MAXSEG shared memory segments of upto MAXPAGES memory pages in size. The size of each memory page is architecture dependent β see getpagesize(3C) if you wanna get into it. π§
The segments are then numbered 0..N-1, where N is the number of segments created. The first segment (0) has the shared memory control structure placed in its head. This structure allows alien processes to located the other shared memory segments and any required controlling information. (yes, "alien processes", she said what she said, that's the wording.) π
The message passing layer allocates memory from these segments asynchronously without any interaction with the pvm_shmd, using semaphores to protect data during updates to any associated structures. For each segment there is an associated page map of which processes have currently locked a page. Each page map for a segment has a separate semaphore protecting it. The semaphores are accessed with the SEM_UNDO flag set so that if a process holding a semaphore should die, the OS (should) reset the semaphore automatically, thus allowing any waiting/blocked processes to continue. the way that recovery just... happens? obsessed. π«Ά
The pvm_shmd only maintains the segments and their allocation page map(s). So if a process allocated pages in a segment and then exits, it is the pvm_shmd that detects this and then frees the allocated pages. She's cleaning up after everybody. Constantly. π
You can have the pvm_shmd's status checked at any time by using the pvm_shmd_stat process to kick it into reporting onto either stdio or the pvm log file (pvml.uid) its internal state. Kick it and she'll spill. π
The shared memory and all associated processes can be cleared by sending the pvm_shmd a HUP signal.
Sending the pvm_shmd a TERM signal will just cause it to clear any shared resources and then exit.
Thepvm_shmdcannot catch theKILLsignal. No cap. There is no handler. There is no plan. It's over. π
If the pvm_shmd is killed without clearing all of its shared resources, these can be cleared by calling ipcfree, which resides in the pvm3/lib directory. β¨
π Message Passing using SHMD π
The pvm_shmd handles resources that are used by special versions of pvm_psend() and pvm_precv() stored in the libpvmshmd.a library. So to use these facilities, applications have to link to this library instead of the usual libpvm3.a library. Different library, bestie. Don't link the wrong one and then act surprised. π
β¨ OPTIONS β¨
The following options may be specified on the command line when starting the pvm_shmd:
-debug=levelβ Sets thepvm_shmddebug level. Used to debug thepvm_shmdorlibpvmshmdβ not intended to be used to debug application programs, so don't get it twisted. π-maxsegs=maxsegsβ Sets the maximum number of segments that thepvm_shmdcan create. This is used to over-ride the compiled in value fromshmd.h. Note that the value cannot be above theMAXSEGSin theshmd.hfile. hard ceiling, periodt.-maxpages=maxpagesβ Sets the maximum segment size tomaxpagespages of memory. This value cannot be above the compiled valueMAXPAGESinshmd.hor the actual OS defined limit. π
π NOTES π
Remember that pvm_shmd allocated memory from the VM available on the machine. Allocating more segements improves performance as there is less sharing of segments (semaphores for their page maps). Although you must remember to leave some memory available for normal program and OS system usage, as the pvm_shmd allocated memory is ONLY used for message passing. π¦
bestie. leave the OS some RAM. she is also a main character. π«Ά
πΈ FILES πΈ
$PVM_ROOT/lib/$PVM_ARCH/pvm_shmdβ PVM shared memory daemon executable$PVM_ROOT/shmd/shmd.hβ Shared Memory hard limits header file/tmp/pvml.uidβ Pvmd runtime error log
π SEE ALSO π
pvm(1PVM), pvmd(1PVM), getpagesize(3C), ipcs(1), msgctl(2), semctl(2), shmctl(2), signal(5)
and that's the whole page, bestie, you ate it, you understood it, you're basically a shared memory girlie now π β¨
this masterpiece was written by G.E.Fagg on 11 March, 1999, for PVM Version 3.4 β and we are, as always, obsessed with her ππ
π¦ 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