Skip to content

Commit b13a08f

Browse files
committed
Merge branch 'jgfouca/fix_shoc_valg' into master (PR #6813)
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
2 parents 79d4b09 + 48c9eec commit b13a08f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

components/eamxx/scripts/machines_specs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def setup_pm(cls,partition):
124124
cls.batch += "--time 00:30:00 --nodes=1 -q debug"
125125
else:
126126
cls.batch += "--time 02:00:00 --nodes=4 --gpus-per-node=4 --gpu-bind=none --exclusive -q regular"
127-
127+
128128
cls.baselines_dir = f"/global/cfs/cdirs/e3sm/baselines/{compiler}/scream/{cls.name}"
129129

130130
###############################################################################

components/eamxx/src/physics/shoc/impl/shoc_pblintd_impl.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ void Functions<S,D>::pblintd(
7878

7979
// Initialize
8080
bool check = true;
81-
// The loop below fixes valgrind uninitialized mem errs
82-
#ifndef NDEBUG
81+
// The loop below fixes valgrind uninitialized mem errs. As in other
82+
// places in eamxx, we use SCREAM_SHORT_TESTS as a proxy for knowing
83+
// mem checking is on.
84+
#if !defined(NDEBUG) || defined(SCREAM_SHORT_TESTS)
8385
for (size_t i=0; i<rino.size(); ++i) {
8486
rino(i)=0;
8587
}

components/eamxx/src/share/scream_types.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ enum class RunType {
3939

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

0 commit comments

Comments
 (0)