Where does stuff printed in tasks go?

next up previous contents
Next: I don't see Up: Running and debugging Previous: My tasks can't

Where does stuff printed in tasks go?

Why does stuff printed by child tasks appear in the master pvmd log file, while output from the parent task appears on the window where you start the parent?

The spawned tasks' output goes to their pvmds; their stdouts are not inherited from the parent task. Each pvmd collects output from its tasks through pipes and passes it to the master pvmd, which logs it in /tmp/pvml.uid2.15) and on its stdout. Additionally, stderr of spawned tasks is duped to stdout - they're not separate files. Finally, spawned tasks have no stdin, because /dev/null is opened as file 0.

Tasks started by hand have normal stdin, stdout and stderr connections.

You can redirect output (stdout/err) from spawned tasks to the console, and to a file if you like. Type ``help spawn'' for more information. If the output is not redirected to the console, it goes to the master pvmd logfile as before.

PVM output redirection is inherited, so if you spawn a task from the console and redirect its output to the console, you'll also get output from all its children.

You can also call pvm_catchout() in the master task of your program before spawing child tasks. Output from children will be sent to the master and printed on its stdout. Be sure to call pvm_exit() to have to master wait for all output from children before exiting.

Bob Manchek
Fri Mar 3 15:08:11 EST 1995