@@ -42,10 +42,12 @@ inline auto &GetReceiverGid(Mesh::channel_key_t &key) { return std::get<1>(key);
4242inline auto &GetVariable (Mesh::channel_key_t &key) { return std::get<2 >(key); }
4343inline auto &GetLocIdx (Mesh::channel_key_t &key) { return std::get<3 >(key); }
4444inline auto &GetOther (Mesh::channel_key_t &key) { return std::get<4 >(key); }
45- inline std::string GetLabel (Mesh::channel_key_t &key) { return " sender: " + std::to_string (GetSenderGid (key)) + " , receiver: " +
46- std::to_string (GetReceiverGid (key)) + " , var: " + GetVariable (key) +
47- " , location: " + std::to_string (GetLocIdx (key)) + " , other:"
48- + std::to_string (GetOther (key));}
45+ inline std::string GetLabel (Mesh::channel_key_t &key) {
46+ return " sender: " + std::to_string (GetSenderGid (key)) +
47+ " , receiver: " + std::to_string (GetReceiverGid (key)) +
48+ " , var: " + GetVariable (key) + " , location: " + std::to_string (GetLocIdx (key)) +
49+ " , other:" + std::to_string (GetOther (key));
50+ }
4951inline Mesh::channel_key_t SendKey (const MeshBlock *pmb, const NeighborBlock &nb,
5052 const std::shared_ptr<Variable<Real>> &pcv,
5153 BoundaryType btype, int id) {
@@ -105,16 +107,17 @@ void InitializeBufferCache(std::shared_ptr<MeshData<Real>> &md, COMM_MAP *comm_m
105107 std::vector<std::tuple<int , int , Mesh::channel_key_t >> key_order;
106108
107109 int boundary_idx = 0 ;
108- ForEachBoundary<bound_type>(md, [&](auto pmb, sp_mbd_t rc, const nb_t &nb, const sp_cv_t v) {
109- auto key = KeyFunc (pmb, nb, v, bound_type, md->GetBoundBufferId (bound_type));
110- PARTHENON_DEBUG_REQUIRE (comm_map->count (key) > 0 ,
111- " Boundary communicator does not exist" );
112- // Create a unique index by combining receiver gid (second element of the key
113- // tuple) and geometric element index (fourth element of the key tuple)
114- int recvr_idx = 27 * GetReceiverGid (key) + GetLocIdx (key);
115- key_order.push_back ({recvr_idx, boundary_idx, key});
116- ++boundary_idx;
117- });
110+ ForEachBoundary<bound_type>(
111+ md, [&](auto pmb, sp_mbd_t rc, const nb_t &nb, const sp_cv_t v) {
112+ auto key = KeyFunc (pmb, nb, v, bound_type, md->GetBoundBufferId (bound_type));
113+ PARTHENON_DEBUG_REQUIRE (comm_map->count (key) > 0 ,
114+ " Boundary communicator does not exist" );
115+ // Create a unique index by combining receiver gid (second element of the key
116+ // tuple) and geometric element index (fourth element of the key tuple)
117+ int recvr_idx = 27 * GetReceiverGid (key) + GetLocIdx (key);
118+ key_order.push_back ({recvr_idx, boundary_idx, key});
119+ ++boundary_idx;
120+ });
118121
119122 // If desired, sort the keys and boundary indices by receiver_idx
120123 // std::sort(key_order.begin(), key_order.end(),
@@ -132,8 +135,8 @@ void InitializeBufferCache(std::shared_ptr<MeshData<Real>> &md, COMM_MAP *comm_m
132135 std::for_each (std::begin (key_order), std::end (key_order), [&](auto &t) {
133136 if (comm_map->count (std::get<2 >(t)) == 0 ) {
134137 auto key = std::get<2 >(t);
135- PARTHENON_FAIL (std::string (" Asking for buffer that doesn't exist" ) +
136- " ( " + GetLabel (key) + " )" );
138+ PARTHENON_FAIL (std::string (" Asking for buffer that doesn't exist" ) + " ( " +
139+ GetLabel (key) + " )" );
137140 }
138141 pcache->buf_vec .push_back (&((*comm_map)[std::get<2 >(t)]));
139142 (pcache->idx_vec )[std::get<1 >(t)] = buff_idx++;
0 commit comments