Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option in the cfg to select the SLURM account #300

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/osa/configs/sequencer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ WALLTIME: 1:15:00
# Days from current day up to which the jobs are fetched from the queue.
# Default is None (left empty).
STARTTIME_DAYS_SACCT:
ACCOUNT: dpps

[WEBSERVER]
# Set the server address and port to transfer the datacheck plots
Expand Down
1 change: 1 addition & 0 deletions src/osa/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ def scheduler_env_variables(sequence, scheduler="slurm"):

sbatch_parameters.append(f"--partition={cfg.get('SLURM', f'PARTITION_{sequence.type}')}")
sbatch_parameters.append(f"--mem-per-cpu={cfg.get('SLURM', f'MEMSIZE_{sequence.type}')}")
sbatch_parameters.append(f"--account={cfg.get('SLURM', 'ACCOUNT')}")

return ["#SBATCH " + line for line in sbatch_parameters]

Expand Down
10 changes: 8 additions & 2 deletions src/osa/tests/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def test_scheduler_env_variables(sequence_list, running_analysis_dir):
"#SBATCH --error=log/Run01809.%4a_jobid_%A.err",
f'#SBATCH --partition={cfg.get("SLURM", "PARTITION_PEDCALIB")}',
"#SBATCH --mem-per-cpu=3GB",
"#SBATCH --account=dpps",
]
# Extract the second sequence
second_sequence = sequence_list[1]
Expand All @@ -84,6 +85,7 @@ def test_scheduler_env_variables(sequence_list, running_analysis_dir):
"#SBATCH --array=0-10",
f'#SBATCH --partition={cfg.get("SLURM", "PARTITION_DATA")}',
"#SBATCH --mem-per-cpu=16GB",
"#SBATCH --account=dpps",
]


Expand All @@ -104,7 +106,8 @@ def test_job_header_template(sequence_list, running_analysis_dir):
#SBATCH --output=log/Run01809.%4a_jobid_%A.out
#SBATCH --error=log/Run01809.%4a_jobid_%A.err
#SBATCH --partition={cfg.get('SLURM', 'PARTITION_PEDCALIB')}
#SBATCH --mem-per-cpu=3GB"""
#SBATCH --mem-per-cpu=3GB
#SBATCH --account=dpps"""
)
assert header == output_string1

Expand All @@ -122,7 +125,8 @@ def test_job_header_template(sequence_list, running_analysis_dir):
#SBATCH --error=log/Run01807.%4a_jobid_%A.err
#SBATCH --array=0-10
#SBATCH --partition={cfg.get('SLURM', 'PARTITION_DATA')}
#SBATCH --mem-per-cpu=16GB"""
#SBATCH --mem-per-cpu=16GB
#SBATCH --account=dpps"""
)
assert header == output_string2

Expand Down Expand Up @@ -154,6 +158,7 @@ def test_create_job_template_scheduler(
#SBATCH --array=0-10
#SBATCH --partition={cfg.get('SLURM', 'PARTITION_DATA')}
#SBATCH --mem-per-cpu={cfg.get('SLURM', 'MEMSIZE_DATA')}
#SBATCH --account={cfg.get('SLURM', 'ACCOUNT')}

import os
import subprocess
Expand Down Expand Up @@ -199,6 +204,7 @@ def test_create_job_template_scheduler(
#SBATCH --array=0-8
#SBATCH --partition={cfg.get('SLURM', 'PARTITION_DATA')}
#SBATCH --mem-per-cpu={cfg.get('SLURM', 'MEMSIZE_DATA')}
#SBATCH --account={cfg.get('SLURM', 'ACCOUNT')}

import os
import subprocess
Expand Down
Loading