Explore Abinit and around
- ABINIT Coding
- Doc for new developers
The information provided in this page is valid for Abinit 8.5 and future versions only.
Linear algebra is the most critical dependency to consider, since Abinit could not be built nor run without it. It is also the most complex one, due to:
It logically corresponds to the most complex core block of the build system. On one side, there are vendors, who develop specific components for specific architectures. On another side, there are architectures, which include various kinds of optimizations and offer various degrees of parallelism. And on a third side, there are components, defined by the kind of mathematical operations they provide and the architectures they aim at.
We have designed our implementation to cover the highest possible number of cases, while preserving a relative simplicity in the configuration of their parameters. For this, we have grouped the 3 above concepts under flavors that users select depending on their situations and preferences.
This document is best understood when consulted peacefully. Please take your time to read it and feel free to come back as many times as you wish.
For sake of clarity, we provide here 3 different perspectives on the linear algebra flavors supported by Abinit and their relationships with the other concepts. The build system lets you configure linear algebra from each of these 3 perspectives, mainly by setting its with_linalg_flavor option in different ways (explained in detail below). You can choose between:
The following table lists the available flavors supported by Abinit and their relationships with the other relevant concepts:
|essl||IBM||ESSL||serial, openmp, mpi||blas, lapack, scalapack|
|mkl||Intel||MKL||serial, openmp, mpi||blas, lapack, scalapack|
|netlib||Netlib||Netlib Repository||serial, mpi||blas, lapack, lapacke, scalapack|
Please refer to the instructions of each vendor listed above by clicking on the corresponding link to obtain information on how to install their linear algebra implementation.
By default, the build system assumes that you want the fastest possible linear algebra operations. When no linear algebra option is specified, it thus looks for each component as soon as its prerequisites are met. The only required components are BLAS and LAPACK, since Abinit relies on them in each and every situation. Unless forced by the user, the other components are enabled only if their prerequisites are met, their detection succeeds, and are proved working.
In the absence of any option, the build system will use an internal heuristic to look for linear algebra libraries and enable/disable components depending on the following criteria:
In all cases, the build system will try to mitigate side-effects on other components, e.g. FFT, but there is no guarantee that it will succeed by itself. This selection and detection process is known to work in the most common cases. If you have a customized linear algebra configuration, you will likely want to use some options to direct the build system to the right libraries and give it instructions to minimize side-effects.
To deal more easily with the various linear algebra implementations that can be used concurrently on the same computer, Abinit provides the with_linalg_flavor option. It will tune the detection tests made by the build system so that the probability of finding the correct libraries and setting-up the environment is maximized.
Please note that, when using with_linalg_flavor, the LD_LIBRARY_PATH and PATH environment variables must be properly set for the detection to succeed, in particular if you do not specify any other linear algebra option.
You can tune the detection mechanism through the with_linalg_flavor option in 3 ways:
Please note that you can only use one of these 3 methods at a time. Mixes are explicitly forbidden. Omitting an architectural item or a linear algebra component with the 2 latter methods will be equivalent to disabling this element.
The other options provide hints to the build system and determine which kinds of tests will be performed:
will cause the build system to look for OpenBLAS for the blas component and use Netlib for the other ones, i.e. lapack for the serial case and scalapack if MPI is enabled in the current build. Unspecified components will be detected using the default behavior, e.g. the build system will look for all available implementations of elpa if MPI is enabled but do nothing if MPI is disabled.
will cause the build system to look for Atlas for blas, Netlib for lapack and scalapack, and MAGMA 1.5 for magma. However, it will never look for elpa, since it has not been explicitly stated, and will stop with an error if one of the specified elements is not present or not working. When using this method, you must specify the serial block. If one of the blas or lapack components is omitted, then netlib is assumed.
The following table links the serial and multicore architectures supported by Abinit with the other relevant concepts:
|serial||acml, atlas, essl, mkl, netlib, openblas||blas, lapack|
|mpi||elpa2014, elpa2015, essl, mkl, netlib||elpa, scalapack|
will cause the build system to look for the blas, lapack and elpa components, but not for scalapack, even if MPI is enabled. It will also fail if any component is missing or not working. When using this method, you must specify the blas and lapack components.
The following table summarizes the linear algebra components supported by Abinit and their relationships with the other relevant concepts:
|blas||Mandatory||acml, asl, essl, atlas, mkl, netlib, openblas||Required in any case|
|lapack||Mandatory||acml, asl, essl, mkl, netlib||Requires BLAS|
|scalapack||Optional||mkl, netlib||Requires MPI and LAPACK|
|elpa||Optional||elpa2014, elpa2015||Requires MPI and LAPACK|
|plasma||Optional||plasma1||Requires OpenMP (caveats)|
|magma||Optional||magma10, magma15||Requires MPI and GPU|