-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,012 additions
and
5 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
seqnado/workflow/envs/profiles/profile_slurm_singularity_bmrc/CookieCutter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Based on lsf CookieCutter.py | ||
# | ||
import os | ||
import json | ||
|
||
d = os.path.dirname(__file__) | ||
with open(os.path.join(d, "settings.json")) as fh: | ||
settings = json.load(fh) | ||
|
||
|
||
def from_entry_or_env(values, key): | ||
"""Return value from ``values`` and override with environment variables.""" | ||
if key in os.environ: | ||
return os.environ[key] | ||
else: | ||
return values[key] | ||
|
||
|
||
class CookieCutter: | ||
|
||
SBATCH_DEFAULTS = from_entry_or_env(settings, "SBATCH_DEFAULTS") | ||
CLUSTER_NAME = from_entry_or_env(settings, "CLUSTER_NAME") | ||
CLUSTER_CONFIG = from_entry_or_env(settings, "CLUSTER_CONFIG") | ||
|
||
@staticmethod | ||
def get_cluster_option() -> str: | ||
cluster = CookieCutter.CLUSTER_NAME | ||
if cluster != "": | ||
return f"--cluster={cluster}" | ||
return "" | ||
|
||
@staticmethod | ||
def get_cluster_logpath() -> str: | ||
return "logs/slurm/%r/%j" | ||
|
||
@staticmethod | ||
def get_cluster_jobname() -> str: | ||
return "%r_%w" |
38 changes: 33 additions & 5 deletions
38
seqnado/workflow/envs/profiles/profile_slurm_singularity_bmrc/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,34 @@ | ||
jobname: smk-{jobid}-{rule}-{wildcards} | ||
use-singularity: true | ||
|
||
cluster-sidecar: "slurm-sidecar.py" | ||
cluster-cancel: "scancel" | ||
restart-times: "0" | ||
jobscript: "slurm-jobscript.sh" | ||
cluster: "slurm-submit.py" | ||
cluster-status: "slurm-status.py" | ||
max-jobs-per-second: "10" | ||
max-status-checks-per-second: "10" | ||
local-cores: 1 | ||
latency-wait: "5" | ||
use-conda: "False" | ||
use-singularity: "True" | ||
singularity-args: -B /well -B /exafs1 | ||
keep-going: True | ||
rerun-incomplete: True | ||
printshellcmds: True | ||
jobs: "50" | ||
printshellcmds: "True" | ||
rerun-incomplete: "True" | ||
keep-going: "True" | ||
retries: "3" | ||
|
||
|
||
# Example resource configuration | ||
# default-resources: | ||
# - runtime=100 | ||
# - mem_mb=6000 | ||
# - disk_mb=1000000 | ||
# # set-threads: map rule names to threads | ||
# set-threads: | ||
# - single_core_rule=1 | ||
# - multi_core_rule=10 | ||
# # set-resources: map rule names to resources in general | ||
# set-resources: | ||
# - high_memory_rule:mem_mb=12000 | ||
# - long_running_rule:runtime=1200 |
5 changes: 5 additions & 0 deletions
5
seqnado/workflow/envs/profiles/profile_slurm_singularity_bmrc/settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"SBATCH_DEFAULTS": "--partition=short.qc --time=0-01:00:00 --mem=3G", | ||
"CLUSTER_NAME": "", | ||
"CLUSTER_CONFIG": "" | ||
} |
3 changes: 3 additions & 0 deletions
3
seqnado/workflow/envs/profiles/profile_slurm_singularity_bmrc/slurm-jobscript.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
# properties = {properties} | ||
{exec_job} |
Oops, something went wrong.