7.3 psb_exit — Exit from PSBLAS parallel environment

call psb_exit(ctxt)
call psb_exit(ctxt,close)

This subroutine exits from the PSBLAS parallel virtual machine.

On Entry
the communication context identifying the virtual parallel machine.
Scope: global.
Type: required.
Intent: in.
Specified as: an integer variable.
Whether to close all data structures related to the virtual parallel machine, besides those associated with ctxt.
Scope: global.
Type: optional.
Intent: in.
Specified as: a logical variable, default value: true.


  1. This routine may be called even if a previous call to psb_info has returned with iam = -1; indeed, it it is the only routine that may be called with argument ctxt in this situation.
  2. A call to this routine with close=.true. implies a call to MPI_Finalize, after which no parallel routine may be called.
  3. If the user whishes to use multiple communication contexts in the same program, or to enter and exit multiple times into the parallel environment, this routine may be called to selectively close the contexts with close=.false., while on the last call it should be called with close=.true. to shutdown in a clean way the entire parallel environment.