flux.job.info module

class flux.job.info.AnnotationsInfo(annotationsDict)

Bases: object

class flux.job.info.EmptyObject

Bases: object

Convenience "empty" object for use with string.format

This class can be used in place of a real class but returns appropriate empty or unset value for various conversions, or for string.format() calls.

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

Bases: object

class flux.job.info.InfoList(iterable=(), /)

Bases: list

Extend list with string representation appropriate for JobInfo format

class flux.job.info.InstanceInfo(uri=None)

Bases: object

property gpu_utilization
property progress
property utilization
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.

property contextual_info

Generate contextual nodelist/reason information based on job state: PRIORITY: returns "priority-wait" DEPEND: returns depends:dependencies list SCHED: returns eta:sched.t_estimate if available RUN+: returns assigned nodelist

property contextual_time

Return job duration if job is not running, otherwise runtime

defaults = {'bank': '', 'cwd': '', 'duration': 0.0, 'expiration': 0.0, 'name': '', 'ncores': '', 'nnodes': '', 'nodelist': '', 'ntasks': '', 'priority': '', 'project': '', 'queue': '', 'ranks': '', 'result': '', 'success': '', 't_cleanup': 0.0, 't_depend': 0.0, 't_inactive': 0.0, 't_run': 0.0, 'waitstatus': ''}
property inactive_reason

Generate contextual exit reason based on how the job ended

properties = ('id', 't_submit', 't_remaining', 'state', 'result', 'username', 'userid', 'urgency', 'runtime', 'status', 'returncode', 'dependencies')
property result
property result_abbrev
property result_emoji
property 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.

property runtime
property state
property state_emoji
property state_single
property status
property status_abbrev
property status_emoji
property t_remaining

Return a set of job attributes as a dict By default, empty or unset values are filtered from the result, so these keys will be missing. Set filtered=False to get the unfiltered dict, which has these uninitialized values set to an empty string or 0, key dependent.

property uri
property username
class flux.job.info.JobInfoFormat(fmt, headings=None, prepend=None)

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...

headings: Mapping[str, str] = {'annotations': 'ANNOTATIONS', 'annotations.sched.reason_pending': 'REASON', 'annotations.sched.resource_summary': 'RESOURCES', 'annotations.sched.t_estimate': 'T_ESTIMATE', 'bank': 'BANK', 'contextual_info': 'INFO', 'contextual_time': 'TIME', 'cwd': 'CWD', 'dependencies': 'DEPENDENCIES', 'duration': 'DURATION', '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.emoji': 'JOBID', 'id.f58': 'JOBID', 'id.hex': 'JOBID', 'id.kvs': 'JOBID', 'id.words': 'JOBID', 'inactive_reason': 'INACTIVE-REASON', 'instance.gpu_utilization': 'GPU%', 'instance.progress': 'PROG', 'instance.resources.all.ncores': 'CORES', 'instance.resources.all.ngpus': 'GPUS', 'instance.resources.all.nnodes': 'NODES', 'instance.resources.allocated.ncores': 'USED', 'instance.resources.allocated.ngpus': 'USED', 'instance.resources.allocated.nnodes': 'USED', 'instance.resources.down.ncores': 'DOWN', 'instance.resources.down.ngpus': 'DOWN', 'instance.resources.down.nnodes': 'DOWN', 'instance.resources.free.ncores': 'FREE', 'instance.resources.free.ngpus': 'FREE', 'instance.resources.free.nnodes': 'FREE', 'instance.resources.up.ncores': 'UP', 'instance.resources.up.ngpus': 'UP', 'instance.resources.up.nnodes': 'UP', 'instance.stats.total': 'NJOBS', 'instance.utilization': 'CORE%', 'name': 'NAME', 'ncores': 'NCORES', 'nnodes': 'NNODES', 'nodelist': 'NODELIST', 'ntasks': 'NTASKS', 'priority': 'PRI', 'project': 'PROJECT', 'queue': 'QUEUE', 'ranks': 'RANKS', 'result': 'RESULT', 'result_abbrev': 'RS', 'result_emoji': 'RESULT', 'returncode': 'RC', 'runtime': 'RUNTIME', 'sched': 'SCHED', 'sched.reason_pending': 'REASON', 'sched.resource_summary': 'RESOURCES', 'sched.t_estimate': 'T_ESTIMATE', 'state': 'STATE', 'state_emoji': 'STATE', 'state_single': 'S', 'status': 'STATUS', 'status_abbrev': 'ST', 'status_emoji': 'STATUS', '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', 'uri': 'URI', 'uri.local': 'URI', 'user': 'USER', 'userid': 'UID', 'username': 'USER', 'waitstatus': 'WSTATUS'}
class flux.job.info.StatsInfo(handle=None)

Bases: flux.job.stats.JobStats

Extend JobStats with default __repr__

flux.job.info.resulttostr(resultid, fmt='L')
flux.job.info.statetostr(stateid, fmt='L')
flux.job.info.statustoemoji(stateid, resultid)
flux.job.info.statustostr(stateid, resultid, fmt='L')