CATCHOUT(3PVM)
π CATCHOUT(3PVM) π
ok so this is a page from the PVM Version 3.4 manual, bestie, and it's all about catching output from your child tasks like the absolute icon you are π«Ά
β¨ NAME β¨
pvm_catchout β catch output from child tasks. yes literally, that's the whole job, she's a catcher π
πΈ SYNOPSIS πΈ
C:
#include <stdio.h>
int info = pvm_catchout( FILE *ff )
Fortran:
call pvmfcatchout( onoff, info )
π PARAMETERS π
ffβ the file descriptor you want the collected output written to. that's the lil home for all the spillover πonoffβ an integer. flips output collection on or off, like a light switch but for vibes β¨infoβ the integer status code the routine hands back to you. anything less than zero = something went wrong, and we do NOT love that π
π¦ DESCRIPTION π¦
okay so here's the tea: pvm_catchout makes the task that calls it (that's the parent, the main character fr) catch the output from any tasks spawned after the call to pvm_catchout. anything the child tasks print to stdout or stderr gets collected by the pvmds and sent over in control messages to the parent task, which then tags every single line and appends it to the file you specified. obsessed honestly π
and get this β output from grandchildren tasks (aka the ones spawned by your children, the whole family tree is thriving) is also collected, provided the children don't reset their PvmOutputTid. periodt.
If option PvmShowTids (peep pvm_setopt) is true (nonzero), the output gets printed like this, tagged with the task id of wherever the output came from:
[txxxxx] BEGIN
[txxxxx] (text from child task)
[txxxxx] END
so every task's output gets exactly one BEGIN line and one END line, with whatever the task prints chillin' in between. and if PvmShowTids is false? then you just get the raw output, no extra info, no garnish, just the goods π
In C you can specify the output file descriptor. giving a null pointer turns output collection off for any child tasks spawned after that point. (quick note bestie: any existing output collection will still proceed at the child tasks until they exit or change their PvmOutputTid or related settings β go see the man page for pvm_setopt() for that.) In Fortran, output collection can only be turned on or off (and again, only for subsequently spawned child tasks), and it's always logged to the stdout of the parent task. no choosing, that's just how she is π
β οΈ real talk: ifpvm_exitis called while output collection is in effect, it will block in order to print all the output, until all tasks sending the given task output have exited. so to dodge that whole situation, turn output collection off by callingpvm_catchout(0)before you callpvm_exit. you're welcome, this is the save π«Ά
pvm_catchout() always returns 0. always. no surprises, she's consistent π
π₯ EXAMPLES π₯
C:
#include <stdio.h>
pvm_catchout(stdout);
Fortran:
CALL PVMFCATCHOUT( 1, INFO )
π SEE ALSO π
pvm_exit(3PVM)pvm_setopt(3PVM)pvm_spawn(3PVM)
and that's the whole page, bestie!! π this iconic little number came from PVM Version 3.4, dated 13 July, 1994 β an absolute vintage queen and she ate fr fr πβ¨π
π¦ 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