Skip to content

Commit

Permalink
Merge branch 'release-2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
alazzaro committed Nov 15, 2019
2 parents 78aa0a2 + 5f84eba commit e4db53e
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 15 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ if (USE_MPI)
get_property(REQUIRED_MPI_COMPONENTS GLOBAL PROPERTY ENABLED_LANGUAGES)
list(REMOVE_ITEM REQUIRED_MPI_COMPONENTS CUDA) # CUDA does not have a MPI component
find_package(MPI COMPONENTS ${REQUIRED_MPI_COMPONENTS} REQUIRED)

if (NOT MPI_Fortran_HAVE_F90_MODULE)
message(FATAL_ERROR "\
The listed MPI implementation does not provide the required mpi.mod interface. \
When using the GNU compiler in combination with Intel MPI, please use the \
Intel MPI compiler wrappers. Check the INSTALL.md for more information.")
endif ()
endif ()

if (USE_SMM MATCHES "blas")
Expand Down
165 changes: 165 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# DBCSR CMake Build Recipes

Following are recipes for different combinations of compilers, platforms and libraries.
Unless otherwise noted, the examples assume that after fetching/unpacking DBCSR you created
a directory `build/` inside the DBCSR directory and switched into it using `cd build/`.

The listed examples can usually be combined with other build options like *libxsmm* or *CUDA*
even if the examples are not explicitly given.

The instructions used for building in the Continuous Integration can be found in
the `.ci/` folder or in the `.travis.yml`.


## GNU


### GNU compiler, system MPI and system-provided OpenBLAS

Most Linux systems provide the GNU compiler, a system MPI (OpenMPI or MPICH) using the
the GNU compiler as a backend and OpenBLAS for BLAS/LAPACK:

cmake ..


### GNU compiler, system MPI and Intel MKL

To use the Intel MKL together with the GNU compiler and possibly a system-MPI,
assuming that MKL is installed in `/sw/intel/mkl`.

Verified with MKL provided as part of the Intel Parallel Studio XE 2019.5 installed in `/sw/intel`
with an OS-provided GCC 7.4.1 on Linux openSUSE Leap 15.1, using CMake 3.10.2.

1. Make sure the MKL environment is properly loaded:

source /sw/intel/mkl/bin/mklvars.sh intel64

2. Make sure CMake picks the Intel MKL over any system-provided BLAS library:

cmake -DBLA_VENDOR=Intel10_64lp_seq ..


## Intel

Instructions for using Intel compiler or libraries for different parts on non-Cray systems.
For Cray systems, please check further below.

*Note*: in Intel Parallel Studio 2019 there is a potential issue that `mpirun` fails with
the error `OFI addrinfo() failed` on local (non-cluster) installations.
This can be worked around by setting `export I_MPI_FABRICS=shm`.

### Intel MPI, GNU Compiler and system-provided OpenBLAS

Verified with Intel Parallel Studio XE 2019.5 installed in `/sw/intel`
with an OS-provided GCC 7.4.1 on Linux openSUSE Leap 15.1, using CMake 3.10.2.

1. Make sure that the Intel environment is properly loaded:

source /sw/intel/bin/compilervars.sh intel64

2. Use the Intel-provided MPI compiler wrappers for the GNU toolchain,
to override CMake's auto-detection which may pick up the system MPI:

CC=mpicc FC=mpifc CXX=mpicxx cmake ..


### Intel MPI, GNU Compiler and Intel MKL

Verified with Intel Parallel Studio XE 2019.5 installed in `/sw/intel`
with an OS-provided GCC 7.4.1 on Linux openSUSE Leap 15.1, using CMake 3.10.2.

1. Make sure that the Intel environment is properly loaded:

source /sw/intel/bin/compilervars.sh intel64

2. Use the Intel-provided MPI compiler wrappers for the GNU toolchain:

CC=mpicc FC=mpifc CXX=mpicxx cmake -DBLA_VENDOR=Intel10_64lp_seq ..


### Intel MPI, Intel Compiler and Intel MKL

Verified with Intel Parallel Studio XE 2019.5 installed in `/sw/intel`
on Linux openSUSE Leap 15.1, using CMake 3.10.2.

1. Make sure that the Intel environment is properly loaded:

source /sw/intel/bin/compilervars.sh intel64

2. Use the Intel-provided MPI compiler wrappers:

CC=mpiicc FC=mpiifort CXX=mpiicxx cmake -DBLA_VENDOR=Intel10_64lp_seq ..


## Cray

Some machines require additional environments to be loaded to either provide
the modules specified below or to be able to properly build with the loaded modules.

Please contact your cluster/datacenter administrator for more information.

Example for the CSCS' Piz Daint:

module load daint-mc # to build for the non-GPU partition
module load daint-gpu # to build for the GPU partition

*Note*: the `libsci-cray` has different variants for MPI or OpenMP.
When disabling either MPI or OpenMP support in DBCSR you might want to adjust the
selected BLAS/LAPACK library accordingly (e.g. drop the `_mpi`, or `_mp`).


### CCE and libsci-cray

Verified on CSCS' Piz Daint with CCE 9.0.2 and cray-libsci 19.06.1,
using CMake 3.14.5.

1. Make sure that the `PrgEnv-cray` module is loaded:

module load PrgEnv-cray

2. While the MPI wrapper/compiler will be detected automatically,
must the BLAS/LAPACK libraries be specified manually:

cmake \
-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment \
-DBLAS_LIBRARIES="-lsci_cray_mpi_mp -lhugetlbfs" \
-DLAPACK_LIBRARIES="-lsci_cray_mpi_mp" \
..


### Intel Compiler and libsci-cray

Verified on CSCS' Piz Daint with Intel 19.01 and cray-libsci 19.06.1,
using CMake 3.14.5.

1. Make sure that the `PrgEnv-intel` module is loaded:

module load PrgEnv-intel

2. While the MPI wrapper/compiler will be detected automatically,
must the BLAS/LAPACK libraries be specified manually:

cmake \
-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment \
-DBLAS_LIBRARIES="-lsci_intel_mpi_mp -lhugetlbfs" \
-DLAPACK_LIBRARIES="-lsci_intel_mpi_mp" \
..


### GNU Compiler and libsci-cray

Verified on CSCS' Piz Daint with GNU 8.3.0 and cray-libsci 19.06.1,
using CMake 3.14.5.

1. Make sure that the `PrgEnv-gnu` module is loaded:

module load PrgEnv-gnu

2. While the MPI wrapper/compiler will be detected automatically,
must the BLAS/LAPACK libraries be specified manually:

cmake \
-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment \
-DBLAS_LIBRARIES="-lsci_gnu_mpi_mp -lhugetlbfs" \
-DLAPACK_LIBRARIES="-lsci_gnu_mpi_mp" \
..
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ The configuration flags are (default first):
-DTEST_OMP_THREADS=<2,N>
-DCMAKE_BUILD_TYPE=<Release|Debug|Coverage>


Building on Cray requires an additional flag to make sure CMake is able to properly
detect the compiler behind the compiler wrappers:

-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment
For build recipes on different platforms, make sure to also read the [INSTALL.md](INSTALL.md).

## Using DBCSR in a CMake project

Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MAJOR = 2
MINOR = 0
PATCH = 0
PATCH = 1
# A specific DATE (YYYY-MM-DD) fixes an official release, otherwise
# it is considered Development version.
DATE = 2019-11-11
DATE = 2019-11-15
2 changes: 1 addition & 1 deletion src/acc/libsmm_acc/libcusmm/PACKAGE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"description": "Cuda accelerated Small Matrix Multiplications",
"archive": "libdbcsr",
"requires": ["kernels", "../include",]
"requires": ["kernels", "../include", "../../include"]
}
9 changes: 2 additions & 7 deletions src/mpi/dbcsr_mpiwrap.F
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ MODULE dbcsr_mpiwrap
#define __MPI_VERSION 3
#endif

#if defined(__parallel) && ! defined(__HAS_NO_MPI_MOD)
USE mpi ! compiler *errors* mean mpi installation and fortran compiler mismatch: see INSTALL (-D__HAS_NO_MPI_MOD)
#if defined(__parallel)
USE mpi
! subroutines: unfortunately, mpi implementations do not provide interfaces for all subroutines (problems with types and ranks explosion),
! we do not quite know what is in the module, so we can not include any....
! to nevertheless get checking for what is included, we use the mpi module without use clause, getting all there is
Expand Down Expand Up @@ -51,16 +51,11 @@ MODULE dbcsr_mpiwrap

! parameters that might be needed
#if defined(__parallel)
#if defined(__HAS_NO_MPI_MOD)
INCLUDE "mpif.h"
#endif
INTEGER, PARAMETER :: MP_STD_REAL = MPI_DOUBLE_PRECISION
INTEGER, PARAMETER :: MP_STD_COMPLEX = MPI_DOUBLE_COMPLEX
INTEGER, PARAMETER :: MP_STD_HALF_REAL = MPI_REAL
INTEGER, PARAMETER :: MP_STD_HALF_COMPLEX = MPI_COMPLEX
#endif

#ifdef __parallel
LOGICAL, PARAMETER :: dbcsr_is_parallel = .TRUE.
INTEGER, PARAMETER, PUBLIC :: mp_any_tag = MPI_ANY_TAG
INTEGER, PARAMETER, PUBLIC :: mp_any_source = MPI_ANY_SOURCE
Expand Down

0 comments on commit e4db53e

Please sign in to comment.