本文整理汇总了Python中pilot.PilotComputeService.list_pilots方法的典型用法代码示例。如果您正苦于以下问题:Python PilotComputeService.list_pilots方法的具体用法?Python PilotComputeService.list_pilots怎么用?Python PilotComputeService.list_pilots使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pilot.PilotComputeService
的用法示例。
在下文中一共展示了PilotComputeService.list_pilots方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: async_re_job
# 需要导入模块: from pilot import PilotComputeService [as 别名]
# 或者: from pilot.PilotComputeService import list_pilots [as 别名]
#.........这里部分代码省略.........
# if self.status[k]['running_status'] == "R":
# if self.cus[k].get_state() != "Running":
# self.cus[k].cancel()
# self.status[k]['running_status'] = "W"
# update status
# self.updateStatus()
# self.print_status()
# wait until running jobs complete
self.cds.wait()
def cleanJob(self):
self.cds.cancel()
self.pj.cancel()
def launch_pilotjob(self):
# pilotjob: PilotJob description
# pilotjob: Variables defined in command.inp
pcd = {
"service_url": self.keywords.get("RESOURCE_URL"),
"number_of_processes": self.keywords.get("TOTAL_CORES"),
"working_directory": self.bj_working_dir,
"queue": self.keywords.get("QUEUE"),
"processes_per_node": self.ppn,
"project": self.keywords.get("PROJECT"),
"walltime": int(self.keywords.get("WALL_TIME")),
}
if self.keywords.get("SGE_WAYNESS") is not None:
pcd["spmd_variation"] = self.keywords.get("SGE_WAYNESS")
# pilotjob: Create pilot job with above description
self.pj.create_pilot(pilot_compute_description=pcd)
self.cds.add_pilot_compute_service(self.pj)
self.pilotcompute = self.pj.list_pilots()[0]
def _write_status(self):
"""
Pickle the current state of the RE job and write to in BASENAME.stat.
"""
status_file = "%s.stat" % self.basename
f = _open(status_file, "w")
pickle.dump(self.status, f)
f.close()
def _read_status(self):
"""
Unpickle and load the current state of the RE job from BASENAME.stat.
"""
status_file = "%s.stat" % self.basename
f = _open(status_file, "r")
self.status = pickle.load(f)
f.close()
def print_status(self):
"""
Writes to BASENAME_stat.txt a text version of the status of the RE job.
It's fun to follow the progress in real time by doing:
watch cat BASENAME_stat.txt
"""
log = "Replica State Status Cycle \n"
for k in range(self.nreplicas):
log += "%6d %5d %5s %5d \n" % (
k,
self.status[k]["stateid_current"],
self.status[k]["running_status"],
self.status[k]["cycle_current"],