Skip to content

Commit

Permalink
add non-slurm cores command
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralVerity committed Apr 2, 2024
1 parent 003cbac commit cfb74de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions denv_pipeline/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def main(sysargs = sys.argv[1:]):

parser.add_argument("--slurm", help="flag for if running on HPC with slurm", action="store_true")
parser.add_argument("--slurm-cores", help="number of slurm cores to assign. Default is 10", dest="slurm_cores", type=int)
parser.add_argument("--cores", help="number of non-slurm cores to assign. Default is 1", type=int)
parser.add_argument("--verbose", "-v", dest="verbose", action="store_true")
parser.add_argument("--help", "-h", action="store_true", dest="help")
parser.add_argument("--overwrite", help="overwrite current results", action="store_true")
Expand Down Expand Up @@ -111,6 +112,10 @@ def main(sysargs = sys.argv[1:]):
status = snakemake.snakemake(snakefile, printshellcmds=False, forceall=True, force_incomplete=True,
workdir=cwd,config=config,lock=False, slurm=True, cores=config["slurm_cores"]
)
elif config["cores"]:
status = snakemake.snakemake(snakefile, printshellcmds=False, forceall=True, force_incomplete=True,
workdir=cwd,config=config,lock=False, cores=config["cores"]
)
else:
status = snakemake.snakemake(snakefile, printshellcmds=False, forceall=True, force_incomplete=True,
workdir=cwd,config=config,lock=False
Expand Down
2 changes: 2 additions & 0 deletions denv_pipeline/utils/set_up_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def get_defaults(config):
config["verbose"] = False
config["slurm"] = False
config["slurm_cores"] = 10
config["cores"] = False
config["download"] = False
config["temp"] = False
config["overwrite"] = False
Expand Down Expand Up @@ -210,6 +211,7 @@ def get_valid_keys():
valid_keys.append("download")
valid_keys.append("slurm")
valid_keys.append("slurm_cores")
valid_keys.append("cores")
valid_keys.append("verbose")
valid_keys.append("config")
valid_keys.append("dry_run")
Expand Down

0 comments on commit cfb74de

Please sign in to comment.