Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__pycache__/
*.egg-info/
_version.py
.DS_Store

20 changes: 20 additions & 0 deletions stormworkflow/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from importlib.resources import files
from argparse import ArgumentParser
from pathlib import Path
import sys

import yaml
from packaging.version import Version
Expand Down Expand Up @@ -134,6 +135,25 @@ def main():

wf = scripts.joinpath('workflow.sh')

# Check output directory is writeable and exists
output_dir = conf['RUN_OUT']
if not output_dir:
_logger.error(f"Output directory {output_dir} is not defined in configuration")

# convert to absolute path
output_dir = os.path.abspath(output_dir)
try:
os.makedirs(output_dir,exist_ok=True)
except Exception as e:
_logger.error(f"Can not create output directory {output_dir}: {e}")
sys.exit(1)
if not os.access(output_dir,os.W_OK):
_logger.error(f"Output directory {output_dir} is not writeable")
sys.exit(1)

# update configurations with absolute path
conf['RUN_OUT'] = output_dir

run_env = os.environ.copy()
run_env['L_SCRIPT_DIR'] = slurm.joinpath('.')
for k, v in conf.items():
Expand Down