Newsgroups: comp.parallel.pvm
From: oreymann@gentiane.ens-lyon.fr (Olivier Reymann)
Subject: Re: How to recognize the console process
Organization: Ecole Normale Superieure de Lyon, France
Date: 25 Apr 1996 17:53:40 GMT
Message-ID: <OREYMANN.96Apr25195340@gentiane.ens-lyon.fr>

In article <4lnvbe$8fe@utrhcs.cs.utwente.nl> scheer@cs.utwente.nl (Rienk van
der Scheer) writes:

> From: scheer@cs.utwente.nl (Rienk van der Scheer)
> Newsgroups: comp.parallel.pvm
> Date: 25 Apr 1996 13:39:58 GMT
> Organization: University of Twente, Dept. of Computer Science
> 
> I'm writing an SPMD program. The first process starts a number
> of copies of itself. I would like to have the possibility to choose
> between starting the first process from the Unix Shell or from
> the PVM console.
> To detect whether a process is the first one, I use a combination
> of the parents TID and it's executable name (reported by pvm_tasks).
> It works fine when started from the PVM console, but not from
> the Unix Shell, because the executable name of the first
> process (started from the Unix Shell) is not set.
> 
> Is there any way to detect whether a process' parent is the PVM console
> or process started earlier from the Unix Shell?
> 
> Any suggestions will be appreciated.
> 

When you start the executable from an Unix shell, you just have to test if
pvm_parent() returns PvmNoParent. This means that it is the parent task.


That's all.


	Olivier
-- 
                                             
           |~~~|                              
           |~~~|D    Kil Kenny
          C|. :|D       is
           |: .|D  good for you !
           |___|
     \\|//  ||
     |^ _|  ||                       Ecole Normale Superieure
    ( -_+ ) //                       LIP (URA 1398 du CNRS)
   /_\ O / /      __   __    __      Bureau 316
   || \_/ /      |  | |  |  |  |     46, Allee d'Italie
   ||____/       |  | |  |  |  |     69364 Lyon - FRANCE
---`----- \-- ---|  |-|  |--|  |--   tel : (33) 72 72 83 52
          v      |==| |==|  |==|     fax : (33) 72 72 80 80
                                     http://www.ens-lyon.fr/~oreymann

