pyiron_base.jobs.job.extension.server.queuestatus module
Set of functions to interact with the queuing system directly from within pyiron - optimized for the Sun grid engine.
- pyiron_base.jobs.job.extension.server.queuestatus.queue_check_job_is_waiting_or_running(item)
Check if a job is still listed in the queue system as either waiting or running.
- Parameters:
item (int, GenericJob) – Provide either the job_ID or the full hamiltonian
- Returns:
[True/False]
- Return type:
bool
- pyiron_base.jobs.job.extension.server.queuestatus.queue_delete_job(item)
Delete a job from the queuing system
- Parameters:
item (int, pyiron_base.jobs.job.generic.GenericJob) – Provide either the job_ID or the full hamiltonian
- Returns:
Output from the queuing system as string - optimized for the Sun grid engine
- Return type:
str
- pyiron_base.jobs.job.extension.server.queuestatus.queue_enable_reservation(item)
Enable a reservation for a particular job within the queuing system
- Parameters:
item (int, pyiron_base.jobs.job.generic.GenericJob) – Provide either the job_ID or the full hamiltonian
- Returns:
Output from the queuing system as string - optimized for the Sun grid engine
- Return type:
str
- pyiron_base.jobs.job.extension.server.queuestatus.queue_info_by_job_id(job_id)
Display the queuing system info of job by qstat | grep shell command as dictionary
- Parameters:
job_id (int) – query for a specific job_id
- Returns:
Dictionary with the output from the queuing system - optimized for the Sun grid engine
- Return type:
dict
- pyiron_base.jobs.job.extension.server.queuestatus.queue_is_empty()
Check if the queue table is currently empty - no more jobs to wait for.
- Returns:
True if the table is empty, else False - optimized for the Sun grid engine
- Return type:
bool
- pyiron_base.jobs.job.extension.server.queuestatus.queue_table(job_ids=None, working_directory_lst=None, project_only=True, full_table=False)
Display the queuing system table as pandas.Dataframe
- Parameters:
job_ids (list) – check for a specific list of job IDs - empty list by default
working_directory_lst (list) – list of working directories to include - empty list by default
project_only (bool) – Query only for jobs within the current project - True by default
full_table (bool) – Return all entries from the queuing system without filtering - False by default
- Returns:
Output from the queuing system - optimized for the Sun grid engine
- Return type:
pandas.DataFrame
- pyiron_base.jobs.job.extension.server.queuestatus.retrieve_job(job, try_collecting=False)
Retrieve a job from remote server and check if it has a “finished status”. Optionally try to collect its output.
- Parameters:
job – pyiron job
try_collecting (bool) – whether to run collect if not finished - default=False
- Returns:
returns None
- pyiron_base.jobs.job.extension.server.queuestatus.update_from_remote(project, recursive=True, ignore_exceptions=False, try_collecting=False)
Update jobs from the remote server
- Parameters:
project – Project instance the jobs is located in
recursive (bool) – search subprojects [True/False] - default=True
ignore_exceptions (bool) – ignore eventual exceptions when retrieving jobs - default=False
try_collecting (bool) – try to collect jobs that don’t have a status counting as finished - default=False
- Returns:
returns None if ignore_exceptions is False or when no error occured. returns a list with job ids when errors occured, but were ignored
- pyiron_base.jobs.job.extension.server.queuestatus.validate_que_request(item)
Internal function to convert the job_ID or hamiltonian to the queuing system ID.
- Parameters:
item (int, pyiron_base.jobs.job.generic.GenericJob) – Provide either the job_ID or the full hamiltonian
- Returns:
queuing system ID
- Return type:
int
- pyiron_base.jobs.job.extension.server.queuestatus.wait_for_job(job, interval_in_s=5, max_iterations=100)
Sleep until the job is finished but maximum interval_in_s * max_iterations seconds.
- Parameters:
job (pyiron_base.job.utils.GenericJob) – Job to wait for
interval_in_s (int) – interval when the job status is queried from the database - default 5 sec.
max_iterations (int) – maximum number of iterations - default 100
- Raises:
ValueError – max_iterations reached, job still running
- pyiron_base.jobs.job.extension.server.queuestatus.wait_for_jobs(project, interval_in_s=5, max_iterations=100, recursive=True, ignore_exceptions=False, try_collecting=False)
Wait for the calculation in the project to be finished
- Parameters:
project – Project instance the jobs is located in
interval_in_s (int) – interval when the job status is queried from the database - default 5 sec.
max_iterations (int) – maximum number of iterations - default 100
recursive (bool) – search subprojects [True/False] - default=True
ignore_exceptions (bool) – ignore eventual exceptions when retrieving jobs - default=False
try_collecting (bool) – try to run collect for fetched jobs that don’t have a status counting as finished - default=False
- Raises:
ValueError – max_iterations reached, but jobs still running