submission_statements
This module contains the classes for the submission statements for the different cluster systems.
HTC
Bases: SubmissionStatement
A class to represent an HTCondor submission statement.
Attributes:
| Name | Type | Description |
|---|---|---|
head |
str
|
The header of the submission script. |
body |
str
|
The body of the submission script. |
tail |
str
|
The tail of the submission script. |
submit_command |
str
|
The command to submit the job. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initializes the HTCondor submission statement. |
get_submit_command |
Returns the command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
__init__(sub_filename, path_job_folder, gpu, htc_flavor='espresso')
Initializes the HTCondor submission statement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
path_job_folder
|
str
|
The path to the job folder. |
required |
gpu
|
bool
|
If a GPU must be requested for the submission. |
required |
htc_flavor
|
str
|
The flavor of the HTCondor job. Defaults to "espresso". |
'espresso'
|
Source code in study_da/submit/cluster_submission/submission_statements.py
get_submit_command(sub_filename)
staticmethod
Returns the command to submit the job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
HTCDocker
Bases: SubmissionStatement
A class to represent an HTCondor submission statement using Docker.
Attributes:
| Name | Type | Description |
|---|---|---|
head |
str
|
The header of the submission script. |
body |
str
|
The body of the submission script. |
tail |
str
|
The tail of the submission script. |
submit_command |
str
|
The command to submit the job. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initializes the HTCondor Docker submission statement. |
get_submit_command |
Returns the command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
__init__(sub_filename, path_job_folder, gpu, path_image, htc_flavor='espresso')
Initializes the HTCondor Docker submission statement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
path_job_folder
|
str
|
The path to the job folder. |
required |
gpu
|
bool
|
If a GPU must be requested for the submission. |
required |
path_image
|
str
|
The path to the Docker image. |
required |
htc_flavor
|
str
|
The flavor of the HTCondor job. Defaults to "espresso". |
'espresso'
|
Source code in study_da/submit/cluster_submission/submission_statements.py
get_submit_command(sub_filename)
staticmethod
Returns the command to submit the job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
LocalPC
Bases: SubmissionStatement
A class to represent a local PC submission statement.
Attributes:
| Name | Type | Description |
|---|---|---|
head |
str
|
The header of the submission script. |
body |
str
|
The body of the submission script. |
tail |
str
|
The tail of the submission script. |
submit_command |
str
|
The command to submit the job. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initializes the LocalPC submission statement. |
get_submit_command |
Returns the command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
__init__(sub_filename, path_job_folder, gpu=None)
Initializes the LocalPC submission statement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
path_job_folder
|
str
|
The path to the job folder. |
required |
gpu
|
bool
|
If a GPU must be requested for the submission. Defaults to None. |
None
|
Source code in study_da/submit/cluster_submission/submission_statements.py
get_submit_command(sub_filename)
staticmethod
Returns the command to submit the job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
Slurm
Bases: SubmissionStatement
A class to represent a SLURM submission statement.
Attributes:
| Name | Type | Description |
|---|---|---|
head |
str
|
The header of the submission script. |
body |
str
|
The body of the submission script. |
tail |
str
|
The tail of the submission script. |
submit_command |
str
|
The command to submit the job. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initializes the SLURM submission statement. |
get_submit_command |
Returns the command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
__init__(sub_filename, path_job_folder, gpu)
Initializes the SLURM submission statement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
path_job_folder
|
str
|
The path to the job folder. |
required |
gpu
|
bool | None
|
If a GPU must be requested for the submission. |
required |
Source code in study_da/submit/cluster_submission/submission_statements.py
get_submit_command(sub_filename)
staticmethod
Returns the command to submit the job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
SlurmDocker
Bases: SubmissionStatement
A class to represent a SLURM submission statement using Docker.
Attributes:
| Name | Type | Description |
|---|---|---|
head |
str
|
The header of the submission script. |
body |
str
|
The body of the submission script. |
tail |
str
|
The tail of the submission script. |
submit_command |
str
|
The command to submit the job. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initializes the SLURM Docker submission statement. |
get_submit_command |
Returns the command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
__init__(sub_filename, path_job_folder, gpu, path_image, fix=False)
Initializes the SLURM Docker submission statement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
path_job_folder
|
str
|
The path to the job folder. |
required |
gpu
|
bool
|
If a GPU must be requested for the submission. |
required |
path_image
|
str
|
The path to the Docker image. |
required |
fix
|
bool
|
A flag to apply a fix for INFN. Defaults to False. |
False
|
Source code in study_da/submit/cluster_submission/submission_statements.py
get_submit_command(sub_filename)
staticmethod
Returns the command to submit the job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The command to submit the job. |
Source code in study_da/submit/cluster_submission/submission_statements.py
SubmissionStatement
A master class to represent a submission statement for job scheduling.
Attributes:
| Name | Type | Description |
|---|---|---|
sub_filename |
str
|
The name of the submission file. |
path_job_folder |
str
|
The path to the job folder, ensuring no trailing slash. |
request_GPUs |
int
|
The number of GPUs requested. |
slurm_queue_statement |
str
|
The SLURM queue statement. |
Methods:
| Name | Description |
|---|---|
__init__ |
str, path_job_folder: str, gpu: bool | None): Initializes the SubmissionStatement with the given filename, job folder path, and gpu request. |
Source code in study_da/submit/cluster_submission/submission_statements.py
__init__(sub_filename, path_job_folder, gpu)
Initialize the submission statement configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_filename
|
str
|
The name of the submission file. |
required |
path_job_folder
|
str
|
The path to the job folder. Trailing slash will be removed if present. |
required |
gpu
|
bool | None
|
If a GPU must be requested. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
sub_filename |
str
|
The name of the submission file. |
path_job_folder |
str
|
The path to the job folder without trailing slash. |
request_GPUs |
int
|
Number of GPUs requested. 1 if gpu is True, 0 otherwise. |
slurm_queue_statement |
str
|
SLURM queue statement. Empty if gpu requested, otherwise set to '#SBATCH --partition=slurm_hpc_acc'. |