Skip to content

Commit 5a96adc

Browse files
fengjicaaranadive
andauthored
make nixlbench exit with failure when iov consistency check fails. (#992)
Signed-off-by: Feng Ji <[email protected]> Co-authored-by: Adit Ranadive <[email protected]>
1 parent 3995f17 commit 5a96adc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

benchmark/nixlbench/src/utils/utils.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ void xferBenchUtils::checkConsistency(std::vector<std::vector<xferBenchIOV>> &io
659659
xferBenchConfig::num_initiator_dev);
660660
gusli_devmap_init = true;
661661
}
662+
bool pass_check_consistency = true;
662663
for (const auto &iov_list: iov_lists) {
663664
for(const auto &iov: iov_list) {
664665
void *addr = NULL;
@@ -793,6 +794,7 @@ void xferBenchUtils::checkConsistency(std::vector<std::vector<xferBenchIOV>> &io
793794
rc = allBytesAre(addr, len, check_val);
794795
if (true != rc) {
795796
std::cerr << "Consistency check failed for iov " << i << ":" << j << std::endl;
797+
pass_check_consistency = false;
796798
}
797799
// Free the addr only if is allocated here
798800
if (is_allocated) {
@@ -802,6 +804,10 @@ void xferBenchUtils::checkConsistency(std::vector<std::vector<xferBenchIOV>> &io
802804
}
803805
i++;
804806
}
807+
if (!pass_check_consistency) {
808+
std::cerr << "Consistency check failed" << std::endl;
809+
exit(EXIT_FAILURE);
810+
}
805811
}
806812

807813
void

0 commit comments

Comments
 (0)