Newsgroups: comp.parallel.pvm
From: Ken Lancaster <ken@wynde.com>
Subject: Spawned task output (stdout, stderr) doesn't show up in log file.
Organization: Rocky Mountain Internet Inc.
Date: 19 Oct 1995 23:13:01 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <466m1t$11p@natasha.rmii.com>

The PVM documentation indicates that output to stdout and stderr from spawned
sub-tasks is routed to a file named /tmp/pvml.<user_id>.

Unfortunately, what I've observed is that sometimes it works, and sometimes
it doesn't.

In certain cases, the log file is created, and all expected I/O appears
in the file. (Good show.)

In some cases, the log file is created, but doesn't have anything in it.

In some cases, the log file is not even created (!?).

I've also observed that, even when all the expected IO appears in the 
log file, messages appear in the file out of order.  For example,
I ran a (simple) test case as follows:

  task a: 
    - enrolls in pvm (pvm_mytid)
    - writes "first output from task A" to stdout (printf)
    - spawns task b (pvm_spawn)
    - writes "second message from task A" to stdout (printf)
    - exits from pvm (pvm_exit)

  task b:
    - enrolls in PVM
    - writes "hello from task B" to stdout (printf)
    - exits pvm (pvm_exit)

When a log file is created ( 30% of the time ? ), I would expect
to see "first message from task A", followed by either "hello from
task B" or "second message from task A", depending on which task got to 
their respective printf statement first.

Instead, what I find in the log file is the message from task B (the child),
FOLLOWED BY the output from task A (the parent), i.e.

  [task B] "hello from task B"
  [task A] "first message from task A"
  [task A] "second message from task A"

Sounds improbable, but that's what I see (when it works at all).
One thing that MAY have an effect on this is that task A is a TCL/TK
application, and performs the steps described above in response to
a button click.  But despite that fact, the code described above for
task A runs from beginning to end without interruption, just like any
ordinary snippet of C code in a typical C program, so I don't believe
that TCL/TK is causing the problem.

Has anyone else using PVM experienced similar difficulties ?  With or
without TCL/TK in the picture ?

Ken Lancaster
ken@wynde.com
Boulder, CO  (USA)


