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

Change ilamb task name #272

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/source/dev_guide/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Before running ``tests/integration/test_bundles.py`` run the following:
zppy -c tests/integration/test_bundles.cfg
# bundle1 and bundle2 should run. After they finish, invoke zppy again to resolve remaining dependencies:
zppy -c tests/integration/test_bundles.cfg
# bundle3 and ilamb_run should run
# bundle3 and ilamb should run

Commands to run to replace outdated expected files
--------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_bundles.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ ts_num_years = 5
walltime = "00:30:00" # bundle2 should take walltime from "ts: atm_monthly_glb", i.e., "02:00:00"
years = "1850-1860",

[ilamb_run]
[ilamb]
active = True
# No bundle, let bundle1 finish first because "ilamb_run" requires "ts: atm_monthly_180x360_aave"
# No bundle, let bundle1 finish first because "ilamb" requires "ts: atm_monthly_180x360_aave"
grid = '180x360_aave'
short_name = 'v2.LR.historical_0201'
ts_num_years = 2
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_bundles_bash_file_list(self):
"e3sm_diags_atm_monthly_180x360_aave_model_vs_obs_1852-1853.bash",
"e3sm_diags_atm_monthly_180x360_aave_mvm_model_vs_model_1850-1851_vs_1850-1851.bash",
"global_time_series_1850-1860.bash",
"ilamb_run_1850-1851.bash",
"ilamb_1850-1851.bash",
"tc_analysis_1850-1851.bash",
"ts_atm_daily_180x360_aave_1850-1851-0002.bash",
"ts_atm_daily_180x360_aave_1852-1853-0002.bash",
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_complete_run.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ts_years = "1850-1854", "1850-1860",
walltime = "00:30:00"
years = "1850-1860",

[ilamb_run]
[ilamb]
active = True
grid = '180x360_aave'
short_name = 'v2.LR.historical_0201'
Expand Down
6 changes: 3 additions & 3 deletions zppy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from zppy.climo import climo
from zppy.e3sm_diags import e3sm_diags
from zppy.global_time_series import global_time_series
from zppy.ilamb_run import ilamb_run
from zppy.ilamb import ilamb
from zppy.mpas_analysis import mpas_analysis
from zppy.tc_analysis import tc_analysis
from zppy.ts import ts
Expand Down Expand Up @@ -144,8 +144,8 @@ def main(): # noqa: C901
# global time series tasks
existing_bundles = global_time_series(config, scriptDir, existing_bundles)

# ilamb_run tasks
existing_bundles = ilamb_run(config, scriptDir, existing_bundles)
# ilamb tasks
existing_bundles = ilamb(config, scriptDir, existing_bundles)

# Submit bundle jobs
for b in existing_bundles:
Expand Down
12 changes: 6 additions & 6 deletions zppy/ilamb_run.py → zppy/ilamb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@


# -----------------------------------------------------------------------------
def ilamb_run(config, scriptDir, existing_bundles):
def ilamb(config, scriptDir, existing_bundles):

# Initialize jinja2 template engine
templateLoader = jinja2.FileSystemLoader(
searchpath=config["default"]["templateDir"]
)
templateEnv = jinja2.Environment(loader=templateLoader)
template = templateEnv.get_template("ilamb_run.bash")
template = templateEnv.get_template("ilamb.bash")

# --- List of ilamb_run tasks ---
tasks = getTasks(config, "ilamb_run")
# --- List of ilamb tasks ---
tasks = getTasks(config, "ilamb")
if len(tasks) == 0:
return existing_bundles

# --- Generate and submit ilamb_run scripts ---
# --- Generate and submit ilamb scripts ---
dependencies = []

for c in tasks:
Expand Down Expand Up @@ -81,7 +81,7 @@ def ilamb_run(config, scriptDir, existing_bundles):
),
)

prefix = "ilamb_run_%04d-%04d" % (
prefix = "ilamb_%04d-%04d" % (
c["year1"],
c["year2"],
)
Expand Down
4 changes: 2 additions & 2 deletions zppy/templates/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ ts_num_years = integer(default=10)
ts_years = string_list(default=list(""))
# `years = "1-100",` would plot years 1 to 100 on the graphs.

[ilamb_run]
cfg = string(default="ilamb_run/cmip.cfg")
[ilamb]
cfg = string(default="ilamb/cmip.cfg")
ilamb_obs = string(default="")
land_only = boolean(default=False)
ts_atm_subsection = string(default="atm_monthly_180x360_aave")
Expand Down
4 changes: 2 additions & 2 deletions zppy/templates/ilamb_run.bash → zppy/templates/ilamb.bash
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ echo
# TODO: find the mpi run format for different platforms

# include cfg file
cat > ilamb_run.cfg << EOF
cat > ilamb.cfg << EOF
{% include cfg %}
EOF

echo ${workdir}
echo {{ scriptDir }}

srun -N 1 ilamb-run --config ilamb_run.cfg --model_root $model_root --regions global --model_year ${Y1} 2000
srun -N 1 ilamb-run --config ilamb.cfg --model_root $model_root --regions global --model_year ${Y1} 2000

if [ $? != 0 ]; then
cd {{ scriptDir }}
Expand Down
File renamed without changes.
File renamed without changes.