Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect combine, deflate, & gather output to stdout #81

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions salishsea_cmd/run.py
Original file line number Diff line number Diff line change
@@ -1143,7 +1143,7 @@ def _execute(
)
script += textwrap.dedent(
f"""\
${{COMBINE}} ${{RUN_DESC}} --debug
${{COMBINE}} ${{RUN_DESC}} --debug{redirect}
echo "Results combining ended at $(date)"{redirect}
"""
)
@@ -1167,15 +1167,15 @@ def _execute(
f"""\
${{DEFLATE}} *_ptrc_T*.nc *_prod_T*.nc *_carp_T*.nc *_grid_[TUVW]*.nc \\
*_turb_T*.nc *_dia[12n]_T*.nc FVCOM*.nc Slab_[UV]*.nc *_mtrc_T*.nc \\
--jobs {max_deflate_jobs} --debug
--jobs {max_deflate_jobs} --debug{redirect}
echo "Results deflation ended at $(date)"{redirect}
"""
)
script += textwrap.dedent(
f"""\

echo "Results gathering started at $(date)"{redirect}
${{GATHER}} ${{RESULTS_DIR}} --debug
${{GATHER}} ${{RESULTS_DIR}} --debug{redirect}
echo "Results gathering ended at $(date)"{redirect}
"""
)
16 changes: 8 additions & 8 deletions tests/test_run.py
Original file line number Diff line number Diff line change
@@ -2584,7 +2584,7 @@ def test_salish(self, deflate, monkeypatch):
echo "Ended run at $(date)" >>${RESULTS_DIR}/stdout

echo "Results combining started at $(date)" >>${RESULTS_DIR}/stdout
${COMBINE} ${RUN_DESC} --debug
${COMBINE} ${RUN_DESC} --debug >>${RESULTS_DIR}/stdout
echo "Results combining ended at $(date)" >>${RESULTS_DIR}/stdout
"""
)
@@ -2595,15 +2595,15 @@ def test_salish(self, deflate, monkeypatch):
echo "Results deflation started at $(date)" >>${RESULTS_DIR}/stdout
${DEFLATE} *_ptrc_T*.nc *_prod_T*.nc *_carp_T*.nc *_grid_[TUVW]*.nc \\
*_turb_T*.nc *_dia[12n]_T*.nc FVCOM*.nc Slab_[UV]*.nc *_mtrc_T*.nc \\
--jobs 4 --debug
--jobs 4 --debug >>${RESULTS_DIR}/stdout
echo "Results deflation ended at $(date)" >>${RESULTS_DIR}/stdout
"""
)
expected += textwrap.dedent(
"""\

echo "Results gathering started at $(date)" >>${RESULTS_DIR}/stdout
${GATHER} ${RESULTS_DIR} --debug
${GATHER} ${RESULTS_DIR} --debug >>${RESULTS_DIR}/stdout
echo "Results gathering ended at $(date)" >>${RESULTS_DIR}/stdout

chmod go+rx ${RESULTS_DIR}
@@ -3361,17 +3361,17 @@ def test_salish_execute_with_deflate(self, monkeypatch):
echo "Ended run at $(date)" >>${{RESULTS_DIR}}/stdout

echo "Results combining started at $(date)" >>${{RESULTS_DIR}}/stdout
${{COMBINE}} ${{RUN_DESC}} --debug
${{COMBINE}} ${{RUN_DESC}} --debug >>${{RESULTS_DIR}}/stdout
echo "Results combining ended at $(date)" >>${{RESULTS_DIR}}/stdout

echo "Results deflation started at $(date)" >>${{RESULTS_DIR}}/stdout
${{DEFLATE}} *_ptrc_T*.nc *_prod_T*.nc *_carp_T*.nc *_grid_[TUVW]*.nc \\
*_turb_T*.nc *_dia[12n]_T*.nc FVCOM*.nc Slab_[UV]*.nc *_mtrc_T*.nc \\
--jobs 4 --debug
--jobs 4 --debug >>${{RESULTS_DIR}}/stdout
echo "Results deflation ended at $(date)" >>${{RESULTS_DIR}}/stdout

echo "Results gathering started at $(date)" >>${{RESULTS_DIR}}/stdout
${{GATHER}} ${{RESULTS_DIR}} --debug
${{GATHER}} ${{RESULTS_DIR}} --debug >>${{RESULTS_DIR}}/stdout
echo "Results gathering ended at $(date)" >>${{RESULTS_DIR}}/stdout
"""
)
@@ -3606,11 +3606,11 @@ def test_salish_execute_without_deflate(
echo "Ended run at $(date)" >>${{RESULTS_DIR}}/stdout

echo "Results combining started at $(date)" >>${{RESULTS_DIR}}/stdout
${{COMBINE}} ${{RUN_DESC}} --debug
${{COMBINE}} ${{RUN_DESC}} --debug >>${{RESULTS_DIR}}/stdout
echo "Results combining ended at $(date)" >>${{RESULTS_DIR}}/stdout

echo "Results gathering started at $(date)" >>${{RESULTS_DIR}}/stdout
${{GATHER}} ${{RESULTS_DIR}} --debug
${{GATHER}} ${{RESULTS_DIR}} --debug >>${{RESULTS_DIR}}/stdout
echo "Results gathering ended at $(date)" >>${{RESULTS_DIR}}/stdout
"""
)