Neko
0.8.1
A portable framework for high-order spectral element flow simulations
|
Neko can be installed in various ways, either building directly from source, manually compiling all dependencies and Neko or via Spack. Pre-built Docker images are also provided for each release of Neko.
To build Neko, you will need a Fortran compiler supporting the Fortran-08 standard, autotools, pkg-config, a working MPI installation supporting the Fortran 2008 bindings (mpi_f08
), BLAS/LAPACK and JSON-Fortran. Optional dependencies are PFunit, gslib and ParMETIS.
Follow the steps below to install the less common dependencies (e.g. JSON-Fortran).
Download and compile, at least version 0.7.1 of JSON Fortran from the main repository.
USE_GNU_INSTALL_CONVENTION
. Now ad the installation path to PKG_CONFIG_PATH
(and if needed LD_LIBRARY_PATH
).
lib
should be substituted with lib64
If you have a Nek5000 installation, use:
If not, you should download and compile gslib
. In a folder outside of Neko:
Check that libgs.a
has been created:
Now add the path to gslib to an environment variable GSLIB
Later, when configuring Neko, add the following option to enable gslib
Make sure you see the following message during the configuration:
The following steps is an example on how to build and install ParMETIS
metis.h
, check if it is found in /parmetis_install_path/include
. If this is not the case, repeat the same make config prefix=/parmetis_install_path
and make install
commands from the metis
subfolder.To build the PFunit testing framework, please refers to the Testing page
Neko uses autotools as its build system. The first step is to run the configure
script, located in the top directory.
In the above command, [options]
refers to either optional features or packages.
Features are enabled and disabled by passing either --enable-FEATURE[=arg]
or --disable-FEATURE
to configure
. A list of currently supported features are given in the table below.
Name | Description |
---|---|
--enable-real=Xp | Specify working precision of REAL types:sp – REAL(kind=4) dp – REAL(kind=8) (default)qp – REAL(kind=16) |
--enable-contrib | Compile various tools |
--enable-device-mpi | Enable device aware MPI |
Optional packages are controlled by passing either --with-PACKAGE[=ARG]
or --without-PACKAGE
to configure
. A list of all supported optional packages are given in the table below.
Name | Description |
---|---|
--with-blas=<lib> | Use BLAS library <lib> |
--with-lapack=<lib> | Use LAPACK library <lib> |
--with-metis=DIR | Directory for metis |
--with-metis-libdir=LIBDIR | Directory for metis library (if different) |
--with-parmetis=DIR | Compile with support for parmetis library |
--with-parmetis-libdir=LIBDIR | Directory for parmetis library (if different) |
--with-adios2=DIR | Compile with support for ADIOS2 |
--with-gslib=DIR | Compile with support for gslib |
--with-libxsmm | Compile with support for libxsmm |
--with-hip=DIR | Compile with HIP backend |
--with-cuda=DIR | Compile with CUDA backend |
--with-opencl=DIR | Compile with OpenCL backend |
--with-nvtx=DIR | Compile with support for NVTX |
--with-roctx=DIR | Compile with support for ROCTX |
--with-pfunit=DIR | Directory for pFUnit (see Testing) |
Once configured, to compile and install Neko issue make
followed by make install
For a standard CPU or SX-Aurora build of Neko, simply run the configure
script as given above, using appropriate compilers and compiler flags, e.g:
To compile Neko for NVIDIA GPUs
nvidia-cuda-toolkit
)--with-cuda=/path/to/cuda
argument to configure
, e.g.: CUDA_CFLAGS
, CUDA_ARCH
and NVCC
respectively, e.g: make && make install
To compile Neko for AMD GPUs
--with-hip=/path/to/hip
argument to configure
, e.g.: Neko is distributed as part of the package manager Spack as neko
. The package can install releases of Neko as well as the latest commit to the develop
branch, for most of Neko's supported backends. For a list of all supported variants, see spack info neko
To install a CPU build of Neko using Spack, follow the steps below:
For a GPU build using e.g. CUDA, change the last line to :
For a more detailed guide on getting started with Spack, please refer to the offical documentation: https://spack.readthedocs.io/en/latest/getting_started.html
Perhaps the easiest way to quickly give Neko a try is using a Docker container. Below we assume that you have Docker up and running on your system. The released container images can be found here: https://gitlab.com/ExtremeFLOW/neko/container_registry. Select the image with the release you want to use. Here we will use version 0.6.1, but in most cases you will want to simply pick up the latest version available. To the left of every image there is a button with three dots. Click on it to get the full path to the image in the correct format for Docker. For our release this is registry.gitlab.com/extremeflow/neko/release-0.6.1-ubunut20.04-x86_64-gcc-12.3
. To get the image on you machine use docker pull
:
Now, let's verify that the image has been added using docker image ls
. There should be a row of the following kind in the output.
The third column contains the ID of the image. We will need that to run Neko in the container. The typical scenario is that you want to run a case stored on your computer inside the container. For that we will need to mount the directory with the case to the container file system. This is done using the the -v
flag to the docker run
command. For example, we will consider that the case resides in /home/user/case
and we will mount it to /case
inside the container. The full command to execute is the following:
The --rm
flag tells Docker to remove the container after the run is finished. Note that we use the image ID from before as the third argument. As the run command we simply use bash
, followed by a sequence of commands to actually execute the case. The commands are chained using &&
, so one can easily add additional steps, for example, running makeneko
.