本文整理汇总了Python中system_tests_common.SystemTestsCommon.build方法的典型用法代码示例。如果您正苦于以下问题:Python SystemTestsCommon.build方法的具体用法?Python SystemTestsCommon.build怎么用?Python SystemTestsCommon.build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system_tests_common.SystemTestsCommon
的用法示例。
在下文中一共展示了SystemTestsCommon.build方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build
# 需要导入模块: from system_tests_common import SystemTestsCommon [as 别名]
# 或者: from system_tests_common.SystemTestsCommon import build [as 别名]
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))
示例2: build
# 需要导入模块: from system_tests_common import SystemTestsCommon [as 别名]
# 或者: from system_tests_common.SystemTestsCommon import build [as 别名]
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"))
示例3: build
# 需要导入模块: from system_tests_common import SystemTestsCommon [as 别名]
# 或者: from system_tests_common.SystemTestsCommon import build [as 别名]
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)
示例4: build
# 需要导入模块: from system_tests_common import SystemTestsCommon [as 别名]
# 或者: from system_tests_common.SystemTestsCommon import build [as 别名]
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)
示例5: build
# 需要导入模块: from system_tests_common import SystemTestsCommon [as 别名]
# 或者: from system_tests_common.SystemTestsCommon import build [as 别名]
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"))
示例6: build
# 需要导入模块: from system_tests_common import SystemTestsCommon [as 别名]
# 或者: from system_tests_common.SystemTestsCommon import build [as 别名]
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"))
示例7: build
# 需要导入模块: from system_tests_common import SystemTestsCommon [as 别名]
# 或者: from system_tests_common.SystemTestsCommon import build [as 别名]
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))
示例8: build
# 需要导入模块: from system_tests_common import SystemTestsCommon [as 别名]
# 或者: from system_tests_common.SystemTestsCommon import build [as 别名]
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"))