...
1. Retrieve the source and unpack it. Here we clone the whole repository:
...
For the student cluster competition, we have tagged (scc20) a particular version to be used, which can be directly download from https://
...
...
2. Create build directory
...
Code Block |
---|
SET(CMAKE_INSTALL_PREFIX "$ENV{PWD}/../elmer-install" CACHE PATH "") SET(CMAKE_C_COMPILER "gcc" CACHE STRING "") SET(CMAKE_CXX_COMPILER "g++" CACHE STRING "") SET(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "") SET(WITH_ElmerIce TRUE CACHE BOOL "") SET(WITH_MPI TRUE CACHE BOOL "") SET(WITH_OpenMP TRUE CACHE BOOL "") SET(WITH_LUA TRUE CACHE BOOL "") |
Here you can choose the installation directory for Elmer as well by modifying variable the CMAKE_INSTALL_PREFIX.
...
Code Block |
---|
SET(CMAKE_INSTALL_PREFIX "../elmer-install" CACHE PATH "")
SET(CMAKE_C_COMPILER "icc" CACHE STRING "")
SET(CMAKE_CXX_COMPILER "icpc" CACHE STRING "")
SET(CMAKE_Fortran_COMPILER "ifort" CACHE STRING "")
SET(WITH_ElmerIce TRUE CACHE BOOL "")
SET(WITH_MPI TRUE CACHE BOOL "")
SET(WITH_OpenMP TRUE CACHE BOOL "")
SET(WITH_LUA TRUE CACHE BOOL "") |
4. Load the relevant modules e.g.
...
Code Block |
---|
$ cd elmer-build --- For elmer use $ cmake -C ../elmer-opts.cmake ../elmerfem --- For elmer/ice, add the bool flag $ cmake -C ../elmer-opts.cmake ../elmerfem -DWITH_ElmerIce:BOOL=TRUE --- Add MPI support $ cmake -C ../elmer-opts.cmake ../elmerfem -DWITH_ElmerIce:BOOL=TRUE -DWITH_MPI:BOOL=TRUE ... -- ------------------------------------------------ -- Package filename: elmerfem-8.4-9d3f59b-20190807_Linux-x86_64 -- Patch version: 8.4-9d3f59b -- Configuring done -- Generating done -- Build files have been written to: ..... /elmer-build --- To explicitly include LUA (with -DWITH_LUA:BOOL=TRUE) in compilation, in case the following error is encountered: MAIN: Reading Model: Stokes_steady_vec_lua.sif LoadInputFile: Scanning input file: Stokes_steady_vec_lua.sif ERROR:: ReadAndTrim: LUA not included, cannot continue STOP 1 --- To explicitly set installation directory -DCMAKE_INSTALL_PREFIX=../install --- Optional: To try different libraries -DLAPACK_LIBRARIES="-L/usr/lib/x86_64-linux-gnu/lapack -llapack " |
The cmake tool will now inform if any libraries are missing. The build configuration can be further edited using e.g. ccmake tool or cmake-gui application.
...
Code Block |
---|
$ cat ELMERSOLVER_STARTINFO LID3D.sif |
Alternatively, one can also just launch ElmerSolver with the SIF as an argument (works also in parallel) and does not need to fill in ELMERSOLVER_STARTINFO
ElmerSolver LID3D.sif
4. Try to run the ElmerSolver serialy at first (no MPI), look for the SOLVER TOTAL TIME(CPU,REAL), in my case ~370s using one CPU core.
...
Code Block |
---|
$ ElmerGrid 2 2 LID3D_extrude_100k/ -metiskway 129128 ... |
Allocate 4 nodes and run the mpi job.
Code Block |
---|
$ salloc -N 4 -p thor
...
$ mpirun -np 128 ElmerSolver
...
VtuOutputSolver: Writing elemental fields
AscBinWriteFree: Terminating buffered ascii/binary writing
VtuOutputSolver: All done for now
ResultOutputSolver: -------------------------------------
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_post]
ReloadInputFile: Realoading input file
LoadInputFile: Loading input file:
ElmerSolver: *** Elmer Solver: ALL DONE ***
ElmerSolver: The end
SOLVER TOTAL TIME(CPU,REAL): 34.49 45.64
ELMER SOLVER FINISHED AT: 2019/08/08 16:01:36 |
...