diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 942435cbe5..813f151aaa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ stages: - ASSIGN_ID=$(if [[ -n "${JOBID}" ]]; then echo "--jobid=${JOBID}"; fi) # BUILD + TEST - echo -e "\e[0Ksection_start:$(date +%s):src_build_and_test\r\e[0KSource Build and Test ${CI_PROJECT_NAME}" - - ${ALLOC_COMMAND} ${ASSIGN_ID} python3 scripts/llnl_scripts/build_src.py -v --host-config ${HOST_CONFIG} --extra-cmake-options -DENABLE_DOCS=OFF + - ${ALLOC_COMMAND} ${ASSIGN_ID} python3 scripts/llnl_scripts/build_src.py -v --host-config ${HOST_CONFIG} --extra-cmake-options '-DENABLE_DOCS=OFF ${EXTRA_CMAKE_OPTIONS}' --build-type ${BUILD_TYPE:-Debug} - echo -e "\e[0Ksection_end:$(date +%s):src_build_and_test\r\e[0K" artifacts: paths: diff --git a/.gitlab/build_ruby.yml b/.gitlab/build_ruby.yml index c68ab0a2d6..0634504261 100644 --- a/.gitlab/build_ruby.yml +++ b/.gitlab/build_ruby.yml @@ -63,6 +63,14 @@ ruby-clang_10_0_0-src: HOST_CONFIG: "ruby-toss_3_x86_64_ib-${COMPILER}.cmake" extends: .src_build_on_ruby +ruby-clang_10_0_0-release-src: + variables: + COMPILER: "clang@10.0.0" + HOST_CONFIG: "ruby-toss_3_x86_64_ib-${COMPILER}.cmake" + BUILD_TYPE: "Release" + EXTRA_CMAKE_OPTIONS: "-DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON" + extends: .src_build_on_ruby + ruby-clang_9_0_0-src: variables: COMPILER: "clang@9.0.0" diff --git a/RELEASE b/RELEASE index 79101753bb..b40458d3d0 100644 --- a/RELEASE +++ b/RELEASE @@ -1,6 +1,6 @@ ******************************************************************************* -Axom: ................................, version 0.6.0 +Axom: ................................, version 0.6.1 Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory. diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 083e762c36..34f3b99f61 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -19,6 +19,31 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ## [Unreleased] - Release date yyyy-mm-dd +## [Version 0.6.1] - Release date 2021-11-17 + +### Added +- Added a config variable, `AXOM_DEBUG_DEFINE` to control whether the `AXOM_DEBUG` compiler define is enabled. + By `DEFAULT`, it is enabled for `Debug` and `RelWithDebInfo` configurations, but this can be overriden + by setting `AXOM_DEBUG_DEFINE` to `ON` or `OFF`. +- `axom::Array` is now GPU-compatible, in particular via a memory space template parameter and via + extensions to `axom::ArrayView` that allow for copying into kernels and transfers between memory spaces. +- Adds some utility arithmetic operators for adding and subracting `primal::Point`s and `primal::Vector`s + +### Changed +- Renamed `AXOM_NOT_USED` macro to `AXOM_UNUSED_PARAM` for better consistency with other Axom macros +- Added `explicit` to `axom::Inlet::InletVector` constructors and added a constructor that accepts a `double*` +- `AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION` configuration option is now `ON` by default (rather than `OFF`). + This option should be disabled if `mfem` was configured with `MFEM_USE_SIDRE`. + +### Fixed +- The `AXOM_DEBUG` compiler define is now properly exported via the `axom` CMake target when it is enabled +- Added tolerance parameter `EPS` to `primal::closest_point()` operator. This effectively snaps + closest points to the triangle boundaries vertices and edges when they are within `EPS`, + improving consistency when, e.g., querying multiple triangles from the same mesh. +- Fixed regression in `SignedDistance` queries for query points closest to edges or vertices + of the input triangle mesh + + ## [Version 0.6.0] - Release date 2021-11-04 ### Added @@ -628,7 +653,8 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ### Security - Use this section in case of vulnerabilities -[Unreleased]: https://github.com/LLNL/axom/compare/v0.6.0...develop +[Unreleased]: https://github.com/LLNL/axom/compare/v0.6.1...develop +[Version 0.6.1]: https://github.com/LLNL/axom/compare/v0.6.0...v0.6.1 [Version 0.6.0]: https://github.com/LLNL/axom/compare/v0.5.0...v0.6.0 [Version 0.5.0]: https://github.com/LLNL/axom/compare/v0.4.0...v0.5.0 [Version 0.4.0]: https://github.com/LLNL/axom/compare/v0.3.3...v0.4.0 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 907824ce12..dd4a7c416d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,8 +9,8 @@ variables: DO_BUILD: 'yes' DO_TEST: 'yes' DO_CLEAN: 'no' - CLANG10_IMAGENAME: 'axom/tpls:clang-10_10-21-21_21h-28m' - GCC8_IMAGENAME: 'axom/tpls:gcc-8_10-21-21_21h-28m' + CLANG10_IMAGENAME: 'axom/tpls:clang-10_11-11-21_01h-52m' + GCC8_IMAGENAME: 'axom/tpls:gcc-8_11-11-21_01h-52m' jobs: - job: Build_and_Test @@ -34,7 +34,8 @@ jobs: linux_clang10: VM_ImageName: 'ubuntu-18.04' Compiler_ImageName: '$(CLANG10_IMAGENAME)' - CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON ' + CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON' + BUILD_TYPE: 'Release' COMPILER: 'clang++' TEST_TARGET: 'linux_clang10' HOST_CONFIG: 'docker-linux-ubuntu18.04-x86_64-clang@10.0.0' @@ -46,7 +47,7 @@ jobs: TEST_TARGET: 'linux_clang10' HOST_CONFIG: 'docker-linux-ubuntu18.04-x86_64-clang@10.0.0' osx_gcc: - VM_ImageName: 'macos-10.14' + VM_ImageName: 'macos-1015' CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF' TEST_TARGET: 'osx_gcc' windows: @@ -90,7 +91,7 @@ jobs: - script: | echo " -e $TEST_TARGET -e $COMPILER -e $DO_BUILD -e $DO_TEST -e $CMAKE_EXTRA_FLAGS $(Compiler_ImageName) ./scripts/azure-pipelines/linux-build_and_test.sh" docker run --rm --user='root' -v `pwd`:/home/axom/axom $(Compiler_ImageName) chown -R axom /home/axom - docker run --rm -v `pwd`:/home/axom/axom -e TEST_TARGET -e COMPILER -e DO_BUILD -e DO_TEST -e DO_CLEAN -e HOST_CONFIG -e CMAKE_EXTRA_FLAGS $(Compiler_ImageName) ./axom/scripts/azure-pipelines/linux-build_and_test.sh + docker run --rm -v `pwd`:/home/axom/axom -e TEST_TARGET -e COMPILER -e DO_BUILD -e DO_TEST -e DO_CLEAN -e HOST_CONFIG -e CMAKE_EXTRA_FLAGS -e BUILD_TYPE $(Compiler_ImageName) ./axom/scripts/azure-pipelines/linux-build_and_test.sh condition: eq( variables['Agent.OS'], 'Linux') displayName: 'Linux Build & Test ($(TEST_TARGET))' diff --git a/data b/data index 74a47ea458..b3d8e6fc72 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 74a47ea45851197f46c344863cb91f53ed69f5cd +Subproject commit b3d8e6fc72af0d5d8618033b33346f83112fdc91 diff --git a/host-configs/docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake b/host-configs/docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake index e50c2b8783..3254cfb8d7 100644 --- a/host-configs/docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake +++ b/host-configs/docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake @@ -69,7 +69,7 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") set(TPL_ROOT "/home/axom/axom_tpls/clang-10.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") # C2C not built diff --git a/host-configs/docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake b/host-configs/docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake index 8ea4fad90e..2bcf6cb1ed 100644 --- a/host-configs/docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake +++ b/host-configs/docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake @@ -71,7 +71,7 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") set(TPL_ROOT "/home/axom/axom_tpls/gcc-8.4.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") # C2C not built diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake index 02234011b5..9b0b51f290 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -97,9 +97,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/clang-8.0.1_nvcc_xlf" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/clang-8.0.1_nvcc_xlf" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake index 76a4641c3e..746c3cdcc9 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -73,9 +73,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/clang-9.0.0_upstream_xlf" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/clang-9.0.0_upstream_xlf" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake index c9462ad102..152654d181 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -65,13 +65,13 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/gcc-7.3.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/gcc-7.3.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") +# MFEM not built set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake index 70667f8c4c..e33715a398 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -73,9 +73,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/xl-16.1.1_coral" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/xl-16.1.1_coral" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake index eff031cdf8..9f3e4200eb 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -97,9 +97,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/xl-16.1.1_nvcc" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/xl-16.1.1_nvcc" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake b/host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake index ceed86efa2..cc18ecc4e0 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/clang-10.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/clang-10.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake b/host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake index 56d914b48b..545cac4834 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/clang-9.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/clang-9.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake b/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake index 67c42edab3..3b324c6275 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -63,9 +63,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/gcc-8.1.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/gcc-8.1.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake b/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake index 77f282e0b4..d8722e7ae8 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake @@ -11,9 +11,9 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/g++" CACHE PATH "") # No Fortran compiler defined in spec else() @@ -61,13 +61,13 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/gcc-8.1_no_fortran" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/gcc-8.1_no_fortran" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") +# MFEM not built set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake b/host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake index f902554753..bcdbc3e7cc 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/icc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/icc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/icpc" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/icpc" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/ifort" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/ifort" CACHE PATH "") else() @@ -63,9 +63,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/intel-18.0.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/intel-18.0.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake b/host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake index 8ccc140b84..07148cd0be 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/icc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/icc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/icpc" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/icpc" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/ifort" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/ifort" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/intel-19.0.4" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/intel-19.0.4" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake index 1961951064..3d13f00775 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -97,9 +97,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/clang-8.0.1_nvcc_xlf" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/clang-8.0.1_nvcc_xlf" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake index 709bfa7d7c..01aa32816b 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -73,9 +73,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/clang-9.0.0_upstream_xlf" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/clang-9.0.0_upstream_xlf" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake index ca455525ca..89cb4525ba 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -65,13 +65,13 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/gcc-7.3.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/gcc-7.3.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") +# MFEM not built set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake index 554ba44d47..7eb4797858 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -73,9 +73,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/xl-16.1.1_coral" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/xl-16.1.1_coral" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake index 9cfad45921..dddb492cf3 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -97,9 +97,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/xl-16.1.1_nvcc" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/xl-16.1.1_nvcc" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzansel-klee-clang@8.0.1_nvcc_xlf.cmake b/host-configs/rzansel-klee-clang@8.0.1_nvcc_xlf.cmake deleted file mode 100644 index d446a7732d..0000000000 --- a/host-configs/rzansel-klee-clang@8.0.1_nvcc_xlf.cmake +++ /dev/null @@ -1,130 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.14.5/bin/cmake -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: clang@8.0.1_nvcc_xlf -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_20_23_46/spack/lib/spack/env/clang/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_20_23_46/spack/lib/spack/env/clang/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_20_23_46/spack/lib/spack/env/clang/flang" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/clang/clang-8.0.1/bin/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-8.0.1/bin/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/tce/packages/xl/xl-2019.12.23/bin/xlf2003" CACHE PATH "") - -endif() - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -set(BLT_CXX_STD "c++14" CACHE STRING "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-8.0.1/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-8.0.1/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-8.0.1/bin/mpif90" CACHE PATH "") - -set(MPIEXEC_EXECUTABLE "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-8.0.1/bin/mpirun" CACHE PATH "") - -set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "") - -set(ENABLE_MPI ON CACHE BOOL "") - -set(BLT_MPI_COMMAND_APPEND "mpibind" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Hardware -#------------------------------------------------------------------------------ - -#------------------------------------------------ -# Cuda -#------------------------------------------------ - -set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-10.1.243" CACHE PATH "") - -set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") - -set(CMAKE_CUDA_HOST_COMPILER "${MPI_CXX_COMPILER}" CACHE PATH "") - -set(ENABLE_CUDA ON CACHE BOOL "") - -set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "") - -set(AXOM_ENABLE_ANNOTATIONS ON CACHE BOOL "") - -set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "") - -set(CMAKE_CUDA_FLAGS "-restrict --expt-extended-lambda -arch sm_${CMAKE_CUDA_ARCHITECTURES} -std=c++14" CACHE STRING "") - -# nvcc does not like gtest's 'pthreads' flag - -set(gtest_disable_pthreads ON CACHE BOOL "") - -#------------------------------------------------ -# Hardware Specifics -#------------------------------------------------ - -set(ENABLE_OPENMP OFF CACHE BOOL "") - -set(ENABLE_GTEST_DEATH_TESTS OFF CACHE BOOL "") - -set(BLT_EXE_LINKER_FLAGS "${BLT_EXE_LINKER_FLAGS} -Wl,-rpath,/usr/tce/packages/xl/xl-2019.12.23/lib" CACHE STRING "Adds a missing rpath for libraries associated with the fortran compiler") - -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath,/usr/tce/packages/xl/xl-2019.12.23/lib" CACHE STRING "Adds a missing rpath for libraries associated with the fortran compiler") - -set(BLT_FORTRAN_FLAGS "-WF,-C! -qxlf2003=polymorphic" CACHE STRING "Converts C-style comments to Fortran style in preprocessed files") - -set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3" CACHE STRING "") - -#------------------------------------------------------------------------------ -# TPLs -#------------------------------------------------------------------------------ - -# Root directory for generated TPLs - -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_20_23_46/clang-8.0.1_nvcc_xlf" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.3.5" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-0.14.0" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-6.0.0" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -# ClangFormat disabled due to disabled devtools - -set(ENABLE_CLANGFORMAT OFF CACHE BOOL "") - -set(ENABLE_DOCS OFF CACHE BOOL "") - - diff --git a/host-configs/rzgenie-klee-clang@10.0.0.cmake b/host-configs/rzgenie-klee-clang@10.0.0.cmake deleted file mode 100644 index 82fe8608da..0000000000 --- a/host-configs/rzgenie-klee-clang@10.0.0.cmake +++ /dev/null @@ -1,126 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.14.5/bin/cmake -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: clang@10.0.0 -#------------------------------------------------------------------------------ -# Note: -# Contains a parallel build of MFEM generated using: -# >./scripts/llnl_scripts/build_tpls.py --spec "%clang@10.0.0+devtools+mfem+c2c ^mfem+mpi+metis+zlib" -# and adds a flag to use the axom version of mfem sidre data collection (see bottom of file) -#------------------------------------------------------------------------------ - -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_19_10_21_07/spack/lib/spack/env/clang/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_19_10_21_07/spack/lib/spack/env/clang/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_19_10_21_07/spack/lib/spack/env/clang/gfortran" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/clang/clang-10.0.0/bin/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-10.0.0/bin/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran" CACHE PATH "") - -endif() - -set(CMAKE_C_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0" CACHE STRING "") - -set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0" CACHE STRING "") - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,/usr/tce/packages/clang/clang-10.0.0/lib" CACHE STRING "Adds a missing libstdc++ rpath") - -set(BLT_CXX_STD "c++14" CACHE STRING "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0/bin/mpif90" CACHE PATH "") - -set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") - -set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") - -set(ENABLE_MPI ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# Hardware -#------------------------------------------------------------------------------ - -#------------------------------------------------ -# Hardware Specifics -#------------------------------------------------ - -set(ENABLE_OPENMP ON CACHE BOOL "") - -set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# TPLs -#------------------------------------------------------------------------------ - -# Root directory for generated TPLs - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_19_10_21_07/clang-10.0.0" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.3.5" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-0.14.0" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-6.0.0" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -# Root directory for generated developer tools - -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/2020_08_21_22_18_57/gcc-8.1.0" CACHE PATH "") - -set(CLANGFORMAT_EXECUTABLE "/usr/tce/packages/clang/clang-10.0.0/bin/clang-format" CACHE PATH "") - -set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.7.7/bin/python3.7" CACHE PATH "") - -set(ENABLE_DOCS ON CACHE BOOL "") - -set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.7.7/bin/sphinx-build" CACHE PATH "") - -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.7.7/bin/shroud" CACHE PATH "") - -set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-1.87/bin/cppcheck" CACHE PATH "") - -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") - - - -#------------------------------------------------------------------------------ -# Additional setup for Klee examples -#------------------------------------------------------------------------------ -set(AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION ON CACHE STRING "") - diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake index fc20f7e296..cb3209f3ac 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/clang-10.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/clang-10.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake index 75dacd0325..81c399729e 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/clang-9.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/clang-9.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake index 80d7f91e99..15a5fc9cbe 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -63,9 +63,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/gcc-8.1.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/gcc-8.1.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake index b634682241..8f5bc3fba2 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake @@ -11,9 +11,9 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/g++" CACHE PATH "") # No Fortran compiler defined in spec else() @@ -61,13 +61,13 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/gcc-8.1_no_fortran" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/gcc-8.1_no_fortran" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") +# MFEM not built set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake index 73f01243b9..870669c9c8 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/icc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/icc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/icpc" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/icpc" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/ifort" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/ifort" CACHE PATH "") else() @@ -63,9 +63,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/intel-18.0.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/intel-18.0.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake index 8febb65695..5a3724ac0e 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/icc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/icc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/icpc" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/icpc" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/ifort" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/ifort" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/intel-19.0.4" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/intel-19.0.4" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/scripts/azure-pipelines/linux-build_and_test.sh b/scripts/azure-pipelines/linux-build_and_test.sh index 0dfb2668dd..10df29dd31 100755 --- a/scripts/azure-pipelines/linux-build_and_test.sh +++ b/scripts/azure-pipelines/linux-build_and_test.sh @@ -18,16 +18,19 @@ function or_die () { } or_die cd axom -git submodule init -git submodule update +git submodule init +git submodule update echo HOST_CONFIG echo $HOST_CONFIG +export BUILD_TYPE=${BUILD_TYPE:-Debug} + + if [[ "$DO_BUILD" == "yes" ]] ; then echo "~~~~~~ RUNNING CMAKE ~~~~~~~~" - or_die ./config-build.py -hc /home/axom/axom/host-configs/docker/${HOST_CONFIG}.cmake -DENABLE_GTEST_DEATH_TESTS=ON ${CMAKE_EXTRA_FLAGS} - or_die cd build-$HOST_CONFIG-debug + or_die ./config-build.py -hc /home/axom/axom/host-configs/docker/${HOST_CONFIG}.cmake -bt ${BUILD_TYPE} -DENABLE_GTEST_DEATH_TESTS=ON ${CMAKE_EXTRA_FLAGS} + or_die cd build-$HOST_CONFIG-${BUILD_TYPE,,} echo "~~~~~~ BUILDING ~~~~~~~~" if [[ ${CMAKE_EXTRA_FLAGS} == *COVERAGE* ]] ; then or_die make -j 10 diff --git a/scripts/llnl_scripts/build_src.py b/scripts/llnl_scripts/build_src.py index 629de762e2..236ba2aa78 100755 --- a/scripts/llnl_scripts/build_src.py +++ b/scripts/llnl_scripts/build_src.py @@ -9,7 +9,7 @@ """ file: build_src.py - description: + description: Builds all Axom with the host-configs for the current machine. """ @@ -37,6 +37,12 @@ def parse_args(): dest="hostconfig", default="", help="Specific host-config file to build (Tries multiple known paths to locate given file)") + # Build type for the configuration + parser.add_option("--build-type", + dest="buildtype", + default="Debug", + choices = ("Debug", "RelWithDebInfo", "Release", "MinSizeRel"), + help="The CMake build type to use") # Extra cmake options to pass to config build parser.add_option("--extra-cmake-options", dest="extra_cmake_options", @@ -56,7 +62,7 @@ def parse_args(): # parse args ############### opts, extras = parser.parse_args() - # we want a dict b/c the values could + # we want a dict b/c the values could # be passed without using optparse opts = vars(opts) @@ -100,7 +106,10 @@ def main(): # Default to build all SYS_TYPE's host-configs in host-config/ build_all = not opts["hostconfig"] and not opts["automation"] if build_all: - res = build_and_test_host_configs(repo_dir, job_name, timestamp, False, opts["verbose"], opts["extra_cmake_options"]) + res = build_and_test_host_configs(repo_dir, job_name, timestamp, False, + report_to_stdout = opts["verbose"], + extra_cmake_options = opts["extra_cmake_options"], + build_type = opts["buildtype"]) # Otherwise try to build a specific host-config else: # Command-line arg has highest priority @@ -149,7 +158,10 @@ def main(): test_root = get_build_and_test_root(repo_dir, timestamp) test_root = "{0}_{1}".format(test_root, hostconfig.replace(".cmake", "").replace("@","_")) os.mkdir(test_root) - res = build_and_test_host_config(test_root, hostconfig_path, opts["verbose"], opts["extra_cmake_options"]) + res = build_and_test_host_config(test_root, hostconfig_path, + report_to_stdout = opts["verbose"], + extra_cmake_options = opts["extra_cmake_options"], + build_type = opts["buildtype"]) # Archive logs if opts["archive"] != "": diff --git a/scripts/llnl_scripts/llnl_lc_build_tools.py b/scripts/llnl_scripts/llnl_lc_build_tools.py index 911d0476cb..882b205d94 100755 --- a/scripts/llnl_scripts/llnl_lc_build_tools.py +++ b/scripts/llnl_scripts/llnl_lc_build_tools.py @@ -8,7 +8,7 @@ """ file: llnl_lc_uberenv_install_tools.py - description: + description: helpers for installing axom tpls on llnl lc systems. """ @@ -232,7 +232,7 @@ def archive_tpl_logs(prefix, job_name, timestamp): os.makedirs(archive_spec_dir) copy_if_exists(tpl_log, pjoin(archive_spec_dir, "output.log.spack.txt")) - + # Note: There should only be one of these per spec config_spec_logs = glob.glob(pjoin(build_and_test_root, "output.log.*-" + spec + ".configure.txt")) if len(config_spec_logs) > 0: @@ -296,7 +296,7 @@ def uberenv_build(prefix, spec, project_file, mirror_path): cmd += "--mirror=\"{0}\" ".format(mirror_path) if project_file: cmd += "--project-json=\"{0}\" ".format(project_file) - + spack_tpl_build_log = pjoin(prefix,"output.log.spack.tpl.build.%s.txt" % spec.replace(" ", "_")) print("[starting tpl install of spec %s]" % spec) print("[log file: %s]" % spack_tpl_build_log) @@ -322,7 +322,10 @@ def uberenv_build(prefix, spec, project_file, mirror_path): # helpers for testing a set of host configs ############################################################ -def build_and_test_host_config(test_root, host_config, report_to_stdout = False, extra_cmake_options = ""): +def build_and_test_host_config(test_root, host_config, + report_to_stdout = False, + extra_cmake_options = "", + build_type = "Debug"): host_config_root = get_host_config_root(host_config) # setup build and install dirs build_dir = pjoin(test_root,"build-%s" % host_config_root) @@ -335,7 +338,7 @@ def build_and_test_host_config(test_root, host_config, report_to_stdout = False, cfg_output_file = pjoin(test_root,"output.log.%s.configure.txt" % host_config_root) print("[starting configure of %s]" % host_config) print("[log file: %s]" % cfg_output_file) - res = sexe("python config-build.py -bp %s -ip %s -hc %s %s" % (build_dir, install_dir, host_config, extra_cmake_options), + res = sexe("python config-build.py -bp %s -ip %s -bt %s -hc %s %s" % (build_dir, install_dir, build_type, host_config, extra_cmake_options), output_file = cfg_output_file, echo=True) @@ -346,11 +349,11 @@ def build_and_test_host_config(test_root, host_config, report_to_stdout = False, if res != 0: print("[ERROR: Configure for host-config: %s failed]\n" % host_config) return res - + #### # build, test, and install #### - + # build the code bld_output_file = pjoin(build_dir,"output.log.make.txt") print("[starting build]") @@ -512,7 +515,13 @@ def build_and_test_host_config(test_root, host_config, report_to_stdout = False, return 0 -def build_and_test_host_configs(prefix, job_name, timestamp, use_generated_host_configs, report_to_stdout = False, extra_cmake_options = ""): +def build_and_test_host_configs(prefix, + job_name, + timestamp, + use_generated_host_configs, + report_to_stdout = False, + extra_cmake_options = "", + build_type = "Debug"): host_configs = get_host_configs_for_current_machine(prefix, use_generated_host_configs) if len(host_configs) == 0: log_failure(prefix,"[ERROR: No host configs found at %s]" % prefix) @@ -524,14 +533,17 @@ def build_and_test_host_configs(prefix, job_name, timestamp, use_generated_host_ test_root = get_build_and_test_root(prefix, timestamp) os.mkdir(test_root) - write_build_info(pjoin(test_root,"info.json"), job_name) + write_build_info(pjoin(test_root,"info.json"), job_name) ok = [] bad = [] for host_config in host_configs: build_dir = get_build_dir(test_root, host_config) start_time = time.time() - if build_and_test_host_config(test_root, host_config, report_to_stdout, extra_cmake_options) == 0: + if build_and_test_host_config(test_root, host_config, + report_to_stdout = report_to_stdout, + extra_cmake_options=extra_cmake_options, + build_type = build_type) == 0: ok.append(host_config) log_success(build_dir, job_name, timestamp) else: @@ -566,8 +578,7 @@ def build_and_test_host_configs(prefix, job_name, timestamp, use_generated_host_ def set_group_and_perms(directory): """ - Sets the proper group and access permissions of given input - directory. + Sets the proper group and access permissions of given input directory. """ skip = True @@ -657,7 +668,7 @@ def full_build_and_test_of_tpls(builds_dir, job_name, timestamp, spec, report_to src_build_failed = True else: print("[SUCCESS: Build and test of src vs tpls test passed.]\n") - + # set proper perms for installed tpls set_group_and_perms(prefix) @@ -861,7 +872,7 @@ def get_compiler_from_spec(spec): compiler = spec for c in ['~', '+']: index = compiler.find(c) - if index != -1: + if index != -1: compiler = compiler[:index] return compiler diff --git a/scripts/spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml b/scripts/spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml index f171775d65..835a1a8cb2 100644 --- a/scripts/spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml +++ b/scripts/spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml @@ -52,6 +52,12 @@ packages: externals: - spec: netlib-lapack@3.8.0 %clang@8.0.1_nvcc_xlf prefix: /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20/ + - spec: netlib-lapack@3.8.0 %clang@9.0.0_upstream_xlf + prefix: /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20/ + - spec: netlib-lapack@3.8.0 %xl@16.1.1_coral + prefix: /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20/ + - spec: netlib-lapack@3.8.0 %xl@16.1.1_nvcc + prefix: /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20/ # System level packages to not build autoconf: @@ -119,7 +125,7 @@ packages: hypre: version: [2.20.0] mfem: - variants: ~mpi~metis~zlib + version: [4.2.0] raja: variants: ~shared~examples~exercises scr: diff --git a/scripts/spack/configs/docker/ubuntu18/packages.yaml b/scripts/spack/configs/docker/ubuntu18/packages.yaml index 965c7b4b7e..b0acb98a9a 100644 --- a/scripts/spack/configs/docker/ubuntu18/packages.yaml +++ b/scripts/spack/configs/docker/ubuntu18/packages.yaml @@ -100,9 +100,12 @@ packages: variants: ~shared~test hdf5: variants: ~shared~mpi + hypre: + version: [2.20.0] # do shared mfem to allow PIC flag in mfem mfem: - variants: +shared~static~mpi~metis~zlib + version: [4.2.0] + variants: +shared~static raja: variants: ~shared~examples~exercises scr: diff --git a/scripts/spack/configs/toss_3_x86_64_ib/packages.yaml b/scripts/spack/configs/toss_3_x86_64_ib/packages.yaml index e8c347bae5..ee461e2a36 100644 --- a/scripts/spack/configs/toss_3_x86_64_ib/packages.yaml +++ b/scripts/spack/configs/toss_3_x86_64_ib/packages.yaml @@ -24,7 +24,7 @@ packages: lapack: [netlib-lapack] mpi: [mvapich2] -# LLNL toss3 CUDA +# LLNL toss3 CUDA cuda: buildable: false externals: @@ -132,7 +132,7 @@ packages: buildable: false externals: - spec: pdsh@2.33 - prefix: /usr + prefix: /usr # Globally lock version of third party libraries conduit: @@ -140,8 +140,10 @@ packages: variants: ~shared~test hdf5: variants: ~shared~mpi + hypre: + version: [2.20.0] mfem: - variants: ~mpi~metis~zlib + version: [4.2.0] raja: variants: ~shared~examples~exercises scr: diff --git a/scripts/spack/packages/raja/package.py b/scripts/spack/packages/raja/package.py index c6ea65dfd8..6aa9c62b1b 100644 --- a/scripts/spack/packages/raja/package.py +++ b/scripts/spack/packages/raja/package.py @@ -132,7 +132,12 @@ def initconfig_package_entries(self): entries.append(cmake_cache_path("camp_DIR", spec['camp'].prefix)) entries.append(cmake_cache_option("BUILD_SHARED_LIBS", '+shared' in spec)) entries.append(cmake_cache_option("ENABLE_EXAMPLES", '+examples' in spec)) - entries.append(cmake_cache_option("ENABLE_EXERCISES", '+exercises' in spec)) + if spec.satisfies('@0.14.0:'): + entries.append(cmake_cache_option("RAJA_ENABLE_EXERCISES", + '+exercises' in spec)) + else: + entries.append(cmake_cache_option("ENABLE_EXERCISES", + '+exercises' in spec)) # Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which # is used by the spack compiler wrapper. This can go away when BLT diff --git a/scripts/spack/packages/umpire/package.py b/scripts/spack/packages/umpire/package.py index 63be406c01..fcbe0209cc 100644 --- a/scripts/spack/packages/umpire/package.py +++ b/scripts/spack/packages/umpire/package.py @@ -195,6 +195,7 @@ def initconfig_package_entries(self): entries.append(cmake_cache_option( "ENABLE_BENCHMARKS", 'tests=benchmarks' in spec)) entries.append(cmake_cache_option("ENABLE_EXAMPLES", '+examples' in spec)) + entries.append(cmake_cache_option("ENABLE_DOCS", False)) entries.append(cmake_cache_option("BUILD_SHARED_LIBS", '+shared' in spec)) entries.append(cmake_cache_option("ENABLE_TESTS", 'tests=none' not in spec)) diff --git a/scripts/spack/specs.json b/scripts/spack/specs.json index b4ce4d41d7..065b34e5a9 100644 --- a/scripts/spack/specs.json +++ b/scripts/spack/specs.json @@ -17,7 +17,7 @@ [ "clang@9.0.0~cpp14+devtools+mfem+c2c", "clang@10.0.0~cpp14+devtools+mfem+c2c", "gcc@8.1.0~cpp14+devtools+mfem+c2c", - "gcc@8.1_no_fortran~cpp14~fortran+devtools+mfem+c2c", + "gcc@8.1_no_fortran~cpp14~fortran+devtools~mfem+c2c", "intel@18.0.2~cpp14~openmp+devtools+mfem+c2c", "intel@19.0.4~cpp14~openmp+devtools+mfem+c2c" ], @@ -31,7 +31,7 @@ "blueos_3_ppc64le_ib_p9": [ "clang@9.0.0_upstream_xlf~cpp14~openmp+devtools+mfem+c2c", "clang@8.0.1_nvcc_xlf~cpp14~openmp+devtools+mfem+cuda+c2c cuda_arch=70", - "gcc@7.3.1~cpp14+devtools+mfem+c2c", + "gcc@7.3.1~cpp14+devtools~mfem+c2c", "xl@16.1.1_coral~cpp14~openmp+devtools+mfem+c2c", "xl@16.1.1_nvcc~cpp14~openmp+devtools+mfem+cuda+c2c cuda_arch=70" ], diff --git a/src/axom/CMakeLists.txt b/src/axom/CMakeLists.txt index 3a5c997b96..4687f51ae8 100644 --- a/src/axom/CMakeLists.txt +++ b/src/axom/CMakeLists.txt @@ -31,8 +31,8 @@ axom_add_component(COMPONENT_NAME sidre DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONE axom_add_component(COMPONENT_NAME mint DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) axom_add_component(COMPONENT_NAME spin DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) axom_add_component(COMPONENT_NAME inlet DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) -axom_add_component(COMPONENT_NAME quest DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) axom_add_component(COMPONENT_NAME klee DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) +axom_add_component(COMPONENT_NAME quest DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) if(ENABLE_CUDA) # Force "early" device linking to avoid propagating an NVCC link dependency diff --git a/src/axom/core/Array.hpp b/src/axom/core/Array.hpp index b92edfa727..79c887dded 100644 --- a/src/axom/core/Array.hpp +++ b/src/axom/core/Array.hpp @@ -8,7 +8,6 @@ #include "axom/config.hpp" // for compile-time defines #include "axom/core/Macros.hpp" // for axom macros -#include "axom/core/memory_management.hpp" // for memory allocation functions #include "axom/core/utilities/Utilities.hpp" // for processAbort() #include "axom/core/Types.hpp" // for IndexType definition #include "axom/core/ArrayBase.hpp" @@ -20,24 +19,8 @@ namespace axom { -// TODO: Add this as a non-type template parameter to Array/View -// The intent is that there will also be a "Dynamic" or "Polymorphic" -// resource type -// enum MemoryResourceType -// { -// Host, -// Device, -// Unified, -// Pinned, -// Constant, -// File, -// NoOp, -// Shared, -// Unknown -// }; - // Forward declare the templated classes and operator function(s) -template +template class Array; /*! @@ -81,14 +64,15 @@ class Array; * \see https://en.cppreference.com/w/cpp/named_req * */ -template -class Array : public ArrayBase> +template +class Array : public ArrayBase> { public: static constexpr double DEFAULT_RESIZE_RATIO = 2.0; static constexpr IndexType MIN_DEFAULT_CAPACITY = 32; using value_type = T; - using ArrayIterator = ArrayIteratorBase>; + static constexpr MemorySpace space = SPACE; + using ArrayIterator = ArrayIteratorBase>; public: /// \name Native Storage Array Constructors @@ -120,10 +104,20 @@ class Array : public ArrayBase> * \post size() == num_elements * \post getResizeRatio() == DEFAULT_RESIZE_RATIO */ - template ::type* = nullptr> + template ::type* = nullptr> Array(IndexType num_elements, IndexType capacity = 0, - int allocator_id = axom::getDefaultAllocatorID()); + int allocator_id = axom::detail::getAllocatorID()); + + /// \overload + template ::type* = nullptr> + Array(IndexType num_elements, IndexType capacity = 0); /*! * \brief Generic constructor for an Array of arbitrary dimension @@ -137,7 +131,9 @@ class Array : public ArrayBase> * \post size() == num_elements * \post getResizeRatio() == DEFAULT_RESIZE_RATIO */ - template + template ::value>::type* = nullptr> Array(Args... args); /*! @@ -145,13 +141,22 @@ class Array : public ArrayBase> * * \param [in] allocator_id the ID of the allocator to use (optional) */ - Array(const Array& other, int allocator_id = axom::getDefaultAllocatorID()); + Array(const Array& other, + int allocator_id = axom::detail::getAllocatorID()); /*! * \brief Move constructor for an Array instance */ Array(Array&& other); + /*! + * \brief Constructor for transferring between memory spaces + * + * \param [in] other The array in a different memory space to copy from + */ + template + Array(const ArrayBase& other); + /// @} /// \name Array copy and move operators @@ -222,8 +227,8 @@ class Array : public ArrayBase> */ /// @{ - inline T* data() { return m_data; } - inline const T* data() const { return m_data; } + AXOM_HOST_DEVICE inline T* data() { return m_data; } + AXOM_HOST_DEVICE inline const T* data() const { return m_data; } /// @} @@ -271,7 +276,6 @@ class Array : public ArrayBase> * \note The size increases by 1. * */ - template ::type* = nullptr> void insert(IndexType pos, const T& value); /*! @@ -285,7 +289,6 @@ class Array : public ArrayBase> * * \return ArrayIterator to inserted value */ - template ::type* = nullptr> ArrayIterator insert(ArrayIterator pos, const T& value); /*! @@ -318,7 +321,6 @@ class Array : public ArrayBase> * * \return ArrayIterator to first element inserted (pos if n == 0) */ - template ::type* = nullptr> ArrayIterator insert(ArrayIterator pos, IndexType n, const T* values); /*! @@ -335,7 +337,6 @@ class Array : public ArrayBase> * * \pre pos <= m_num_elements. */ - template ::type* = nullptr> void insert(IndexType pos, IndexType n, const T& value); /*! @@ -354,11 +355,10 @@ class Array : public ArrayBase> * * \return ArrayIterator to first element inserted (pos if n == 0) */ - template ::type* = nullptr> ArrayIterator insert(ArrayIterator pos, IndexType n, const T& value); // Make the overload "visible" - using ArrayBase>::insert; + using ArrayBase>::insert; /*! * \brief Appends an Array to the end of the calling object @@ -371,7 +371,7 @@ class Array : public ArrayBase> template void append(const ArrayBase& other) { - ArrayBase>::insert(size(), other); + ArrayBase>::insert(size(), other); } /*! @@ -481,7 +481,7 @@ class Array : public ArrayBase> /*! * \brief Return the number of elements stored in the data array. */ - inline IndexType size() const { return m_num_elements; } + AXOM_HOST_DEVICE inline IndexType size() const { return m_num_elements; } /*! * \brief Update the number of elements stored in the data array. @@ -494,7 +494,7 @@ class Array : public ArrayBase> /*! * \brief Exchanges the contents of this Array with the other. */ - void swap(Array& other); + void swap(Array& other); /*! * \brief Get the ratio by which the capacity increases upon dynamic resize. @@ -587,15 +587,17 @@ using MCArray = Array; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -template -Array::Array() : m_allocator_id(axom::getDefaultAllocatorID()) +template +Array::Array() + : m_allocator_id(axom::detail::getAllocatorID()) { } -template -template -Array::Array(Args... args) - : ArrayBase>(args...) - , m_allocator_id(axom::getDefaultAllocatorID()) +template +template ::value>::type*> +Array::Array(Args... args) + : ArrayBase>(args...) + , m_allocator_id(axom::detail::getAllocatorID()) { static_assert(sizeof...(Args) == DIM, "Array size must match number of dimensions"); @@ -606,32 +608,62 @@ Array::Array(Args... args) } //------------------------------------------------------------------------------ -template -template ::type*> -Array::Array(IndexType num_elements, IndexType capacity, int allocator_id) +template +template ::type*> +Array::Array(IndexType num_elements, + IndexType capacity, + int allocator_id) : m_allocator_id(allocator_id) { initialize(num_elements, capacity); } //------------------------------------------------------------------------------ -template -Array::Array(const Array& other, int allocator_id) - : ArrayBase>( - static_cast>&>(other)) - , m_allocator_id(allocator_id) +template +template ::type*> +Array::Array(IndexType num_elements, IndexType capacity) + : m_allocator_id(axom::detail::getAllocatorID()) +{ + initialize(num_elements, capacity); +} + +//------------------------------------------------------------------------------ +template +Array::Array(const Array& other, int allocator_id) + : ArrayBase>( + static_cast>&>(other)) + , m_allocator_id(SPACE == MemorySpace::Dynamic + ? allocator_id + : axom::detail::getAllocatorID()) { +// We can't template/SFINAE away the allocator_id parameter since this is a copy +// constructor, so we just ignore the allocator ID if the memory space isn't Dynamic. +// We can warn the user that their input is being ignored, though. +#ifdef AXOM_DEBUG + if(SPACE != MemorySpace::Dynamic && + allocator_id != axom::detail::getAllocatorID()) + { + std::cerr << "Incorrect allocator ID was provided for an Array object with " + "explicit memory space\n"; + } +#endif initialize(other.size(), other.capacity()); axom::copy(m_data, other.data(), m_num_elements * sizeof(T)); } //------------------------------------------------------------------------------ -template -Array::Array(Array&& other) - : ArrayBase>( - static_cast>&&>(std::move(other))) +template +Array::Array(Array&& other) + : ArrayBase>( + static_cast>&&>(std::move(other))) , m_resize_ratio(0.0) - , m_allocator_id(axom::getDefaultAllocatorID()) + , m_allocator_id(axom::detail::getAllocatorID()) { m_data = other.m_data; m_num_elements = other.m_num_elements; @@ -646,8 +678,24 @@ Array::Array(Array&& other) } //------------------------------------------------------------------------------ -template -Array::~Array() +template +template +Array::Array(const ArrayBase& other) + : ArrayBase>(other) + , m_allocator_id(axom::detail::getAllocatorID()) +{ + initialize(static_cast(other).size(), + static_cast(other).size()); + // axom::copy is aware of pointers registered in Umpire, so this will handle + // the transfer between memory spaces + axom::copy(m_data, + static_cast(other).data(), + m_num_elements * sizeof(T)); +} + +//------------------------------------------------------------------------------ +template +Array::~Array() { if(m_data != nullptr) { @@ -658,8 +706,8 @@ Array::~Array() } //------------------------------------------------------------------------------ -template -inline void Array::fill(const T& value) +template +inline void Array::fill(const T& value) { for(IndexType i = 0; i < m_num_elements; i++) { @@ -668,8 +716,8 @@ inline void Array::fill(const T& value) } //------------------------------------------------------------------------------ -template -inline void Array::set(const T* elements, IndexType n, IndexType pos) +template +inline void Array::set(const T* elements, IndexType n, IndexType pos) { assert(elements != nullptr); assert(pos >= 0); @@ -682,8 +730,8 @@ inline void Array::set(const T* elements, IndexType n, IndexType pos) } //------------------------------------------------------------------------------ -template -inline void Array::clear() +template +inline void Array::clear() { // This most likely needs to be a call to erase() instead. for(IndexType i = 0; i < m_num_elements; ++i) @@ -695,29 +743,29 @@ inline void Array::clear() } //------------------------------------------------------------------------------ -template -template ::type*> -inline void Array::insert(IndexType pos, const T& value) +template +inline void Array::insert(IndexType pos, const T& value) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); reserveForInsert(1, pos); m_data[pos] = value; } //------------------------------------------------------------------------------ -template -template ::type*> -inline typename Array::ArrayIterator Array::insert( - Array::ArrayIterator pos, +template +inline typename Array::ArrayIterator Array::insert( + Array::ArrayIterator pos, const T& value) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); assert(pos >= begin() && pos <= end()); insert(pos - begin(), value); return pos; } //------------------------------------------------------------------------------ -template -inline void Array::insert(IndexType pos, IndexType n, const T* values) +template +inline void Array::insert(IndexType pos, IndexType n, const T* values) { assert(values != nullptr); reserveForInsert(n, pos); @@ -728,23 +776,23 @@ inline void Array::insert(IndexType pos, IndexType n, const T* values) } //------------------------------------------------------------------------------ -template -template ::type*> -inline typename Array::ArrayIterator Array::insert( - Array::ArrayIterator pos, +template +inline typename Array::ArrayIterator Array::insert( + Array::ArrayIterator pos, IndexType n, const T* values) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); assert(pos >= begin() && pos <= end()); insert(pos - begin(), n, values); return pos; } //------------------------------------------------------------------------------ -template -template ::type*> -inline void Array::insert(IndexType pos, IndexType n, const T& value) +template +inline void Array::insert(IndexType pos, IndexType n, const T& value) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); reserveForInsert(n, pos); for(IndexType i = 0; i < n; ++i) { @@ -753,22 +801,22 @@ inline void Array::insert(IndexType pos, IndexType n, const T& value) } //------------------------------------------------------------------------------ -template -template ::type*> -inline typename Array::ArrayIterator Array::insert( - Array::ArrayIterator pos, +template +inline typename Array::ArrayIterator Array::insert( + Array::ArrayIterator pos, IndexType n, const T& value) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); assert(pos >= begin() && pos <= end()); insert(pos - begin(), n, value); return pos; } //------------------------------------------------------------------------------ -template -inline typename Array::ArrayIterator Array::erase( - Array::ArrayIterator pos) +template +inline typename Array::ArrayIterator Array::erase( + Array::ArrayIterator pos) { assert(pos >= begin() && pos < end()); int counter = 0; @@ -786,10 +834,10 @@ inline typename Array::ArrayIterator Array::erase( } //------------------------------------------------------------------------------ -template -inline typename Array::ArrayIterator Array::erase( - Array::ArrayIterator first, - Array::ArrayIterator last) +template +inline typename Array::ArrayIterator Array::erase( + Array::ArrayIterator first, + Array::ArrayIterator last) { assert(first >= begin() && first < end()); assert(last >= first && last <= end()); @@ -827,19 +875,19 @@ inline typename Array::ArrayIterator Array::erase( } //------------------------------------------------------------------------------ -template +template template -inline void Array::emplace(IndexType pos, Args&&... args) +inline void Array::emplace(IndexType pos, Args&&... args) { reserveForInsert(1, pos); m_data[pos] = std::move(T(std::forward(args)...)); } //------------------------------------------------------------------------------ -template +template template -inline typename Array::ArrayIterator Array::emplace( - Array::ArrayIterator pos, +inline typename Array::ArrayIterator Array::emplace( + Array::ArrayIterator pos, Args&&... args) { assert(pos >= begin() && pos <= end()); @@ -848,9 +896,9 @@ inline typename Array::ArrayIterator Array::emplace( } //------------------------------------------------------------------------------ -template +template template -inline void Array::resize(Args... args) +inline void Array::resize(Args... args) { static_assert(sizeof...(Args) == DIM, "Array size must match number of dimensions"); @@ -859,8 +907,8 @@ inline void Array::resize(Args... args) assert(detail::allNonNegative(tmp_args)); const auto new_num_elements = detail::packProduct(tmp_args); - static_cast>&>(*this) = - ArrayBase> {static_cast(args)...}; + static_cast>&>(*this) = + ArrayBase> {static_cast(args)...}; if(new_num_elements > m_capacity) { @@ -871,10 +919,10 @@ inline void Array::resize(Args... args) } //------------------------------------------------------------------------------ -template -inline void Array::swap(Array& other) +template +inline void Array::swap(Array& other) { - ArrayBase>::swap(other); + ArrayBase>::swap(other); T* temp_data = m_data; IndexType temp_num_elements = m_num_elements; IndexType temp_capacity = m_capacity; @@ -892,8 +940,9 @@ inline void Array::swap(Array& other) } //------------------------------------------------------------------------------ -template -inline void Array::initialize(IndexType num_elements, IndexType capacity) +template +inline void Array::initialize(IndexType num_elements, + IndexType capacity) { assert(num_elements >= 0); @@ -917,8 +966,8 @@ inline void Array::initialize(IndexType num_elements, IndexType capacity } //------------------------------------------------------------------------------ -template -inline T* Array::reserveForInsert(IndexType n, IndexType pos) +template +inline T* Array::reserveForInsert(IndexType n, IndexType pos) { assert(n >= 0); assert(pos >= 0); @@ -947,8 +996,8 @@ inline T* Array::reserveForInsert(IndexType n, IndexType pos) } //------------------------------------------------------------------------------ -template -inline void Array::updateNumElements(IndexType new_num_elements) +template +inline void Array::updateNumElements(IndexType new_num_elements) { assert(new_num_elements >= 0); assert(new_num_elements <= m_capacity); @@ -956,8 +1005,8 @@ inline void Array::updateNumElements(IndexType new_num_elements) } //------------------------------------------------------------------------------ -template -inline void Array::setCapacity(IndexType new_capacity) +template +inline void Array::setCapacity(IndexType new_capacity) { assert(new_capacity >= 0); @@ -973,8 +1022,8 @@ inline void Array::setCapacity(IndexType new_capacity) } //------------------------------------------------------------------------------ -template -inline void Array::dynamicRealloc(IndexType new_num_elements) +template +inline void Array::dynamicRealloc(IndexType new_num_elements) { assert(m_resize_ratio >= 1.0); IndexType new_capacity = new_num_elements * m_resize_ratio + 0.5; diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index 52358fa9d4..04cc0d0b3c 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -8,13 +8,15 @@ #include "axom/config.hpp" // for compile-time defines #include "axom/core/Macros.hpp" // for axom macros +#include "axom/core/memory_management.hpp" // for memory allocation functions #include "axom/core/utilities/Utilities.hpp" // for processAbort() #include "axom/core/Types.hpp" // for IndexType definition +#include "axom/core/StackArray.hpp" +#include "axom/core/numerics/matvecops.hpp" // for dot_product // C/C++ includes -#include // for std::array #include // for std::cerr and std::ostream -#include // for std::inner_product +#include // for std::accumulate namespace axom { @@ -94,6 +96,19 @@ class ArrayBase updateStrides(); } + /*! + * \brief Copy constructor for arrays of different type + * Because the element type (T) and dimension (DIM) are still locked down, + * this function is nominally used for copying ArrayBase metadata from + * Array <-> ArrayView and/or Array-like objects whose data are in different + * memory spaces + */ + template + ArrayBase(const ArrayBase& other) + : m_dims(other.shape()) + , m_strides(other.strides()) + { } + /*! * \brief Dimension-aware accessor, returns a reference to the given value. * @@ -106,22 +121,20 @@ class ArrayBase */ template ::type> - T& operator()(Args... args) + AXOM_HOST_DEVICE T& operator()(Args... args) { - IndexType indices[] = {static_cast(args)...}; - IndexType idx = - std::inner_product(indices, indices + DIM, m_strides.begin(), 0); + const IndexType indices[] = {static_cast(args)...}; + const IndexType idx = numerics::dot_product(indices, m_strides.begin(), DIM); assert(inBounds(idx)); return asDerived().data()[idx]; } /// \overload template ::type> - const T& operator()(Args... args) const + AXOM_HOST_DEVICE const T& operator()(Args... args) const { - IndexType indices[] = {static_cast(args)...}; - IndexType idx = - std::inner_product(indices, indices + DIM, m_strides.begin(), 0); + const IndexType indices[] = {static_cast(args)...}; + const IndexType idx = numerics::dot_product(indices, m_strides.begin(), DIM); assert(inBounds(idx)); return asDerived().data()[idx]; } @@ -138,13 +151,13 @@ class ArrayBase * * \pre 0 <= idx < m_num_elements */ - T& operator[](const IndexType idx) + AXOM_HOST_DEVICE T& operator[](const IndexType idx) { assert(inBounds(idx)); return asDerived().data()[idx]; } /// \overload - const T& operator[](const IndexType idx) const + AXOM_HOST_DEVICE const T& operator[](const IndexType idx) const { assert(inBounds(idx)); return asDerived().data()[idx]; @@ -159,10 +172,16 @@ class ArrayBase } /// \brief Returns the dimensions of the Array - const std::array& shape() const { return m_dims; } + AXOM_HOST_DEVICE const StackArray& shape() const + { + return m_dims; + } /// \brief Returns the strides of the Array - const std::array& strides() const { return m_strides; } + AXOM_HOST_DEVICE const StackArray& strides() const + { + return m_strides; + } /*! * \brief Appends an Array to the end of the calling object @@ -221,9 +240,12 @@ class ArrayBase private: /// \brief Returns a reference to the Derived CRTP object - see https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/ - ArrayType& asDerived() { return static_cast(*this); } + AXOM_HOST_DEVICE ArrayType& asDerived() + { + return static_cast(*this); + } /// \overload - const ArrayType& asDerived() const + AXOM_HOST_DEVICE const ArrayType& asDerived() const { return static_cast(*this); } @@ -232,7 +254,7 @@ class ArrayBase /// @{ /*! \brief Test if idx is within bounds */ - inline bool inBounds(IndexType idx) const + AXOM_HOST_DEVICE inline bool inBounds(IndexType idx) const { return idx >= 0 && idx < asDerived().size(); } @@ -240,9 +262,9 @@ class ArrayBase protected: /// \brief The sizes (extents?) in each dimension - std::array m_dims; + StackArray m_dims; /// \brief The strides in each dimension - std::array m_strides; + StackArray m_strides; }; /// \brief Array implementation specific to 1D Arrays @@ -252,6 +274,11 @@ class ArrayBase public: ArrayBase(IndexType = 0) { } + // Empy implementation because no member data + template + ArrayBase(const ArrayBase&) + { } + /*! * \brief Push a value to the back of the array. * @@ -282,9 +309,11 @@ class ArrayBase void emplace_back(Args&&... args); /// \brief Returns the dimensions of the Array - // FIXME: std::array is used for consistency with multidim case, should we just return the scalar? // Double curly braces needed for C++11 prior to resolution of CWG issue 1720 - std::array shape() const { return {{asDerived().size()}}; } + AXOM_HOST_DEVICE StackArray shape() const + { + return {{asDerived().size()}}; + } /*! * \brief Accessor, returns a reference to the given value. @@ -297,13 +326,13 @@ class ArrayBase * \pre 0 <= idx < m_num_elements */ /// @{ - T& operator[](const IndexType idx) + AXOM_HOST_DEVICE T& operator[](const IndexType idx) { assert(inBounds(idx)); return asDerived().data()[idx]; } /// \overload - const T& operator[](const IndexType idx) const + AXOM_HOST_DEVICE const T& operator[](const IndexType idx) const { assert(inBounds(idx)); return asDerived().data()[idx]; @@ -337,9 +366,12 @@ class ArrayBase private: /// \brief Returns a reference to the Derived CRTP object - see https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/ - ArrayType& asDerived() { return static_cast(*this); } + AXOM_HOST_DEVICE ArrayType& asDerived() + { + return static_cast(*this); + } /// \overload - const ArrayType& asDerived() const + AXOM_HOST_DEVICE const ArrayType& asDerived() const { return static_cast(*this); } @@ -348,7 +380,7 @@ class ArrayBase /// @{ /*! \brief Test if idx is within bounds */ - inline bool inBounds(IndexType idx) const + AXOM_HOST_DEVICE inline bool inBounds(IndexType idx) const { return idx >= 0 && idx < asDerived().size(); } @@ -368,12 +400,13 @@ template inline std::ostream& print(std::ostream& os, const ArrayBase& array) { -#if defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) - // FIXME: Re-add check for umpire::resource::Constant as well, but this will crash - // if there exists no allocator for Constant memory. Is there a more fine-grained - // approach we can use to see what allocators are available before trying to get their IDs? - if(static_cast(array).getAllocatorID() == - axom::getUmpireResourceAllocatorID(umpire::resource::Device)) +#if defined(AXOM_USE_UMPIRE) && defined(UMPIRE_ENABLE_DEVICE) + const int alloc_id = static_cast(array).getAllocatorID(); + if(alloc_id == axom::getUmpireResourceAllocatorID(umpire::resource::Device) + #ifdef UMPIRE_ENABLE_CONST + || alloc_id == axom::getUmpireResourceAllocatorID(umpire::resource::Constant) + #endif + ) { std::cerr << "Cannot print Array allocated on the GPU" << std::endl; utilities::processAbort(); @@ -477,6 +510,25 @@ bool allNonNegative(const T (&arr)[N]) return true; } +/// \brief Indirection needed to dodge an MSVC compiler bug +template +struct all_types_are_integral_impl : std::true_type +{ }; + +template +struct all_types_are_integral_impl +{ + static constexpr bool value = std::is_integral::value && + all_types_are_integral_impl::value; +}; + +/// \brief Checks if all types in a parameter pack are integral +template +struct all_types_are_integral +{ + static constexpr bool value = all_types_are_integral_impl::value; +}; + } // namespace detail } /* namespace axom */ diff --git a/src/axom/core/ArrayView.hpp b/src/axom/core/ArrayView.hpp index 9f709a0d39..c92fbf16c6 100644 --- a/src/axom/core/ArrayView.hpp +++ b/src/axom/core/ArrayView.hpp @@ -13,7 +13,7 @@ namespace axom { // Forward declare the templated classes and operator function(s) -template +template class ArrayView; /// \name ArrayView to wrap a pointer and provide indexing semantics @@ -30,16 +30,17 @@ class ArrayView; * \tparam DIM The dimension of the array. * */ -template -class ArrayView : public ArrayBase> +template +class ArrayView : public ArrayBase> { public: using value_type = T; static constexpr int dimension = DIM; - using ArrayViewIterator = ArrayIteratorBase>; + static constexpr MemorySpace space = SPACE; + using ArrayViewIterator = ArrayIteratorBase>; /// \brief Default constructor - ArrayView() = default; + ArrayView() : m_allocator_id(axom::detail::getAllocatorID()) { } /*! * \brief Generic constructor for an ArrayView of arbitrary dimension with external data @@ -54,10 +55,24 @@ class ArrayView : public ArrayBase> template ArrayView(T* data, Args... args); + /*! + * \brief Constructor for transferring between memory spaces + * + * \param [in] other The array in a different memory space to copy from + * + * \note The parameter is non-const because \a other can be modified through the constructed View + * + * \note This constructor is left implicit to allow for convenient function calls that convert + * from \p Array -> \p ArrayView or from dynamic memory spaces to an \p ArrayView of explicitly specified + * space. + */ + template + ArrayView(ArrayBase& other); + /*! * \brief Return the number of elements stored in the data array. */ - inline IndexType size() const { return m_num_elements; } + inline AXOM_HOST_DEVICE IndexType size() const { return m_num_elements; } /*! * \brief Returns an ArrayViewIterator to the first element of the Array @@ -83,23 +98,30 @@ class ArrayView : public ArrayBase> */ /// @{ - inline T* data() { return m_data; } - inline const T* data() const { return m_data; } + AXOM_HOST_DEVICE inline T* data() + { +#ifdef AXOM_DEVICE_CODE + static_assert(SPACE != MemorySpace::Constant, + "Cannot modify Constant memory from device code"); +#endif + return m_data; + } + AXOM_HOST_DEVICE inline const T* data() const { return m_data; } /// @} /*! * \brief Get the ID for the umpire allocator - * - * FIXME: This is just a stand-in impl, extend this class to support wrapping of GPU pointers */ - int getAllocatorID() const { return axom::getDefaultAllocatorID(); } + int getAllocatorID() const { return m_allocator_id; } private: T* m_data = nullptr; /// \brief The full number of elements in the array /// i.e., 3 for a 1D Array of size 3, 9 for a 3x3 2D array, etc IndexType m_num_elements = 0; + /// \brief The allocator ID for the memory space in which m_data was allocated + int m_allocator_id; }; /// \brief Helper alias for multi-component arrays @@ -111,17 +133,59 @@ using MCArrayView = ArrayView; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -template +template template -ArrayView::ArrayView(T* data, Args... args) - : ArrayBase>(args...) +ArrayView::ArrayView(T* data, Args... args) + : ArrayBase>(args...) , m_data(data) + , m_allocator_id(axom::detail::getAllocatorID()) { static_assert(sizeof...(Args) == DIM, "Array size must match number of dimensions"); // Intel hits internal compiler error when casting as part of function call IndexType tmp_args[] = {args...}; m_num_elements = detail::packProduct(tmp_args); + +#ifdef AXOM_USE_UMPIRE + // If we have Umpire, we can try and see what space the pointer is allocated in + // Probably not worth checking this if SPACE != Dynamic, we *could* error out + // if e.g., the user gives a host pointer to ArrayView, but even + // Thrust doesn't guard against this. + + // FIXME: Is it worth trying to get rid of this at compile time? + // (using a workaround since we don't have "if constexpr") + if(SPACE == MemorySpace::Dynamic) + { + auto& rm = umpire::ResourceManager::getInstance(); + if(rm.hasAllocator(data)) + { + auto alloc = rm.getAllocator(data); + m_allocator_id = alloc.getId(); + } + } +#endif +} + +//------------------------------------------------------------------------------ +template +template +ArrayView::ArrayView(ArrayBase& other) + : ArrayBase>(other) + , m_data(static_cast(other).data()) + , m_num_elements(static_cast(other).size()) + , m_allocator_id(static_cast(other).getAllocatorID()) +{ +#ifdef AXOM_DEBUG + // If it's not dynamic, the allocator ID from the argument array has to match the template param. + // If that's not the case then things have gone horribly wrong somewhere. + if(SPACE != MemorySpace::Dynamic && + m_allocator_id != axom::detail::getAllocatorID()) + { + std::cerr << "Input argument allocator does not match the explicitly " + "provided memory space\n"; + utilities::processAbort(); + } +#endif } } /* namespace axom */ diff --git a/src/axom/core/CMakeLists.txt b/src/axom/core/CMakeLists.txt index da509ac69e..e3c55b3ce0 100644 --- a/src/axom/core/CMakeLists.txt +++ b/src/axom/core/CMakeLists.txt @@ -107,6 +107,12 @@ blt_add_library( NAME core OBJECT TRUE ) +# Add the AXOM_DEBUG compile definition, if non-empty +if(AXOM_DEBUG_DEFINE_STRING) + blt_add_target_definitions(TO core SCOPE PUBLIC TARGET_DEFINITIONS "${AXOM_DEBUG_DEFINE_STRING}") +endif() + + axom_write_unified_header( NAME core HEADERS ${core_headers} ) diff --git a/src/axom/core/Macros.hpp b/src/axom/core/Macros.hpp index 156987dc28..e7ae1b7dde 100644 --- a/src/axom/core/Macros.hpp +++ b/src/axom/core/Macros.hpp @@ -114,20 +114,19 @@ /*! * - * \def AXOM_NOT_USED(x) - * \brief Macro used to silence compiler warnings in methods with unused - * arguments. + * \def AXOM_UNUSED_PARAM(x) + * \brief Macro used to silence compiler warnings in methods with unused arguments. * \note The intent is to use this macro in the function signature. For example: * \code * - * void my_function(int x, int AXOM_NOT_USED(y)) + * void my_function(int x, int AXOM_UNUSED_PARAM(y)) * { * // my implementation * } * * \endcode */ -#define AXOM_NOT_USED(x) +#define AXOM_UNUSED_PARAM(x) /*! * @@ -165,7 +164,7 @@ /*! * \def AXOM_DEBUG_PARAM(x) * \brief Macro used to silence compiler warnings about parameters - * that are used in debug code but not in release code. + * that are only used when AXOM_DEBUG is defined * \note Default values are ok * \code * diff --git a/src/axom/core/StackArray.hpp b/src/axom/core/StackArray.hpp index 5d23b1cfad..780dd9de1a 100644 --- a/src/axom/core/StackArray.hpp +++ b/src/axom/core/StackArray.hpp @@ -57,9 +57,57 @@ struct StackArray /// @} + /*! + * \brief Begin/end iterators + */ + /// @{ + + AXOM_HOST_DEVICE T* begin() noexcept { return &m_data[0]; } + AXOM_HOST_DEVICE const T* begin() const noexcept { return &m_data[0]; } + + AXOM_HOST_DEVICE T* end() noexcept { return &m_data[0] + N; } + AXOM_HOST_DEVICE const T* end() const noexcept { return &m_data[0] + N; } + + /// @} + T m_data[N]; }; +/*! + * \brief Equality comparison operator for StackArray + * + * \param [in] lhs left StackArray to compare + * \param [in] rhs right StackArray to compare + * \return true if the StackArrays have the same element values + */ +template +AXOM_HOST_DEVICE bool operator==(const StackArray& lhs, + const StackArray& rhs) +{ + for(int i = 0; i < N; i++) + { + if(lhs[i] != rhs[i]) + { + return false; + } + } + return true; +} + +/*! + * \brief Inequality comparison operator for StackArray + * + * \param [in] lhs left StackArray to compare + * \param [in] rhs right StackArray to compare + * \return true if the StackArrays have different element values + */ +template +AXOM_HOST_DEVICE bool operator!=(const StackArray& lhs, + const StackArray& rhs) +{ + return !(lhs == rhs); +} + } /* namespace axom */ #endif /* AXOM_STACKARRAY_HPP_ */ diff --git a/src/axom/core/docs/sphinx/core_containers.rst b/src/axom/core/docs/sphinx/core_containers.rst index bc32d9b794..e4d96b822e 100644 --- a/src/axom/core/docs/sphinx/core_containers.rst +++ b/src/axom/core/docs/sphinx/core_containers.rst @@ -17,6 +17,10 @@ Axom Core contains the ``Array``, ``ArrayView``, and ``StackArray`` classes. Among other things, these data containers facilitate porting code that uses ``std::vector`` to GPUs. +##### +Array +##### + ``Array`` is a multidimensional contiguous container template. In the 1-dimensional case, this class behaves similar to ``std::vector``. In higher dimensions, some vector-like functionality, such as ``push_back``, are not @@ -37,7 +41,7 @@ by default. To return all extra memory, an application can call Use ``reserve()`` when the number of nodes is known a priori, or use a constructor that takes an actual size and capacity when possible. -.. note:: The Array destructor deallocates and returns all memory associated +.. note:: The ``Array`` destructor deallocates and returns all memory associated with it to the system. Here's an example showing how to use ``Array`` instead of ``std::vector``. @@ -79,6 +83,10 @@ The output of this example is:: [8, 0, -1] ] +######### +ArrayView +######### + It is also often useful to wrap an external, user-supplied buffer without taking ownership of the data. For this purpose Axom provides the ``ArrayView`` class, which is a lightweight wrapper over a buffer that provides one- or multi-dimensional indexing/reshaping semantics. @@ -137,6 +145,106 @@ The output of this example is:: Range-based for loop over ArrayView c yields: 1 5 6 9 1 4 Standard for loop over ArrayView c yields: 1 5 6 9 1 4 +######################## +Using Arrays in GPU Code +######################## + +Instead of writing kernels and device functions that operate on raw pointers, we can use ``ArrayView`` +in device code. The basic "workflow" for this process is as follows: + + 1. Create an ``Array`` allocated in device-accessible memory via either specifying an allocator ID + or using a class template parameter for the desired memory space. + 2. Write a kernel that accepts an ``ArrayView`` parameter **by value**, not by reference or pointer. + 3. Create an ``ArrayView`` from the ``Array`` to call the function. For non-templated kernels + an implicit conversion is provided. + + +The full template signature for ``Array`` (``ArrayView`` has an analogous signature) is +``Array``. Of particular interest +is the last parameter, which specifies the memory space in which the array's data are allocated. +The default, ``Dynamic``, means that the memory space is set via an allocator ID at runtime. + +.. note:: Allocating ``Array`` s in different memory spaces is only possible when Umpire is available. + To learn more about Umpire, see the `Umpire documentation `_ + +Setting the ``MemorySpace`` to an option other than ``Dynamic`` (for example, ``MemorySpace::Device``) provides +a compile-time guarantee that data can always be accessed from a GPU. "Locking down" the memory space at +compile time can help to prevent illegal memory accesses and segmentation faults when pointers are dereferenced +from the wrong execution space. + +To summarize, there are a couple different options for creating an ``ArrayView``. +Consider a function that takes as an argument an ``ArrayView`` on the device: + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _basic_array_function_start + :end-before: _basic_array_function_end + :language: C++ + +To create an argument to this function we can select the space either at runtime or at compile-time as follows: + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _basic_array_device_create_start + :end-before: _basic_array_device_create_end + :language: C++ + +The first way we can create the required ``ArrayView`` is by implicit conversion, which also simplifies +the process of "locking down" a ``MemorySpace::Dynamic`` array to an explicit memory space - ``MemorySpace:Device`` in this case. + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _basic_array_device_implicit_start + :end-before: _basic_array_device_implicit_end + :language: C++ + +.. warning:: If we had attempted to convert from a ``MemorySpace::Dynamic`` array that had been allocated in host memory, + for example, an error would be produced at runtime. + +We can also explicitly construct the ``ArrayView`` before calling the function. + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _basic_array_device_explicit_start + :end-before: _basic_array_device_explicit_end + :language: C++ + +A more realistic example of this functionality involves a GPU kernel requiring +that its argument arrays be allocated in a specific memory space. +To illustrate how different memory spaces can be required, the following kernel requires that its +input arrays ``A`` and ``B`` are in unified memory and its output array ``C`` is in device memory. + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _cuda_kernel_start + :end-before: _cuda_kernel_end + :language: C++ + +The following snippet illustrates how one would create and initialize the inputs/outputs to this kernel. + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _cuda_array_create_start + :end-before: _cuda_array_create_end + :language: C++ + +.. note:: Unless the Dynamic memory space is in use, the ``Array`` constructor will + ignore an allocator ID that doesn't match its memory space, and in debug + builds will print a warning at runtime. + +We can now launch the kernel and display the results via a transfer back to host-accessible memory: + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _cuda_array_call_start + :end-before: _cuda_array_call_end + :language: C++ + +If RAJA is available, we can also use Axom's acceleration utilities to perform an operation on the GPU +via a lambda: + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _array_w_raja_start + :end-before: _array_w_raja_end + :language: C++ + +########## +StackArray +########## + The ``StackArray`` class is a work-around for a limitation in older versions of the nvcc compiler, which do not capture arrays on the stack in device lambdas. More details are in the API documentation and in the tests. diff --git a/src/axom/core/examples/CMakeLists.txt b/src/axom/core/examples/CMakeLists.txt index c9a7945890..9100cb8c87 100644 --- a/src/axom/core/examples/CMakeLists.txt +++ b/src/axom/core/examples/CMakeLists.txt @@ -34,12 +34,19 @@ foreach(example_source ${example_sources}) endforeach() if(ENABLE_CUDA) - blt_add_executable( - NAME ${exe_name}_cuda_on_ex + blt_add_executable( + NAME core_acceleration_cuda_on_ex SOURCES core_acceleration.cpp OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY} DEPENDS_ON axom cuda FOLDER axom/core/examples ) + + blt_add_executable( + NAME core_containers_cuda_on_ex + SOURCES core_containers.cpp + OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY} + DEPENDS_ON axom cuda + FOLDER axom/core/examples ) endif() blt_add_executable( diff --git a/src/axom/core/examples/core_acceleration.cpp b/src/axom/core/examples/core_acceleration.cpp index eadd6f0300..8040f5a8e9 100644 --- a/src/axom/core/examples/core_acceleration.cpp +++ b/src/axom/core/examples/core_acceleration.cpp @@ -144,7 +144,7 @@ void demoAxomExecution() #endif } -int main(int AXOM_NOT_USED(argc), char **AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char **AXOM_UNUSED_PARAM(argv)) { demoMemoryManageBasic(); demoAxomExecution(); diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index 19ae70b310..fb7f84c6b5 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -22,15 +22,9 @@ #include "axom/core/Macros.hpp" #include "axom/core/memory_management.hpp" -#ifdef WIN32 - #include "windows.h" -void sleep(int numSeconds) -{ - int numMilliSecs = numSeconds * 1000; - Sleep(numMilliSecs); -} -#else - #include // for sleep() +#ifdef AXOM_USE_RAJA + #include "axom/core/execution/execution_space.hpp" + #include "axom/core/execution/for_all.hpp" #endif // C/C++ includes @@ -176,8 +170,137 @@ void demoArrayBasic() // _iteration_end } -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +// The following example requires CUDA + Umpire + unified memory +// FIXME: HIP +#if defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) && \ + defined(__CUDACC__) && defined(UMPIRE_ENABLE_UM) + #define AXOM_CONTAINERS_EXAMPLE_ON_DEVICE +#endif + +#ifdef AXOM_CONTAINERS_EXAMPLE_ON_DEVICE + +// _cuda_kernel_start +// Aliases used for convenience +using UnifiedIntArrayView = axom::ArrayView; +using DeviceIntArrayView = axom::ArrayView; + +__global__ void add(const UnifiedIntArrayView A, + const UnifiedIntArrayView B, + DeviceIntArrayView C) +{ + for(int i = 0; i < A.size(); i++) + { + C[i] = A[i] + B[i]; + } +} +// _cuda_kernel_end + +// _basic_array_function_start +void takesDeviceArrayView(axom::ArrayView) { } +// _basic_array_function_end +#endif + +void demoArrayDevice() +{ +#ifdef AXOM_CONTAINERS_EXAMPLE_ON_DEVICE + // _basic_array_device_create_start + constexpr int N = 10; + // An device array can be constructed by either specifying the corresponding allocator ID... + const int device_allocator_id = axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Device); + axom::Array device_array_dynamic(N, N, device_allocator_id); + // ...or by providing the memory space via template parameter: + axom::Array device_array_template(N); + // _basic_array_device_create_end + + // _basic_array_device_implicit_start + takesDeviceArrayView(device_array_dynamic); + takesDeviceArrayView(device_array_template); + // _basic_array_device_implicit_end + + // _basic_array_device_explicit_start + axom::ArrayView view_of_dynamic_array( + device_array_dynamic); + takesDeviceArrayView(view_of_dynamic_array); + axom::ArrayView view_of_template_array( + device_array_template); + takesDeviceArrayView(view_of_template_array); + // _basic_array_device_explicit_end + + // _cuda_array_create_start + const int allocator_id = axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Unified); + + // The last template parameter specifies a memory space. + // Its default value is Dynamic, which lets the user specify the + // memory space at runtime with a memory allocator ID. The + // third constructor parameter specifies the allocator. + // If this argument is not provided host memory will be allocated. + axom::Array A_dynamic(N, N, allocator_id); + + // We also have the option to "lock down" the memory space to allow for + // compile-time guarantees against dereferencing pointers in the wrong memory space. + axom::Array B_unified(N); + + // Despite having different types, both of these arrays are in unified memory. + for(int i = 0; i < N; i++) + { + A_dynamic[i] = i * 5; + B_unified[i] = i * 2; + } + + // The result array is allocated in device memory + axom::Array C_device(N); + + // _cuda_array_create_end + // _cuda_array_call_start + + // Passing by reference is not possible for CUDA kernels, so the three arrays + // are converted to corresponding ArrayViews that are "shallow copies" of the + // original Array. + // Note that even though A's memory space has not been locked down at compile time, + // we are able to pass it as an argument - it will be implicitly converted to an ArrayView + // of the correct type. Also note that if we had not constructed A with the UM allocator ID, + // this conversion would fail and produce an error at runtime. + add<<<1, 1>>>(A_dynamic, B_unified, C_device); + + // Since our result array is in device memory, we copy it to host memory so we can view it. + axom::Array C_host = C_device; + std::cout << "Array C_host = " << C_host << std::endl; + + // Since by default allocations happen in host memory, we could have also used a dynamic array (the default) + axom::Array C_dynamic = C_device; + std::cout << "Array C_dynamic = " << C_dynamic << std::endl; + // _cuda_array_call_end + + #ifdef AXOM_USE_RAJA + // _array_w_raja_start + // To use a lambda as a kernel, we create the ArrayViews explicitly. + const UnifiedIntArrayView A_view = A_dynamic; + const UnifiedIntArrayView B_view = B_unified; + // Create a new array for our RAJA result + axom::Array C_device_raja(N); + DeviceIntArrayView C_view = C_device_raja; + + // Declare the lambda mutable so our copy of C_view (captured by value) is mutable + axom::for_all>( + 0, + N, + [=] AXOM_HOST_DEVICE(axom::IndexType i) mutable { + C_view[i] = A_view[i] + B_view[i] + 1; + }); + + // Finally, copy things over to host memory so we can display the data + axom::Array C_host_raja = C_view; + std::cout << "Array C_host_raja = " << C_host_raja << std::endl; + // _array_w_raja_end + #endif +#endif +} + +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { demoArrayBasic(); + demoArrayDevice(); return 0; } diff --git a/src/axom/core/examples/core_numerics.cpp b/src/axom/core/examples/core_numerics.cpp index 581345c61e..69c3db7e22 100644 --- a/src/axom/core/examples/core_numerics.cpp +++ b/src/axom/core/examples/core_numerics.cpp @@ -277,7 +277,7 @@ void demoMatrix() // _solve_end } -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { // _timer_start axom::utilities::Timer t; diff --git a/src/axom/core/execution/execution_space.hpp b/src/axom/core/execution/execution_space.hpp index 7a13421a51..4ab3e032a0 100644 --- a/src/axom/core/execution/execution_space.hpp +++ b/src/axom/core/execution/execution_space.hpp @@ -86,7 +86,7 @@ struct execution_space static int allocatorID() noexcept { return axom::INVALID_ALLOCATOR_ID; }; }; -} /* namespace axom */ +} // namespace axom // execution_space traits specialization #include "axom/core/execution/internal/seq_exec.hpp" @@ -100,4 +100,4 @@ struct execution_space #include "axom/core/execution/internal/cuda_exec.hpp" #endif -#endif /* AXOM_SPIN_EXECUTIONSPACE_HPP_ */ +#endif // AXOM_EXECUTIONSPACE_HPP_ diff --git a/src/axom/core/memory_management.hpp b/src/axom/core/memory_management.hpp index 00f3a1fecf..761b2b3784 100644 --- a/src/axom/core/memory_management.hpp +++ b/src/axom/core/memory_management.hpp @@ -15,6 +15,7 @@ #include "umpire/config.hpp" #include "umpire/ResourceManager.hpp" #include "umpire/op/MemoryOperationRegistry.hpp" + #include "umpire/resource/MemoryResourceTypes.hpp" #include "umpire/strategy/QuickPool.hpp" #else #include // for std::memcpy @@ -25,6 +26,25 @@ namespace axom { constexpr int INVALID_ALLOCATOR_ID = -1; +/*! + * \brief Memory spaces supported by Array-like types + * + * This abstraction is not implemented using Umpire's MemoryResourceType enum + * in order to also include a "Dynamic" option as a default template parameter + * for Array-like types + */ +enum class MemorySpace +{ + Dynamic, +#ifdef AXOM_USE_UMPIRE + Host, + Device, + Unified, + Pinned, + Constant +#endif +}; + /// \name Memory Management Routines /// @{ @@ -251,6 +271,59 @@ inline void copy(void* dst, const void* src, std::size_t numbytes) noexcept #endif } +namespace detail +{ +/// \brief Translates between the MemorySpace enum and Umpire allocator IDs +template +inline int getAllocatorID(); + +template <> +inline int getAllocatorID() +{ + return axom::getDefaultAllocatorID(); +} + +#ifdef AXOM_USE_UMPIRE + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Host); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Device); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Unified); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Pinned); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Constant); +} + +#endif + +} // namespace detail + } // namespace axom #endif /* AXOM_MEMORYMANAGEMENT_HPP_ */ diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 1bb85ade2a..2909e82b93 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -679,8 +679,8 @@ void check_swap(Array& v) EXPECT_EQ(v_two, v_two_copy); } -template -void check_alloc(Array& v, const int& id) +template +void check_alloc(Array& v, const int id) { // Verify allocation EXPECT_EQ(v.getAllocatorID(), id); @@ -733,6 +733,175 @@ void check_external_view(ArrayView& v) EXPECT_EQ(data_ptr, v.data()); } +// FIXME: HIP +#if defined(__CUDACC__) && defined(AXOM_USE_UMPIRE) + +template +__global__ void assign_raw(T* data, int N) +{ + for(int i = 0; i < N; i++) + { + data[i] = i; + } +} + +template +__global__ void assign_view(ArrayView view) +{ + for(int i = 0; i < view.size(); i++) + { + view[i] = i * 2; + } +} + +/*! + * \brief Check that an array can be modified/accessed from device code + * \param [in] v the array to check. + */ +template +void check_device(Array& v) +{ + const IndexType size = v.size(); + // Then assign to it via a raw device pointer + assign_raw<<<1, 1>>>(v.data(), size); + + // Check the contents of the array by assigning to a Dynamic array + // The default Umpire allocator should be Host, so we can access it from the CPU + Array check_raw_array_dynamic = v; + EXPECT_EQ(check_raw_array_dynamic.size(), size); + for(int i = 0; i < check_raw_array_dynamic.size(); i++) + { + EXPECT_EQ(check_raw_array_dynamic[i], i); + } + + // Then check the contents by assigning to an explicitly Host array + Array check_raw_array_host = v; + EXPECT_EQ(check_raw_array_host.size(), size); + for(int i = 0; i < check_raw_array_host.size(); i++) + { + EXPECT_EQ(check_raw_array_host[i], i); + } + + // Then modify the underlying data via a view + ArrayView view(v); + assign_view<<<1, 1>>>(view); + + // Check the contents of the array by assigning to a Dynamic array + // The default Umpire allocator should be Host, so we can access it from the CPU + Array check_view_array_dynamic = view; + EXPECT_EQ(check_view_array_dynamic.size(), size); + for(int i = 0; i < check_view_array_dynamic.size(); i++) + { + EXPECT_EQ(check_view_array_dynamic[i], i * 2); + } + + // Then check the contents by assigning to an explicitly Host array + Array check_view_array_host = view; + EXPECT_EQ(check_view_array_host.size(), size); + for(int i = 0; i < check_view_array_host.size(); i++) + { + EXPECT_EQ(check_view_array_host[i], i * 2); + } +} + +template +__global__ void assign_raw_2d(T* data, int M, int N) +{ + for(int i = 0; i < N; i++) + { + for(int j = 0; j < N; j++) + { + data[i * N + j] = i * i + j; + } + } +} + +template +__global__ void assign_view_2d(ArrayView view) +{ + for(int i = 0; i < view.shape()[0]; i++) + { + for(int j = 0; j < view.shape()[1]; j++) + { + view(i, j) = j * j + i; + } + } +} + +/*! + * \brief Check that a 2D array can be modified/accessed from device code + * \param [in] v the array to check. + */ +template +void check_device_2D(Array& v) +{ + const IndexType size = v.size(); + const IndexType M = v.shape()[0]; + const IndexType N = v.shape()[1]; + // Then assign to it via a raw device pointer + assign_raw_2d<<<1, 1>>>(v.data(), M, N); + + // Check the contents of the array by assigning to a Dynamic array + // The default Umpire allocator should be Host, so we can access it from the CPU + Array check_raw_array_dynamic = v; + EXPECT_EQ(check_raw_array_dynamic.size(), size); + EXPECT_EQ(check_raw_array_dynamic.shape(), v.shape()); + + for(int i = 0; i < M; i++) + { + for(int j = 0; j < N; j++) + { + EXPECT_EQ(check_raw_array_dynamic(i, j), i * i + j); + } + } + + // Then check the contents by assigning to an explicitly Host array + Array check_raw_array_host = v; + EXPECT_EQ(check_raw_array_host.size(), size); + EXPECT_EQ(check_raw_array_host.shape(), v.shape()); + + for(int i = 0; i < M; i++) + { + for(int j = 0; j < N; j++) + { + EXPECT_EQ(check_raw_array_host(i, j), i * i + j); + } + } + + // Then modify the underlying data via a view + ArrayView view(v); + assign_view_2d<<<1, 1>>>(view); + + // Check the contents of the array by assigning to a Dynamic array + // The default Umpire allocator should be Host, so we can access it from the CPU + Array check_view_array_dynamic = view; + EXPECT_EQ(check_view_array_dynamic.size(), size); + EXPECT_EQ(check_view_array_dynamic.shape(), v.shape()); + + for(int i = 0; i < M; i++) + { + for(int j = 0; j < N; j++) + { + EXPECT_EQ(check_view_array_dynamic(i, j), j * j + i); + } + } + + // Then check the contents by assigning to an explicitly Host array + Array check_view_array_host = view; + EXPECT_EQ(check_view_array_host.size(), size); + EXPECT_EQ(check_view_array_host.shape(), v.shape()); + + for(int i = 0; i < M; i++) + { + for(int j = 0; j < N; j++) + { + EXPECT_EQ(check_view_array_host(i, j), j * j + i); + } + } +} + +#endif // defined(__CUDACC__) && defined(AXOM_USE_UMPIRE) + } /* end namespace internal */ //------------------------------------------------------------------------------ @@ -913,18 +1082,68 @@ TEST(core_array, checkAlloc) #endif }; - for(int id : memory_locations) + for(double ratio = 1.0; ratio <= 2.0; ratio += 0.5) { - for(double ratio = 1.0; ratio <= 2.0; ratio += 0.5) + for(IndexType capacity = 4; capacity <= 512; capacity *= 2) { - for(IndexType capacity = 4; capacity <= 512; capacity *= 2) + // First use the dynamic option + for(int id : memory_locations) { - Array v_int(capacity, capacity, id); + Array v_int(capacity, capacity, id); internal::check_alloc(v_int, id); - Array v_double(capacity, capacity, id); + Array v_double(capacity, + capacity, + id); internal::check_alloc(v_double, id); } +// Then, if Umpire is available, we can use the space as an explicit template parameter +#ifdef AXOM_USE_UMPIRE + #ifdef UMPIRE_ENABLE_DEVICE + Array v_int_device(capacity, capacity); + internal::check_alloc( + v_int_device, + axom::getUmpireResourceAllocatorID(umpire::resource::Device)); + Array v_double_device(capacity, + capacity); + internal::check_alloc( + v_double_device, + axom::getUmpireResourceAllocatorID(umpire::resource::Device)); + #endif + #ifdef UMPIRE_ENABLE_UM + Array v_int_unified(capacity, capacity); + internal::check_alloc( + v_int_unified, + axom::getUmpireResourceAllocatorID(umpire::resource::Unified)); + Array v_double_unified(capacity, + capacity); + internal::check_alloc( + v_double_unified, + axom::getUmpireResourceAllocatorID(umpire::resource::Unified)); + #endif + #ifdef UMPIRE_ENABLE_CONST + Array v_int_const(capacity, capacity); + internal::check_alloc( + v_int_const, + axom::getUmpireResourceAllocatorID(umpire::resource::Constant)); + Array v_double_const(capacity, + capacity); + internal::check_alloc( + v_double_const, + axom::getUmpireResourceAllocatorID(umpire::resource::Constant)); + #endif + #ifdef UMPIRE_ENABLE_PINNED + Array v_int_pinned(capacity, capacity); + internal::check_alloc( + v_int_pinned, + axom::getUmpireResourceAllocatorID(umpire::resource::Pinned)); + Array v_double_pinned(capacity, + capacity); + internal::check_alloc( + v_double_pinned, + axom::getUmpireResourceAllocatorID(umpire::resource::Pinned)); + #endif +#endif } } } @@ -1105,7 +1324,7 @@ TEST(core_array, check_multidimensional) v_int.fill(MAGIC_INT); // Make sure the number of elements and contents are correct EXPECT_EQ(v_int.size(), 2 * 2); - std::array expected_shape = {2, 2}; + StackArray expected_shape = {2, 2}; EXPECT_EQ(v_int.shape(), expected_shape); for(const auto val : v_int) { @@ -1123,7 +1342,7 @@ TEST(core_array, check_multidimensional) v_int_flat[1] = 2; v_int_flat[2] = 3; v_int_flat[3] = 4; - std::array expected_flat_shape = {4}; + StackArray expected_flat_shape = {4}; EXPECT_EQ(v_int_flat.shape(), expected_flat_shape); for(int i = 0; i < v_int_flat.size(); i++) @@ -1135,7 +1354,7 @@ TEST(core_array, check_multidimensional) Array v_double(4, 3, 2); v_double.fill(MAGIC_DOUBLE); EXPECT_EQ(v_double.size(), 4 * 3 * 2); - std::array expected_double_shape = {4, 3, 2}; + StackArray expected_double_shape = {4, 3, 2}; EXPECT_EQ(v_double.shape(), expected_double_shape); for(const auto val : v_double) { @@ -1174,7 +1393,7 @@ TEST(core_array, check_multidimensional_view) ArrayView v_int_view(v_int_arr, 2, 2); // Make sure the number of elements and contents are correct EXPECT_EQ(v_int_view.size(), 2 * 2); - std::array expected_shape = {2, 2}; + StackArray expected_shape = {2, 2}; EXPECT_EQ(v_int_view.shape(), expected_shape); for(const auto val : v_int_view) { @@ -1189,7 +1408,7 @@ TEST(core_array, check_multidimensional_view) // FIXME: Should we add a std::initializer_list ctor? int v_int_flat_arr[] = {1, 2, 3, 4}; ArrayView v_int_flat_view(v_int_flat_arr, 4); - std::array expected_flat_shape = {4}; + StackArray expected_flat_shape = {4}; EXPECT_EQ(v_int_flat_view.shape(), expected_flat_shape); for(int i = 0; i < v_int_flat_view.size(); i++) @@ -1202,7 +1421,7 @@ TEST(core_array, check_multidimensional_view) std::fill_n(v_double_arr, 4 * 3 * 2, MAGIC_DOUBLE); ArrayView v_double_view(v_double_arr, 4, 3, 2); EXPECT_EQ(v_double_view.size(), 4 * 3 * 2); - std::array expected_double_shape = {4, 3, 2}; + StackArray expected_double_shape = {4, 3, 2}; EXPECT_EQ(v_double_view.shape(), expected_double_shape); for(const auto val : v_double_view) { @@ -1231,4 +1450,63 @@ TEST(core_array, check_multidimensional_view) } } +//------------------------------------------------------------------------------ +TEST(core_array, checkDevice) +{ +// FIXME: HIP +#if !defined(__CUDACC__) || !defined(AXOM_USE_UMPIRE) || \ + !defined(UMPIRE_ENABLE_DEVICE) + GTEST_SKIP() + << "CUDA is not available, skipping tests that use Array in device code"; +#else + for(IndexType capacity = 2; capacity < 512; capacity *= 2) + { + // Allocate a Dynamic array in Device memory + Array v_int_dynamic( + capacity, + capacity, + axom::getUmpireResourceAllocatorID(umpire::resource::Device)); + + internal::check_device(v_int_dynamic); + + Array v_double_dynamic( + capacity, + capacity, + axom::getUmpireResourceAllocatorID(umpire::resource::Device)); + + internal::check_device(v_double_dynamic); + + // Then allocate an explicitly Device array + Array v_int_device(capacity, capacity); + internal::check_device(v_int_device); + + Array v_double_device(capacity, + capacity); + internal::check_device(v_double_device); + } +#endif +} + +//------------------------------------------------------------------------------ +TEST(core_array, checkDevice2D) +{ +// FIXME: HIP +#if !defined(__CUDACC__) || !defined(AXOM_USE_UMPIRE) || \ + !defined(UMPIRE_ENABLE_DEVICE) + GTEST_SKIP() + << "CUDA is not available, skipping tests that use Array in device code"; +#else + for(IndexType capacity = 2; capacity < 512; capacity *= 2) + { + // Allocate an explicitly Device array + Array v_int_device(capacity, capacity); + internal::check_device_2D(v_int_device); + + Array v_double_device(capacity, + capacity); + internal::check_device_2D(v_double_device); + } +#endif +} + } /* end namespace axom */ diff --git a/src/axom/core/tests/utils_about.hpp b/src/axom/core/tests/utils_about.hpp index a8932b2ff5..87b2dfcf54 100644 --- a/src/axom/core/tests/utils_about.hpp +++ b/src/axom/core/tests/utils_about.hpp @@ -17,8 +17,10 @@ TEST(core_about, print_about) { axom::about(); } TEST(core_about, get_version) { std::ostringstream EXPECTED_VERSION_STRING; - EXPECTED_VERSION_STRING << AXOM_VERSION_FULL << "-"; - EXPECTED_VERSION_STRING << AXOM_VERSION_EXTRA; + EXPECTED_VERSION_STRING << AXOM_VERSION_FULL; +#ifdef AXOM_VERSION_EXTRA + EXPECTED_VERSION_STRING << "-" << AXOM_VERSION_EXTRA; +#endif std::string axom_version = axom::getVersion(); EXPECT_EQ(EXPECTED_VERSION_STRING.str(), axom_version); diff --git a/src/axom/inlet/InletVector.hpp b/src/axom/inlet/InletVector.hpp index 6a67143781..29243b6faa 100644 --- a/src/axom/inlet/InletVector.hpp +++ b/src/axom/inlet/InletVector.hpp @@ -66,7 +66,24 @@ struct InletVector * \param [in] d The dimension of the vector ******************************************************************************* */ - InletVector(primal::Vector3D&& v, int d = 3) : vec(std::move(v)), dim(d) { } + explicit InletVector(primal::Vector3D&& v, int d = 3) + : vec(std::move(v)) + , dim(d) + { } + + /*! + ******************************************************************************* + * \brief Constructs a vector with a pointer and a dimension + * + * \param [in] values The pointer to the vector data + * \param [in] d The dimension of the vector (length of the data) + * + * \note Data is copied from the pointer - lifetime of the constructed InletVector + * is not dependent on the lifetime of the pointer. + ******************************************************************************* + */ + explicit InletVector(const double* values, int d = 3) : vec(values, d), dim(d) + { } /*! ******************************************************************************* diff --git a/src/axom/inlet/LuaReader.cpp b/src/axom/inlet/LuaReader.cpp index 9ffd2ee9c9..986c6c2298 100644 --- a/src/axom/inlet/LuaReader.cpp +++ b/src/axom/inlet/LuaReader.cpp @@ -113,15 +113,13 @@ LuaReader::LuaReader() "new", axom::sol::factories( [](double x, double y, double z) { - return FunctionType::Vector {primal::Vector3D {x, y, z}, 3}; + return FunctionType::Vector {x, y, z}; }, [](double x, double y) { - return FunctionType::Vector {primal::Vector3D {x, y}, 2}; + return FunctionType::Vector {x, y}; }, // Assume three for a default constructor - [] { - return FunctionType::Vector {primal::Vector3D {}, 3}; - }), + [] { return FunctionType::Vector {}; }), // Add vector addition operation axom::sol::meta_function::addition, [](const FunctionType::Vector& u, const FunctionType::Vector& v) { diff --git a/src/axom/inlet/examples/mfem_coefficient.cpp b/src/axom/inlet/examples/mfem_coefficient.cpp index 81075f2826..94cd7d5aa9 100644 --- a/src/axom/inlet/examples/mfem_coefficient.cpp +++ b/src/axom/inlet/examples/mfem_coefficient.cpp @@ -100,7 +100,7 @@ struct BoundaryCondition inlet::InletVector toInletVector(const mfem::Vector& vec) { - return {axom::primal::Vector3D {vec.GetData(), vec.Size()}, vec.Size()}; + return inlet::InletVector {vec.GetData(), vec.Size()}; } // Uses out-params to match MFEM semantics diff --git a/src/axom/inlet/examples/nested_structs.cpp b/src/axom/inlet/examples/nested_structs.cpp index 05cb80735e..0dff9f65a1 100644 --- a/src/axom/inlet/examples/nested_structs.cpp +++ b/src/axom/inlet/examples/nested_structs.cpp @@ -20,9 +20,7 @@ using Vector = inlet::FunctionType::Vector; // to a geometric vector type Vector toVector(const std::vector& vec) { - // Narrow from std::size_t to int - const int size = vec.size(); - return {axom::primal::Vector3D {vec.data(), size}, size}; + return Vector {vec.data(), static_cast(vec.size())}; } // A union of the members required for each of the operations is stored for simplicity diff --git a/src/axom/mint/CMakeLists.txt b/src/axom/mint/CMakeLists.txt index d410bffd41..36f5fdc6aa 100644 --- a/src/axom/mint/CMakeLists.txt +++ b/src/axom/mint/CMakeLists.txt @@ -8,6 +8,8 @@ #------------------------------------------------------------------------------ # Check necessary dependencies +# +# Note: Mint also optionally depends on Sidre when AXOM_MINT_USE_SIDRE=ON #------------------------------------------------------------------------------ axom_component_requires(NAME Mint COMPONENTS SLIC) diff --git a/src/axom/mint/docs/sphinx/sections/tutorial.rst b/src/axom/mint/docs/sphinx/sections/tutorial.rst index 5416c186a4..609f1a1f01 100644 --- a/src/axom/mint/docs/sphinx/sections/tutorial.rst +++ b/src/axom/mint/docs/sphinx/sections/tutorial.rst @@ -774,7 +774,7 @@ the cell centroid by averaging the coordinates of the constituent cell .. note:: Since this kernel does not use the node IDs, the argument to the kernel - is annotated using the ``AXOM_NOT_USED`` macro to silence compiler + is annotated using the ``AXOM_UNUSED_PARAM`` macro to silence compiler warnings. .. literalinclude:: ../../../examples/user_guide/mint_tutorial.cpp @@ -937,7 +937,7 @@ the face centroid by averaging the coordinates of the constituent face .. note:: Since this kernel does not use the node IDs, the argument to the kernel - is annotated using the ``AXOM_NOT_USED`` macro to silence compiler + is annotated using the ``AXOM_UNUSED_PARAM`` macro to silence compiler warnings. .. literalinclude:: ../../../examples/user_guide/mint_tutorial.cpp diff --git a/src/axom/mint/examples/mint_curvilinear_mesh.cpp b/src/axom/mint/examples/mint_curvilinear_mesh.cpp index 0c9f07e7c7..161bc06c1d 100644 --- a/src/axom/mint/examples/mint_curvilinear_mesh.cpp +++ b/src/axom/mint/examples/mint_curvilinear_mesh.cpp @@ -24,7 +24,7 @@ constexpr double M = (2 * M_PI) / 50.0; * \brief Illustrates how to construct and use a mint::CurvilinearMesh object. */ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { constexpr int N = 100; constexpr double h = 0.5; diff --git a/src/axom/mint/examples/mint_particle_mesh.cpp b/src/axom/mint/examples/mint_particle_mesh.cpp index f11f899772..18d001277c 100644 --- a/src/axom/mint/examples/mint_particle_mesh.cpp +++ b/src/axom/mint/examples/mint_particle_mesh.cpp @@ -19,7 +19,7 @@ namespace mint = axom::mint; namespace utilities = axom::utilities; //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { using int64 = axom::IndexType; const axom::IndexType NUM_PARTICLES = 100; diff --git a/src/axom/mint/examples/mint_rectilinear_mesh.cpp b/src/axom/mint/examples/mint_rectilinear_mesh.cpp index f125f9f5ff..8182b8dbf9 100644 --- a/src/axom/mint/examples/mint_rectilinear_mesh.cpp +++ b/src/axom/mint/examples/mint_rectilinear_mesh.cpp @@ -39,7 +39,7 @@ void exponential_distribution(double origin, IndexType N, double* x) } //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { constexpr int N = 100; diff --git a/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp b/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp index 08b545d038..5e7b972b74 100644 --- a/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp +++ b/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp @@ -27,7 +27,7 @@ inline bool appendQuad(axom::IndexType i, axom::IndexType j) } //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { SimpleLogger logger; // create & initialize test logger, diff --git a/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp b/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp index 41b2cbf158..01b3d2e618 100644 --- a/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp +++ b/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp @@ -19,7 +19,7 @@ using namespace axom; using axom::slic::SimpleLogger; //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { SimpleLogger logger; // create & initialize test logger, diff --git a/src/axom/mint/examples/user_guide/mint_tutorial.cpp b/src/axom/mint/examples/user_guide/mint_tutorial.cpp index bd2082de93..8482e4045a 100644 --- a/src/axom/mint/examples/user_guide/mint_tutorial.cpp +++ b/src/axom/mint/examples/user_guide/mint_tutorial.cpp @@ -218,7 +218,7 @@ void cell_traversals() &mesh, AXOM_LAMBDA(IndexType cellIdx, const numerics::Matrix& coords, - const IndexType* AXOM_NOT_USED(nodeIdx)) { + const IndexType* AXOM_UNUSED_PARAM(nodeIdx)) { // sum nodal coordinates double xsum = 0.0; double ysum = 0.0; @@ -349,7 +349,7 @@ void face_traversals() &mesh, AXOM_LAMBDA(IndexType faceIdx, const numerics::Matrix& coords, - const IndexType* AXOM_NOT_USED(nodeIdx)) { + const IndexType* AXOM_UNUSED_PARAM(nodeIdx)) { // sum nodal coordinates double xsum = 0.0; double ysum = 0.0; @@ -382,7 +382,7 @@ void face_traversals() mint::for_all_faces( &mesh, - AXOM_LAMBDA(IndexType faceIdx, IndexType AXOM_NOT_USED(c1), IndexType c2) { + AXOM_LAMBDA(IndexType faceIdx, IndexType AXOM_UNUSED_PARAM(c1), IndexType c2) { boundary[faceIdx] = (c2 == -1) ? ON_BOUNDARY : INTERIOR; }); @@ -823,7 +823,7 @@ void using_sidre() /*! * \brief Tutorial main */ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { // Native construction of various mesh types construct_uniform(); diff --git a/src/axom/mint/execution/internal/for_all_cells.hpp b/src/axom/mint/execution/internal/for_all_cells.hpp index 61ae3bca2b..343a42a7e0 100644 --- a/src/axom/mint/execution/internal/for_all_cells.hpp +++ b/src/axom/mint/execution/internal/for_all_cells.hpp @@ -314,7 +314,7 @@ inline void for_all_cells_impl(xargs::faceids, for_all_cells_impl( xargs::ij(), m, - AXOM_LAMBDA(IndexType cellID, IndexType AXOM_NOT_USED(i), IndexType j) { + AXOM_LAMBDA(IndexType cellID, IndexType AXOM_UNUSED_PARAM(i), IndexType j) { IndexType faces[4]; /* The I_DIRECTION faces */ @@ -340,7 +340,7 @@ inline void for_all_cells_impl(xargs::faceids, xargs::ijk(), m, AXOM_LAMBDA(IndexType cellID, - IndexType AXOM_NOT_USED(i), + IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { IndexType faces[6]; @@ -599,7 +599,7 @@ inline void for_all_cells_impl(xargs::coords, struct for_all_cell_nodes_functor { template - inline void operator()(ExecPolicy AXOM_NOT_USED(policy), + inline void operator()(ExecPolicy AXOM_UNUSED_PARAM(policy), const MeshType& m, KernelType&& kernel) const { @@ -657,7 +657,7 @@ inline void for_all_cells_impl(xargs::coords, m, AXOM_LAMBDA(IndexType cellID, const IndexType* nodeIDs, - IndexType AXOM_NOT_USED(numNodes)) { + IndexType AXOM_UNUSED_PARAM(numNodes)) { double coords[2] = {x[nodeIDs[0]], x[nodeIDs[1]]}; numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); diff --git a/src/axom/mint/execution/internal/for_all_faces.hpp b/src/axom/mint/execution/internal/for_all_faces.hpp index f241c46588..d2664dc46a 100644 --- a/src/axom/mint/execution/internal/for_all_faces.hpp +++ b/src/axom/mint/execution/internal/for_all_faces.hpp @@ -309,8 +309,8 @@ inline void for_all_faces_impl(xargs::nodeids, xargs::ij(), m, AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_NOT_USED(i), - IndexType AXOM_NOT_USED(j)) { + IndexType AXOM_UNUSED_PARAM(i), + IndexType AXOM_UNUSED_PARAM(j)) { IndexType nodes[2]; nodes[0] = faceID; nodes[1] = nodes[0] + cellNodeOffset3; @@ -320,7 +320,7 @@ inline void for_all_faces_impl(xargs::nodeids, helpers::for_all_J_faces( xargs::ij(), m, - AXOM_LAMBDA(IndexType faceID, IndexType AXOM_NOT_USED(i), IndexType j) { + AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType j) { const IndexType shiftedID = faceID - numIFaces; IndexType nodes[2]; nodes[0] = shiftedID + j; @@ -349,8 +349,8 @@ inline void for_all_faces_impl(xargs::nodeids, xargs::ijk(), m, AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_NOT_USED(i), - IndexType AXOM_NOT_USED(j), + IndexType AXOM_UNUSED_PARAM(i), + IndexType AXOM_UNUSED_PARAM(j), IndexType k) { IndexType nodes[4]; nodes[0] = faceID + k * INodeResolution; @@ -364,7 +364,7 @@ inline void for_all_faces_impl(xargs::nodeids, xargs::ijk(), m, AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_NOT_USED(i), + IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { const IndexType shiftedID = faceID - numIFaces; @@ -380,7 +380,7 @@ inline void for_all_faces_impl(xargs::nodeids, xargs::ijk(), m, AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_NOT_USED(i), + IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { const IndexType shiftedID = faceID - numIJFaces; @@ -904,7 +904,7 @@ inline void for_all_faces_impl(xargs::coords, struct for_all_face_nodes_functor { template - inline void operator()(ExecPolicy AXOM_NOT_USED(policy), + inline void operator()(ExecPolicy AXOM_UNUSED_PARAM(policy), const MeshType& m, KernelType&& kernel) const { diff --git a/src/axom/mint/fem/shape_functions/Lagrange.hpp b/src/axom/mint/fem/shape_functions/Lagrange.hpp index 6f68d5374d..8abea98408 100644 --- a/src/axom/mint/fem/shape_functions/Lagrange.hpp +++ b/src/axom/mint/fem/shape_functions/Lagrange.hpp @@ -7,7 +7,7 @@ #define MINT_LAGRANGE_SHAPEFUNCTION_HPP_ // Axom includes -#include "axom/core/Macros.hpp" // For AXOM_STATIC_ASSERT(), AXOM_NOT_USED() +#include "axom/core/Macros.hpp" // Mint includes #include "axom/mint/mesh/CellTypes.hpp" @@ -143,7 +143,7 @@ class Lagrange : public ShapeFunction> * * \note This method is implemented in specialized instances. */ - static void getCenter(double* AXOM_NOT_USED(center)) + static void getCenter(double* AXOM_UNUSED_PARAM(center)) { constexpr int cell_value = mint::cellTypeToInt(CELLTYPE); AXOM_STATIC_ASSERT(cell_value >= 0 && cell_value < mint::NUM_CELL_TYPES); @@ -159,7 +159,7 @@ class Lagrange : public ShapeFunction> * \note The coordinates are arranged in column-major flat array layout. * \note This method is implemented in specialized instances. */ - static void getCoords(double* AXOM_NOT_USED(coords)) + static void getCoords(double* AXOM_UNUSED_PARAM(coords)) { constexpr int cell_value = mint::cellTypeToInt(CELLTYPE); AXOM_STATIC_ASSERT(cell_value >= 0 && cell_value < mint::NUM_CELL_TYPES); @@ -178,8 +178,8 @@ class Lagrange : public ShapeFunction> * * \note This method is implemented in specialized instances. */ - static void computeShape(const double* AXOM_NOT_USED(nc), - double* AXOM_NOT_USED(phi)) + static void computeShape(const double* AXOM_UNUSED_PARAM(nc), + double* AXOM_UNUSED_PARAM(phi)) { constexpr int cell_value = mint::cellTypeToInt(CELLTYPE); AXOM_STATIC_ASSERT(cell_value >= 0 && cell_value < mint::NUM_CELL_TYPES); @@ -198,8 +198,8 @@ class Lagrange : public ShapeFunction> * * \note This method is implemented in specialized instances. */ - static void computeDerivatives(const double* AXOM_NOT_USED(nc), - double* AXOM_NOT_USED(phidot)) + static void computeDerivatives(const double* AXOM_UNUSED_PARAM(nc), + double* AXOM_UNUSED_PARAM(phidot)) { constexpr int cell_value = mint::cellTypeToInt(CELLTYPE); AXOM_STATIC_ASSERT(cell_value >= 0 && cell_value < mint::NUM_CELL_TYPES); diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_tetra_4.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_tetra_4.hpp index 3d48401546..b485347098 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_tetra_4.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_tetra_4.hpp @@ -106,7 +106,8 @@ class Lagrange : public ShapeFunction> phi[3] = t; } - static void computeDerivatives(const double* AXOM_NOT_USED(xr), double* phidot) + static void computeDerivatives(const double* AXOM_UNUSED_PARAM(xr), + double* phidot) { SLIC_ASSERT(phidot != nullptr); diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_tri_3.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_tri_3.hpp index e23fa622c8..2c06614342 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_tri_3.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_tri_3.hpp @@ -93,7 +93,8 @@ class Lagrange : public ShapeFunction> phi[2] = s; } - static void computeDerivatives(const double* AXOM_NOT_USED(xr), double* phidot) + static void computeDerivatives(const double* AXOM_UNUSED_PARAM(xr), + double* phidot) { SLIC_ASSERT(phidot != nullptr); diff --git a/src/axom/mint/mesh/ConnectivityArray.hpp b/src/axom/mint/mesh/ConnectivityArray.hpp index 53126ffe1f..f34a395afd 100644 --- a/src/axom/mint/mesh/ConnectivityArray.hpp +++ b/src/axom/mint/mesh/ConnectivityArray.hpp @@ -430,7 +430,8 @@ class ConnectivityArray * * \post getIDCapacity() >= n_IDs */ - void reserve(IndexType ID_capacity, IndexType AXOM_NOT_USED(value_capacity) = 0) + void reserve(IndexType ID_capacity, + IndexType AXOM_UNUSED_PARAM(value_capacity) = 0) { SLIC_ERROR_IF(isExternal() && ID_capacity > m_values->capacity(), "cannot exceed initial capacity of external buffer!"); @@ -446,7 +447,7 @@ class ConnectivityArray * * \post getNumberOfIDs() == newIDSize */ - void resize(IndexType ID_size, IndexType AXOM_NOT_USED(value_size) = 0) + void resize(IndexType ID_size, IndexType AXOM_UNUSED_PARAM(value_size) = 0) { m_values->resize(ID_size); } @@ -523,7 +524,7 @@ class ConnectivityArray * * \param [in] ID not used, does not need to be specified. */ - IndexType getNumberOfValuesForID(IndexType AXOM_NOT_USED(ID) = 0) const + IndexType getNumberOfValuesForID(IndexType AXOM_UNUSED_PARAM(ID) = 0) const { return m_stride; } @@ -533,7 +534,7 @@ class ConnectivityArray * * \param [in] ID not used, does not need to be specified. */ - CellType getIDType(IndexType AXOM_NOT_USED(ID) = 0) const + CellType getIDType(IndexType AXOM_UNUSED_PARAM(ID) = 0) const { return m_cell_type; } @@ -614,8 +615,8 @@ class ConnectivityArray * \pre values != nullptr */ void append(const IndexType* values, - IndexType AXOM_NOT_USED(n_values) = 0, - CellType AXOM_NOT_USED(type) = UNDEFINED_CELL) + IndexType AXOM_UNUSED_PARAM(n_values) = 0, + CellType AXOM_UNUSED_PARAM(type) = UNDEFINED_CELL) { appendM(values, 1); } @@ -634,8 +635,8 @@ class ConnectivityArray */ void appendM(const IndexType* values, IndexType n_IDs, - const IndexType* AXOM_NOT_USED(offsets) = nullptr, - const CellType* AXOM_NOT_USED(types) = nullptr) + const IndexType* AXOM_UNUSED_PARAM(offsets) = nullptr, + const CellType* AXOM_UNUSED_PARAM(types) = nullptr) { SLIC_ASSERT(values != nullptr); SLIC_ASSERT(n_IDs >= 0); @@ -693,8 +694,8 @@ class ConnectivityArray */ void insert(const IndexType* values, IndexType start_ID, - IndexType AXOM_NOT_USED(n_values) = 0, - CellType AXOM_NOT_USED(type) = UNDEFINED_CELL) + IndexType AXOM_UNUSED_PARAM(n_values) = 0, + CellType AXOM_UNUSED_PARAM(type) = UNDEFINED_CELL) { insertM(values, start_ID, 1); } @@ -716,8 +717,8 @@ class ConnectivityArray void insertM(const IndexType* values, IndexType start_ID, IndexType n_IDs, - const IndexType* AXOM_NOT_USED(offsets) = nullptr, - const CellType* AXOM_NOT_USED(types) = nullptr) + const IndexType* AXOM_UNUSED_PARAM(offsets) = nullptr, + const CellType* AXOM_UNUSED_PARAM(types) = nullptr) { SLIC_ASSERT(start_ID >= 0); SLIC_ASSERT(start_ID <= getNumberOfIDs()); diff --git a/src/axom/mint/mesh/Mesh.hpp b/src/axom/mint/mesh/Mesh.hpp index e17894aa7d..f86e33b1e4 100644 --- a/src/axom/mint/mesh/Mesh.hpp +++ b/src/axom/mint/mesh/Mesh.hpp @@ -267,8 +267,8 @@ class Mesh * \pre nodes != nullptr * \pre 0 <= cellID < getNumberOfCells() */ - virtual IndexType getCellNodeIDs(IndexType AXOM_NOT_USED(cellID), - IndexType* AXOM_NOT_USED(nodes)) const = 0; + virtual IndexType getCellNodeIDs(IndexType AXOM_UNUSED_PARAM(cellID), + IndexType* AXOM_UNUSED_PARAM(nodes)) const = 0; /*! * \brief Return the number of faces associated with the given cell. @@ -276,7 +276,7 @@ class Mesh * \param [in] cellID the ID of the cell in question. */ virtual IndexType getNumberOfCellFaces( - IndexType AXOM_NOT_USED(cellID) = 0) const = 0; + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const = 0; /*! * \brief Populates the given buffer with the IDs of the faces of the given @@ -289,8 +289,8 @@ class Mesh * \pre faces != nullptr * \pre 0 <= cellID < getNumberOfCells() */ - virtual IndexType getCellFaceIDs(IndexType AXOM_NOT_USED(cellID), - IndexType* AXOM_NOT_USED(faces)) const = 0; + virtual IndexType getCellFaceIDs(IndexType AXOM_UNUSED_PARAM(cellID), + IndexType* AXOM_UNUSED_PARAM(faces)) const = 0; /// @} @@ -367,14 +367,15 @@ class Mesh * * \param [in] faceID the ID of the face in question. */ - virtual CellType getFaceType(IndexType AXOM_NOT_USED(faceID)) const = 0; + virtual CellType getFaceType(IndexType AXOM_UNUSED_PARAM(faceID)) const = 0; /*! * \brief Return the number of nodes associated with the given face. * * \param [in] faceID the ID of the face in question. */ - virtual IndexType getNumberOfFaceNodes(IndexType AXOM_NOT_USED(faceID)) const = 0; + virtual IndexType getNumberOfFaceNodes( + IndexType AXOM_UNUSED_PARAM(faceID)) const = 0; /*! * \brief Copy the IDs of the nodes that compose the given face into the @@ -389,8 +390,8 @@ class Mesh * \pre nodes != nullptr * \pre 0 <= faceID < getNumberOfFaces() */ - virtual IndexType getFaceNodeIDs(IndexType AXOM_NOT_USED(faceID), - IndexType* AXOM_NOT_USED(nodes)) const = 0; + virtual IndexType getFaceNodeIDs(IndexType AXOM_UNUSED_PARAM(faceID), + IndexType* AXOM_UNUSED_PARAM(nodes)) const = 0; /*! * \brief Copy the IDs of the cells adjacent to the given face into the @@ -405,9 +406,9 @@ class Mesh * * \pre 0 <= faceID < getNumberOfFaces() */ - virtual void getFaceCellIDs(IndexType AXOM_NOT_USED(faceID), - IndexType& AXOM_NOT_USED(cellIDOne), - IndexType& AXOM_NOT_USED(cellIDTwo)) const = 0; + virtual void getFaceCellIDs(IndexType AXOM_UNUSED_PARAM(faceID), + IndexType& AXOM_UNUSED_PARAM(cellIDOne), + IndexType& AXOM_UNUSED_PARAM(cellIDTwo)) const = 0; /// @} diff --git a/src/axom/mint/mesh/ParticleMesh.hpp b/src/axom/mint/mesh/ParticleMesh.hpp index 24135d1d9f..1809afb47a 100644 --- a/src/axom/mint/mesh/ParticleMesh.hpp +++ b/src/axom/mint/mesh/ParticleMesh.hpp @@ -235,12 +235,12 @@ class ParticleMesh : public Mesh } virtual IndexType getNumberOfCellNodes( - IndexType AXOM_NOT_USED(cellID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return 1; } - virtual CellType getCellType(IndexType AXOM_NOT_USED(cellID) = 0) const final override + virtual CellType getCellType(IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return VERTEX; } @@ -255,7 +255,7 @@ class ParticleMesh : public Mesh * \param [in] cellID the ID of the cell in question. */ virtual IndexType getNumberOfCellFaces( - IndexType AXOM_NOT_USED(cellID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return 0; } @@ -269,8 +269,8 @@ class ParticleMesh : public Mesh * \param [out] faces buffer to populate with the face IDs. Must be of length * at least getNumberOfCellFaces( cellID ). */ - virtual IndexType getCellFaceIDs(IndexType AXOM_NOT_USED(cellID), - IndexType* AXOM_NOT_USED(faces)) const final override + virtual IndexType getCellFaceIDs(IndexType AXOM_UNUSED_PARAM(cellID), + IndexType* AXOM_UNUSED_PARAM(faces)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); return 0; @@ -352,7 +352,7 @@ class ParticleMesh : public Mesh * * \note The particle mesh does not have any faces so this call errors out. */ - virtual CellType getFaceType(IndexType AXOM_NOT_USED(faceID)) const final override + virtual CellType getFaceType(IndexType AXOM_UNUSED_PARAM(faceID)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); return UNDEFINED_CELL; @@ -366,7 +366,7 @@ class ParticleMesh : public Mesh * \note The particle mesh does not have any faces so this call errors out. */ virtual IndexType getNumberOfFaceNodes( - IndexType AXOM_NOT_USED(faceID)) const final override + IndexType AXOM_UNUSED_PARAM(faceID)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); return -1; @@ -385,8 +385,8 @@ class ParticleMesh : public Mesh * * \note The particle mesh does not have any faces so this call errors out. */ - virtual IndexType getFaceNodeIDs(IndexType AXOM_NOT_USED(faceID), - IndexType* AXOM_NOT_USED(nodes)) const final override + virtual IndexType getFaceNodeIDs(IndexType AXOM_UNUSED_PARAM(faceID), + IndexType* AXOM_UNUSED_PARAM(nodes)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); return -1; @@ -402,9 +402,9 @@ class ParticleMesh : public Mesh * * \note The particle mesh does not have any faces so this call errors out. */ - virtual void getFaceCellIDs(IndexType AXOM_NOT_USED(faceID), - IndexType& AXOM_NOT_USED(cellIDOne), - IndexType& AXOM_NOT_USED(cellIDTwo)) const final override + virtual void getFaceCellIDs(IndexType AXOM_UNUSED_PARAM(faceID), + IndexType& AXOM_UNUSED_PARAM(cellIDOne), + IndexType& AXOM_UNUSED_PARAM(cellIDTwo)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); } diff --git a/src/axom/mint/mesh/StructuredMesh.cpp b/src/axom/mint/mesh/StructuredMesh.cpp index 588349cd2f..c84e9bad8e 100644 --- a/src/axom/mint/mesh/StructuredMesh.cpp +++ b/src/axom/mint/mesh/StructuredMesh.cpp @@ -25,7 +25,7 @@ bool validStructuredMeshType(int type) (type == STRUCTURED_UNIFORM_MESH)); } -inline int dim(const IndexType& AXOM_NOT_USED(Ni), +inline int dim(const IndexType& AXOM_UNUSED_PARAM(Ni), const IndexType& Nj, const IndexType& Nk) { diff --git a/src/axom/mint/mesh/StructuredMesh.hpp b/src/axom/mint/mesh/StructuredMesh.hpp index a6e0b41022..2854eeee16 100644 --- a/src/axom/mint/mesh/StructuredMesh.hpp +++ b/src/axom/mint/mesh/StructuredMesh.hpp @@ -80,7 +80,7 @@ class StructuredMesh : public Mesh * \param [in] cellID the ID of the cell in question, this parameter is * ignored. */ - virtual CellType getCellType(IndexType AXOM_NOT_USED(cellID) = 0) const final override + virtual CellType getCellType(IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return (m_ndims == 1) ? SEGMENT : (m_ndims == 2) ? QUAD : HEX; } @@ -92,7 +92,7 @@ class StructuredMesh : public Mesh * ignored. */ virtual IndexType getNumberOfCellNodes( - IndexType AXOM_NOT_USED(cellID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return (m_ndims == 1) ? 2 : (m_ndims == 2) ? 4 : 8; } @@ -120,7 +120,7 @@ class StructuredMesh : public Mesh * ignored. */ virtual IndexType getNumberOfCellFaces( - IndexType AXOM_NOT_USED(cellID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { CellType cell_type = getCellType(); return getCellInfo(cell_type).num_faces; @@ -218,7 +218,7 @@ class StructuredMesh : public Mesh * \param [in] faceID the ID of the face in question, this parameter is * ignored. */ - virtual CellType getFaceType(IndexType AXOM_NOT_USED(faceID) = 0) const final override + virtual CellType getFaceType(IndexType AXOM_UNUSED_PARAM(faceID) = 0) const final override { return (m_ndims == 2) ? SEGMENT : (m_ndims == 3) ? QUAD : UNDEFINED_CELL; } @@ -230,7 +230,7 @@ class StructuredMesh : public Mesh * ignored. */ virtual IndexType getNumberOfFaceNodes( - IndexType AXOM_NOT_USED(faceID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(faceID) = 0) const final override { return (m_ndims == 2) ? 2 : (m_ndims == 3) ? 4 : 0; } diff --git a/src/axom/mint/mesh/UniformMesh.hpp b/src/axom/mint/mesh/UniformMesh.hpp index e38e41142d..9e84e379e6 100644 --- a/src/axom/mint/mesh/UniformMesh.hpp +++ b/src/axom/mint/mesh/UniformMesh.hpp @@ -6,11 +6,11 @@ #ifndef MINT_UNIFORMMESH_HPP_ #define MINT_UNIFORMMESH_HPP_ -#include "axom/core/StackArray.hpp" // for StackArray -#include "axom/mint/config.hpp" // for IndexType, int64 -#include "axom/mint/mesh/StructuredMesh.hpp" // for StructuredMesh +#include "axom/core/StackArray.hpp" +#include "axom/mint/config.hpp" +#include "axom/mint/mesh/StructuredMesh.hpp" -#include "axom/slic/interface/slic.hpp" // for SLIC macros +#include "axom/slic/interface/slic.hpp" namespace axom { @@ -221,13 +221,13 @@ class UniformMesh : public StructuredMesh */ /// @{ - virtual double* getCoordinateArray(int AXOM_NOT_USED(dim)) final override + virtual double* getCoordinateArray(int AXOM_UNUSED_PARAM(dim)) final override { SLIC_ERROR("getCoordinateArray() is not supported for UniformMesh"); return nullptr; } - virtual const double* getCoordinateArray(int AXOM_NOT_USED(dim)) const final override + virtual const double* getCoordinateArray(int AXOM_UNUSED_PARAM(dim)) const final override { SLIC_ERROR("getCoordinateArray() is not supported for UniformMesh"); return nullptr; diff --git a/src/axom/mint/mesh/internal/ConnectivityArray_indirection.hpp b/src/axom/mint/mesh/internal/ConnectivityArray_indirection.hpp index dc5b5fa424..b40e6a0e72 100644 --- a/src/axom/mint/mesh/internal/ConnectivityArray_indirection.hpp +++ b/src/axom/mint/mesh/internal/ConnectivityArray_indirection.hpp @@ -437,7 +437,7 @@ class ConnectivityArray * * \param [in] ID not used, does not need to be specified. */ - CellType getIDType(IndexType AXOM_NOT_USED(id) = 0) const + CellType getIDType(IndexType AXOM_UNUSED_PARAM(id) = 0) const { return m_cell_type; } @@ -518,7 +518,7 @@ class ConnectivityArray */ void append(const IndexType* values, IndexType n_values, - CellType AXOM_NOT_USED(type) = UNDEFINED_CELL) + CellType AXOM_UNUSED_PARAM(type) = UNDEFINED_CELL) { SLIC_ASSERT(values != nullptr); m_values->append(values, n_values); @@ -544,7 +544,7 @@ class ConnectivityArray void appendM(const IndexType* values, IndexType n_IDs, const IndexType* offsets, - const CellType* AXOM_NOT_USED(types) = nullptr) + const CellType* AXOM_UNUSED_PARAM(types) = nullptr) { internal::append(n_IDs, values, offsets, m_values, m_offsets); } @@ -600,7 +600,7 @@ class ConnectivityArray void insert(const IndexType* values, IndexType start_ID, IndexType n_values, - CellType AXOM_NOT_USED(type) = UNDEFINED_CELL) + CellType AXOM_UNUSED_PARAM(type) = UNDEFINED_CELL) { IndexType offsets[2]; offsets[0] = 0; @@ -630,7 +630,7 @@ class ConnectivityArray IndexType start_ID, IndexType n_IDs, const IndexType* offsets, - const CellType* AXOM_NOT_USED(types) = nullptr) + const CellType* AXOM_UNUSED_PARAM(types) = nullptr) { internal::insert(start_ID, n_IDs, values, offsets, m_values, m_offsets); } diff --git a/src/axom/mint/mesh/internal/MeshHelpers.hpp b/src/axom/mint/mesh/internal/MeshHelpers.hpp index f2e533c6ef..8d85bb0340 100644 --- a/src/axom/mint/mesh/internal/MeshHelpers.hpp +++ b/src/axom/mint/mesh/internal/MeshHelpers.hpp @@ -5,7 +5,7 @@ #ifndef MINT_MESH_HELPERS_HPP_ #define MINT_MESH_HELPERS_HPP_ -#include "axom/core/Macros.hpp" // for AXOM_NOT_USED +#include "axom/core/Macros.hpp" // for AXOM_UNUSED_PARAM #include "axom/core/Types.hpp" // for nullptr #include "axom/mint/config.hpp" // for mint compile-time type #include "axom/mint/mesh/CellTypes.hpp" // for CellType @@ -20,7 +20,7 @@ class Mesh; // forward declaration namespace internal { -inline int dim(const double* AXOM_NOT_USED(x), const double* y, const double* z) +inline int dim(const double* AXOM_UNUSED_PARAM(x), const double* y, const double* z) { return ((z != nullptr) ? 3 : ((y != nullptr) ? 2 : 1)); } diff --git a/src/axom/primal/geometry/Polyhedron.hpp b/src/axom/primal/geometry/Polyhedron.hpp index 801ff17d21..f54526afbb 100644 --- a/src/axom/primal/geometry/Polyhedron.hpp +++ b/src/axom/primal/geometry/Polyhedron.hpp @@ -405,7 +405,7 @@ class Polyhedron axom::int8 checkedSize = 0; axom::int8 facesAdded = 0; // # edges * (# vertices per edge) * (# orientation per edge) - axom::int8 checkedEdges[MAX_VERTS * 2 * 2]; + axom::int8 checkedEdges[MAX_VERTS * 2 * 2] = {0}; // Check each vertex for(int i = 0; i < numVertices(); i++) diff --git a/src/axom/primal/geometry/Vector.hpp b/src/axom/primal/geometry/Vector.hpp index 4fb6e04188..fc5da7c8fd 100644 --- a/src/axom/primal/geometry/Vector.hpp +++ b/src/axom/primal/geometry/Vector.hpp @@ -27,6 +27,9 @@ namespace primal template class Vector; +template +class Point; + /// \name Forward Declared Overloaded Operators /// @{ @@ -40,6 +43,26 @@ template AXOM_HOST_DEVICE Vector operator+(const Vector& A, const Vector& B); +/*! + * \brief Adds vector \a V to point \a P and stores the result into a new point + * \param [in] P point on the left-hand side. + * \param [in] V vector on the right-hand side. + * \return resulting point, \f$ p'_i = p_i + v_i \forall i \f$ + */ +template +AXOM_HOST_DEVICE Point operator+(const Point& P, + const Vector& V); + +/*! + * \brief Adds vector \a V to point \a P and stores the result into a new point + * \param [in] V vector on the left-hand side. + * \param [in] P point on the right-hand side. + * \return resulting point, \f$ p'_i = v_i + p_i \forall i \f$ + */ +template +AXOM_HOST_DEVICE Point operator+(const Vector& V, + const Point& P); + /*! * \brief Subtracts vectors A, B and stores the result into a new vector C * \param [in] A vector on the left-hand side. @@ -50,6 +73,16 @@ template AXOM_HOST_DEVICE Vector operator-(const Vector& A, const Vector& B); +/*! + * \brief Subtracts Point \a t from Point \a h, yielding a vector + * \param [in] h the head of the resulting vector + * \param [in] t the tail of the resulting vector + * \return resulting vector, \f$ V_i = h_i - t_i \forall i \f$ + */ +template +AXOM_HOST_DEVICE Vector operator-(const Point& h, + const Point& t); + /*! * \brief Unary negation of a vector instance. * \param [in] vec1 vector instance to negate. @@ -550,6 +583,23 @@ inline Vector operator+(const Vector& vec1, return result; } +//------------------------------------------------------------------------------ +template +AXOM_HOST_DEVICE Point operator+(const Point& P, + const Vector& V) +{ + Point result(P); + result.array() += V.array(); + return result; +} + +template +AXOM_HOST_DEVICE Point operator+(const Vector& V, + const Point& P) +{ + return P + V; +} + //------------------------------------------------------------------------------ template inline Vector operator/(const Vector& vec, const T scalar) @@ -569,6 +619,14 @@ inline Vector operator-(const Vector& vec1, return result; } +//------------------------------------------------------------------------------ +template +AXOM_HOST_DEVICE Vector operator-(const Point& h, + const Point& t) +{ + return Vector(t, h); +} + //------------------------------------------------------------------------------ template inline Vector operator-(const Vector& vec1) diff --git a/src/axom/primal/operators/closest_point.hpp b/src/axom/primal/operators/closest_point.hpp index 009e82ca00..56b1659825 100644 --- a/src/axom/primal/operators/closest_point.hpp +++ b/src/axom/primal/operators/closest_point.hpp @@ -17,7 +17,7 @@ #include "axom/primal/geometry/Point.hpp" #include "axom/primal/geometry/Triangle.hpp" #include "axom/primal/geometry/OrientedBoundingBox.hpp" - +#include "axom/primal/operators/detail/intersect_impl.hpp" namespace axom { namespace primal @@ -60,20 +60,26 @@ namespace primal template AXOM_HOST_DEVICE inline Point closest_point(const Point& P, const Triangle& tri, - int* loc = nullptr) + int* loc = nullptr, + double EPS = 1E-8) { -// convenience macros to access triangle vertices -#define A(t) t[0] -#define B(t) t[1] -#define C(t) t[2] + using PointType = Point; + using VectorType = Vector; + + using detail::isGeq; + using detail::isLeq; + + const PointType& A = tri[0]; + const PointType& B = tri[1]; + const PointType& C = tri[2]; // Check if P in vertex region outside A - Vector ab(A(tri), B(tri)); - Vector ac(A(tri), C(tri)); - Vector ap(A(tri), P); - T d1 = Vector::dot_product(ab, ap); - T d2 = Vector::dot_product(ac, ap); - if(d1 <= 0.0f && d2 <= 0.0f) + const VectorType ab(A, B); + const VectorType ac(A, C); + const VectorType ap(A, P); + const T d1 = VectorType::dot_product(ab, ap); + const T d2 = VectorType::dot_product(ac, ap); + if(isLeq(d1, T(0), EPS) && isLeq(d2, T(0), EPS)) { // A is the closest point if(loc != nullptr) @@ -81,16 +87,15 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, *loc = 0; } - return (A(tri)); - - } // END if + return A; + } //---------------------------------------------------------------------------- // Check if P in vertex region outside B - Vector bp(B(tri), P); - T d3 = Vector::dot_product(ab, bp); - T d4 = Vector::dot_product(ac, bp); - if(d3 >= 0.0f && d4 <= d3) + const VectorType bp(B, P); + const T d3 = VectorType::dot_product(ab, bp); + const T d4 = VectorType::dot_product(ac, bp); + if(isGeq(d3, T(0), EPS) && isLeq(d4, d3, EPS)) { // B is the closest point if(loc != nullptr) @@ -98,36 +103,31 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, *loc = 1; } - return (B(tri)); - - } // END if + return B; + } //---------------------------------------------------------------------------- // Check if P in edge region of AB - T vc = d1 * d4 - d3 * d2; - if(vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) + const T vc = d1 * d4 - d3 * d2; + if(isLeq(vc, T(0), EPS) && isGeq(d1, T(0), EPS) && isLeq(d3, T(0), EPS)) { - T v = d1 / (d1 - d3); - Vector v_ab = ab * v; - - double x = A(tri)[0] + v_ab[0]; - double y = A(tri)[1] + v_ab[1]; - double z = (NDIMS == 3) ? A(tri)[2] + v_ab[2] : 0.0; + const T v = d1 / (d1 - d3); + const VectorType v_ab = ab * v; if(loc != nullptr) { *loc = -1; } - return (Point::make_point(x, y, z)); - } // END if + return A + v_ab; + } //---------------------------------------------------------------------------- // Check if P in vertex region outside C - Vector cp(C(tri), P); - T d5 = Vector::dot_product(ab, cp); - T d6 = Vector::dot_product(ac, cp); - if(d6 >= 0.0f && d5 <= d6) + const VectorType cp(C, P); + const T d5 = VectorType::dot_product(ab, cp); + const T d6 = VectorType::dot_product(ac, cp); + if(isGeq(d6, T(0), EPS) && isLeq(d5, d6, EPS)) { // C is the closest point if(loc != nullptr) @@ -135,71 +135,56 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, *loc = 2; } - return (C(tri)); + return C; } //---------------------------------------------------------------------------- // Check if P in edge region of AC - T vb = d5 * d2 - d1 * d6; - if(vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) + const T vb = d5 * d2 - d1 * d6; + if(isLeq(vb, T(0), EPS) && isGeq(d2, T(0), EPS) && isLeq(d6, T(0), EPS)) { - T w = d2 / (d2 - d6); - Vector w_ac = ac * w; - - double x = A(tri)[0] + w_ac[0]; - double y = A(tri)[1] + w_ac[1]; - double z = (NDIMS == 3) ? A(tri)[2] + w_ac[2] : 0.0; + const T w = d2 / (d2 - d6); + const VectorType w_ac = ac * w; if(loc != nullptr) { *loc = -3; } - return (Point::make_point(x, y, z)); - } // END if + return A + w_ac; + } //---------------------------------------------------------------------------- // Check if P in edge region of BC T va = d3 * d6 - d5 * d4; - if(va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) + if(isLeq(va, T(0), EPS) && isGeq(d4 - d3, T(0), EPS) && + isGeq(d5 - d6, T(0), EPS)) { - T w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); - Vector bc(B(tri), C(tri)); - Vector w_bc = bc * w; - - double x = B(tri)[0] + w_bc[0]; - double y = B(tri)[1] + w_bc[1]; - double z = (NDIMS == 3) ? B(tri)[2] + w_bc[2] : 0.0; + const T w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); + const VectorType bc(B, C); + const VectorType w_bc = bc * w; if(loc != nullptr) { *loc = -2; } - return (Point::make_point(x, y, z)); - } // END if + return B + w_bc; + } //---------------------------------------------------------------------------- // P is inside face region - T denom = 1.0f / (va + vb + vc); - T v = vb * denom; - T w = vc * denom; - Vector N = (ab * v) + (ac * w); - - double x = A(tri)[0] + N[0]; - double y = A(tri)[1] + N[1]; - double z = (NDIMS == 3) ? A(tri)[2] + N[2] : 0.0; + const T denom = T(1) / (va + vb + vc); + const T v = vb * denom; + const T w = vc * denom; + const VectorType N = (ab * v) + (ac * w); if(loc != nullptr) { *loc = Triangle::NUM_TRI_VERTS; } - return (Point::make_point(x, y, z)); - -#undef A -#undef B -#undef C + return A + N; } /*! diff --git a/src/axom/primal/tests/primal_vector.cpp b/src/axom/primal/tests/primal_vector.cpp index 3ed90bd92d..1d667d69ef 100644 --- a/src/axom/primal/tests/primal_vector.cpp +++ b/src/axom/primal/tests/primal_vector.cpp @@ -4,8 +4,10 @@ // SPDX-License-Identifier: (BSD-3-Clause) #include "gtest/gtest.h" +#include "axom/slic.hpp" #include "axom/primal/geometry/Vector.hpp" +#include "axom/primal/geometry/Point.hpp" #include "axom/core/execution/execution_space.hpp" // for execution_space traits #include "axom/core/execution/for_all.hpp" // for_all() @@ -295,6 +297,71 @@ TEST(primal_vector, vector_zero) } } +//------------------------------------------------------------------------------ +TEST(primal_vector, add_point_vector) +{ + constexpr int DIM = 3; + using QPt = primal::Point; + using QVec = primal::Vector; + + { + QPt one {1.}; + QVec zero {0.0}; + EXPECT_EQ(one, one + zero); + EXPECT_EQ(one, zero + one); + EXPECT_EQ(zero + one, one + zero); + } + + { + QPt pt {1.23, 4.56, 7.89}; + QVec vec {.23, .56, .89}; + + EXPECT_EQ(pt + vec, vec + pt); + + QPt pv = pt + -vec; + QPt vp = -vec + pt; + QPt exp {1, 4, 7}; + for(int i = 0; i < DIM; ++i) + { + EXPECT_DOUBLE_EQ(pv[i], vp[i]); + EXPECT_DOUBLE_EQ(exp[i], pv[i]); + } + } +} + +//------------------------------------------------------------------------------ +TEST(primal_vector, subtract_points) +{ + constexpr int DIM = 3; + using QPt = primal::Point; + using QVec = primal::Vector; + + { + QPt zeroPt {0.0}; + QPt onePt {1.0}; + + QVec oneVec {1.0}; + + EXPECT_EQ(oneVec, onePt - zeroPt); + EXPECT_EQ(-oneVec, zeroPt - onePt); + } + + { + QPt head {1.23, 4.56, 7.89}; + QPt tail {.23, .56, .89}; + + QVec diff = head - tail; + QVec exp {1, 4, 7}; + QVec ctor(tail, head); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_DOUBLE_EQ(exp[i], diff[i]); + EXPECT_DOUBLE_EQ(ctor[i], diff[i]); + } + } +} + //------------------------------------------------------------------------------ AXOM_CUDA_TEST(primal_numeric_array, numeric_array_check_policies) { @@ -319,19 +386,13 @@ AXOM_CUDA_TEST(primal_numeric_array, numeric_array_check_policies) } //---------------------------------------------------------------------- -//---------------------------------------------------------------------- -#include "axom/slic/core/SimpleLogger.hpp" -using axom::slic::SimpleLogger; int main(int argc, char* argv[]) { int result = 0; ::testing::InitGoogleTest(&argc, argv); - - SimpleLogger logger; // create & initialize test logger, - - // finalized when exiting main scope + axom::slic::SimpleLogger logger; result = RUN_ALL_TESTS(); diff --git a/src/axom/quest/CMakeLists.txt b/src/axom/quest/CMakeLists.txt index 5b84e9d51e..bea6131b4b 100644 --- a/src/axom/quest/CMakeLists.txt +++ b/src/axom/quest/CMakeLists.txt @@ -8,6 +8,8 @@ #------------------------------------------------------------------------------ # Check necessary dependencies +# +# Note: Quest also optionally depends on Klee, when Klee is enabled #------------------------------------------------------------------------------ axom_component_requires(NAME QUEST COMPONENTS MINT PRIMAL SLAM SLIC SPIN) @@ -94,7 +96,7 @@ blt_list_append(TO quest_depends_on IF ENABLE_OPENMP ELEMENTS openmp) blt_list_append(TO quest_depends_on IF SPARSEHASH_FOUND ELEMENTS sparsehash) blt_list_append(TO quest_depends_on IF MFEM_FOUND ELEMENTS mfem) -if(MFEM_FOUND AND AXOM_USE_KLEE AND AXOM_USE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION) +if(MFEM_FOUND AND AXOM_ENABLE_KLEE AND AXOM_ENABLE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION) list(APPEND quest_headers Shaper.hpp SamplingShaper.hpp IntersectionShaper.hpp diff --git a/src/axom/quest/IntersectionShaper.hpp b/src/axom/quest/IntersectionShaper.hpp index 600b558d2b..fc33817564 100644 --- a/src/axom/quest/IntersectionShaper.hpp +++ b/src/axom/quest/IntersectionShaper.hpp @@ -33,8 +33,8 @@ #include "mfem.hpp" -#include "fmt/fmt.hpp" -#include "fmt/locale.h" +#include "axom/fmt.hpp" +#include "axom/fmt/locale.h" // RAJA #if defined(AXOM_USE_RAJA) @@ -204,10 +204,11 @@ class IntersectionShaper : public Shaper void prepareShapeQueryImpl(klee::Dimensions shapeDimension, const klee::Shape& shape) { - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format("Running intersection-based shaper in execution Space: {}", - axom::execution_space::name()))); + axom::fmt::format( + "Running intersection-based shaper in execution Space: {}", + axom::execution_space::name()))); umpire::ResourceManager& rm = umpire::ResourceManager::getInstance(); @@ -225,20 +226,22 @@ class IntersectionShaper : public Shaper AXOM_UNUSED_VAR(shapeDimension); AXOM_UNUSED_VAR(shapeName); - SLIC_INFO(fmt::format("Current shape is {}", shapeName)); + SLIC_INFO(axom::fmt::format("Current shape is {}", shapeName)); // Number of points in polyline int pointcount = getSurfaceMesh()->getNumberOfNodes(); Point2D* polyline = axom::allocate(pointcount); - SLIC_INFO(fmt::format("{:-^80}", - fmt::format(" Refinement level set to {} ", m_level))); + SLIC_INFO(axom::fmt::format( + "{:-^80}", + axom::fmt::format(" Refinement level set to {} ", m_level))); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format(" Checking contour with {} points for degenerate segments ", - pointcount))); + axom::fmt::format( + " Checking contour with {} points for degenerate segments ", + pointcount))); enum { @@ -299,9 +302,9 @@ class IntersectionShaper : public Shaper } } - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format(" Discretizing contour with {} points ", polyline_size))); + axom::fmt::format(" Discretizing contour with {} points ", polyline_size))); // Flip point order if(flip) @@ -327,8 +330,9 @@ class IntersectionShaper : public Shaper disc_status, "Discretization of contour has failed. Check that contour is valid"); - SLIC_INFO(fmt::format("Contour has been discretized into {} octahedra ", - m_octcount)); + SLIC_INFO( + axom::fmt::format("Contour has been discretized into {} octahedra ", + m_octcount)); if(this->isVerbose()) { @@ -338,10 +342,10 @@ class IntersectionShaper : public Shaper { all_oct_bb.addBox(primal::compute_bounding_box(m_octs[i])); } - SLIC_INFO( - fmt::format("DEBUG: Bounding box containing all generated octahedra " - "has dimensions:\n\t{}", - all_oct_bb)); + SLIC_INFO(axom::fmt::format( + "DEBUG: Bounding box containing all generated octahedra " + "has dimensions:\n\t{}", + all_oct_bb)); // Print out the total volume of all the octahedra using REDUCE_POL = typename axom::execution_space::reduce_policy; @@ -378,9 +382,9 @@ class IntersectionShaper : public Shaper total_oct_vol += octVolume; }); - SLIC_INFO( - fmt::format("DEBUG: Total volume of all generated octahedra is {}", - total_oct_vol.get())); + SLIC_INFO(axom::fmt::format( + "DEBUG: Total volume of all generated octahedra is {}", + total_oct_vol.get())); // Check if any Octahedron are degenerate with all points {0,0,0} RAJA::ReduceSum num_degenerate(0); @@ -395,8 +399,8 @@ class IntersectionShaper : public Shaper }); SLIC_INFO( - fmt::format("DEBUG: {} Octahedron found with all points (0,0,0)", - num_degenerate.get())); + axom::fmt::format("DEBUG: {} Octahedron found with all points (0,0,0)", + num_degenerate.get())); // Dump discretized octs as a tet mesh axom::mint::Mesh* tetmesh; @@ -441,7 +445,8 @@ class IntersectionShaper : public Shaper ZERO[0] = 0; SLIC_INFO( - fmt::format("{:-^80}", " Inserting Octahedra bounding boxes into BVH ")); + axom::fmt::format("{:-^80}", + " Inserting Octahedra bounding boxes into BVH ")); // Generate the BVH tree over the octahedra // Access-aligned bounding boxes @@ -459,7 +464,7 @@ class IntersectionShaper : public Shaper spin::BVH<3, ExecSpace, double> bvh; bvh.initialize(m_aabbs, m_octcount); - SLIC_INFO(fmt::format("{:-^80}", " Querying the BVH tree ")); + SLIC_INFO(axom::fmt::format("{:-^80}", " Querying the BVH tree ")); mfem::Mesh* mesh = getDC()->GetMesh(); @@ -470,10 +475,11 @@ class IntersectionShaper : public Shaper if(this->isVerbose()) { - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format(" Initializing {} hexahedral elements from given mesh ", - m_num_elements))); + axom::fmt::format( + " Initializing {} hexahedral elements from given mesh ", + m_num_elements))); } if(NE > 0) @@ -485,7 +491,7 @@ class IntersectionShaper : public Shaper // Create and register a scalar field for this shape's volume fractions // The Degrees of Freedom will be in correspondence with the elements auto* volFrac = this->newVolFracGridFunction(); - auto volFracName = fmt::format("shape_vol_frac_{}", shape.getName()); + auto volFracName = axom::fmt::format("shape_vol_frac_{}", shape.getName()); this->getDC()->RegisterField(volFracName, volFrac); // Initialize hexahedral elements @@ -583,7 +589,7 @@ class IntersectionShaper : public Shaper }); // Find which octahedra bounding boxes intersect hexahedron bounding boxes - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", " Finding octahedra candidates for each hexahedral element ")); @@ -626,7 +632,7 @@ class IntersectionShaper : public Shaper int* newTotalCandidates = axom::allocate(1); axom::copy(newTotalCandidates, ZERO, sizeof(int)); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", " Decomposing each hexahedron element into 24 tetrahedrons ")); @@ -643,9 +649,9 @@ class IntersectionShaper : public Shaper } });); - SLIC_INFO( - fmt::format("{:-^80}", - " Linearizing each tetrahedron, octahedron candidate pair ")); + SLIC_INFO(axom::fmt::format( + "{:-^80}", + " Linearizing each tetrahedron, octahedron candidate pair ")); AXOM_PERF_MARK_SECTION( "init_candidates", @@ -682,7 +688,8 @@ class IntersectionShaper : public Shaper m_overlap_volumes[i] = 0; }); - SLIC_INFO(fmt::format("{:-^80}", " Calculating hexahedron element volume ")); + SLIC_INFO( + axom::fmt::format("{:-^80}", " Calculating hexahedron element volume ")); AXOM_PERF_MARK_SECTION("hex_volume", axom::for_all( @@ -694,7 +701,7 @@ class IntersectionShaper : public Shaper tet_volume); });); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", " Calculating element overlap volume from each tet-oct pair ")); @@ -731,10 +738,10 @@ class IntersectionShaper : public Shaper totalHex += m_hex_volumes[i]; }); - SLIC_INFO(fmt::format("Total overlap volume with shape is {}", - this->allReduceSum(totalOverlap))); - SLIC_INFO( - fmt::format("Total mesh volume is {}", this->allReduceSum(totalHex))); + SLIC_INFO(axom::fmt::format("Total overlap volume with shape is {}", + this->allReduceSum(totalOverlap))); + SLIC_INFO(axom::fmt::format("Total mesh volume is {}", + this->allReduceSum(totalHex))); // Deallocate no longer needed variables axom::deallocate(ZERO); @@ -758,14 +765,15 @@ class IntersectionShaper : public Shaper { const auto& shapeName = shape.getName(); const auto& materialName = shape.getMaterial(); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format("Applying replacement rules for shape '{}' of material {}", - shapeName, - materialName))); + axom::fmt::format( + "Applying replacement rules for shape '{}' of material {}", + shapeName, + materialName))); - auto shapeVolFracName = fmt::format("shape_vol_frac_{}", shapeName); - auto materialVolFracName = fmt::format("vol_frac_{}", materialName); + auto shapeVolFracName = axom::fmt::format("shape_vol_frac_{}", shapeName); + auto materialVolFracName = axom::fmt::format("vol_frac_{}", materialName); auto* shapeVolFrac = this->getDC()->GetField(shapeVolFracName); SLIC_ASSERT(shapeVolFrac != nullptr); diff --git a/src/axom/quest/MeshTester.hpp b/src/axom/quest/MeshTester.hpp index 5fbedf101a..24a2287a57 100644 --- a/src/axom/quest/MeshTester.hpp +++ b/src/axom/quest/MeshTester.hpp @@ -159,28 +159,29 @@ void findTriMeshIntersectionsBVH( // Initialize the bounding box for each Triangle and marks // if the Triangle is degenerate. - AXOM_PERF_MARK_SECTION("init_tri_bb", - mint::for_all_cells( - surface_mesh, - AXOM_LAMBDA(IndexType cellIdx, - numerics::Matrix & coords, - const IndexType* AXOM_NOT_USED(nodeIds)) { - detail::Triangle3 tri; - - for(IndexType inode = 0; inode < 3; ++inode) - { - const double* node = coords.getColumn(inode); - tri[inode][0] = node[mint::X_COORDINATE]; - tri[inode][1] = node[mint::Y_COORDINATE]; - tri[inode][2] = node[mint::Z_COORDINATE]; - } // END for all cells nodes + AXOM_PERF_MARK_SECTION( + "init_tri_bb", + mint::for_all_cells( + surface_mesh, + AXOM_LAMBDA(IndexType cellIdx, + numerics::Matrix & coords, + const IndexType* AXOM_UNUSED_PARAM(nodeIds)) { + detail::Triangle3 tri; + + for(IndexType inode = 0; inode < 3; ++inode) + { + const double* node = coords.getColumn(inode); + tri[inode][0] = node[mint::X_COORDINATE]; + tri[inode][1] = node[mint::Y_COORDINATE]; + tri[inode][2] = node[mint::Z_COORDINATE]; + } // END for all cells nodes - degenerate[cellIdx] = (tri.degenerate() ? 1 : 0); + degenerate[cellIdx] = (tri.degenerate() ? 1 : 0); - tris[cellIdx] = tri; + tris[cellIdx] = tri; - aabbs[cellIdx] = compute_bounding_box(tri); - });); + aabbs[cellIdx] = compute_bounding_box(tri); + });); // Copy degenerate data back to host int* host_degenerate = diff --git a/src/axom/quest/SamplingShaper.hpp b/src/axom/quest/SamplingShaper.hpp index f648a084a1..5042f81236 100644 --- a/src/axom/quest/SamplingShaper.hpp +++ b/src/axom/quest/SamplingShaper.hpp @@ -33,8 +33,8 @@ #include "mfem.hpp" -#include "fmt/fmt.hpp" -#include "fmt/locale.h" +#include "axom/fmt.hpp" +#include "axom/fmt/locale.h" namespace axom { @@ -131,7 +131,7 @@ class InOutSampler // Sample the in/out field at each point // store in QField which we register with the QFunc collection - const std::string inoutName = fmt::format("inout_{}", m_shapeName); + const std::string inoutName = axom::fmt::format("inout_{}", m_shapeName); const int vdim = 1; auto* inout = new mfem::QuadratureFunction(sp, vdim); inoutQFuncs.Register(inoutName, inout, true); @@ -151,17 +151,18 @@ class InOutSampler const bool in = m_octree->within(pt); res(p) = in ? 1. : 0.; - // SLIC_INFO(fmt::format("[{},{}] Pt: {}, In: {}", i,p,pt, (in? "yes" : "no") )); + // SLIC_INFO(axom::fmt::format("[{},{}] Pt: {}, In: {}", i,p,pt, (in? "yes" : "no") )); } } timer.stop(); - SLIC_INFO(fmt::format(std::locale("en_US.UTF-8"), - "\t Sampling inout field '{}' took {} seconds (@ " - "{:L} queries per second)", - inoutName, - timer.elapsed(), - static_cast((NE * nq) / timer.elapsed()))); + SLIC_INFO( + axom::fmt::format(std::locale("en_US.UTF-8"), + "\t Sampling inout field '{}' took {} seconds (@ " + "{:L} queries per second)", + inoutName, + timer.elapsed(), + static_cast((NE * nq) / timer.elapsed()))); } /** @@ -169,7 +170,7 @@ class InOutSampler * in region defined by bounding box \a queryBounds */ void computeVolumeFractionsBaseline(mfem::DataCollection* dc, - int AXOM_NOT_USED(sampleRes), + int AXOM_UNUSED_PARAM(sampleRes), int outputOrder) { // Step 1 -- generate a QField w/ the spatial coordinates @@ -188,7 +189,7 @@ class InOutSampler mfem::FiniteElementSpace* fes = new mfem::FiniteElementSpace(mesh, coll); mfem::GridFunction* volFrac = new mfem::GridFunction(fes); volFrac->MakeOwner(coll); - auto volFracName = fmt::format("vol_frac_{}", m_shapeName); + auto volFracName = axom::fmt::format("vol_frac_{}", m_shapeName); dc->RegisterField(volFracName, volFrac); auto* fe = fes->GetFE(0); @@ -298,7 +299,7 @@ class SamplingShaper : public Shaper { const auto& shapeName = shape.getName(); - SLIC_INFO(fmt::format("{:-^80}", " Generating the octree ")); + SLIC_INFO(axom::fmt::format("{:-^80}", " Generating the octree ")); internal::ScopedLogLevelChanger logLevelChanger( this->isVerbose() ? slic::message::Debug : slic::message::Warning); @@ -336,20 +337,20 @@ class SamplingShaper : public Shaper const int nVerts = m_surfaceMesh->getNumberOfNodes(); const int nCells = m_surfaceMesh->getNumberOfCells(); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "After welding, surface mesh has {} vertices and {} triangles.", nVerts, nCells)); mint::write_vtk(m_surfaceMesh, - fmt::format("meldedTriMesh_{}.vtk", shapeName)); + axom::fmt::format("meldedTriMesh_{}.vtk", shapeName)); } } void runShapeQuery(const klee::Shape& shape) override { - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format(" Querying the octree for shape '{}'", shape.getName()))); + axom::fmt::format(" Querying the octree for shape '{}'", shape.getName()))); internal::ScopedLogLevelChanger logLevelChanger( this->isVerbose() ? slic::message::Debug : slic::message::Warning); @@ -367,21 +368,23 @@ class SamplingShaper : public Shaper void applyReplacementRules(const klee::Shape& shape) override { - using axom::utilities::string::splitLastNTokens; + using axom::utilities::string::rsplitN; const auto& shapeName = shape.getName(); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format("Applying replacement rules over for shape '{}'", shapeName))); + axom::fmt::format("Applying replacement rules over for shape '{}'", + shapeName))); internal::ScopedLogLevelChanger logLevelChanger( this->isVerbose() ? slic::message::Debug : slic::message::Warning); // Get inout qfunc for this shape - auto* shapeQFunc = m_inoutShapeQFuncs.Get(fmt::format("inout_{}", shapeName)); + auto* shapeQFunc = + m_inoutShapeQFuncs.Get(axom::fmt::format("inout_{}", shapeName)); SLIC_ASSERT_MSG( shapeQFunc != nullptr, - fmt::format("Missing inout samples for shape '{}'", shapeName)); + axom::fmt::format("Missing inout samples for shape '{}'", shapeName)); // Create a copy of the inout samples for this shape // Replacements will be applied to this and then copied into our shape's material @@ -391,7 +394,7 @@ class SamplingShaper : public Shaper const auto& thisMatName = shape.getMaterial(); for(auto& mat : m_inoutMaterialQFuncs) { - const std::string otherMatName = splitLastNTokens(mat.first, 2, '_')[1]; + const std::string otherMatName = rsplitN(mat.first, 2, '_')[1]; // We'll handle the current shape's material at the end if(otherMatName == thisMatName) @@ -400,7 +403,7 @@ class SamplingShaper : public Shaper } const bool shouldReplace = shape.replaces(otherMatName); - SLIC_DEBUG(fmt::format( + SLIC_DEBUG(axom::fmt::format( "Should we replace material '{}' with shape '{}' of material '{}'? {}", otherMatName, shapeName, @@ -410,14 +413,15 @@ class SamplingShaper : public Shaper auto* otherMatQFunc = mat.second; SLIC_ASSERT_MSG( otherMatQFunc != nullptr, - fmt::format("Missing inout samples for material '{}'", otherMatName)); + axom::fmt::format("Missing inout samples for material '{}'", + otherMatName)); quest::shaping::replaceMaterial(shapeQFuncCopy, otherMatQFunc, shouldReplace); } // Get inout qfunc for the current material const std::string materialQFuncName = - fmt::format("mat_inout_{}", thisMatName); + axom::fmt::format("mat_inout_{}", thisMatName); if(!m_inoutMaterialQFuncs.Has(materialQFuncName)) { // initialize material from shape inout, the QFunc registry takes ownership @@ -429,7 +433,7 @@ class SamplingShaper : public Shaper auto* matQFunc = m_inoutMaterialQFuncs.Get(materialQFuncName); SLIC_ASSERT_MSG( matQFunc != nullptr, - fmt::format("Missing inout samples for material '{}'", thisMatName)); + axom::fmt::format("Missing inout samples for material '{}'", thisMatName)); quest::shaping::copyShapeIntoMaterial(shapeQFuncCopy, matQFunc); @@ -462,8 +466,8 @@ class SamplingShaper : public Shaper { const std::string matName = mat.first; SLIC_INFO( - fmt::format("Generating volume fraction fields for '{}' material", - matName)); + axom::fmt::format("Generating volume fraction fields for '{}' material", + matName)); // Sample the InOut field at the mesh quadrature points switch(m_vfSampling) diff --git a/src/axom/quest/Shaper.cpp b/src/axom/quest/Shaper.cpp index bd053e7e40..6f963c6223 100644 --- a/src/axom/quest/Shaper.cpp +++ b/src/axom/quest/Shaper.cpp @@ -9,7 +9,7 @@ #include "axom/core.hpp" #include "axom/quest/interface/internal/QuestHelpers.hpp" -#include "fmt/fmt.hpp" +#include "axom/fmt.hpp" #ifndef AXOM_USE_MFEM #error Shaping functionality requires Axom to be configured with MFEM and the AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION option @@ -90,7 +90,7 @@ void Shaper::setSamplesPerKnotSpan(int nSamples) using axom::utilities::clampLower; SLIC_WARNING_IF( nSamples < 1, - fmt::format( + axom::fmt::format( "Samples per knot span must be at least 1. Provided value was {}", nSamples)); @@ -101,7 +101,7 @@ void Shaper::setVertexWeldThreshold(double threshold) { SLIC_WARNING_IF( threshold <= 0., - fmt::format( + axom::fmt::format( "Vertex weld threshold should be positive Provided value was {}", threshold)); @@ -117,12 +117,13 @@ void Shaper::loadShape(const klee::Shape& shape) { using axom::utilities::string::endsWith; - SLIC_INFO(fmt::format("{:-^80}", - fmt::format(" Loading shape '{}' ", shape.getName()))); + SLIC_INFO(axom::fmt::format( + "{:-^80}", + axom::fmt::format(" Loading shape '{}' ", shape.getName()))); SLIC_ASSERT_MSG(this->isValidFormat(shape.getGeometry().getFormat()), - fmt::format("Shape has unsupported format: '{}", - shape.getGeometry().getFormat())); + axom::fmt::format("Shape has unsupported format: '{}", + shape.getGeometry().getFormat())); std::string shapePath = m_shapeSet.resolvePath(shape.getGeometry().getPath()); SLIC_INFO("Reading file: " << shapePath << "..."); @@ -144,9 +145,9 @@ void Shaper::loadShape(const klee::Shape& shape) else { SLIC_ERROR( - fmt::format("Unsupported filetype for this Axom configuration. " - "Provided file was '{}'", - shapePath)); + axom::fmt::format("Unsupported filetype for this Axom configuration. " + "Provided file was '{}'", + shapePath)); } } diff --git a/src/axom/quest/Shaper.hpp b/src/axom/quest/Shaper.hpp index 4f85565ba8..c909ee10aa 100644 --- a/src/axom/quest/Shaper.hpp +++ b/src/axom/quest/Shaper.hpp @@ -13,7 +13,7 @@ #define AXOM_QUEST_SHAPER__HPP_ #include "axom/config.hpp" -#ifndef AXOM_ENABLE_KLEE +#ifndef AXOM_USE_KLEE #error Shaping functionality requires Axom to be configured with the Klee component #endif #ifndef AXOM_USE_MFEM diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index 66750821a8..b5f0a124a8 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -77,6 +77,42 @@ struct UcdMeshData */ bool SD_GetUcdMeshData(const mint::Mesh* surfaceMesh, UcdMeshData& outSurfData); +/// Enum for different 'location' types returned by primal::closest_point() +enum class ClosestPointLocType +{ + uninitialized = -1, + vertex = 0, + edge = 1, + face = 2 +}; + +/// Converts from \a loc code returned by primal::closest_point() to a \a ClosestPointLocType enum +AXOM_HOST_DEVICE inline ClosestPointLocType getClosestPointLocType(int loc) +{ + SLIC_ASSERT_MSG(loc >= -3, + "Invalid closest point location type: " + << loc << ". See documentation for primal::closest_point()."); + switch(loc) + { + case -3: // intentional fall-through + case -2: + case -1: + return ClosestPointLocType::edge; + case 0: // intentional fall-through + case 1: + case 2: + return ClosestPointLocType::vertex; + default: + return ClosestPointLocType::face; + } +} + +/// A \a ClosestPointLocType is shared for a vertex or edge, unshared otherwise +AXOM_HOST_DEVICE inline bool isClosestPointTypeShared(ClosestPointLocType cpt) +{ + return cpt == ClosestPointLocType::edge || cpt == ClosestPointLocType::vertex; +} + } // end namespace detail template @@ -93,15 +129,21 @@ class SignedDistance private: struct MinCandidate { - double minSqDist = - numerics::floating_point_limits::max(); // Squared distance to query point - PointType minPt {}; // Closest point on element - int minLoc; // Location of closest point on element - int minElem; // Closest element index in mesh - TriangleType minTri; // The actual cell element - - VectorType sumNormals {}; // The normal if the closest point is on an edge - VectorType sumNormalsAngWt {}; // The normal if the closest point is a node + /// Squared distance to query point + double minSqDist {numerics::floating_point_limits::max()}; + /// Closest point on element + PointType minPt {}; + /// Type of the closest point + detail::ClosestPointLocType minType { + detail::ClosestPointLocType::uninitialized}; + /// Index within mesh of closest element + int minElem; + /// Contains geometry of the closest element + TriangleType minTri; + /// Weighted sum of normals when closest pt is on edge or vertex + VectorType sumNormals {}; + /// Count of the number of elements found at the current closest distance + int minCount {0}; }; public: @@ -267,8 +309,7 @@ class SignedDistance bool computeSign); /*! - * \brief Computes the sign of the given query point given the closest point - * data. + * \brief Computes the sign of the given query point given the closest point data * * \param [in] qpt query point to check against surface element * \param [in] currMin the minimum-distance surface element data @@ -546,56 +587,83 @@ inline void SignedDistance::checkCandidate( TriangleType {meshPts[nodes[0]], meshPts[nodes[2]], meshPts[nodes[3]]}; } + using axom::primal::closest_point; + using axom::primal::squared_distance; + using axom::utilities::isNearlyEqual; + using detail::getClosestPointLocType; + using detail::isClosestPointTypeShared; + constexpr double EPS = 1e-12; + for(int ei = 0; ei < num_candidates; ei++) { int candidate_loc; PointType candidate_pt = - axom::primal::closest_point(qpt, surface_elems[ei], &candidate_loc); - double sq_dist = axom::primal::squared_distance(qpt, candidate_pt); + closest_point(qpt, surface_elems[ei], &candidate_loc, EPS); + double sq_dist = squared_distance(qpt, candidate_pt); + + // Check the type of intersection we found + const auto cpt_type = getClosestPointLocType(candidate_loc); + + // Determine if the closest point is on an edge or vertex + const bool is_cpt_shared = isClosestPointTypeShared(cpt_type); - bool shares_min_pt = true; + bool shouldUpdateNormals = false; if(sq_dist < currMin.minSqDist) { + // Clear the sum of normals if: + const bool shouldClearNormals = + // we're not in a shared configuration + !is_cpt_shared || + // or, if previous closest point type was different than current + (currMin.minType != cpt_type) || + // finally, if there was a previous shared point -- check if approximately same as current + !isNearlyEqual(squared_distance(candidate_pt, currMin.minPt), 0., EPS); + currMin.minSqDist = sq_dist; currMin.minPt = candidate_pt; - currMin.minLoc = candidate_loc; + currMin.minType = cpt_type; currMin.minElem = cellId; currMin.minTri = surface_elems[ei]; - currMin.sumNormals = VectorType {}; - currMin.sumNormalsAngWt = VectorType {}; + if(computeNormal && shouldClearNormals) + { + currMin.sumNormals = VectorType {}; + currMin.minCount = 0; + } + + shouldUpdateNormals = (computeNormal && is_cpt_shared); } else { - // check if we have an element sharing the same closest point - double pt_dist_to_curr = - axom::primal::squared_distance(candidate_pt, currMin.minPt); - shares_min_pt = axom::utilities::isNearlyEqual(pt_dist_to_curr, 0.0, 1e-16); + shouldUpdateNormals = computeNormal && is_cpt_shared && + (currMin.minType == cpt_type) && + isNearlyEqual(squared_distance(candidate_pt, currMin.minPt), 0., EPS); } - if(computeNormal && shares_min_pt && - currMin.minLoc < TriangleType::NUM_TRI_VERTS) + if(shouldUpdateNormals) { VectorType norm = surface_elems[ei].normal(); + ++currMin.minCount; - // 0 = closest point on edge - // 1 = closest point on vertex - // 2 = closest point on face - int cpt_type = (candidate_loc + 3) / 3; - - if(cpt_type == 0) + switch(cpt_type) { + case detail::ClosestPointLocType::edge: // Candidate closest point is on an edge - add the normal of a // potentially-adjacent face currMin.sumNormals += norm; - } - else if(cpt_type == 1 && !surface_elems[ei].degenerate()) - { - // Candidate closest point is on a vertex - add the angle-weighted - // normal of a face potentially sharing a vertex - double alpha = surface_elems[ei].angle(candidate_loc); - currMin.sumNormalsAngWt += (norm.unitVector() * alpha); + break; + case detail::ClosestPointLocType::vertex: + if(!surface_elems[ei].degenerate()) + { + // Candidate closest point is on a vertex - add the angle-weighted + // normal of a face potentially sharing a vertex + double alpha = surface_elems[ei].angle(candidate_loc); + currMin.sumNormals += (norm.unitVector() * alpha); + } + break; + default: + break; // no-op } } } @@ -608,34 +676,22 @@ inline double SignedDistance::computeSign( const MinCandidate& currMin) { double sgn = 1.0; - // STEP 1: Select the pseudo-normal N at the closest point to calculate the - // sign. + // STEP 1: Select the pseudo-normal N at the closest point to calculate the sign. // There are effectively 3 cases based on the location of the closest point. VectorType N; - if(currMin.minLoc >= TriangleType::NUM_TRI_VERTS) + switch(currMin.minType) { + case detail::ClosestPointLocType::face: // CASE 1: closest point is on the face of the surface element N = currMin.minTri.normal(); - } - else if(currMin.minLoc < 0) - { - // CASE 2: closest point is on an edge, use sum of normals of equidistant - // faces - // TODO: Sometimes, the traversal fails to find the opposite face, so only - // a single face's normal is accumulated here. The proper solution would be - // to precompute edge pseudo-normals during construction time, but that - // would also require generating cell-to-face connectivity for the surface - // mesh. + break; + default: // Use precomputed normal for edges and vertices N = currMin.sumNormals; + break; } - else - { - // CASE 3: closest point is on a node, use angle-weighted pseudo-normal - N = currMin.sumNormalsAngWt; - } + // STEP 2: Given the pseudo-normal, N, and the vector r from the closest point - // to the query point, compute the sign by checking the sign of their dot - // product. + // to the query point, compute the sign by checking the sign of their dot product. VectorType r(currMin.minPt, qpt); double dotprod = r.dot(N); sgn = (dotprod >= 0.0) ? 1.0 : -1.0; diff --git a/src/axom/quest/detail/shaping/shaping_helpers.cpp b/src/axom/quest/detail/shaping/shaping_helpers.cpp index 2676aecaa5..a05831c380 100644 --- a/src/axom/quest/detail/shaping/shaping_helpers.cpp +++ b/src/axom/quest/detail/shaping/shaping_helpers.cpp @@ -4,8 +4,8 @@ #include "axom/core.hpp" #include "axom/slic.hpp" -#include "fmt/fmt.hpp" -#include "fmt/locale.h" +#include "axom/fmt.hpp" +#include "axom/fmt/locale.h" #ifndef AXOM_USE_MFEM #error Shaping functionality requires Axom to be configured with MFEM and the AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION option @@ -132,10 +132,10 @@ void computeVolumeFractions(const std::string& matField, QFunctionCollection& inoutQFuncs, int outputOrder) { - using axom::utilities::string::splitLastNTokens; + using axom::utilities::string::rsplitN; - auto matName = splitLastNTokens(matField, 2, '_')[1]; - auto volFracName = fmt::format("vol_frac_{}", matName); + auto matName = rsplitN(matField, 2, '_')[1]; + auto volFracName = axom::fmt::format("vol_frac_{}", matName); // Grab a pointer to the inout samples QFunc mfem::QuadratureFunction* inout = inoutQFuncs.Get(matField); @@ -143,21 +143,21 @@ void computeVolumeFractions(const std::string& matField, const int sampleOrder = inout->GetSpace()->GetElementIntRule(0).GetOrder(); const int sampleNQ = inout->GetSpace()->GetElementIntRule(0).GetNPoints(); const int sampleSZ = inout->GetSpace()->GetSize(); - SLIC_INFO(fmt::format(std::locale("en_US.UTF-8"), - "In computeVolumeFractions(): sample order {} | " - "sample num qpts {} | total samples {:L}", - sampleOrder, - sampleNQ, - sampleSZ)); + SLIC_INFO(axom::fmt::format(std::locale("en_US.UTF-8"), + "In computeVolumeFractions(): sample order {} | " + "sample num qpts {} | total samples {:L}", + sampleOrder, + sampleNQ, + sampleSZ)); mfem::Mesh* mesh = dc->GetMesh(); const int dim = mesh->Dimension(); const int NE = mesh->GetNE(); - SLIC_INFO(fmt::format(std::locale("en_US.UTF-8"), - "Mesh has dim {} and {:L} elements", - dim, - NE)); + SLIC_INFO(axom::fmt::format(std::locale("en_US.UTF-8"), + "Mesh has dim {} and {:L} elements", + dim, + NE)); // Project QField onto volume fractions field @@ -211,13 +211,13 @@ void computeVolumeFractions(const std::string& matField, } } timer.stop(); - SLIC_INFO( - fmt::format(std::locale("en_US.UTF-8"), - "\t Generating volume fractions '{}' took {:.3f} seconds (@ " - "{:L} dofs processed per second)", - volFracName, - timer.elapsed(), - static_cast(fes->GetNDofs() / timer.elapsed()))); + SLIC_INFO(axom::fmt::format( + std::locale("en_US.UTF-8"), + "\t Generating volume fractions '{}' took {:.3f} seconds (@ " + "{:L} dofs processed per second)", + volFracName, + timer.elapsed(), + static_cast(fes->GetNDofs() / timer.elapsed()))); } /** @@ -266,10 +266,10 @@ void FCT_project(mfem::DenseMatrix& M, #ifdef AXOM_DEBUG SLIC_WARNING_IF(!(y_min < y_avg + 1e-12 && y_avg < y_max + 1e-12), - fmt::format("Average ({}) is out of bounds [{},{}]: ", - y_avg, - y_min - 1e-12, - y_max + 1e-12)); + axom::fmt::format("Average ({}) is out of bounds [{},{}]: ", + y_avg, + y_min - 1e-12, + y_max + 1e-12)); #endif Vector z(s); @@ -372,7 +372,7 @@ void computeVolumeFractionsIdentity(mfem::DataCollection* dc, const int dim = mesh->Dimension(); const int NE = mesh->GetNE(); - std::cout << fmt::format("Mesh has dim {} and {} elements", dim, NE) + std::cout << axom::fmt::format("Mesh has dim {} and {} elements", dim, NE) << std::endl; mfem::L2_FECollection* fec = diff --git a/src/axom/quest/examples/CMakeLists.txt b/src/axom/quest/examples/CMakeLists.txt index a67648f85e..1300cacee1 100644 --- a/src/axom/quest/examples/CMakeLists.txt +++ b/src/axom/quest/examples/CMakeLists.txt @@ -20,8 +20,8 @@ blt_add_executable( ) if(ENABLE_MPI AND MFEM_FOUND AND MFEM_USE_MPI - AND AXOM_USE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION - AND AXOM_USE_KLEE) + AND AXOM_ENABLE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION + AND AXOM_ENABLE_KLEE) blt_add_executable( NAME quest_shaping_driver_ex SOURCES shaping_driver.cpp diff --git a/src/axom/quest/examples/quest_signed_distance_interface.cpp b/src/axom/quest/examples/quest_signed_distance_interface.cpp index 11668b9039..01a4f50ce8 100644 --- a/src/axom/quest/examples/quest_signed_distance_interface.cpp +++ b/src/axom/quest/examples/quest_signed_distance_interface.cpp @@ -78,7 +78,7 @@ struct Arguments bool use_shared {false}; bool use_batched_query {false}; bool ignore_signs {false}; - quest::SignedDistExec exec_space; + quest::SignedDistExec exec_space {quest::SignedDistExec::CPU}; void parse(int argc, char** argv, axom::CLI::App& app) { diff --git a/src/axom/quest/examples/shaping_driver.cpp b/src/axom/quest/examples/shaping_driver.cpp index ec1c37d622..a1e0ac700b 100644 --- a/src/axom/quest/examples/shaping_driver.cpp +++ b/src/axom/quest/examples/shaping_driver.cpp @@ -17,8 +17,8 @@ #include "axom/klee.hpp" #include "axom/quest.hpp" -#include "fmt/fmt.hpp" -#include "CLI11/CLI11.hpp" +#include "axom/fmt.hpp" +#include "axom/CLI11.hpp" // NOTE: The shaping driver requires Axom to be configured with mfem as well as // the AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION CMake option @@ -115,17 +115,17 @@ struct Input return name; } - void parse(int argc, char** argv, CLI::App& app) + void parse(int argc, char** argv, axom::CLI::App& app) { app.add_option("-m,--mesh-file", meshFile) ->description( "Path to computational mesh (generated by MFEMSidreDataCollection)") - ->check(CLI::ExistingFile) + ->check(axom::CLI::ExistingFile) ->required(); app.add_option("-i,--shape-file", shapeFile) ->description("Path to input shape file") - ->check(CLI::ExistingFile) + ->check(axom::CLI::ExistingFile) ->required(); app.add_flag("-v,--verbose,!--no-verbose", m_verboseOutput) @@ -136,11 +136,11 @@ struct Input ->description( "(2D only) Number of linear segments to generate per NURBS knot span") ->capture_default_str() - ->check(CLI::PositiveNumber); + ->check(axom::CLI::PositiveNumber); app.add_option("-t,--weld-threshold", weldThresh) ->description("Threshold for welding") - ->check(CLI::NonNegativeNumber) + ->check(axom::CLI::NonNegativeNumber) ->capture_default_str(); // Parameter to determine if we're using a file or a box mesh @@ -151,7 +151,8 @@ struct Input ->description( "Determines the shaping method -- either sampling or intersection") ->capture_default_str() - ->transform(CLI::CheckedTransformer(methodMap, CLI::ignore_case)); + ->transform( + axom::CLI::CheckedTransformer(methodMap, axom::CLI::ignore_case)); // parameters that only apply to the sampling method auto* sampling_options = @@ -161,7 +162,7 @@ struct Input sampling_options->add_option("-o,--order", outputOrder) ->description("order of the output grid function") ->capture_default_str() - ->check(CLI::NonNegativeNumber); + ->check(axom::CLI::NonNegativeNumber); sampling_options->add_option("-q,--quadrature-order", quadratureOrder) ->description( @@ -169,7 +170,7 @@ struct Input "Determines number of samples per element in determining " "volume fraction field") ->capture_default_str() - ->check(CLI::PositiveNumber); + ->check(axom::CLI::PositiveNumber); std::map vfsamplingMap { {"qpts", VolFracSampling::SAMPLE_AT_QPTS}, @@ -180,7 +181,8 @@ struct Input "Sampling either at quadrature points or collocated with " "degrees of freedom") ->capture_default_str() - ->transform(CLI::CheckedTransformer(vfsamplingMap, CLI::ignore_case)); + ->transform( + axom::CLI::CheckedTransformer(vfsamplingMap, axom::CLI::ignore_case)); // parameters that only apply to the intersection method auto* intersection_options = @@ -190,7 +192,7 @@ struct Input intersection_options->add_option("-r, --refinements", refinementLevel) ->description("Number of refinements to perform for revolved contour") ->capture_default_str() - ->check(CLI::NonNegativeNumber); + ->check(axom::CLI::NonNegativeNumber); std::stringstream pol_sstr; pol_sstr << "Set runtime policy for intersection-based sampling method."; @@ -206,7 +208,7 @@ struct Input intersection_options->add_option("-p, --policy", policy, pol_sstr.str()) ->capture_default_str() - ->transform(CLI::CheckedTransformer(s_validPolicies)); + ->transform(axom::CLI::CheckedTransformer(s_validPolicies)); app.get_formatter()->column_width(50); @@ -254,7 +256,7 @@ void printMeshInfo(mfem::Mesh* mesh, const std::string& prefixMessage = "") switch(mesh->Dimension()) { case 2: - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{} mesh has {} elements and (approximate) bounding box {}", prefixMessage, numElements, @@ -262,7 +264,7 @@ void printMeshInfo(mfem::Mesh* mesh, const std::string& prefixMessage = "") primal::Point(maxs.GetData())))); break; case 3: - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{} mesh has {} elements and (approximate) bounding box {}", prefixMessage, numElements, @@ -337,13 +339,13 @@ int main(int argc, char** argv) // Set up and parse command line arguments //--------------------------------------------------------------------------- Input params; - CLI::App app {"Driver for Klee shaping query"}; + axom::CLI::App app {"Driver for Klee shaping query"}; try { params.parse(argc, argv, app); } - catch(const CLI::ParseError& e) + catch(const axom::CLI::ParseError& e) { int retval = -1; if(my_rank == 0) @@ -371,14 +373,15 @@ int main(int argc, char** argv) std::vector errs; for(auto verificationError : error.getErrors()) { - errs.push_back(fmt::format(" - '{}': {}", - static_cast(verificationError.path), - verificationError.message)); + errs.push_back( + axom::fmt::format(" - '{}': {}", + static_cast(verificationError.path), + verificationError.message)); } - SLIC_WARNING(fmt::format( + SLIC_WARNING(axom::fmt::format( "Error during parsing klee input. Found the following errors:\n{}", - fmt::join(errs, "\n"))); + axom::fmt::join(errs, "\n"))); finalizeLogger(); @@ -392,7 +395,7 @@ int main(int argc, char** argv) // Apply error checking #ifndef AXOM_USE_C2C - SLIC_ERROR_IF(shapeDim == klee::Dimension::Two, + SLIC_ERROR_IF(shapeDim == klee::Dimensions::Two, "Shaping with contour files requires an Axom configured with " "the C2C library"); #endif @@ -464,7 +467,7 @@ int main(int argc, char** argv) //--------------------------------------------------------------------------- // Process each of the shapes //--------------------------------------------------------------------------- - SLIC_INFO(fmt::format("{:=^80}", "Sampling InOut fields for shapes")); + SLIC_INFO(axom::fmt::format("{:=^80}", "Sampling InOut fields for shapes")); for(const auto& shape : params.shapeSet.getShapes()) { // Load the shape from file @@ -496,7 +499,8 @@ int main(int argc, char** argv) // After shaping in all shapes, generate/adjust the material volume fractions //--------------------------------------------------------------------------- SLIC_INFO( - fmt::format("{:=^80}", "Generating volume fraction fields for materials")); + axom::fmt::format("{:=^80}", + "Generating volume fraction fields for materials")); shaper->adjustVolumeFractions(); diff --git a/src/axom/quest/tests/CMakeLists.txt b/src/axom/quest/tests/CMakeLists.txt index 4c2cb05d94..f23b3c4f22 100644 --- a/src/axom/quest/tests/CMakeLists.txt +++ b/src/axom/quest/tests/CMakeLists.txt @@ -16,7 +16,7 @@ set(quest_tests quest_vertex_weld.cpp ) -blt_list_append(TO quest_tests +blt_list_append(TO quest_tests IF C2C_FOUND ELEMENTS quest_c2c_reader.cpp) @@ -96,7 +96,7 @@ set(quest_mpi_tests ) # Optionally, add tests that require AXOM_DATA_DIR -blt_list_append(TO quest_mpi_tests +blt_list_append(TO quest_mpi_tests IF AXOM_DATA_DIR ELEMENTS quest_inout_interface.cpp ) @@ -182,39 +182,44 @@ if (ENABLE_MPI AND AXOM_ENABLE_SIDRE) # Add resolution tests for each dataset and resolution if(AXOM_DATA_DIR) set(quest_data_dir ${AXOM_DATA_DIR}/quest) - - set(quest_regression_datasets - sphere - ) - set(quest_regression_resolutions - 16 - ) + # Datasets contain a mesh name and resolution delimited by a colon + set(quest_regression_datasets sphere:16 + tetrahedron:31) + + # Add additional regression datasets when its config variable is defined blt_list_append( TO quest_regression_datasets - ELEMENTS aatbase_3_binary - cap - naca0012 - plane_binary - plane_simp - IF AXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS - ) - blt_list_append( - TO quest_regression_resolutions - ELEMENTS 32 + ELEMENTS aatbase_3_binary:16 + aatbase_3_binary:32 + boxedSphere:40 + cap:16 + cap:32 + naca0012:16 + naca0012:32 + plane_binary:16 + plane_binary:32 + plane_simp:16 + plane_simp:32 + plane_simp:120_120_60 + sphere:32 + tetrahedron:100 IF AXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS ) - foreach(dataset ${quest_regression_datasets}) - foreach(res ${quest_regression_resolutions}) - axom_add_test( - NAME quest_regression_${dataset}_${res} - COMMAND ${test_name} - --mesh ${quest_data_dir}/${dataset}.stl - --baseline ${quest_data_dir}/regression/${dataset}_${res}_baseline.root - NUM_MPI_TASKS 1 - ) - endforeach() + foreach(el ${quest_regression_datasets}) + # Extract mesh and resolution from the dataset string + string(REPLACE ":" ";" _dataset_res ${el}) + list(GET _dataset_res 0 _dataset) + list(GET _dataset_res 1 _res) + + axom_add_test( + NAME quest_regression_${_dataset}_${_res} + COMMAND ${test_name} + --mesh ${quest_data_dir}/${_dataset}.stl + --baseline ${quest_data_dir}/regression/${_dataset}_${_res}_baseline.root + NUM_MPI_TASKS 1 + ) endforeach() endif() endif() diff --git a/src/axom/sidre/core/Array.hpp b/src/axom/sidre/core/Array.hpp index 29254250dc..5d8f5b3920 100644 --- a/src/axom/sidre/core/Array.hpp +++ b/src/axom/sidre/core/Array.hpp @@ -32,7 +32,7 @@ constexpr axom::IndexType ZERO = 0; namespace detail { inline void describeViewImpl(TypeID T_type, - const std::array& shape, + const StackArray& shape, View* view) { SLIC_ASSERT(view != nullptr); @@ -43,7 +43,7 @@ inline void describeViewImpl(TypeID T_type, } inline void describeViewImpl(TypeID T_type, - const std::array& shape, + const StackArray& shape, View* view) { SLIC_ASSERT(view != nullptr); diff --git a/src/axom/slam/Map.hpp b/src/axom/slam/Map.hpp index e440047ddb..3d49bb2bcd 100644 --- a/src/axom/slam/Map.hpp +++ b/src/axom/slam/Map.hpp @@ -394,7 +394,7 @@ class Map : public MapBase, public StridePolicy // setStride function should not be called after constructor is called. // This (should) override the StridePolicy setStride(s) function. - void setStride(SetPosition AXOM_NOT_USED(str)) + void setStride(SetPosition AXOM_UNUSED_PARAM(str)) { SLIC_ASSERT_MSG(false, "Stride should not be changed after construction of map."); diff --git a/src/axom/slam/NullSet.hpp b/src/axom/slam/NullSet.hpp index e203070af2..45090f7b3e 100644 --- a/src/axom/slam/NullSet.hpp +++ b/src/axom/slam/NullSet.hpp @@ -50,7 +50,10 @@ class NullSet : public Set inline bool isSubset() const { return false; } const ParentSet* parentSet() const { return this; } - bool isValid(bool AXOM_NOT_USED(verboseOutput) = false) const { return true; } + bool isValid(bool AXOM_UNUSED_PARAM(verboseOutput) = false) const + { + return true; + } bool empty() const { return true; } diff --git a/src/axom/slam/policies/CardinalityPolicies.hpp b/src/axom/slam/policies/CardinalityPolicies.hpp index ce7bb98ceb..7944ffc65a 100644 --- a/src/axom/slam/policies/CardinalityPolicies.hpp +++ b/src/axom/slam/policies/CardinalityPolicies.hpp @@ -92,7 +92,7 @@ struct ConstantCardinality m_begins = builder; } - const ElementType size(ElementType AXOM_NOT_USED(fromPos)) const + const ElementType size(ElementType AXOM_UNUSED_PARAM(fromPos)) const { return m_begins.stride(); } @@ -111,7 +111,7 @@ struct ConstantCardinality template bool isValid(const FromSetType* fromSet, - bool AXOM_NOT_USED(vertboseOutput) = false) const + bool AXOM_UNUSED_PARAM(verboseOutput) = false) const { return m_begins.size() == fromSet->size(); } diff --git a/src/axom/slam/tests/slam_relation_StaticConstant.cpp b/src/axom/slam/tests/slam_relation_StaticConstant.cpp index 6d154aafcf..0d9463eca9 100644 --- a/src/axom/slam/tests/slam_relation_StaticConstant.cpp +++ b/src/axom/slam/tests/slam_relation_StaticConstant.cpp @@ -85,7 +85,7 @@ void printVector(StrType const& msg, VecType const& vec) SLIC_INFO(msg << ": " << sstr.str()); } -SetPosition elementCardinality(SetPosition AXOM_NOT_USED(fromPos)) +SetPosition elementCardinality(SetPosition AXOM_UNUSED_PARAM(fromPos)) { return ELEM_STRIDE; } diff --git a/src/axom/slic/docs/sphinx/sections/architecture.rst b/src/axom/slic/docs/sphinx/sections/architecture.rst index 6e661e53f0..d403e5718b 100644 --- a/src/axom/slic/docs/sphinx/sections/architecture.rst +++ b/src/axom/slic/docs/sphinx/sections/architecture.rst @@ -400,7 +400,7 @@ The ``MyStream`` class implements the ``LogStream::append()`` method of the const std::string& tagName, const std::string& fileName, int line, - bool AXOM_NOT_USED(filtered_duplicates) ) + bool AXOM_UNUSED_PARAM(filtered_duplicates) ) { assert( m_stream != nillptr ); diff --git a/src/axom/slic/examples/basic/logging.cpp b/src/axom/slic/examples/basic/logging.cpp index 234b8c8ea2..bbc45a1b2b 100644 --- a/src/axom/slic/examples/basic/logging.cpp +++ b/src/axom/slic/examples/basic/logging.cpp @@ -13,7 +13,7 @@ using namespace axom; //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { // SPHINX_SLIC_INIT_BEGIN diff --git a/src/axom/slic/interface/slic_macros.hpp b/src/axom/slic/interface/slic_macros.hpp index 88c60023b0..459c91d9f1 100644 --- a/src/axom/slic/interface/slic_macros.hpp +++ b/src/axom/slic/interface/slic_macros.hpp @@ -7,7 +7,7 @@ #define AXOM_SLIC_MACROS_HPP_ #include "axom/config.hpp" -#include "axom/core/Macros.hpp" // for AXOM_HOST_DEVICE macros +#include "axom/core/Macros.hpp" /*! * \file slic_macros.hpp @@ -125,7 +125,7 @@ * \brief Asserts that a given expression is true. If the expression is not true * an error will be logged and the application will be aborted. * \param [in] EXP user-supplied boolean expression. - * \note This macro is only active when debugging is turned on. + * \note This macro is only active when AXOM_DEBUG is defined. * \warning This macro calls processAbort() if EXP is false. * * Usage: @@ -150,7 +150,7 @@ * \brief Same as SLIC_ASSERT, but with a custom error message. * \param [in] EXP user-supplied boolean expression. * \param [in] msg user-supplied message - * \note This macro is only active when debugging is turned on. + * \note This macro is only active when AXOM_DEBUG is defined. * \warning This macro calls processAbort() if EXP is false. * \see SLIC_ASSERT( EXP ) * @@ -183,7 +183,7 @@ * a warning is logged, but, in contrast to the similar SLIC_ASSERT macro the * application is not aborted. * \param [in] EXP user-supplied boolean expression. - * \note This macro is only active when debugging is turned on. + * \note This macro is only active when AXOM_DEBUG is defined. * * Usage: * \code @@ -214,7 +214,7 @@ * \brief Same as SLIC_CHECK, but with a custom error message. * \param [in] EXP user-supplied boolean expression. * \param [in] msg user-supplied message - * \note This macro is only active when debugging is turned on. + * \note This macro is only active when AXOM_DEBUG is defined. * \see SLIC_DEBUG( EXP ) * * Usage: @@ -316,7 +316,7 @@ * \def SLIC_DEBUG( msg ) * \brief Logs a Debug message. * \param [in] msg user-supplied message - * \note The SLIC_Debug macro is active in debug mode. + * \note The SLIC_Debug macro is active when AXOM_DEBUG is defined. * * Usage: * \code @@ -340,7 +340,7 @@ * \brief Logs an Debug message iff EXP is true * \param [in] EXP user-supplied boolean expression. * \param [in] msg user-supplied message. - * \note The SLIC_DEBUG_IF macro is active in debug mode. + * \note The SLIC_DEBUG_IF macro is active when AXOM_DEBUG is defined. * * Usage: * \code diff --git a/src/axom/slic/streams/GenericOutputStream.cpp b/src/axom/slic/streams/GenericOutputStream.cpp index fe753adf39..60dc86d05b 100644 --- a/src/axom/slic/streams/GenericOutputStream.cpp +++ b/src/axom/slic/streams/GenericOutputStream.cpp @@ -30,7 +30,7 @@ void GenericOutputStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_NOT_USED(filtered_duplicates)) + bool AXOM_UNUSED_PARAM(filtered_duplicates)) { if(m_stream == nullptr) { diff --git a/src/axom/slic/streams/LumberjackStream.cpp b/src/axom/slic/streams/LumberjackStream.cpp index 1d703b1b29..6c86496a8d 100644 --- a/src/axom/slic/streams/LumberjackStream.cpp +++ b/src/axom/slic/streams/LumberjackStream.cpp @@ -72,7 +72,7 @@ void LumberjackStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_NOT_USED(filter_duplicates)) + bool AXOM_UNUSED_PARAM(filter_duplicates)) { if(m_lj == nullptr) { diff --git a/src/axom/slic/streams/SynchronizedStream.cpp b/src/axom/slic/streams/SynchronizedStream.cpp index 7c89e7e9c7..4bfb6d12fc 100644 --- a/src/axom/slic/streams/SynchronizedStream.cpp +++ b/src/axom/slic/streams/SynchronizedStream.cpp @@ -73,7 +73,7 @@ void SynchronizedStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_NOT_USED(filter_duplicates)) + bool AXOM_UNUSED_PARAM(filter_duplicates)) { if(m_cache == nullptr) { diff --git a/src/axom/spin/BVH.hpp b/src/axom/spin/BVH.hpp index 7484ab2a6e..95fa32f962 100644 --- a/src/axom/spin/BVH.hpp +++ b/src/axom/spin/BVH.hpp @@ -100,11 +100,13 @@ struct BVHPolicy * spin::BVH< DIMENSION, axom::OMP_EXEC > bvh; * bvh.initialize( aabbs, numItems ); * - * // query points supplied in arrays, qx, qy, qz, + * // query points supplied in arrays, qx, qy, qz * const axom::IndexType numPoints = ... * const double* qx = ... * const double* qy = ... * const double* qz = ... + * //use the ZipPoint class to tie them together + * ZipPoint qpts {{qx,qy,qz}}; * * // output array buffers * axom::IndexType* offsets = axom::allocate< IndexType >( numPoints ); @@ -113,7 +115,7 @@ struct BVHPolicy * * // find candidates in parallel, allocates and populates the supplied * // candidates array - * bvh.findPoints( offsets, counts, candidates, numPoints, qx, qy, qz ); + * bvh.findPoints( offsets, counts, candidates, numPoints, qpts ); * SLIC_ASSERT( candidates != nullptr ); * * ... @@ -148,7 +150,7 @@ class BVH { private: template ()[0])> - static Ret array_operator_type(U AXOM_NOT_USED(obj)) + static Ret array_operator_type(U AXOM_UNUSED_PARAM(obj)) { } static std::false_type array_operator_type(...) diff --git a/src/axom/spin/policy/LinearBVH.hpp b/src/axom/spin/policy/LinearBVH.hpp index 31fbc4a2f4..c4e7a8ecdd 100644 --- a/src/axom/spin/policy/LinearBVH.hpp +++ b/src/axom/spin/policy/LinearBVH.hpp @@ -294,8 +294,8 @@ void LinearBVH::findCandidatesImpl( int32 count = 0; PrimitiveType primitive {objs[i]}; - auto leafAction = [&count](int32 AXOM_NOT_USED(current_node), - const int32* AXOM_NOT_USED(leaf_nodes)) { + auto leafAction = [&count](int32 AXOM_UNUSED_PARAM(current_node), + const int32* AXOM_UNUSED_PARAM(leaf_nodes)) { count++; }; diff --git a/src/axom/spin/tests/spin_bvh.cpp b/src/axom/spin/tests/spin_bvh.cpp index f621c89a2d..c268af3da6 100644 --- a/src/axom/spin/tests/spin_bvh.cpp +++ b/src/axom/spin/tests/spin_bvh.cpp @@ -125,7 +125,7 @@ void generate_aabbs(const mint::Mesh* mesh, mesh, AXOM_LAMBDA(IndexType cellIdx, numerics::Matrix & coords, - const IndexType* AXOM_NOT_USED(nodeIds)) { + const IndexType* AXOM_UNUSED_PARAM(nodeIds)) { primal::BoundingBox range; for(IndexType inode = 0; inode < nodes_per_dim; ++inode) @@ -191,7 +191,7 @@ void generate_aabbs_and_centroids(const mint::Mesh* mesh, mesh, AXOM_LAMBDA(IndexType cellIdx, numerics::Matrix & coords, - const IndexType* AXOM_NOT_USED(nodeIds)) { + const IndexType* AXOM_UNUSED_PARAM(nodeIds)) { BoxType range; PointType sum(0.0); diff --git a/src/cmake/AxomOptions.cmake b/src/cmake/AxomOptions.cmake index 5583a19cf3..29fc22498f 100644 --- a/src/cmake/AxomOptions.cmake +++ b/src/cmake/AxomOptions.cmake @@ -10,7 +10,7 @@ option(AXOM_ENABLE_ANNOTATIONS "Enables code annotations to facilitate performan option(AXOM_ENABLE_SPARSEHASH "Enables Sparsehash." ON) option(AXOM_ENABLE_ALL_COMPONENTS "Enables all components by default" ON) option(AXOM_USE_64BIT_INDEXTYPE "Use 64-bit integers for axom::IndexType" OFF) -option(AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION "Enable Axom's version of the MFEM SidreDataCollection" OFF) +option(AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION "Enable Axom's version of the MFEM SidreDataCollection" ON) if(NOT CMAKE_CONFIGURATION_TYPES) if(CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)") @@ -27,3 +27,12 @@ option(AXOM_ENABLE_TOOLS "Enables Axom Tools" ON) cmake_dependent_option(AXOM_ENABLE_MPI3 "Enables use of MPI-3 features" OFF "ENABLE_MPI" OFF) mark_as_advanced(AXOM_ENABLE_MPI3) + +#-------------------------------------------------------------------------- +# Option to control whether AXOM_DEFINE compiler define is enabled +# +# Possible values are: "ON", "OFF" and "DEFAULT" +# By default, AXOM_DEBUG is defined in Debug and RelWithDebInfo configurations +#-------------------------------------------------------------------------- +set(AXOM_DEBUG_DEFINE "DEFAULT" CACHE STRING "Controls whether AXOM_DEBUG compiler define is enabled") +set_property(CACHE AXOM_DEBUG_DEFINE PROPERTY STRINGS "DEFAULT" "ON" "OFF") diff --git a/src/cmake/AxomVersion.cmake b/src/cmake/AxomVersion.cmake index 63026612b4..772571b299 100644 --- a/src/cmake/AxomVersion.cmake +++ b/src/cmake/AxomVersion.cmake @@ -10,7 +10,7 @@ #------------------------------------------------------------------------------ set(AXOM_VERSION_MAJOR 0) set(AXOM_VERSION_MINOR 6) -set(AXOM_VERSION_PATCH 0) +set(AXOM_VERSION_PATCH 1) string(CONCAT AXOM_VERSION_FULL "v${AXOM_VERSION_MAJOR}" ".${AXOM_VERSION_MINOR}" diff --git a/src/cmake/CMakeBasics.cmake b/src/cmake/CMakeBasics.cmake index c821989197..0faad02aef 100644 --- a/src/cmake/CMakeBasics.cmake +++ b/src/cmake/CMakeBasics.cmake @@ -19,20 +19,35 @@ include(cmake/AxomMacros.cmake) #------------------------------------------------------------------------------ include(cmake/thirdparty/SetupAxomThirdParty.cmake) -if(NOT CMAKE_CONFIGURATION_TYPES) - #-------------------------------------------------------------------------- - # Add define we can use when debug builds are enabled - #-------------------------------------------------------------------------- - if( CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)" ) - add_definitions(-DAXOM_DEBUG) - endif() -else () - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS - $<$:AXOM_DEBUG> - $<$:AXOM_DEBUG> - ) +#------------------------------------------------------------------------------ +# Set up AXOM_DEBUG compiler define string, as appropriate, based on config type. +# Result is stored in AXOM_DEBUG_DEFINE_STRING cache variable +#------------------------------------------------------------------------------ +set(AXOM_DEBUG_DEFINE_STRING "") + +# Handle the three valid values for AXOM_DEBUG_DEFINE: {on, off, default} +string(TOUPPER "${AXOM_DEBUG_DEFINE}" _axom_debug_define_upper) +if("${_axom_debug_define_upper}" MATCHES "ON|TRUE") + set(AXOM_DEBUG_DEFINE_STRING "AXOM_DEBUG") +elseif("${_axom_debug_define_upper}" MATCHES "OFF|FALSE") + # no-op +elseif("${_axom_debug_define_upper}" MATCHES "DEFAULT") + # Default behavior is to be on for Debug and RelWithDebInfo configurations and off otherwise + if(NOT CMAKE_CONFIGURATION_TYPES) # This case handles single-config generators, e.g. make + if( CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)" ) + set(AXOM_DEBUG_DEFINE_STRING "AXOM_DEBUG") + endif() + else () # This case handles multi-config generators, e.g. MSVC + set(AXOM_DEBUG_DEFINE_STRING "$<$:AXOM_DEBUG>") + endif() +else() # Handle bad value for AXOM_DEBUG_DEFINE config variable + message(FATAL_ERROR + "Invalid value for AXOM_DEBUG_DEFINE. Must be 'DEFAULT', 'ON' or 'OFF'; was '${AXOM_DEBUG_DEFINE}'") endif() +set(AXOM_DEBUG_DEFINE_STRING "${AXOM_DEBUG_DEFINE_STRING}" CACHE STRING "" FORCE) +mark_as_advanced(AXOM_DEBUG_DEFINE_STRING) + #------------------------------------------------------------------------------ # Fortran Configuration #------------------------------------------------------------------------------ diff --git a/src/cmake/axom-config.cmake.in b/src/cmake/axom-config.cmake.in index 2b3db3accb..e5e34059e9 100644 --- a/src/cmake/axom-config.cmake.in +++ b/src/cmake/axom-config.cmake.in @@ -14,14 +14,14 @@ if(NOT AXOM_FOUND) # Set version and paths #---------------------------------------------------------------------------- - set(AXOM_VERSION "@AXOM_VERSION_FULL@") - set(AXOM_VERSION_MAJOR "@AXOM_VERSION_MAJOR@") - set(AXOM_VERSION_MINOR "@AXOM_VERSION_MINOR@") - set(AXOM_VERSION_PATCH "@AXOM_VERSION_PATCH@") + set(AXOM_VERSION "@AXOM_VERSION_FULL@") + set(AXOM_VERSION_MAJOR "@AXOM_VERSION_MAJOR@") + set(AXOM_VERSION_MINOR "@AXOM_VERSION_MINOR@") + set(AXOM_VERSION_PATCH "@AXOM_VERSION_PATCH@") + + set(AXOM_INSTALL_PREFIX "@AXOM_INSTALL_PREFIX@") + set(AXOM_INCLUDE_DIRS "${AXOM_INSTALL_PREFIX}/include") - set(AXOM_INSTALL_PREFIX "@AXOM_INSTALL_PREFIX@") - set(AXOM_INCLUDE_DIRS "${AXOM_INSTALL_PREFIX}/include") - #---------------------------------------------------------------------------- # Set user configuration options and features #---------------------------------------------------------------------------- @@ -60,6 +60,10 @@ if(NOT AXOM_FOUND) set(AXOM_USE_SCR "@AXOM_USE_SCR@") set(AXOM_USE_UMPIRE "@AXOM_USE_UMPIRE@") + # Configration for Axom compiler defines + set(AXOM_DEBUG_DEFINE "@AXOM_DEBUG_DEFINE@") + set(AXOM_DEBUG_DEFINE_STRING "@AXOM_DEBUG_DEFINE_STRING@") + #---------------------------------------------------------------------------- # Bring in required dependencies for this axom configuration #---------------------------------------------------------------------------- diff --git a/src/docs/dependencies.dot b/src/docs/dependencies.dot index f03afe36af..a6616d5632 100644 --- a/src/docs/dependencies.dot +++ b/src/docs/dependencies.dot @@ -1,5 +1,6 @@ digraph dependencies { quest -> {slam primal mint spin}; + quest -> klee [style="dashed"]; {inlet klee mint primal quest slam spin} -> {slic core}; mint -> sidre [style="dashed"]; spin -> {slam primal}; diff --git a/src/docs/sphinx/quickstart_guide/config_build.rst b/src/docs/sphinx/quickstart_guide/config_build.rst index 0e1e4c98bb..3f8790fb70 100644 --- a/src/docs/sphinx/quickstart_guide/config_build.rst +++ b/src/docs/sphinx/quickstart_guide/config_build.rst @@ -280,46 +280,51 @@ CMake Configuration Options Here are the key build system options in Axom: -+------------------------------+---------+--------------------------------+ -| OPTION | Default | Description | -+==============================+=========+================================+ -| AXOM_ENABLE_ALL_COMPONENTS | ON | Enable all components | -| | | by default | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_ | ON | Enables the axom component | -| | | named 'foo' | -| | | | -| | | (e.g. AXOM_ENABLE_SIDRE) | -| | | for the sidre component | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_DOCS | ON | Builds documentation | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_EXAMPLES | ON | Builds examples | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_TESTS | ON | Builds unit tests | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_TOOLS | ON | Builds tools | -+------------------------------+---------+--------------------------------+ -| BUILD_SHARED_LIBS | OFF | Build shared libraries. | -| | | Default is Static libraries | -+------------------------------+---------+--------------------------------+ -| ENABLE_ALL_WARNINGS | ON | Enable extra compiler warnings | -| | | in all build targets | -+------------------------------+---------+--------------------------------+ -| ENABLE_BENCHMARKS | OFF | Enable google benchmark | -+------------------------------+---------+--------------------------------+ -| ENABLE_CODECOV | ON | Enable code coverage via gcov | -+------------------------------+---------+--------------------------------+ -| ENABLE_FORTRAN | ON | Enable Fortran compiler | -| | | support | -+------------------------------+---------+--------------------------------+ -| ENABLE_MPI | OFF | Enable MPI | -+------------------------------+---------+--------------------------------+ -| ENABLE_OPENMP | OFF | Enable OpenMP | -+------------------------------+---------+--------------------------------+ -| ENABLE_WARNINGS_AS_ERRORS | OFF | Compiler warnings treated as | -| | | errors. | -+------------------------------+---------+--------------------------------+ ++------------------------------+---------+----------------------------------------+ +| OPTION | Default | Description | ++==============================+=========+========================================+ +| AXOM_DEBUG_DEFINE | DEFAULT | Controls whether the `AXOM_DEBUG` | +| | | compiler define is enabled | +| | | | +| | | By DEFAULT, it is enabled for | +| | | `Debug` and `RelWithDebInfo` configs | +| | | but this can be overridden by setting | +| | | `AXOM_DEBUG_DEFINE` to `ON` or `OFF` | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_ALL_COMPONENTS | ON | Enable all components by default | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_ | ON | Enables the axom component named 'foo' | +| | | | +| | | (e.g. AXOM_ENABLE_SIDRE) | +| | | for the sidre component | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_DOCS | ON | Builds documentation | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_EXAMPLES | ON | Builds examples | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_TESTS | ON | Builds unit tests | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_TOOLS | ON | Builds tools | ++------------------------------+---------+----------------------------------------+ +| BUILD_SHARED_LIBS | OFF | Build shared libraries. | +| | | Default is Static libraries | ++------------------------------+---------+----------------------------------------+ +| ENABLE_ALL_WARNINGS | ON | Enable extra compiler warnings | +| | | in all build targets | ++------------------------------+---------+----------------------------------------+ +| ENABLE_BENCHMARKS | OFF | Enable google benchmark | ++------------------------------+---------+----------------------------------------+ +| ENABLE_CODECOV | ON | Enable code coverage via gcov | ++------------------------------+---------+----------------------------------------+ +| ENABLE_FORTRAN | ON | Enable Fortran compiler support | ++------------------------------+---------+----------------------------------------+ +| ENABLE_MPI | OFF | Enable MPI | ++------------------------------+---------+----------------------------------------+ +| ENABLE_OPENMP | OFF | Enable OpenMP | ++------------------------------+---------+----------------------------------------+ +| ENABLE_WARNINGS_AS_ERRORS | OFF | Compiler warnings treated as errors | +| | | errors. | ++------------------------------+---------+----------------------------------------+ If ``AXOM_ENABLE_ALL_COMPONENTS`` is OFF, you must explicitly enable the desired components (other than 'core', which is always enabled). diff --git a/src/index.rst b/src/index.rst index 9d77783a62..528799c045 100644 --- a/src/index.rst +++ b/src/index.rst @@ -115,9 +115,9 @@ Axom has the following inter-component dependencies: - Slic optionally depends on Lumberjack - Slam, Spin, Primal, Mint, Quest, and Sidre depend on Slic - Mint optionally depends on Sidre -- Quest depends on Slam, Spin, Primal, and Mint - Inlet depends on Sidre, Slic, and Primal - Klee depends on Sidre, Slic, Inlet and Primal +- Quest depends on Slam, Spin, Primal, Mint, and, optionally, Klee The figure below summarizes these dependencies. Solid links indicate hard dependencies; dashed links indicate optional dependencies.