Skip to content

Commit

Permalink
fix: update biowulf scheduler interactions for lscratch
Browse files Browse the repository at this point in the history
  • Loading branch information
rroutsong committed Feb 7, 2024
1 parent ad0258a commit bb1ac3b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
19 changes: 6 additions & 13 deletions scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
from pathlib import Path
from os import access as check_access, R_OK
from os.path import expandvars
from os.path import expandvars, expanduser
from socket import gethostname
from uuid import uuid4
from collections import defaultdict
Expand Down Expand Up @@ -161,18 +161,11 @@ def get_tmp_dir(host):

this_tmp = TMP_CONFIGS[host]['user']

try:
Path(expandvars(this_tmp)).mkdir(parents=False, exist_ok=True)
except Exception as e:
logging.error("SLURM TMP DIR NOT FOUND: " + traceback.format_exc())
this_tmp = TMP_CONFIGS[host]['global']

try:
Path(expandvars(this_tmp)).mkdir(parents=False, exist_ok=True)
except:
raise OSError(f'TMPDIR does exist and can not be created: "{this_tmp}"')

return this_tmp
# this directory, if it does not exist,
if Path(this_tmp).parents[0].exists():
return this_tmp
else:
return TMP_CONFIGS[host]['global']


DIRECTORY_CONFIGS = {
Expand Down
9 changes: 2 additions & 7 deletions scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,6 @@ def get_mods(init=False):
def get_mounts(*extras):
mount_binds = []
resources = get_resource_config()
slurm_id = os.environ

if os.environ.get("SLURM_JOB_ID", None):
tmpdir = get_tmp_dir(get_current_server())
if not Path(os.path.expandvars(tmpdir)).exists():
Path(tmpdir).mkdir(parents=True, exist_ok=True)
mount_binds.append(str(tmpdir) + ':/tmp:rw')

if resources:
for this_mount_label, this_mount_attrs in resources['mounts'].items():
Expand Down Expand Up @@ -227,6 +220,8 @@ def get_mounts(*extras):
raise FileNotFoundError(f"Can't mount {str(bind)}, it doesn't exist!")
file_to, file_from, mode = str(bind), str(bind), 'rw'
mounts.append(file_from + ':' + file_to + ':' + mode)

mounts.append('\$TMPDIR:/tmp:rw')

return ','.join(mounts)

Expand Down
2 changes: 1 addition & 1 deletion utils
2 changes: 2 additions & 0 deletions workflow/demux.smk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ rule bcl2fastq:
threads: 34
resources:
mem_mb = int(64e3),
runtime = 4*60,
shell:
"""
bcl2fastq \
Expand Down Expand Up @@ -94,6 +95,7 @@ rule bclconvert:
threads: 50
resources:
mem_mb = int(64e3),
runtime = 4*60,
shell:
"""
bcl-convert \
Expand Down

0 comments on commit bb1ac3b

Please sign in to comment.