• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python system_tests_common.SystemTestsCommon类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中system_tests_common.SystemTestsCommon的典型用法代码示例。如果您正苦于以下问题:Python SystemTestsCommon类的具体用法?Python SystemTestsCommon怎么用?Python SystemTestsCommon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SystemTestsCommon类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: build

    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))
开发者ID:quantheory,项目名称:cime,代码行数:25,代码来源:pea.py


示例2: build

    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"))
开发者ID:quantheory,项目名称:cime,代码行数:25,代码来源:pet.py


示例3: run

 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)
开发者ID:jedwards4b,项目名称:cime,代码行数:7,代码来源:seq.py


示例4: build

    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)
开发者ID:jedwards4b,项目名称:cime,代码行数:13,代码来源:pet.py


示例5: build

    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)
开发者ID:quantheory,项目名称:cime,代码行数:50,代码来源:seq.py


示例6: build

    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"))
开发者ID:jedwards4b,项目名称:cime,代码行数:48,代码来源:ncr.py


示例7: build

    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"))
开发者ID:quantheory,项目名称:cime,代码行数:48,代码来源:erp.py


示例8: build

 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))
开发者ID:jedwards4b,项目名称:cime,代码行数:17,代码来源:cme.py


示例9: build

    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"))
开发者ID:quantheory,项目名称:cime,代码行数:42,代码来源:pem.py


示例10: run

    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
开发者ID:quantheory,项目名称:cime,代码行数:37,代码来源:seq.py


示例11: report

 def report(self):
     SystemTestsCommon.report(self)
开发者ID:quantheory,项目名称:cime,代码行数:2,代码来源:pem.py


示例12: run

 def run(self):
     SystemTestsCommon.run(self)
开发者ID:quantheory,项目名称:cime,代码行数:2,代码来源:pem.py


示例13: __init__

 def __init__(self, case):
     """
     initialize a test object
     """
     SystemTestsCommon.__init__(self, case)
开发者ID:quantheory,项目名称:cime,代码行数:5,代码来源:pem.py


示例14: __init__

 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)
开发者ID:jedwards4b,项目名称:cime,代码行数:6,代码来源:pfs.py


示例15: __init__

 def __init__(self, caseroot, case):
     """
     initialize an object interface to file env_test.xml in the case directory
     """
     SystemTestsCommon.__init__(self, caseroot, case)
开发者ID:jedwards4b,项目名称:cime,代码行数:5,代码来源:seq.py


示例16: __init__

 def __init__(self, case):
     """
     initialize an object interface to the CME test
     """
     SystemTestsCommon.__init__(self, case)
     self._testname = "CME"
开发者ID:quantheory,项目名称:cime,代码行数:6,代码来源:cme.py


示例17: __init__

 def __init__(self, caseroot, case):
     """
     initialize an object interface to the ERS system test
     """
     SystemTestsCommon.__init__(self, caseroot, case)
开发者ID:jedwards4b,项目名称:cime,代码行数:5,代码来源:ers.py



注:本文中的system_tests_common.SystemTestsCommon类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python log.Logger类代码示例发布时间:2022-05-27
下一篇:
Python system_test_utils.unique_resource_id函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap