dftbplus / mpifx

Modern Fortran wrappers around MPI routines
BSD 2-Clause "Simplified" License
34 stars 13 forks source link
fortran mpi wrappers

MpiFx - Modern Fortran Interface for MPI


The open source library MpiFx <https://github.com/dftbplus/mpifx>_ provides modern Fortran (Fortran 2008) wrappers around routines of the MPI library to make their use as simple as possible. Currently several data distribution routines are covered.

The documentation is included inside the repository, but is also available at dftbplus.github.io <https://dftbplus.github.io/>_.

Installation

The preferred way of obtaining MpiFx is to install it via the Conda package management framework using Miniconda <https://docs.conda.io/en/latest/miniconda.html> or Anaconda <https://www.anaconda.com/products/individual>. Make sure to add/enable the conda-forge channel in order to be able to access MpiFx, and ensure that the conda-forge channel is the first repository to be searched for packages.

We provide both, OpenMPI and MPICH based build variants, choose the one suiting your needs. For example, issue ::

conda install 'mpifx==mpimpich'

or ::

conda install 'mpifx==mpiopenmpi'

to get the last stable release of MpiFx for the respective MPI framework.

Building from source

Prerequisites

Building and installing the library

The library can be built and installed with the usual CMake-workflow::

FC=gfortran cmake -B _build -DCMAKE_INSTALL_PREFIX=$HOME/opt/mpifx cmake --build _build cmake --install _build

You can influence the configuration via CMake-variables, which are listed in config.cmake <config.cmake>_. You can either modify the values directly there or pass them as command line options at the configuration phase, e.g.::

FC=ifort cmake -B _build -DBUILD_TESTING=NO .

Testing

A few tests / usage examples can be found in the test/ subdirectory, a sub-set of which can be checked with ctest. The compiled test programs will be in the test/ subfolder of your build directory.

To disable building tests, include the cmake option -DBUILD_TESTING=OFF

Using the library

CMake build

Pkg-config build

License

MpiFx is licensed under the 2-Clause BSD License <LICENSE>_.