def hold_on_submit(hook_config, job): ''' Hold every job so that we can process it properly in the periodic hook. ''' pbs.logmsg(pbs.LOG_DEBUG, "cycle_sub_hook - holding job %s with hold_type 'so'" % job.id) job.Hold_Types = pbs.hold_types("so")
def placement_hook(hook_config, job): if not get_select(job): # pbs 18 seems to treat host booleans as strings, which is causing this very annoying workaround. #job.Resource_List["ungrouped"] = "true" if job.Resource_List["slot_type"]: job.Resource_List["slot_type"] = job.Resource_List["slot_type"] # Check to see if job is interactive if job.interactive: debug("Job is interactive") return debug( "The job doesn't have a select statement, it doesn't have any placement requirements." ) debug("Place a hold on the job") job.Hold_Types = pbs.hold_types("so") return if validate_groupid_placement(job): _, select_dict = parse_select(job) if "ungrouped" not in select_dict: set_select_key(job, "ungrouped", "false") slot_type = select_dict.get("slot_type") if slot_type: set_select_key(job, "slot_type", slot_type) debug("Using the grouped slot_type as a resource (%s)." % slot_type)
def placement_hook(hook_config, job): if not get_select(job): # pbs 18 seems to treat host booleans as strings, which is causing this very annoying workaround. #job.Resource_List["ungrouped"] = "true" if job.Resource_List["slot_type"]: job.Resource_List["slot_type"] = job.Resource_List["slot_type"] # Check to see if job is interactive if job.interactive: debug("Job is interactive") return debug( "The job doesn't have a select statement, it doesn't have any placement requirements." ) debug("Place a hold on the job") job.Hold_Types = pbs.hold_types("so") return debug("The job has a select statement.") debug("Place a hold on the job") job.Hold_Types = pbs.hold_types("so") return '''
def hold_on_submit(hook_config, event): """ Hold every job so that we can process it properly in the periodic hook. """ job = event.job if job.Resource_List["nodes"]: job.Resource_List[] debug( ( "holding job %s with hold_type 'so' because it uses -l nodes syntax." + " It will be updated and released shortly." ) % job.id ) job.Hold_Types = pbs.hold_types("so") event.accept() return return
new_select = selspec.increment_chunks(1) e.job.Resource_List["select"] = new_select pbs.logmsg(pbs.LOG_DEBUG, "job's select spec changed to %s" % new_select) elif e.type == pbs.EXECJOB_LAUNCH: if 'PBS_NODEFILE' not in e.env: e.accept() # add a log entry in primary mom logs pbs.logmsg(pbs.LOG_DEBUG, "Executing launch") # print out the vnode_list[] values for vn in e.vnode_list: v = e.vnode_list[vn] pbs.logjobmsg(e.job.id, "launch: found vnode_list[" + v.name + "]") # print out the vnodes in vnode_list_fail[] and offline them for vn in e.vnode_list_fail: v = e.vnode_list_fail[vn] pbs.logjobmsg( e.job.id, "launch: found vnode_list_fail[" + v.name + "]") v.state = pbs.ND_OFFLINE # prune the job's vnodes to satisfy the select spec in resource 'site' # and vnodes in vnode_list_fail[] are not used. if e.job.in_ms_mom(): pj = e.job.release_nodes(keep_select=e.job.Resource_List["site"]) if pj is None: e.job.Hold_Types = pbs.hold_types("s") e.job.rerun() e.reject("unsuccessful at LAUNCH")
new_select = selspec.increment_chunks(1) e.job.Resource_List["select"] = new_select pbs.logmsg(pbs.LOG_DEBUG, "job's select spec changed to %s" % new_select) elif e.type == pbs.EXECJOB_LAUNCH: if 'PBS_NODEFILE' not in e.env: e.accept() # add a log entry in primary mom logs pbs.logmsg(pbs.LOG_DEBUG, "Executing launch") # print out the vnode_list[] values for vn in e.vnode_list: v = e.vnode_list[vn] pbs.logjobmsg(e.job.id, "launch: found vnode_list[" + v.name + "]") # print out the vnodes in vnode_list_fail[] and offline them for vn in e.vnode_list_fail: v = e.vnode_list_fail[vn] pbs.logjobmsg(e.job.id, "launch: found vnode_list_fail[" + v.name + "]") v.state = pbs.ND_OFFLINE # prune the job's vnodes to satisfy the select spec in resource 'site' # and vnodes in vnode_list_fail[] are not used. if e.job.in_ms_mom(): pj = e.job.release_nodes(keep_select=e.job.Resource_List["site"]) if pj is None: e.job.Hold_Types = pbs.hold_types("s") e.job.rerun() e.reject("unsuccessful at LAUNCH")