forked from GPUSPH/gpusph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpi_command
executable file
·132 lines (106 loc) · 3 KB
/
mpi_command
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
121
122
123
124
125
126
127
128
129
130
131
if [ "$1" == "" ]
then
echo "USAGE: $ mpi_command DELTAP NPROCS NHOSTS DEV_STRING STRIPING GPUDIRECT ASYNCMPI TEND"
echo "Deltap can be 0"
echo "grep -A 1 ___ mpi_command for resolutions"
exit 1
fi
export PREFIX=dbNoObst
export NPROCS=$2
export NODEDEVS=$4
export NHOSTS=$3
#export NHOSTS=$NPROCS
# uncomment to use one process per device, 2 processes per node
#export NHOSTS=$(( $NHOSTS / 2 ))
# ___ 107 M
#export DELTAP=0.001
# ___ 31.7 M
#export DELTAP=0.0015
# ___ 6.4 M
#export DELTAP=0.0025596
# ___ 4.0 M
#export DELTAP=0.003
# ___ 3.2 M
export DELTAP=0.003225
# ___ 1.6 M
#export DELTAP=0.004
# ___ 874 K
#export DELTAP=0.005
# ___ 392 K
#export DELTAP=0.0065
# ___ 213 K
#export DELTAP=0.008
# default: 13 K
#export DELTAP=0.02
# hit: divide deltap by 2^(1/3) to double the particles
# set deltap if not user specified
if [ "$1" != "0" ]
then
export DELTAP=$1
fi
# multidevice
export STRIPING=$5
# multinode
export GPUDIRECT=$6
export ASYNCMPI=$7
export TEND=$8
export NAME=${PREFIX}_$(date +%d%b)_dp${DELTAP}_tend${TEND}_${NPROCS}procs_${NHOSTS}hosts_gd${GPUDIRECT}_str${STRIPING}_isend${ASYNCMPI}
#export NAME=nostriping_${NPROCS}nodes
#export LOGFILE=logs/logmpi_${NAME}.txt
export LOGFILE=lm_${NAME}.txt
echo $NAME
echo "ENTER to go, CTRL+C to stop"
read
#export TEND=1.5
#export TEND=0.1
#export TEND=0.01
#export TEND=0.001
#export TEND=0.05
export EXTRA=""
export EXTRA="$EXTRA --num_hosts $NHOSTS"
if [ "$STRIPING" -eq "1" ]
then
export EXTRA="$EXTRA --striping"
fi
if [ "$GPUDIRECT" -eq "1" ]
then
export EXTRA="$EXTRA --gpudirect"
fi
if [ "$ASYNCMPI" -eq "1" ]
then
export EXTRA="$EXTRA --asyncmpi"
fi
rm $LOGFILE &> /dev/null
#mpirun -prepend-rank -hostfile hostfile_gpusph -np 4 GPUSPH --device 0 --deltap 0.005 --dir ./tests/mpi_delme
echo Running on $NPROCS nodes, devices "$NODEDEVS"
echo log: $LOGFILE
export MV2_ENABLE_AFFINITY=0
#export MV2_USE_GPUDIRECT=1
# default 65535
#export MV2_CUDA_BLOCK_SIZE=524279
#export MV2_CUDA_BLOCK_SIZE=131071
#export MV2_CUDA_BLOCK_SIZE=65535
# both default 1
#export MV2_CUDA_NONBLOCKING_STREAMS=1
#export MV2_CUDA_IPC=1
unset MV2_CUDA_BLOCK_SIZE
unset COMPUTE_PROFILE
#unset MV2_CUDA_IPC
#unset MV2_CUDA_NONBLOCKING_STREAMS
#unset MV2_CUDA_IPC
#mpirun -prepend-rank -hostfile hostfile_gpusph -np $NPROCS GPUSPH --device ${NODEDEVS} --deltap ${DELTAP} --tend $TEND --dir ./tests/mpi_${NAME} ${EXTRA}
export COMMAND="GPUSPH --device ${NODEDEVS} --deltap ${DELTAP} --tend $TEND --dir ./tests/mpi_${NAME} ${EXTRA}"
echo "./$COMMAND"
echo Log: "$LOGFILE"
mpirun -outfile-pattern $LOGFILE -prepend-rank -hostfile hostfile_gpusph -np $NPROCS $COMMAND
echo "./$COMMAND" >> $LOGFILE
for i in $(seq 0 $NPROCS)
do
egrep "^\[$i" $LOGFILE > $LOGFILE.$i.txt 2> /dev/null
done
#grep compiled $LOGFILE.0.txt
grep compacted $LOGFILE
grep "Simulation time" $LOGFILE.0.txt | tail -n 1
grep "MIPPS" $LOGFILE.0.txt | tail -n 1
grep "Global performance" $LOGFILE.0.txt
#mpirun -prepend-rank -hostfile hostfile_gpusph -np 2 GPUSPH --device 0 --deltap 0.005 --tend 0.001 --dir ./tests/mpi_delme