SIBLINGS(3PVM)

πŸ“¦ version 3.4.6, in debian bookworm, ubuntu jammy

πŸ’– SIBLINGS β€” the pvm_siblings manual, bestie edition πŸ’–

okay so this is pvm_siblings from the PVM Version 3.4 manual (the 3PVM girlies know πŸ’…). It's a C and Fortran routine and it's genuinely so useful, let me tell you everything, no cap.


✨ NAME ✨

pvm_siblings β€” returns the number and the associated task ids of processes that were started together in a single spawn call. yes bestie, the whole friend group 🫢


🌸 SYNOPSIS 🌸

C:

int ntids = pvm_siblings( int **tids )

Fortran:

call pvmfsiblings( ntids, index, sibling )

πŸŽ€ PARAMETERS πŸŽ€

  • ntids β€” returns the number of tids that were spawned together. If this value is less than 0, that's an error, bestie 😭
  • tids β€” a pointer to the array of tids that contains the siblings. Indexed from 0 to (ntids - 1), okay, zero-indexed, we love that for us.
  • index β€” integer index of the tid to be returned in sibling. If index is set to -1, then sibling is left unchanged. Otherwise, it must be in the range [0, ntids - 1] β€” colour inside the lines please πŸ’…
  • sibling β€” when index is in the range [0, ntids -1], this contains the tid of the desired index. slay.

πŸ¦‹ DESCRIPTION πŸ¦‹

So pvm_siblings returns the number of tasks and a list of task ids of processes that were spawned together in a single spawn call. The spawning task multicasts the list of successful to the spawned tasks, so that each task has an identical copy of the sibling list. it's giving synced group chat ✨

pvm_siblings uses local storage to keep the list of tids and does not update this list when sibling tasks exit the virtual machine. So it's a snapshot, not a live feed, iykyk.

The FORTRAN version lets calling programs read a particular index in the internal sibling array.

If pvm_siblings is successful, ntids will be > 0. If some error occurs then ntids will be < 0. periodt.

pvm_siblings is designed to simplify the logic in static spmd-style programs. By giving tasks an identical list of tids and its size, programs may self size and treat the sibling as a static map between instances and tasks. The internal list is not updated when sibling tasks exit the virtual machine and should be treated as a snapshot of the parallel program when it was first started. πŸ“Έ

If a task was started by pvm_spawn, then pvm_siblings will return ntids = 1 and

ntids = 1 and tids will contain a single entry identical to the task id
returned by pvm_mytid()

main character energy, honestly πŸ‘‘


🌈 EXAMPLES 🌈

C:

int *tids;
ntids = pvm_siblings(&tids);

Fortran:

INTEGER TIDS(0:MAXNPROC)
CALL PVMFSIBLINGS(NTIDS, -1, IDUM)
DO I = 0, NTIDS-1
   CALL PVMFSIBLINGS(NTIDS, I, TIDS(I))

πŸ’€ ERRORS πŸ’€

pvm_siblings can return the following error codes:

  • PvmNoTask β€” no task at that index, or the index is invalid. yeah that one's on you bestie πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

pvm_spawn(3PVM), pvm_mytid(3PVM), pvm_parent(3PVM)


go read those too, they're literally the rest of the friend group πŸ’œ

k that's the whole page, mwah πŸ’‹ this one's from PVM Version 3.4, dated 26 June, 1997 β€” vintage but iconic, we stan a timeless classic πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from