libNEGF is a general library for Non Equilibrium Green’s Functions.
With libNEGF you can calculate Equilibrium and Non Equilibrium Green’s Function in open systems and related quantities, within an efficient sparse iterative scheme.
libNEGF is available under LGPL license.
Have a look at the contributor’s guide if you want to help developing libNEGF.
For an example of application, see the use of libNEGF in DFTB+.
If you used libNEGF, please cite the following publication:
A. Pecchia, L. Salvucci, G. Penazzi and A. Di Carlo: "
Non-equilibrium Green's functions in density functional tight binding: method and applications". New Journal of Physics 10, 065022 (2008). DOI: 10.1088/1367-2630/10/6/065022.
libNEGF requires
-
CMake,
-
a C99 compiler,
-
a Fortran 2018 compiler,
-
BLAS,
-
LAPACK, and
-
MPI 3.
Optionally CUDA can be used.
Note that MPICH version 4 may cause build problems due to the mpifx dependency, see mpifx#48. Moreover it is recommended to use recent gfortran releases: gfortran 11 and 12 are known to work, gfortran 10.2.1 (found in Debian 11) and GCC 8.3.0 (found in Debian 10) are known not to work.
Running the tests additionally requires git-lfs for downloading test inputs.
The extension of test input files is .dat.
On some HPC systems, front-end nodes do not feature GPUs (e.g., on LUMI) or the front-end nodes may have an instruction set architecture different from compute nodes (e.g., on Fugaku with its Intel front-end and Arm64FX compute nodes). On these systems, it is best to submit all tests to the batch scheduler.
This can be achieved with the following steps. First, determine the account name and a queue (or partition) for job submission. Next, select a time limit. Tests that do not possess the label long run quickly even on personal computers. Therefore, we suggest a time limit of at most five minutes (this is per task). Finally, determine the number of MPI tasks within the job. Our recommendation is to run on at most one node with one job per NUMA domain.
|
Caution
|
Avoid large numbers of MPI tasks (e.g., by launching one task per virtual CPU core). The tests may not scale very well. |
With the values above in mind, enable LIBNEGF_TEST_WITH_MPIEXEC, set
MPIEXEC_EXECUTABLE to the absolute path to the batch scheduler executable, and
have MPIEXEC_PREFLAGS contain all the batch scheduler arguments as a CMake
list; in a CMake list, list items are separated by a semicolon. Here is an
example for Slurm:
cmake \
-DLIBNEGF_TEST_WITH_MPIEXEC=ON \
-DMPIEXEC_EXECUTABLE="$(which srun)" \
-DMPIEXEC_NUMPROC_FLAG='--ntasks' \
-DMPIEXEC_MAX_NUMPROCS=4 \
-DMPIEXEC_PREFLAGS='--account=mat4energy;--partition=develbooster;--nodes=1;--gpus-per-task=1;--time=1' \
...For faster execution, the tests can be run in an existing job allocation, e.g.,
by calling salloc (for Slurm) or by using a reservation. Within the allocation, just call ctest.
Note the following:
-
A time limit of one minutes is sufficient for tests without
longtag on JUWELS Booster and LUMI. -
The time limit of the job and the time limit of test CMake test submitting the job are two different things.
-
Redirecting the output to files (e.g., with Slurm with
--output=stdout.txt) breaks the mpifx tests because these tests examine the standard output instead of the exit status.
To create libNEGF input, obtain Slater-Koster parameterizations[1] for the molecule at hand (e.g., from the DFTB+ Parameters page) and describe the geometric properties of the molecule and its contacts. The description file format as well as visualization of input and output are described in details in the DTFB+ recipes document Setup Geometry utility.
Simplified LCAO Method for the Periodic Potential Problem". 1954. Physical Review 94 (1498). DOI: 10.1103/PhysRev.94.1498.