Skip to content

Commit

Permalink
Merge branch 'jgfouca/fix_shoc_valg' into master (PR #6813)
Browse files Browse the repository at this point in the history
The mem tests are no longer guaranteed to have NDEBUG on. We use
SCREAM_SHORT_TESTS as a proxy for knowing that mem checking is on.

[BFB]

* jgfouca/fix_shoc_valg:
  Init rino when short tests are on
  • Loading branch information
jgfouca committed Dec 9, 2024
2 parents 79d4b09 + 48c9eec commit b13a08f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/eamxx/scripts/machines_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def setup_pm(cls,partition):
cls.batch += "--time 00:30:00 --nodes=1 -q debug"
else:
cls.batch += "--time 02:00:00 --nodes=4 --gpus-per-node=4 --gpu-bind=none --exclusive -q regular"

cls.baselines_dir = f"/global/cfs/cdirs/e3sm/baselines/{compiler}/scream/{cls.name}"

###############################################################################
Expand Down
6 changes: 4 additions & 2 deletions components/eamxx/src/physics/shoc/impl/shoc_pblintd_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ void Functions<S,D>::pblintd(

// Initialize
bool check = true;
// The loop below fixes valgrind uninitialized mem errs
#ifndef NDEBUG
// The loop below fixes valgrind uninitialized mem errs. As in other
// places in eamxx, we use SCREAM_SHORT_TESTS as a proxy for knowing
// mem checking is on.
#if !defined(NDEBUG) || defined(SCREAM_SHORT_TESTS)
for (size_t i=0; i<rino.size(); ++i) {
rino(i)=0;
}
Expand Down
3 changes: 2 additions & 1 deletion components/eamxx/src/share/scream_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ enum class RunType {

// We cannot expect BFB results between f90 and cxx if optimizations are on.
// Same goes for cuda-memcheck because it makes the bfb math layer prohibitively
// expensive and so must be turned off.
// expensive and so must be turned off. SCREAM_SHORT_TESTS is a proxy
// for mem checking.
#if defined (NDEBUG) || defined (SCREAM_SHORT_TESTS)
static constexpr bool SCREAM_BFB_TESTING = false;
#else
Expand Down

0 comments on commit b13a08f

Please sign in to comment.