Repository: ESMCI/cime

Issue:
Jgfouca/branch for acme split 2018 09 10
Test suite: scripts_regression_tests
Test baseline: 
Test namelist changes: 
Test status: [bit for bit, roundoff, climate changing]

Fixes [CIME Github issue #]

User interface changes?: 

Update gh-pages html (Y/N)?:

Code review: 



Discussion:
@jgfouca here is a minor issue from travis-ci - I'll try to do a full review today or tomorrow.
scripts/lib/CIME/SystemTests/mvk.py:54:12: W1505: Using deprecated method warn() (deprecated-method)

Resolving patch:
diff --git a/scripts/lib/CIME/BuildTools/valuesetting.py b/scripts/lib/CIME/BuildTools/valuesetting.py
--- a/scripts/lib/CIME/BuildTools/valuesetting.py
+++ b/scripts/lib/CIME/BuildTools/valuesetting.py
@@ -115,7 +115,7 @@ def has_special_case(self, other):
 
         >>> a = ValueSetting('foo', False, {"DEBUG": "TRUE"}, [], [])
         >>> b = ValueSetting('bar', False, {"DEBUG": "TRUE", "MPILIB": "mpich2"}, [], [])
-        >>> c = ValueSetting('bar', False, {"DEBUG": "TRUE", "compile_threaded": "false"}, [], [])
+        >>> c = ValueSetting('bar', False, {"DEBUG": "TRUE", "compile_threaded": "FALSE"}, [], [])
         >>> d = ValueSetting('foo', False, {"DEBUG": "FALSE"}, [], [])
         >>> a.has_special_case(b)
         True
diff --git a/scripts/lib/CIME/build.py b/scripts/lib/CIME/build.py
--- a/scripts/lib/CIME/build.py
+++ b/scripts/lib/CIME/build.py
@@ -18,7 +18,7 @@ def get_standard_makefile_args(case):
                  "OCN_SUBMODEL", "CISM_USE_TRILINOS", "USE_ALBANY", "USE_PETSC"]
 
     make_args = "CIME_MODEL={} ".format(case.get_value("MODEL"))
-    make_args += " compile_threaded={} ".format(case.get_build_threaded())
+    make_args += " compile_threaded={} ".format(stringify_bool(case.get_build_threaded()))
     for var in variables:
         make_args+=xml_to_make_variable(case, var)
 
diff --git a/scripts/lib/CIME/case/check_input_data.py b/scripts/lib/CIME/case/check_input_data.py
--- a/scripts/lib/CIME/case/check_input_data.py
+++ b/scripts/lib/CIME/case/check_input_data.py
@@ -37,6 +37,8 @@ def _download_checksum_file(rundir):
         else:
             expect(False, "Unsupported inputdata protocol: {}".format(protocol))
 
+        if not chksum_file:
+            continue
 
         success = False
         rel_path = chksum_file
@@ -355,7 +357,8 @@ def verify_chksum(input_data_root, rundir, filename, isdirectory):
     if not chksum_hash:
         hashfile = os.path.join(rundir, local_chksum_file)
         if not os.path.isfile(hashfile):
-            expect(False, "Failed to find or download file {}".format(hashfile))
+            logger.warning("Failed to find or download file {}".format(hashfile))
+            return
 
         with open(hashfile) as fd:
             lines = fd.readlines()
@@ -365,6 +368,7 @@ def verify_chksum(input_data_root, rundir, filename, isdirectory):
                     expect(chksum_hash[fname] == fchksum, " Inconsistent hashes in chksum for file {}".format(fname))
                 else:
                     chksum_hash[fname] = fchksum
+
     if isdirectory:
         filenames = glob.glob(os.path.join(filename,"*.*"))
     else:
@@ -381,8 +385,6 @@ def verify_chksum(input_data_root, rundir, filename, isdirectory):
                        "chksum mismatch for file {} expected {} found {}".
                        format(os.path.join(input_data_root,fname),chksum, chksum_hash[fname]))
 
-
-
 def md5(fname):
     """
     performs an md5 sum one chunk at a time to avoid memory issues with large files.


Test patch:
diff --git a/config/e3sm/tests.py b/config/e3sm/tests.py
--- a/config/e3sm/tests.py
+++ b/config/e3sm/tests.py
@@ -54,6 +54,7 @@
             "PEM_Ln5.ne4_ne4.FC5AV1C-L",
             "SMS_D_Ln5.ne4_ne4.FC5AV1C-L.cam-cosplite_nhtfrq5",
             "ERS_Ld5.ne4_ne4.FC5AV1C-L.cam-rrtmgp",
+            "ERS_Ld5.ne4_ne4.FC5AV1C-L.cam-gust_param",
             "REP_Ln5.ne4_ne4.FC5AV1C-L",
             )
         },
@@ -112,6 +113,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",
             )
         },
 
diff --git a/doc/source/users_guide/unit_testing.rst b/doc/source/users_guide/unit_testing.rst
--- a/doc/source/users_guide/unit_testing.rst
+++ b/doc/source/users_guide/unit_testing.rst
@@ -165,7 +165,7 @@ For a serial build, your setting will look like this example:
 
 .. code-block:: xml
 
-     <PFUNIT_PATH MPILIB="mpi-serial" compile_threaded="false">$ENV{CESMDATAROOT}/tools/pFUnit/pFUnit3.2.8_cheyenne_Intel17.0.1_noMPI_noOpenMP</PFUNIT_PATH>
+     <PFUNIT_PATH MPILIB="mpi-serial" compile_threaded="FALSE">$ENV{CESMDATAROOT}/tools/pFUnit/pFUnit3.2.8_cheyenne_Intel17.0.1_noMPI_noOpenMP</PFUNIT_PATH>
 
 The ``MPILIB`` attribute should be either:
 
@@ -173,7 +173,7 @@ The ``MPILIB`` attribute should be either:
 
 * the name of the MPI library you used for a pFUnit build where ``-DMPI=YES``. (For example, you might use ``mpich``, which should be one of the machine's MPI libraries specified by ``MPILIBS`` in **config_machines.xml**.)
 
-The ``compile_threaded`` attribute should be either ``true`` or ``false`` depending on the value of ``-DOPENMP``.
+The ``compile_threaded`` attribute should be either ``TRUE`` or ``FALSE`` depending on the value of ``-DOPENMP``.
 
 Once you have specified the path for your build(s), you should be able to run the unit tests by following the instructions in :ref:`running_unit_tests`.
 
diff --git a/scripts/create_test b/scripts/create_test
--- a/scripts/create_test
+++ b/scripts/create_test
@@ -411,6 +411,13 @@ def parse_command_line(args, description):
             logging.info("Suite supports shared executables, setting --single-exe to True")
             args.single_exe = True
 
+        if len(args.testargs) == 1 and \
+           args.testargs[0] in get_tests.get_test_suites() and \
+           get_tests.get_test_data(args.testargs[0])[2] and \
+           not args.single_exe:
+            logging.info("Suite supports shared executables, setting --single-exe to True")
+            args.single_exe = True
+
     expect(mach_obj.is_valid_compiler(args.compiler),
            "Compiler %s not valid for machine %s" % (args.compiler, mach_obj.get_machine_name()))
 
diff --git a/scripts/fortran_unit_testing/run_tests.py b/scripts/fortran_unit_testing/run_tests.py
--- a/scripts/fortran_unit_testing/run_tests.py
+++ b/scripts/fortran_unit_testing/run_tests.py
@@ -237,7 +237,7 @@ def find_pfunit(compilerobj, mpilib, use_openmp):
     - use_openmp: Boolean
     """
     attrs = {"MPILIB": mpilib,
-             "compile_threaded": "true" if use_openmp else "false"
+             "compile_threaded": "TRUE" if use_openmp else "FALSE"
              }
 
     pfunit_path = compilerobj.get_optional_compiler_node("PFUNIT_PATH", attributes=attrs)
@@ -337,9 +337,9 @@ def _main():
     os.environ["DEBUG"] = stringify_bool(debug)
     os.environ["MPILIB"] = mpilib
     if use_openmp:
-        os.environ["compile_threaded"] = "true"
+        os.environ["compile_threaded"] = "TRUE"
     else:
-        os.environ["compile_threaded"] = "false"
+        os.environ["compile_threaded"] = "FALSE"
 
     os.environ["UNIT_TEST_HOST"] = socket.gethostname()
     if "NETCDF_PATH" in os.environ and not "NETCDF" in os.environ:
diff --git a/scripts/lib/CIME/test_scheduler.py b/scripts/lib/CIME/test_scheduler.py
--- a/scripts/lib/CIME/test_scheduler.py
+++ b/scripts/lib/CIME/test_scheduler.py
@@ -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'):
@@ -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):
diff --git a/scripts/tests/scripts_regression_tests.py b/scripts/tests/scripts_regression_tests.py
--- a/scripts/tests/scripts_regression_tests.py
+++ b/scripts/tests/scripts_regression_tests.py
@@ -235,7 +235,7 @@ def _has_unit_test_support(self):
             compiler = Compilers(MACHINE, compiler=default_compiler)
         else:
             compiler = Compilers(MACHINE, compiler=TEST_COMPILER)
-        attrs = {'MPILIB': 'mpi-serial', 'compile_threaded': 'false'}
+        attrs = {'MPILIB': 'mpi-serial', 'compile_threaded': 'FALSE'}
         pfunit_path = compiler.get_optional_compiler_node("PFUNIT_PATH",
                                                           attributes=attrs)
         if pfunit_path is None: