View on GitHub

COSMA

Distributed Communication-Optimal Matrix-Matrix Multiplication Algorithm

Building COSMA

To build COSMA, do the following steps:

# clone the repository
git clone --recursive https://github.com/eth-cscs/COSMA.git
cd COSMA

# create a build directory within COSMA
mkdir build
cd build

# set up the compiler, e.g. with:
export CC=`which cc`
export CXX=`which CC`

# Choose which BLAS and SCALAPACK backends to use (e.g. MKL)
cmake -DCOSMA_BLAS=MKL -DCOSMA_SCALAPACK=MKL ..

# compile
make -j 8

!! Note the –recursive flag !!

Other important options that can be passed to cmake are the following:

Building COSMA on Multi-GPU Systems

COSMA can take advantage of fast GPU-to-GPU interconnects like NV-Links, through the use of the following:

Building COSMA on Cray Systems

There are already prepared scripts for loading the necessary dependencies for COSMA on Cray-Systems:

After the right modules are loaded, the instructions from the beginning of this file can be followed.

Installing COSMA

To install do make install.

!! Note: To set custom installation directory use CMAKE_INSTALL_PREFIX when building.

COSMA is CMake friendly and provides a cosmaConfig.cmake module for easy integration into 3rd-party CMake projects with

find_package(cosma REQUIRED)
target_link_libraries( ... cosma::cosma)

COSMA’s dependencies are taken care of internally, nothing else needs to be linked. Make sure to set CMAKE_INSTALL_PREFIX to COSMA’s installation directory when building.

There is a rudimentary pkgconfig support; dependencies are handles explicitly by consumers.

Installing COSMA with Spack

Notes:

For more information on Spack: Spack 101 Tutorial.

Docker

COSMA can be installed into a Docker container in the following way:

docker build -f docker/gpu/build-env.Dockerfile -t cosma-build-env .
docker build --build-arg BUILD_ENV=cosma-build-env -f docker/gpu/deploy.Dockerfile -t cosma .

Then the cosma container can be deployed for testing:

docker run --rm -it -v (pwd):(pwd) --gpus all cosma