-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch_submit.sh
More file actions
executable file
·26 lines (23 loc) · 932 Bytes
/
launch_submit.sh
File metadata and controls
executable file
·26 lines (23 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# This script is a simple for loop to launch multiple scripts jobs. It requires that
# the files to be processed be in a subfolder within the one where you will be
# launching the job. It assumes that your folder is named with the last dot separated
# field being of your sample.
# Usage:
# bash launch_submit.sh <pattern_folder> <database_with_path> <path_to_code> <cpus> <mem> <account>
# <cpus> <mem> <account> are optional, defaulting to 8, 32G and def-mcristes
pattern_folder=$1
db=$2
path_to_code=$3
cpus=$4
mem=$5
acc=$6
if [ -z ${cpus} ]; then cpus=8; fi
if [ -z ${mem} ]; then mem=32G; fi
if [ -z ${acc} ]; then acc=def-mcristes; fi
for i in `find . -type d -name "*${pattern_folder}*"`; do
name=`echo ${i} | rev | cut -d'.' -f 1 | rev`
sbatch --job-name=${name} -o ${name}.out --cpus-per-task=${cpus} \
--export=file_path=${i},db_path=${db},cpus=${cpus} --mem=${mem} \
-A ${acc} ${path_to_code}
done