Skip to content

Commit

Permalink
Update slurm script generators with NSCA Delta specifics (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfhealy committed Apr 8, 2024
1 parent 5f2d948 commit 818fdc4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/combine_preds_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ def main():
if args.cluster_name in ['Expanse', 'expanse', 'EXPANSE']:
fid.write('module purge\n')
fid.write(f'source activate {args.python_env_name}\n')
elif args.cluster_name in ['Delta', 'delta', 'DELTA']:
fid.write('module purge\n')
fid.write('module add anaconda3_cpu\n')
fid.write(f'source activate {args.python_env_name}\n')

fid.write(
'combine-preds --path-to-preds %s --combined-preds-dirname %s --specific-field %s --dateobs %s --dnn-directory %s --xgb-directory %s --agg-method %s --p-threshold %s %s \n'
Expand Down
10 changes: 10 additions & 0 deletions tools/generate_features_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@ def main():
fid.write('module add gpu/0.15.4\n')
fid.write('module add cuda\n')
fid.write(f'source activate {args.python_env_name}\n')
elif args.cluster_name in ['Delta', 'delta', 'DELTA']:
fid.write('module purge\n')
fid.write('module add anaconda3_gpu\n')
fid.write('module add cuda\n')
fid.write('module add gcc-runtime\n')
fid.write(f'source activate {args.python_env_name}\n')

if args.doQuadrantFile:
qid = '$QID'
Expand Down Expand Up @@ -502,6 +508,10 @@ def main():
fid.write('module purge\n')
fid.write('module add slurm\n')
fid.write(f'source activate {args.python_env_name}\n')
elif args.cluster_name in ['Delta', 'delta', 'DELTA']:
fid.write('module purge\n')
fid.write('module add anaconda3_cpu\n')
fid.write(f'source activate {args.python_env_name}\n')

if not args.doSubmitLoop:
if args.runParallel:
Expand Down
13 changes: 13 additions & 0 deletions tools/run_inference_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ def main():
fid.write('module add gpu/0.15.4\n')
fid.write('module add cuda\n')
fid.write(f'source activate {args.python_env_name}\n')
elif args.cluster_name in ['Delta', 'delta', 'DELTA']:
fid.write('module purge\n')
if args.gpus > 0:
fid.write('module add anaconda3_gpu\n')
fid.write('module add cuda\n')
fid.write('module add gcc-runtime\n')
else:
fid.write('module add anaconda3_cpu\n')
fid.write(f'source activate {args.python_env_name}\n')

fid.write(f"{script_path} $FID" + '\n')
fid.close()
Expand All @@ -204,6 +213,10 @@ def main():
fid.write('module purge\n')
fid.write('module add slurm\n')
fid.write(f'source activate {args.python_env_name}\n')
elif args.cluster_name in ['Delta', 'delta', 'DELTA']:
fid.write('module purge\n')
fid.write('module add anaconda3_cpu\n')
fid.write(f'source activate {args.python_env_name}\n')

fid.write(
'run-inference-job-submission --dirname %s --scriptname %s --user %s --algorithm %s\n'
Expand Down
13 changes: 13 additions & 0 deletions tools/train_algorithm_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ def main():
fid.write('module add gpu/0.15.4\n')
fid.write('module add cuda\n')
fid.write(f'source activate {args.python_env_name}\n')
elif args.cluster_name in ['Delta', 'delta', 'DELTA']:
fid.write('module purge\n')
if args.gpus > 0:
fid.write('module add anaconda3_gpu\n')
fid.write('module add cuda\n')
fid.write('module add gcc-runtime\n')
else:
fid.write('module add anaconda3_cpu\n')
fid.write(f'source activate {args.python_env_name}\n')

fid.write("scope-train " + "--tag $TID " + " ".join(line_info) + '\n')
fid.close()
Expand All @@ -253,6 +262,10 @@ def main():
fid.write('module purge\n')
fid.write('module add slurm\n')
fid.write(f'source activate {args.python_env_name}\n')
elif args.cluster_name in ['Delta', 'delta', 'DELTA']:
fid.write('module purge\n')
fid.write('module add anaconda3_cpu\n')
fid.write(f'source activate {args.python_env_name}\n')

if args.sweep:
fid.write(
Expand Down

0 comments on commit 818fdc4

Please sign in to comment.