Allgather
event CCL_API allgather (const void *send_buf, void *recv_buf, size_t send_count, datatype dtype, const communicator &comm, const stream &stream, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
Allgather is a collective communication operation that collects send_count elements from all the ranks within the communicator and places the results into recv_buf, in such a way that data from rank i can be found at offset rank i * send_count. The resulting data in the output recv_buf buffer is the same for each rank.
- Parameters
-
send_buf – the buffer with send_count elements of dtype that stores local data to be gathered
recv_buf – [out] the buffer to store gathered result of dtype, must be large enough to hold values from all ranks, i.e. size should be equal to dtype size in bytes * send_count
send_count – the number of elements of type dtype to be sent to or to received from each rank
dtype – the datatype of elements in send_buf and recv_buf
comm – the communicator for which the operation will be performed
stream – abstraction over a device queue constructed via ccl::create_stream
attr – optional attributes to customize operation
deps – an optional vector of the events that the operation should depend on
- Returns
-
ccl::event an object to track the progress of the operation
event CCL_API allgather (const void *send_buf, void *recv_buf, size_t send_count, datatype dtype, const communicator &comm, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
event CCL_API allgather (const void *send_buf, const vector_class< void * > &recv_bufs, size_t send_count, datatype dtype, const communicator &comm, const stream &stream, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
send_buf – the buffer of dtype with send_count elements that stores local data to be gathered
recv_bufs – [out] array of buffers to store gathered result, one buffer per rank; each buffer must be large enough to keep send_count elements of dtype size
event CCL_API allgather (const void *send_buf, const vector_class< void * > &recv_bufs, size_t send_count, datatype dtype, const communicator &comm, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class BufferType, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type> event CCL_API allgather (const BufferType *send_buf, BufferType *recv_buf, size_t send_count, const communicator &comm, const stream &stream, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Type-safe version.
- Parameters
-
send_buf – the buffer with send_count elements of BufferType that stores local data to be gathered
recv_buf – [out] the buffer to store gathered result of BufferType. It must be large enough to hold values from all ranks, i.e. size should be equal to BufferType size in bytes * send_count
template<class BufferType, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type> event CCL_API allgather (const BufferType *send_buf, BufferType *recv_buf, size_t send_count, const communicator &comm, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Type-safe version.
template<class BufferType, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type> event CCL_API allgather (const BufferType *send_buf, vector_class< BufferType * > &recv_bufs, size_t send_count, const communicator &comm, const stream &stream, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Type-safe version.
- Parameters
-
send_buf – the buffer with send_count elements of BufferType that stores local data to be gathered
recv_bufs – [out] array of buffers to store gathered result, one buffer per rank; each buffer must be large enough to keep send_count elements of BufferType size
template<class BufferType, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type> event CCL_API allgather (const BufferType *send_buf, vector_class< BufferType * > &recv_bufs, size_t send_count, const communicator &comm, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Type-safe version.
template<class BufferObjectType, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type> event CCL_API allgather (const BufferObjectType &send_buf, BufferObjectType &recv_buf, size_t send_count, const communicator &comm, const stream &stream, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Type-safe version.
- Parameters
-
send_buf – the buffer of BufferObjectType with send_count elements that stores local data to be gathered
recv_buf – [out] the buffer to store gathered result of BufferObjectType. It must be large enough to hold values from all ranks, i.e. size should be equal to BufferObjectType size in bytes * send_count
template<class BufferObjectType, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type> event CCL_API allgather (const BufferObjectType &send_buf, BufferObjectType &recv_buf, size_t send_count, const communicator &comm, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Type-safe version.
template<class BufferObjectType, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type> event CCL_API allgather (const BufferObjectType &send_buf, vector_class< reference_wrapper_class< BufferObjectType > > &recv_bufs, size_t send_count, const communicator &comm, const stream &stream, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Type-safe version.
- Parameters
-
send_buf – the buffer of BufferObjectType with send_count elements that stores local data to be gathered
recv_bufs – [out] array of buffers to store gathered result, one buffer per rank; each buffer must be large enough to keep send_count elements of BufferObjectType size
template<class BufferObjectType, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type> event CCL_API allgather (const BufferObjectType &send_buf, vector_class< reference_wrapper_class< BufferObjectType > > &recv_bufs, size_t send_count, const communicator &comm, const allgather_attr &attr=default_allgather_attr, const vector_class< event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Type-safe version.