Beispiel #1
0
    def build(self, sharedlib_only=False, model_only=False):
        exeroot = self._case.get_value("EXEROOT")
        cime_model = CIME.utils.get_model()

        # first set all component mpi tasks to 1
        for comp in ['ATM','CPL','OCN','WAV','GLC','ICE','ROF','LND']:
            self._case.set_value("NTASKS_%s"%comp, 1)

        build1 = os.path.join("LockedFiles","env_build.PEA1.xml")
        if ( os.path.isfile(build1) ):
            shutil.copy(build1,"env_build.xml")

        mpilib = self._case.get_value("MPILIB")
        for mpilib in [mpilib, "mpi-serial"]:
            logging.warn("Starting bld for %s"%mpilib)
            self._case.set_value("MPILIB",mpilib)
            self._case.flush()
            case_setup(self._case, reset=True)
            self.clean_build()
            SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
            if (not sharedlib_only):
                shutil.move("%s/%s.exe"%(exeroot,cime_model),
                            "%s/%s.exe.PEA_%s"%(exeroot,cime_model,mpilib))
            shutil.copy("env_build.xml",os.path.join("LockedFiles",
                                                     "env_build_PEA_%s.xml"%mpilib))
Beispiel #2
0
    def build(self, sharedlib_only=False, model_only=False):
        exeroot = self._case.get_value("EXEROOT")
        cime_model = CIME.utils.get_model()

        # first make sure that all components have threaded settings
        for comp in ['ATM','CPL','OCN','WAV','GLC','ICE','ROF','LND']:
            if self._case.get_value("NTHRDS_%s"%comp) <= 1:
                self._case.set_value("NTHRDS_%s"%comp, 2)

        machpes1 = os.path.join("LockedFiles","env_mach_pes.PET1.xml")
        if ( os.path.isfile(machpes1) ):
            shutil.copy(machpes1,"env_mach_pes.xml")
        else:
            logging.warn("Copying env_mach_pes.xml to %s"%(machpes1))
            shutil.copy("env_mach_pes.xml", machpes1)

        build1 = os.path.join("LockedFiles","env_build.PET1.xml")
        if ( os.path.isfile(build1) ):
            shutil.copy(build1,"env_build.xml")

        self._case.flush()
        case_setup(self._case, reset=True)
        self.clean_build()
        SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
        shutil.copy("env_build.xml",os.path.join("LockedFiles","env_build_PET1.xml"))
Beispiel #3
0
 def run(self):
     self._case.set_value("CONTINUE_RUN","FALSE")
     self._case.set_value("REST_OPTION","none")
     self._case.set_value("HIST_OPTION","$STOP_OPTION")
     self._case.set_value("HIST_N","$STOP_N")
     self._case.flush()
     SystemTestsCommon.run(self)
Beispiel #4
0
    def build(self, sharedlib_only=False, model_only=False):
        exeroot = self._case.get_value("EXEROOT")
        cime_model = CIME.utils.get_model()

        for comp in ['ATM','CPL','OCN','WAV','GLC','ICE','ROF','LND']:
            if (self._case.get_value("NTHRDS_%s"%comp) <= 1):
                self._case.set_value("NTHRDS_%s"%comp,"2")

        self._case.flush()
        run_cmd("case.setup -clean ")
        run_cmd("case.setup")
        run_cmd('case.clean_build')
        SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
Beispiel #5
0
    def build(self, sharedlib_only=False, model_only=False):
        """
        Build two cases.
        """
        SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
        if sharedlib_only:
            return

        exeroot = self._case.get_value("EXEROOT")
        cime_model = self._case.get_value("MODEL")
        shutil.move("%s/%s.exe"%(exeroot,cime_model),
                    "%s/%s.exe.SEQ1"%(exeroot,cime_model))
        any_changes = False
        machpes1 = os.path.join("LockedFiles","env_mach_pes.SEQ1.xml")
        if ( os.path.isfile(machpes1) ):
            shutil.copy(machpes1,"env_mach_pes.xml")
        else:
            logging.warn("Copying env_mach_pes.xml to %s"%(machpes1))
            shutil.copy("env_mach_pes.xml", machpes1)

        comp_classes = self._case.get_value("COMP_CLASSES").split(',')
        for comp in comp_classes:
            if comp != "DRV":
                any_changes |= self._case.get_value("ROOTPE_%s" % comp) != 0
        if any_changes:
            for comp in comp_classes:
                if comp != "DRV":
                    self._case.set_value("ROOTPE_%s"%comp, 0)
        else:
            rootpe = 2
            for comp in comp_classes:
                # here we set the cpl to have the first 2 tasks
                # and each component to have a different ROOTPE
                if comp == "DRV":
                    self._case.set_value("NTASKS_CPL", 2)
                else:
                    ntasks = self._case.get_value("NTASKS_%s"%comp)
                    if ntasks > 1:
                        self._case.set_value("NTASKS_%s"%comp, max(1,ntasks-rootpe))
                        self._case.set_value("ROOTPE_%s"%comp, rootpe+1)
                        rootpe += 1
        self._case.flush()
        case_setup(self._case, test_mode=True, reset=True)
        self.clean_build()
        SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
        shutil.move("%s/%s.exe"%(exeroot,cime_model),
                    "%s/%s.exe.SEQ2"%(exeroot,cime_model))
        machpes2 = os.path.join("LockedFiles","env_mach_pes.SEQ2.xml")
        logging.warn("Copying env_mach_pes.xml to %s"%(machpes2))
        shutil.copy("env_mach_pes.xml", machpes2)
Beispiel #6
0
    def build(self):
        exeroot = self._case.get_value("EXEROOT")
        cime_model = CIME.utils.get_model()

        machpes1 = os.path.join("LockedFiles","env_mach_pes.NCR1.xml")
        if ( os.path.isfile(machpes1) ):
            shutil.copy(machpes1,"env_mach_pes.xml")

        for bld in range(1,3):
            """
            Build two exectuables for this test, the first is a default build
            the second halves the number of tasks and runs two instances
            for each component
            """
            logging.warn("Starting bld %s"%bld)
            machpes = os.path.join("LockedFiles","env_mach_pes.NCR%s.xml"%bld)
            ntasks_sum = 0
            for comp in ['ATM','OCN','WAV','GLC','ICE','ROF','LND']:
                self._case.set_value("NINST_%s"%comp,str(bld))
                ntasks      = int(self._case.get_value("NTASKS_%s"%comp))
                if(bld == 1):
                    self._case.set_value("ROOTPE_%s"%comp,"0")
                    if ( ntasks > 1 ):
                        self._case.set_value("NTASKS_%s"%comp, "%s"%int(ntasks/2))
                else:
                    self._case.set_value("ROOTPE_%s"%comp, "%s"% ntasks_sum)
                    ntasks_sum += ntasks*2
                    self._case.set_value("NTASKS_%s"%comp, "%s"%int(ntasks*2))
            self._case.flush()


            run_cmd("case.setup -clean -testmode")
            run_cmd("case.setup")
            run_cmd('case.clean_build')
            SystemTestsCommon.build(self)
            shutil.move("%s/%s.exe"%(exeroot,cime_model),
                        "%s/%s.exe.NCR%s"%(exeroot,cime_model,bld))
            shutil.copy("env_build.xml",os.path.join("LockedFiles","env_build.NCR%s.xml"%bld))
            shutil.copy("env_mach_pes.xml", machpes)
#
# Because mira/cetus interprets its run script differently than
# other systems we need to copy the original env_mach_pes.xml
# back
#

        shutil.copy(machpes1,"env_mach_pes.xml")
        shutil.copy("env_mach_pes.xml",
                    os.path.join("LockedFiles","env_mach_pes.xml"))
Beispiel #7
0
    def build(self, sharedlib_only=False, model_only=False):
        """
        Build two cases.  Case one uses defaults, case2 uses half the number of threads
        and tasks.   This test will fail for components (pop) that do not reproduce exactly
        with different numbers of mpi tasks.
        """
        exeroot = self._case.get_value("EXEROOT")
        cime_model = CIME.utils.get_model()
        machpes1 = os.path.join("LockedFiles","env_mach_pes.ERP1.xml")
        if ( os.path.isfile(machpes1) ):
            shutil.copy(machpes1,"env_mach_pes.xml")
        else:
            logging.warn("Copying env_mach_pes.xml to %s"%(machpes1))
            shutil.copy("env_mach_pes.xml", machpes1)

        for bld in range(1,3):
            logging.warn("Starting bld %s"%bld)
            if(bld == 2):
                # halve the number of tasks and threads
                for comp in ['ATM','CPL','OCN','WAV','GLC','ICE','ROF','LND']:
                    ntasks    = self._case.get_value("NTASKS_%s"%comp)
                    nthreads  = self._case.get_value("NTHRDS_%s"%comp)
                    rootpe    = self._case.get_value("ROOTPE_%s"%comp)
                    if ( nthreads > 1 ):
                        self._case.set_value("BUILD_THREADED", True)
                    if ( ntasks > 1 ):
                        self._case.set_value("NTASKS_%s"%comp, ntasks/2)
                        self._case.set_value("ROOTPE_%s"%comp, rootpe/2)
                    if ( nthreads > 1 ):
                        self._case.set_value("NTHRDS_%s"%comp, nthreads/2)
            self._case.set_value("SMP_BUILD","0")
            self._case.flush()
            case_setup(self._case, test_mode=True, reset=True)
            self.clean_build()
            SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
            if (not sharedlib_only):
                shutil.move("%s/%s.exe"%(exeroot,cime_model),
                            "%s/%s.exe.ERP%s"%(exeroot,cime_model,bld))
            shutil.copy("env_build.xml",os.path.join("LockedFiles","env_build_ERP%s.xml"%bld))

        #
        # Because mira/cetus interprets its run script differently than
        # other systems we need to copy the original env_mach_pes.xml
        # back
        #
        shutil.copy(machpes1,"env_mach_pes.xml")
        shutil.copy("env_mach_pes.xml",
                    os.path.join("LockedFiles","env_mach_pes.xml"))
Beispiel #8
0
 def build(self, sharedlib_only=False, model_only=False):
     """
     Build two exectuables for the CME test, one with ESMF interfaces
     the other with MCT interfaces and compare results - they should be exact
     """
     self._case.set_value('USE_ESMF_LIB','TRUE')
     exeroot = self._case.get_value("EXEROOT")
     cime_model = CIME.utils.get_model()
     for CPL in ['MCT','ESMF']:
         self._case.set_value('COMP_INTERFACE',CPL)
         self._case.flush()
         run_cmd('case.clean_build')
         SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
         if (not sharedlib_only):
             shutil.move("%s/%s.exe"%(exeroot,cime_model),
                         "%s/%s.exe.%s"%(exeroot,cime_model,CPL))
         shutil.copy("env_build.xml",os.path.join("LockedFiles","env_build_%s.xml"%CPL))
Beispiel #9
0
    def build(self, sharedlib_only=False, model_only=False):
        """
        build two cases, the first is default the second has halve the tasks per component
        """
        exeroot = self._case.get_value("EXEROOT")
        cime_model = CIME.utils.get_model()

        machpes1 = os.path.join("LockedFiles","env_mach_pes.PEM1.xml")
        if ( os.path.isfile(machpes1) ):
            shutil.copy(machpes1,"env_mach_pes.xml")

        for bld in range(1,3):
            logging.warn("Starting bld %s"%bld)
            self._case.flush()
            case_setup(self._case, reset=True)
            self.clean_build()
            SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
            machpes = os.path.join("LockedFiles","env_mach_pes.PEM%s.xml"%bld)

            if (not sharedlib_only):
                shutil.move("%s/%s.exe"%(exeroot,cime_model),
                            "%s/%s.exe.PEM%s"%(exeroot,cime_model,bld))

            shutil.copy("env_build.xml",os.path.join("LockedFiles","env_build_PEM%s.xml"%bld))
            shutil.copy("env_mach_pes.xml", machpes)

            if bld == 1:
                for comp in ["CPL", "ATM", "LND", "ICE", "OCN", "ROF", "GLC", "WAV"]:
                    ntasks = self._case.get_value("NTASKS_%s"%comp)
                    rootpe = self._case.get_value("ROOTPE_%s"%comp)
                    if ntasks > 1:
                        self._case.set_value("NTASKS_%s"%comp, ntasks/2)
                        self._case.set_value("ROOTPE_%s"%comp, rootpe/2)

        #
        # Because mira/cetus interprets its run script differently than
        # other systems we need to copy the original env_mach_pes.xml
        # back
        #
        shutil.copy(machpes1,"env_mach_pes.xml")
        shutil.copy("env_mach_pes.xml",
                    os.path.join("LockedFiles","env_mach_pes.xml"))
Beispiel #10
0
    def run(self):
        # Move to config_tests.xml once that's ready.
        self._case.set_value("CONTINUE_RUN", False)
        self._case.set_value("REST_OPTION", "never")
        self._case.set_value("HIST_OPTION", "$STOP_OPTION")
        self._case.set_value("HIST_N", "$STOP_N")
        self._case.flush()

        stop_n      = self._case.get_value("STOP_N")
        stop_option = self._case.get_value("STOP_OPTION")
        exeroot = self._case.get_value("EXEROOT")
        cime_model = self._case.get_value("MODEL")

        #
        # do an initial run test with default layout
        #
        logger.info("doing a %d %s initial test with default layout" % (stop_n, stop_option))

        shutil.copy("%s/%s.exe.SEQ1"%(exeroot,cime_model),
                    "%s/%s.exe"%(exeroot,cime_model))
        shutil.copy(os.path.join("LockedFiles", "env_mach_pes.SEQ1.xml"), "env_mach_pes.xml")
        shutil.copy("env_mach_pes.xml", os.path.join("LockedFiles", "env_mach_pes.xml"))
        success = SystemTestsCommon._run(self)
        if not success:
            return False
        shutil.copy(os.path.join("LockedFiles", "env_mach_pes.SEQ2.xml"), "env_mach_pes.xml")
        shutil.copy("env_mach_pes.xml", os.path.join("LockedFiles", "env_mach_pes.xml"))

        logger.info("doing a second %d %s test with rootpes set to zero" % (stop_n, stop_option))
        shutil.copy("%s/%s.exe.SEQ1"%(exeroot,cime_model),
                    "%s/%s.exe"%(exeroot,cime_model))
        success = SystemTestsCommon._run(self, "seq")

        if success:
            return self._component_compare_test("base", "seq")
        else:
            return False
Beispiel #11
0
 def report(self):
     SystemTestsCommon.report(self)
Beispiel #12
0
 def run(self):
     SystemTestsCommon.run(self)
Beispiel #13
0
 def __init__(self, case):
     """
     initialize a test object
     """
     SystemTestsCommon.__init__(self, case)
Beispiel #14
0
 def __init__(self, caseroot, case):
     """
     initialize an object interface to the PFS system test
     """
     expectedrunvars = ["CONTINUE_RUN", "REST_OPTION", "HIST_OPTION", "HIST_N"]
     SystemTestsCommon.__init__(self, caseroot, case, expectedrunvars)
Beispiel #15
0
 def __init__(self, caseroot, case):
     """
     initialize an object interface to file env_test.xml in the case directory
     """
     SystemTestsCommon.__init__(self, caseroot, case)
Beispiel #16
0
 def __init__(self, case):
     """
     initialize an object interface to the CME test
     """
     SystemTestsCommon.__init__(self, case)
     self._testname = "CME"
Beispiel #17
0
 def __init__(self, caseroot, case):
     """
     initialize an object interface to the ERS system test
     """
     SystemTestsCommon.__init__(self, caseroot, case)