Skip to content

Commit

Permalink
Merge branch 'E3SM-Project/bartgol/eamxx/valg-fixes' (PR #6841)
Browse files Browse the repository at this point in the history
Fixes valgrind tests failures in eamxx standalone tests.
  • Loading branch information
bartgol authored Dec 12, 2024
2 parents d782204 + 4f33953 commit 3fa5421
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions components/eamxx/scripts/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def __init__(self, tas):
"Release build where tests run through valgrind",
[("CMAKE_BUILD_TYPE", "RelWithDebInfo"),
("EKAT_ENABLE_VALGRIND", "True"),
("SCREAM_PACK_SIZE", "1"),
("SCREAM_TEST_MAX_THREADS", "2")],
uses_baselines=False,
on_by_default=False,
Expand Down
9 changes: 6 additions & 3 deletions components/eamxx/tests/generic/fail_check/valg_fail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ namespace scream {

TEST_CASE("force_valgrind_err")
{
bool uninit;
bool* uninit = new bool[1];
int i = 0;
if (uninit) {
if (uninit[0]) {
++i;
}
else {
i += 4;
}
REQUIRE(i < 10);
if (i<4) {
printf("less than four\n");
}
delete uninit;
}

} // empty namespace
7 changes: 7 additions & 0 deletions components/homme/src/share/namelist_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,13 @@ subroutine readnl(par)
se_ftype = ftype ! MNL: For non-CAM runs, ftype=0 in control_mod
nsplit = 1
pertlim = 0.0_real_kind
#else
se_partmethod = SFCURVE
se_ne = 0
se_ne_x = 0
se_ne_y = 0
se_lx = 0
se_ly = 0
#endif
sub_case = 1
numnodes = -1
Expand Down

0 comments on commit 3fa5421

Please sign in to comment.