diff --git a/.github/containers/x86_64-broadwell-cuda11.6.1/spack.yaml b/.github/containers/x86_64-broadwell-cuda11.6.1/spack.yaml index 02d6bfb4..2830d79a 100644 --- a/.github/containers/x86_64-broadwell-cuda11.6.1/spack.yaml +++ b/.github/containers/x86_64-broadwell-cuda11.6.1/spack.yaml @@ -20,6 +20,7 @@ spack: - flux-sched - py-pika - amqp-cpp +tcp + - adiak view: local concretizer: unify: true @@ -76,4 +77,6 @@ spack: require: '@0.28' py-pika: require: '@1.3.1' + adiak: + require: '@0.4.0+shared+mpi' diff --git a/.github/containers/x86_64-broadwell-gcc11.2.1/spack.yaml b/.github/containers/x86_64-broadwell-gcc11.2.1/spack.yaml index 5184391a..1596d8ec 100644 --- a/.github/containers/x86_64-broadwell-gcc11.2.1/spack.yaml +++ b/.github/containers/x86_64-broadwell-gcc11.2.1/spack.yaml @@ -20,6 +20,7 @@ spack: - flux-sched - py-pika - amqp-cpp +tcp + - adiak view: local concretizer: unify: true @@ -68,4 +69,6 @@ spack: require: '@0.28' py-pika: require: '@1.3.1' + adiak: + require: '@0.4.0+shared+mpi' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fa433c5..e1942232 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,7 @@ jobs: -DFAISS_DIR=$AMS_FAISS_PATH \ -DWITH_AMS_DEBUG=On \ -DWITH_WORKFLOW=On \ + -DWITH_ADIAK=On \ $GITHUB_WORKSPACE make - name: Run tests Torch=On FAISS=On HDF5=On AMS @@ -90,6 +91,7 @@ jobs: -DFAISS_DIR=$AMS_FAISS_PATH \ -DWITH_AMS_DEBUG=On \ -DWITH_WORKFLOW=On \ + -DWITH_ADIAK=On \ $GITHUB_WORKSPACE make - name: Run tests Torch=Off FAISS=On HDF5=On AMS @@ -126,6 +128,7 @@ jobs: -DWITH_TESTS=On \ -DWITH_AMS_DEBUG=On \ -DWITH_WORKFLOW=On \ + -DWITH_ADIAK=On \ $GITHUB_WORKSPACE make - name: Run tests Torch=Off FAISS=Off HDF5=On AMS @@ -159,6 +162,7 @@ jobs: -DWITH_TESTS=On \ -DWITH_AMS_DEBUG=On \ -DWITH_WORKFLOW=On \ + -DWITH_ADIAK=Off \ $GITHUB_WORKSPACE make - name: Run tests Torch=Off FAISS=Off HDF5=Off AMS @@ -208,6 +212,7 @@ jobs: -DFAISS_DIR=$AMS_FAISS_PATH \ -DWITH_AMS_DEBUG=On \ -DWITH_WORKFLOW=On \ + -DWITH_ADIAK=On \ $GITHUB_WORKSPACE make - name: Build Torch=Off FAISS=On HDF5=On AMS @@ -242,6 +247,7 @@ jobs: -DFAISS_DIR=$AMS_FAISS_PATH \ -DWITH_AMS_DEBUG=On \ -DWITH_WORKFLOW=On \ + -DWITH_ADIAK=On \ $GITHUB_WORKSPACE make - name: Build Torch=Off FAISS=Off HDF5=On AMS @@ -274,6 +280,7 @@ jobs: -DWITH_TESTS=On \ -DWITH_AMS_DEBUG=On \ -DWITH_WORKFLOW=On \ + -DWITH_ADIAK=On \ $GITHUB_WORKSPACE make - name: Build Torch=Off FAISS=Off HDF5=Off AMS @@ -303,5 +310,6 @@ jobs: -DWITH_TESTS=On \ -DWITH_AMS_DEBUG=On \ -DWITH_WORKFLOW=On \ + -DWITH_ADIAK=Off \ $GITHUB_WORKSPACE make diff --git a/CMakeLists.txt b/CMakeLists.txt index eee9a9da..ac996c12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,7 @@ option(WITH_AMS_DEBUG "Enable verbose messages" OFF) option(WITH_PERFFLOWASPECT "Use PerfFlowAspect for Profiling" OFF) option(WITH_WORKFLOW "Install python drivers used by the outer workflow" OFF) option(WITH_AMS_LIB "Install C++ library to support scientific applications" ON) +option(WITH_ADIAK "Use Adiak for recording metadata" OFF) option(BUILD_SHARED_LIBS "Build using shared libraries" ON) if (WITH_MPI) @@ -308,6 +309,13 @@ if (WITH_EXAMPLES) list(APPEND AMS_EXAMPLE_DEFINES "-D__ENABLE_PERFFLOWASPECT__") endif() + if (WITH_ADIAK) + find_package(adiak REQUIRED) + list(APPEND AMS_EXAMPLE_DEFINES "-D__ENABLE_ADIAK__") + list(APPEND AMS_EXAMPLE_INCLUDES ${adiak_INCLUDE_DIR}) + list(APPEND AMS_EXAMPLE_LIBRARIES adiak::adiak) + endif() + add_subdirectory(examples) endif() endif() diff --git a/INSTALL.md b/INSTALL.md index 02f3b036..2240b226 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -11,6 +11,7 @@ AMSLib depends on the following packages: * REDIS (Optional) * HDF5 (Optional) * CUDA (Optional) +* ADIAK (Optional) ## Spack Installation diff --git a/examples/main.cpp b/examples/main.cpp index 99f4d3e5..ed4f7a87 100644 --- a/examples/main.cpp +++ b/examples/main.cpp @@ -5,6 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ +#ifdef __AMS_ENABLE_ADIAK__ +#include +#endif #include #include #include @@ -642,6 +645,30 @@ int main(int argc, char **argv) bool verbose = false; +#ifdef __AMS_ENABLE_ADIAK__ + // add adiak init here + adiak::init(NULL); + + // replace with adiak::collect_all(); once adiak v0.4.0 + adiak::uid(); + adiak::launchdate(); + adiak::launchday(); + adiak::executable(); + adiak::executablepath(); + adiak::workdir(); + adiak::libraries(); + adiak::cmdline(); + adiak::hostname(); + adiak::clustername(); + adiak::walltime(); + adiak::systime(); + adiak::cputime(); + adiak::jobsize(); + adiak::hostlist(); + adiak::numhosts(); + adiak::value("compiler", std::string("@RAJAPERF_COMPILER@")); +#endif + // ------------------------------------------------------------------------- // setup command line parser // ------------------------------------------------------------------------- @@ -876,6 +903,12 @@ int main(int argc, char **argv) return -1; } + // --------------------------------------------------------------------------- +#ifdef __AMS_ENABLE_ADIAK__ + // adiak finalize + adiak::fini(); +#endif + MPI_CALL(MPI_Finalize()); return ret; }