Skip to content

Commit

Permalink
Merge pull request #1248 from LLNL/tupek/parallel_constistent_tr_size…
Browse files Browse the repository at this point in the history
…_fix

Quick fix to make sure trust region scaling is parallel consistent.
  • Loading branch information
tupek2 authored Oct 18, 2024
2 parents 6299260 + e76f0bc commit 6357a07
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions .gitlab/build_toss4_cray.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
# Build jobs

# Only run integration tests on one spec
toss4_cray-clang_17_0_0-src:
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}_hip.cmake"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON"
ALLOC_NODES: "1"
ALLOC_TIME: "30"
extends: .src_build_on_toss4_cray
#toss4_cray-clang_17_0_0-src:
# variables:
# COMPILER: "[email protected]"
# HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}_hip.cmake"
# EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON"
# ALLOC_NODES: "1"
# ALLOC_TIME: "30"
# extends: .src_build_on_toss4_cray

toss4_cray-clang_17_0_0-full:
variables:
Expand Down
10 changes: 6 additions & 4 deletions src/serac/numerics/equation_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,12 @@ class TrustRegion : public mfem::NewtonSolver {

TrustRegionResults trResults(X.Size());
TrustRegionSettings settings;
settings.min_cg_iterations = static_cast<size_t>(nonlinear_options.min_iterations);
settings.max_cg_iterations = static_cast<size_t>(linear_options.max_iterations);
settings.cg_tol = 0.5 * norm_goal;
double tr_size = nonlinear_options.trust_region_scaling * std::sqrt(X.Size());
settings.min_cg_iterations = static_cast<size_t>(nonlinear_options.min_iterations);
settings.max_cg_iterations = static_cast<size_t>(linear_options.max_iterations);
settings.cg_tol = 0.5 * norm_goal;

scratch = 1.0;
double tr_size = nonlinear_options.trust_region_scaling * std::sqrt(Dot(scratch, scratch));
size_t cumulative_cg_iters_from_last_precond_update = 0;

auto& d = trResults.d; // reuse, maybe dangerous!
Expand Down

0 comments on commit 6357a07

Please sign in to comment.