Compiling JOREK
- Check the code out from the git repository as explained here.
- Compile JOREK as explained at the end of this page.
Specialized guides:
- Compiling on macos
- Compiling MUMPS (+METIS)
- Compiling with long integers int64
- Compiling all dependencies without MKL
SCOTCH
Scotch is a software package for graph and mesh/hypergraph partitioning, graph clustering, and sparse matrix ordering.
- Download the source code here or use the version with
libesmumpsincluded - Currently version 5.1.12b is recommended; recently also version 6.0.4 worked well but is not yet suitable if several MPI tasks are required per toroidal harmonic (feature to be added with 6.1.x)
- Unpack with
tar -xvzf scotch_5.1.12b.tar.gz
- Create the configuration file
Makefile.incin thesrc/folder- Generic examples can be found in
src/Make.inc/ - Suitable example for use with JOREK (Scotch 5.1.12b)
- Generic examples can be found in
- Compile the library:
make clean
make -j 8 scotch
make -j 8 ptscotch
PaStiX (before version 6.x)
PaStiX is a high performance parallel solver for very large sparse linear systems based on direct methods. It provides also an adaptive blockwise iLU(k) factorization that can be used as a parallel preconditioner.
- Download the source code here
- Note that there is a bug in PaStiX revisions 3519 to 4030 leading to large memory consumption!
- Unpack with:
tar -xvjf pastix_5.2.3.tar.bz2
- Create the configuration file
config.inin thesrc/folder- Generic examples can be found in
src/config/ - Suitable example for use with JOREK (PaStiX revision 4492)
- Do not forget to uncomment the memory usage statistics, located under Options in
config.in
- Generic examples can be found in
- Compile the library:
make clean
make -j 8
make -j 8 install
- It is possible to validate the PaStiX installation after it has been compiled:
# simplest example
make examples
mpirun -np <Nprocs> ./example/bin/simple -rsa matrix/small.rsa -t <nthreads> -v 4
# Calling PaStiX with separated steps (as in Jorek)
mpirun -np <Nprocs> ./example/bin/step-by-step -rsa matrix/small.rsa -t <nthreads> -v 4
# Calling PaStiX with several communicators (as in Jorek)
mpirun -np <Nprocs> ./example/bin/multi-comm -rsa matrix/small.rsa -t <nthreads> -v 4
PaStiX 6
The new version of PaStiX (with new features such as block-low-rank compression).
- Download the source code here (release versions)
- Download latest develop version here (see Readme for git download instructions)
- Download the tar.gz of the version used for the benchmarks and BLR test from 2019/07
- Unless downloaded from git, unpack with:
tar -xvzf pastix-6.0.2.tar.gz
- Go to the PaStiX 6 base directory, create a
buildsubdirectory and build with CMake. Several options can be set, most of which will be set automatically but you might need to specify your ordering library (Scotch or Metis) and the compiler used to compile it, as well as the installation prefix (where PaStiX 6 should be installed). In this case, the command line argument is as follows (replacing...with the appropriate paths):
mkdir build
cd build
cmake .. -DSCOTCH_DIR=... -DCMAKE_C_COMPILER=... -DCMAKE_INSTALL_PREFIX=...
- Just like previous versions, PaStiX 6 can now be installed from the PaStiX home directory with
make clean
make -j 8
make -j 8 install
FFTW
JOREK also uses FFTW for fast Fourier transformations. This library is usually available on machines via module load fftw. See also here to include FFTW.
Compile JOREK
We use Make to compile JOREK, with dependency generation via util/makedepend. See Makefile for more information.
- Create the JOREK configuration file
trunk/Makefile.incfor your system, examples are available intrunk/Make.inc/. - Add the following lines to link to the libraries:
# SCOTCH Library: Automatically included via the pastix-conf script calls below
# PaStiX Library:
USE_PASTIX = 1
USE_PASTIX_MURGE = 1 # Different way for matrix assembly, the choice is up to you
PASTIX_HOME = <path-to-pastix>/install/
LIB_PASTIX = `$(PASTIX_HOME)/pastix-conf --libs`
LIB_PASTIX_MURGE = `$(PASTIX_HOME)/pastix-conf --libs_murge`
LIB_PASTIX_BLAS = `$(PASTIX_HOME)/pastix-conf --blas`
INC_PASTIX = `$(PASTIX_HOME)/pastix-conf --incs`
# FFTW Library: FFTW_HOME might be set by "module load fftw", otherwise do so manually
LIBFFTW = $(FFTW_HOME)/lib/libfftw3.a
- For PaStiX after revision 3945, additionally the following is required (see also preprocessor flags):
FFLAGS := $(FFLAGS) -DFUNNELED -DWORLDWAR2
-
In case of PaStiX 6.x, instead of the parameters shown above,
USE_PASTIX6=1,PASTIX6_HOME,LIB_PASTIX6,LIB_PASTIX6_BLAS, andINC_PASTIX6need to be set correctly. In that case,USE_PASTIXmust be 0. -
Set the hard-coded parameters correctly. For example:
./util/config.sh model=303 n_tor=3 n_period=8 n_plane=8 # set hard-coded parameters
./util/config.sh # check hard-coded parameters
- Compile the main program and/or diagnostics tools:
make # compile main program jorek_modelxxx
make jorek2vtk
make jorek2_postproc
...
- Parallel compilation is possible, e.g. with 8 threads:
make -j 8
Special Compile Options for Single Source Files
- It is now possible to specify special compile options (added to the normal
FFLAGS) for individual source files. An example for the filemodels/model333/element_matrix_fft.f90(to put inMakefile.inc):
.obj/element_matrix_fft.o: FFLAGS+=-O3
Remarks
- When switching the physics model or hard-coded parameters, you should always call a
make cleanbefore recompiling. When dependencies between files differ for different models (preprocessor directives), this is not sufficient and amake cleanallis required../util/config.shhas been adapted to do this automatically. - Compiler Optimization: (Preliminary -- will be updated)
- Tests in Garching on our local Linux Cluster and on our supercomputer Hydra showed that the best optimization options seem to be simply
-fast -DUSE_BLOCKwithout anything else like-O2 -xSSE4.2etc. Both systems are equipped with Intel Ivy Bridge processors very similar to Helios.
- Tests in Garching on our local Linux Cluster and on our supercomputer Hydra showed that the best optimization options seem to be simply