7.9 psb_bcast — Broadcast data

call psb_bcast(ctxt, dat [, root, mode, request])

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

Type:
Synchronous.
On Entry
ctxt
the communication context identifying the virtual parallel machine.
Scope: global.
Type: required.
Intent: in.
Specified as: an integer variable.
dat
On the root process, the data to be broadcast.
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, or a character or logical variable, which may be a scalar or rank 1 array.  Type, kind, rank and size must agree on all processes.
root
Root process holding data to be broadcast.
Scope: global.
Type: optional.
Intent: in.
Specified as: an integer value 0 <= root <= np - 1, default 0  
mode
Whether the call is started in non-blocking mode and completed later, or is executed synchronously.
Scope: global.
Type: optional.
Intent: in.
Specified as: an integer value. The action to be taken is determined by its bit fields, which can be set with bitwise OR. Basic action values are psb_collective_start_, psb_collective_end_. Default: both fields are selected (i.e. require synchronous completion).
request
A request variable to check for operation completion.
Scope: local.
Type: optional.
Intent: inout.
If mode does not specify synchronous completion, then this variable must be present.

On Return
dat
On all processes other than root, the broadcasted data.
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, or a character or logical scalar.  Type, kind, rank and size must agree on all processes.
request
A request variable to check for operation completion.
Scope: local.
Type: optional.
Intent: inout.
If mode does not specify synchronous completion, then this variable must be present.

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 mode argument can be built with the bitwise IOR() operator; in the following example, the argument is forcing immediate completion, hence the request argument needs not be specified:

      call psb_bcast(ctxt,dat,mode=ior(psb_collective_start_,psb_collective_end_))
    

  3. When splitting the operation in two calls, the dat argument must not be accessed between calls:

      call psb_bcast(ctxt,dat,mode=psb_collective_start_,request=bcast_request)
      ....... ! Do not access dat
      call psb_bcast(ctxt,dat,mode=psb_collective_end_, request=bcast_request)