Esempio n. 1
0
    def _create_newcase_phase(self, test_name):
    ###########################################################################
        test_dir = self._get_test_dir(test_name)

        test_case, case_opts, grid, compset, machine, compiler, test_mods = acme_util.parse_test_name(test_name)
        if (compiler != self._compiler):
            raise StandardError("Test '%s' has compiler that does not match instance compliler '%s'" % (test_name, self._compiler))
        if (self._parallel_jobs == 1):
            scratch_dir = acme_util.get_machine_info("CESMSCRATCHROOT", machine=machine, project=self._project)
            sharedlibroot = os.path.join(scratch_dir, "sharedlibroot.%s" % self._test_id)
        else:
            # Parallelizing builds introduces potential sync problems with sharedlibroot
            # Just let every case build it's own
            sharedlibroot = os.path.join(test_dir, "sharedlibroot.%s" % self._test_id)

        create_newcase_cmd = "%s -silent -case %s -res %s -mach %s -compiler %s -compset %s -testname %s -project %s -nosavetiming -sharedlibroot %s" % \
                              (os.path.join(self._cime_root, "scripts", "create_newcase"),
                               test_dir, grid, machine, compiler, compset, test_case, self._project,
                               sharedlibroot)
        if (case_opts is not None):
            create_newcase_cmd += " -confopts _%s" % ("_".join(case_opts))
        if (test_mods is not None):
            test_mod_file = os.path.join(self._cime_root, "scripts", "Testing", "Testlistxml", "testmods_dirs", test_mods)
            if (not os.path.exists(test_mod_file)):
                self._log_output(test_name, "Missing testmod file '%s'" % test_mod_file)
                return False
            create_newcase_cmd += " -user_mods_dir %s" % test_mod_file

        return self._run_phase_command(test_name, create_newcase_cmd, CREATE_NEWCASE_PHASE)
Esempio n. 2
0
    def _create_newcase_phase(self, test_name):
    ###########################################################################
        test_dir = self._get_test_dir(test_name)

        test_case, case_opts, grid, compset, machine, compiler, test_mods = acme_util.parse_test_name(test_name)
        if (compiler != self._compiler):
            raise StandardError("Test '%s' has compiler that does not match instance compliler '%s'" % (test_name, self._compiler))
        if (self._parallel_jobs == 1):
            scratch_dir = acme_util.get_machine_info("CESMSCRATCHROOT", machine=machine, project=self._project)
            sharedlibroot = os.path.join(scratch_dir, "sharedlibroot.%s" % self._test_id)
        else:
            # Parallelizing builds introduces potential sync problems with sharedlibroot
            # Just let every case build it's own
            sharedlibroot = os.path.join(test_dir, "sharedlibroot.%s" % self._test_id)

        create_newcase_cmd = "%s -silent -case %s -res %s -mach %s -compiler %s -compset %s -testname %s -project %s -nosavetiming -sharedlibroot %s" % \
                              (os.path.join(self._cime_root, "scripts", "create_newcase"),
                               test_dir, grid, machine, compiler, compset, test_case, self._project,
                               sharedlibroot)
        if (case_opts is not None):
            create_newcase_cmd += " -confopts _%s" % ("_".join(case_opts))
        if (test_mods is not None):
            test_mod_file = os.path.join(self._cime_root, "scripts", "Testing", "Testlistxml", "testmods_dirs", test_mods)
            if (not os.path.exists(test_mod_file)):
                self._log_output(test_name, "Missing testmod file '%s'" % test_mod_file)
                return False
            create_newcase_cmd += " -user_mods_dir %s" % test_mod_file

        return self._run_phase_command(test_name, create_newcase_cmd, CREATE_NEWCASE_PHASE)
Esempio n. 3
0
    def _setup_phase(self, test_name):
    ###########################################################################
        test_case = acme_util.parse_test_name(test_name)[0]
        test_dir  = self._get_test_dir(test_name)
        test_case_definition_dir = os.path.join(self._cime_root, "scripts", "Testing", "Testcases")
        test_build = os.path.join(test_dir, "%s.test_build" % self._get_case_id(test_name))

        if (os.path.exists(os.path.join(test_case_definition_dir, "%s_build.csh" % test_case))):
            shutil.copy(os.path.join(test_case_definition_dir, "%s_build.csh" % test_case), test_build)
        else:
            shutil.copy(os.path.join(test_case_definition_dir, "tests_build.csh"), test_build)

        return self._run_phase_command(test_name, "./cesm_setup", SETUP_PHASE, from_dir=test_dir)
Esempio n. 4
0
    def _setup_phase(self, test_name):
    ###########################################################################
        test_case = acme_util.parse_test_name(test_name)[0]
        test_dir  = self._get_test_dir(test_name)
        test_case_definition_dir = os.path.join(self._cime_root, "scripts", "Testing", "Testcases")
        test_build = os.path.join(test_dir, "%s.test_build" % self._get_case_id(test_name))

        if (os.path.exists(os.path.join(test_case_definition_dir, "%s_build.csh" % test_case))):
            shutil.copy(os.path.join(test_case_definition_dir, "%s_build.csh" % test_case), test_build)
        else:
            shutil.copy(os.path.join(test_case_definition_dir, "tests_build.csh"), test_build)

        return self._run_phase_command(test_name, "./cesm_setup", SETUP_PHASE, from_dir=test_dir)
Esempio n. 5
0
    def _xml_phase(self, test_name):
        ###########################################################################
        test_case, _, _, _, machine, _, _ = acme_util.parse_test_name(
            test_name)

        xml_file = os.path.join(self._get_test_dir(test_name), "env_test.xml")
        xml_bridge_cmd = os.path.join(acme_util.get_acme_scripts_root(),
                                      "xml_bridge")

        mach_dir = os.path.join(self._cime_root, "machines-acme")
        xml_bridge_cmd += " %s %s %s" % (mach_dir, machine, xml_file)

        xml_bridge_cmd += " TESTCASE,%s" % test_case
        xml_bridge_cmd += " TEST_TESTID,%s" % self._test_id

        test_argv = "-testname %s -testroot %s" % (test_name, self._test_root)
        if (self._generate):
            test_argv += " -generate %s" % self._baseline_name
        if (self._compare):
            test_argv += " -compare %s" % self._baseline_name
        xml_bridge_cmd += " 'TEST_ARGV,%s'" % test_argv

        xml_bridge_cmd += " CASEBASEID,%s" % test_name

        if (self._generate):
            xml_bridge_cmd += " BASELINE_NAME_GEN,%s" % self._baseline_name
            xml_bridge_cmd += " BASEGEN_CASE,%s" % os.path.join(
                self._baseline_name, test_name)
        if (self._compare):
            xml_bridge_cmd += " BASELINE_NAME_CMP,%s" % self._baseline_name
            xml_bridge_cmd += " BASECMP_CASE,%s" % os.path.join(
                self._baseline_name, test_name)

        xml_bridge_cmd += " CLEANUP,%s" % ("TRUE" if self._clean else "FALSE")

        if (self._generate or self._compare):
            xml_bridge_cmd += " BASELINE_ROOT,%s" % self._baseline_root

        xml_bridge_cmd += " GENERATE_BASELINE,%s" % ("TRUE" if self._generate
                                                     else "FALSE")
        xml_bridge_cmd += " COMPARE_BASELINE,%s" % ("TRUE" if self._compare
                                                    else "FALSE")

        return self._run_phase_command(test_name, xml_bridge_cmd, XML_PHASE)
Esempio n. 6
0
    def _xml_phase(self, test_name):
    ###########################################################################
        test_case, _, _, _, machine, _, _ = acme_util.parse_test_name(test_name)

        xml_file = os.path.join(self._get_test_dir(test_name), "env_test.xml")
        xml_bridge_cmd = os.path.join(acme_util.get_acme_scripts_root(), "xml_bridge")

        mach_dir = os.path.join(self._cime_root, "machines-acme")
        xml_bridge_cmd += " %s %s %s" % (mach_dir, machine, xml_file)

        xml_bridge_cmd += " TESTCASE,%s" % test_case
        xml_bridge_cmd += " TEST_TESTID,%s" % self._test_id

        test_argv = "-testname %s -testroot %s" % (test_name, self._test_root)
        if (self._generate):
            test_argv += " -generate %s" % self._baseline_name
        if (self._compare):
            test_argv += " -compare %s" % self._baseline_name
        xml_bridge_cmd += " 'TEST_ARGV,%s'" % test_argv

        xml_bridge_cmd += " CASEBASEID,%s" % test_name

        if (self._generate):
            xml_bridge_cmd += " BASELINE_NAME_GEN,%s" % self._baseline_name
            xml_bridge_cmd += " BASEGEN_CASE,%s" % os.path.join(self._baseline_name, test_name)
        if (self._compare):
            xml_bridge_cmd += " BASELINE_NAME_CMP,%s" % self._baseline_name
            xml_bridge_cmd += " BASECMP_CASE,%s" % os.path.join(self._baseline_name, test_name)

        xml_bridge_cmd += " CLEANUP,%s" % ("TRUE" if self._clean else "FALSE")

        if (self._generate or self._compare):
            xml_bridge_cmd += " BASELINE_ROOT,%s" % self._baseline_root

        xml_bridge_cmd += " GENERATE_BASELINE,%s" % ("TRUE" if self._generate else "FALSE")
        xml_bridge_cmd += " COMPARE_BASELINE,%s" % ("TRUE" if self._compare else "FALSE")

        return self._run_phase_command(test_name, xml_bridge_cmd, XML_PHASE)