next up previous contents index
Next: ZEND - normal Up: Global operational aids Previous: Global operational aids

ZPHASE - set program phase

Primarily to avoid recovery to 'next event' at the wrong moment, ZEBRA needs to know in which phase the user program is at any given moment. We distinguish three phases:

  1. during the initialization phase the user prepares the context for
  2. the operation phase of his program;
  3. during the termination phase accumulated results are output, files are closed, etc.

The user may subdivide the operation phase for his own purpose. With the change to 'termination' one may request ZPHASE to take action of tidying up the primary store, to make room for end-processing routines (like output of histograms) which may need a large amount of working memory.

CALL ZPHASE (JPH)

signals to Zebra a change of phase, preset by MZEBRA to 'initialization'.

   Normal operation phase:  JPH .GE. 0

   Termination phase:       JPH .LT. 0

      JPH = -1:  reset the working space to be of zero length,
                  but leave the store as it is;

            -2:  reset the working space,
                  wipe all user short-range divisions;

            -3:  reset, wipe, and collapse upwards all short-range user
                  divisions to be of zero length, giving their space to
                  division 1 for use by termination routines; perform
                  clean-up garbage collection in all other divisions.

The program phase is recorded on the variable NQPHAS of /ZSTATE/ and has the following significance :

   NQPHAS =   0  initialisation phase
             >0  = MAX(JPH,1):  normal operation phase
             <0  = JPH: termination phase
If the user whishes to subdivide the operation phase, he can pick up the current state from this variable.

ZPHASE prints a log message at level --1 for major phase changes, and at level 2 for minor changes.


Janne Saarela
Mon May 15 08:34:47 METDST 1995