Skip to content

Commit

Permalink
Merge branch 'jgfouca/cime/kokkos_bld_improvements' into master (PR #…
Browse files Browse the repository at this point in the history
…2822)

Add a new kokkos build-only test to e3sm_developer.

Change list:
* Add a new 'B' test option to indicate a build-only test
* Have '--with-openmp --with-serial' be the default kokkos configuration
* Add SMS_B.ne4_ne4.FC5AV1C-L-AQUAP.cam-hommexx to e3sm_developer

[BFB]

* jgfouca/cime/kokkos_bld_improvements:
  Add a new kokkos build-only test to e3sm_developer.
  • Loading branch information
jgfouca committed Mar 27, 2019
2 parents 6061054 + 814b693 commit ee923ca
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
1 change: 0 additions & 1 deletion config/e3sm/machines/config_compilers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,6 @@ for mct, etc.

<compiler MACH="melvin" COMPILER="gnu">
<ALBANY_PATH>/projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install</ALBANY_PATH>
<KOKKOS_OPTIONS> --with-openmp --with-options=aggressive_vectorization </KOKKOS_OPTIONS>
<CFLAGS>
<append DEBUG="FALSE"> -O2 </append>
</CFLAGS>
Expand Down
1 change: 1 addition & 0 deletions config/e3sm/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"SMS.T62_oQU120_ais20.MPAS_LISIO_TEST",
"SMS.f09_g16_a.IGCLM45_MLI",
"SMS_P12x2.ne4_oQU240.A_WCYCL1850.allactive-mach_mods",
"SMS_B.ne4_ne4.FC5AV1C-L-AQUAP.cam-hommexx",
)
},

Expand Down
33 changes: 21 additions & 12 deletions scripts/lib/CIME/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ def _xml_phase(self, test):
opt.startswith('P') or # handled in create_newcase
opt.startswith('N') or # handled in create_newcase
opt.startswith('C') or # handled in create_newcase
opt.startswith('V')): # handled in create_newcase
opt.startswith('V') or # handled in create_newcase
opt == 'B'): # handled in run_phase
pass

elif opt.startswith('IOP'):
Expand Down Expand Up @@ -716,17 +717,25 @@ def _run_phase(self, test):
###########################################################################
test_dir = self._get_test_dir(test)

cmd = "./case.submit"
if not self._allow_pnl:
cmd += " --skip-preview-namelist"
if self._no_batch:
cmd += " --no-batch"
if self._mail_user:
cmd += " --mail-user={}".format(self._mail_user)
if self._mail_type:
cmd += " -M={}".format(",".join(self._mail_type))

return self._shell_cmd_for_phase(test, cmd, RUN_PHASE, from_dir=test_dir)
case_opts = parse_test_name(test)[1]
if case_opts is not None and "B" in case_opts: # pylint: disable=unsupported-membership-test
self._log_output(test, "{} SKIPPED for test '{}'".format(RUN_PHASE, test))
self._update_test_status_file(test, SUBMIT_PHASE, TEST_PASS_STATUS)
self._update_test_status_file(test, RUN_PHASE, TEST_PASS_STATUS)

return True, "SKIPPED"
else:
cmd = "./case.submit"
if not self._allow_pnl:
cmd += " --skip-preview-namelist"
if self._no_batch:
cmd += " --no-batch"
if self._mail_user:
cmd += " --mail-user={}".format(self._mail_user)
if self._mail_type:
cmd += " -M={}".format(",".join(self._mail_type))

return self._shell_cmd_for_phase(test, cmd, RUN_PHASE, from_dir=test_dir)

###########################################################################
def _run_catch_exceptions(self, test, phase, run):
Expand Down
12 changes: 9 additions & 3 deletions src/build_scripts/buildlib.kokkos
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

from standard_script_setup import *
from CIME.utils import expect, run_bld_cmd_ensure_logging, run_cmd_no_fail
from CIME.utils import expect, run_bld_cmd_ensure_logging, run_cmd_no_fail, run_cmd
from CIME.case import Case
from CIME.build import get_standard_makefile_args

Expand Down Expand Up @@ -52,8 +52,14 @@ def buildlib(bldroot, installpath, case):
# (generated from config_compilers.xml), but we want to otherwise
# let kokkos control flags
make_args = get_standard_makefile_args(case)
kokkos_options = run_cmd_no_fail("make -f Macros.make {} -p | grep KOKKOS_OPTIONS".format(make_args)).split(":=")[-1].strip()
cxx = run_cmd_no_fail("make -f Macros.make {} -p | grep SCXX".format(make_args)).split(":=")[-1].strip()
stat, output, _ = run_cmd("make -f Macros.make {} -p | grep KOKKOS_OPTIONS".format(make_args))
if stat == 0:
kokkos_options = output.split(":=")[-1].strip()
else:
kokkos_options = "--with-openmp --with-serial" # This is the default
logger.warning("Failed to find custom kokkos options, using default.")

cxx = run_cmd_no_fail("make -f Macros.make {} -p | grep SCXX".format(make_args)).split(":=")[-1].strip()

gmake_cmd = case.get_value("GMAKE")
gmake_j = case.get_value("GMAKE_J")
Expand Down

0 comments on commit ee923ca

Please sign in to comment.