Process creation and exit



next up previous
Next: Generic message passing Up: EASYPVM in more Previous: EASYPVM in more

Process creation and exit

The underlying logical processor topology in EASYPVM is a 3D-torus found also in the Cray T3D architecture. The so called nearest neighbour -functions and rank indexing of the NODE-processes guarantee flexible access of any NODE-process in a logical computational cluster.

EASYPVM is capable for HOST-NODE and NODE-only (SPMD or non-SPMD) approaches. A single HOST can be a user written program or so called pvmserver, a generic HOST-program that automatically drives and terminates the NODE-programs. Furthermore, a user written HOST-program can operate simultaneously with several clusters of NODE-programs which need not to be aware of each others.

One weakness in the pure PVM is a process creation. Every time a HOST process creates one or several NODE-processes, nearly all of the following steps must be repeated:

  1. Get my PVM task id via XXXmytid() -call.
    XXX refers to pvmf in Fortran or pvm_ in C/C++ -languages.
  2. Get my PVM parent process id from the XXXparent() -call
  3. Call XXXspawn(...) to create the NODE processes
  4. Multicast task ids of the NODE processes to every NODE that were just created so that every NODE knows about its siblings

This can be expressed in EASYPVM by a simple subroutine call and providing so called NODE Definition File (ndffile) for the HOST process:

  character*(*) ndffile
  CALL createproc(ndffile)

Alternatively an SPMD-model can be adopted. In this case the HOST calls loadproc() with two parameters: NODE-program executable name and how many copies of the NODE should be initiated.

In the NODE -side the repeated steps are usually:

  1. Get my PVM task id via XXXmytid() call
  2. Get my PVM parent process id from XXXparent()
  3. Receive task ids of the sibling NODE processes

These can be hidden by the following call:

  CALL attachproc(me,nproc)

This connects the NODE-programs to the PVM-complex and all sibling-related information are made available to them. After the call, the parameters me and nproc contain the rank of the process (..nproc-1) and how many NODE-processes actually form a computational cluster.

Thus these simple looking function calls hide all the handshaking details from the programmer, who is only responsible for creating the appropriate ndffile just before starting his application. An ndffile contains typically information about logical 3D-torus dimensions, NODE-executable names and parameter list and on which computers NODEs should be initiated.

For leaving the PVM-complex, EASYPVM offers routine detachproc(). This notifies automatically the HOST-process so that the HOST can decrement its counter of the still active NODE-processes. If detachproc() was not called by the user, then EASYPVM-library takes care of this upon process' exit.

detachproc() only leaves the PVM-complex, not exits the process. If program needs to be terminated explicitly, for example, because of some abnormal operation, EASYPVM has another routine available: killproc(procno). This terminates any process that is a member in a computational cluster; also itself.

Additional features to manage graceful exit and shutdown of any pending PVM-daemons, are implemented via signal handlers in EASYPVM-library and through the system level command pvmclean. Both of them guarantee that no processes will remain hanging after abnormal situations. The former one will caught any interrupt signals issued from the keyboard (like CTRL-C) or other abnormal situations like segmentation violations. The pvmclean does a post-cleaning of any pending processes by killing the PVM-daemons and running down the PVM-complex gracefully.



next up previous
Next: Generic message passing Up: EASYPVM in more Previous: EASYPVM in more



Sami Saarinen
Thu Nov 3 14:56:09 EET 1994