Newsgroups: comp.parallel.pvm
From: zelek@McRCIM.McGill.EDU (John S. Zelek)
Subject: starting pvm from the application rather than the console
Keywords: pvm console start
Organization: McGill Research Centre for Intelligent Machines
Date: 2 Mar 1995 09:41:41 -0500
Message-ID: <3j4lf5$dn2@Thunder.McRCIM.McGill.EDU>


The following is the set of responses I got from the question
I posted a couple of days ago.
The question was with respect to how to start pvm (pvmd) from an application as 
opposed to the console.

From don@neuronet.pitt.edu Wed Mar  1 15:00:04 1995
Received: from server1.neuronet.pitt.edu by Lightning.McRCIM.McGill.EDU (8.6.9) with ESMTP
	id <199503011500.KAA27532@Lightning.McRCIM.McGill.EDU>; Wed, 1 Mar 1995 10:00:01 -0500
Message-Id: <199503011500.KAA27532@Lightning.McRCIM.McGill.EDU>
Received: from hp71533d.neuronet.pitt.edu (hp71550n.neuronet.pitt.edu) by server1.neuronet.pitt.edu with SMTP
	(1.37.109.14/16.2) id AA121830173; Wed, 1 Mar 1995 10:02:53 -0500
Received: from localhost by hp71533d.neuronet.pitt.edu with SMTP
	(1.37.109.4/16.2) id AA03134; Wed, 1 Mar 95 09:57:29 -0500
From: Donald Krieger <don@neuronet.pitt.edu>
Date: Wed, 01 Mar 95 09:57:29 -500
Sender: don@neuronet.pitt.edu
To: zelek@McRCIM.McGill.EDU
Mime-Version: 1.0
X-Mailer: Mozilla/1.0N (X11; HP-UX A.09.01 9000/715)
Content-Type: text/plain;  charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: pvm auto startup
X-Url: news:3j20li$4ae@Thunder.McRCIM.McGill.EDU
Status: RO

John,

	Here is a csh script which could be
executed from within a program, for example
using system(3f).  The script creates a .pvmrc
file in the place where the pvm console will
look given the setting of PVM_ROOT and then
runs the pvm console.  Notice that the last
line of the .pvmrc file is:
		quit

	There are some extra lines in this
script which are probably not necessary but
hopefully it will get you started.  Good luck.

			Don Krieger
			(412)692-5093


From casas@cse.ogi.edu Wed Mar  1 17:18:47 1995
Received: from church.cse.ogi.edu by Lightning.McRCIM.McGill.EDU (8.6.9) with SMTP
	id <199503011718.MAA02668@Lightning.McRCIM.McGill.EDU>; Wed, 1 Mar 1995 12:18:38 -0500
Received: by church.cse.ogi.edu (Smail3.1.29.1 #2)
	id m0rjs2o-000L4YC; Wed, 1 Mar 95 09:18 PST
Message-Id: <m0rjs2o-000L4YC@church.cse.ogi.edu>
Date: Wed, 1 Mar 95 09:18 PST
From: casas@cse.ogi.edu (Jeremy Casas)
To: zelek@McRCIM.McGill.EDU
Subject: Re: pvm automatic startup?
Newsgroups: comp.parallel.pvm
In-Reply-To: <3j20li$4ae@Thunder.McRCIM.McGill.EDU>
Organization: Oregon Grad. Inst. Computer Science and Eng., Beaverton
Cc: 
Status: RO

In article <3j20li$4ae@Thunder.McRCIM.McGill.EDU> you write:
>
>Is there any way for a process to start pvm if pvm is not
>running at the present time?  I looked through the set of pvm 
>routines and there does not appear to be any predicates that allow
>this.  Presently, I start pvm through the console mode.
>Thanks in advance.
>John Zelek
>-- 
>John S. Zelek   Centre for Intelligent Machines (CIM)
>                McGill University, Montreal      tel: (514)-483-0780
>e-mail: zelek@mcrcim.mcgill.edu
>www:    http://www.cim.mcgill.ca/~zelek/Home.html

Use the pvm_start_pvmd() library call (and yes, it's not documented).
That's what the console uses.

j


From don@neuronet.pitt.edu Wed Mar  1 17:56:30 1995
Received: from server1.neuronet.pitt.edu by Lightning.McRCIM.McGill.EDU (8.6.9) with ESMTP
	id <199503011756.MAA04055@Lightning.McRCIM.McGill.EDU>; Wed, 1 Mar 1995 12:56:29 -0500
From: <don@neuronet.pitt.edu>
Message-Id: <199503011756.MAA04055@Lightning.McRCIM.McGill.EDU>
Received: from hp71533d.neuronet.pitt.edu (hp71550n.neuronet.pitt.edu) by server1.neuronet.pitt.edu with SMTP
	(1.37.109.14/16.2) id AA123970762; Wed, 1 Mar 1995 12:59:22 -0500
Received: by hp71533d.neuronet.pitt.edu
	(1.37.109.4/16.2) id AA00369; Wed, 1 Mar 95 12:53:58 -0500
Date: Wed, 1 Mar 95 12:53:58 -0500
Apparently-To: zelek@mcrcim.mcgill.edu
Status: RO

John,

	Sorry about that.  Here is the script:

#! /bin/csh
#
#       This is a script which add host $argv to the local
#  virtual machine.  It goes through the following steps:
#       create /tmp/.pvmrc on the local machine
#       add remote machine from console on local machine
#       start pvm_isd on the remote machine
#
#       Key environmental variables:
#
  setenv PVM_ROOT /tmp/pvm3
  setenv PVM_DPATH /tmp/pvm3/lib/pvmd
#
#          if remote system name is NULL
#
  if ($argv == "") then
    echo "start again and enter remote hostname"
    exit
  endif
#          add base machine
#
#          create /tmp/.pvmrc on the local machine
#
  echo "add $argv" > /tmp/.pvmrc
  echo "spawn -1-$argv pvm_isd" >> /tmp/.pvmrc
  echo "quit" >> /tmp/.pvmrc
#
#          add machine from console on local machine
#
  setenv HOME /tmp/
  /tmp/pvm3/lib/HPPA/pvm >& /dev/null
  rm /tmp/.pvmrc >& /dev/null
#


From moorej@chert.CS.ORST.EDU Wed Mar  1 18:05:17 1995
Received: from research.CS.ORST.EDU by Lightning.McRCIM.McGill.EDU (8.6.9) with SMTP
	id <199503011805.NAA04465@Lightning.McRCIM.McGill.EDU>; Wed, 1 Mar 1995 13:05:14 -0500
Received: from demion.CS.ORST.EDU by research.CS.ORST.EDU (4.1/1.30)
	id AA15897; Wed, 1 Mar 95 10:02:08 PST
From: moorej@chert.CS.ORST.EDU (Jason Moore)
Received: by demion.CS.ORST.EDU (1.38.193.4/CS-Client)
	id AA02360; Wed, 1 Mar 1995 10:06:10 -0800
Date: Wed, 1 Mar 1995 10:06:10 -0800
Message-Id: <9503011806.AA02360@demion.CS.ORST.EDU>
To: zelek@mcrcim.mcgill.edu (John S. Zelek)
Reply-To: moorej@chert.CS.ORST.EDU
Subject: Re: pvm automatic startup?
Status: RO


Hi.  

Try this at the beginning of the program.
#include <unistd.h>

system("pvmd3 2> /dev/null &");


If the daemon is already running, the error message goes to
/dev/null and no harm is done.  If not, it starts up for you before you
make any pvm calls.  I use this with success.

Jason

In article <3j20li$4ae@Thunder.McRCIM.McGill.EDU>, you write:
|> 
|> Is there any way for a process to start pvm if pvm is not
|> running at the present time?  I looked through the set of pvm 
|> routines and there does not appear to be any predicates that allow
|> this.  Presently, I start pvm through the console mode.
|> Thanks in advance.
|> John Zelek
|> -- 
|> John S. Zelek   Centre for Intelligent Machines (CIM)
|>                 McGill University, Montreal      tel: (514)-483-0780
|> e-mail: zelek@mcrcim.mcgill.edu
|> www:    http://www.cim.mcgill.ca/~zelek/Home.html

-- 
--------
Jason Moore                       Internet:  moorej@research.cs.orst.edu
Department of Computer Science    Bell-net:  (503) 737-4052
Oregon State University
"Anything worth doing is worth doing with a smile"



From bijal@nuc.berkeley.edu Wed Mar  1 22:19:48 1995
Received: from fusion.Nuc.Berkeley.EDU by Lightning.McRCIM.McGill.EDU (8.6.9) with ESMTP
	id <199503012219.RAA13060@Lightning.McRCIM.McGill.EDU>; Wed, 1 Mar 1995 17:19:46 -0500
Received: (bijal@localhost) by fusion.Nuc.Berkeley.EDU (8.6.9/8.6.5) id OAA06643; Wed, 1 Mar 1995 14:19:17 -0800
Date: Wed, 1 Mar 1995 14:19:17 -0800
From: "Bijal C. Modi" <bijal@nuc.berkeley.edu>
Message-Id: <199503012219.OAA06643@fusion.Nuc.Berkeley.EDU>
To: zelek@McRCIM.McGill.EDU
Subject: Re: pvm automatic startup?
Newsgroups: comp.parallel.pvm
In-Reply-To: <3j20li$4ae@thunder.mcrcim.mcgill.edu>
Organization: University of California
Cc: 
Status: RO


Hi,

 How about pvm_start_pvmd?

======

NAME
     pvm_start_pvmd - Starts new PVM daemon.

SYNOPSIS
     C    int info = pvm_start_pvmd( int argc, char  **argv,  int
     block )

     Fortran   NOT AVAILABLE

PARAMETERS
     argc    Number of arguments in argv.

     argv    An array of arguments to the executable.

     block   Integer specifying whether to block until startup of
             all hosts complete or return immediately.

     info    Integer returning the error code.

======

-Bijal.
 bijal@fusion.berkeley.edu


From varadhan@cs.utk.edu Wed Mar  1 22:50:20 1995
Received: from straw.cs.utk.edu by Lightning.McRCIM.McGill.EDU (8.6.9) with ESMTP
	id <199503012249.RAA14020@Lightning.McRCIM.McGill.EDU>; Wed, 1 Mar 1995 17:49:56 -0500
From: <varadhan@cs.utk.edu>
Received:  by straw.cs.utk.edu (cf v2.11c-UTK)
          id RAA10061; Wed, 1 Mar 1995 17:49:58 -0500
Date: Wed, 1 Mar 1995 17:49:58 -0500
Message-Id: <199503012249.RAA10061@straw.cs.utk.edu>
To: zelek@McRCIM.McGill.EDU
Subject: Re: pvm automatic startup?
Newsgroups: comp.parallel.pvm
In-Reply-To: <3j20li$4ae@Thunder.McRCIM.McGill.EDU>
Organization: CS Department, University of Tennessee, Knoxville
Cc: 
Status: RO

In article <3j20li$4ae@Thunder.McRCIM.McGill.EDU> you write:
>
>Is there any way for a process to start pvm if pvm is not
>running at the present time?  I looked through the set of pvm 
>routines and there does not appear to be any predicates that allow
>this.  Presently, I start pvm through the console mode.
>Thanks in advance.
>John Zelek
>-- 


Maybe you already have the answer to this, but there are multiple
ways of doing this...

one way that works for me is to have this in a script file:

# START UP PVM
pvm hostfile < /dev/null

other ways: check out pvm_start_pvmd() (not listed in user's guide but
there is an on-line man page), or to start the pvmd (which should
not give console, I am told)

Cheers
Sowmini



From meta@calpar.cnuce.cnr.it Thu Mar  2 14:25:43 1995
Received: from calpar.cnuce.cnr.it by Lightning.McRCIM.McGill.EDU (8.6.9) with SMTP
	id <199503021425.JAA28840@Lightning.McRCIM.McGill.EDU>; Thu, 2 Mar 1995 09:25:33 -0500
Message-Id: <199503021425.JAA28840@Lightning.McRCIM.McGill.EDU>
Received: by calpar.cnuce.cnr.it
	(1.37.109.4/16.2) id AA09874; Thu, 2 Mar 95 15:24:17 +0100
From: Marcello-Gianluca <meta@calpar.cnuce.cnr.it>
Subject: Re: How To start PVM
To: zelek@mcrcim.mcgill.edu
Date: Thu, 2 Mar 95 15:24:15 MET
Mailer: Elm [revision: 70.85]
Status: RO

zelek@McRCIM.McGill.EDU (John S. Zelek) wrote:
>
> 
> Is there any way for a process to start pvm if pvm is not
> running at the present time?  I looked through the set of pvm 
> routines and there does not appear to be any predicates that allow
> this.  Presently, I start pvm through the console mode.
> Thanks in advance.
> John Zelek
> -- 
> John S. Zelek   Centre for Intelligent Machines (CIM)
>                 McGill University, Montreal      tel: (514)-483-0780
> e-mail: zelek@mcrcim.mcgill.edu
> www:    http://www.cim.mcgill.ca/~zelek/Home.html


Hi,
we had the same problem and discovered that pvm console uses
the libpvm function pvm_start_pvmd.

It is not documented neither in PVM 3 USERS' GUIDE nor in
PVM 3 BOOK, but you can try online man pages (%>man pvm_start_pvmd).

Hope this helps.
					bye,
				Marcello & Gianluca
				

P.S. We replied by e-mail because our news server got mad.

--
   /| /|+-----+--|\	Gianluca Faieta & Marcello Formica
  / |/ ||__   |  | \	Tesi Metacomputer
 /     ||     |  |__\
/      |+---  |  |   \	E-mail: meta@calpar.cnuce.cnr.it

-- 
John S. Zelek   Centre for Intelligent Machines (CIM)
                McGill University, Montreal      tel: (514)-483-0780
e-mail: zelek@mcrcim.mcgill.edu
www:    http://www.cim.mcgill.ca/~zelek/Home.html

