44namespace shamalgs::collective {
48 std::unique_ptr<shamcomm::CommunicationBuffer> payload;
53 std::unique_ptr<shamcomm::CommunicationBuffer> payload;
57 std::vector<u64> local_send_vec_comm_ranks;
58 std::vector<u64> global_comm_ranks;
60 void build(
const std::vector<SendPayload> &message_send) {
63 local_send_vec_comm_ranks.resize(message_send.size());
66 for (
u64 i = 0; i < message_send.size(); i++) {
67 local_send_vec_comm_ranks[i]
75 void sparse_comm_debug_infos(
76 std::shared_ptr<sham::DeviceScheduler> dev_sched,
77 const std::vector<SendPayload> &message_send,
78 std::vector<RecvPayload> &message_recv,
81 void sparse_comm_isend_probe_count_irecv(
82 std::shared_ptr<sham::DeviceScheduler> dev_sched,
83 const std::vector<SendPayload> &message_send,
84 std::vector<RecvPayload> &message_recv,
87 void sparse_comm_allgather_isend_irecv(
88 std::shared_ptr<sham::DeviceScheduler> dev_sched,
89 const std::vector<SendPayload> &message_send,
90 std::vector<RecvPayload> &message_recv,
93 inline void sparse_comm_c(
94 std::shared_ptr<sham::DeviceScheduler> dev_sched,
95 const std::vector<SendPayload> &message_send,
96 std::vector<RecvPayload> &message_recv,
101 sparse_comm_allgather_isend_irecv(dev_sched, message_send, message_recv, comm_table);
104 inline void base_sparse_comm(
105 std::shared_ptr<sham::DeviceScheduler> dev_sched,
106 const std::vector<SendPayload> &message_send,
107 std::vector<RecvPayload> &message_recv) {
110 SparseCommTable comm_table;
112 comm_table.build(message_send);
114 sparse_comm_c(dev_sched, message_send, message_recv, comm_table);
117 inline void base_sparse_comm_max_comm(
118 std::shared_ptr<sham::DeviceScheduler> dev_sched,
119 std::vector<SendPayload> &message_send,
120 std::vector<RecvPayload> &message_recv,
121 u32 max_simultaneous_send) {
123 int send_loc = message_send.size();
132 while (i < send_max_count) {
136 logger::warn_ln(
"SparseComm",
"Split sparse comm", i,
"/", send_max_count));
139 std::vector<SendPayload> message_send_tmp;
140 std::vector<RecvPayload> message_recv_tmp;
142 for (
int j = i; (j < (i + max_simultaneous_send)) && (j < message_send.size()); j++) {
144 message_send_tmp.emplace_back(std::move(message_send[j]));
147 base_sparse_comm(dev_sched, message_send_tmp, message_recv_tmp);
149 for (
int j = 0; j < message_recv_tmp.size(); j++) {
150 message_recv.emplace_back(std::move(message_recv_tmp[j]));
153 i += max_simultaneous_send;
Shamrock communication buffers.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
std::int32_t i32
32 bit integer
Shamrock assertion utility.
This header file contains utility functions related to exception handling in the code.
std::vector< int > vector_allgatherv(const std::vector< T > &send_vec, const MPI_Datatype &send_type, std::vector< T > &recv_vec, const MPI_Datatype &recv_type, const MPI_Comm comm)
allgatherv on vector with size query (size querying variant of vector_allgatherv_ks) //TODO add fault...
MPI string gather / allgather helpers (declarations; implementations in shamalgs/src/collective/gathe...
Utility functions for MPI error checking.
i32 world_rank()
Gives the rank of the current process in the MPI communicator.
This file contains the definition for the stacktrace related functionality.
Functions related to the MPI communicator.
#define ON_RANK_0(x)
Macro to execute code only on rank 0.
void Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
MPI wrapper for MPI_Allreduce.