File collectives.h¶
Functions
-
int
GpuArray_reduce_from
(const GpuArray *src, int opcode, int root, gpucomm *comm)¶ Reduce collective operation for non root participant ranks in a communicator world.
- Note
Root rank of reduce operation must call GpuArray_reduce().
- Note
Must be called separately for each rank in
comm
, except root rank.- Return
error code or GA_NO_ERROR if success
- Parameters
src
: array to be reducedopcode
: reduce operation code, see gpucomm_reduce_opsroot
: rank incomm
which will collect resultcomm
: gpu communicator
-
int
GpuArray_reduce
(const GpuArray *src, GpuArray *dest, int opcode, int root, gpucomm *comm)¶ Reduce collective operation for ranks in a communicator world.
- Note
Can be used by root and non root ranks alike.
- Note
Non root ranks can call this, using a NULL
dest
.- Note
Must be called separately for each rank in
comm
(non root can call GpuArray_reduce_from() instead).- Return
error code or GA_NO_ERROR if success
- Parameters
src
: array to be reduceddest
: array to collect reduce operation resultopcode
: reduce operation code, see gpucomm_reduce_opsroot
: rank incomm
which will collect resultcomm
: gpu communicator
-
int
GpuArray_all_reduce
(const GpuArray *src, GpuArray *dest, int opcode, gpucomm *comm)¶ AllReduce collective operation for ranks in a communicator world.
Reduces
src
using op operation and leaves identical copies of result indest
on each rank ofcomm
.- Note
Must be called separately for each rank in
comm
.- Return
error code or GA_NO_ERROR if success
- Parameters
src
: array to be reduceddest
: array to collect reduce operation resultopcode
: reduce operation code, see gpucomm_reduce_opscomm
: gpu communicator
-
int
GpuArray_reduce_scatter
(const GpuArray *src, GpuArray *dest, int opcode, gpucomm *comm)¶ ReduceScatter collective operation for ranks in a communicator world.
Reduces data in
src
usingopcode
operation and leaves reduced result scattered overdest
in the user-defined rank order incomm
.- Note
Must be called separately for each rank in
comm
.- Return
error code or GA_NO_ERROR if success
- Parameters
src
: array to be reduceddest
: array to collect reduce operation scattered resultopcode
: reduce operation code, see gpucomm_reduce_opscomm
: gpu communicator
-
int
GpuArray_broadcast
(GpuArray *array, int root, gpucomm *comm)¶ Broadcast collective operation for ranks in a communicator world.
Copies
array
to all ranks incomm
.- Note
Must be called separately for each rank in
comm
.- Return
error code or GA_NO_ERROR if success
- Parameters
array
: array to be broadcasted, if root rank, else to receiveroot
: rank incomm
which broadcasts its arraycomm
: gpu communicator
-
int
GpuArray_all_gather
(const GpuArray *src, GpuArray *dest, gpucomm *comm)¶ AllGather collective operation for ranks in a communicator world.
Each rank receives all
src
arrays from every rank in the user-defined rank order incomm
.- Note
Must be called separately for each rank in
comm
.- Return
error code or GA_NO_ERROR if success
- Parameters
src
: array to be gathereddest
: array to receive all gathered arrays from ranks incomm
comm
: gpu communicator