Setup

This page is intended as a guide to jump start new KokkosComm users.

System requirements

Name

Requirement

CMake

3.25+

C++ compiler

Conforming to ISO C++20 standard

Kokkos

4.7+

MPI

Conforming to MPI-3+ standard

NCCL

2+

KokkosComm will attempt to support the same systems and toolchains as Kokkos.

Installation

Download

KokkosComm’s source code is available on GitHub, which you can obtain using the following command:

$ git clone https://github.com/kokkos/kokkos-comm.git

Or using the GitHub CLI tool:

$ gh repo clone kokkos/kokkos-comm

Build

A basic configure and build of KokkosComm:

$ cmake -B <BUILD_DIR> -DKokkos_ROOT=<KOKKOS_INSTALL_DIR>
$ cmake --build <BUILD_DIR>

Test

$ cmake -B <BUILD_DIR> \
        -DKokkos_ROOT=<KOKKOS_INSTALL_DIR> \
        -DKokkosComm_ENABLE_TESTS=ON
$ cmake --build <BUILD_DIR>
$ ctest --test-dir <BUILD_DIR>/unit_tests

For a detailed guide on testing KokkosComm, please refer to the Testing section.

Install

$ cmake --install <BUILD_DIR> --prefix <INSTALL_DIR>

Integration in user applications

Similarly to Kokkos, KokkosComm is packaged with a modern CMake build system.

Once installed, you can declare KokkosComm as a dependency of your project by adding the following line to your CMakeLists.txt:

find_package(KokkosComm REQUIRED)

Then, for every executable or library in your project that depends on KokkosComm:

target_link_libraries(MyTarget KokkosComm::KokkosComm)

CMake configuration options

This section lists the available options to customize your KokkosComm build/installation.

Important

All KokkosComm CMake options are prefixed with KokkosComm_, which is case-sensitive.

Communication backend selection

You can enable communication backends by configuring with -DKokkosComm_ENABLE_<COMM_BACKEND>=ON, where <COMM_BACKEND> is replaced with the specific communication backend you want to enable (e.g. -DKokkosComm_ENABLE_MPI=ON for MPI).

CMake option

Default

Description

KokkosComm_ENABLE_MPI

ON

Build with MPI backend.

KokkosComm_ENABLE_NCCL

OFF

Build with NCCL backend (experimental).

Behavior tuning

CMake option

Default

Description

KokkosComm_ABORT_ON_ERROR

OFF

Runtime check failures trigger a global abort.

General options

CMake option

Default

Description

KokkosComm_ENABLE_TESTS

OFF

Build unit tests.

KokkosComm_ENABLE_PERFTESTS

OFF

Build performance tests.

KokkosComm_INSTALL_CMAKE_PACKAGE

${PROJECT_IS_TOP_LEVEL}

Install a CMake config-file package together with the library. Defaults to ON for standalone builds, OFF otherwise. Note that library files are always installed.

Known quirks

At Sandia, with the VPN enabled while using MPICH, you may have to do the following:

$ export FI_PROVIDER=tcp