Skip to content

Commit

Permalink
Update CIME to ESMCI cime5.8.2-3 (PR #2938)
Browse files Browse the repository at this point in the history
Update CIME to ESMCI cime5.8.2-3

Squash merge of jgfouca/branch-for-to-acme-2019-05-21

Features:
* Allow custom run_exe and run_misc_suffix
* send run two TestStatus.log to case1 log for 2-case tests

Bugs:
* Fix ConfigParser fails with some saved submit_options

[BFB]
  • Loading branch information
jgfouca authored May 23, 2019
1 parent 577f07f commit d115201
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 25 deletions.
6 changes: 6 additions & 0 deletions cime/config/xml_schemas/config_machines.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
<xs:element name="executable" type="xs:string"/>
<xs:element name="default_run_exe" type="xs:string"/>
<xs:element name="default_run_misc_suffix" type="xs:string"/>
<xs:element name="run_exe" type="xs:string"/>
<xs:element name="run_misc_suffix" type="xs:string"/>
<xs:element name="RUNDIR" type="xs:string"/>
<xs:element name="EXEROOT" type="xs:string"/>
<xs:element name="TEST_TPUT_TOLERANCE" type="xs:string"/>
Expand Down Expand Up @@ -179,6 +181,10 @@
<xs:sequence>
<xs:element ref="executable"/>
<xs:element ref="arguments" minOccurs="0"/>
<!-- run_exe: The run executable to use; overrides default_run_exe -->
<xs:element ref="run_exe" minOccurs="0"/>
<!-- run_misc_suffix: the misc run suffix to use; overrides default_run_misc_suffix -->
<xs:element ref="run_misc_suffix" minOccurs="0"/>
</xs:sequence>
<xs:attribute ref="compiler"/>
<xs:attribute ref="queue"/>
Expand Down
2 changes: 2 additions & 0 deletions cime/config/xml_schemas/env_mach_specific.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
<xs:sequence>
<xs:element ref="executable"/>
<xs:element minOccurs="0" maxOccurs="1" ref="arguments"/>
<xs:element minOccurs="0" maxOccurs="1" name="run_exe" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="run_misc_suffix" type="xs:string"/>
</xs:sequence>
<xs:attribute ref="compiler"/>
<xs:attribute ref="mpilib"/>
Expand Down
2 changes: 2 additions & 0 deletions cime/doc/source/users_guide/machine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Each ``<machine>`` tag requires the following input:
* May have optional attributes of ``compiler``, ``mpilib`` and/or ``threaded``
* May have an optional ``<arguments>`` element which in turn contains one or more ``<arg>`` elements.
These specify the arguments to the mpi executable and are dependent on your mpi library implementation.
* May have an option ``<run_exe>`` element which overrides the ``default_run_exe``
* May have an option ``<run_misc_suffix>`` element which overrides the ``default_run_misc_suffix``


* ``module_system``: How and what modules to load on this system. Module systems allow you to easily load multiple compiler environments on a machine. CIME provides support for two types of module tools: `module <http://www.tacc.utexas.edu/tacc-projects/mclay/lmod>`_ and `soft <http://www.mcs.anl.gov/hs/software/systems/softenv/softenv-intro.html>`_. If neither of these is available on your machine, simply set ``<module_system type="none"\>``.
Expand Down
4 changes: 0 additions & 4 deletions cime/scripts/Tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,6 @@ ifeq ($(strip $(USE_KOKKOS)), TRUE)
CXX_LDFLAGS += $(KOKKOS_LDFLAGS)
endif

ifeq ($(strip $(USE_FMS)), TRUE)
SLIBS += -lfms
endif

# Set MOAB info if it is being used
ifeq ($(strip $(USE_MOAB)), TRUE)
ifdef MOAB_PATH
Expand Down
2 changes: 1 addition & 1 deletion cime/scripts/fortran_unit_testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def _main():
}

# We can get away with specifying case=None since we're using exe_only=True
mpirun_command, _ = machspecific.get_mpirun(None, mpi_attribs, None, exe_only=True)
mpirun_command, _, _, _ = machspecific.get_mpirun(None, mpi_attribs, None, exe_only=True)
mpirun_command = machspecific.get_resolved_value(mpirun_command)
logger.info("mpirun command is '{}'".format(mpirun_command))

Expand Down
2 changes: 1 addition & 1 deletion cime/scripts/lib/CIME/SystemTests/erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is a pes counts hybrid (open-MP/MPI) restart bfb test from
startup. This is just like an ERS test but the pe-counts/threading
count are modified on retart.
count are modified on restart.
(1) Do an initial run with pes set up out of the box (suffix base)
(2) Do a restart test with half the number of tasks and threads (suffix rest)
"""
Expand Down
20 changes: 10 additions & 10 deletions cime/scripts/lib/CIME/SystemTests/system_tests_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def build(self, sharedlib_only=False, model_only=False):
else:
excmsg = "Exception during build:\n{}\n{}".format(str(e), traceback.format_exc())

append_testlog(excmsg)
append_testlog(excmsg, self._orig_caseroot)
raise

finally:
Expand Down Expand Up @@ -163,7 +163,7 @@ def run(self, skip_pnl=False):
else:
excmsg = "Exception during run:\n{}\n{}".format(str(e), traceback.format_exc())

append_testlog(excmsg)
append_testlog(excmsg, self._orig_caseroot)
raise

finally:
Expand Down Expand Up @@ -261,7 +261,7 @@ def _coupler_log_indicates_run_complete(self):

def _component_compare_copy(self, suffix):
comments = copy(self._case, suffix)
append_testlog(comments)
append_testlog(comments, self._orig_caseroot)

def _component_compare_test(self, suffix1, suffix2,
success_change=False,
Expand All @@ -280,7 +280,7 @@ def _component_compare_test(self, suffix1, suffix2,
if success_change:
success = not success

append_testlog(comments)
append_testlog(comments, self._orig_caseroot)
status = TEST_PASS_STATUS if success else TEST_FAIL_STATUS
with self._test_status:
self._test_status.set_status("{}_{}_{}".format(COMPARE_PHASE, suffix1, suffix2), status)
Expand Down Expand Up @@ -349,7 +349,7 @@ def _phase_modifying_call(self, phase, function):
excmsg = "Exception during {}:\n{}\n{}".format(phase, msg, traceback.format_exc())

logger.warning(excmsg)
append_testlog(excmsg)
append_testlog(excmsg, self._orig_caseroot)

with self._test_status:
self._test_status.set_status(phase, TEST_FAIL_STATUS, comments="exception")
Expand Down Expand Up @@ -384,7 +384,7 @@ def _check_for_memleak(self):
self._test_status.set_status(MEMLEAK_PHASE, TEST_PASS_STATUS)
else:
comment = "memleak detected, memory went from {:f} to {:f} in {:d} days".format(originalmem, finalmem, finaldate-originaldate)
append_testlog(comment)
append_testlog(comment, self._orig_caseroot)
self._test_status.set_status(MEMLEAK_PHASE, TEST_FAIL_STATUS, comments=comment)

def compare_env_run(self, expected=None):
Expand Down Expand Up @@ -449,7 +449,7 @@ def _compare_memory(self):
elif self._test_status.get_status(MEMCOMP_PHASE) != TEST_FAIL_STATUS:
comment = "Error: Memory usage increase > 10% from baseline"
self._test_status.set_status(MEMCOMP_PHASE, TEST_FAIL_STATUS, comments=comment)
append_testlog(comment)
append_testlog(comment, self._orig_caseroot)

def _compare_throughput(self):
with self._test_status:
Expand Down Expand Up @@ -481,7 +481,7 @@ def _compare_throughput(self):
elif self._test_status.get_status(THROUGHPUT_PHASE) != TEST_FAIL_STATUS:
comment = "Error: Computation time increase > {:d} pct from baseline".format(int(tolerance*100))
self._test_status.set_status(THROUGHPUT_PHASE, TEST_FAIL_STATUS, comments=comment)
append_testlog(comment)
append_testlog(comment, self._orig_caseroot)

def _compare_baseline(self):
"""
Expand All @@ -490,7 +490,7 @@ def _compare_baseline(self):
with self._test_status:
# compare baseline
success, comments = compare_baseline(self._case)
append_testlog(comments)
append_testlog(comments, self._orig_caseroot)
status = TEST_PASS_STATUS if success else TEST_FAIL_STATUS
baseline_name = self._case.get_value("BASECMP_CASE")
ts_comments = os.path.dirname(baseline_name) + ": " + get_ts_synopsis(comments)
Expand All @@ -503,7 +503,7 @@ def _generate_baseline(self):
with self._test_status:
# generate baseline
success, comments = generate_baseline(self._case)
append_testlog(comments)
append_testlog(comments, self._orig_caseroot)
status = TEST_PASS_STATUS if success else TEST_FAIL_STATUS
baseline_name = self._case.get_value("BASEGEN_CASE")
self._test_status.set_status(GENERATE_PHASE, status, comments=os.path.dirname(baseline_name))
Expand Down
16 changes: 13 additions & 3 deletions cime/scripts/lib/CIME/XML/env_mach_specific.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def populate(self, machobj):
if len(nodes) == 0:
value = self.text(default_run_exe_node) if item == "run_exe" else self.text(default_run_misc_suffix_node)
else:
value = nodes[0].text
value = self.text(nodes[0])

entity_node = self.make_child("entry", {"id":item, "value":value}, root=group_node)

Expand Down Expand Up @@ -452,7 +452,7 @@ def get_mpirun(self, case, attribs, job, exe_only=False):

# if there are no special arguments required for mpi-serial it need not have an entry in config_machines.xml
if "mpilib" in attribs and attribs["mpilib"] == "mpi-serial" and best_match is None:
return "",[]
return "",[],None,None

expect(best_match is not None or default_match is not None,
"Could not find a matching MPI for attributes: {}".format(attribs))
Expand All @@ -474,8 +474,18 @@ def get_mpirun(self, case, attribs, job, exe_only=False):
exec_node = self.get_child("executable", root=the_match)
expect(exec_node is not None,"No executable found")
executable = self.text(exec_node)
run_exe = None
run_misc_suffix = None

return executable, args
run_exe_node = self.get_optional_child('run_exe', root=the_match)
if run_exe_node:
run_exe = self.text(run_exe_node)

run_misc_suffix_node = self.get_optional_child('run_misc_suffix', root=the_match)
if run_misc_suffix_node:
run_misc_suffix = self.text(run_misc_suffix_node)

return executable, args, run_exe, run_misc_suffix

def get_type_info(self, vid):
return "char"
12 changes: 9 additions & 3 deletions cime/scripts/lib/CIME/case/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,6 @@ def get_mpirun_cmd(self, job=None, allow_unresolved_envvars=True):
run_exe = env_mach_specific.get_value("run_exe")
run_misc_suffix = env_mach_specific.get_value("run_misc_suffix")
run_misc_suffix = "" if run_misc_suffix is None else run_misc_suffix
run_suffix = run_exe + run_misc_suffix

mpirun_cmd_override = self.get_value("MPI_RUN_COMMAND")
if mpirun_cmd_override not in ["", None, "UNSET"]:
Expand All @@ -1379,7 +1378,14 @@ def get_mpirun_cmd(self, job=None, allow_unresolved_envvars=True):
"unit_testing" : False
}

executable, mpi_arg_list = env_mach_specific.get_mpirun(self, mpi_attribs, job)
executable, mpi_arg_list, custom_run_exe, custom_run_misc_suffix = env_mach_specific.get_mpirun(self, mpi_attribs, job)
if custom_run_exe:
logger.info('Using a custom run_exe {}'.format(custom_run_exe))
run_exe = custom_run_exe
if custom_run_misc_suffix:
logger.info('Using a custom run_misc_suffix {}'.format(custom_run_misc_suffix))
run_misc_suffix = custom_run_misc_suffix


# special case for aprun
if executable is not None and "aprun" in executable and not "theta" in self.get_value("MACH"):
Expand All @@ -1393,7 +1399,7 @@ def get_mpirun_cmd(self, job=None, allow_unresolved_envvars=True):
if self.get_value("BATCH_SYSTEM") == "cobalt":
mpi_arg_string += " : "

return self.get_resolved_value("{} {} {}".format(executable if executable is not None else "", mpi_arg_string, run_suffix), allow_unresolved_envvars=allow_unresolved_envvars)
return self.get_resolved_value("{} {} {} {}".format(executable if executable is not None else "", mpi_arg_string, run_exe, run_misc_suffix), allow_unresolved_envvars=allow_unresolved_envvars)

def set_model_version(self, model):
version = "unknown"
Expand Down
2 changes: 1 addition & 1 deletion cime/scripts/lib/CIME/case/case_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def submit(self, job=None, no_batch=False, prereq=None, allow_fail=False, resubm
# any submit options used on the original submit and use them again
submit_options = os.path.join(caseroot, ".submit_options")
if resubmit and os.path.exists(submit_options):
config = configparser.SafeConfigParser()
config = configparser.RawConfigParser()
config.read(submit_options)
if not skip_pnl and config.has_option('SubmitOptions','skip_pnl'):
skip_pnl = config.getboolean('SubmitOptions', 'skip_pnl')
Expand Down
7 changes: 5 additions & 2 deletions cime/scripts/lib/e3sm_cime_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ def setup():
if ESMCI_REMOTE_NAME not in remotes:
run_cmd_no_fail("git remote add {} {}".format(ESMCI_REMOTE_NAME, ESMCI_URL), verbose=True)

run_cmd_no_fail("git fetch --prune {}".format(ESMCI_REMOTE_NAME), verbose=True)
run_cmd_no_fail("git fetch --prune {} --tags".format(ESMCI_REMOTE_NAME), verbose=True)
for origin in ["origin", ESMCI_REMOTE_NAME]:
run_cmd_no_fail("git fetch --prune {}".format(origin), verbose=True)
run_cmd_no_fail("git fetch --prune {} --tags".format(origin), verbose=True)

run_cmd_no_fail("git clean -fd", verbose=True)

run_cmd_no_fail("git clean -fd", verbose=True)

Expand Down

0 comments on commit d115201

Please sign in to comment.