本文整理汇总了Python中Cobalt.Proxy.ComponentProxy.invoke_mpi_from_script方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentProxy.invoke_mpi_from_script方法的具体用法?Python ComponentProxy.invoke_mpi_from_script怎么用?Python ComponentProxy.invoke_mpi_from_script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cobalt.Proxy.ComponentProxy
的用法示例。
在下文中一共展示了ComponentProxy.invoke_mpi_from_script方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ComponentProxy
# 需要导入模块: from Cobalt.Proxy import ComponentProxy [as 别名]
# 或者: from Cobalt.Proxy.ComponentProxy import invoke_mpi_from_script [as 别名]
raise SystemExit, 1
user = pwd.getpwuid(os.getuid())[0]
jobspec = {'jobid':int(os.environ["COBALT_JOBID"]), 'user':user, 'true_mpi_args':arglist,
'walltime':j['walltime'], 'args':[], 'location':j['location'], 'outputdir':j['outputdir'], }
for key in io_redirect:
if io_redirect[key]:
jobspec.update({key: io_redirect[key]})
try:
scriptm = ComponentProxy("script-manager", defer=False)
system = ComponentProxy("system", defer=False)
# try adding job to queue_manager
pgid = int(scriptm.invoke_mpi_from_script(jobspec))
# give the process a chance to get started before we check for it
start = time.time()
while True:
r = system.get_process_groups([{'id':pgid, 'state':'*'}])
if r:
break
# we'll give it 90 seconds to get started
if time.time() - start > 90:
break
time.sleep(5)
while True: