genipe.db package¶
Module contents¶
Submodules¶
genipe.db.utils module¶
-
genipe.db.utils.
check_task_completion
(task_id, db_name)[source]¶ Checks if the task exists and if it’s completed.
- Parameters
- Returns
True
if the task exists and is completed,False
otherwise
- Return type
Note
A task is completed if the column
completed
equals 1. It is not completed otherwise.
-
genipe.db.utils.
create_task_db
(out_dir)[source]¶ Creates a task DB.
- Parameters
out_dir (str) – the directory where the DB will be saved
- Returns
the name of the file containing the DB
- Return type
A SQLITE database will be created in the
out_dir
directory (with the nametasks.db
. Thegenipe_task
table is automatically created.
-
genipe.db.utils.
create_task_entry
(task_id, db_name)[source]¶ Creates (or updates) a task.
- Parameters
If the task ID doesn’t exist in the DB, a new one will be created with the current time as launch and start time.
If the task ID already exist, it is presumed that the task will be relaunched, hence the database entry is updated to the current time (for launch and start time) and
completed
is set to0
.
-
genipe.db.utils.
get_all_runtimes
(db_name)[source]¶ Gets all tasks execution time.
- Parameters
db_name (str) – the name of the DB (usually a file)
- Returns
the execution time (seconds) of all the tasks in the database
- Return type
This function returns a dictionary of task ID (keys) pointing to execution time (in second) (int).
-
genipe.db.utils.
mark_drmaa_task_completed
(task_id, launch_time, start_time, end_time, db_name)[source]¶ Marks a task run by DRMAA as completed (while updating times).
- Parameters
The task entry is updated with the launch, start and end time. Those times come from the DRMAA library. The launch time is the time at which the task was launched to the scheduler. The start time correspond to the time that the scheduler started the job on the cluster. Finally, the end time is the time that the job was completed.