Newsgroups: comp.parallel.pvm
From: aspoon@ee.ualberta.ca (Alvin Poon)
Subject: help with pvm_notify
Organization: University of Alberta, Edmonton, Canada
Date: 18 Mar 1996 15:58:11 GMT
Message-ID: <4ik16j$ha8@pulp.ucs.ualberta.ca>

Hi,

I have a problem with pvm_notify.  Can anyone help me out with it?

Right after I spawn my child processes, I call pvm_notify as follows:

  ...
  pvm_config( &nhost, &narch, &hostinfo );
  ...
  dtids = (int *)calloc( nhost, sizeof(int) );
  for( num = 0; num < nhost; num++ )
    dtids[num] = hostinfo[num].hi_tid;
  ...
  pvm_notify( PvmTaskExit, MSG_TASKEXIT, nproc, tids );
  pvm_notify( PvmHostDelete, MSG_DELHOST, nhost, dtids );
  pvm_notify( PvmHostAdd, MSG_ADDHOST, -1, NULL );
  free( dtids );

and when I process the incoming messages:

  switch( msgtag )
  {
    ...
    case MSG_ADDHOST:
      fprintf( stderr, "*** AddHost ***\n" );
      break;
    case MSG_DELHOST:
      fprintf( stderr, "*** DeleteHost ***\n" );
      break;
    case MSG_TASKEXIT:
      fprintf( stderr, "*** TaskExit ***\n" );
      break;
  }
  
but nothing showed up when I deleted a host through the PVM console.
I even killed a child process, (which captures the signal and calls
pvm_exit()) but still, nothing shows.  Adding a host results in the
same thing, nothing.

The question is: how can I get this to work?  Also, is it safe to
free my list of daemon TIDs before the program exits, or does freeing
the structure cancels the pvm_notify calls related to the daemon list?

Alvin
--
|| | |  |  |   |   |    |    |     |    |    |   |   |  |  | | ||
|| Alvin S. Poon   |    |    |     |     aspoon@EE.UAlberta.CA ||
|| | |  |  |   |   |    |    |     | poona@GPU.SRV.UAlberta.CA ||
<a href="http://Nyquist.EE.UAlberta.CA/~aspoon/">My Home Page</a>

