Skip to content

Commit

Permalink
[coll-comm] review update:
Browse files Browse the repository at this point in the history
- fix include guards
- update docs

Co-authored-by: Pratik Nayak <[email protected]>
  • Loading branch information
MarcelKoch and pratikvn committed Jul 19, 2024
1 parent dc33601 commit db7f6ed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
6 changes: 3 additions & 3 deletions core/distributed/device_partition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// SPDX-License-Identifier: BSD-3-Clause

#ifndef GINKGO_PARTITION_HPP
#define GINKGO_PARTITION_HPP
#ifndef GKO_CORE_DISTRIBUTED_PARTITION_HPP
#define GKO_CORE_DISTRIBUTED_PARTITION_HPP

#include <ginkgo/core/distributed/partition.hpp>

Expand Down Expand Up @@ -89,4 +89,4 @@ to_device_const(
} // namespace gko


#endif // GINKGO_PARTITION_HPP
#endif // GKO_CORE_DISTRIBUTED_PARTITION_HPP
2 changes: 1 addition & 1 deletion include/ginkgo/core/base/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ namespace distributed {


/**
* Make mpi::comm_index_type avaiable in this namespace
* Make mpi::comm_index_type available in this namespace
*/
using mpi::comm_index_type;

Expand Down
5 changes: 3 additions & 2 deletions include/ginkgo/core/distributed/collective_communicator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class CollectiveCommunicator {
/**
* Non-blocking all-to-all communication.
*
* The send_buffer must have size get_send_size, and the recv_buffer
* must have size get_recv_size.
* The send_buffer must have allocated at least get_send_size number of
* elements, and the recv_buffer must have allocated at least get_recv_size
* number of elements.
*
* @tparam SendType the type of the elements to send
* @tparam RecvType the type of the elements to receive
Expand Down
6 changes: 3 additions & 3 deletions include/ginkgo/core/distributed/index_map_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// SPDX-License-Identifier: BSD-3-Clause

#ifndef GINKGO_INDEX_MAP_FWD_HPP
#define GINKGO_INDEX_MAP_FWD_HPP
#ifndef GKO_PUBLIC_CORE_INDEX_MAP_FWD_HPP
#define GKO_PUBLIC_CORE_INDEX_MAP_FWD_HPP

#include <variant>

Expand All @@ -27,4 +27,4 @@ using index_map_variant =
} // namespace experimental
} // namespace gko

#endif // GINKGO_INDEX_MAP_FWD_HPP
#endif // GKO_PUBLIC_CORE_INDEX_MAP_FWD_HPP
18 changes: 6 additions & 12 deletions include/ginkgo/core/distributed/neighborhood_communicator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,10 @@ class NeighborhoodCommunicator final : public CollectiveCommunicator {
const std::vector<comm_index_type>& send_offsets);

/**
* Communicate data from all ranks to all other ranks using the
* neighboorhood communication MPI_Ineighbor_alltoallv. See MPI
* documentation for more details
* @copydoc CollectiveCommunicator::i_all_to_all_v
*
* @param exec The executor, on which the message buffers are located.
* @param send_buffer the buffer to send
* @param send_type the MPI_Datatype for the send buffer
* @param recv_buffer the buffer to gather into
* @param recv_type the MPI_Datatype for the recv buffer
*
* @return the request handle for the call
* This implementation uses the neighborhood communication
* MPI_Ineighbor_alltoallv. See MPI documentation for more details.
*/
request i_all_to_all_v(std::shared_ptr<const Executor> exec,
const void* send_buffer, MPI_Datatype send_type,
Expand All @@ -98,6 +91,7 @@ class NeighborhoodCommunicator final : public CollectiveCommunicator {
std::unique_ptr<CollectiveCommunicator> create_with_same_type(
communicator base,
const distributed::index_map_variant& imap) const override;

/**
* Creates the inverse neighborhood_communicator by switching sources
* and destinations.
Expand All @@ -110,12 +104,12 @@ class NeighborhoodCommunicator final : public CollectiveCommunicator {
/**
* @copydoc collective_communicator::get_recv_size
*/
comm_index_type get_recv_size() const override;
[[nodiscard]] comm_index_type get_recv_size() const override;

/**
* @copydoc collective_communicator::get_recv_size
*/
comm_index_type get_send_size() const override;
[[nodiscard]] comm_index_type get_send_size() const override;

private:
communicator comm_;
Expand Down

0 comments on commit db7f6ed

Please sign in to comment.