Skip to content

Commit

Permalink
logfile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
brryan committed Nov 13, 2024
1 parent 91591eb commit 49d8ac9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
5 changes: 3 additions & 2 deletions tst/launch_ci_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ def run_tests_in_temp_dir(pr_number, head_repo, head_ref, commit_sha):
+ " -j 20 -f && cd "
+ os.path.join(temp_dir, "tst")
+ " && python3 run_tests.py gpu.suite "
"--exe " + os.path.join(build_dir, "src", "artemis") + " "
"--log_file=ci_cpu_log.txt",
+ "--exe "
+ os.path.join(build_dir, "src", "artemis")
+ " --log_file=ci_cpu_log.txt",
]
subprocess.run(test_command, check=True)

Expand Down
43 changes: 23 additions & 20 deletions tst/scripts/advection/advection.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import os
import scripts.utils.artemis as artemis
import sys

sys.path.append(os.path.join(artemis.artemis_dir, "analysis"))
from ahistory import ahistory

Expand Down Expand Up @@ -80,7 +81,9 @@ def analyze():
dtype=np.float64,
ndmin=2,
)
history = ahistory(os.path.join(artemis.get_run_directory(), _file_id + ".out0.hst"))
history = ahistory(
os.path.join(artemis.get_run_directory(), _file_id + ".out0.hst")
)
analyze_status = True
if np.isnan(data).any():
logger.warning("NaN encountered")
Expand All @@ -94,30 +97,30 @@ def history_equiv(a, b, tol=1.0e-4):
return True

history_expected = {
"time": 1.0,
"dt": 1.11612e-02,
"cycle": 56,
"nbtotal": 16,
"gas_mass_0": 6.75,
"gas_momentum_x1_0": 2.25,
"gas_momentum_x2_0": 4.5,
"gas_momentum_x3_0": 4.5,
"gas_energy_0": 9.45,
"gas_internal_energy_0": 6.075,
"dust_mass_0": 6.75,
"dust_mass_1": 6.75,
"dust_momentum_x1_0": 2.25,
"dust_momentum_x1_1": -2.25,
"dust_momentum_x2_0": 4.5,
"dust_momentum_x2_1": -4.5,
"dust_momentum_x3_0": 4.5,
"dust_momentum_x3_1": -4.5
"time": 1.0,
"dt": 1.11612e-02,
"cycle": 56,
"nbtotal": 16,
"gas_mass_0": 6.75,
"gas_momentum_x1_0": 2.25,
"gas_momentum_x2_0": 4.5,
"gas_momentum_x3_0": 4.5,
"gas_energy_0": 9.45,
"gas_internal_energy_0": 6.075,
"dust_mass_0": 6.75,
"dust_mass_1": 6.75,
"dust_momentum_x1_0": 2.25,
"dust_momentum_x1_1": -2.25,
"dust_momentum_x2_0": 4.5,
"dust_momentum_x2_1": -4.5,
"dust_momentum_x3_0": 4.5,
"dust_momentum_x3_1": -4.5,
}

for key in history_expected.keys():
values = history.Get(key)
if len(values) != 11:
analyze_status=False
analyze_status = False
for value in values:
if np.isnan(value):
logger.warning("NaN encountered")
Expand Down

0 comments on commit 49d8ac9

Please sign in to comment.