Skip to content

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
class HTC(SubmissionStatement):
    """
    A class to represent an HTCondor submission statement.

    Attributes:
        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:
        __init__(sub_filename, path_job_folder, gpu, htc_flavor='espresso'):
            Initializes the HTCondor submission statement.
        get_submit_command(sub_filename): Returns the command to submit the job.
    """

    def __init__(
        self, sub_filename: str, path_job_folder: str, gpu: bool, htc_flavor: str = "espresso"
    ):
        """
        Initializes the HTCondor submission statement.

        Args:
            sub_filename (str): The name of the submission file.
            path_job_folder (str): The path to the job folder.
            gpu (bool): If a GPU must be requested for the submission.
            htc_flavor (str, optional): The flavor of the HTCondor job. Defaults to "espresso".
        """
        super().__init__(sub_filename, path_job_folder, gpu)

        self.head: str = (
            "# This is a HTCondor submission file\n"
            + "error  = error.txt\n"
            + "output = output.txt\n"
            + "log  = log.txt"
        )
        self.body: str = (
            f"initialdir = {self.path_job_folder}\n"
            + f"executable = {self.path_job_folder}/run.sh\n"
            + f"request_GPUs = {self.request_GPUs}\n"
            + f'+JobFlavour  = "{htc_flavor}"\n'
            + "queue"
        )
        self.tail: str = "# HTC"
        self.submit_command: str = self.get_submit_command(sub_filename)

    @staticmethod
    def get_submit_command(sub_filename: str) -> str:
        """
        Returns the command to submit the job.

        Args:
            sub_filename (str): The name of the submission file.

        Returns:
            str: The command to submit the job.
        """
        return f"condor_submit {sub_filename}"

__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
def __init__(
    self, sub_filename: str, path_job_folder: str, gpu: bool, htc_flavor: str = "espresso"
):
    """
    Initializes the HTCondor submission statement.

    Args:
        sub_filename (str): The name of the submission file.
        path_job_folder (str): The path to the job folder.
        gpu (bool): If a GPU must be requested for the submission.
        htc_flavor (str, optional): The flavor of the HTCondor job. Defaults to "espresso".
    """
    super().__init__(sub_filename, path_job_folder, gpu)

    self.head: str = (
        "# This is a HTCondor submission file\n"
        + "error  = error.txt\n"
        + "output = output.txt\n"
        + "log  = log.txt"
    )
    self.body: str = (
        f"initialdir = {self.path_job_folder}\n"
        + f"executable = {self.path_job_folder}/run.sh\n"
        + f"request_GPUs = {self.request_GPUs}\n"
        + f'+JobFlavour  = "{htc_flavor}"\n'
        + "queue"
    )
    self.tail: str = "# HTC"
    self.submit_command: str = self.get_submit_command(sub_filename)

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
@staticmethod
def get_submit_command(sub_filename: str) -> str:
    """
    Returns the command to submit the job.

    Args:
        sub_filename (str): The name of the submission file.

    Returns:
        str: The command to submit the job.
    """
    return f"condor_submit {sub_filename}"

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
class HTCDocker(SubmissionStatement):
    """
    A class to represent an HTCondor submission statement using Docker.

    Attributes:
        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:
        __init__(sub_filename, path_job_folder, gpu, path_image, htc_flavor='espresso'):
            Initializes the HTCondor Docker submission statement.
        get_submit_command(sub_filename): Returns the command to submit the job.
    """

    def __init__(
        self,
        sub_filename: str,
        path_job_folder: str,
        gpu: bool,
        path_image: str,
        htc_flavor: str = "espresso",
    ):
        """
        Initializes the HTCondor Docker submission statement.

        Args:
            sub_filename (str): The name of the submission file.
            path_job_folder (str): The path to the job folder.
            gpu (bool): If a GPU must be requested for the submission.
            path_image (str): The path to the Docker image.
            htc_flavor (str, optional): The flavor of the HTCondor job. Defaults to "espresso".
        """
        super().__init__(sub_filename, path_job_folder, gpu)

        self.head: str = (
            "# This is a HTCondor submission file using Docker\n"
            + "error  = error.txt\n"
            + "output = output.txt\n"
            + "log  = log.txt\n"
            + "universe = vanilla\n"
            + "+SingularityImage ="
            + f' "{path_image}"'
        )
        self.body: str = (
            f"initialdir = {self.path_job_folder}\n"
            + f"executable = {self.path_job_folder}/run.sh\n"
            + f"request_GPUs = {self.request_GPUs}\n"
            + f'+JobFlavour  = "{htc_flavor}"\n'
            + "queue"
        )
        self.tail: str = "# HTC Docker"
        self.submit_command: str = self.get_submit_command(sub_filename)

    @staticmethod
    def get_submit_command(sub_filename: str) -> str:
        """
        Returns the command to submit the job.

        Args:
            sub_filename (str): The name of the submission file.

        Returns:
            str: The command to submit the job.
        """
        return f"condor_submit {sub_filename}"

__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
def __init__(
    self,
    sub_filename: str,
    path_job_folder: str,
    gpu: bool,
    path_image: str,
    htc_flavor: str = "espresso",
):
    """
    Initializes the HTCondor Docker submission statement.

    Args:
        sub_filename (str): The name of the submission file.
        path_job_folder (str): The path to the job folder.
        gpu (bool): If a GPU must be requested for the submission.
        path_image (str): The path to the Docker image.
        htc_flavor (str, optional): The flavor of the HTCondor job. Defaults to "espresso".
    """
    super().__init__(sub_filename, path_job_folder, gpu)

    self.head: str = (
        "# This is a HTCondor submission file using Docker\n"
        + "error  = error.txt\n"
        + "output = output.txt\n"
        + "log  = log.txt\n"
        + "universe = vanilla\n"
        + "+SingularityImage ="
        + f' "{path_image}"'
    )
    self.body: str = (
        f"initialdir = {self.path_job_folder}\n"
        + f"executable = {self.path_job_folder}/run.sh\n"
        + f"request_GPUs = {self.request_GPUs}\n"
        + f'+JobFlavour  = "{htc_flavor}"\n'
        + "queue"
    )
    self.tail: str = "# HTC Docker"
    self.submit_command: str = self.get_submit_command(sub_filename)

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
@staticmethod
def get_submit_command(sub_filename: str) -> str:
    """
    Returns the command to submit the job.

    Args:
        sub_filename (str): The name of the submission file.

    Returns:
        str: The command to submit the job.
    """
    return f"condor_submit {sub_filename}"

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
class LocalPC(SubmissionStatement):
    """
    A class to represent a local PC submission statement.

    Attributes:
        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:
        __init__(sub_filename, path_job_folder, gpu=None): Initializes the LocalPC submission
            statement.
        get_submit_command(sub_filename): Returns the command to submit the job.
    """

    def __init__(self, sub_filename: str, path_job_folder: str, gpu: bool | None = None):
        """
        Initializes the LocalPC submission statement.

        Args:
            sub_filename (str): The name of the submission file.
            path_job_folder (str): The path to the job folder.
            gpu (bool, optional): If a GPU must be requested for the submission. Defaults to None.
        """
        super().__init__(sub_filename, path_job_folder, gpu)

        self.head: str = "# Running on local pc"
        self.body: str = f"bash {self.path_job_folder}/run.sh &"
        self.tail: str = "# Local pc"
        self.submit_command: str = self.get_submit_command(sub_filename)

    @staticmethod
    def get_submit_command(sub_filename: str) -> str:
        """
        Returns the command to submit the job.

        Args:
            sub_filename (str): The name of the submission file.

        Returns:
            str: The command to submit the job.
        """
        return f"bash {sub_filename}"

__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
def __init__(self, sub_filename: str, path_job_folder: str, gpu: bool | None = None):
    """
    Initializes the LocalPC submission statement.

    Args:
        sub_filename (str): The name of the submission file.
        path_job_folder (str): The path to the job folder.
        gpu (bool, optional): If a GPU must be requested for the submission. Defaults to None.
    """
    super().__init__(sub_filename, path_job_folder, gpu)

    self.head: str = "# Running on local pc"
    self.body: str = f"bash {self.path_job_folder}/run.sh &"
    self.tail: str = "# Local pc"
    self.submit_command: str = self.get_submit_command(sub_filename)

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
@staticmethod
def get_submit_command(sub_filename: str) -> str:
    """
    Returns the command to submit the job.

    Args:
        sub_filename (str): The name of the submission file.

    Returns:
        str: The command to submit the job.
    """
    return f"bash {sub_filename}"

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
class Slurm(SubmissionStatement):
    """
    A class to represent a SLURM submission statement.

    Attributes:
        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:
        __init__(sub_filename, path_job_folder, gpu): Initializes the SLURM submission statement.
        get_submit_command(sub_filename): Returns the command to submit the job.
    """

    def __init__(self, sub_filename: str, path_job_folder: str, gpu: bool | None):
        """
        Initializes the SLURM submission statement.

        Args:
            sub_filename (str): The name of the submission file.
            path_job_folder (str): The path to the job folder.
            gpu (bool|None): If a GPU must be requested for the submission.
        """
        super().__init__(sub_filename, path_job_folder, gpu)

        self.head: str = "# Running on SLURM "
        if self.slurm_queue_statement != "":
            queue_statement = self.slurm_queue_statement.split(" ")[1]
        else:
            queue_statement = self.slurm_queue_statement
        self.body: str = (
            f"sbatch --ntasks=2 {queue_statement} "
            f"--output=output.txt --error=error.txt "
            f"--gres=gpu:{self.request_GPUs} {self.path_job_folder}/run.sh"
        )
        self.tail: str = "# SLURM"
        self.submit_command: str = self.get_submit_command(sub_filename)

    @staticmethod
    def get_submit_command(sub_filename: str) -> str:
        """
        Returns the command to submit the job.

        Args:
            sub_filename (str): The name of the submission file.

        Returns:
            str: The command to submit the job.
        """
        return f"bash {sub_filename}"

__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
def __init__(self, sub_filename: str, path_job_folder: str, gpu: bool | None):
    """
    Initializes the SLURM submission statement.

    Args:
        sub_filename (str): The name of the submission file.
        path_job_folder (str): The path to the job folder.
        gpu (bool|None): If a GPU must be requested for the submission.
    """
    super().__init__(sub_filename, path_job_folder, gpu)

    self.head: str = "# Running on SLURM "
    if self.slurm_queue_statement != "":
        queue_statement = self.slurm_queue_statement.split(" ")[1]
    else:
        queue_statement = self.slurm_queue_statement
    self.body: str = (
        f"sbatch --ntasks=2 {queue_statement} "
        f"--output=output.txt --error=error.txt "
        f"--gres=gpu:{self.request_GPUs} {self.path_job_folder}/run.sh"
    )
    self.tail: str = "# SLURM"
    self.submit_command: str = self.get_submit_command(sub_filename)

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
@staticmethod
def get_submit_command(sub_filename: str) -> str:
    """
    Returns the command to submit the job.

    Args:
        sub_filename (str): The name of the submission file.

    Returns:
        str: The command to submit the job.
    """
    return f"bash {sub_filename}"

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
class SlurmDocker(SubmissionStatement):
    """
    A class to represent a SLURM submission statement using Docker.

    Attributes:
        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:
        __init__(sub_filename, path_job_folder, gpu, path_image, fix=False): Initializes the
            SLURM Docker submission statement.
        get_submit_command(sub_filename): Returns the command to submit the job.
    """

    def __init__(
        self,
        sub_filename: str,
        path_job_folder: str,
        gpu: bool,
        path_image: str,  # type: ignore
        fix: bool = False,
    ):
        """
        Initializes the SLURM Docker submission statement.

        Args:
            sub_filename (str): The name of the submission file.
            path_job_folder (str): The path to the job folder.
            gpu (bool): If a GPU must be requested for the submission.
            path_image (str): The path to the Docker image.
            fix (bool, optional): A flag to apply a fix for INFN. Defaults to False.
        """
        super().__init__(sub_filename, path_job_folder, gpu)

        # ! Ugly fix, will need to be removed when INFN is fixed
        if fix:
            to_replace = "/storage-hpc/gpfs_data/HPC/home_recovery"
            replacement = "/home/HPC"
            self.path_job_folder: str = self.path_job_folder.replace(to_replace, replacement)
            path_image: str = path_image.replace(to_replace, replacement)
            self.sub_filename: str = self.sub_filename.replace(to_replace, replacement)

        self.head: str = (
            "#!/bin/bash\n"
            + "# This is a SLURM submission file using Docker\n"
            + self.slurm_queue_statement
            + "\n"
            + f"#SBATCH --output={self.path_job_folder}/output.txt\n"
            + f"#SBATCH --error={self.path_job_folder}/error.txt\n"
            + "#SBATCH --ntasks=2\n"
            + f"#SBATCH --gres=gpu:{self.request_GPUs}"
        )
        self.body: str = f"singularity exec {path_image} {self.path_job_folder}/run.sh"
        self.tail: str = "# SLURM Docker"
        self.submit_command: str = self.get_submit_command(sub_filename)

    @staticmethod
    def get_submit_command(sub_filename: str) -> str:
        """
        Returns the command to submit the job.

        Args:
            sub_filename (str): The name of the submission file.

        Returns:
            str: The command to submit the job.
        """
        return f"sbatch {sub_filename}"

__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
def __init__(
    self,
    sub_filename: str,
    path_job_folder: str,
    gpu: bool,
    path_image: str,  # type: ignore
    fix: bool = False,
):
    """
    Initializes the SLURM Docker submission statement.

    Args:
        sub_filename (str): The name of the submission file.
        path_job_folder (str): The path to the job folder.
        gpu (bool): If a GPU must be requested for the submission.
        path_image (str): The path to the Docker image.
        fix (bool, optional): A flag to apply a fix for INFN. Defaults to False.
    """
    super().__init__(sub_filename, path_job_folder, gpu)

    # ! Ugly fix, will need to be removed when INFN is fixed
    if fix:
        to_replace = "/storage-hpc/gpfs_data/HPC/home_recovery"
        replacement = "/home/HPC"
        self.path_job_folder: str = self.path_job_folder.replace(to_replace, replacement)
        path_image: str = path_image.replace(to_replace, replacement)
        self.sub_filename: str = self.sub_filename.replace(to_replace, replacement)

    self.head: str = (
        "#!/bin/bash\n"
        + "# This is a SLURM submission file using Docker\n"
        + self.slurm_queue_statement
        + "\n"
        + f"#SBATCH --output={self.path_job_folder}/output.txt\n"
        + f"#SBATCH --error={self.path_job_folder}/error.txt\n"
        + "#SBATCH --ntasks=2\n"
        + f"#SBATCH --gres=gpu:{self.request_GPUs}"
    )
    self.body: str = f"singularity exec {path_image} {self.path_job_folder}/run.sh"
    self.tail: str = "# SLURM Docker"
    self.submit_command: str = self.get_submit_command(sub_filename)

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
@staticmethod
def get_submit_command(sub_filename: str) -> str:
    """
    Returns the command to submit the job.

    Args:
        sub_filename (str): The name of the submission file.

    Returns:
        str: The command to submit the job.
    """
    return f"sbatch {sub_filename}"

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
class SubmissionStatement:
    """
    A master class to represent a submission statement for job scheduling.

    Attributes:
        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:
        __init__(sub_filename: str, path_job_folder: str, gpu: bool | None):
            Initializes the SubmissionStatement with the given filename, job folder path, and
            gpu request.
    """

    def __init__(self, sub_filename: str, path_job_folder: str, gpu: bool | None):
        """
        Initialize the submission statement configuration.

        Args:
            sub_filename (str): The name of the submission file.
            path_job_folder (str): The path to the job folder. Trailing slash will be removed if
                present.
            gpu (bool | None): If a GPU must be requested.

        Attributes:
            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'.
        """
        self.sub_filename: str = sub_filename
        self.path_job_folder: str = (
            path_job_folder[:-1] if path_job_folder[-1] == "/" else path_job_folder
        )

        # GPU configuration
        if gpu:
            self.request_GPUs: int = 1
            self.slurm_queue_statement: str = ""
        else:
            self.request_GPUs: int = 0
            self.slurm_queue_statement: str = "#SBATCH --partition=slurm_hpc_acc"

__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'.

Source code in study_da/submit/cluster_submission/submission_statements.py
def __init__(self, sub_filename: str, path_job_folder: str, gpu: bool | None):
    """
    Initialize the submission statement configuration.

    Args:
        sub_filename (str): The name of the submission file.
        path_job_folder (str): The path to the job folder. Trailing slash will be removed if
            present.
        gpu (bool | None): If a GPU must be requested.

    Attributes:
        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'.
    """
    self.sub_filename: str = sub_filename
    self.path_job_folder: str = (
        path_job_folder[:-1] if path_job_folder[-1] == "/" else path_job_folder
    )

    # GPU configuration
    if gpu:
        self.request_GPUs: int = 1
        self.slurm_queue_statement: str = ""
    else:
        self.request_GPUs: int = 0
        self.slurm_queue_statement: str = "#SBATCH --partition=slurm_hpc_acc"