Skip to content

Commit 0540483

Browse files
Alexander SannikovJuliaRS
authored andcommitted
Fixed error handling for subsets of MPI_COMM_WORLD
1 parent 81a8392 commit 0540483

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src_cpp/helpers/helper_IMB_functions.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ struct Bmark_descr {
7575
std::vector<std::string> comments;
7676
std::vector<const char *> cmt;
7777
bool stop_iterations;
78-
int time_limit[2];
7978
double sample_time;
8079
BTYPES descr2type(descr_t t) {
8180
switch(t) {
@@ -758,7 +757,6 @@ struct Bmark_descr {
758757
glob.header=1;
759758
Bmark->sample_failure = 0;
760759
sample_time = MPI_Wtime();
761-
time_limit[0] = time_limit[1] = 0;
762760
Bmark->success = 1;
763761
#ifdef MPI1
764762
c_info.select_source = Bmark->select_source;
@@ -776,15 +774,15 @@ struct Bmark_descr {
776774

777775
void helper_time_check(comm_info &c_info, GLOBALS &,
778776
Bench *Bmark, iter_schedule &ITERATIONS) {
779-
if (!Bmark->sample_failure) {
780-
time_limit[1] = 0;
781-
if (c_info.rank >= 0) {
782-
time_limit[1] = (MPI_Wtime() - sample_time < std::max(std::max(c_info.n_lens, c_info.max_msg_log - c_info.min_msg_log) - 1, 1) * ITERATIONS.secs) ? 0 : 1;
783-
}
777+
int __tmp = 0;
778+
779+
if ((!Bmark->sample_failure) && (c_info.rank >= 0)
780+
&& (MPI_Wtime() - sample_time > std::max(std::max(c_info.n_lens, c_info.max_msg_log - c_info.min_msg_log) - 1, 1) * ITERATIONS.secs)) {
781+
Bmark->sample_failure = SAMPLE_FAILED_TIME_OUT;
784782
}
785-
MPI_Allreduce(&time_limit[1], &time_limit[0], 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
786-
if (time_limit[0]) {
787-
Bmark->sample_failure = SAMPLE_FAILED_TIME_OUT;
783+
784+
MPI_Allreduce(&mark->sample_failure, __tmp, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD);
785+
if (__tmp < 0) {
788786
stop_iterations = true;
789787
}
790788
return;

0 commit comments

Comments
 (0)