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

Update case members in case_setup #1414

Merged
merged 5 commits into from
Apr 25, 2017
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
6 changes: 3 additions & 3 deletions scripts/lib/CIME/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, case_root=None, read_only=True):
self.cores_per_task = None
# check if case has been configured and if so initialize derived
if self.get_value("CASEROOT") is not None:
self._initialize_derived_attributes()
self.initialize_derived_attributes()

def check_if_comp_var(self, vid):
vid = vid
Expand All @@ -119,7 +119,7 @@ def check_if_comp_var(self, vid):
return vid, comp, iscompvar
return vid, comp, iscompvar

def _initialize_derived_attributes(self):
def initialize_derived_attributes(self):
"""
These are derived variables which can be used in the config_* files
for variable substitution using the {{ var }} syntax
Expand Down Expand Up @@ -809,7 +809,7 @@ def configure(self, compset_name, grid_name, machine_name=None,
if test:
self.set_value("TEST",True)

self._initialize_derived_attributes()
self.initialize_derived_attributes()

# Make sure that parallel IO is not specified if total_tasks==1
if self.total_tasks == 1:
Expand Down
18 changes: 11 additions & 7 deletions scripts/lib/CIME/case_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ def _case_setup_impl(case, caseroot, clean=False, test_mode=False, reset=False,
else:
expect(False, "NINST_%s value %d greater than NTASKS_%s %d" % (comp, ninst, comp, ntasks))

# Set TOTAL_CORES
case.set_value("TOTAL_CORES", case.total_tasks * case.cores_per_task )

if os.path.exists("case.run"):
logger.info("Machine/Decomp/Pes configuration has already been done ...skipping")

case.initialize_derived_attributes()
else:
check_pelayouts_require_rebuild(case, models)

Expand All @@ -159,6 +158,12 @@ def _case_setup_impl(case, caseroot, clean=False, test_mode=False, reset=False,
cost_pes = env_mach_pes.get_cost_pes(pestot, thread_count, machine=case.get_value("MACH"))
case.set_value("COST_PES", cost_pes)

# Make sure pio settings are consistent
if adjust_pio:
adjust_pio_layout(case, tasks_per_node)

case.initialize_derived_attributes()

# create batch files
logger.info("Creating batch script case.run")
env_batch = case.get_env("batch")
Expand All @@ -176,17 +181,16 @@ def _case_setup_impl(case, caseroot, clean=False, test_mode=False, reset=False,
logger.info("Writing %s script from input template %s" % (job, input_batch_script))
env_batch.make_batch_script(input_batch_script, job, case, pestot, tasks_per_node, num_nodes, thread_count)

# Make sure pio settings are consistant
if adjust_pio:
adjust_pio_layout(case, tasks_per_node)

# Make a copy of env_mach_pes.xml in order to be able
# to check that it does not change once case.setup is invoked
logger.info("Locking file env_mach_pes.xml")
case.flush()
logger.debug("at copy TOTALPES = %s"%case.get_value("TOTALPES"))
lock_file("env_mach_pes.xml")

# Set TOTAL_CORES
case.set_value("TOTAL_CORES", case.total_tasks * case.cores_per_task )

# Create user_nl files for the required number of instances
if not os.path.exists("user_nl_cpl"):
logger.info("Creating user_nl_xxx files for components and cpl")
Expand Down
1 change: 1 addition & 0 deletions scripts/lib/update_acme_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"ERP.f45_g37_rx1.A",
"SMS_D_Ln9.f19_g16_rx1.A",
"DAE.f19_f19.A",
"PET.f19_f19.A",
"SMS.T42_T42.S",
"PRE.f45_g37_rx1.ADESP")
),
Expand Down