├── LICENSE ├── README.md ├── base ├── Dockerfile └── set-home-permissions.sh ├── code_aster ├── Dockerfile ├── WELCOME └── data │ ├── aster.patch │ ├── cfg.py │ ├── parmetis.patch │ └── petsc.patch ├── run_tests.sh └── salome_meca ├── Dockerfile └── WELCOME /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2018, Tianyi Li 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker for Code_Aster 2 | 3 | This repository contains the Dockerfiles for building images of [Code_Aster](https://bitbucket.org/code_aster/codeaster-src) inside a Ubuntu based system. The built images are available on [quay.io](https://quay.io/tianyikillua). Using [Docker](https://www.docker.com/) you can directly execute Code_Aster on virtually any platform (Linux, Mac, Windows, ...) and without having to compile yourself the full package (`hdf5`, `med`, `mumps`, etc). 4 | 5 | Some files are based on the [Docker files of the FEniCS project](https://bitbucket.org/fenics-project/docker). 6 | 7 | Currently the following images are available: 8 | 9 | 1. `quay.io/tianyikillua/code_aster:v13`: a `GCC`-based build of the 13.6 version. Both the sequential and parallel (MPI) versions are available. Its size is around 3 GB. 10 | 11 | ``` 12 | -- CODE_ASTER -- VERSION : EXPLOITATION (stable) -- 13 | 14 | Version 13.6.0 modifiée le 21/06/2018 15 | révision fb950a49b96d - branche 'v13' 16 | Copyright EDF R&D 1991 - 2018 17 | 18 | Version de Python : 2.7.12 19 | Version de NumPy : 1.11.0 20 | Version de la librairie HDF5 : 1.8.14 21 | Version de la librairie MED : 3.3.1 22 | Version de la librairie MFront : 3.0.0 23 | Version de la librairie MUMPS : 5.1.1 24 | Version de la librairie PETSc : 3.7.7p0 25 | Version de la librairie SCOTCH : 6.0.4 26 | ``` 27 | 28 | 2. `quay.io/tianyikillua/code_aster`: a `GCC`-based build of the 14.4 version. Both the sequential and parallel (MPI) versions are available. Its size is around 3 GB. 29 | 30 | ``` 31 | -- CODE_ASTER -- VERSION : DÉVELOPPEMENT STABILISÉE (testing) -- 32 | 33 | Version 14.4.0 modifiée le 28/06/2019 34 | révision 9aa55c3f2e9e - branche 'default' 35 | Copyright EDF R&D 1991 - 2019 36 | 37 | Version de Python : 3.6.8 38 | Version de NumPy : 1.13.3 39 | Version de la librairie HDF5 : 1.10.3 40 | Version de la librairie MED : 4.0.0 41 | Version de la librairie MFront : non disponible 42 | Version de la librairie MUMPS : 5.1.2 43 | Librairie PETSc : non disponible 44 | Version de la librairie SCOTCH : 6.0.4 45 | ``` 46 | 47 | > For the 14.4 version, currently PETSc is not supported. It may be tricky to compile PETSc with 64-bit support. 48 | 49 | 3. `quay.io/tianyikillua/salome_meca`: the official releases of [Salome_Meca](https://www.code-aster.org/V2/spip.php?article295) Only the sequential version is available, but `aster` is compiled with Intel compilers that in general give better performance. Additional packages such as `ecrevisse` are also provided. Unnecessary modules could in fact be removed to reduce the image size, which is currently around 4.1 GB. 50 | 51 | > There is a `profile.sh` issue in the latest 2019 version such that the `as_run` command does not work properly. To investigate. 52 | 53 | | Image name | Build status | Description | Version | 54 | | ---------------------------------- | ------------------------------------------------------------ | ----------------------------------- | ------- | 55 | | `quay.io/tianyikillua/code_aster` | [![Docker Repository on Quay](https://quay.io/repository/tianyikillua/code_aster/status "Docker Repository on Quay")](https://quay.io/repository/tianyikillua/code_aster) | Code_Aster | 14.4 | 56 | | `quay.io/tianyikillua/code_aster:v13` | [![Docker Repository on Quay](https://quay.io/repository/tianyikillua/code_aster_testing/status "Docker Repository on Quay")](https://quay.io/repository/tianyikillua/code_aster) | Code_Aster | 13.6 | 57 | | `quay.io/tianyikillua/salome_meca` | [![Docker Repository on Quay](https://quay.io/repository/tianyikillua/salome_meca/status "Docker Repository on Quay")](https://quay.io/repository/tianyikillua/salome_meca) | Salome_Meca | 2019 | 58 | | `quay.io/tianyikillua/salome_meca:v2018` | [![Docker Repository on Quay](https://quay.io/repository/tianyikillua/salome_meca/status "Docker Repository on Quay")](https://quay.io/repository/tianyikillua/salome_meca) | Salome_Meca | 2018 | 59 | 60 | ### Introduction and usage 61 | 62 | To install Docker for your platform, follow the instructions at [docker.com](https://www.docker.com/get-docker). The [tutorial](https://docs.docker.com/get-started) provided there may also be useful. 63 | 64 | One you have Docker installed, you can use the following commands to enjoy this Code_Aster image. 65 | 66 | #### Preliminary verification 67 | 68 | We can run an interactive `bash` session containing in particular the `as_run` command in its `PATH` 69 | 70 | ```sh 71 | docker run -ti --rm quay.io/tianyikillua/code_aster 72 | ``` 73 | 74 | where `-ti` stands for an interactive process and `--rm` means the container will be automatically removed when it exits, in order to save disk space. 75 | 76 | If everything goes well, you will see the following message showing up in the terminal 77 | 78 | ``` 79 | # Code_Aster latest stable version 80 | 81 | Welcome to Code_Aster! 82 | 83 | This image provides a GCC-based build of the latest 84 | stable release of Code_Aster containing the following 85 | components: 86 | 87 | ... 88 | 89 | To execute an "export" file, just run 90 | 91 | as_run foo.export 92 | ``` 93 | 94 | To immediately verify that Code_Aster indeed works, you may launch a simple testcase (here `forma02a`) 95 | 96 | ```sh 97 | as_run --test forma02a 98 | ``` 99 | 100 | for the sequential version, and 101 | 102 | ```sh 103 | as_run --vers stable_mpi --test forma02a 104 | ``` 105 | 106 | for the parallel version. 107 | 108 | #### Running simulation via `as_run` inside an interactive session 109 | 110 | You already have all simulation files and an `export` file `test.export` defining all input/outputs in your current directory. You can first open an interactive session as before, and then run the simulation using the `as_run` command. In this case, you also need to share your current working directory into the container directory `/home/aster/shared` via the `-v` command. The `-w` command defines the starting working directory. 111 | 112 | ```sh 113 | docker run -ti --rm -v $(pwd):/home/aster/shared -w /home/aster/shared quay.io/tianyikillua/code_aster 114 | as_run test.export 115 | ``` 116 | 117 | The Windows users may need to replace `$(pwd)` by `%cd%`. 118 | 119 | Of course, you need to have a correct `export` file. 120 | 121 | 1. All files should be accessible by Docker via the `/home/aster/shared` directory. They should be given using their relative path or absolute path including `/home/aster/shared`, like this 122 | 123 | ``` 124 | F comm /home/aster/shared/test.comm D 1 125 | F mmed /home/aster/shared/test.med D 20 126 | F mess /home/aster/shared/test.mess R 6 127 | F resu /home/aster/shared/test.resu R 8 128 | ``` 129 | 130 | 2. In order to use the parallel version, these are the related variables in the `export` file 131 | 132 | ``` 133 | P version stable_mpi 134 | P mpi_nbcpu 4 -> number of CPU cores 135 | P mpi_nbnoeud 1 -> number of nodes 136 | P ncpus 1 -> number of threads (OpenMP) 137 | ``` 138 | 139 | It is recommended to read the [official Code_Aster documentation on parallelism](https://www.code-aster.org/V2/doc/default/en/man_u/u2/u2.08.06.pdf). 140 | 141 | #### Running simulation via a direct `as_run` command 142 | 143 | You can also directly run the simulation by indicating the exact command to Docker, without opening an interactive session. Suppose you want to run `test.export`, you can directly run in your host 144 | 145 | ```sh 146 | docker run --rm -v $(pwd):/home/aster/shared -w /home/aster/shared quay.io/tianyikillua/code_aster "/home/aster/aster/bin/as_run test.export" 147 | ``` 148 | 149 | Note that you have to specify the absolute path of `as_run` (`/home/aster/aster/bin/as_run`). 150 | 151 | #### Running simulation via `astk` 152 | 153 | You can also use the graphical interface `astk` to run your simulations, which will automatically write an `export` file for you. 154 | 155 | 1. For Windows users, download and open a X11 server via [MobaXterm](https://mobaxterm.mobatek.net), etc. 156 | 2. Get your IP address (use `ipconfig` for Windows users) 157 | 3. Run the following in the directory containing simulations files 158 | 159 | ```sh 160 | docker run -ti --rm -e DISPLAY=[YOUR IP ADDRESS]:0 -v $(pwd):/home/aster/shared -w /home/aster/shared quay.io/tianyikillua/code_aster 161 | ``` 162 | 163 | 4. Run `astk` in your terminal, and voilà (see [here](https://user-images.githubusercontent.com/4027283/59491059-7323d200-8e86-11e9-8bba-13f41012236f.png)). Remember to define a `ncpus` value before running your simulation (see [here](https://user-images.githubusercontent.com/4027283/59494661-ed0b8980-8e8d-11e9-8c0e-358396dfb1ba.png)). 164 | 165 | ### Testcases qualification 166 | 167 | A simple `run_tests.sh` script file is available at `/home/aster` that will launch all the testcases available. You can just run 168 | 169 | ```sh 170 | ./run_tests.sh 171 | ``` 172 | 173 | The test results are saved to `/home/aster/shared/test` (which will be shared with your host if you are using the `-v` command). A summary will also be given at the end. 174 | 175 | By default it will run the sequential version `stable`. You can define an environmental variable `ASRUN` to run the parallel version `stable_mpi` 176 | 177 | ```sh 178 | export ASRUN="/home/aster/aster/bin/as_run --vers stable_mpi" 179 | ./run_tests.sh 180 | ``` 181 | 182 | Using the sequential and parallel versions provided here, only the following tests fail mainly due to lack of some features not provided by the `aster-full` package. 183 | 184 | > The following tests are reported for the 13.6 version. 185 | 186 | - Missing `xmgrace` (20 cases) 187 | 188 | ``` 189 | forma10a forma10b forma30b sdld102a sdnl105a sdnl105b sdns107a sdns107b 190 | ssnl127a ssnl127b ssnl127c ssnl127d ssnl127e ssnp150b ssnp153a ssnv194a 191 | ssnv219b ssnv219c ssnv219d tplp107b 192 | ``` 193 | 194 | - Missing `europlexus` (28 cases) 195 | 196 | ``` 197 | plexu* (except plexu10c) 198 | ``` 199 | 200 | - `gmsh` installation problem (3 cases, see [#1](../../issues/1)) 201 | 202 | ``` 203 | ssls131a zzzz151a zzzz216b 204 | ``` 205 | 206 | - Missing `miss3d` (27 cases) 207 | 208 | ``` 209 | fdlv112b fdlv112e fdlv112f fdlv112g fdlv112k fdlv113a sdls118a sdls118d 210 | sdlv133a sdlx101a sdlx101b sdlx103a sdlx104a sdlx105a sdlx106a sdnx100a 211 | sdnx100b sdnx100c sdnx100d sdnx100e sdnx100f sdnx100g sdnx101a sdnx101b 212 | sdnx101c zzzz108c zzzz200b 213 | ``` 214 | 215 | - Missing `ecrevisse` (19 cases) 216 | 217 | ``` 218 | zzzz218a zzzz218b zzzz218c zzzz354a zzzz354b zzzz354c zzzz354d zzzz354e 219 | zzzz354f zzzz354g zzzz354h zzzz355a zzzz355b zzzz355c zzzz355d zzzz355e 220 | zzzz355f zzzz355g zzzz355h 221 | ``` 222 | 223 | - Missing `CALC_MAC3COEUR` (31 cases) 224 | 225 | ``` 226 | mac3c* 227 | ``` 228 | 229 | - Missing `MACR_RECAL ` (6 cases) 230 | 231 | ``` 232 | sdls121a sdls121b sdls121c zzzz159b zzzz159e zzzz159f 233 | ``` 234 | 235 | - Missing material data (32 cases) 236 | 237 | ``` 238 | hsnv131a ort001a ssll501a ssna117a ssna117b ssna117c ssnl121b ssnl121c 239 | ssnl128a ssnl128b ssnl128c ssnl128d ssnl131a ssnl131b ssnl131c ssnl131d 240 | ssnp132a ssnv101c ssnv113a ssnv190a ssnv190b ssnv212a ssnv213a ssnv214a 241 | ssnv215a ssnv216a zzzz118a zzzz118b zzzz118c zzzz118d zzzz120a zzzz120b 242 | ``` 243 | 244 | - Missing `scipy` (1 case) 245 | 246 | ``` 247 | sdll151a 248 | ``` 249 | 250 | - Missing `devtools` (1 case) 251 | 252 | ``` 253 | supv002a 254 | ``` 255 | 256 | - Possible numerical issues to be investigated further (12 cases) 257 | 258 | ``` 259 | erreu06a forma11a rccm01b sdnd123a ssnp504e ssns115b ssnv128r ssnv157k 260 | supv003a umat002a wtnv135a zzzz255b 261 | ``` 262 | 263 | ### Performance 264 | 265 | On a Windows 10 host with 8 Intel(R) Xeon(R) W-2123 CPU @ 3.6 GHz, with the [Docker Community Edition for Windows](https://store.docker.com/editions/community/docker-ce-desktop-windows), the following strong scaling result is obtained for the [perf009d](https://www.code-aster.org/V2/spip.php?article260) testcase. 266 | 267 | ![](https://user-images.githubusercontent.com/4027283/41157663-dfb66bc8-6b26-11e8-8706-98c186812d71.png) 268 | 269 | Similarly, for the [perf015](https://www.code-aster.org/V2/spip.php?article662) testcases, we obtain 270 | 271 | ![](https://user-images.githubusercontent.com/4027283/41162091-2b9c7506-6b35-11e8-9808-d02c99358ff7.png) 272 | 273 | Since back-end virtualization may still be used by Docker under Mac and Windows, performance should be better under a native Linux environment using Docker. 274 | 275 | ### Author 276 | 277 | [Tianyi Li](https://www.linkedin.com/in/tianyikillua) ([tianyikillua@gmail.com](mailto:tianyikillua@gmail.com)) 278 | -------------------------------------------------------------------------------- /base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM phusion/baseimage:0.11 2 | 3 | # Get Ubuntu updates and basic packages 4 | USER root 5 | RUN apt-get update && \ 6 | apt-get upgrade -y --with-new-pkgs -o Dpkg::Options::="--force-confold" && \ 7 | apt-get install -y \ 8 | locales sudo \ 9 | gcc g++ gfortran \ 10 | wget \ 11 | python3 \ 12 | python3-dev \ 13 | python3-numpy \ 14 | libxft2 \ 15 | libxmu6 \ 16 | libxss1 && \ 17 | echo "C.UTF-8 UTF-8" > /etc/locale.gen && \ 18 | locale-gen && \ 19 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 20 | 21 | # Set locale environment 22 | ENV LC_ALL=C.UTF-8 \ 23 | LANG=C.UTF-8 \ 24 | LANGUAGE=C.UTF-8 25 | 26 | COPY set-home-permissions.sh /etc/my_init.d/set-home-permissions.sh 27 | 28 | # Add a new user 29 | RUN adduser --disabled-password --gecos "" aster && \ 30 | adduser aster sudo && \ 31 | echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ 32 | rm /etc/my_init.d/10_syslog-ng.init && \ 33 | chmod +x /etc/my_init.d/set-home-permissions.sh 34 | 35 | # Create a sharable zone 36 | USER aster 37 | RUN touch /home/aster/.sudo_as_admin_successful && \ 38 | mkdir /home/aster/shared 39 | VOLUME /home/aster/shared 40 | 41 | WORKDIR /home/aster 42 | USER root 43 | ENTRYPOINT ["/sbin/my_init", "--quiet", "--", "/sbin/setuser", "aster", "/bin/bash", "-l", "-c"] 44 | CMD ["/bin/bash", "-i"] 45 | -------------------------------------------------------------------------------- /base/set-home-permissions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # User can pass e.g. --env HOST_UID=1003 so that UID in the container matches 3 | # with the UID on the host. 4 | if [ "$HOST_UID" ]; then 5 | usermod -u $HOST_UID aster 6 | fi 7 | if [ "$HOST_GID" ]; then 8 | groupmod -g $HOST_GID aster 9 | fi 10 | -------------------------------------------------------------------------------- /code_aster/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/tianyikillua/base:latest 2 | LABEL maintainer "Tianyi Li " 3 | 4 | # Variables 5 | ENV HDF5_VER=1.10.3 6 | ENV MED_VER=4.0.0 7 | ENV METIS_VER=5.1.0 8 | ENV PARMETIS_VER=4.0.3 9 | ENV SCOTCH_VER=6.0.4 10 | ENV MUMPS_VER=5.1.2 11 | ENV MFRONT_VER=3.2.1 12 | ENV PETSC_VER=3.9.4 13 | ENV SCALAPACK_VER=2.0.2 14 | ENV ASTER_VER=14.4 15 | 16 | ENV SCOTCH_SRC="scotch-${SCOTCH_VER}-aster7.tar.gz" 17 | ENV MUMPS_SRC="mumps-${MUMPS_VER}-aster6.tar.gz" 18 | ENV ASTER_SRC="aster-${ASTER_VER}.0.tgz" 19 | ENV SCALAPACK_SRC="http://www.netlib.org/scalapack/scalapack-${SCALAPACK_VER}.tgz" 20 | ENV PARMETIS_SRC="http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-${PARMETIS_VER}.tar.gz" 21 | ENV PETSC_SRC="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-${PETSC_VER}.tar.gz" 22 | 23 | ENV ASTER_FULL_SRC="https://code-aster.org/FICHIERS/aster-full-src-14.4.0-1.noarch.tar.gz" 24 | ENV ASTER_ROOT=/home/aster/aster 25 | ENV PUBLIC=$ASTER_ROOT/public 26 | 27 | # Get Ubuntu updates and basic packages 28 | USER root 29 | RUN apt-get update && \ 30 | apt-get upgrade -y --with-new-pkgs -o Dpkg::Options::="--force-confold" && \ 31 | apt-get install -y \ 32 | patch \ 33 | make cmake \ 34 | grace \ 35 | zlib1g-dev \ 36 | tk bison flex \ 37 | libglu1-mesa libxcursor-dev \ 38 | libmpich-dev \ 39 | libopenblas-dev \ 40 | libsuperlu-dev \ 41 | libboost-python-dev && \ 42 | apt-get clean && \ 43 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 44 | 45 | USER aster 46 | WORKDIR /tmp 47 | 48 | # Download and install the latest stable version 49 | RUN wget --no-check-certificate --quiet ${ASTER_FULL_SRC} -O aster_full.tar.gz && \ 50 | mkdir aster_full && tar xf aster_full.tar.gz -C aster_full --strip-components 1 && \ 51 | cd aster_full && \ 52 | python3 setup.py install --prefix ${ASTER_ROOT} --noprompt && \ 53 | mv SRC/${SCOTCH_SRC} SRC/${MUMPS_SRC} SRC/${ASTER_SRC} /tmp && \ 54 | rm -rf /tmp/aster_full.tar.gz /tmp/aster_full && \ 55 | cd ${PUBLIC}/tfel-${MFRONT_VER}/bin && \ 56 | ln -s mfront-3.2.1 mfront 57 | 58 | # Build ptscotch 59 | RUN mkdir ptscotch && tar xf ${SCOTCH_SRC} -C ptscotch --strip-components 1 && \ 60 | cd ptscotch/src && \ 61 | make scotch esmumps ptscotch ptesmumps CCD=mpicc && \ 62 | mkdir ${PUBLIC}/ptscotch-${SCOTCH_VER} && \ 63 | make install prefix=${PUBLIC}/ptscotch-${SCOTCH_VER} && \ 64 | rm -rf /tmp/${SCOTCH_SRC} /tmp/ptscotch 65 | 66 | # Build parmetis 67 | # Patch from https://bitbucket.org/code_aster/parmetis/src/parmetis_aster/ 68 | COPY --chown=aster:aster code_aster/data/parmetis.patch /tmp/parmetis.patch 69 | RUN wget --no-check-certificate --quiet ${PARMETIS_SRC} -O parmetis.tar.gz && \ 70 | mkdir parmetis && tar xf parmetis.tar.gz -C parmetis --strip-components 1 && \ 71 | patch -s -p0 < parmetis.patch && \ 72 | cd parmetis && \ 73 | make config prefix=${PUBLIC}/parmetis-${PARMETIS_VER} && \ 74 | make && \ 75 | make install && \ 76 | rm -rf /tmp/parmetis.tar.gz /tmp/parmetis.patch /tmp/parmetis 77 | 78 | # Build scalapack 79 | RUN wget --no-check-certificate --quiet ${SCALAPACK_SRC} -O scalapack.tar.gz && \ 80 | mkdir scalapack && tar xf scalapack.tar.gz -C scalapack --strip-components 1 && \ 81 | cd scalapack && \ 82 | mkdir build && cd build && \ 83 | cmake -DCMAKE_INSTALL_PREFIX=${PUBLIC}/scalapack-${SCALAPACK_VER} -DBUILD_SHARED_LIBS=ON .. && \ 84 | make && \ 85 | make install && \ 86 | cd ${PUBLIC}/scalapack-${SCALAPACK_VER}/lib && \ 87 | cp libscalapack.so libblacs.so && \ 88 | rm -rf /tmp/scalapack.tar.gz /tmp/scalapack 89 | 90 | # Build parallel mumps 91 | RUN mkdir mumps && tar xf ${MUMPS_SRC} -C mumps --strip-components 1 && \ 92 | cd mumps && \ 93 | export INCLUDES="${PUBLIC}/metis-${METIS_VER}/include \ 94 | ${PUBLIC}/parmetis-${PARMETIS_VER}/include \ 95 | ${PUBLIC}/ptscotch-${SCOTCH_VER}/include" && \ 96 | export LIBPATH="${PUBLIC}/metis-${METIS_VER}/lib \ 97 | ${PUBLIC}/parmetis-${PARMETIS_VER}/lib \ 98 | ${PUBLIC}/ptscotch-${SCOTCH_VER}/lib \ 99 | ${PUBLIC}/scalapack-${SCALAPACK_VER}/lib" && \ 100 | python3 waf configure --prefix=${PUBLIC}/mumps-${MUMPS_VER}_mpi --install-tests --enable-mpi && \ 101 | python3 waf build --jobs=1 && \ 102 | python3 waf install --jobs=1 && \ 103 | rm -rf /tmp/${MUMPS_SRC} /tmp/mumps 104 | 105 | # Build parallel PETSc 106 | # Patch from https://hitoricae.com/2019/11/10/code_aster-14-4-with-petsc/ 107 | COPY --chown=aster:aster code_aster/data/petsc.patch /tmp/petsc.patch 108 | RUN wget --no-check-certificate --quiet ${PETSC_SRC} -O petsc.tar.gz && \ 109 | mkdir petsc && tar xf petsc.tar.gz -C petsc --strip-components 1 && \ 110 | patch -s -p0 < petsc.patch && \ 111 | cd petsc && \ 112 | ./configure --COPTFLAGS="-O2" \ 113 | --CXXOPTFLAGS="-O2" \ 114 | --FOPTFLAGS="-O2" \ 115 | --with-debugging=0 \ 116 | --with-shared-libraries=1 \ 117 | --with-scalapack-dir=${PUBLIC}/scalapack-${SCALAPACK_VER} \ 118 | --with-mumps-dir=${PUBLIC}/mumps-${MUMPS_VER}_mpi \ 119 | --with-metis-dir=${PUBLIC}/metis-${METIS_VER} \ 120 | --with-parmetis-dir=${PUBLIC}/parmetis-${PARMETIS_VER} \ 121 | --with-ptscotch-dir=${PUBLIC}/ptscotch-${SCOTCH_VER} \ 122 | --download-hypre \ 123 | --download-ml \ 124 | --LIBS="-lgomp" \ 125 | --prefix=${PUBLIC}/petsc-${PETSC_VER} && \ 126 | make all && \ 127 | make install && \ 128 | rm -rf /tmp/petsc.tar.gz /tmp/petsc 129 | 130 | # Build parallel aster 131 | COPY --chown=aster:aster code_aster/data/cfg.py /tmp/cfg.py 132 | COPY --chown=aster:aster code_aster/data/aster.patch /tmp/aster.patch 133 | RUN . ${ASTER_ROOT}/${ASTER_VER}/share/aster/profile_mfront.sh && \ 134 | . ${ASTER_ROOT}/etc/codeaster/profile.sh && \ 135 | mkdir aster && tar xf ${ASTER_SRC} -C aster --strip-components 1 && \ 136 | patch aster/waftools/mathematics.py < aster.patch && \ 137 | cd aster && \ 138 | export INCLUDES="/usr/include/superlu \ 139 | ${PUBLIC}/hdf5-${HDF5_VER}/include \ 140 | ${PUBLIC}/med-${MED_VER}/include \ 141 | ${PUBLIC}/metis-${METIS_VER}/include \ 142 | ${PUBLIC}/parmetis-${PARMETIS_VER}/include \ 143 | ${PUBLIC}/ptscotch-${SCOTCH_VER}/include \ 144 | ${PUBLIC}/mumps-${MUMPS_VER}_mpi/include \ 145 | ${PUBLIC}/petsc-${PETSC_VER}/include \ 146 | ${PUBLIC}/tfel-${MFRONT_VER}/include" && \ 147 | export LIBPATH="${PUBLIC}/hdf5-${HDF5_VER}/lib \ 148 | ${PUBLIC}/med-${MED_VER}/lib \ 149 | ${PUBLIC}/metis-${METIS_VER}/lib \ 150 | ${PUBLIC}/parmetis-${PARMETIS_VER}/lib \ 151 | ${PUBLIC}/ptscotch-${SCOTCH_VER}/lib \ 152 | ${PUBLIC}/scalapack-${SCALAPACK_VER}/lib \ 153 | ${PUBLIC}/mumps-${MUMPS_VER}_mpi/lib \ 154 | ${PUBLIC}/petsc-${PETSC_VER}/lib \ 155 | ${PUBLIC}/tfel-${MFRONT_VER}/lib" && \ 156 | export METISDIR=${PUBLIC}/metis-${METIS_VER} && \ 157 | export TFELHOME=${PUBLIC}/tfel-${MFRONT_VER} && \ 158 | export GMSH_BIN_DIR=${PUBLIC}/gmsh-3.0.6-Linux64/bin && \ 159 | export HOMARD_ASTER_ROOT_DIR=${PUBLIC}/homard-11.12 && \ 160 | ./waf configure --use-config-dir=/tmp --use-config=cfg --prefix=${ASTER_ROOT}/${ASTER_VER}_mpi --install-tests --enable-mpi && \ 161 | ./waf build && \ 162 | ./waf install && \ 163 | rm -rf /tmp/* 164 | 165 | # Add a welcome message and a script for testcases 166 | WORKDIR /home/aster 167 | COPY --chown=aster:aster code_aster/WELCOME /home/aster/WELCOME 168 | COPY --chown=aster:aster run_tests.sh /home/aster/run_tests.sh 169 | 170 | RUN echo "vers : stable_mpi:${ASTER_ROOT}/${ASTER_VER}_mpi/share/aster" >> ${ASTER_ROOT}/etc/codeaster/aster && \ 171 | echo "localhost" > ${ASTER_ROOT}/etc/codeaster/mpi_hostfile && \ 172 | echo "mpi_get_procid_cmd : echo \$PMI_RANK" >> ${ASTER_ROOT}/etc/codeaster/asrun && \ 173 | echo "" >> .bashrc && \ 174 | echo "source ${ASTER_ROOT}/etc/codeaster/profile.sh" >> .bashrc && \ 175 | echo "source ${ASTER_ROOT}/${ASTER_VER}/share/aster/profile_mfront.sh" >> .bashrc && \ 176 | echo "cat ~/WELCOME" >> .bashrc && \ 177 | echo "echo" >> .bashrc 178 | 179 | USER root 180 | -------------------------------------------------------------------------------- /code_aster/WELCOME: -------------------------------------------------------------------------------- 1 | # Code_Aster 14.4 2 | 3 | Welcome to Code_Aster! 4 | 5 | This image provides a GCC-based build of the 14.4 version of Code_Aster containing the following 6 | components: 7 | 8 | - hdf5 1.10.3 9 | - med 4.0.0 10 | - gmsh 3.0.6 11 | - scotch 6.0.4 12 | - astk 2019.0 13 | - metis 5.1.0 14 | - mfront 3.2.1 15 | - mumps 5.1.2 16 | - homard 11.12 17 | - aster 14.4.0 18 | 19 | To execute an "export" file, just run 20 | 21 | as_run foo.export 22 | -------------------------------------------------------------------------------- /code_aster/data/aster.patch: -------------------------------------------------------------------------------- 1 | --- aster/waftools/mathematics.py 2020-06-05 14:58:36.000000000 +0200 2 | +++ aster_patched/waftools/mathematics.py 2020-06-05 14:58:57.000000000 +0200 3 | @@ -359,9 +359,6 @@ 4 | blacs_fragment = r""" 5 | program test_blacs 6 | integer iam, nprocs 7 | - call blacs_pinfo (iam, nprocs) 8 | - print *,iam 9 | - print *,nprocs 10 | end program test_blacs 11 | """ 12 | 13 | -------------------------------------------------------------------------------- /code_aster/data/cfg.py: -------------------------------------------------------------------------------- 1 | def configure(self): 2 | opts = self.options 3 | 4 | opts.parallel = True 5 | opts.enable_petsc = True 6 | opts.petsc_libs = "petsc HYPRE ml" 7 | 8 | opts.maths_libs = "openblas superlu" 9 | opts.enable_homard = True 10 | opts.with_prog_metis = True 11 | opts.with_prog_gmsh = True 12 | opts.with_prog_homard = True 13 | opts.with_prog_xmgrace = True 14 | 15 | self.env.append_value("LIB_METIS", ("parmetis")) 16 | self.env.append_value( 17 | "LIB_SCOTCH", ("ptscotch", "ptscotcherr", "ptscotcherrexit", "ptesmumps") 18 | ) 19 | -------------------------------------------------------------------------------- /code_aster/data/parmetis.patch: -------------------------------------------------------------------------------- 1 | diff -ruN parmetis/metis/include/metis.h parmetis_aster/metis/include/metis.h 2 | --- parmetis/metis/include/metis.h 2013-03-30 17:24:50.000000000 +0100 3 | +++ parmetis_aster/metis/include/metis.h 2019-04-29 13:43:58.000000000 +0200 4 | @@ -30,7 +30,11 @@ 5 | GCC does provides these definitions in stdint.h, but it may require some 6 | modifications on other architectures. 7 | --------------------------------------------------------------------------*/ 8 | +#ifdef INTSIZE32 9 | #define IDXTYPEWIDTH 32 10 | +#else 11 | +#define IDXTYPEWIDTH 64 12 | +#endif 13 | 14 | 15 | /*-------------------------------------------------------------------------- 16 | -------------------------------------------------------------------------------- /code_aster/data/petsc.patch: -------------------------------------------------------------------------------- 1 | diff -ruN petsc/config/BuildSystem/config/packages/metis.py petsc_aster/config/BuildSystem/config/packages/metis.py 2 | --- petsc/config/BuildSystem/config/packages/metis.py 2018-07-02 17:58:27.000000000 +0200 3 | +++ petsc_aster/config/BuildSystem/config/packages/metis.py 2020-06-04 20:47:14.000000000 +0200 4 | @@ -40,12 +40,12 @@ 5 | config.package.Package.configureLibrary(self) 6 | oldFlags = self.compilers.CPPFLAGS 7 | self.compilers.CPPFLAGS += ' '+self.headers.toString(self.include) 8 | - if not self.checkCompile('#include "metis.h"', '#if (IDXTYPEWIDTH != '+ str(self.getDefaultIndexSize())+')\n#error incompatible IDXTYPEWIDTH\n#endif'): 9 | - if self.defaultIndexSize == 64: 10 | - msg= '--with-64-bit-indices option requires a metis build with IDXTYPEWIDTH=64.\n' 11 | - else: 12 | - msg= 'IDXTYPEWIDTH=64 metis build appears to be specified for a default 32-bit-indices build of PETSc.\n' 13 | - raise RuntimeError('Metis specified is incompatible!\n'+msg+'Suggest using --download-metis for a compatible metis') 14 | + # if not self.checkCompile('#include "metis.h"', '#if (IDXTYPEWIDTH != '+ str(self.getDefaultIndexSize())+')\n#error incompatible IDXTYPEWIDTH\n#endif'): 15 | + # if self.defaultIndexSize == 64: 16 | + # msg= '--with-64-bit-indices option requires a metis build with IDXTYPEWIDTH=64.\n' 17 | + # else: 18 | + # msg= 'IDXTYPEWIDTH=64 metis build appears to be specified for a default 32-bit-indices build of PETSc.\n' 19 | + # raise RuntimeError('Metis specified is incompatible!\n'+msg+'Suggest using --download-metis for a compatible metis') 20 | 21 | self.compilers.CPPFLAGS = oldFlags 22 | return 23 | -------------------------------------------------------------------------------- /run_tests.sh: -------------------------------------------------------------------------------- 1 | if [ -z "$ASRUN" ]; then 2 | ASRUN=/home/aster/aster/bin/as_run 3 | fi 4 | 5 | TEST_DIR=/home/aster/shared/test 6 | 7 | mkdir -p $TEST_DIR 8 | cd $TEST_DIR 9 | $ASRUN --list --all --output=$TEST_DIR/testcases 10 | # $ASRUN --list --all --filter='"parallel" in testlist' --output=$TEST_DIR/testcases 11 | 12 | for testcase in `cat $TEST_DIR/testcases` 13 | do 14 | echo "Working on $testcase..." 15 | $ASRUN --test $testcase $TEST_DIR >> $TEST_DIR/screen 16 | done 17 | 18 | $ASRUN --diag --only_nook --astest_dir=$TEST_DIR > $TEST_DIR/diag 19 | -------------------------------------------------------------------------------- /salome_meca/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/tianyikillua/base:latest 2 | LABEL maintainer "Tianyi Li " 3 | 4 | # Get Ubuntu updates 5 | USER root 6 | RUN apt-get update && \ 7 | apt-get upgrade -y --with-new-pkgs -o Dpkg::Options::="--force-confold" && \ 8 | apt-get clean && \ 9 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 10 | 11 | # Download and install the latest salome_meca 12 | USER aster 13 | WORKDIR /home/aster 14 | RUN wget --no-check-certificate --quiet \ 15 | https://www.code-aster.org/FICHIERS/salome_meca-2019.0.1-2-LGPL.tgz && \ 16 | tar xf salome_meca-2019.0.1-2-LGPL.tgz && \ 17 | ./salome_meca-2019.0.1-2-LGPL.run && \ 18 | rm salome_meca-2019.0.1-2-LGPL.* 19 | 20 | # Add as_run into PATH 21 | RUN echo "" >> .bashrc && \ 22 | echo "source ~/salome_meca/V2019_univ/salome_prerequisites.sh" >> .bashrc && \ 23 | echo "cat ~/WELCOME" >> .bashrc && \ 24 | echo "echo" >> .bashrc 25 | 26 | # Add a welcome message and a script for testcases 27 | COPY --chown=aster:aster salome_meca/WELCOME /home/aster/WELCOME 28 | COPY --chown=aster:aster run_tests.sh /home/aster/run_tests.sh 29 | 30 | USER root 31 | -------------------------------------------------------------------------------- /salome_meca/WELCOME: -------------------------------------------------------------------------------- 1 | # Salome_Meca latest version 2 | 3 | Welcome to Salome_Meca! 4 | 5 | This image provides the official build of the latest 6 | release of Salome_Meca. 7 | 8 | To execute an "export" file, just run 9 | 10 | as_run foo.export 11 | --------------------------------------------------------------------------------