-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_mpi.sh
executable file
·143 lines (114 loc) · 3.97 KB
/
setup_mpi.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
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
132
133
134
135
136
137
138
139
#!/bin/bash
OPTIND=1
usage() { echo "Usage: $0 [-c <string>]" 1>&2; return; }
while getopts ":v:c:" o; do
case "${o}" in
v)
v=${OPTARG}
;;
c)
c=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${c}" ]; then
usage
fi
# container case
if [ $c == 'cont' ]
then
export CONT=/lustre/rz/dbertini/containers/prod/rlx8_ompi_ucx.sif
echo "Singularity container image -> $CONT"
export CC=`which gcc`
export CXX=`which g++`
export FC=`which gfortran`
echo 'Epoch container setup ->'
export EPOCH_ROOT=/usr/local/epoch
export EPOCH_PATH=$EPOCH_ROOT
type epoch1d
type epoch2d
type epoch3d
# Generate static library
mkdir -p sdf2opmd_1d/epoch_libs/
mkdir -p sdf2opmd_2d/epoch_libs/
mkdir -p sdf2opmd_3d/epoch_libs/
ar cr sdf2opmd_1d/epoch_libs/epoch1d_lib.a $EPOCH_PATH/epoch1d/obj/*.o
ar cr sdf2opmd_2d/epoch_libs/epoch2d_lib.a $EPOCH_PATH/epoch2d/obj/*.o
ar cr sdf2opmd_3d/epoch_libs/epoch3d_lib.a $EPOCH_PATH/epoch3d/obj/*.o
return
fi
# check first if we have spack
if ! [ -x "$(which spack)" ]; then
echo 'Error: spack is not installed on this system, quiting ...' >&2
return
fi
echo "selected compiler = ${c}"
# Check in which VAE we are
vae_arch=`spack arch -o`
echo "selected vae: $vae_arch"
if [ $c == 'gcc8' ]
then
echo "loading spack gcc v8 + openmpi v3.1..."
spack load cmake %gcc target=$(spack arch -t)
spack load openmpi target=$(spack arch -t)
spack load --only package hdf5%gcc target=$(spack arch -t)
spack load python target=$(spack arch -t)
if [ ${vae_arch} == "debian10" ]
then
echo "vae:debian10 -> do not load gcc"
elif [ ${vae_arch} == "centos7" ]
then
spack load gcc
fi
# Add adios 2 for openpmd-api
export LD_LIBRARY_PATH=/lustre/rz/dbertini/soft/adios/lib:$LD_LIBRARY_PATH
export PATH=/lustre/rz/dbertini/rz/soft/adios/bin:$PATH
export CPLUS_INCLUDE_PATH=/lustre/rz/dbertini/soft/adios/include:$CPLUS_INCLUDE_PATH
export CMAKE_PREFIX_PATH=/lustre/rz/dbertini/soft/adios2:$CMAKE_PREFIX_PATH
# Add openpmd-api
export LD_LIBRARY_PATH=/lustre/rz/dbertini/soft/openpmd-api/lib:$LD_LIBRARY_PATH
export PATH=/lustre/rz/dbertini/rz/soft/openpmd-api/bin:$PATH
export CPLUS_INCLUDE_PATH=/lustre/rz/dbertini/soft/openpmd-api/include:$CPLUS_INCLUDE_PATH
export CMAKE_PREFIX_PATH=/lustre/rz/dbertini/soft/openpmd-api:$CMAKE_PREFIX_PATH
elif [ $c == 'intel' ]
then
echo "loading spack icc v19 + openmpi v3.1 ..."
spack load [email protected]%intel arch=linux-centos7-x86_64
spack load hdf5%intel arch=linux-centos7-x86_64
spack load gcc
spack load intel-parallel-studio
spack load cmake%intel
elif [ $c == 'gcc11' ]
then
echo "loading local gcc v11.2 + openmpi v4.1 (ibverbs only) ..."
spack load cmake %gcc target=x86_64
module use /lustre/rz/dbertini/modulefiles
module load compiler/gcc/11.2.0_virgo
# export LD_LIBRARY_PATH=$MPI4_PATH/soft/ucx/1.11/lib:$LD_LIBRARY_PATH
# export PATH=$WD/soft/ucx/1.11/bin:$PATH
export HDF5_PATH=/lustre/rz/dbertini/soft/hdf5-gcc11
export LD_LIBRARY_PATH=$MPI4_PATH/soft/ompi4.1_gcc8_centos/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$HDF5_PATH/lib:$LD_LIBRARY_PATH
export PATH=$WD/soft/ompi4.1_gcc8_centos/bin:$PATH
export PATH=$HDF5_PATH/bin:$PATH
fi
echo 'General setup ->'
type gcc
type mpicc
type python
echo 'Epoch setup ->'
# Simple settings for Epoch
export EPOCH_ROOT=/lustre/rz/dbertini/plasma/epoch_dev
export PATH=$EPOCH_ROOT/epoch1d/bin:$EPOCH_ROOT/epoch2d/bin:$EPOCH_ROOT/epoch3d/bin:$PATH
export EPOCH_PATH=$EPOCH_ROOT
type epoch1d
type epoch2d
type epoch3d
# Generate static library
ar cr sdf2opmd_1d/epoch_libs/epoch1d_lib.a $EPOCH_ROOT/epoch1d/obj/*.o
ar cr sdf2opmd_2d/epoch_libs/epoch2d_lib.a $EPOCH_ROOT/epoch2d/obj/*.o
ar cr sdf2opmd_3d/epoch_libs/epoch3d_lib.a $EPOCH_ROOT/epoch3d/obj/*.o