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 reduced
  • opcode: reduce operation code, see gpucomm_reduce_ops
  • root: rank in comm which will collect result
  • comm: 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 reduced
  • dest: array to collect reduce operation result
  • opcode: reduce operation code, see gpucomm_reduce_ops
  • root: rank in comm which will collect result
  • comm: 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 in dest on each rank of comm.

Note
Must be called separately for each rank in comm.
Return
error code or GA_NO_ERROR if success
Parameters
  • src: array to be reduced
  • dest: array to collect reduce operation result
  • opcode: reduce operation code, see gpucomm_reduce_ops
  • comm: 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 using opcode operation and leaves reduced result scattered over dest in the user-defined rank order in comm.

Note
Must be called separately for each rank in comm.
Return
error code or GA_NO_ERROR if success
Parameters
  • src: array to be reduced
  • dest: array to collect reduce operation scattered result
  • opcode: reduce operation code, see gpucomm_reduce_ops
  • comm: 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 in comm.

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 receive
  • root: rank in comm which broadcasts its array
  • comm: 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 in comm.

Note
Must be called separately for each rank in comm.
Return
error code or GA_NO_ERROR if success
Parameters
  • src: array to be gathered
  • dest: array to receive all gathered arrays from ranks in comm
  • comm: gpu communicator