@@ -55,6 +55,8 @@ ParArray1D<BndId> &CoalescedBuffer::GetBndIdsOnDevice(const std::set<Uid_t> &var
55
55
int nbnd_id{0 };
56
56
int comb_size{0 };
57
57
for (auto uid : var_set) {
58
+ // Skip this variable if it is not communicated in this BoundaryType
59
+ if (coalesced_info_buf.count (uid) == 0 ) continue ;
58
60
nbnd_id += coalesced_info_buf.at (uid).size ();
59
61
for (auto &[bnd_id, pvbbuf] : coalesced_info_buf.at (uid)) {
60
62
auto buf_state = pvbbuf->GetState ();
@@ -81,6 +83,8 @@ ParArray1D<BndId> &CoalescedBuffer::GetBndIdsOnDevice(const std::set<Uid_t> &var
81
83
int idx{0 };
82
84
int c_buf_idx{0 }; // Index at which v-b buffer starts in combined buffer
83
85
for (auto uid : var_set) {
86
+ // Skip this variable if it is not communicated in this BoundaryType
87
+ if (coalesced_info_buf.count (uid) == 0 ) continue ;
84
88
for (auto &[bnd_id, pvbbuf] : coalesced_info_buf.at (uid)) {
85
89
auto &bid_h = bnd_ids_host[idx];
86
90
auto buf_state = pvbbuf->GetState ();
@@ -143,6 +147,8 @@ void CoalescedBuffer::PackAndSend(const std::set<Uid_t> &vars) {
143
147
auto &stat = sparse_status_buffer.buffer ();
144
148
int idx{0 };
145
149
for (auto uid : var_set) {
150
+ // Skip this variable if it is not communicated in this BoundaryType
151
+ if (coalesced_info_buf.count (uid) == 0 ) continue ;
146
152
for (auto &[bnd_id, pvbbuf] : coalesced_info_buf.at (uid)) {
147
153
const auto state = pvbbuf->GetState ();
148
154
PARTHENON_REQUIRE (state == BufferState::sending ||
@@ -157,6 +163,8 @@ void CoalescedBuffer::PackAndSend(const std::set<Uid_t> &vars) {
157
163
158
164
// Information in these send buffers is no longer required
159
165
for (auto uid : var_set) {
166
+ // Skip this variable if it is not communicated in this BoundaryType
167
+ if (coalesced_info_buf.count (uid) == 0 ) continue ;
160
168
for (auto &[bnd_id, pvbbuf] : coalesced_info_buf.at (uid)) {
161
169
pvbbuf->Stale ();
162
170
}
@@ -173,6 +181,8 @@ bool CoalescedBuffer::TryReceiveAndUnpack(const std::set<Uid_t> &vars) {
173
181
// Make sure the var-boundary buffers are available to write to
174
182
int nbuf{0 };
175
183
for (auto uid : var_set) {
184
+ // Skip this variable if it is not communicated in this BoundaryType
185
+ if (coalesced_info_buf.count (uid) == 0 ) continue ;
176
186
for (auto &[bnd_id, pvbbuf] : coalesced_info_buf.at (uid)) {
177
187
if (pvbbuf->GetState () != BufferState::stale) return false ;
178
188
nbuf++;
@@ -190,6 +200,8 @@ bool CoalescedBuffer::TryReceiveAndUnpack(const std::set<Uid_t> &vars) {
190
200
int idx{0 };
191
201
auto &stat = sparse_status_buffer.buffer ();
192
202
for (auto uid : var_set) {
203
+ // Skip this variable if it is not communicated in this BoundaryType
204
+ if (coalesced_info_buf.count (uid) == 0 ) continue ;
193
205
for (auto &[bnd_id, pvbbuf] : coalesced_info_buf.at (uid)) {
194
206
if (stat[idx] == 1 ) {
195
207
pvbbuf->SetReceived ();
0 commit comments