Newsgroups: comp.parallel.pvm
From: Graham Edward Fagg <sssfagg@reading.ac.uk>
Subject: Re: group server again
Organization: University of Reading, U.K.
Date: Thu, 12 Oct 1995 13:38:11 +0100
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <Pine.SOL.3.91.951012132314.10067D-100000@suma3.reading.ac.uk>

On 11 Oct 1995, Philip Papadopoulos wrote:
> Sure. From the console just do
> pvm> reset               # make sure nothing is running
> pvm> spawn -<your host name here> pvmgs

> That will put the group server where you want it. You can use
> pvm_spawn("pvmgs",....), as suggested previously, from your code.
> 
> Each task must look up the tid of the group server on the first
> group call. If it finds it, it records the tid for future 
> calls. If it doesn't find it, it starts a new server.
> -Phil

If you want to completely restart the server on a particular machine from 
your code you could use the following fragment:

{
  int i,j;
  int gs_tid, reg, stat;
  int my_tid;

  my_tid = pvm_mytid(); /* join PVM */
  reg = pvm_lookup ("pvmgs", 0, &gs_tid);
  if (reg >=0 ) { /* then a group server has existed or may still exist */
    /* get the status of this process to see if it still exists */
    stat = pvm_pstat (gs_tid);
    if (stat == PvmOk) pvm_kill (gs_tid); /* kill this one */
  }
  /* free to startup a new server */
  pvm_spawn("pvmgs", 0, PvmTaskHost, "lynx", 1, &gs_tid);

  printf("new group server started with id %x\n", gs_tid);

  /* rest of code.... */

}

When killing the server off make sure that this happens only once before 
any process attempts to use the group sevices. If the reason for location 
being critical is overall group speed then think about using the new
pvm_freegroup(3PVM) call. Which once the group is formed caches every 
thing so it does matter how slow the group server is (with its non-cached 
minimum of around 4msec overhead per group operation).

Graham.
=============================================================================
Graham E. Fagg    | ***** Cluster Computing Lab. *****  |  please e-mail me
Computer Science  | Software Engineering Subject Group  |  g.e.fagg@rdg.ac.uk
Reading Uni, UK.  | *** Systems Architecture Group ***  |  sssfagg@rdg.ac.uk
01734-875123 7626 |http://www.cs.reading.ac.uk/people/gef/ PVM/MPI/LINDA/VMD
=============================================================================


