-
Notifications
You must be signed in to change notification settings - Fork 1
/
prep_conf.sh
executable file
·45 lines (41 loc) · 1.72 KB
/
prep_conf.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
#!/bin/bash
#
# Prepare a machine.conf for VPIC build
#
# for CRAY targets, let the $CRAY_CPU_TARGET take priority (since
# the user should be setting the craype module target properly).
# otherwise fall back to hostname.
#
src_dir="$1"
host=$(hostname)
rm -f $src_dir/machine.conf
if [ x$CRAY_CPU_TARGET = xhaswell ]; then
echo "Preparing machine.conf for CRAY Haswell target"
cp $src_dir/cray-haswell.conf $src_dir/machine.conf
elif [ x$CRAY_CPU_TARGET = xmic-knl ]; then
echo "Preparing machine.conf for CRAY MIC-KNL target"
cp $src_dir/cray-mic-knl.conf $src_dir/machine.conf
elif [ $(hostname | grep tt-fey) ]; then
echo "Preparing machine.conf for Trinitite (haswell)"
cp $src_dir/cray-haswell.conf $src_dir/machine.conf
elif [ $(hostname | grep tr-fe) ]; then
echo "Preparing machine.conf for Trinity (haswell)"
cp $src_dir/cray-haswell.conf $src_dir/machine.conf
elif [ $(hostname | grep ga-fe) ]; then
echo "Preparing machine.conf for Gadget (haswell)"
cp $src_dir/cray-haswell.conf $src_dir/machine.conf
elif [ $(hostname | grep narwhal) ] && [ `which mpirun.mpich` ]; then
echo "Preparing machine.conf for Narwhal (MPICH)"
cp $src_dir/narwhal-mpich.conf $src_dir/machine.conf
elif [ $(hostname | grep narwhal) ] && [ `which mpiexec.hydra` ]; then
echo "Preparing machine.conf for Narwhal (MPICH)"
cp $src_dir/narwhal-mpich.conf $src_dir/machine.conf
elif [ $(hostname | grep narwhal) ]; then
echo "Preparing machine.conf for Narwhal (OpenMPI)"
cp $src_dir/narwhal-openmpi.conf $src_dir/machine.conf
else
echo "prep_conf.sh: WARNING: unknown system, using default (mpich)"
echo "Preparing default machine.conf"
cp $src_dir/narwhal-mpich.conf $src_dir/machine.conf
fi
exit 0