-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.mpi.default
243 lines (185 loc) · 7.43 KB
/
Dockerfile.mpi.default
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
FROM aethereng/codeaster-common:latest as builder
USER root
ARG VERSION_ASTER
ENV DEVTOOLS_COMPUTER_ID=aster
# set environment variables
ENV TEMP_DIRECTORY=/tmp
ENV ASTER_DIRECTORY=/aster
ENV PREREQ_PATH=$ASTER_DIRECTORY
ENV LINKFLAGS="-Wl,--no-as-needed"
# prerequisites paths
ENV LIBPATH_HDF5="${PREREQ_PATH}/hdf5/lib"
ENV INCLUDES_HDF5="${PREREQ_PATH}/hdf5/include"
ENV LD_LIBRARY_PATH="${LIBPATH_HDF5}:${LD_LIBRARY_PATH}"
ENV LIBPATH_MED="${PREREQ_PATH}/med/lib"
ENV INCLUDES_MED="${PREREQ_PATH}/med/include"
ENV PYPATH_MED="${PREREQ_PATH}/med/lib/python3.6/site-packages"
ENV PATH="${PREREQ_PATH}/med/bin:${PATH}"
ENV LD_LIBRARY_PATH="${LIBPATH_MED}:${LD_LIBRARY_PATH}"
ENV PYTHONPATH="${PYPATH_MED}:${PYTHONPATH}"
ENV LIBPATH_METIS="${PREREQ_PATH}/metis/lib"
ENV INCLUDES_METIS="${PREREQ_PATH}/metis/include"
ENV LD_LIBRARY_PATH="${LIBPATH_METIS}:${LD_LIBRARY_PATH}"
ENV LIBPATH_TFEL="${PREREQ_PATH}/tfel/lib"
ENV INCLUDES_TFEL="${PREREQ_PATH}/tfel/include"
ENV LD_LIBRARY_PATH="${LIBPATH_TFEL}:${LD_LIBRARY_PATH}"
ENV PATH="${PREREQ_PATH}/tfel/bin/mfront-3.4.0:${PATH}"
ENV PATH="${PREREQ_PATH}/homard/bin:${PATH}"
ENV LIBPATH_SCOTCH="${PREREQ_PATH}/scotch_mpi/lib"
ENV INCLUDES_SCOTCH="${PREREQ_PATH}/scotch_mpi/include"
ENV LD_LIBRARY_PATH="${LIBPATH_SCOTCH}:${LD_LIBRARY_PATH}"
ENV LIBPATH_MUMPS="${PREREQ_PATH}/mumps_mpi/lib"
ENV INCLUDES_MUMPS="${PREREQ_PATH}/mumps_mpi/include ${PREREQ_PATH}/mumps_mpi/include_seq"
ENV LD_LIBRARY_PATH="${LIBPATH_MUMPS}:${LD_LIBRARY_PATH}"
ENV PATH="${PREREQ_PATH}/miss3d:${PATH}"
ENV PYPATH_ASRUN="${PREREQ_PATH}/asrun/lib/python3.6/site-packages"
ENV PATH="${PREREQ_PATH}/asrun/bin:${PATH}"
ENV PYTHONPATH="${PYPATH_ASRUN}:${PYTHONPATH}"
ENV LIBPATH_PARMETIS="${PREREQ_PATH}/parmetis/lib"
ENV INCLUDES_PARMETIS="${PREREQ_PATH}/parmetis/include"
ENV LD_LIBRARY_PATH="${LIBPATH_PARMETIS}:${LD_LIBRARY_PATH}"
ENV LIBPATH_PETSC="${PREREQ_PATH}/petsc/lib"
ENV INCLUDES_PETSC="${PREREQ_PATH}/petsc/include"
ENV PYPATH_PETSC="${PREREQ_PATH}/petsc/lib"
ENV LD_LIBRARY_PATH="${LIBPATH_PETSC}:${LD_LIBRARY_PATH}"
ENV PYTHONPATH="${PYPATH_PETSC}:${PYTHONPATH}"
ENV LINKFLAGS="${LINKFLAGS} -Wl,-rpath=${LD_LIBRARY_PATH}"
# include libraries
ENV PYTHONPATH=${ASTER_DIRECTORY}/tfel/lib/python3.6/site-packages:$PYTHONPATH
ENV PATH=$ASTER_DIRECTORY/devtools/bin:$PATH
ENV LD_LIBRARY_PATH=$ASTER_DIRECTORY/devtools/lib:$LD_LIBRARY_PATH
ENV ENABLE_MPI=1
# create symlink to lib64
RUN ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib64
WORKDIR ${TEMP_DIRECTORY}
# clone aster
RUN git clone --branch ${VERSION_ASTER} https://gitlab.com/codeaster/src.git aster
# clone devtools
ENV VERSION_DEVTOOLS=default
RUN hg clone -r ${VERSION_DEVTOOLS} http://hg.code.sf.net/p/codeaster/devtools devtools
WORKDIR ${TEMP_DIRECTORY}/aster
RUN sed -i 's/self.check_mpi_get_rank()/#self.check_mpi_get_rank()/g' data/wscript
ENV CONFIG_PARAMETERS_addmem=4096
ENV CONFIG_PARAMETERS_mpiexec="mpirun -np %(mpi_nbcpu)s --hostfile %(mpi_hostfile)s %(program)s --allow-run-as-root"
ENV CONFIG_PARAMETERS_mpi_get_rank="echo ${OMPI_COMM_WORLD_RANK}"
ENV CATALO_CMD="DUMMY="
# set Code Aster package version
ADD add_version.sh .
ADD aster_pkginfo.pytmpl .
RUN chmod +x add_version.sh
RUN ./add_version.sh ${VERSION_ASTER}
RUN cp pkginfo.py ${TEMP_DIRECTORY}/aster/code_aster/pkginfo.py
# install
RUN ./waf_mpi distclean
RUN ./waf_mpi configure \
--use-config=scif_mpi \
--use-config-dir=${ASTER_DIRECTORY}/aster/lib \
--prefix=${ASTER_DIRECTORY}/aster \
--install-tests \
--with-data=${TEMP_DIRECTORY}/aster/data \
--without-hg
RUN ./waf_mpi install
# move testcases to minimize binary image size
RUN mv ${ASTER_DIRECTORY}/aster/share/aster/tests ${TEMP_DIRECTORY}/tests && \
mkdir ${ASTER_DIRECTORY}/aster/share/aster/tests && \
for name in forma01a hsnv100a pynl01a sdll100a sslv155a ssnv128a zzzz100f; do \
mv ${TEMP_DIRECTORY}/tests/${name}* ${ASTER_DIRECTORY}/aster/share/aster/tests/; \
done
RUN rm -rf ${TEMP_DIRECTORY}/*
# binary installation
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
ENV DEVTOOLS_COMPUTER_ID=aster
# Base system + prerequisites
# Show all the dependencies of each prerequisite even if some packages are
# repeated
RUN apt-get update --fix-missing -y --no-install-recommends -o Dpkg::Options::="--force-confold"
RUN apt-get install -y \
g++ \
gcc \
gfortran \
locales \
zlib1g-dev \
bison \
flex \
zlib1g-dev \
libopenblas-dev \
python3-dev \
python3-numpy \
libboost-numpy-dev \
libboost-python-dev \
libopenmpi-dev \
libblacs-mpi-dev \
libscalapack-openmpi-dev \
gdb \
tk \
xterm \
gmsh \
grace
RUN apt-get install -y \
ssh
ENV LANGUAGE=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_MESSAGES=POSIX
ENV LC_CTYPE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
RUN locale-gen en_US.UTF-8 fr_FR.UTF-8
RUN update-locale
ENV ASTER_DIRECTORY=/aster
ENV PREREQ_PATH=$ASTER_DIRECTORY
ENV CONFIG_PARAMETERS_addmem=4800
ENV LINKFLAGS="-Wl,--no-as-needed"
# prerequisites paths
ENV LIBPATH_HDF5="${PREREQ_PATH}/hdf5/lib"
ENV INCLUDES_HDF5="${PREREQ_PATH}/hdf5/include"
ENV LD_LIBRARY_PATH="${LIBPATH_HDF5}:${LD_LIBRARY_PATH}"
ENV LIBPATH_MED="${PREREQ_PATH}/med/lib"
ENV INCLUDES_MED="${PREREQ_PATH}/med/include"
ENV PYPATH_MED="${PREREQ_PATH}/med/lib/python3.6/site-packages"
ENV PATH="${PREREQ_PATH}/med/bin:${PATH}"
ENV LD_LIBRARY_PATH="${LIBPATH_MED}:${LD_LIBRARY_PATH}"
ENV PYTHONPATH="${PYPATH_MED}:${PYTHONPATH}"
ENV LIBPATH_METIS="${PREREQ_PATH}/metis/lib"
ENV INCLUDES_METIS="${PREREQ_PATH}/metis/include"
ENV LD_LIBRARY_PATH="${LIBPATH_METIS}:${LD_LIBRARY_PATH}"
ENV LIBPATH_TFEL="${PREREQ_PATH}/tfel/lib"
ENV INCLUDES_TFEL="${PREREQ_PATH}/tfel/include"
ENV LD_LIBRARY_PATH="${LIBPATH_TFEL}:${LD_LIBRARY_PATH}"
ENV PATH="${PREREQ_PATH}/tfel/bin/mfront-3.4.0:${PATH}"
ENV PATH="${PREREQ_PATH}/homard/bin:${PATH}"
ENV LIBPATH_SCOTCH="${PREREQ_PATH}/scotch_mpi/lib"
ENV INCLUDES_SCOTCH="${PREREQ_PATH}/scotch_mpi/include"
ENV LD_LIBRARY_PATH="${LIBPATH_SCOTCH}:${LD_LIBRARY_PATH}"
ENV LIBPATH_MUMPS="${PREREQ_PATH}/mumps_mpi/lib"
ENV INCLUDES_MUMPS="${PREREQ_PATH}/mumps_mpi/include ${PREREQ_PATH}/mumps_mpi/include_seq"
ENV LD_LIBRARY_PATH="${LIBPATH_MUMPS}:${LD_LIBRARY_PATH}"
ENV PATH="${PREREQ_PATH}/miss3d:${PATH}"
ENV PYPATH_ASRUN="${PREREQ_PATH}/asrun/lib/python3.6/site-packages"
ENV PATH="${PREREQ_PATH}/asrun/bin:${PATH}"
ENV PYTHONPATH="${PYPATH_ASRUN}:${PYTHONPATH}"
ENV LIBPATH_PARMETIS="${PREREQ_PATH}/parmetis/lib"
ENV INCLUDES_PARMETIS="${PREREQ_PATH}/parmetis/include"
ENV LD_LIBRARY_PATH="${LIBPATH_PARMETIS}:${LD_LIBRARY_PATH}"
ENV LIBPATH_PETSC="${PREREQ_PATH}/petsc/lib"
ENV INCLUDES_PETSC="${PREREQ_PATH}/petsc/include"
ENV PYPATH_PETSC="${PREREQ_PATH}/petsc/lib"
ENV LD_LIBRARY_PATH="${LIBPATH_PETSC}:${LD_LIBRARY_PATH}"
ENV PYTHONPATH="${PYPATH_PETSC}:${PYTHONPATH}"
ENV LINKFLAGS="${LINKFLAGS} -Wl,-rpath=${LD_LIBRARY_PATH}"
# include libraries
ENV PYTHONPATH=${ASTER_DIRECTORY}/tfel/lib/python3.6/site-packages:$PYTHONPATH
ENV PATH=$ASTER_DIRECTORY/devtools/bin:$PATH
ENV LD_LIBRARY_PATH=$ASTER_DIRECTORY/devtools/lib:$LD_LIBRARY_PATH
RUN mkdir /work && \
useradd -b /work -m -s /bin/bash aster
# clean source directory
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*
COPY --from=builder /aster /aster
COPY run_testcases /usr/local/bin/run_testcases
# replay
RUN ln -s /usr/bin/python3 /usr/local/bin/python && \
ln -s /aster/tfel/bin/mfront-3.4.0 /usr/local/bin/ && \
ln -s /aster/asrun/bin/as_run /usr/local/bin/
USER aster
WORKDIR /work/aster