The synchronization workspace (pSync) should be of size
_SHMEM_REDUCE_SYNC_SIZE, and each element should be initialized
to _SHMEM_SYNC_VALUE before first use.
The size of the data workspace buffer(pWrk) must be at least the
maximum of _SHMEM_REDUCE_MIN_WRKDATA_SIZE and nreduce/2
+ 1. The workspace buffer does not need to be initialized before first
use. shmem_X_Y_to_all() will automatically reset
the elements of pWrk back to
_SHMEM_REDUCE_MIN_WRKDATA_SIZE upon completion, so the same
synchronization workspace can be immediately reused.
The source and target buffers must be left intact until all
of the nodes are done referencing them. This can be implemented by
calling a barrier function after calling a
shmem_X_Y_to_all() function.
The example programs `collc.c' and `coll.f' in the HPVM 1.0 release show how to perform this operation.
Go to the first, previous, next, last section, table of contents.