-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
""" | ||
CIME HOMME test. This class inherits from SystemTestsCommon | ||
""" | ||
from CIME.XML.standard_module_setup import * | ||
from CIME.SystemTests.system_tests_common import SystemTestsCommon | ||
from CIME.build import post_build, case_build | ||
|
||
import shutil | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
class HOMME(SystemTestsCommon): | ||
|
||
def __init__(self, case): | ||
""" | ||
initialize an object interface to the SMS system test | ||
""" | ||
SystemTestsCommon.__init__(self, case) | ||
|
||
def build_phase(self, sharedlib_only=False, model_only=False): | ||
if not sharedlib_only: | ||
# Build HOMME | ||
srcroot = self._case.get_value("SRCROOT") | ||
mach = self._case.get_value("MACH") | ||
procs = self._case.get_value("TOTALPES") | ||
exeroot = self._case.get_value("EXEROOT") | ||
baseline = self._case.get_value("CCSM_BASELINE") | ||
basegen = self._case.get_value("BASEGEN_CASE") | ||
basecmp = self._case.get_value("BASECMP_CASE") | ||
generate = self._case.get_value("GENERATE_BASELINE") | ||
|
||
basename = basegen if generate else basecmp | ||
cmake_cmd = "cmake -C %s/components/homme/cmake/machineFiles/%s.cmake -DUSE_NUM_PROCS=%s %s/components/homme -DHOMME_BASELINE_DIR=%s/%s >& homme.bldlog" % (srcroot, mach, procs, srcroot, baseline, basename) | ||
|
||
run_cmd_no_fail(cmake_cmd, from_dir=exeroot) | ||
run_cmd_no_fail("make -j8 >> homme.bldlog 2>&1", from_dir=exeroot) | ||
|
||
post_build(self._case, [os.path.join(exeroot, "homme.bldlog")]) | ||
|
||
def run_phase(self): | ||
|
||
rundir = self._case.get_value("RUNDIR") | ||
exeroot = self._case.get_value("EXEROOT") | ||
baseline = self._case.get_value("CCSM_BASELINE") | ||
compare = self._case.get_value("COMPARE_BASELINE") | ||
generate = self._case.get_value("GENERATE_BASELINE") | ||
basegen = self._case.get_value("BASEGEN_CASE") | ||
|
||
log = os.path.join(rundir, "homme.log") | ||
if os.path.exists(log): | ||
os.remove(log) | ||
|
||
if generate: | ||
full_baseline_dir = os.path.join(baseline, basegen, "tests", "baseline") | ||
run_cmd_no_fail("make -j 4 baseline >& %s" % log, from_dir=exeroot) | ||
if os.path.isdir(full_baseline_dir): | ||
shutil.rmtree(full_baseline_dir) | ||
shutil.copytree(os.path.join(exeroot, "tests", "baseline"), full_baseline_dir) | ||
elif compare: | ||
run_cmd_no_fail("make -j 4 check >& %s" % log, from_dir=exeroot) | ||
else: | ||
run_cmd_no_fail("make -j 4 baseline >& %s" % log, from_dir=exeroot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters