-
Notifications
You must be signed in to change notification settings - Fork 206
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
create_test: add --driver support for e3sm #4673
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,11 +209,12 @@ def __init__( | |
workflow=None, | ||
chksum=False, | ||
force_rebuild=False, | ||
driver=None, | ||
): | ||
########################################################################### | ||
self._cime_root = get_cime_root() | ||
self._cime_model = get_model() | ||
self._cime_driver = get_cime_default_driver() | ||
self._cime_driver = driver if driver is not None else get_cime_default_driver() | ||
self._save_timing = save_timing | ||
self._queue = queue | ||
self._test_data = ( | ||
|
@@ -649,6 +650,7 @@ def _create_newcase_phase(self, test): | |
mpilib = None | ||
ninst = 1 | ||
ncpl = 1 | ||
driver = self._cime_driver | ||
if case_opts is not None: | ||
for case_opt in case_opts: # pylint: disable=not-an-iterable | ||
if case_opt.startswith("M"): | ||
|
@@ -681,15 +683,16 @@ def _create_newcase_phase(self, test): | |
) | ||
) | ||
elif case_opt.startswith("V"): | ||
self._cime_driver = case_opt[1:] | ||
create_newcase_cmd += " --driver {}".format(self._cime_driver) | ||
driver = case_opt[1:] | ||
|
||
create_newcase_cmd += " --driver {}".format(driver) | ||
|
||
if ( | ||
"--ninst" in create_newcase_cmd | ||
and not "--multi-driver" in create_newcase_cmd | ||
): | ||
if "--driver nuopc" in create_newcase_cmd or ( | ||
"--driver" not in create_newcase_cmd and self._cime_driver == "nuopc" | ||
"--driver" not in create_newcase_cmd and driver == "nuopc" | ||
): | ||
expect(False, "_N option not supported by nuopc driver, use _C instead") | ||
|
||
|
@@ -704,7 +707,7 @@ def _create_newcase_phase(self, test): | |
self._log_output(test, error) | ||
return False, error | ||
|
||
files = Files(comp_interface=self._cime_driver) | ||
files = Files(comp_interface=driver) | ||
testmods_dir = files.get_value( | ||
"TESTS_MODS_DIR", {"component": component} | ||
) | ||
|
@@ -783,23 +786,28 @@ def _xml_phase(self, test): | |
test_dir = self._get_test_dir(test) | ||
envtest = EnvTest(test_dir) | ||
|
||
# Find driver. It may be different for the current test if V testopt is used | ||
driver = self._cime_driver | ||
if case_opts is not None: | ||
for case_opt in case_opts: # pylint: disable=not-an-iterable | ||
if case_opt.startswith("V"): | ||
driver = case_opt[1:] | ||
|
||
# Determine list of component classes that this coupler/driver knows how | ||
# to deal with. This list follows the same order as compset longnames follow. | ||
files = Files(comp_interface=self._cime_driver) | ||
files = Files(comp_interface=driver) | ||
ufs_driver = os.environ.get("UFS_DRIVER") | ||
attribute = None | ||
if ufs_driver: | ||
attribute = {"component": ufs_driver} | ||
|
||
drv_config_file = files.get_value("CONFIG_CPL_FILE", attribute=attribute) | ||
|
||
if self._cime_driver == "nuopc" and not os.path.exists(drv_config_file): | ||
if driver == "nuopc" and not os.path.exists(drv_config_file): | ||
drv_config_file = files.get_value("CONFIG_CPL_FILE", {"component": "cpl"}) | ||
expect( | ||
os.path.exists(drv_config_file), | ||
"File {} not found, cime driver {}".format( | ||
drv_config_file, self._cime_driver | ||
), | ||
"File {} not found, cime driver {}".format(drv_config_file, driver), | ||
) | ||
|
||
drv_comp = Component(drv_config_file, "CPL") | ||
|
@@ -924,7 +932,9 @@ def _xml_phase(self, test): | |
elif opt.startswith("A"): | ||
# A option is for testing in ASYNC IO mode, only available with nuopc driver and pio2 | ||
envtest.set_test_parameter("PIO_ASYNC_INTERFACE", "TRUE") | ||
envtest.set_test_parameter("CIME_DRIVER", "nuopc") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also looked really problematic. Setting the driver to nuopc even if that doesn't match cime_driver? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PIO async mode is only supported in nuopc - but since cesm only supports the nuopc driver now, this is okay to remove. |
||
expect( | ||
driver == "nuopc", "ASYNC IO mode only works with nuopc driver" | ||
) | ||
envtest.set_test_parameter("PIO_VERSION", "2") | ||
match = re.match("A([0-9]+)x?([0-9])*", opt) | ||
envtest.set_test_parameter("PIO_NUMTASKS_CPL", match.group(1)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code looks like a bug. The presence of one test with Vdriver would change the driver for all the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's been there for a long time, seems like we would have seen problems by now if that were the case. On the other hand, I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean adding one Vdriver a test in a suite would change all tests in that suite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rljacob , yes.
self._cime_driver
is shared for all tests.