Installation of Code Saturne

Code_Saturne will be installed as a module on VILJE. However it is useful to experience on compiling the software at a local computer. Code_saturne can be compiled with different options/parameters as linear algebra libraries, partitioning methods, mesh importing formats, MPI/OpenMP by using several different external libraries. This document helps to develop and debug the code after a successful installation. The user may try these options in a local computer and prepare his/her case before uploading the supercomputer with a batch script.

Windows

Unfortunately there is no suitable Code_Saturne package for installation to Windows operating system. However for the ones who have no access a Linux machines can use virtual machines or bootable USB sticks for Linux. The methodology is similar to OpenFOAM installation. More information can be found here:

https://hpc.it.ntnu.no/ntnu-hpc-group/vilje/user-guide/software/openfoam/openfoam-installation/#OpenFOAM-Installation-Windows

Linux

In this page, practical information will be documented for installation on Linux. Users can download the source code and third part libraries from the links and follow the instructions. The detailed installation guide can be found on the official website of EFD:

http://code-saturne.org/cms/sites/default/files/install-3.0.pdf

Downloading necessary files

The instructions at this page are based on the version 3.0.1 and the source files can be downloaded from here http://code-saturne.org/cms/download/3.0 , for all other versions: http://code-saturne.org/releases/

Several optional libraries can be linked with the code for a more complete experience of Code_Saturne. These are:

Graphical Interface(GUI):

This option is not necessary for VILJE. It should be installed for local computers to use GUI.

Mesh format for pre- and post-processing

  • CGNS, is library and generic file format for CFD data, It is useful for importing mesh files from ANSYS. The binary files for version ( can be downloaded from http://cgns.sourceforge.net/ )
  • MED is library and file format for the tool SALOME which is an open-source software that provides a generic platform for Pre- and Post-Processing for numerical simulations. The binary files for version, can be downloaded from here http://www.salome-platform.org/
  • HDF5 is a data model, library, and file format for storing and managing data. It supports an unlimited variety of data types, and is designed for flexible and efficient I/O and for high volume and complex data. It can be downloaded from here http://www.hdfgroup.org/HDF5/

The only compulsory pre-requisites needed are compilers for C/C++/Fortran (like GNU or Intel compilers) and a Python interpreter.

Parallel computing

  • MPI, is necessary for parallel computations. OpenMPI, MPICH2, Intel MPI or MPT (from SGI) must be installed in the system. VILJE has MPT installed. For installation at a local computer, OpenMPI is recommended. The library should be compiled with same compiler which will be used for building Code_Saturne in order to avoid possible compilation errors.

The last versions of these libraries can be downloaded from their official website and built the binaries through the system compiler (it should be the same compiler that is used for building Code_Saturne). However the binary versions which is built for suitable Linux version can be downloaded from SALOME’s website (it requires a free registration):

http://www.salome-platform.org/downloads/current-version

After downloading and installing the SALOME, the binaries of libxml2, CGNS, MED, HDF5, METIS and Scotch will be created. Those libraries will be used to built the Code_Saturne which will be described later in more detail. SALOME can also be used for pre/post process tool for the code. A tutorial for SALOME can be found at:

http://www.code-saturne.org/cms/sites/default/files/file_attach/Tutorial/version-3.0/Tutorial_CFD_Study.pdf

Compiling

The libraries and source file should be copied in a folder that is accessible as a user and be extracted from the source tar file. The following script is prepared as an example to configure the Code_Saturne. At this script the compiler is GNU compiler and can be modified based on the system’s compiler. For example, for Intel compiler as in VILJE, the configuration options should be CC=icc CXX=icpc FC=ifort .It is recommended to build the version in a folder with a name representing the configuration options. Several builts with different options help to try several type of configurations.

SOURCE=/home/user/code_saturne/code_saturne-3.0.1
TARGET=/home/user/code_saturne
${SOURCE}/configure --prefix=${TARGET}/target_scotch_cgns_med_hdf5 \
--with-hdf5=/home/user/code_saturne/salome_7.2.0/hdf5-1.8.10 \
--with-med-include=/home/user/code_saturne/salome_7.2.0/med-3.0.6/include\
--with-med-lib=/home/user/code_saturne/salome_7.2.0/med-3.0.6/lib\
--with-scotch=/home/user/code_saturne/salome_7.2.0/scotch-5.1.11\
--with-cgns=/home/user/code_saturne/salome_7.2.0/cgnslib-3.1.3\
--with-mpi=/home/user/openmpi-1.6.3/build\
--with-libxml2=/home/user/code_saturne/salome_7.2.0/libxml2-2.9.0\
CC=gcc CXX=g++ FC=gfortran 2>&1 | tee log_config.txt

Another example for configuration script is prepared for VILJE. In this script Intel compiler and MPI is loaded as a module. The GUI is disabled without using ‘libxml2’ option. ‘--enable-mpi-io’ and ‘--enable-openmp’ options activate MPI-IO and OpenMP. --with-blas option activates the BLAS (Basic Linear Algebra Subprograms) libraries which a set of low-level kernel subroutines that perform common linear algebra operations. Intel MKL library is installed at VILJE. Building Code_Saturne with this option may affect the performance of the code. Partition method is selected as Scotch by --with-scotch option.

module load
intelcomp/13.0.1 mpt/2.06
SOURCE=/home/ntnu/user/code_saturne/intel_mpt/ptscotch/mk_hd_cg_io_omp/code_saturne-3.0.1
TARGET=/home/ntnu/user/code_saturne
${SOURCE}/configure --prefix=${TARGET}/intel_mpt/ptscotch/mk_hd_cg_io_omp/target_v3.0.1 \
--with-mpi \
--with-blas=/sw/sdev/Modules/intelcomp/13.0.1/mkl\
--with-zlib \
--with-med-include=/home/ntnu/user/med-3.0.6/include\
--with-med-lib=/home/ntnu/user/med-3.0.6/lib\
--with-hdf5=/home/ntnu/user/hdf5-1.8.10\
--with-cgns-include=/home/ntnu/user/cgnslib-3.1.3/include\
--with-cgns-lib=/home/ntnu/user/cgnslib-3.1.3/lib\
--disable-gui \
--enable-mpi-io \
--enable-long-gnum \
--enable-openmp \
--with-scotch=/home/ntnu/user/scotch/6.0.0\
CC=icc CXX=icpc FC=ifort 2>&1 | tee log_config.log

After running the script, the logs can be tracked the configuration output at the log_config.txt and config.log files which is the default output. After configuring the options, for to build the code, run the two scripts below respectively and follow the log files (log_make, log_makeInstall)

module load mpt/2.06 
module load
intelcomp/13.0.1
make CC=icc CXX=icpc FC=ifort 2>&1 | tee log_make

module load mpt/2.06 
module load
intelcomp/13.0.1
make install CC=icc CXX=icpc FC=ifort 2>&1 | tee log_makeInstall

After a successful compilation, the environment setting should be set in .bashrc file as follows:

 PATH=${PATH}:/home/ntnu/user/code_saturne/ptscotch/mk_hd_cg_io_omp/target_v3.0.1/bin/:$PATH

where the path is pointing the binary file of the Code_Saturne based on the target at configuration options. Now ‘code_saturne is ready as a command with following options

help
autovnv
compile
config
create
gui
info
run
salome
Scroll to Top