Newsgroups: comp.parallel.pvm
From: Jonathan King <nobody@nowhere.else>
Subject: Re: writing to the log
Organization: Hewlett-Packard Co.
Date: Mon, 16 Sep 1996 08:26:09 -0700
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <323D7191.3434@nowhere.else>

Rob Torop wrote:
> 
> I have a few questions about the log file (/tmp/pvml.<uid> by
> default).
> 
> 1) How can I tell pvm to send output to a different file?  For
>    example, suppose I want the output of all children to go to
>    ~me/tmp/blah.log.

You can't change the name of the log file.  See below.

> 2) How can I write directly to the log from a program?  For example, I
>    have a master program that spawns multiple slaves.  Each writes to
>    stdout which ends up in the log.  How can I get the master to write
>    to the log?
> 
> I know that "catchout" has something to do with it, but I can't figure
> it out.  Any advice would be appreciated.

The function pvm_catchout redirects all child task output to the parents
stdout.  By using freopen to redirect stdout, and then using
pvm_catchout to redirect child tasks to the parent's stdout, you can
effectively change the file output is written to (and get the parent to
write there as well).

Good luck.
Jon

-- 
#########################################################
# Jonathan B. King       kingjo at research.cs.orst.edu #
# M.S. Student in C.S.   jking at cv.hp.com             #
#                                                       # 
#  Replying to this address will not work.  Please use  #
#    one of the above email addresses to contact me.    #
#                                                       # 
#               My opinions are my own.                 #
#########################################################

