Skip to content

Commit

Permalink
bmrc queue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CChahrour committed Nov 9, 2023
1 parent 084fb2c commit 0ddb72e
Show file tree
Hide file tree
Showing 8 changed files with 1,012 additions and 5 deletions.
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"
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
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": ""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# properties = {properties}
{exec_job}
Loading

0 comments on commit 0ddb72e

Please sign in to comment.