Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 "

...

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

...