Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
spack-build/
spack-build-env.txt
spack-build-out.txt
spack.lock
.spack-env/
cmake_install.cmake
CMakeFiles/
LibInstalls/
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,39 @@ in the `Exercises` directory.
Compatible means:
* X86 with a NVIDIA V100 GPU
* kokkos was cloned to ${HOME}/Kokkos/kokkos

# Using `spack` to build Kokkos and Kokkos-Kernels

[`spack`](https://spack.io) is a package manager for supercomputers, Linux, and macOS. It makes installing scientific
software easy. With `spack`, you can build Kokkos and its dependencies with a single command.

We provide environments to ease the setup of Kokkos and Kokkos-Kernels for the tutorials. The environments are located
in the `spack-envs` directory.

To use the environments, first install `spack` by following the
instructions [here](https://spack.readthedocs.io/en/latest/getting_started.html).

To build Kokkos and Kokkos-Kernels with OpenMP backend, you can use the following commands:

```bash
source <spack_install_dir>/share/spack/setup-env.sh
spack compiler add # find compilers on your system
spack env activate spack-envs/kokkos-kernels/openmp
spack install
spack load kokkos-kernels
```

Now you can go to the tutorial directory and build the tutorials using the installed Kokkos-Kernels library.

For example:

```bash
# Select the exercise, and cheat to the solution directory
cd Exercises/kokkoskernels/GaussSeidel/Solution
# Configure the build
cmake -B build_dir
# Build the exercise
cmake --build build_dir
# Run the exercise
./build_dir/gauss_seidel
```
11 changes: 11 additions & 0 deletions spack-envs/kokkos-kernels/openmp/spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
# add package specs to the `specs` list
specs:
- kokkos-kernels+openmp
view: false
concretizer:
unify: true
11 changes: 11 additions & 0 deletions spack-envs/kokkos/openmp/spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
# add package specs to the `specs` list
specs:
- kokkos+openmp~serial
view: false
concretizer:
unify: true