flux.job.info module

class flux.job.info.AnnotationsInfo(annotationsDict)

Bases: object

class flux.job.info.ExceptionInfo(occurred, severity, _type, note)

Bases: object

class flux.job.info.InfoList

Bases: list

Extend list with string representation appropriate for JobInfo format

class flux.job.info.JobInfo(info_resp)

Bases: object

JobInfo class: encapsulate job-list.list response in an object that implements a getattr interface to job information with memoization. Better for use with output formats since results are only computed as-needed.

defaults = {'expiration': 0.0, 'nnodes': '', 'nodelist': '', 'priority': '', 'ranks': '', 'result': '', 'success': '', 't_cleanup': 0.0, 't_depend': 0.0, 't_inactive': 0.0, 't_run': 0.0, 'waitstatus': ''}
get_remaining_time()
get_runtime()
result
result_abbrev
returncode

The job return code if the job has exited, or an empty string if the job is still active. The return code of a job is the highest job shell exit code, or the negative signal number if the job shell was terminated by a signal. For jobs that were canceled before the RUN state, the return code will be set to -128.

runtime
state
state_single
status
status_abbrev
t_remaining
username
class flux.job.info.JobInfoFormat(fmt)

Bases: flux.util.OutputFormat

Store a parsed version of an output format string for JobInfo objects, allowing the fields to iterated without modifiers, building a new format suitable for headers display, etc...

class HeaderFormatter

Bases: flux.job.info.JobFormatter

Custom formatter for flux-jobs(1) header row.

Override default formatter behavior of calling getattr() on dotted field names. Instead look up header literally in kwargs. This greatly simplifies header name registration as well as registration of "valid" fields.

get_field(field_name, args, kwargs)

Override get_field() so we don't do the normal gettatr thing

class JobFormatter

Bases: string.Formatter

convert_field(value, conv)

Flux job-specific field conversions. Avoids the need to create many different format field names to represent different conversion types. (mainly used for time-specific fields for now).

format_field(value, spec)
format(obj)

format object with our JobFormatter

header()

format header with custom HeaderFormatter

headings = {'annotations': 'ANNOTATIONS', 'annotations.sched.reason_pending': 'REASON', 'annotations.sched.resource_summary': 'RESOURCES', 'annotations.sched.t_estimate': 'T_ESTIMATE', 'dependencies': 'DEPENDENCIES', 'exception.note': 'EXCEPTION-NOTE', 'exception.occurred': 'EXCEPTION-OCCURRED', 'exception.severity': 'EXCEPTION-SEVERITY', 'exception.type': 'EXCEPTION-TYPE', 'expiration': 'EXPIRATION', 'id': 'JOBID', 'id.dec': 'JOBID', 'id.dothex': 'JOBID', 'id.f58': 'JOBID', 'id.hex': 'JOBID', 'id.kvs': 'JOBID', 'id.words': 'JOBID', 'name': 'NAME', 'nnodes': 'NNODES', 'nodelist': 'NODELIST', 'ntasks': 'NTASKS', 'priority': 'PRI', 'ranks': 'RANKS', 'result': 'RESULT', 'result_abbrev': 'RS', 'returncode': 'RC', 'runtime': 'RUNTIME', 'sched': 'SCHED', 'sched.reason_pending': 'REASON', 'sched.resource_summary': 'RESOURCES', 'sched.t_estimate': 'T_ESTIMATE', 'state': 'STATE', 'state_single': 'S', 'status': 'STATUS', 'status_abbrev': 'ST', 'success': 'SUCCESS', 't_cleanup': 'T_CLEANUP', 't_depend': 'T_DEPEND', 't_inactive': 'T_INACTIVE', 't_remaining': 'T_REMAINING', 't_run': 'T_RUN', 't_submit': 'T_SUBMIT', 'urgency': 'URG', 'user': 'USER', 'userid': 'UID', 'username': 'USER', 'waitstatus': 'WSTATUS'}
flux.job.info.fsd(secs)
flux.job.info.get_username(userid)
flux.job.info.resulttostr(resultid, singlechar=False)
flux.job.info.statetostr(stateid, singlechar=False)
flux.job.info.statustostr(stateid, resultid, abbrev=False)