flux.job.list module

class flux.job.list.JobList(flux_handle, attrs=['userid', 'urgency', 'priority', 't_submit', 't_depend', 't_run', 't_cleanup', 't_inactive', 'state', 'name', 'ntasks', 'nnodes', 'ranks', 'nodelist', 'waitstatus', 'success', 'exception_occurred', 'exception_type', 'exception_severity', 'exception_note', 'result', 'expiration', 'annotations', 'dependencies'], filters=[], ids=[], user=None, max_entries=1000)

Bases: object

User friendly class for querying lists of jobs from Flux

By default a JobList will query the last max_entries jobs for all users. Other filter parameters can be passed to the constructor or the set_user() and add_filter() methods.

Flux_handle:A Flux handle obtained from flux.Flux()
Attrs:Optional list of job attributes to fetch. (default is all attrs)
Filters:List of strings defining the results or states to filter. E.g., [ "pending", "running" ].
Ids:List of jobids to return. Other filters are ignored if ids is not empty.
User:Username or userid for which to fetch jobs. Default is all users.
Max_entries:Maximum number of jobs to return
RESULTS = {'canceled': <sphinx.ext.autodoc.importer._MockObject object>, 'completed': <sphinx.ext.autodoc.importer._MockObject object>, 'failed': <sphinx.ext.autodoc.importer._MockObject object>, 'timeout': <sphinx.ext.autodoc.importer._MockObject object>}
STATES = {'active': <sphinx.ext.autodoc.importer._MockObject object>, 'cleanup': <sphinx.ext.autodoc.importer._MockObject object>, 'depend': <sphinx.ext.autodoc.importer._MockObject object>, 'inactive': <sphinx.ext.autodoc.importer._MockObject object>, 'pending': <sphinx.ext.autodoc.importer._MockObject object>, 'priority': <sphinx.ext.autodoc.importer._MockObject object>, 'run': <sphinx.ext.autodoc.importer._MockObject object>, 'running': <sphinx.ext.autodoc.importer._MockObject object>, 'sched': <sphinx.ext.autodoc.importer._MockObject object>}
add_filter(fname)

Append a state or result filter to JobList query

fetch_jobs()

Initiate the JobList query to the Flux job-info module

JobList.fetch_jobs() returns a JobListRPC or JobListIdsFuture, either of which will be fulfilled when the job data is available.

Once the Future has been fulfilled, a list of JobInfo objects can be obtained via JobList.jobs(). If JobList.errors is non-empty, then it will contain a list of errors returned via the query.

jobs()

Synchronously fetch a list of JobInfo objects from JobList query

If the Future object returned by JobList.fetch_jobs has not yet been fulfilled (e.g. is_ready() returns False), then this call may block. Otherwise, returns a list of JobInfo objects for all jobs returned from the underlying job listing RPC.

set_user(user)

Only return jobs for user (may be a username or userid)

class flux.job.list.JobListIdRPC(*args, **kwargs)

Bases: flux.rpc.RPC

get_job()
get_jobinfo()
class flux.job.list.JobListIdsFuture

Bases: flux.future.WaitAllFuture

Simulate interface of JobListRPC for listing multiple jobids

get_jobinfos()

get all successful results as list of JobInfo objects

Any errors are appended to self.errors.

get_jobs()

get all successful results, appending errors into self.errors

class flux.job.list.JobListRPC(flux_handle, topic, payload=None, nodeid=<sphinx.ext.autodoc.importer._MockObject object>, flags=0)

Bases: flux.rpc.RPC

get_jobinfos()
get_jobs()
flux.job.list.job_list(flux_handle, max_entries=1000, attrs=[], userid=1005, states=0, results=0)
flux.job.list.job_list_id(flux_handle, jobid, attrs=[])
flux.job.list.job_list_inactive(flux_handle, since=0.0, max_entries=1000, attrs=[], name=None)