-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit_tune.sh
More file actions
51 lines (39 loc) · 1.45 KB
/
submit_tune.sh
File metadata and controls
51 lines (39 loc) · 1.45 KB
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
# Get input arguments
CONFIG=$1
BENCH=$2
FOLDER=$3
GPUs=$4
#Prepare Paths
ws='/home/aming/MICRO/mobilenetv2/imagenet_pytorch_training'
rs='/home/aming/MICRO/mobilenetv2/imagenet_pytorch_training'
cd $rs
mkdir -p $FOLDER
mkdir -p $FOLDER/$CONFIG
cd $ws
STDOUT="$rs/${FOLDER}/${CONFIG}/${BENCH}_%A_%a.stdout"
STDERR="$rs/${FOLDER}/${CONFIG}/${BENCH}_%A_%a.stderror"
# initial
SLURM_JOB_NAME="${BENCH}@${CONFIG}@${FOLDER}"
localMachineName=jarvis2
machineName='beluga' # befor submitting!
#Automaticallt decide the cluster to run on
if [[ 5 < $(expr match $(hostname) ${machineName} ) ]];
then
echo "This machine is: $machineName: $(hostname)"
sbatch --output=$STDOUT --error=$STDERR -J ${SLURM_JOB_NAME} $ws/RunBench_beluga.slurm
elif [[ 4 < $(expr match $(hostname) 'cedar' ) ]]
then
echo "This machine is: cedar: $(hostname)"
cd /scratch;
sbatch --output=$STDOUT --error=$STDERR -J ${SLURM_JOB_NAME} $ws/RunBench_cedar.slurm
cd $ws
else
if [[ $(hostname) == $localMachineName ]]
then
echo "This machine is: $(hostname) - running w/ vip on ${GPUs} GPUs"
sbatch --output=$STDOUT --error=$STDERR --time=70:00:00 -p vip -J ${SLURM_JOB_NAME} $ws/RunBench_local_${GPUs}.slurm
else
echo "This machine is: $(hostname) - running on ${GPUs} GPUs"
sbatch --output=$STDOUT --error=$STDERR --time=48:00:00 -J ${SLURM_JOB_NAME} $ws/RunBench_local_${GPUs}.slurm
fi
fi