next up previous contents
Next: psb_max Global Up: Parallel environment routines Previous: psb_bcast Broadcast   Contents

psb_sum -- Global sum

call psb_sum(icontxt, dat, root)

This subroutine implements a sum reduction operation based on the underlying communication library.

Type:
Synchronous.
On Entry
icontxt
the communication context identifying the virtual parallel machine.
Scope: global.
Type: required.
Intent: in.
Specified as: an integer variable.
dat
The local contribution to the global sum.
Scope: global.
Type: required.
Intent: inout.
Specified as: an integer, real or complex variable, which may be a scalar, or a rank 1 or 2 array. Type, kind, rank and size must agree on all processes.
root
Process to hold the final sum, or $-1$ to make it available on all processes.
Scope: global.
Type: optional.
Intent: in.
Specified as: an integer value $-1<= root <= np-1$, default -1.

On Return
dat
On destination process(es), the result of the sum operation.
Scope: global.
Type: required.
Intent: inout.
Specified as: an integer, real or complex variable, which may be a scalar, or a rank 1 or 2 array.
Type, kind, rank and size must agree on all processes.

Notes

  1. The dat argument is both input and output, and its value may be changed even on processes different from the final result destination.
  2. The dat argument may also be a long integer scalar.


next up previous contents
Next: psb_max Global Up: Parallel environment routines Previous: psb_bcast Broadcast   Contents