CATCHOUT(3PVM)
β¨ CATCHOUT π
β the pvm_catchout page (3PVM, PVM Version 3.4)
okay bestie, pull up a chair because this one is literally about being the nosy parent who reads their kids' texts. except the "kids" are child tasks and the "texts" are stdout and stderr. π
πΈ NAME πΈ
pvm_catchout β catch output from child tasks. that's it, that's the whole vibe. it's giving "helicopter parent but for spawned processes". π¦
β¨ SYNOPSIS β¨
C bestie:
#include <stdio.h>
int info = pvm_catchout( FILE *ff )
Fortran bestie:
call pvmfcatchout( onoff, info )
π PARAMETERS π
ffβ the file descriptor you want all the collected output to get written to. that's the lil bucket you're catching everything in. πͺ£onoffβ an integer, bestie. flips output collection on or off. the switch. the toggle. the main character of Fortran-land.infoβ the integer status code the routine hands back to you. anything less than zero means something went wrong. no cap. π
π DESCRIPTION π
okay so here's the tea. pvm_catchout makes the calling task (that's the parent) start catching output from any tasks spawned after the call to pvm_catchout. characters printed on stdout or stderr in children tasks get collected by the pvmds and sent in control messages to the parent task, which tags each line and appends it to the specified file. β¨
and the grandchildren?? the tasks spawned by the children?? their output gets collected too, provided the children don't reset their PvmOutputTid. so it's a whole family group chat, fr fr. π«Ά
if the option PvmShowTids (peep pvm_setopt) is true (nonzero), the output gets printed like this, tagged with the task id where the output originated:
[txxxxx] BEGIN
[txxxxx] (text from child task)
[txxxxx] END
so the output from each task includes one BEGIN line and one END line, with whatever the task prints sitting in between. if PvmShowTids is false, you just get the raw output printed with no extra info at all. plain. unseasoned. π€·βοΈ
in C, you get to specify the output file descriptor. giving a null pointer turns output collection off for any subsequently spawned child tasks. (any existing output collection will still proceed at the child tasks, until they exit or change their PvmOutputTid or related settings β go read the man page for pvm_setopt() for that whole situation.) π
in Fortran, output collection can only be turned on or off (again, only for subsequently spawned child tasks), and it's always logged to the stdout of the parent task. no file descriptor choices for you, sorry babes.
β οΈ 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. that's a yikes. to avoid it, turn output collection off by callingpvm_catchout(0)before you callpvm_exit. save yourself the pain. π
and the iconic finale: pvm_catchout() always returns 0. always. every time. periodt. π
π EXAMPLES π
C bestie:
#include <stdio.h>
pvm_catchout(stdout);
Fortran bestie:
CALL PVMFCATCHOUT( 1, INFO )
π¦ SEE ALSO π¦
pvm_exit(3PVM)pvm_setopt(3PVM)pvm_spawn(3PVM)
and that's the whole page, bestie!! this was PVM Version 3.4 energy, dated 13 July, 1994 β yeah she's vintage, she's an icon, she ate and left no crumbs. now go catch that output. πβ¨π
π¦ 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