-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkrun.sh
More file actions
executable file
·121 lines (83 loc) · 2.13 KB
/
mkrun.sh
File metadata and controls
executable file
·121 lines (83 loc) · 2.13 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/bash
if [[ -z $NITER ]]; then
NITER=100
fi
if [[ -z $NPIX ]]; then
NPIX=2
echo "WARNING: SETTING NPIX TO $NPIX"
fi
if [[ -z $NPIY ]]; then
NPIY=2
echo "WARNING: SETTING NPIX TO $NPIY"
fi
if [[ -z $NNODES ]]; then
NNODES=1
fi
if [[ -z $NELEM ]]; then
NELEM=32
fi
#-----------------------------------------------------------
if [[ -z $NPI ]]; then
NPI=$(($NPIX*$NPIY))
fi
if [[ $NPI -ne 1 ]]; then
LNPI=$(($NPI/$NNODES))
else
LNPI=1
fi
if [[ -z $NCORE ]]; then
NCORE=$((16/$LNPI)) #-- number of cpus per task
fi
echo "set NNODES=${NNODES}"
echo "set NPI=${NPI}"
echo "set LNPI=${LNPI}"
echo "set NCORE=${NCORE}"
#-----------------------------------------------------------
ts=`date +"%Y-%m-%d-%H-%M-%S"`
JOBDIR="gpi-test-${NPIX}x${NPIY}-$ts"
/usr/bin/mkdir -p $JOBDIR
cd $JOBDIR
ln -s ../*.c .
ln -s ../Makefile .
ln -s ../printmachinefile .
#-----------------------------------------------------------
module purge
MACHINEFILE="machinefile"
#GPI
module load devtoolset-7 gpi2/1.3.0
CC=gcc
CFLAGS="-O3 -W -Wall -fopenmp -lm -I${GPIINC} -L${GPILIB}"
RUN="gaspi_run -m $MACHINEFILE "
DEF="NPI=$NPI LNPI=$LNPI NPIX=$NPIX NPIY=$NPIY NITER=$NITER"
make clean && make NPI="$NPI" LNPI="$LNPI" NPIX="$NPIX" NPIY="$NPIY" NITER="$NITER" NELEM="$NELEM"
if [[ $? != 0 ]];
then
echo "compilation FAILED !"
exit 1
fi
#-----------------------------------------------------------
cat > "run.slurm" << EOF
#!/bin/bash
#
#SBATCH --job-name=gpi-test
#SBATCH --error=gpi-test-%j.err
#SBATCH --output=gpi-test-%j.out
#SBATCH --nodes=$NNODES
#SBATCH --mem=64000
#SBATCH --ntasks-per-node=$LNPI
#SBATCH --cpus-per-task=$NCORE
#SBATCH --cpu-freq=performance
#SBATCH --exclusive
#SBATCH --partition=shortrun
#SBATCH --requeue
echo "SLURM_JOB_NODELIST=\$SLURM_JOB_NODELIST SLURM_NTASKS=\$SLURM_NTASKS SLURM_JOB_NUM_NODES=\$SLURM_JOB_NUM_NODES"
source printmachinefile
printmachinefile > $MACHINEFILE
echo "module load devtoolset-7 gpi2/1.3.0"
export OMP_NUM_THREADS=1
echo "Running $NPI ($NPIX x $NPIY) tasks, $LNPI task/node"
$RUN ./test.exe
EOF
sbatch run.slurm
#-----------------------------------------------------------
exit 0