Skip to content

Building FleCSI with Kokkos Support (Legion Kokkos CUDA)

Irina Demeshko edited this page Nov 26, 2019 · 2 revisions

Building third-party dependencies + with CUDA support:

Kokkos

git clone —recursive https://github.com/kokkos/kokkos.git

git checkout -b develop origin/develop

mkdir build

cd build

CC=clang CXX=clang++ ccmake -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} --gcc-toolchain=set_path_to_your_gcc_build -static-libstdc++ -D__STRICT_ANSI__  -fPIC " -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} --gcc-toolchain=set_path_to_your_gcc_build -static-libstdc++ -D__STRICT_ANSI__  -fPIC " .. -DCMAKE_INSTALL_PREFIX=/your/install/path -DCMAKE_BUILD_TYPE=Debug  -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON  -DKokkos_ENABLE_DEBUG=ON  -DKokkos_ENABLE_SERIAL=ON -DKOKKOS_CXX_COMPILER_ID=Clang -DKokkos_ARCH=Power9 -DKokkos_ARCH_VOLTA70=ON -DKokkos_ENABLE_CUDA_UVM=OFF  -DKokkos_CXX_STANDART=11

make

make install

Flecsi third-party libraries

If needed, set CMAKE_PREFIX_PATH to point to correct Kokkos install

git clone —recursive  https://github.com/laristra/flecsi-third-party.git

cd flecsi-third-party

git checkout -b irina/kokkos origin/irina/kokkos

git submodule update --recursive 

mkdir build

cd build

CC=clang CXX=clang++ ccmake -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} --gcc-toolchain=set_path_to_your_gcc_build  -static-libstdc++ -D__STRICT_ANSI__ -std=c++11" -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} --gcc-toolchain=set_path_to_your_gcc_build -static-libstdc++ -D__STRICT_ANSI__" .. -DCMAKE_INSTALL_PREFIX=/your/install/path -DCMAKE_BUILD_TYPE=Debug -DLEGION_USE_KOKKOS=ON 

make

make install

Building FleCSI

git clone --recursive https://github.com/laristra/flecsi.git

mkdir build

cd build

../arch/developer-clang legion kokkos

make

There is kokkos_test unit test (https://github.com/laristra/flecsi/blob/master/flecsi/execution/test/kokkos.cc) that can be used as an example of how to use kokkos in FleCSI

you can execute it like:

cd build
cd test/execution
./kokkos_test -ll:gpu 1