Skip to content

Commit

Permalink
Add full parallelization no matter what for constraint handling stuff…
Browse files Browse the repository at this point in the history
… since they tend to not be parallelized that much anyways.
  • Loading branch information
JamesYang007 committed Nov 27, 2024
1 parent 1e23cef commit 51c9a6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adelie/src/include/adelie_core/solver/solver_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ inline void update_abs_grad(
try_failed = true;
}
};
util::omp_parallel_for(routine, 0, groups.size(), n_threads * (n_threads <= static_cast<size_t>(groups.size())));
util::omp_parallel_for(routine, 0, groups.size(), n_threads);
if (try_failed) {
throw util::adelie_core_solver_error(
"exception raised in constraint->solve_zero(). "
Expand Down Expand Up @@ -192,7 +192,7 @@ inline auto sparsify_dual(
constraint->dual(indices_v, values_v);
indices_v += dual_groups[i];
};
util::omp_parallel_for(routine, 0, n_constraints, n_threads * (n_threads <= n_constraints));
util::omp_parallel_for(routine, 0, n_constraints, n_threads);
}

const auto last_constraint = constraints[n_constraints-1];
Expand Down

0 comments on commit 51c9a6e

Please sign in to comment.