Skip to content

Commit 638c9ee

Browse files
committed
EAMxx: fix issue with catch rng seed in unit tests
We cannot pass "--rng-seed -123" as flag, so ensure that we have a POSITIVE seed
1 parent 194de81 commit 638c9ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/eamxx/src/share/util/scream_setup_random_test.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ inline int get_random_test_seed(const ekat::Comm* comm=nullptr)
1818

1919
std::random_device rdev;
2020
const int catchRngSeed = Catch::rngSeed();
21-
int seed = catchRngSeed==0 ? rdev() : catchRngSeed;
21+
int seed = catchRngSeed==0 ? rdev()/2 : catchRngSeed;
2222

2323
if (comm == nullptr || comm->am_i_root()) {
2424
// Print seed to screen to trace tests that fail.

0 commit comments

Comments
 (0)