gridtk.models

Functions

add_job(session, command_line[, name, ...])

Helper function to create a job, add the dependencies and the array jobs.

times(job)

Returns a string containing timing information for teh given job, which might be a Job or an ArrayJob.

Classes

ArrayJob(id, job_id)

This class defines one element of an array job.

Job(command_line[, name, exec_dir, log_dir, ...])

This class defines one Job that was submitted to the Job Manager.

JobDependence(waiting_job_id, waited_for_job_id)

This table defines a many-to-many relationship between Jobs.

class gridtk.models.ArrayJob(id, job_id)[source]

Bases: Base

This class defines one element of an array job.

unique
job
id
job_id
status
result
machine_name
submit_time
start_time
finish_time
std_out_file()[source]
std_err_file()[source]
format(format)[source]

Formats the current job into a nicer string to fit into a table.

class gridtk.models.Job(command_line, name=None, exec_dir=None, log_dir=None, array_string=None, queue_name='local', machine_name=None, stop_on_failure=False, **kwargs)[source]

Bases: Base

This class defines one Job that was submitted to the Job Manager.

unique
id
submit_time
start_time
finish_time
status
result
command_line
name
queue_name
machine_name
grid_arguments
exec_dir
log_dir
stop_on_failure
array_string
submit(new_queue=None)[source]

Sets the status of this job to ‘submitted’.

queue(new_job_id=None, new_job_name=None, queue_name=None)[source]

Sets the status of this job to ‘queued’ or ‘waiting’.

execute(array_id=None, machine_name=None)[source]

Sets the status of this job to ‘executing’.

finish(result, array_id=None)[source]

Sets the status of this job to ‘success’ or ‘failure’.

refresh()[source]

Refreshes the status information.

get_command_line()[source]

Returns the command line for the job.

set_command_line(command_line)[source]

Sets / overwrites the command line for the job.

get_exec_dir()[source]

Returns the command line for the job.

get_array()[source]

Returns the array arguments for the job; usually a string.

get_arguments()[source]

Returns the additional options for the grid (such as the queue, memory requirements, …).

set_arguments(**kwargs)[source]
get_jobs_we_wait_for()[source]
get_jobs_waiting_for_us()[source]
std_out_file(array_id=None)[source]
std_err_file(array_id=None)[source]
format(format, dependencies=0, limit_command_line=None)[source]

Formats the current job into a nicer string to fit into a table.

class gridtk.models.JobDependence(waiting_job_id, waited_for_job_id)[source]

Bases: Base

This table defines a many-to-many relationship between Jobs.

id
waiting_job
waited_for_job
waiting_job_id
waited_for_job_id
gridtk.models.add_job(session, command_line, name='job', dependencies=[], array=None, exec_dir=None, log_dir=None, stop_on_failure=False, **kwargs)[source]

Helper function to create a job, add the dependencies and the array jobs.

gridtk.models.times(job)[source]

Returns a string containing timing information for teh given job, which might be a Job or an ArrayJob.