Allgatherv#

event CCL_API allgatherv (const void *send_buf, size_t send_count, void *recv_buf, const vector_class< size_t > &recv_counts, datatype dtype, const communicator &comm, const stream &stream, const allgatherv_attr &attr=default_allgatherv_attr, const vector_class< event > &deps={})

Allgatherv is a collective communication operation that collects data from all the ranks within a communicator into a single buffer. Different ranks may contribute segments of different sizes. The resulting data in the output 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

  • send_count – the number of elements of type dtype in send_buf

  • 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 * sum of all values in recv_counts

  • recv_counts – array with the number of elements of type dtype to be 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 allgatherv (const void *send_buf, size_t send_count, void *recv_buf, const vector_class< size_t > &recv_counts, datatype dtype, const communicator &comm, const allgatherv_attr &attr=default_allgatherv_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 allgatherv (const void *send_buf, size_t send_count, const vector_class< void * > &recv_bufs, const vector_class< size_t > &recv_counts, datatype dtype, const communicator &comm, const stream &stream, const allgatherv_attr &attr=default_allgatherv_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.

This overloaded function takes separate receive buffer per rank.

Parameters

recv_bufs – [out] array of buffers to store gathered result, one buffer per rank; each buffer must be large enough to keep the corresponding recv_counts elements of dtype size

event CCL_API allgatherv (const void *send_buf, size_t send_count, const vector_class< void * > &recv_bufs, const vector_class< size_t > &recv_counts, datatype dtype, const communicator &comm, const allgatherv_attr &attr=default_allgatherv_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.

This overloaded function takes separate receive buffer per rank.

Parameters

recv_bufs – [out] array of buffers to store gathered result, one buffer per rank; each buffer must be large enough to keep the corresponding recv_counts elements of dtype size

template<class BufferType, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type> event CCL_API allgatherv (const BufferType *send_buf, size_t send_count, BufferType *recv_buf, const vector_class< size_t > &recv_counts, const communicator &comm, const stream &stream, const allgatherv_attr &attr=default_allgatherv_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, must be large enough to hold values from all ranks, i.e. size should be equal to BufferType size in bytes * sum of all values in recv_counts

template<class BufferType, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type> event CCL_API allgatherv (const BufferType *send_buf, size_t send_count, BufferType *recv_buf, const vector_class< size_t > &recv_counts, const communicator &comm, const allgatherv_attr &attr=default_allgatherv_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, must be large enough to hold values from all ranks, i.e. size should be equal to BufferType size in bytes * sum of all values in recv_counts

template<class BufferType, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type> event CCL_API allgatherv (const BufferType *send_buf, size_t send_count, vector_class< BufferType * > &recv_bufs, const vector_class< size_t > &recv_counts, const communicator &comm, const stream &stream, const allgatherv_attr &attr=default_allgatherv_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 the corresponding recv_counts elements of BufferType size

template<class BufferType, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type> event CCL_API allgatherv (const BufferType *send_buf, size_t send_count, vector_class< BufferType * > &recv_bufs, const vector_class< size_t > &recv_counts, const communicator &comm, const allgatherv_attr &attr=default_allgatherv_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 the corresponding recv_counts elements of BufferType size

template<class BufferObjectType, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type> event CCL_API allgatherv (const BufferObjectType &send_buf, size_t send_count, BufferObjectType &recv_buf, const vector_class< size_t > &recv_counts, const communicator &comm, const stream &stream, const allgatherv_attr &attr=default_allgatherv_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 of BufferObjectType to store gathered result, must be large enough to hold values from all ranks, i.e. size should be equal to BufferType size in bytes * sum of all values in recv_counts

template<class BufferObjectType, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type> event CCL_API allgatherv (const BufferObjectType &send_buf, size_t send_count, BufferObjectType &recv_buf, const vector_class< size_t > &recv_counts, const communicator &comm, const allgatherv_attr &attr=default_allgatherv_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 of BufferObjectType to store gathered result, must be large enough to hold values from all ranks, i.e. size should be equal to BufferType size in bytes * sum of all values in recv_counts

template<class BufferObjectType, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type> event CCL_API allgatherv (const BufferObjectType &send_buf, size_t send_count, vector_class< reference_wrapper_class< BufferObjectType >> &recv_bufs, const vector_class< size_t > &recv_counts, const communicator &comm, const stream &stream, const allgatherv_attr &attr=default_allgatherv_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 the corresponding recv_counts elements of BufferObjectType size

template<class BufferObjectType, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type> event CCL_API allgatherv (const BufferObjectType &send_buf, size_t send_count, vector_class< reference_wrapper_class< BufferObjectType >> &recv_bufs, const vector_class< size_t > &recv_counts, const communicator &comm, const allgatherv_attr &attr=default_allgatherv_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 the corresponding recv_counts elements of BufferObjectType size