Job
Warning
This class is superseded by pyslurm.Job and will be removed in a future release.
pyslurm.deprecated.job
Slurm Job Information.
find(name='', val='')
method descriptor
find_id(jobid)
method descriptor
Retrieve job ID data.
This method accepts both string and integer formats of the jobid. This works for single jobs and job arrays. It uses the internal helper _load_single_job to do slurm_load_job. If the job corresponding to the jobid does not exist, a ValueError will be raised.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jobid
|
str
|
Job id key string to search |
required |
Returns:
Type | Description |
---|---|
list
|
List of dictionary of values for given job id |
find_user(user)
method descriptor
get()
method descriptor
Get all slurm jobs information.
This method calls slurm_load_jobs to get job_table records for all jobs
Returns:
Type | Description |
---|---|
dict
|
Data where key is the job name, each entry contains a dictionary of job attributes |
ids()
method descriptor
lastBackfill()
method descriptor
lastUpdate()
method descriptor
slurm_job_batch_script(jobid)
method descriptor
Return the contents of the batch-script for a Job.
The string returned also includes all the "\n" characters (new-line).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jobid
|
Union[str, int]
|
ID of the Job for which the script should be retrieved. |
required |
Returns:
Type | Description |
---|---|
str
|
The content of the batch script. |
submit_batch_job(job_opts)
method descriptor
wait_finished(jobid)
method descriptor
Block until the job given by the jobid finishes.
This works for single jobs, as well as job arrays.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jobid
|
int
|
The job id of the slurm job. To reference a job with job array set, use the first/"master" jobid (the same as given by squeue) |
required |
Returns:
Type | Description |
---|---|
int
|
The exit code of the slurm job. |