Skip to content

Commit

Permalink
#1934: Update usage of the buffer in the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Sep 17, 2024
1 parent c8561f2 commit 15e4c9f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/vt/vrt/collection/balance/workload_replay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,19 @@ readInWorkloads(const std::string &filename) {
auto json = r.readFile();
auto sd = std::make_shared<LBDataHolder>(*json);

for (auto phase = sd->node_data_.backPhase(); phase <= sd->node_data_.frontPhase(); phase++) {
for (auto &phase_data : sd->node_data_) {
vt_debug_print(
normal, replay,
"found {} loads for phase {}\n",
sd->node_data_[phase].size(), phase
phase_data.second.size(), phase_data.first
);
}

for (auto phase = sd->node_comm_.backPhase(); phase <= sd->node_comm_.frontPhase(); phase++) {
for (auto &phase_data : sd->node_comm_) {
vt_debug_print(
normal, replay,
"found {} comms for phase {}\n",
sd->node_comm_[phase].size(), phase
phase_data.second.size(), phase_data.first
);
}

Expand Down
7 changes: 4 additions & 3 deletions tests/unit/collection/test_lb.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -606,16 +606,17 @@ TEST_F(TestRestoreLBData, test_restore_lb_data_data_1) {
);
} else {
// compare the whole-phase load data in detail
for (auto phase = lbdh.node_data_.backPhase(); phase <= lbdh.node_data_.frontPhase(); phase++) {
EXPECT_TRUE(lbdh_read.node_data_.contains(phase));
for (auto &phase_data : lbdh.node_data_) {
auto phase = phase_data.first;
EXPECT_FALSE(!lbdh_read.node_data_.contains(phase));
if (!lbdh_read.node_data_.contains(phase)) {
fmt::print(
"Phase {} in whole-phase loads were not read in",
phase
);
} else {
auto &read_load_map = lbdh_read.node_data_[phase];
auto &orig_load_map = lbdh.node_data_[phase];
auto &orig_load_map = phase_data.second;
for (auto &entry : read_load_map) {
auto read_elm_id = entry.first;
if ((read_elm_id.id == vt::elm::no_element_id)
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/lb/test_lb_data_comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_col_to_col_send) {
if (proxy(i).tryGetLocalPtr()) {
bool found = false;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
if (key.to_.id == idxToElmID(idx)) {
Expand Down Expand Up @@ -358,7 +358,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_col_to_objgroup_send) {
bool found = false;
auto idb = vt::elm::ElmIDBits::createObjGroup(op, next).id;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
if (key.from_.id == idxToElmID(idx) /*and key.to_.id == idb*/) {
Expand Down Expand Up @@ -421,7 +421,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_objgroup_to_col_send) {
if (proxy(i).tryGetLocalPtr()) {
bool found = false;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
if (key.to_.id == idxToElmID(idx)) {
Expand Down Expand Up @@ -475,7 +475,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_objgroup_to_objgroup_send) {
// Check that communication exists on the send side as expected
bool found = false;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
if (key.from_.id == ida /*and key.to_.id == idb*/) {
Expand Down Expand Up @@ -532,7 +532,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_handler_to_col_send) {
if (proxy(i).tryGetLocalPtr()) {
bool found = false;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
if (key.to_.id == idxToElmID(idx)) {
Expand Down Expand Up @@ -592,7 +592,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_col_to_handler_send) {
if (proxy(i).tryGetLocalPtr()) {
bool found = false;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
fmt::print("from={}, to={}\n", key.from_, key.to_);
Expand Down Expand Up @@ -641,7 +641,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_objgroup_to_handler_send) {
// Check that communication exists on the send side as expected
bool found = false;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
if (key.from_.id == ida) {
Expand Down Expand Up @@ -686,7 +686,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_handler_to_objgroup_send) {
// Check that communication exists on the send side as expected
bool found = false;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
if (key.to_.id == ida) {
Expand Down Expand Up @@ -727,7 +727,7 @@ TEST_F(TestLBDataComm, test_lb_data_comm_handler_to_handler_send) {
// Check that communication exists on the send side as expected
bool found = false;
for (auto&& x : comm) {
for (auto&& y : x) {
for (auto&& y : x.second) {
auto key = y.first;
auto vol = y.second;
if (key.to_.id == ida and key.from_.id == idb) {
Expand Down

0 comments on commit 15e4c9f

Please sign in to comment.