-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslurm_runner2.sh
67 lines (50 loc) · 1.78 KB
/
slurm_runner2.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#SBATCH --job-name=GA_unfold # Name this job
#SBATCH --output=slurm_%u_%x_%j_stdout.log # Name of log for STDOUT & STDERR
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=20
#SBATCH --mem-per-cpu=8G
#SBATCH --verbose # Be verbose wherever possible
#SBATCH --time=24:00:00 # Request resources for 24 hours
#SBATCH --mail-type=end,fail # Email on job completion / failure
# Set up environment
WORKDIR="/home/fm02/MEG_NEOS/NEOS"
# Path to script
# SCRIPT="$WORKDIR/NEOS_eyeCA.py"
# SCRIPT="$WORKDIR/main_over_participants.py"
# SCRIPT="$WORKDIR/apply_ica_over_participants.py"
# SCRIPT="plot_frps_over_participants.py"
# SCRIPT="NEOS_synch_per_block.py"
# SCRIPT="NEOS_stcsFactorialDesign.py"
SCRIPT="dev_GA_unfoldeffects.py"
# Make folders for logging
LOGDIR="/home/fm02/Desktop/MEG_EOS_scripts/sbatch_out"
mkdir -p "$LOGDIR/tasks"
# Activate conda environment (or some other module that manages environment)
conda activate mne1.2.1_0
echo "JOB $SLURM_JOB_ID STARTING"
# Loop over range of arguments to script
# for i in {1..15}
# do
# echo "TASK $i STARTING"
# Run task on node
srun --ntasks=1 \
--output="$LOGDIR/tasks/slurm_%u_%x_%A_%a_%N_stdout_task_$i.log" \
--exclusive "python" $SCRIPT $i &
echo "TASK $i PUSHED TO BACKGROUND"
# done
# Wait till everything has run
wait
# Loop over range of arguments to script
# for i in {16..30}
# do
# echo "TASK $i STARTING"
# # Run task on node
# srun --ntasks=1 \
# --output="$LOGDIR/tasks/slurm_%u_%x_%A_%a_%N_stdout_task_$i.log" \
# --exclusive "python" $SCRIPT $i &
# echo "TASK $i PUSHED TO BACKGROUND"
# done
# # Wait till everything has run
# wait
# echo "JOB $SLURM_JOB_ID COMPLETED"