Can I spawn shell scripts

next up previous contents
Next: Can a task Up: Advanced programming Previous: My application needs

Can I spawn shell scripts

Yes, as well as other non-PVM programs (e.g. /bin/date). Even if a spawned program makes no PVM calls, it will have a task id and context (output redirection, etc.). When it exits, the pvmd will catch the exit signal and clean up the task context.

If a non-PVM program (such as a shell script) starts a PVM program, the PVM program reconnects to the context allocated to its parent, claiming the task id and context. When it exits, it takes the task id with it. This means you can spawn a shell script that starts a PVM program, and the PVM program will receive the same task id as was returned by the call to spawn. The debugger script ($PVM_ROOT/lib/debugger) does this.

Note that if a second PVM program is started by the shell script, it will not reconnect to the same task context, which is freed by the exit of the first PVM program. Take for example the following timeline:

Thus, gets an anonymous context, as though it was not spawned by PVM. It has a new task id and no output redirection.

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