Skip to content

Commit

Permalink
Add early exit to be at the end of the for-loop to guarantee process …
Browse files Browse the repository at this point in the history
…after every lambda (including last one), change to v1.1.44, and remove pedantic since it is too stringent.
  • Loading branch information
JamesYang007 committed Jun 27, 2024
1 parent aa57da8 commit 60847b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion adelie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# - Leda Guin
# - Ginnie Guin

__version__ = "1.1.43"
__version__ = "1.1.44"

# Set environment flags before loading adelie_core
import os
Expand Down
18 changes: 11 additions & 7 deletions adelie/src/include/adelie_core/solver/solver_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,6 @@ inline void solve_core(

for (; pb_it != pb.end(); ++pb_it)
{
// check early exit
if (early_exit_f(state)) {
pb_add_suffix_f(state, pb);
break;
}

// batch the next set of lambdas
const auto lmda_curr = lmda_path[lmda_path_idx];

Expand Down Expand Up @@ -468,7 +462,17 @@ inline void solve_core(
} // end while(1)

pb_add_suffix_f(state, pb);
}

// Early exit condition must be here to ensure that
// it is called after processing each lambda (including the last lambda).
if (early_exit_f(state)) {
// must add one more bar
++pb_it;
if (!(pb_it != pb.end())) break;
pb_add_suffix_f(state, pb);
break;
}
} // end for-loop over progress bar
}

} // namespace solver
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def run_cmd(cmd):
"-Wall",
"-Wextra",
"-Werror",
"-pedantic",
"-DNDEBUG",
"-O3",
]
Expand Down

0 comments on commit 60847b4

Please sign in to comment.