DYSJZWZUGJ7ZNEI7WL5FHS2TDM7LQA7HEEUHGV7EJJRF3TYENNCAC Cactus Code Thorn KokkosAuthor(s) : Erik SchnetterMaintainer(s): Cactus teamLicence : ?--------------------------------------------------------------------------1. PurposeConfigure the Kokkos library; see <https://github.com/kokkos/kokkos>From the web site:Kokkos C++ Performance Portability Programming EcoSystem: TheProgramming Model -- Parallel Execution and Memory AbstractionKokkos Core implements a programming model in C++ for writingperformance portable applications targeting all major HPC platforms.For that purpose it provides abstractions for both parallel executionof code and data management. Kokkos is designed to target complex nodearchitectures with N-level memory hierarchies and multiple types ofexecution resources. It currently can use OpenMP, Pthreads and CUDA asbackend programming models.
# Configuration definitions for thorn KokkosPROVIDES Kokkos{SCRIPT configure.shLANG bashOPTIONS KOKKOS_DIR}REQUIRES Kokkos
#! /bin/bash################################################################################# Prepare################################################################################# Set up shellif [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; thenset -x # Output commandsfiset -e # Abort on errors################################################################################# Configure Cactus################################################################################if [ -z "${KOKKOS_DIR}" ]; thenecho "BEGIN ERROR"echo "Configuration variable KOKKOS_DIR is not set"echo "END ERROR"exit 1fi# Set options: ${KOKKOS_INC_DIRS="${KOKKOS_DIR}/include"}: ${KOKKOS_LIB_DIRS="${KOKKOS_DIR}/lib"}: ${KOKKOS_LIBS="kokkos"}KOKKOS_INC_DIRS="$(${CCTK_HOME}/lib/sbin/strip-incdirs.sh ${KOKKOS_INC_DIRS})"KOKKOS_LIB_DIRS="$(${CCTK_HOME}/lib/sbin/strip-libdirs.sh ${KOKKOS_LIB_DIRS})"echo "BEGIN MAKE_DEFINITION"echo "KOKKOS_DIR = ${KOKKOS_DIR}"echo "KOKKOS_INC_DIRS = ${KOKKOS_INC_DIRS}"echo "KOKKOS_LIB_DIRS = ${KOKKOS_LIB_DIRS}"echo "KOKKOS_LIBS = ${KOKKOS_LIBS}"echo "END MAKE_DEFINITION"echo 'INCLUDE_DIRECTORY $(KOKKOS_INC_DIRS)'echo 'LIBRARY_DIRECTORY $(KOKKOS_LIB_DIRS)'echo 'LIBRARY $(KOKKOS_LIBS)'
# Interface definition for thorn KokkosIMPLEMENTS: Kokkos
# Parameter definitions for thorn Kokkos
# Schedule definitions for thorn KokkosSCHEDULE Kokkos_Startup AT startup AFTER Driver_Startup{LANG: C} "Initialize Kokkos"SCHEDULE Kokkos_Shutdown AT shutdown BEFORE Driver_Shutdown{LANG: COPTIONS: meta} "Finalize Kokkos"
#include <cctk.h>#include <cctk_Arguments.h>#include <Kokkos_Core.hpp>extern "C" int Kokkos_Startup() {int argc = 0;char *argv[] = {nullptr};Kokkos::initialize(argc, argv);return 0;}extern "C" int Kokkos_Shutdown() {Kokkos::finalize();return 0;}
# Main make.code.defn file for thorn Kokkos# Source files in this directorySRCS = kokkos.cxx# Subdirectories containing source filesSUBDIRS =