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

[Bug]: e3sm_diags_run.log was not properly generated #848

Open
chengzhuzhang opened this issue Sep 19, 2024 · 0 comments
Open

[Bug]: e3sm_diags_run.log was not properly generated #848

chengzhuzhang opened this issue Sep 19, 2024 · 0 comments
Labels
bug Bug fix (will increment patch version)

Comments

@chengzhuzhang
Copy link
Contributor

chengzhuzhang commented Sep 19, 2024

What happened?

When using runner.run_diags() in a loop, e3sm_diags_run.log was not properly generated:

Traceback (most recent call last):
  File "/global/u2/c/chengzhu/tests/tc_analysis/run_tc_analysis.py", line 47, in <module>
    runner.run_diags([param])
  File "/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_1.10.0_login/lib/python3.10/site-packages/e3sm_diags/run.py", line 95, in run_diags
    move_log_to_prov_dir(params[0].results_dir)
  File "/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_1.10.0_login/lib/python3.10/site-packages/e3sm_diags/logger.py", line 104, in move_log_to_prov_dir
    shutil.copy(LOG_FILENAME, provenance_dir)
  File "/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_1.10.0_login/lib/python3.10/shutil.py", line 417, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_1.10.0_login/lib/python3.10/shutil.py", line 254, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'e3sm_diags_run.log'

What did you expect to happen? Are there are possible answers you came across?

No response

Minimal Complete Verifiable Example (MVCE)

import os
from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.parameter.tc_analysis_parameter import TCAnalysisParameter
from e3sm_diags.run import runner

simulations = ['tc-v1.HR.0026_0035','tc-v2.LR.2000_2014','tc-v3.HR.0006_0025','tc-v3.LR.2000_2014']
sim_names = ['theta.20180906.branch_noCNT.A_WCYCL1950S_CMIP6_HR.ne120_oRRS18v3_ICG','v2.LR.historical_0101','20240609.piCtl.ne120pg2_r025_RRSwISC6to18E3r5.chrysalis.test1','extendedOutput.v3.LR.historical_0101']

data_path = '/global/homes/c/chengzhu/tests/tc_analysis/'

for idx, sim in enumerate(simulations):
    print(sim)
    param = CoreParameter()
    param.test_data_path = data_path+sim
    param.test_name = sim_names[idx]
    param.test_start_yr = sim.split('.')[-1][0:4]
    param.test_end_yr = sim.split('.')[-1][5:9]

    param.reference_data_path = '/global/cfs/cdirs/e3sm/diagnostics/observations/Atm/tc-analysis'
    param.ref_start_yr = '1979'
    param.ref_end_yr = '2018'

    prefix = f'/global/cfs/cdirs/e3sm/www/chengzhu/tc_analysis_test/'
    param.results_dir = os.path.join(prefix, sim)
    runner.sets_to_run = ['tc_analysis']
    runner.run_diags([param]

Environment

e3sm_unified_1.10.0

@chengzhuzhang chengzhuzhang added the bug Bug fix (will increment patch version) label Sep 19, 2024
@chengzhuzhang chengzhuzhang assigned forsyth2 and unassigned forsyth2 Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fix (will increment patch version)
Projects
None yet
Development

No branches or pull requests

2 participants