diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcdb6f2e89..2eaf2c8d66 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -36,6 +36,7 @@ stages: - ${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} ${EXTRA_OPTIONS} - echo -e "\e[0Ksection_end:$(date +%s):src_build_and_test\r\e[0K" artifacts: + expire_in: 2 weeks paths: - _axom_build_and_test_*/output.log*.txt - _axom_build_and_test_*/build-*/output.log*.txt @@ -48,6 +49,7 @@ stages: - ${ALLOC_COMMAND} python3 scripts/llnl_scripts/build_tpls.py -v --spec="${SPEC} ${EXTRA_SPEC}" --directory=${FULL_BUILD_ROOT} - echo -e "\e[0Ksection_end:$(date +%s):full_build_and_test\r\e[0K" artifacts: + expire_in: 2 weeks paths: - ${FULL_BUILD_ROOT}/${SYS_TYPE}/*/_axom_build_and_test_*/output.log*.txt - ${FULL_BUILD_ROOT}/${SYS_TYPE}/*/_axom_build_and_test_*/build-*/output.log*.txt diff --git a/.gitlab/build_lassen.yml b/.gitlab/build_lassen.yml index 7167611c20..e2d22eba23 100644 --- a/.gitlab/build_lassen.yml +++ b/.gitlab/build_lassen.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -6,7 +6,6 @@ #### # This is the share configuration of jobs for lassen .on_lassen: - variables: tags: - shell - lassen @@ -23,14 +22,14 @@ .src_build_on_lassen: stage: build variables: - ALLOC_COMMAND: "lalloc 1 -W 25 -q pdebug -alloc_flags atsdisable" + ALLOC_COMMAND: "lalloc 1 -W 25 -q pci -alloc_flags atsdisable" extends: [.src_build_script, .on_lassen, .src_workflow] needs: [] .full_build_on_lassen: stage: build variables: - ALLOC_COMMAND: "lalloc 1 -W 45 -q pdebug -alloc_flags atsdisable" + ALLOC_COMMAND: "lalloc 1 -W 45 -q pci -alloc_flags atsdisable" extends: [.full_build_script, .on_lassen, .full_workflow] needs: [] diff --git a/.gitlab/build_quartz.yml b/.gitlab/build_quartz.yml index 84f0bb867f..c5a4e3d1d8 100644 --- a/.gitlab/build_quartz.yml +++ b/.gitlab/build_quartz.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -10,7 +10,7 @@ - shell - quartz rules: - - if: '$CI_COMMIT_BRANCH =~ /_qnone/ || $ON_RUBY == "OFF"' #run except if ... + - if: '$CI_COMMIT_BRANCH =~ /_qnone/ || $ON_QUARTZ == "OFF"' #run except if ... when: never - if: '$CI_JOB_NAME =~ /quartz_release/' when: always @@ -26,9 +26,7 @@ quartz_allocate: extends: [.on_quartz, .src_workflow] stage: allocate script: - # Use when ellastic ci is on quartz or we go back to ruby - #- salloc --reservation=ci --qos=ci_ruby -N 1 -c 36 -t 60 --no-shell --job-name=${PROJECT_ALLOC_NAME} - - salloc -N 1 -c 36 -t 60 -p pdebug --no-shell --job-name=${PROJECT_ALLOC_NAME} + - salloc -N 1 -c 36 -t 60 --res=ci --no-shell --job-name=${PROJECT_ALLOC_NAME} needs: [] #### @@ -48,8 +46,6 @@ quartz_release: .src_build_on_quartz: stage: build variables: - # Use when ellastic ci is on quartz or we go back to ruby - # ALLOC_COMMAND: "srun --reservation=ci --qos=ci_ruby -t 60 -N 1 " ALLOC_COMMAND: "srun -t 60 -N 1 -p pdebug" extends: [.src_build_script, .on_quartz, .src_workflow] needs: [quartz_allocate] @@ -57,8 +53,6 @@ quartz_release: .full_build_on_quartz: stage: build variables: - # Use when ellastic ci is on quartz or we go back to ruby - # ALLOC_COMMAND: "srun --reservation=ci --qos=ci_ruby -t 60 -N 1 " ALLOC_COMMAND: "srun -t 60 -N 1 -p pdebug" extends: [.full_build_script, .on_quartz, .full_workflow] needs: [] diff --git a/.gitlab/build_rzansel.yml b/.gitlab/build_rzansel.yml index b6988a13fe..390c387dbe 100644 --- a/.gitlab/build_rzansel.yml +++ b/.gitlab/build_rzansel.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -12,7 +12,7 @@ - rzansel before_script: - module load cuda/11.2.0 - - module load cmake/3.18.0 + - module load cmake/3.21.1 #### # Template diff --git a/.gitlab/build_rzgenie.yml b/.gitlab/build_rzgenie.yml index 8ea204f366..2e0300bb04 100644 --- a/.gitlab/build_rzgenie.yml +++ b/.gitlab/build_rzgenie.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/.gitlab/build_tioga.yml b/.gitlab/build_tioga.yml index 8e6555c993..d1ec502610 100644 --- a/.gitlab/build_tioga.yml +++ b/.gitlab/build_tioga.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -21,14 +21,14 @@ .src_build_on_tioga: stage: build variables: - ALLOC_COMMAND: "flux mini run --exclusive --time-limit=30m --nodes=1" + ALLOC_COMMAND: "flux run --queue pci --exclusive --time-limit=30m --nodes=1" extends: [.src_build_script, .on_tioga, .src_workflow] needs: [] .full_build_on_tioga: stage: build variables: - ALLOC_COMMAND: "flux mini run --exclusive --time-limit=60m --nodes=1" + ALLOC_COMMAND: "flux run --queue pci --exclusive --time-limit=60m --nodes=1" extends: [.full_build_script, .on_tioga, .full_workflow] needs: [] @@ -39,14 +39,6 @@ tioga-clang_16_0_0_hip_5_6_0-src: COMPILER: "clang@16.0.0_hip" HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}.cmake" extends: .src_build_on_tioga - allow_failure: true - -tioga-cce_15_0_1_hip_5_4_3-src: - variables: - COMPILER: "cce@15.0.1_hip" - HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}.cmake" - extends: .src_build_on_tioga - allow_failure: true #### # Full Build jobs @@ -56,12 +48,3 @@ tioga-clang_16_0_0_hip_5_6_0-full: SPEC: "%${COMPILER}~openmp+rocm+mfem+c2c" EXTRASPEC: "amdgpu_target=gfx90a ^hip@5.6.0 ^hsa-rocr-dev@5.6.0 ^llvm-amdgpu@5.6.0 ^raja~openmp+rocm ^umpire~openmp+rocm ^hdf5 cflags=-Wno-int-conversion" extends: .full_build_on_tioga - allow_failure: true - -tioga-cce_15_0_1_hip_5_4_3-full: - variables: - COMPILER: "cce@15.0.1_hip" - SPEC: "%${COMPILER}~openmp+rocm+mfem+c2c" - EXTRASPEC: "amdgpu_target=gfx90a ^hip@5.4.3 ^hsa-rocr-dev@5.4.3 ^llvm-amdgpu@5.4.3 ^raja~openmp+rocm ^umpire~openmp+rocm ^hdf5 cflags=-Wno-int-conversion" - extends: .full_build_on_tioga - allow_failure: true diff --git a/.mailmap b/.mailmap index bc5dda36ae..e366e891f9 100644 --- a/.mailmap +++ b/.mailmap @@ -2,6 +2,7 @@ Aaron Black Aaron C. Black Adam J. Kunen Adrien M. Bernede Adrien Bernede <51493078+adrienbernede@users.noreply.github.com> Aesha Parekh Aesha Parekh <29237123+aeshapar@users.noreply.github.com> +Alan Dayton Alan Dayton <6393677+adayton1@users.noreply.github.com> Arlie Capps Arlie Capps Arlie Capps Arlie Capps Arlie Capps Arlie Capps <48997041+agcapps@users.noreply.github.com> @@ -13,6 +14,7 @@ Benjamin Curtice Corbett Benjamin Curtice Corbett Ben Corbett Benjamin Curtice Corbett Benjamin Corbett Benjamin Curtice Corbett Ben Corbett <32752943+corbett5@users.noreply.github.com> +Brad J. Whitlock Brad Whitlock Brian Manh Hien Han Brian Han Brian Manh Hien Han Brian Manh Hien Han Brian T.N. Gunney Brian Gunney <45609916+gunney1@users.noreply.github.com> @@ -24,7 +26,10 @@ Daniel Taller Danny Taller <66029857+dtaller@u Esteban Pauli Esteban Pauli <40901502+estebanpauli@users.noreply.github.com> Evan Taylor Desantola Evan Taylor DeSantola George Zagaris George Zagaris -Jacob Spainhour jcs15c +Jacob Spainhour jcs15c +Jacob Spainhour Jacob Spainhour +Jacob Spainhour Jacob Spainhour +Jamie A. Bramwell Jamie Bramwell Joe Hennis Hennis Joe Hennis hennis1 <73615573+hennis1@users.noreply.github.com> Josh Essman Josh Essman <68349992+joshessman-llnl@users.noreply.github.com> @@ -59,7 +64,6 @@ Robert Carson Robert Robert Carson rcarson3 Robert Cohn rscohn2 Samuel P. Mish samuelpmishLLNL <61714427+samuelpmishLLNL@users.noreply.github.com> -Brad J. Whitlock Brad Whitlock Axom Shared User Asctoolkit Shared User Axom Shared User Asctoolkit Shared User diff --git a/.readthedocs.yml b/.readthedocs.yml index 3298e7ed40..b2f8cfefac 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,6 +10,10 @@ build: os: ubuntu-22.04 tools: python: "3.11" + apt_packages: + - ghostscript + - graphviz + - texlive-full # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/.uberenv_config.json b/.uberenv_config.json index 290a1fd8fc..7bad086557 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -4,12 +4,12 @@ "package_final_phase": "initconfig", "package_source_dir": "../..", "spack_url": "https://github.com/spack/spack.git", -"spack_commit": "44f0708af424cb12dd05dd761de1cdae986ea5cf", +"spack_commit": "0d92b07dbd30b41bc6f50a61f26bc0056dca5e44", "spack_configs_path": "scripts/spack/configs", "spack_packages_path": ["scripts/spack/radiuss-spack-configs/packages", "scripts/spack/packages"], "spack_concretizer": "clingo", "vcpkg_url": "https://github.com/microsoft/vcpkg", -"vcpkg_commit": "6f7ffeb18f99796233b958aaaf14ec7bd4fb64b2", +"vcpkg_commit": "c8696863d371ab7f46e213d8f5ca923c4aef2a00", "vcpkg_triplet": "x64-windows", "vcpkg_ports_path": "scripts/vcpkg_ports" } diff --git a/LICENSE b/LICENSE index 039a20b015..27c1ef4314 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC. +Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index b16bc79a45..347e5b886e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [comment]: # (#################################################################) -[comment]: # (Copyright 2017-2023, Lawrence Livermore National Security, LLC) +[comment]: # (Copyright 2017-2024, Lawrence Livermore National Security, LLC) [comment]: # (and Axom Project Developers. See the top-level LICENSE file) [comment]: # (for details.) [comment]: # @@ -7,7 +7,7 @@ [comment]: # (#################################################################) -# Axom +# Axom [![Azure Pipelines Build Status](https://dev.azure.com/axom/axom/_apis/build/status/LLNL.axom?branchName=develop)](https://dev.azure.com/axom/axom/_build/latest?definitionId=1&branchName=develop) [![Documentation Status](https://readthedocs.org/projects/axom/badge/?version=develop)](https://axom.readthedocs.io/en/develop/?badge=develop) @@ -56,7 +56,7 @@ Thanks to all of Axom's License ------- -Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC. +Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory. Copyrights and patents in the Axom project are retained by contributors. diff --git a/RELEASE b/RELEASE index 6a5a3129ca..ec1babb39d 100644 --- a/RELEASE +++ b/RELEASE @@ -1,8 +1,8 @@ ******************************************************************************* -Axom: ................................, version 0.8.1 +Axom: ................................, version 0.9.0 -Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC. +Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory. All rights reserved. See details in the file axom/LICENSE. diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 852f9f59fd..8e6d1f08ab 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,6 +1,6 @@ [comment]: # (#################################################################) -[comment]: # (Copyright 2017-2023, Lawrence Livermore National Security, LLC) +[comment]: # (Copyright 2017-2024, Lawrence Livermore National Security, LLC) [comment]: # (and Axom Project Developers. See the top-level LICENSE file) [comment]: # (for details.) [comment]: # @@ -19,7 +19,69 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ## [Unreleased] - Release date yyyy-mm-dd -## [v0.8.1] - Release date 2023-08-16 +## [Version 0.9.0] - Release date 2024-03-19 + +### Added +- Primal: Adds a `Quadrilateral` primitive +- Primal: Adds a `compute_bounding_box()` operator for computing the bounding + box of a `Quadrilateral` +- Primal: Adds a `clip()` operator for clipping a tetrahedron against the + half-space defined by a plane +- Primal: Adds a `checkAndFixOrientation()` function to `primal::Tetrahedron` + that swaps the order of vertices if the signed volume of the Tetrahedron is + negative, resulting in the signed volume becoming positive. +- Adds `FlatMap`, a generic key-value store which aims for drop-in compatibility + with `std::unordered_map`, but utilizes an open-addressing design. +- Adds support for device-side use of `Array::push_back()` and `Array::emplace_back()`. +- Adds initial support for using Slic streams with tags +- Adds an example that finds intersection candidate pairs between two Silo + hexahedral meshes using either a BVH or Implicit Grid spatial index +- Quest: Adds `setTetPredFromBoundingBox()` and `setTetPred()` functions to + `quest::ProEReader` and `PProEReader` that set a tet predicate, allowing + user code to read in a subset of a Pro/E ASCII tetrahedron mesh file. + +### Changed +- `MarchingCubes` has optimizations to improve GPU performance, particularly for + repeated computations. The constructor has changed and a new `setMesh` method + is added to set (or change) the mesh. New accessors present output data + without moving them from device to host. These accessors are an interim + solution and likely to be updated in the future. +- `DistributedClosestPoint` outputs are now controlled by the `setOutput` method. +- `MarchingCubes` allows user to select the underlying data-parallel implementation + - `fullParallel` works best on GPUs. + - `hybridParallel` reduces the amount of data processed and works best with + `MarchingCubesRuntimePolicy::seq`. + - `byPolicy` (the default) selects the implementation based on the runtime policy. +- `MarchingCubes` and `DistributedClosestPoint` classes identify domains by their + `state/domain_id` parameters if provided, or the local iteration index if not. +- `MarchingCubes` and `DistributedClosestPoint` classes changed from requiring the Blueprint + coordset name to requiring the Blueprint topology name. The changed interface methods are: + - `DistributedClosestPoint::setObjectMesh` + - `DistributedClosestPoint::computeClosestPoints` + - `MarchingCubes::MarchingCubes` + - `MarchingCubesSingleDomain::MarchingCubesSingleDomain` +- Primal: `Polyhedron::volume()` function changed from returning a signed + volume to an unsigned volume. The added `Polyhedron::signedVolume()` function + returns the signed volume. +- Primal: `intersection_volume()` operators changed from returning a signed + volume to an unsigned volume. +- Primal's `BoundingBox::contains(BoundingBox)` now returns `true` when the input is empty +- Renamed axom's bit utility functions to conform to `C++20` standard: `popCount() -> popcount()`, + `trailingZeros() -> countr_zero()` and `leadingZeros() -> countl_zero()` +- Renamed `axom::utilities::swapEndian() -> byteswap()` to conform to `C++23` standard + +### Fixed +- quest's `SamplingShaper` now properly handles material names containing underscores +- quest's `SamplingShaper` can now be used with an mfem that is configured for (GPU) devices +- primal's `Polygon` area computation in 3D previously only worked when the polygon was aligned with the XY-plane. It now works for arbitrary polygons. +- Upgrades our `vcpkg` usage for automated Windows builds of our TPLs to its [2023.12.12 release](https://github.com/microsoft/vcpkg/releases/tag/2023.12.12) +- Fixed a bug in the bounds checks for `primal::clip(Triangle, BoundingBox)` +- Fixed a bug when loading Sidre groups with attributes that already exist +- Fixed `std::locale` error when when compiling `src/axom/core/utilities/System.cpp` using nvcc +- Include `cstdint` for higher gcc version support (e.g. gcc-13) +- Fixed several memory leaks in `axom::Array`, `quest::Shaping` and `sidre::MFEMSidreDataCollection` + +## [Version 0.8.1] - Release date 2023-08-16 ### Changed - Updates to [RAJA version 2023.06.0][https://github.com/LLNL/RAJA/releases/tag/v2023.06.0] @@ -30,7 +92,7 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ - Fixed MFEMSidreDataCollection finite element space bug - Various fixes to CMake machinery -## [v0.8.0] - Release date 2023-07-26 +## [Version 0.8.0] - Release date 2023-07-26 ### Added - Adds MarchingCubes class implementing the marching cubes algorithm for surface detection. @@ -969,7 +1031,8 @@ fractions for the associated materials must be supplied before shaping. - Use this section in case of vulnerabilities -[Unreleased]: https://github.com/LLNL/axom/compare/v0.8.1...develop +[Unreleased]: https://github.com/LLNL/axom/compare/v0.9.0...develop +[Version 0.9.0]: https://github.com/LLNL/axom/compare/v0.8.1...v0.9.0 [Version 0.8.1]: https://github.com/LLNL/axom/compare/v0.8.0...v0.8.1 [Version 0.8.0]: https://github.com/LLNL/axom/compare/v0.7.0...v0.8.0 [Version 0.7.0]: https://github.com/LLNL/axom/compare/v0.6.1...v0.7.0 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7aa5a555fa..77b746ff19 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -9,8 +9,8 @@ variables: DO_BUILD: 'yes' DO_TEST: 'yes' DO_CLEAN: 'no' - CLANG10_IMAGENAME: 'axom/tpls:clang-10_07-26-23_22h-58m' - GCC11_IMAGENAME: 'axom/tpls:gcc-11_07-26-23_22h-58m' + CLANG10_IMAGENAME: 'axom/tpls:clang-10_03-07-24_19h-20m' + GCC11_IMAGENAME: 'axom/tpls:gcc-11_03-07-24_19h-20m' system.debug: false jobs: diff --git a/config-build.py b/config-build.py index 30a385a103..e87a575928 100755 --- a/config-build.py +++ b/config-build.py @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/data b/data index 0cc49bf58a..400c4e5066 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 0cc49bf58a6f41e3602e6112d8ba9ebd4b8906f6 +Subproject commit 400c4e5066620c653b770bd84b77c326da588567 diff --git a/host-configs/docker/clang@10.0.0.cmake b/host-configs/docker/clang@10.0.0.cmake index 0cafcdc86d..1cbb7a5753 100644 --- a/host-configs/docker/clang@10.0.0.cmake +++ b/host-configs/docker/clang@10.0.0.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/home/axom/axom_tpls/clang-10.0.0/umpire-2023.06.0-ffv2unko7ol7xkbswptn6reo5vkk4z36;/home/axom/axom_tpls/clang-10.0.0/raja-2023.06.0-7mjlmrtwawof7ahtizt2kh3m7pzpaa6r;/home/axom/axom_tpls/clang-10.0.0/camp-2023.06.0-cpcbuctxxtzpikmmjzt5u43oonrsqyag;/home/axom/axom_tpls/clang-10.0.0/mfem-4.5.2-vlkan3esoqo4ext3qsa6m3qiau3gcetk;/home/axom/axom_tpls/clang-10.0.0/hypre-2.24.0-a7pavarlyr7ao3qlmwxbayorpwhmoazm;/home/axom/axom_tpls/clang-10.0.0/lua-5.4.4-g77yiae3ob3q5p7bdgurcj76fgc4uxe6;/home/axom/axom_tpls/clang-10.0.0/readline-8.2-ssf54hxnbztmn4c3gekrqfmu5ovcsexe;/home/axom/axom_tpls/clang-10.0.0/ncurses-6.4-ug6qch6hz5ysjky6ebx76pzg4qumoijl;/home/axom/axom_tpls/clang-10.0.0/conduit-0.8.8-zzhc6p6w4eed6gfuu6nc6kf4uazzsy3z;/home/axom/axom_tpls/clang-10.0.0/parmetis-4.0.3-qb5ova7xrfnnjcnwjg277camap6xfu7d;/home/axom/axom_tpls/clang-10.0.0/metis-5.1.0-xlsz5xtc5npvrzlfkwjiho6uuotdmhv6;/home/axom/axom_tpls/clang-10.0.0/hdf5-1.8.22-bwa77phd2gdupwroibbaz7oa24i5s4mg;/home/axom/axom_tpls/clang-10.0.0/zlib-1.2.13-rgebxh4wloej77x6kjavjfh5cnjegtlj;/home/axom/axom_tpls/clang-10.0.0/gmake-4.4.1-ovbffagtyrtthibtg7dm4xghwjwejn2f;/home/axom/axom_tpls/clang-10.0.0/blt-0.5.3-6jop7ew6gg3noxponfcbnxswwckmjpyc" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/home/axom/axom_tpls/clang-10.0.0/umpire-2024.02.0-lhbuzui3h5a2qwqpogpsemqq5web7nai;/home/axom/axom_tpls/clang-10.0.0/raja-2024.02.0-jlkwrlbhqvm5z32lc3snswvia4ubmtzp;/home/axom/axom_tpls/clang-10.0.0/mfem-4.6.0-ftusbr7mglftqsxy32nmjzgau2ptdrsp;/home/axom/axom_tpls/clang-10.0.0/hypre-2.24.0-fzucmiugxgaiuljssnzc453bwuagxp6o;/home/axom/axom_tpls/clang-10.0.0/lua-5.4.4-c7monkarzpznammmzte52w57k4tul7rq;/home/axom/axom_tpls/clang-10.0.0/readline-8.2-pd6al5egorkcypr7h46odukuef5v6wea;/home/axom/axom_tpls/clang-10.0.0/conduit-0.9.1-ilr73n4bdpnhpsvwfc725alcwve2ubtp;/home/axom/axom_tpls/clang-10.0.0/parmetis-4.0.3-aq6l5hu42jvpds2zb7hc7in4pfgermvu;/home/axom/axom_tpls/clang-10.0.0/hdf5-1.8.23-vodh4tlps5o4frqcm37r7udmywen3viq;/home/axom/axom_tpls/clang-10.0.0/blt-0.6.1.4-fuytsx6iavxnc5gwfhb56i4ftfqfulnx;/home/axom/axom_tpls/clang-10.0.0/fmt-10.2.1-d2ptxbacnuhzfpxrdoxrj225apoeb7pb;/home/axom/axom_tpls/clang-10.0.0/camp-2024.02.0-bf47c6jhvwog6hnusaduhggzmfm46d24;/home/axom/axom_tpls/clang-10.0.0/zlib-ng-2.1.5-abmvhf2ybobwqltpe6zlskjxvxxtxcxq;/home/axom/axom_tpls/clang-10.0.0/metis-5.1.0-xjk3ehggqmdb7rbmht5l5el5wfau6vso;/home/axom/axom_tpls/clang-10.0.0/ncurses-6.4-y3oisa6sfw3llb5nsvrzh7efh6zn5unh;/home/axom/axom_tpls/clang-10.0.0/gmake-4.4.1-gzcsdny44nh45v3qhvshhpvvubmhc3jm" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/home/axom/axom_tpls/clang-10.0.0/axom-develop-tt2s343kb7b22xx46ufv5rkhhlkattnm/lib;/home/axom/axom_tpls/clang-10.0.0/axom-develop-tt2s343kb7b22xx46ufv5rkhhlkattnm/lib64;/home/axom/axom_tpls/clang-10.0.0/conduit-0.9.1-ilr73n4bdpnhpsvwfc725alcwve2ubtp/lib;/home/axom/axom_tpls/clang-10.0.0/hdf5-1.8.23-vodh4tlps5o4frqcm37r7udmywen3viq/lib;/home/axom/axom_tpls/clang-10.0.0/zlib-ng-2.1.5-abmvhf2ybobwqltpe6zlskjxvxxtxcxq/lib;/home/axom/axom_tpls/clang-10.0.0/metis-5.1.0-xjk3ehggqmdb7rbmht5l5el5wfau6vso/lib;/home/axom/axom_tpls/clang-10.0.0/parmetis-4.0.3-aq6l5hu42jvpds2zb7hc7in4pfgermvu/lib;/home/axom/axom_tpls/clang-10.0.0/lua-5.4.4-c7monkarzpznammmzte52w57k4tul7rq/lib;/home/axom/axom_tpls/clang-10.0.0/ncurses-6.4-y3oisa6sfw3llb5nsvrzh7efh6zn5unh/lib;/home/axom/axom_tpls/clang-10.0.0/readline-8.2-pd6al5egorkcypr7h46odukuef5v6wea/lib;/home/axom/axom_tpls/clang-10.0.0/mfem-4.6.0-ftusbr7mglftqsxy32nmjzgau2ptdrsp/lib;/home/axom/axom_tpls/clang-10.0.0/hypre-2.24.0-fzucmiugxgaiuljssnzc453bwuagxp6o/lib;/home/axom/axom_tpls/clang-10.0.0/raja-2024.02.0-jlkwrlbhqvm5z32lc3snswvia4ubmtzp/lib;/home/axom/axom_tpls/clang-10.0.0/camp-2024.02.0-bf47c6jhvwog6hnusaduhggzmfm46d24/lib;/home/axom/axom_tpls/clang-10.0.0/umpire-2024.02.0-lhbuzui3h5a2qwqpogpsemqq5web7nai/lib;/home/axom/axom_tpls/clang-10.0.0/fmt-10.2.1-d2ptxbacnuhzfpxrdoxrj225apoeb7pb/lib" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/home/axom/axom_tpls/clang-10.0.0/axom-develop-tt2s343kb7b22xx46ufv5rkhhlkattnm/lib;/home/axom/axom_tpls/clang-10.0.0/axom-develop-tt2s343kb7b22xx46ufv5rkhhlkattnm/lib64;/home/axom/axom_tpls/clang-10.0.0/conduit-0.9.1-ilr73n4bdpnhpsvwfc725alcwve2ubtp/lib;/home/axom/axom_tpls/clang-10.0.0/hdf5-1.8.23-vodh4tlps5o4frqcm37r7udmywen3viq/lib;/home/axom/axom_tpls/clang-10.0.0/zlib-ng-2.1.5-abmvhf2ybobwqltpe6zlskjxvxxtxcxq/lib;/home/axom/axom_tpls/clang-10.0.0/metis-5.1.0-xjk3ehggqmdb7rbmht5l5el5wfau6vso/lib;/home/axom/axom_tpls/clang-10.0.0/parmetis-4.0.3-aq6l5hu42jvpds2zb7hc7in4pfgermvu/lib;/home/axom/axom_tpls/clang-10.0.0/lua-5.4.4-c7monkarzpznammmzte52w57k4tul7rq/lib;/home/axom/axom_tpls/clang-10.0.0/ncurses-6.4-y3oisa6sfw3llb5nsvrzh7efh6zn5unh/lib;/home/axom/axom_tpls/clang-10.0.0/readline-8.2-pd6al5egorkcypr7h46odukuef5v6wea/lib;/home/axom/axom_tpls/clang-10.0.0/mfem-4.6.0-ftusbr7mglftqsxy32nmjzgau2ptdrsp/lib;/home/axom/axom_tpls/clang-10.0.0/hypre-2.24.0-fzucmiugxgaiuljssnzc453bwuagxp6o/lib;/home/axom/axom_tpls/clang-10.0.0/raja-2024.02.0-jlkwrlbhqvm5z32lc3snswvia4ubmtzp/lib;/home/axom/axom_tpls/clang-10.0.0/camp-2024.02.0-bf47c6jhvwog6hnusaduhggzmfm46d24/lib;/home/axom/axom_tpls/clang-10.0.0/umpire-2024.02.0-lhbuzui3h5a2qwqpogpsemqq5web7nai/lib;/home/axom/axom_tpls/clang-10.0.0/fmt-10.2.1-d2ptxbacnuhzfpxrdoxrj225apoeb7pb/lib" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -35,8 +41,6 @@ set(CMAKE_C_FLAGS "-pthread" CACHE STRING "") set(CMAKE_CXX_FLAGS "-pthread" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/lib64" CACHE STRING "Adds a missing libstdc++ rpath") @@ -75,21 +79,21 @@ 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-0.8.8-zzhc6p6w4eed6gfuu6nc6kf4uazzsy3z" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-ilr73n4bdpnhpsvwfc725alcwve2ubtp" CACHE PATH "") # C2C not built -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-vlkan3esoqo4ext3qsa6m3qiau3gcetk" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-ftusbr7mglftqsxy32nmjzgau2ptdrsp" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-bwa77phd2gdupwroibbaz7oa24i5s4mg" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-vodh4tlps5o4frqcm37r7udmywen3viq" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-g77yiae3ob3q5p7bdgurcj76fgc4uxe6" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-c7monkarzpznammmzte52w57k4tul7rq" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-7mjlmrtwawof7ahtizt2kh3m7pzpaa6r" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-jlkwrlbhqvm5z32lc3snswvia4ubmtzp" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-ffv2unko7ol7xkbswptn6reo5vkk4z36" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-lhbuzui3h5a2qwqpogpsemqq5web7nai" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-cpcbuctxxtzpikmmjzt5u43oonrsqyag" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-bf47c6jhvwog6hnusaduhggzmfm46d24" CACHE PATH "") # scr not built diff --git a/host-configs/docker/gcc@11.1.0.cmake b/host-configs/docker/gcc@11.1.0.cmake index 8211dc00cd..a7d9e80e4a 100644 --- a/host-configs/docker/gcc@11.1.0.cmake +++ b/host-configs/docker/gcc@11.1.0.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/home/axom/axom_tpls/gcc-11.1.0/umpire-2023.06.0-pdygmf4s7ggj4zqbrzy436omasf6eaee;/home/axom/axom_tpls/gcc-11.1.0/raja-2023.06.0-cyz2uqefpnhonaipzcnh4oiidyrfmnsx;/home/axom/axom_tpls/gcc-11.1.0/camp-2023.06.0-csawyq2dbktfyy7srozbr7lefkz2bjmc;/home/axom/axom_tpls/gcc-11.1.0/mfem-4.5.2-dhj56qfyq3zkqiyjapqitz3iaeyjiu3r;/home/axom/axom_tpls/gcc-11.1.0/hypre-2.24.0-xsefh67wzc7yga4wotgcn4nktzsr3dko;/home/axom/axom_tpls/gcc-11.1.0/lua-5.4.4-3iwzuwuvnrymxte2nik7uqwfksk7ui5p;/home/axom/axom_tpls/gcc-11.1.0/readline-8.2-3ghsag74tthrw7kycdjwbstrhxwhiics;/home/axom/axom_tpls/gcc-11.1.0/ncurses-6.4-bqojhx5e5yk7qwezjqzchqtufyegrff7;/home/axom/axom_tpls/gcc-11.1.0/conduit-0.8.8-yohx25l7etfwzetmtcu6erdh3qnbglrn;/home/axom/axom_tpls/gcc-11.1.0/parmetis-4.0.3-wqjpma4axfmudec4ncgxkhgeyquzzneh;/home/axom/axom_tpls/gcc-11.1.0/metis-5.1.0-a6gendzgkorlnu2x6ogz4tywd4yp4c7t;/home/axom/axom_tpls/gcc-11.1.0/hdf5-1.8.22-tdsth6jhlgwhvfscnkpb24lbvvdtgobe;/home/axom/axom_tpls/gcc-11.1.0/zlib-1.2.13-k4fzfbz45b6qs3ysphaxrdowxyvjrg5p;/home/axom/axom_tpls/gcc-11.1.0/gmake-4.4.1-xoqy3bpcm7lirebrxjt4qvp3p72t3dmu;/home/axom/axom_tpls/gcc-11.1.0/blt-0.5.3-zthngkscrkhniwcjsfur5rglm6bkmge3" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/home/axom/axom_tpls/gcc-11.1.0/umpire-2024.02.0-enni4yeviruk7h5zfbmkroiox3xg3if3;/home/axom/axom_tpls/gcc-11.1.0/fmt-10.2.1-qvyqa6m3lunl3mt642hhztl3tbkze4sy;/home/axom/axom_tpls/gcc-11.1.0/raja-2024.02.0-gwrqm6xvkr3upgmhd77ie7rnzw6mtdts;/home/axom/axom_tpls/gcc-11.1.0/camp-2024.02.0-jzv34cutypmwj5drk65diases5ngmfq2;/home/axom/axom_tpls/gcc-11.1.0/mfem-4.6.0-x4tzg3vnrkck26vlduf2e2ayis2dfsr7;/home/axom/axom_tpls/gcc-11.1.0/hypre-2.24.0-w22uojfq5lainzap3vqxxbqjnhdynuhd;/home/axom/axom_tpls/gcc-11.1.0/lua-5.4.4-oxlydb36zseusohbrkaj34db5sz6jwad;/home/axom/axom_tpls/gcc-11.1.0/readline-8.2-ujrbpdblmke4uvalui3g242eounq56jf;/home/axom/axom_tpls/gcc-11.1.0/ncurses-6.4-biefcjrdgewfl6hygtwhakrjxiqpovbb;/home/axom/axom_tpls/gcc-11.1.0/gmake-4.4.1-657kbqwor2lcjpqz3clrhqam6khfzm2g;/home/axom/axom_tpls/gcc-11.1.0/conduit-0.9.1-uffsgbtewmhjj4utevbbpanarb5mahtl;/home/axom/axom_tpls/gcc-11.1.0/parmetis-4.0.3-pqylj3fddaoytfuej3ynedyz6pnitner;/home/axom/axom_tpls/gcc-11.1.0/metis-5.1.0-6zaty2e2as4n3b2lb5eaee7nxdkzfk2a;/home/axom/axom_tpls/gcc-11.1.0/hdf5-1.8.23-jikkc6tqhuwlhy42zrfmsvw55yrk63en;/home/axom/axom_tpls/gcc-11.1.0/zlib-ng-2.1.5-lxz6tnypfmbtf6xlp6wws3fcsvqxu5ug;/home/axom/axom_tpls/gcc-11.1.0/blt-0.6.1.4-uttgpnnmvo2rofs2lgoetd7zu4xnt3uu;/home/axom/axom_tpls/gcc-11.1.0/gcc-runtime-11.1.0-usjxs3hhp7yzd26bafjrzaqwqi43qleg" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/home/axom/axom_tpls/gcc-11.1.0/axom-develop-oddjd3i56sfj5qsy6r32mzyhr5fohopm/lib;/home/axom/axom_tpls/gcc-11.1.0/axom-develop-oddjd3i56sfj5qsy6r32mzyhr5fohopm/lib64;/home/axom/axom_tpls/gcc-11.1.0/conduit-0.9.1-uffsgbtewmhjj4utevbbpanarb5mahtl/lib;/home/axom/axom_tpls/gcc-11.1.0/gcc-runtime-11.1.0-usjxs3hhp7yzd26bafjrzaqwqi43qleg/lib;/home/axom/axom_tpls/gcc-11.1.0/hdf5-1.8.23-jikkc6tqhuwlhy42zrfmsvw55yrk63en/lib;/home/axom/axom_tpls/gcc-11.1.0/zlib-ng-2.1.5-lxz6tnypfmbtf6xlp6wws3fcsvqxu5ug/lib;/home/axom/axom_tpls/gcc-11.1.0/metis-5.1.0-6zaty2e2as4n3b2lb5eaee7nxdkzfk2a/lib;/home/axom/axom_tpls/gcc-11.1.0/parmetis-4.0.3-pqylj3fddaoytfuej3ynedyz6pnitner/lib;/home/axom/axom_tpls/gcc-11.1.0/lua-5.4.4-oxlydb36zseusohbrkaj34db5sz6jwad/lib;/home/axom/axom_tpls/gcc-11.1.0/ncurses-6.4-biefcjrdgewfl6hygtwhakrjxiqpovbb/lib;/home/axom/axom_tpls/gcc-11.1.0/readline-8.2-ujrbpdblmke4uvalui3g242eounq56jf/lib;/home/axom/axom_tpls/gcc-11.1.0/mfem-4.6.0-x4tzg3vnrkck26vlduf2e2ayis2dfsr7/lib;/home/axom/axom_tpls/gcc-11.1.0/hypre-2.24.0-w22uojfq5lainzap3vqxxbqjnhdynuhd/lib;/home/axom/axom_tpls/gcc-11.1.0/raja-2024.02.0-gwrqm6xvkr3upgmhd77ie7rnzw6mtdts/lib;/home/axom/axom_tpls/gcc-11.1.0/camp-2024.02.0-jzv34cutypmwj5drk65diases5ngmfq2/lib;/home/axom/axom_tpls/gcc-11.1.0/umpire-2024.02.0-enni4yeviruk7h5zfbmkroiox3xg3if3/lib;/home/axom/axom_tpls/gcc-11.1.0/fmt-10.2.1-qvyqa6m3lunl3mt642hhztl3tbkze4sy/lib" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/home/axom/axom_tpls/gcc-11.1.0/axom-develop-oddjd3i56sfj5qsy6r32mzyhr5fohopm/lib;/home/axom/axom_tpls/gcc-11.1.0/axom-develop-oddjd3i56sfj5qsy6r32mzyhr5fohopm/lib64;/home/axom/axom_tpls/gcc-11.1.0/conduit-0.9.1-uffsgbtewmhjj4utevbbpanarb5mahtl/lib;/home/axom/axom_tpls/gcc-11.1.0/gcc-runtime-11.1.0-usjxs3hhp7yzd26bafjrzaqwqi43qleg/lib;/home/axom/axom_tpls/gcc-11.1.0/hdf5-1.8.23-jikkc6tqhuwlhy42zrfmsvw55yrk63en/lib;/home/axom/axom_tpls/gcc-11.1.0/zlib-ng-2.1.5-lxz6tnypfmbtf6xlp6wws3fcsvqxu5ug/lib;/home/axom/axom_tpls/gcc-11.1.0/metis-5.1.0-6zaty2e2as4n3b2lb5eaee7nxdkzfk2a/lib;/home/axom/axom_tpls/gcc-11.1.0/parmetis-4.0.3-pqylj3fddaoytfuej3ynedyz6pnitner/lib;/home/axom/axom_tpls/gcc-11.1.0/lua-5.4.4-oxlydb36zseusohbrkaj34db5sz6jwad/lib;/home/axom/axom_tpls/gcc-11.1.0/ncurses-6.4-biefcjrdgewfl6hygtwhakrjxiqpovbb/lib;/home/axom/axom_tpls/gcc-11.1.0/readline-8.2-ujrbpdblmke4uvalui3g242eounq56jf/lib;/home/axom/axom_tpls/gcc-11.1.0/mfem-4.6.0-x4tzg3vnrkck26vlduf2e2ayis2dfsr7/lib;/home/axom/axom_tpls/gcc-11.1.0/hypre-2.24.0-w22uojfq5lainzap3vqxxbqjnhdynuhd/lib;/home/axom/axom_tpls/gcc-11.1.0/raja-2024.02.0-gwrqm6xvkr3upgmhd77ie7rnzw6mtdts/lib;/home/axom/axom_tpls/gcc-11.1.0/camp-2024.02.0-jzv34cutypmwj5drk65diases5ngmfq2/lib;/home/axom/axom_tpls/gcc-11.1.0/umpire-2024.02.0-enni4yeviruk7h5zfbmkroiox3xg3if3/lib;/home/axom/axom_tpls/gcc-11.1.0/fmt-10.2.1-qvyqa6m3lunl3mt642hhztl3tbkze4sy/lib" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -35,8 +41,6 @@ set(CMAKE_C_FLAGS "-pthread" CACHE STRING "") set(CMAKE_CXX_FLAGS "-pthread" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -73,21 +77,21 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") set(TPL_ROOT "/home/axom/axom_tpls/gcc-11.1.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-yohx25l7etfwzetmtcu6erdh3qnbglrn" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-uffsgbtewmhjj4utevbbpanarb5mahtl" CACHE PATH "") # C2C not built -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-dhj56qfyq3zkqiyjapqitz3iaeyjiu3r" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-x4tzg3vnrkck26vlduf2e2ayis2dfsr7" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-tdsth6jhlgwhvfscnkpb24lbvvdtgobe" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-jikkc6tqhuwlhy42zrfmsvw55yrk63en" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-3iwzuwuvnrymxte2nik7uqwfksk7ui5p" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-oxlydb36zseusohbrkaj34db5sz6jwad" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-cyz2uqefpnhonaipzcnh4oiidyrfmnsx" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-gwrqm6xvkr3upgmhd77ie7rnzw6mtdts" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-pdygmf4s7ggj4zqbrzy436omasf6eaee" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-enni4yeviruk7h5zfbmkroiox3xg3if3" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-csawyq2dbktfyy7srozbr7lefkz2bjmc" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-jzv34cutypmwj5drk65diases5ngmfq2" CACHE PATH "") # scr not built diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@10.0.1.1.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@10.0.1.1.cmake index 8472ab379d..ac2f466390 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@10.0.1.1.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@10.0.1.1.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/umpire-2023.06.0-x4j2bn55oz5hlsbgawepoej3kc3s3ama;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/raja-2023.06.0-r2xeiifolea4xkrfluvkeehaynhvaipr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/camp-2023.06.0-55emwjpfri4sr52rqvnfb5fiqitgkyml;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/mfem-4.5.2-dbebdqverfh4lwgj5nal5d2vgmmvl4xb;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/hypre-2.24.0-vrxf2vyvdlmylt5u2cu3vy4dqdc76yvq;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/lua-5.4.4-o6kjgr3nt6ssvrj3mmonawxj3sbbcnel;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/conduit-0.8.8-yguteoqfyvdqs5qgcsxlvykqbn3jy6fl;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/parmetis-4.0.3-aivfy5rovu5bwsiryry63apan5cdtc4m;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/metis-5.1.0-k7t53hncr4qxzqoyzhekte5rqrorclyh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/hdf5-1.8.22-ydeu5u4foixvz5oczqac5otuky4jq7en;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/zlib-1.2.13-aple3eiihvtvpurrdvosba4qab7rgdnr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/c2c-1.8.0-alkiietbi3stbihkzci37tecdzdyxpwh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1/blt-0.5.3-e5rbowq4pvwwuchttguahzyjcpa5zvgr;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/umpire-2024.02.0-3fzuqd3tqb3kh2lai5yqmgom24mlcior;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/raja-2024.02.0-btiwe3jepovgjlxdtuqm4xssselzimcx;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/py-jsonschema-2.6.0-szvkvnsgmp3mys5qwxkzidfljbrx2lc4;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/mfem-4.6.0-izljwvlcbrcbcueewxc74qbs7l3vy3rk;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/hypre-2.24.0-euib2ua4oleljrkszmkexls4kw5cvrr7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/lua-5.4.4-aovjhut3d6o67vxccjkyhfbrxc2eg4de;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/conduit-0.9.1-dfi65iel4lwlrvhi2i7n2hbvxuzlf3fv;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/parmetis-4.0.3-djitip36l7hy2ubwbvrnqmfeodhnjtpk;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/hdf5-1.8.23-ifirj3a475sf7jrliip2tj7laqyidak6;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/blt-0.6.1.4-7qqqx4bcdk5wy7ycpymq6engsddxn4y2;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/fmt-10.2.1-sscbhyiiak2butrj6656mn7nfx37rpr6;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/camp-2024.02.0-zxgjohy7qy2v3nqg4eaba3azthsqhcga;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/metis-5.1.0-e5ov7trmcxxc4pa6cbysd525iyiswtkn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/c2c-1.8.0-vlmxcctikvg2swezpvdqweczpsueuyrl;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/axom-develop-wpre5jwym4gwxknegvw5mdlqmnqxgv3b/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/axom-develop-wpre5jwym4gwxknegvw5mdlqmnqxgv3b/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/c2c-1.8.0-vlmxcctikvg2swezpvdqweczpsueuyrl/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/conduit-0.9.1-dfi65iel4lwlrvhi2i7n2hbvxuzlf3fv/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/hdf5-1.8.23-ifirj3a475sf7jrliip2tj7laqyidak6/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/metis-5.1.0-e5ov7trmcxxc4pa6cbysd525iyiswtkn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/parmetis-4.0.3-djitip36l7hy2ubwbvrnqmfeodhnjtpk/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/lua-5.4.4-aovjhut3d6o67vxccjkyhfbrxc2eg4de/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/mfem-4.6.0-izljwvlcbrcbcueewxc74qbs7l3vy3rk/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/hypre-2.24.0-euib2ua4oleljrkszmkexls4kw5cvrr7/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/py-jsonschema-2.6.0-szvkvnsgmp3mys5qwxkzidfljbrx2lc4/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/raja-2024.02.0-btiwe3jepovgjlxdtuqm4xssselzimcx/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/camp-2024.02.0-zxgjohy7qy2v3nqg4eaba3azthsqhcga/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/umpire-2024.02.0-3fzuqd3tqb3kh2lai5yqmgom24mlcior/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/fmt-10.2.1-sscbhyiiak2butrj6656mn7nfx37rpr6/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8;/usr/tce/packages/clang/clang-ibm-10.0.1/release/lib;/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/release/lib" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/axom-develop-wpre5jwym4gwxknegvw5mdlqmnqxgv3b/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/axom-develop-wpre5jwym4gwxknegvw5mdlqmnqxgv3b/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/c2c-1.8.0-vlmxcctikvg2swezpvdqweczpsueuyrl/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/conduit-0.9.1-dfi65iel4lwlrvhi2i7n2hbvxuzlf3fv/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/hdf5-1.8.23-ifirj3a475sf7jrliip2tj7laqyidak6/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/metis-5.1.0-e5ov7trmcxxc4pa6cbysd525iyiswtkn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/parmetis-4.0.3-djitip36l7hy2ubwbvrnqmfeodhnjtpk/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/lua-5.4.4-aovjhut3d6o67vxccjkyhfbrxc2eg4de/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/mfem-4.6.0-izljwvlcbrcbcueewxc74qbs7l3vy3rk/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/hypre-2.24.0-euib2ua4oleljrkszmkexls4kw5cvrr7/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/py-jsonschema-2.6.0-szvkvnsgmp3mys5qwxkzidfljbrx2lc4/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/raja-2024.02.0-btiwe3jepovgjlxdtuqm4xssselzimcx/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/camp-2024.02.0-zxgjohy7qy2v3nqg4eaba3azthsqhcga/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/umpire-2024.02.0-3fzuqd3tqb3kh2lai5yqmgom24mlcior/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1/fmt-10.2.1-sscbhyiiak2butrj6656mn7nfx37rpr6/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8;/usr/tce/packages/clang/clang-ibm-10.0.1/release/lib;/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/release/lib" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -37,8 +43,6 @@ set(CMAKE_CXX_STANDARD_LIBRARIES "-lgfortran" CACHE STRING "") set(CMAKE_Fortran_STANDARD_LIBRARIES "-lgfortran" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/lib" CACHE STRING "Adds a missing libstdc++ rpath") @@ -69,7 +73,7 @@ set(BLT_MPI_COMMAND_APPEND "mpibind" CACHE STRING "") # Hardware Specifics #------------------------------------------------ -set(ENABLE_OPENMP OFF CACHE BOOL "") +set(ENABLE_OPENMP ON CACHE BOOL "") set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") @@ -79,23 +83,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-yguteoqfyvdqs5qgcsxlvykqbn3jy6fl" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-dfi65iel4lwlrvhi2i7n2hbvxuzlf3fv" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-alkiietbi3stbihkzci37tecdzdyxpwh" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-vlmxcctikvg2swezpvdqweczpsueuyrl" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-dbebdqverfh4lwgj5nal5d2vgmmvl4xb" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-izljwvlcbrcbcueewxc74qbs7l3vy3rk" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-ydeu5u4foixvz5oczqac5otuky4jq7en" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-ifirj3a475sf7jrliip2tj7laqyidak6" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-o6kjgr3nt6ssvrj3mmonawxj3sbbcnel" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-aovjhut3d6o67vxccjkyhfbrxc2eg4de" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-r2xeiifolea4xkrfluvkeehaynhvaipr" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-btiwe3jepovgjlxdtuqm4xssselzimcx" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-x4j2bn55oz5hlsbgawepoej3kc3s3ama" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-3fzuqd3tqb3kh2lai5yqmgom24mlcior" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-55emwjpfri4sr52rqvnfb5fiqitgkyml" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-zxgjohy7qy2v3nqg4eaba3azthsqhcga" CACHE PATH "") # scr not built @@ -103,20 +107,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-55emwjpfri4sr52rqvnfb5fiqitgkyml" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-szvkvnsgmp3mys5qwxkzidfljbrx2lc4/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@10.0.1.2_cuda.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@10.0.1.2_cuda.cmake index 57ca460d66..8da84005d4 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@10.0.1.2_cuda.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@10.0.1.2_cuda.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/umpire-2023.06.0-pfofk6xf3eat7ptoitibuzmnycnwrlfb;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/raja-2023.06.0-26jb32x7kl6lvfhvwvzv6seoiyjd2fe4;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/camp-2023.06.0-mbobtec63kl2etao43ylvvln3ivokfzn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/cub-2.1.0-p5pq3qyp3tthknvf4evygd4yaoay32tu;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/mfem-4.5.2-5aoi62ejerozb42y5awjlgucluokakho;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/hypre-2.24.0-cfxkqrgvzhhkau6afaoohfe3zvmxhr7l;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/lua-5.4.4-27btgrl45gsrfpectq4nqwg3uep2lbcn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/conduit-0.8.8-k25pxkfamv77gz7cplvupfseutwule7o;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/parmetis-4.0.3-ae4f6v6uuhhbv776uy73zl4zqoralhbc;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/metis-5.1.0-ttpdauwjjvuesdbpa2pzh2inam3xgg7u;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/hdf5-1.8.22-ix4txea5c6dbzixdj3ef6dstpnlt6xvb;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/zlib-1.2.13-ywvuuomigfzzbq4fxcgkdrnvnnwkj7zt;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/c2c-1.8.0-icsf7aewc7ocohld45ibjxvygujkq3zd;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2/blt-0.5.3-pytnag7yitffjizxs6mtsgj6amwvpd4v;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/usr/tce/packages/cuda/cuda-11.2.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/umpire-2024.02.0-gdid6sheotanplgeox4xo25w6gqqsztl;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/raja-2024.02.0-o7rjribikrvq6wydxxz22wdo544ai4z2;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/camp-2024.02.0-2jxkuw2qyj7egsho3lshh2ceoa6n3srm;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/py-jsonschema-2.6.0-jzezi7fphud2hpmaepsb5s456tz2dqol;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/mfem-4.6.0-63jbjowv2dojriwkpag6ws3tbm4erk7v;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/hypre-2.24.0-olonyxmliyqz7gjwd5jkenyxuphjff2d;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/lua-5.4.4-5okbr3yhq4vyonc2yt22lich6jkdgp3i;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/conduit-0.9.1-mypcbb7eqvp4oqjftdvw53oql5f5wemd;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/parmetis-4.0.3-gxoxo6iesczbj7ltl3he3vxlv2xb6bdo;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/hdf5-1.8.23-5n6b7og6vcevg2pkbjjrhf54ta4fhl2i;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/blt-0.6.1.4-niyj5uvj7qaxuceaoycpenida5z56ied;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/fmt-10.2.1-rvh2rhnae6757hi6saunbnnicoowhtns;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/cub-2.1.0-ib4hkd2iic3p7ni4lhz5bqd5yivtxo7r;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/metis-5.1.0-5t5rx3oakpli3ywkum4kfhzdiacrdkso;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/c2c-1.8.0-ouuns7euqd3fbobccnfh2zcfgxo2nsss;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/cuda/cuda-11.2.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/axom-develop-ndiry4fjmug7ogvh36noblti67rdegj2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/axom-develop-ndiry4fjmug7ogvh36noblti67rdegj2/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/c2c-1.8.0-ouuns7euqd3fbobccnfh2zcfgxo2nsss/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/conduit-0.9.1-mypcbb7eqvp4oqjftdvw53oql5f5wemd/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/hdf5-1.8.23-5n6b7og6vcevg2pkbjjrhf54ta4fhl2i/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/metis-5.1.0-5t5rx3oakpli3ywkum4kfhzdiacrdkso/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/parmetis-4.0.3-gxoxo6iesczbj7ltl3he3vxlv2xb6bdo/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/lua-5.4.4-5okbr3yhq4vyonc2yt22lich6jkdgp3i/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/mfem-4.6.0-63jbjowv2dojriwkpag6ws3tbm4erk7v/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/hypre-2.24.0-olonyxmliyqz7gjwd5jkenyxuphjff2d/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/py-jsonschema-2.6.0-jzezi7fphud2hpmaepsb5s456tz2dqol/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/raja-2024.02.0-o7rjribikrvq6wydxxz22wdo544ai4z2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/camp-2024.02.0-2jxkuw2qyj7egsho3lshh2ceoa6n3srm/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/umpire-2024.02.0-gdid6sheotanplgeox4xo25w6gqqsztl/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/fmt-10.2.1-rvh2rhnae6757hi6saunbnnicoowhtns/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8;/usr/tce/packages/clang/clang-ibm-10.0.1/release/lib;/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/release/lib" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/axom-develop-ndiry4fjmug7ogvh36noblti67rdegj2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/axom-develop-ndiry4fjmug7ogvh36noblti67rdegj2/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/c2c-1.8.0-ouuns7euqd3fbobccnfh2zcfgxo2nsss/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/conduit-0.9.1-mypcbb7eqvp4oqjftdvw53oql5f5wemd/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/hdf5-1.8.23-5n6b7og6vcevg2pkbjjrhf54ta4fhl2i/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/metis-5.1.0-5t5rx3oakpli3ywkum4kfhzdiacrdkso/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/parmetis-4.0.3-gxoxo6iesczbj7ltl3he3vxlv2xb6bdo/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/lua-5.4.4-5okbr3yhq4vyonc2yt22lich6jkdgp3i/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/mfem-4.6.0-63jbjowv2dojriwkpag6ws3tbm4erk7v/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/hypre-2.24.0-olonyxmliyqz7gjwd5jkenyxuphjff2d/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/py-jsonschema-2.6.0-jzezi7fphud2hpmaepsb5s456tz2dqol/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/raja-2024.02.0-o7rjribikrvq6wydxxz22wdo544ai4z2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/camp-2024.02.0-2jxkuw2qyj7egsho3lshh2ceoa6n3srm/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/umpire-2024.02.0-gdid6sheotanplgeox4xo25w6gqqsztl/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2/fmt-10.2.1-rvh2rhnae6757hi6saunbnnicoowhtns/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8;/usr/tce/packages/clang/clang-ibm-10.0.1/release/lib;/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/release/lib" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -37,8 +43,6 @@ set(CMAKE_CXX_STANDARD_LIBRARIES "-lgfortran" CACHE STRING "") set(CMAKE_Fortran_STANDARD_LIBRARIES "-lgfortran" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") set(BLT_EXE_LINKER_FLAGS " -Xlinker -rpath -Xlinker /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/lib" CACHE STRING "Adds a missing libstdc++ rpath") @@ -97,7 +101,7 @@ set(gtest_disable_pthreads ON CACHE BOOL "") # Hardware Specifics #------------------------------------------------ -set(ENABLE_OPENMP OFF CACHE BOOL "") +set(ENABLE_OPENMP ON CACHE BOOL "") set(ENABLE_GTEST_DEATH_TESTS OFF CACHE BOOL "") @@ -107,23 +111,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/clang-10.0.1.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/clang-10.0.1.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-k25pxkfamv77gz7cplvupfseutwule7o" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-mypcbb7eqvp4oqjftdvw53oql5f5wemd" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-icsf7aewc7ocohld45ibjxvygujkq3zd" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-ouuns7euqd3fbobccnfh2zcfgxo2nsss" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-5aoi62ejerozb42y5awjlgucluokakho" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-63jbjowv2dojriwkpag6ws3tbm4erk7v" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-ix4txea5c6dbzixdj3ef6dstpnlt6xvb" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-5n6b7og6vcevg2pkbjjrhf54ta4fhl2i" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-27btgrl45gsrfpectq4nqwg3uep2lbcn" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-5okbr3yhq4vyonc2yt22lich6jkdgp3i" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-26jb32x7kl6lvfhvwvzv6seoiyjd2fe4" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-o7rjribikrvq6wydxxz22wdo544ai4z2" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-pfofk6xf3eat7ptoitibuzmnycnwrlfb" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-gdid6sheotanplgeox4xo25w6gqqsztl" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-mbobtec63kl2etao43ylvvln3ivokfzn" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-2jxkuw2qyj7egsho3lshh2ceoa6n3srm" CACHE PATH "") # scr not built @@ -131,20 +135,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-mbobtec63kl2etao43ylvvln3ivokfzn" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-jzezi7fphud2hpmaepsb5s456tz2dqol/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@8.3.1.1.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@8.3.1.1.cmake index 9322b541b8..2a1c2d905f 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@8.3.1.1.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@8.3.1.1.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/umpire-2023.06.0-bftoz5wfuvfwldjwe3szsi54hdpw2hfi;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/raja-2023.06.0-tv34emklwgpl4ddrggbpkthu6utweo2a;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/camp-2023.06.0-vuk2xmgpzxl2xb2jupm3uxqxbgrzrmbf;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/lua-5.4.4-e7cdhkbaxuyqljoyozzxrt2n57erhszx;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/conduit-0.8.8-3li2jcc2mecqbanoew5tznr4uzl2k2jg;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/parmetis-4.0.3-c2ub4mddqt7faykccls5eae7xogpi32w;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/metis-5.1.0-t6qk2khpceidsormndy6gj56qbnehxai;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/hdf5-1.8.22-nydokvym7klek6hqoyijbwf3tbmd32ux;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/zlib-1.2.13-zd2x25bmmjwxhw7siucfywjgk7oc262j;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/c2c-1.8.0-zgwmbota3vhdxcdjlwxbhomlwllwhvnc;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1/blt-0.5.3-zghdcshuqlqnbrezcylwnefie7pkvsab;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/umpire-2024.02.0-3fyzeztrclnysexhwf75pm2nxel77776;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/fmt-10.2.1-2vqr6w6s2qq7bt4iq7mdrfiqgfiw6f5l;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/raja-2024.02.0-e6tn6qcf3j2hqkz5ht3xrmlbddp3ngnn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/camp-2024.02.0-avtdwxn6q374o2nqe4rqkjzasuvmudta;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/py-jsonschema-2.6.0-me5qygs6iauo7miussleiado3nbnw5ot;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/lua-5.4.4-v5n5ab5npmyxguqaja6xdmyl6r3gsc5a;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/conduit-0.9.1-7fwf4minhh6ymveutjnb4zetvxwurm66;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/parmetis-4.0.3-p5pmp73u6nshwemscw43atzgaerk4ulu;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/metis-5.1.0-devoja547pbzdundjnarm3hug2hhay2l;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/hdf5-1.8.23-7cjtcdwjrtfgcnqoiyfrufybdw5g6i6h;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/c2c-1.8.0-vj22dsxnnfc6hx73lfgpdmlhithbd5bq;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/blt-0.6.1.4-6lng5thw5prsyymfu2yzy7xdwtwij6ij;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/gcc-runtime-8.3.1.1-pykxuo3lctv7fu6i325szadkdcwrrkim;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/axom-develop-mrrvgirrsjrtdsyltswvulji3his36xi/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/axom-develop-mrrvgirrsjrtdsyltswvulji3his36xi/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/c2c-1.8.0-vj22dsxnnfc6hx73lfgpdmlhithbd5bq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/gcc-runtime-8.3.1.1-pykxuo3lctv7fu6i325szadkdcwrrkim/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/conduit-0.9.1-7fwf4minhh6ymveutjnb4zetvxwurm66/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/hdf5-1.8.23-7cjtcdwjrtfgcnqoiyfrufybdw5g6i6h/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/metis-5.1.0-devoja547pbzdundjnarm3hug2hhay2l/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/parmetis-4.0.3-p5pmp73u6nshwemscw43atzgaerk4ulu/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/lua-5.4.4-v5n5ab5npmyxguqaja6xdmyl6r3gsc5a/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/py-jsonschema-2.6.0-me5qygs6iauo7miussleiado3nbnw5ot/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/raja-2024.02.0-e6tn6qcf3j2hqkz5ht3xrmlbddp3ngnn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/camp-2024.02.0-avtdwxn6q374o2nqe4rqkjzasuvmudta/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/umpire-2024.02.0-3fyzeztrclnysexhwf75pm2nxel77776/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/fmt-10.2.1-2vqr6w6s2qq7bt4iq7mdrfiqgfiw6f5l/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/axom-develop-mrrvgirrsjrtdsyltswvulji3his36xi/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/axom-develop-mrrvgirrsjrtdsyltswvulji3his36xi/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/c2c-1.8.0-vj22dsxnnfc6hx73lfgpdmlhithbd5bq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/gcc-runtime-8.3.1.1-pykxuo3lctv7fu6i325szadkdcwrrkim/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/conduit-0.9.1-7fwf4minhh6ymveutjnb4zetvxwurm66/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/hdf5-1.8.23-7cjtcdwjrtfgcnqoiyfrufybdw5g6i6h/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/metis-5.1.0-devoja547pbzdundjnarm3hug2hhay2l/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/parmetis-4.0.3-p5pmp73u6nshwemscw43atzgaerk4ulu/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/lua-5.4.4-v5n5ab5npmyxguqaja6xdmyl6r3gsc5a/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/py-jsonschema-2.6.0-me5qygs6iauo7miussleiado3nbnw5ot/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/raja-2024.02.0-e6tn6qcf3j2hqkz5ht3xrmlbddp3ngnn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/camp-2024.02.0-avtdwxn6q374o2nqe4rqkjzasuvmudta/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/umpire-2024.02.0-3fyzeztrclnysexhwf75pm2nxel77776/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1/fmt-10.2.1-2vqr6w6s2qq7bt4iq7mdrfiqgfiw6f5l/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -31,8 +37,6 @@ else() endif() -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -71,23 +75,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-3li2jcc2mecqbanoew5tznr4uzl2k2jg" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-7fwf4minhh6ymveutjnb4zetvxwurm66" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-zgwmbota3vhdxcdjlwxbhomlwllwhvnc" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-vj22dsxnnfc6hx73lfgpdmlhithbd5bq" CACHE PATH "") # MFEM not built -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-nydokvym7klek6hqoyijbwf3tbmd32ux" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-7cjtcdwjrtfgcnqoiyfrufybdw5g6i6h" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-e7cdhkbaxuyqljoyozzxrt2n57erhszx" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-v5n5ab5npmyxguqaja6xdmyl6r3gsc5a" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-tv34emklwgpl4ddrggbpkthu6utweo2a" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-e6tn6qcf3j2hqkz5ht3xrmlbddp3ngnn" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-bftoz5wfuvfwldjwe3szsi54hdpw2hfi" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-3fyzeztrclnysexhwf75pm2nxel77776" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-vuk2xmgpzxl2xb2jupm3uxqxbgrzrmbf" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-avtdwxn6q374o2nqe4rqkjzasuvmudta" CACHE PATH "") # scr not built @@ -95,20 +99,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-vuk2xmgpzxl2xb2jupm3uxqxbgrzrmbf" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-me5qygs6iauo7miussleiado3nbnw5ot/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@8.3.1.2_cuda.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@8.3.1.2_cuda.cmake index 20b77bd2a6..1b51e8b4dd 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@8.3.1.2_cuda.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@8.3.1.2_cuda.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/umpire-2023.06.0-mhaqbzgmrizieszsedhkq5j6zr56mtue;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/raja-2023.06.0-5ao6zh3anztpvifl7pi3lx6dalgabreh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/camp-2023.06.0-5yw6pcjgrzzupk3ptfneaygwjewo7sx6;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/cub-2.1.0-zpxcavwsek3eamis6c2ekyd4wpc2aff7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/lua-5.4.4-uzsm5gerahtqcinqqfwleer62mlgl6xt;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/conduit-0.8.8-pslusbff27xjqw5sct3jnddyeqlyide3;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/parmetis-4.0.3-bcniwrmmygfl3ngqqy4ogyuopuilgfy2;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/metis-5.1.0-tht2h2hqk4psrvunj7egarksgyayew3d;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/hdf5-1.8.22-h2labsbvwxgxwvphjb5i357an3dgjhqp;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/zlib-1.2.13-obyznlavcvoyytpvwwyi65s5ngcnpigv;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/c2c-1.8.0-snpbqgmnulnruetig5di7nef2gir354f;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2/blt-0.5.3-umf5hhz3yl7vspds2fejsjdbmy2npyqb;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/usr/tce/packages/cuda/cuda-11.2.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/umpire-2024.02.0-ax6j3jggtgph2kx53njdclhij5457lnr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/fmt-10.2.1-zv6ntw5mnzrvvm2mfyyjjly7cmixmgqr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/raja-2024.02.0-qz732p5cbhzuecyyn47d67h55wir7owh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/camp-2024.02.0-drrgkykr3onmqdkoc2jg6hzxzszakj35;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/cub-2.1.0-i64fir4ytcl7w527jny2bj67irxva2pu;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/py-jsonschema-2.6.0-5rwlawwpfl75pzasnxiulrkcxmznmijx;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/lua-5.4.4-saqxtlwqxhm5xszi6ohoalufvorkont7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/conduit-0.9.1-66pob6ova32wkqvnbdbskk5zk44tjbnk;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/parmetis-4.0.3-2h2xjxkc3qwi237ui476jgsqi2e4kpkh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/metis-5.1.0-3de4wffnqmwqslyiizuoheny6abmfkkn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/hdf5-1.8.23-ada6dnl7e76lppixolnsjy7gmi4adfoh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/c2c-1.8.0-c76hxrgyy2igrclt6cnsvydrkd77ufvm;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/blt-0.6.1.4-ldmftyubptq3py7xr6wirrg2eorm357z;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/gcc-runtime-8.3.1.2-7lxa2lyos6dnjfydj2ewpv4wlnnvp2hh;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/cuda/cuda-11.2.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/axom-develop-qewlj77x5de57xeii6pfarnsgahvapao/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/axom-develop-qewlj77x5de57xeii6pfarnsgahvapao/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/c2c-1.8.0-c76hxrgyy2igrclt6cnsvydrkd77ufvm/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/gcc-runtime-8.3.1.2-7lxa2lyos6dnjfydj2ewpv4wlnnvp2hh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/conduit-0.9.1-66pob6ova32wkqvnbdbskk5zk44tjbnk/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/hdf5-1.8.23-ada6dnl7e76lppixolnsjy7gmi4adfoh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/metis-5.1.0-3de4wffnqmwqslyiizuoheny6abmfkkn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/parmetis-4.0.3-2h2xjxkc3qwi237ui476jgsqi2e4kpkh/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/lua-5.4.4-saqxtlwqxhm5xszi6ohoalufvorkont7/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/py-jsonschema-2.6.0-5rwlawwpfl75pzasnxiulrkcxmznmijx/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/raja-2024.02.0-qz732p5cbhzuecyyn47d67h55wir7owh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/camp-2024.02.0-drrgkykr3onmqdkoc2jg6hzxzszakj35/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/umpire-2024.02.0-ax6j3jggtgph2kx53njdclhij5457lnr/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/fmt-10.2.1-zv6ntw5mnzrvvm2mfyyjjly7cmixmgqr/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/axom-develop-qewlj77x5de57xeii6pfarnsgahvapao/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/axom-develop-qewlj77x5de57xeii6pfarnsgahvapao/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/c2c-1.8.0-c76hxrgyy2igrclt6cnsvydrkd77ufvm/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/gcc-runtime-8.3.1.2-7lxa2lyos6dnjfydj2ewpv4wlnnvp2hh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/conduit-0.9.1-66pob6ova32wkqvnbdbskk5zk44tjbnk/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/hdf5-1.8.23-ada6dnl7e76lppixolnsjy7gmi4adfoh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/metis-5.1.0-3de4wffnqmwqslyiizuoheny6abmfkkn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/parmetis-4.0.3-2h2xjxkc3qwi237ui476jgsqi2e4kpkh/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/lua-5.4.4-saqxtlwqxhm5xszi6ohoalufvorkont7/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/py-jsonschema-2.6.0-5rwlawwpfl75pzasnxiulrkcxmznmijx/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/raja-2024.02.0-qz732p5cbhzuecyyn47d67h55wir7owh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/camp-2024.02.0-drrgkykr3onmqdkoc2jg6hzxzszakj35/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/umpire-2024.02.0-ax6j3jggtgph2kx53njdclhij5457lnr/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2/fmt-10.2.1-zv6ntw5mnzrvvm2mfyyjjly7cmixmgqr/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -31,8 +37,6 @@ else() endif() -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -99,23 +103,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/gcc-8.3.1.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/gcc-8.3.1.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-pslusbff27xjqw5sct3jnddyeqlyide3" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-66pob6ova32wkqvnbdbskk5zk44tjbnk" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-snpbqgmnulnruetig5di7nef2gir354f" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-c76hxrgyy2igrclt6cnsvydrkd77ufvm" CACHE PATH "") # MFEM not built -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-h2labsbvwxgxwvphjb5i357an3dgjhqp" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-ada6dnl7e76lppixolnsjy7gmi4adfoh" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-uzsm5gerahtqcinqqfwleer62mlgl6xt" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-saqxtlwqxhm5xszi6ohoalufvorkont7" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-5ao6zh3anztpvifl7pi3lx6dalgabreh" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-qz732p5cbhzuecyyn47d67h55wir7owh" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-mhaqbzgmrizieszsedhkq5j6zr56mtue" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-ax6j3jggtgph2kx53njdclhij5457lnr" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-5yw6pcjgrzzupk3ptfneaygwjewo7sx6" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-drrgkykr3onmqdkoc2jg6hzxzszakj35" CACHE PATH "") # scr not built @@ -123,20 +127,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-5yw6pcjgrzzupk3ptfneaygwjewo7sx6" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-5rwlawwpfl75pzasnxiulrkcxmznmijx/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1.1.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1.1.cmake index 4842c4a1c2..aacc63f587 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1.1.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1.1.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/umpire-2023.06.0-gfmhpqkxawfjbwtufn3qeg6gkzmlahr7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/raja-2023.06.0-pkp4pk4dybnbq74652a2ayzf6zvzonsy;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/camp-2023.06.0-ilclfpsbzrbirjnwqimbnwoanvxwcvwd;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/mfem-4.5.2-5tpknd5eztbbomidbr3qcs75hyvdqegw;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/hypre-2.24.0-kgmrxqyc3pjlwgzvgbchceub5u4v4tgt;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/lua-5.4.4-22nibaxxfzwid5jk3udivaptba2xtw4r;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/conduit-0.8.8-tnyxf6f7sh7kg3pzvt5acfp4btsprsp7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/parmetis-4.0.3-zsfvlzuxwixta5mjt4dqwikslhx6l6dd;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/metis-5.1.0-hpfbnba3mgk2opmqn3efr2mmda76yacg;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/hdf5-1.8.22-eduvgrxspycy6xfw2t6i6uogdtzgnygm;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/zlib-1.2.13-tnpzx5nxltbrlx27lozjehkg2lkb7lew;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/c2c-1.8.0-vxyvicuyswybrekljpj7khd56uobpc62;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1/blt-0.5.3-zleps37vlw57krmv2zruxq6bpxpn6fik;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/umpire-2024.02.0-kglsalrxtcw2bh4hnsnc5gq5jevvv7bl;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/py-jsonschema-2.6.0-7skzmrvuuo6gtwscj6b6fbdyo7sioz5h;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/mfem-4.6.0-2qilfn4m5dmpxjm2evip6nusosmiqrsz;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/hypre-2.24.0-scxx626pb345r4bpsmn4idus6dt42jcs;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/lua-5.4.4-b43zhs5fpjqoog4hrtfrtxuetq7pwd4b;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/conduit-0.9.1-gds2atmvlsftghczkaxrbdi4fotbl2a3;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/parmetis-4.0.3-unks4pi2gc6heogvv2m3cvjvgc2etfp4;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/hdf5-1.8.23-ur6rpcf7qqngwf25ezjwei6en7rcsnxq;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/blt-0.6.1.4-neovqnvk3tazh7clai422vfazmbjeaqp;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/fmt-10.2.1-iknryrusj34wtt4nk4pn2ybgwa77grms;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/camp-2024.02.0-a2mltgoskoemplkmkkup5cs4pmfn64j7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/raja-2024.02.0-kimeva5su2xhbqpy54xx5lnmvypbavab;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/metis-5.1.0-qww4ax3mkehdlf7akdbjzokbf4wxws5m;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/c2c-1.8.0-bbzy4skytx3akdcm2fvslpxn44vhsq2y;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/axom-develop-mwe36w3aijwdbfu4ckdjv2wksrvqbsj2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/axom-develop-mwe36w3aijwdbfu4ckdjv2wksrvqbsj2/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/c2c-1.8.0-bbzy4skytx3akdcm2fvslpxn44vhsq2y/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/conduit-0.9.1-gds2atmvlsftghczkaxrbdi4fotbl2a3/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/hdf5-1.8.23-ur6rpcf7qqngwf25ezjwei6en7rcsnxq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/metis-5.1.0-qww4ax3mkehdlf7akdbjzokbf4wxws5m/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/parmetis-4.0.3-unks4pi2gc6heogvv2m3cvjvgc2etfp4/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/lua-5.4.4-b43zhs5fpjqoog4hrtfrtxuetq7pwd4b/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/mfem-4.6.0-2qilfn4m5dmpxjm2evip6nusosmiqrsz/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/hypre-2.24.0-scxx626pb345r4bpsmn4idus6dt42jcs/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/py-jsonschema-2.6.0-7skzmrvuuo6gtwscj6b6fbdyo7sioz5h/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/raja-2024.02.0-kimeva5su2xhbqpy54xx5lnmvypbavab/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/camp-2024.02.0-a2mltgoskoemplkmkkup5cs4pmfn64j7/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/umpire-2024.02.0-kglsalrxtcw2bh4hnsnc5gq5jevvv7bl/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/fmt-10.2.1-iknryrusj34wtt4nk4pn2ybgwa77grms/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/axom-develop-mwe36w3aijwdbfu4ckdjv2wksrvqbsj2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/axom-develop-mwe36w3aijwdbfu4ckdjv2wksrvqbsj2/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/c2c-1.8.0-bbzy4skytx3akdcm2fvslpxn44vhsq2y/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/conduit-0.9.1-gds2atmvlsftghczkaxrbdi4fotbl2a3/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/hdf5-1.8.23-ur6rpcf7qqngwf25ezjwei6en7rcsnxq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/metis-5.1.0-qww4ax3mkehdlf7akdbjzokbf4wxws5m/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/parmetis-4.0.3-unks4pi2gc6heogvv2m3cvjvgc2etfp4/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/lua-5.4.4-b43zhs5fpjqoog4hrtfrtxuetq7pwd4b/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/mfem-4.6.0-2qilfn4m5dmpxjm2evip6nusosmiqrsz/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/hypre-2.24.0-scxx626pb345r4bpsmn4idus6dt42jcs/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/py-jsonschema-2.6.0-7skzmrvuuo6gtwscj6b6fbdyo7sioz5h/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/raja-2024.02.0-kimeva5su2xhbqpy54xx5lnmvypbavab/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/camp-2024.02.0-a2mltgoskoemplkmkkup5cs4pmfn64j7/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/umpire-2024.02.0-kglsalrxtcw2bh4hnsnc5gq5jevvv7bl/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1/fmt-10.2.1-iknryrusj34wtt4nk4pn2ybgwa77grms/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -37,8 +43,6 @@ set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRI set(CMAKE_Fortran_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -83,23 +87,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-tnyxf6f7sh7kg3pzvt5acfp4btsprsp7" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-gds2atmvlsftghczkaxrbdi4fotbl2a3" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-vxyvicuyswybrekljpj7khd56uobpc62" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-bbzy4skytx3akdcm2fvslpxn44vhsq2y" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-5tpknd5eztbbomidbr3qcs75hyvdqegw" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-2qilfn4m5dmpxjm2evip6nusosmiqrsz" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-eduvgrxspycy6xfw2t6i6uogdtzgnygm" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-ur6rpcf7qqngwf25ezjwei6en7rcsnxq" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-22nibaxxfzwid5jk3udivaptba2xtw4r" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-b43zhs5fpjqoog4hrtfrtxuetq7pwd4b" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-pkp4pk4dybnbq74652a2ayzf6zvzonsy" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-kimeva5su2xhbqpy54xx5lnmvypbavab" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-gfmhpqkxawfjbwtufn3qeg6gkzmlahr7" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-kglsalrxtcw2bh4hnsnc5gq5jevvv7bl" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-ilclfpsbzrbirjnwqimbnwoanvxwcvwd" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-a2mltgoskoemplkmkkup5cs4pmfn64j7" CACHE PATH "") # scr not built @@ -107,20 +111,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-ilclfpsbzrbirjnwqimbnwoanvxwcvwd" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-7skzmrvuuo6gtwscj6b6fbdyo7sioz5h/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1.2_cuda.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1.2_cuda.cmake index 39850d2f7e..2c16ebf051 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1.2_cuda.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1.2_cuda.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/umpire-2023.06.0-3rafuldohvpy7vxbdjpv3khllaqhgwp5;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/raja-2023.06.0-rzllz6mlecs2kg7dtqwqtl7wvw34ul2q;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/camp-2023.06.0-zpwybznbb32yltcpzmiplykwdlqe2afw;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/cub-2.1.0-45sgqog6spfots46rohzcokfoaxjil4p;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/mfem-4.5.2-264o4xkxhcafenixttd6lw5k466a62b3;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/hypre-2.24.0-x2zforves4hmpcuwjskxbvxu55i5kpfx;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/lua-5.4.4-6yyyruucztcz5p4w33mhydqn5kiywkjn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/conduit-0.8.8-pil6joltz2jsp4vcdsfgndntfkqoi3na;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/parmetis-4.0.3-ogq2nkkjvarhjgaweb6b5lglfcmes3hm;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/metis-5.1.0-7ojc3lx2y6dk2g7gvl6m5n4fq5yewukb;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/hdf5-1.8.22-y23h3hgemr7s6terq2mvsz5if5u327sr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/zlib-1.2.13-nd6r3ccnozxmd7jdwyxbgvqg5y2bn3ds;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/c2c-1.8.0-ckwviu4jwtot52xykd3kuryozuw5o35p;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2/blt-0.5.3-47zfyusaljp2e7x3lsq3iggqvapxox6t;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/usr/tce/packages/cuda/cuda-11.2.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19-cuda-11.2.0;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/umpire-2024.02.0-57lf4jwgiqrgzpeaj7uerwej3ht4wgyt;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/raja-2024.02.0-kghzomlpcrlcri3dky476kdizqatfe5c;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/camp-2024.02.0-ppwilytkx2rffmtiroong3ucsojgc2o7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/py-jsonschema-2.6.0-qpksngigqtckjhj62aeckyiptsyrquwo;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/mfem-4.6.0-giwvzuwtccsd4dt3y6co4ul3x2lkgmpw;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/hypre-2.24.0-njvlsye4yxx7gzho7hpvfaiyugfztlef;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/lua-5.4.4-6jtix4lxlnmvpkuahs62qqbjk5yubmux;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/conduit-0.9.1-wh6qi5s3jncyggsy6w4dxdlcg3n3feag;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/parmetis-4.0.3-buyj5iliasgoeiauw335rdrvht4l46ut;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/hdf5-1.8.23-vlybikhncayldwo36udsi225qyan7dos;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/blt-0.6.1.4-lhkhl33mqna6lfzkqz5fbwzy6by5effo;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/fmt-10.2.1-fl5fgyfjfnworql33rfi4oufl2fyx2ec;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/cub-2.1.0-gk54nvuh77yqhzft2rlourfzd7aqvs6i;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/metis-5.1.0-wzyd4pwtce4c22uw3tq3dljdjpfjrd3z;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/c2c-1.8.0-jklapw7gpgw7rftjwecmk22p7wz4qpc2;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/cuda/cuda-11.2.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19-cuda-11.2.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/axom-develop-woz7ol2eqtmsmfz3sckoddilap5hixzq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/axom-develop-woz7ol2eqtmsmfz3sckoddilap5hixzq/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/c2c-1.8.0-jklapw7gpgw7rftjwecmk22p7wz4qpc2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/conduit-0.9.1-wh6qi5s3jncyggsy6w4dxdlcg3n3feag/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/hdf5-1.8.23-vlybikhncayldwo36udsi225qyan7dos/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/metis-5.1.0-wzyd4pwtce4c22uw3tq3dljdjpfjrd3z/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/parmetis-4.0.3-buyj5iliasgoeiauw335rdrvht4l46ut/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19-cuda-11.2.0/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/lua-5.4.4-6jtix4lxlnmvpkuahs62qqbjk5yubmux/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/mfem-4.6.0-giwvzuwtccsd4dt3y6co4ul3x2lkgmpw/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/hypre-2.24.0-njvlsye4yxx7gzho7hpvfaiyugfztlef/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/py-jsonschema-2.6.0-qpksngigqtckjhj62aeckyiptsyrquwo/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/raja-2024.02.0-kghzomlpcrlcri3dky476kdizqatfe5c/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/camp-2024.02.0-ppwilytkx2rffmtiroong3ucsojgc2o7/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/umpire-2024.02.0-57lf4jwgiqrgzpeaj7uerwej3ht4wgyt/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/fmt-10.2.1-fl5fgyfjfnworql33rfi4oufl2fyx2ec/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/axom-develop-woz7ol2eqtmsmfz3sckoddilap5hixzq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/axom-develop-woz7ol2eqtmsmfz3sckoddilap5hixzq/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/c2c-1.8.0-jklapw7gpgw7rftjwecmk22p7wz4qpc2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/conduit-0.9.1-wh6qi5s3jncyggsy6w4dxdlcg3n3feag/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/hdf5-1.8.23-vlybikhncayldwo36udsi225qyan7dos/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/metis-5.1.0-wzyd4pwtce4c22uw3tq3dljdjpfjrd3z/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/parmetis-4.0.3-buyj5iliasgoeiauw335rdrvht4l46ut/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19-cuda-11.2.0/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/lua-5.4.4-6jtix4lxlnmvpkuahs62qqbjk5yubmux/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/mfem-4.6.0-giwvzuwtccsd4dt3y6co4ul3x2lkgmpw/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/hypre-2.24.0-njvlsye4yxx7gzho7hpvfaiyugfztlef/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/py-jsonschema-2.6.0-qpksngigqtckjhj62aeckyiptsyrquwo/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/raja-2024.02.0-kghzomlpcrlcri3dky476kdizqatfe5c/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/camp-2024.02.0-ppwilytkx2rffmtiroong3ucsojgc2o7/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/umpire-2024.02.0-57lf4jwgiqrgzpeaj7uerwej3ht4wgyt/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2/fmt-10.2.1-fl5fgyfjfnworql33rfi4oufl2fyx2ec/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -37,8 +43,6 @@ set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRI set(CMAKE_Fortran_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -111,23 +115,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_17_42_42/xl-16.1.1.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_06_20_19_26/xl-16.1.1.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-pil6joltz2jsp4vcdsfgndntfkqoi3na" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-wh6qi5s3jncyggsy6w4dxdlcg3n3feag" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-ckwviu4jwtot52xykd3kuryozuw5o35p" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-jklapw7gpgw7rftjwecmk22p7wz4qpc2" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-264o4xkxhcafenixttd6lw5k466a62b3" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-giwvzuwtccsd4dt3y6co4ul3x2lkgmpw" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-y23h3hgemr7s6terq2mvsz5if5u327sr" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-vlybikhncayldwo36udsi225qyan7dos" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-6yyyruucztcz5p4w33mhydqn5kiywkjn" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-6jtix4lxlnmvpkuahs62qqbjk5yubmux" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-rzllz6mlecs2kg7dtqwqtl7wvw34ul2q" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-kghzomlpcrlcri3dky476kdizqatfe5c" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-3rafuldohvpy7vxbdjpv3khllaqhgwp5" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-57lf4jwgiqrgzpeaj7uerwej3ht4wgyt" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-zpwybznbb32yltcpzmiplykwdlqe2afw" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-ppwilytkx2rffmtiroong3ucsojgc2o7" CACHE PATH "") # scr not built @@ -135,20 +139,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-zpwybznbb32yltcpzmiplykwdlqe2afw" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-qpksngigqtckjhj62aeckyiptsyrquwo/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/other/Darwin.cmake b/host-configs/other/Darwin.cmake deleted file mode 100755 index c8b00ae8e7..0000000000 --- a/host-configs/other/Darwin.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) -#------------------------------------------------------------------------------ -# CMake Cache Seed file for OSX machines. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# use clang compilers -#------------------------------------------------------------------------------ -set(CMAKE_C_COMPILER "clang" CACHE PATH "") -set(CMAKE_CXX_COMPILER "clang++" CACHE PATH "") diff --git a/host-configs/other/sqa-uno-MSVC-INTEL.cmake b/host-configs/other/MSVC-INTEL.cmake similarity index 97% rename from host-configs/other/sqa-uno-MSVC-INTEL.cmake rename to host-configs/other/MSVC-INTEL.cmake index 70e910635b..6fa3ab12f9 100644 --- a/host-configs/other/sqa-uno-MSVC-INTEL.cmake +++ b/host-configs/other/MSVC-INTEL.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/other/sqa-uno-MSVC.cmake b/host-configs/other/MSVC.cmake similarity index 97% rename from host-configs/other/sqa-uno-MSVC.cmake rename to host-configs/other/MSVC.cmake index 6cc090680b..5ae02afae9 100644 --- a/host-configs/other/sqa-uno-MSVC.cmake +++ b/host-configs/other/MSVC.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/other/README b/host-configs/other/README new file mode 100644 index 0000000000..90d95acaba --- /dev/null +++ b/host-configs/other/README @@ -0,0 +1,2 @@ +These host-configs are here for documentation of certain use-cases. These are not regularly +tested and may not be currently working. diff --git a/host-configs/other/battra.cmake b/host-configs/other/battra.cmake deleted file mode 100644 index 66fbbb1386..0000000000 --- a/host-configs/other/battra.cmake +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#------------------------------------------------------------------------------ -# uberenv host-config -# -# This is a generated file, edit at own risk. -#------------------------------------------------------------------------------ -# x86_64-gcc@4.9.3 -#------------------------------------------------------------------------------ - -# cmake from uberenv -# cmake executable path: /home/taylor16/apps/cmake-3.8.2/bin/cmake -#------------------------------------------------------------------------------ -# using gcc@4.9.3 compiler spec -#------------------------------------------------------------------------------ - -# c compiler used by spack -set(CMAKE_C_COMPILER "/home/taylor16/apps/gcc-4.9.4/bin/gcc" CACHE PATH "") - -# cpp compiler used by spack -set(CMAKE_CXX_COMPILER "/home/taylor16/apps/gcc-4.9.4/bin/g++" CACHE PATH "") - -# fortran compiler used by spack -set(ENABLE_FORTRAN ON CACHE PATH "") - -set(CMAKE_Fortran_COMPILER "/home/taylor16/apps/gcc-4.9.4/bin/gfortran" CACHE PATH "") - -# Root directory for generated TPLs -set(TPL_ROOT "/home/taylor16/tpl/v2" CACHE PATH "") - -# hdf5 from uberenv -set(HDF5_DIR "${TPL_ROOT}" CACHE PATH "") - -# conduit from uberenv -set(CONDUIT_DIR "${TPL_ROOT}" CACHE PATH "") - -# doxygen from uberenv -set(DOXYGEN_EXECUTABLE "${TPL_ROOT}/bin/doxygen" CACHE PATH "") - -# python from uberenv -set(PYTHON_EXECUTABLE "${TPL_ROOT}/bin/python" CACHE PATH "") - -# lua from uberenv -set(LUA_DIR "${TPL_ROOT}" CACHE PATH "") - -# sphinx from uberenv -set(SPHINX_EXECUTABLE "${TPL_ROOT}/bin/sphinx-build" CACHE PATH "") - -# uncrustify from uberenv -set(UNCRUSTIFY_EXECUTABLE "${TPL_ROOT}/bin/uncrustify" CACHE PATH "") - -# boost headers from uberenv -set(BOOST_DIR "${TPL_ROOT}" CACHE PATH "") - -# lcov and genhtml from uberenv -set(LCOV_PATH "${TPL_ROOT}/usr/bin/lcov" CACHE PATH "") - -set(GENHTML_PATH "${TPL_ROOT}/usr/bin/genhtml" CACHE PATH "") - -#------------------------------------------------------------------------------ -# end uberenv host-config -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# MPI - manually added these for now. -#------------------------------------------------------------------------------ -#set(ENABLE_MPI ON CACHE PATH "") -#set(MPI_C_COMPILER "/home/taylor16/local/mpich-3.2/bin/mpicc" CACHE PATH "") -#set(MPI_CXX_COMPILER "/home/taylor16/local/mpich-3.2/bin/mpicxx" CACHE PATH "") -#set(MPI_Fortran_COMPILER "/home/taylor16/local/mpich-3.2/bin/mpif90" CACHE PATH "") - -#------------------------------------------------------------------------------ -# SHROUD - manually added for now. Use a public build add to TPL later -#------------------------------------------------------------------------------ -set(SHROUD_EXECUTABLE "/home/taylor16/tpl/shroud/bin/shroud" CACHE PATH "") - diff --git a/host-configs/other/empress.llnl.gov.cmake b/host-configs/other/empress.llnl.gov.cmake deleted file mode 100644 index a2ec8202b2..0000000000 --- a/host-configs/other/empress.llnl.gov.cmake +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#------------------------------------------------------------------------------ -# uberenv host-config -# -# This is a generated file, edit at own risk. -#------------------------------------------------------------------------------ -# x86_64-gcc@4.9.3 -#------------------------------------------------------------------------------ - -# cmake from uberenv -# cmake executable path: /home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/cmake-3.3.1-jkk5puodwd24sh2egavyrp2ony2z3wtn/bin/cmake - -#------------------------------------------------------------------------------ -# using gcc@4.9.3 compiler spec -#------------------------------------------------------------------------------ - -# c compiler used by spack -set(CMAKE_C_COMPILER "/home/taylor16/gapps/gcc-4.9.3/bin/gcc" CACHE PATH "") - -# cpp compiler used by spack -set(CMAKE_CXX_COMPILER "/home/taylor16/gapps/gcc-4.9.3/bin/g++" CACHE PATH "") - -# fortran compiler used by spack -set(ENABLE_FORTRAN ON CACHE PATH "") - -set(CMAKE_Fortran_COMPILER "/home/taylor16/gapps/gcc-4.9.3/bin/gfortran" CACHE PATH "") - -# hdf5 from uberenv -set(HDF5_DIR "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/hdf5-1.8.16-vhefrjw2f57yhjzb77fuvhlaowx66dht" CACHE PATH "") - -# conduit from uberenv -#set(CONDUIT_DIR "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/conduit-github-sfgmvgy7nlranrdldpoqrfkrcwv3bvid" CACHE PATH "") -set(CONDUIT_DIR "/home/taylor16/conduit/debug-install" CACHE PATH "") - -# doxygen from uberenv -set(DOXYGEN_EXECUTABLE "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/doxygen-1.8.10-7qxnjx5i5cyy2nbygrdihsdgzrnfvs77/bin/doxygen" CACHE PATH "") - -# python from uberenv -set(PYTHON_EXECUTABLE "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/python-2.7.11-hk7h4ntkiplj3ukfwxcbr7oxqtf3n2hy/bin/python" CACHE PATH "") - -# lua from uberenv -set(LUA_DIR "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/lua-5.1.5-44ijmjynmfovg6eteacz54gu6muabngc" CACHE PATH "") - -# sphinx from uberenv -set(SPHINX_EXECUTABLE "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/python-2.7.11-hk7h4ntkiplj3ukfwxcbr7oxqtf3n2hy/bin/sphinx-build" CACHE PATH "") - -# uncrustify from uberenv -set(UNCRUSTIFY_EXECUTABLE "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/uncrustify-0.61-sdasmocwkfmf6xupjpoo73rzdddf2nl6/bin/uncrustify" CACHE PATH "") - -# sparsehash headers from uberenv -set(SPARSEHASH_DIR "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/sparsehash-headers-2.0.2-rmpk4wmjkozch4i54wa7l5zjfyru7yr3" CACHE PATH "") - -# boost headers from uberenv -set(ENABLE_BOOST ON CACHE PATH "") -set(BOOST_ROOT "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/boost-headers-1.58.0-6jjq5njm5itr67imya3p4fcnmiaj5nab" CACHE PATH "") - -# lcov and genhtml from uberenv -set(LCOV_PATH "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/lcov-1.11-h3ijl43wxo53yrr7j7gsnmpuc4wc5nrn/usr/bin/lcov" CACHE PATH "") - -set(GENHTML_PATH "/home/taylor16/tpl/v7mpi/spack/opt/spack/x86_64/gcc-4.9.3/lcov-1.11-h3ijl43wxo53yrr7j7gsnmpuc4wc5nrn/usr/bin/genhtml" CACHE PATH "") - -#------------------------------------------------------------------------------ -# end uberenv host-config -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# MPI - manually added these for now. -#------------------------------------------------------------------------------ -set(ENABLE_MPI ON CACHE PATH "") -set(MPI_C_COMPILER "/home/taylor16/local/mpich-3.2/bin/mpicc" CACHE PATH "") -set(MPI_CXX_COMPILER "/home/taylor16/local/mpich-3.2/bin/mpicxx" CACHE PATH "") -set(MPI_Fortran_COMPILER "/home/taylor16/local/mpich-3.2/bin/mpif90" CACHE PATH "") diff --git a/host-configs/other/naples.cmake b/host-configs/other/naples.cmake deleted file mode 100644 index 7ecec19f1f..0000000000 --- a/host-configs/other/naples.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) -#------------------------------------------------------------------------------ -# uberenv host-config for asctoolkit -#------------------------------------------------------------------------------ -# cmake from uberenv -# cmake executable path: /Users/harrison37/Work/asctoolkit/uberenv_libs/spack/opt/macosx_10.9_x86_64/clang@3.4svn/cmake@3.2.2/bin/cmake - -# conduit from uberenv -set(CONDUIT_DIR "/Users/harrison37/Work/asctoolkit/uberenv_libs/spack/opt/macosx_10.9_x86_64/clang@3.4svn/conduit@github-6758ccf0" CACHE PATH "") - -# python from uberenv -set(PYTHON_EXECUTABLE "/Users/harrison37/Work/asctoolkit/uberenv_libs/spack/opt/macosx_10.9_x86_64/clang@3.4svn/python@2.7.8/bin/python" CACHE PATH "") - -# sphinx from uberenv -set(SPHINX_EXECUTABLE "/Users/harrison37/Work/asctoolkit/uberenv_libs/spack/opt/macosx_10.9_x86_64/clang@3.4svn/python@2.7.8/bin/sphinx-build" CACHE PATH "") - -# uncrustify from uberenv -set(UNCRUSTIFY_EXECUTABLE "/Users/harrison37/Work/asctoolkit/uberenv_libs/spack/opt/macosx_10.9_x86_64/clang@3.4svn/uncrustify@0.61/bin/uncrustify" CACHE PATH "") - -# sparsehash headers from uberenv -set(SPARSEHASH_DIR "/Users/harrison37/Work/asctoolkit/uberenv_libs/spack/opt/macosx_10.9_x86_64/clang@3.4svn/sparsehash-headers@2.0.2" CACHE PATH "") - -# boost headers from uberenv -set(ENABLE_BOOST ON CACHE PATH "") -set(BOOST_ROOT "/Users/harrison37/Work/asctoolkit/uberenv_libs/spack/opt/macosx_10.9_x86_64/clang@3.4svn/boost-headers@1.58.0" CACHE PATH "") - diff --git a/host-configs/other/no-tpl-toss_3_x86_64_ib-clang@10-ifort@19.cmake b/host-configs/other/no-tpl-toss_4_x86_64_ib-clang@14-ifort@19.cmake similarity index 88% rename from host-configs/other/no-tpl-toss_3_x86_64_ib-clang@10-ifort@19.cmake rename to host-configs/other/no-tpl-toss_4_x86_64_ib-clang@14-ifort@19.cmake index 7f1f5ff7a7..cd7f0139f7 100644 --- a/host-configs/other/no-tpl-toss_3_x86_64_ib-clang@10-ifort@19.cmake +++ b/host-configs/other/no-tpl-toss_4_x86_64_ib-clang@14-ifort@19.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -16,7 +16,7 @@ # cd # mkdir build # cd build -# cmake -C ../host-config/other/no-tpl-toss_3_x86_64_ib-clang@10-ifort@19.cmake \ +# cmake -C ../host-config/other/no-tpl-toss_4_x86_64_ib-clang@14-ifort@19.cmake \ # -DCMAKE_BUILD_TYPE={Debug,Release} \ # -DBUILD_SHARED_LIBS={ON,OFF(DEFAULT)} \ # -DENABLE_EXAMPLES={ON,OFF} \ @@ -24,14 +24,14 @@ # -DCMAKE_INSTALL_PREFIX= /path/to/install/dir \ # ../src #------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake +# CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ set(ENABLE_FORTRAN ON CACHE BOOL "") set(_gnu_root "/usr/tce/packages/gcc/gcc-8.3.1" CACHE PATH "") -set(_clang_root "/usr/tce/packages/clang/clang-10.0.0" CACHE PATH "") -set(_intel_root "/usr/tce/packages/intel/intel-19.0.4" CACHE PATH "") +set(_clang_root "/usr/tce/packages/clang/clang-14.0.6" CACHE PATH "") +set(_intel_root "/usr/tce/packages/intel-classic-tce/intel-classic-19.0.4" CACHE PATH "") set(CMAKE_C_COMPILER "${_clang_root}/bin/clang" CACHE PATH "") set(CMAKE_CXX_COMPILER "${_clang_root}/bin/clang++" CACHE PATH "") @@ -60,7 +60,7 @@ set(AXOM_ENABLE_KLEE OFF CACHE BOOL "") #------------------------------------------------------------------------------ set(ENABLE_MPI ON CACHE BOOL "") -set(_mpi_root "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0" CACHE PATH "") +set(_mpi_root "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-14.0.6" CACHE PATH "") set(MPI_C_COMPILER "${_mpi_root}/bin/mpicc" CACHE PATH "") set(MPI_CXX_COMPILER "${_mpi_root}/bin/mpicxx" CACHE PATH "") set(MPI_Fortran_COMPILER "${_mpi_root}/bin/mpif90" CACHE PATH "") @@ -75,4 +75,4 @@ set(ENABLE_OPENMP OFF CACHE BOOL "") set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") set(ENABLE_DOCS OFF CACHE BOOL "") -set(CLANGFORMAT_EXECUTABLE "/usr/tce/packages/clang/clang-10.0.0/bin/clang-format" CACHE PATH "") +set(CLANGFORMAT_EXECUTABLE "/usr/tce/packages/clang/clang-14.0.6/bin/clang-format" CACHE PATH "") diff --git a/host-configs/other/no-tpl-toss_3_x86_64_ib-clang@10.0.0.cmake b/host-configs/other/no-tpl-toss_4_x86_64_ib-clang@14.0.6.cmake similarity index 87% rename from host-configs/other/no-tpl-toss_3_x86_64_ib-clang@10.0.0.cmake rename to host-configs/other/no-tpl-toss_4_x86_64_ib-clang@14.0.6.cmake index ca1fd5252c..64785589c5 100644 --- a/host-configs/other/no-tpl-toss_3_x86_64_ib-clang@10.0.0.cmake +++ b/host-configs/other/no-tpl-toss_4_x86_64_ib-clang@14.0.6.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -15,7 +15,7 @@ # cd # mkdir build # cd build -# cmake -C ../host-config/other/no-tpl-toss3_x86_64_ib-clang@10.0.0.cmake \ +# cmake -C ../host-config/other/no-tpl-toss4_x86_64_ib-clang@14.0.6.cmake \ # -DCMAKE_BUILD_TYPE={Debug,Release} \ # -DBUILD_SHARED_LIBS={ON,OFF(DEFAULT)} \ # -DENABLE_EXAMPLES={ON,OFF} \ @@ -23,12 +23,12 @@ # -DCMAKE_INSTALL_PREFIX= /path/to/install/dir \ # ../src #------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.16.8/bin/cmake +# CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ set(ENABLE_FORTRAN ON CACHE BOOL "") -set(COMPILER_HOME "/usr/tce/packages/clang/clang-10.0.0" CACHE PATH "") +set(COMPILER_HOME "/usr/tce/packages/clang/clang-14.0.6" CACHE PATH "") set(CMAKE_C_COMPILER "${COMPILER_HOME}/bin/clang" CACHE PATH "") set(CMAKE_CXX_COMPILER "${COMPILER_HOME}/bin/clang++" CACHE PATH "") set(CMAKE_Fortran_COMPILER "/usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran" CACHE PATH "") @@ -46,7 +46,7 @@ set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,${COMPILER_HOME}/lib" CACHE STRING "Adds a #------------------------------------------------------------------------------ set(ENABLE_MPI ON CACHE BOOL "") -set(MPI_HOME "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0" CACHE PATH "") +set(MPI_HOME "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-14.0.6" CACHE PATH "") set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") @@ -57,5 +57,5 @@ set(MPIEXEC_NUMPROC_FLAG "-n" CACHE PATH "") #------------------------------------------------------------------------------ # Other #------------------------------------------------------------------------------ -set(CLANGFORMAT_EXECUTABLE "/usr/tce/packages/clang/clang-10.0.0/bin/clang-format" CACHE PATH "") +set(CLANGFORMAT_EXECUTABLE "/usr/tce/packages/clang/clang-14.0.6/bin/clang-format" CACHE PATH "") diff --git a/host-configs/other/no-tpl-toss_3_x86_64_ib-intel@19.0.4.cmake b/host-configs/other/no-tpl-toss_4_x86_64_ib-intel@19.1.2.cmake similarity index 88% rename from host-configs/other/no-tpl-toss_3_x86_64_ib-intel@19.0.4.cmake rename to host-configs/other/no-tpl-toss_4_x86_64_ib-intel@19.1.2.cmake index cc926b19d1..86268df1c2 100644 --- a/host-configs/other/no-tpl-toss_3_x86_64_ib-intel@19.0.4.cmake +++ b/host-configs/other/no-tpl-toss_4_x86_64_ib-intel@19.1.2.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -15,7 +15,7 @@ # cd # mkdir build # cd build -# cmake -C ../host-config/other/no-tpl-toss3-intel@19.0.4.cmake \ +# cmake -C ../host-config/other/no-tpl-toss_4_x86_64_ib-intel@19.0.4.cmake \ # -DCMAKE_BUILD_TYPE={Debug,Release} \ # -DBUILD_SHARED_LIBS={ON,OFF(DEFAULT)} \ # -DENABLE_EXAMPLES={ON,OFF} \ @@ -23,12 +23,12 @@ # -DCMAKE_INSTALL_PREFIX= /path/to/install/dir \ # ../src #------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.16.8/bin/cmake +# CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ set(ENABLE_FORTRAN ON CACHE BOOL "") -set(COMPILER_HOME "/usr/tce/packages/intel/intel-19.0.4" ) +set(COMPILER_HOME "/usr/tce/packages/intel-classic-tce/intel-classic-19.1.2" ) set(CMAKE_C_COMPILER "${COMPILER_HOME}/bin/icc" CACHE PATH "") set(CMAKE_CXX_COMPILER "${COMPILER_HOME}/bin/icpc" CACHE PATH "") set(CMAKE_Fortran_COMPILER "${COMPILER_HOME}/bin/ifort" CACHE PATH "") @@ -44,7 +44,7 @@ set(AXOM_ENABLE_KLEE OFF CACHE BOOL "") #------------------------------------------------------------------------------ set(ENABLE_MPI ON CACHE BOOL "") -set(MPI_HOME "/usr/tce/packages/mvapich2/mvapich2-2.3-intel-19.0.4" CACHE PATH "") +set(MPI_HOME "/usr/tce/packages/mvapich2/mvapich2-2.3.7-intel-classic-19.1.2" CACHE PATH "") set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") diff --git a/host-configs/quartz-toss_4_x86_64_ib-clang@14.0.6.cmake b/host-configs/quartz-toss_4_x86_64_ib-clang@14.0.6.cmake index c35ae5747e..db22ed82db 100644 --- a/host-configs/quartz-toss_4_x86_64_ib-clang@14.0.6.cmake +++ b/host-configs/quartz-toss_4_x86_64_ib-clang@14.0.6.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/umpire-2023.06.0-o2m7hsis7okxq3yg3xtw5yfe4hqadwxj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/raja-2023.06.0-inhp4zxtm4f67dvepecvxgd7lfkwffj4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/camp-2023.06.0-nsfwjtpvvqciayarnoqbncabzlvvr4pz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/mfem-4.5.2-lwet4c3edrdvipij3r4itukmse2jklvy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/hypre-2.24.0-bwh42bebp4hiuwzlwcthpgkawape6dp3;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/conduit-0.8.8-inqrhwboacvngevqbvavhpisx4aeqpvy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/parmetis-4.0.3-jthqwflsj5bpe6onwsb5r2zi5wbx6pq4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/metis-5.1.0-imzig3eih3itpztvvk4yildzgq6aeelo;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/hdf5-1.8.22-5mfm2r7fo5krpj7vvmayz24qksnluryl;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/c2c-1.8.0-5smd5ktj7yjc2egeyum4t5vlwmw3jktt;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/gmake-4.4.1-6lgy76r7dbvqm6mbwb2jkpcuycf7tb27;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6/blt-0.5.3-xa3bmu75nkolqiewb5ftk5tp2jpzw57n;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-clang-14.0.6;/usr/tce/packages/clang/clang-14.0.6" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/umpire-2024.02.0-jhuql5fc2vhya4sdl7g4nlcrzaoycqai;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/scr-3.0.1-t7t35dyvwswfrk3lp2k4tcjpiyyylgr6;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/spath-0.2.0-5ypljdbn6yf6ab3jabzpeeuxxvbm6vix;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/er-0.2.0-pfk7tzcycgqnc73twpnleapauynyrmuo;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/shuffile-0.2.0-lcyevsv6yv4cwtahb3kt5h4emqtfwwvb;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/redset-0.2.0-yg22aoerdpabedvtormddcankg4lkitu;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/rankstr-0.1.0-t7qtfe3uihx4s2ia5gft2rvwmbfsaqcz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/dtcmp-1.1.4-scoxi2onj4nu3g5em5dgc4imwzihgfjj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/lwgrp-1.0.5-rdvuqikm56okeru5jkroem5tpaybke3q;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/axl-0.7.1-dvovqn3v6stb27lftz5c2jv7ykyt74o3;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/kvtree-1.3.0-3lkpy2ktv66bhbyxtg7r6xca2shap6sw;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/raja-2024.02.0-i7u43vvuic25rvjjhkeblvxeitkvzjwy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/py-jsonschema-2.6.0-6j5dc4xbppedseqpxhmnvdsvfm5nohqz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/mfem-4.6.0-2sgpgtnhas5crnwvexabyzuzouxgblc5;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/hypre-2.24.0-jonmheld2iyk5vpkxjps3wvk6ojyvkm5;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/conduit-0.9.1-sioyszp7ze6fzubtdslxlpkxzojic7hq;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/parmetis-4.0.3-de7rslbjz6xchwd4jlec2iswp6yf4yt7;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/hdf5-1.8.23-j75364eqyn3yxqzod7t4v3hpbaw3zqg4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/blt-0.6.1.4-oouarzy7h3sj5quygkhjaduigaxbj4at;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/fmt-10.2.1-lfndxhuits6wwazxaoj5dxl3ix3hw2cc;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/camp-2024.02.0-ejjy6cua3jj5bnwbk3r6x46ffgqe6tip;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/zlib-ng-2.1.5-lkg7eg7nky6w74eujzgmp6hnhkaf2w7p;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/libyogrt-1.33-z45arsyuiqgmqeo3vnzdiosnbyksfypl;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/metis-5.1.0-ggcpxjmhkbi3nwtqmgu7dal2rsedyza5;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/gmake-4.4.1-jimcbwsnakmlfui3jg7a4e6327ry222f;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/c2c-1.8.0-eojdjy4bkke6p7mtj47tsbk35f3ag3us;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-clang-14.0.6;/usr/tce/packages/clang/clang-14.0.6" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/axom-develop-e3jrpv4mb36q3jxxcbz2ubhcdd75zs2a/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/axom-develop-e3jrpv4mb36q3jxxcbz2ubhcdd75zs2a/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/c2c-1.8.0-eojdjy4bkke6p7mtj47tsbk35f3ag3us/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/conduit-0.9.1-sioyszp7ze6fzubtdslxlpkxzojic7hq/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/hdf5-1.8.23-j75364eqyn3yxqzod7t4v3hpbaw3zqg4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/zlib-ng-2.1.5-lkg7eg7nky6w74eujzgmp6hnhkaf2w7p/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/metis-5.1.0-ggcpxjmhkbi3nwtqmgu7dal2rsedyza5/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/parmetis-4.0.3-de7rslbjz6xchwd4jlec2iswp6yf4yt7/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/mfem-4.6.0-2sgpgtnhas5crnwvexabyzuzouxgblc5/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/hypre-2.24.0-jonmheld2iyk5vpkxjps3wvk6ojyvkm5/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/py-jsonschema-2.6.0-6j5dc4xbppedseqpxhmnvdsvfm5nohqz/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/raja-2024.02.0-i7u43vvuic25rvjjhkeblvxeitkvzjwy/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/camp-2024.02.0-ejjy6cua3jj5bnwbk3r6x46ffgqe6tip/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/dtcmp-1.1.4-scoxi2onj4nu3g5em5dgc4imwzihgfjj/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/lwgrp-1.0.5-rdvuqikm56okeru5jkroem5tpaybke3q/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/libyogrt-1.33-z45arsyuiqgmqeo3vnzdiosnbyksfypl/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/scr-3.0.1-t7t35dyvwswfrk3lp2k4tcjpiyyylgr6/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/axl-0.7.1-dvovqn3v6stb27lftz5c2jv7ykyt74o3/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/kvtree-1.3.0-3lkpy2ktv66bhbyxtg7r6xca2shap6sw/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/er-0.2.0-pfk7tzcycgqnc73twpnleapauynyrmuo/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/rankstr-0.1.0-t7qtfe3uihx4s2ia5gft2rvwmbfsaqcz/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/redset-0.2.0-yg22aoerdpabedvtormddcankg4lkitu/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/shuffile-0.2.0-lcyevsv6yv4cwtahb3kt5h4emqtfwwvb/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/spath-0.2.0-5ypljdbn6yf6ab3jabzpeeuxxvbm6vix/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/umpire-2024.02.0-jhuql5fc2vhya4sdl7g4nlcrzaoycqai/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/fmt-10.2.1-lfndxhuits6wwazxaoj5dxl3ix3hw2cc/lib64;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/axom-develop-e3jrpv4mb36q3jxxcbz2ubhcdd75zs2a/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/axom-develop-e3jrpv4mb36q3jxxcbz2ubhcdd75zs2a/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/c2c-1.8.0-eojdjy4bkke6p7mtj47tsbk35f3ag3us/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/conduit-0.9.1-sioyszp7ze6fzubtdslxlpkxzojic7hq/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/hdf5-1.8.23-j75364eqyn3yxqzod7t4v3hpbaw3zqg4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/zlib-ng-2.1.5-lkg7eg7nky6w74eujzgmp6hnhkaf2w7p/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/metis-5.1.0-ggcpxjmhkbi3nwtqmgu7dal2rsedyza5/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/parmetis-4.0.3-de7rslbjz6xchwd4jlec2iswp6yf4yt7/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/mfem-4.6.0-2sgpgtnhas5crnwvexabyzuzouxgblc5/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/hypre-2.24.0-jonmheld2iyk5vpkxjps3wvk6ojyvkm5/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/py-jsonschema-2.6.0-6j5dc4xbppedseqpxhmnvdsvfm5nohqz/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/raja-2024.02.0-i7u43vvuic25rvjjhkeblvxeitkvzjwy/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/camp-2024.02.0-ejjy6cua3jj5bnwbk3r6x46ffgqe6tip/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/dtcmp-1.1.4-scoxi2onj4nu3g5em5dgc4imwzihgfjj/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/lwgrp-1.0.5-rdvuqikm56okeru5jkroem5tpaybke3q/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/libyogrt-1.33-z45arsyuiqgmqeo3vnzdiosnbyksfypl/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/scr-3.0.1-t7t35dyvwswfrk3lp2k4tcjpiyyylgr6/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/axl-0.7.1-dvovqn3v6stb27lftz5c2jv7ykyt74o3/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/kvtree-1.3.0-3lkpy2ktv66bhbyxtg7r6xca2shap6sw/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/er-0.2.0-pfk7tzcycgqnc73twpnleapauynyrmuo/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/rankstr-0.1.0-t7qtfe3uihx4s2ia5gft2rvwmbfsaqcz/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/redset-0.2.0-yg22aoerdpabedvtormddcankg4lkitu/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/shuffile-0.2.0-lcyevsv6yv4cwtahb3kt5h4emqtfwwvb/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/spath-0.2.0-5ypljdbn6yf6ab3jabzpeeuxxvbm6vix/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/umpire-2024.02.0-jhuql5fc2vhya4sdl7g4nlcrzaoycqai/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6/fmt-10.2.1-lfndxhuits6wwazxaoj5dxl3ix3hw2cc/lib64;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -31,8 +37,6 @@ else() endif() -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,/usr/tce/packages/clang/clang-14.0.6/lib" CACHE STRING "Adds a missing libstdc++ rpath") @@ -69,44 +73,66 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/clang-14.0.6" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/clang-14.0.6" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-inqrhwboacvngevqbvavhpisx4aeqpvy" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-sioyszp7ze6fzubtdslxlpkxzojic7hq" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-5smd5ktj7yjc2egeyum4t5vlwmw3jktt" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-eojdjy4bkke6p7mtj47tsbk35f3ag3us" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-lwet4c3edrdvipij3r4itukmse2jklvy" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-2sgpgtnhas5crnwvexabyzuzouxgblc5" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-5mfm2r7fo5krpj7vvmayz24qksnluryl" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-j75364eqyn3yxqzod7t4v3hpbaw3zqg4" CACHE PATH "") set(LUA_DIR "/usr" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-inhp4zxtm4f67dvepecvxgd7lfkwffj4" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-i7u43vvuic25rvjjhkeblvxeitkvzjwy" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-jhuql5fc2vhya4sdl7g4nlcrzaoycqai" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-ejjy6cua3jj5bnwbk3r6x46ffgqe6tip" CACHE PATH "") + +set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-t7t35dyvwswfrk3lp2k4tcjpiyyylgr6" CACHE PATH "") + +set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-3lkpy2ktv66bhbyxtg7r6xca2shap6sw" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-o2m7hsis7okxq3yg3xtw5yfe4hqadwxj" CACHE PATH "") +set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-scoxi2onj4nu3g5em5dgc4imwzihgfjj" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-nsfwjtpvvqciayarnoqbncabzlvvr4pz" CACHE PATH "") +set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-5ypljdbn6yf6ab3jabzpeeuxxvbm6vix" CACHE PATH "") -# scr not built +set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-dvovqn3v6stb27lftz5c2jv7ykyt74o3" CACHE PATH "") + +set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-rdvuqikm56okeru5jkroem5tpaybke3q" CACHE PATH "") + +set(ER_DIR "${TPL_ROOT}/er-0.2.0-pfk7tzcycgqnc73twpnleapauynyrmuo" CACHE PATH "") + +set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-t7qtfe3uihx4s2ia5gft2rvwmbfsaqcz" CACHE PATH "") + +set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-yg22aoerdpabedvtormddcankg4lkitu" CACHE PATH "") + +set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-lcyevsv6yv4cwtahb3kt5h4emqtfwwvb" CACHE PATH "") + +set(LIBYOGRT_DIR "${TPL_ROOT}/libyogrt-1.33-z45arsyuiqgmqeo3vnzdiosnbyksfypl" CACHE PATH "") #------------------------------------------------------------------------------ # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_05_18_11_52_05/._view/btoxy5ovdbouub2brzxcmjwzdhvzatlc" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-6j5dc4xbppedseqpxhmnvdsvfm5nohqz/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/quartz-toss_4_x86_64_ib-gcc@10.3.1.cmake b/host-configs/quartz-toss_4_x86_64_ib-gcc@10.3.1.cmake index 39e54b5ea6..a228744ea6 100644 --- a/host-configs/quartz-toss_4_x86_64_ib-gcc@10.3.1.cmake +++ b/host-configs/quartz-toss_4_x86_64_ib-gcc@10.3.1.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/umpire-2023.06.0-yvwkknlopetovjrbxfs3qjhifjsf4xmh;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/raja-2023.06.0-sq37cauj2vgwwkl66vngtztqu34pemzs;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/camp-2023.06.0-gjcfvl7y56sgldblilf4pktgdlnhflzp;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/mfem-4.5.2-uyempb4k6nefxh36lxnbfb2dynpyaezr;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/hypre-2.24.0-lof7hdy7wsyuei436d6uhilprsgmr3ik;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/conduit-0.8.8-wngwwhpllk2gjewlizsk4plakvdu4beu;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/parmetis-4.0.3-lq6aryhur6qn3trc2qxizvz4nae5ngzf;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/metis-5.1.0-pyrzcrzqvl6q27kk637o2nwi3j7ibseb;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/hdf5-1.8.22-wikz2sxdo4zf76fdfl5do4mekkixf4yv;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/c2c-1.8.0-bsohtsh5a73tmmxlndgjuhzz6lzoif5j;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/gmake-4.4.1-y2kaxrqjbg3dcwo7dzfphztusfjqoowq;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1/blt-0.5.3-iljv7wrfi4r5i4drs4yf65rgsuunaxjn;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-10.3.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/umpire-2024.02.0-2edi7papg24dx6cmzuu4cvli6gn5ula4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/fmt-10.2.1-vsppemwn4lv42jffltnu2m5wk7pa4mh4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/scr-3.0.1-nimozblni7qmgxh7m4lpclv4ducbwmd7;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/spath-0.2.0-vy4oatc22e4yhneh564uexojguzk64hl;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/libyogrt-1.33-5ylxltz7yzkytfwjqsdy7alvfpvblpfa;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/er-0.2.0-ssi5sg74fzuszg64bx4w36k74aylefbs;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/shuffile-0.2.0-2dqga6mipogmwwnegz6ruroxjjpuydns;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/redset-0.2.0-26dcmicvi4gl3n7bezyvvt6tzxgfhyt4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/rankstr-0.1.0-rtae4hecutfnw3p2c3pw2r23wel57wxe;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/dtcmp-1.1.4-fhlas27vbqequpdrt7hs4z5y7fu6fcux;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/lwgrp-1.0.5-xy2pfakxxt737yqixkijiopg5aqe6qy4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/axl-0.7.1-it2ovw5easrshsv2ii3y7ui7sykejtl3;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/kvtree-1.3.0-ox6ll5w2vlux2gncxlxp6f7sduc5we3k;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/raja-2024.02.0-lgda75dl72dsc3fpkaboonrastlb533i;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/camp-2024.02.0-54ph6bxcskqc6vyj2yumw2c453rdw3ms;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/py-jsonschema-2.6.0-lxk3nz6n2wxarwsyghge5l6jio4pze63;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/mfem-4.6.0-72vdexr6wsfxessfqnjamz4yw7bbimzv;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/hypre-2.24.0-fqukfipx623hwcdtl44ul6m7gf436bea;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/gmake-4.4.1-hnowwppvujezizfysc64xc2myqqulzcn;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/conduit-0.9.1-2gxyktbxfdki7l62knbd2gcv2po5mnnz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/parmetis-4.0.3-olkucdyohy6nglxyp6yqvflfxhhtjji4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/metis-5.1.0-au7rbsfu6yv7cazug6635jzvb2gwy7st;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/hdf5-1.8.23-qdwxt3e3mv7bjt3xqcybad7beymgxcsn;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/zlib-ng-2.1.5-shzp76r665h2g3lnqspfmluapd7jxtrt;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/c2c-1.8.0-fahftlekwziw2ls4bezzaviuke4kvqyz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/blt-0.6.1.4-ee4ftwhz24yhie53n4ximxniibs3wair;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/gcc-runtime-10.3.1-yxmwjg76ccmk3rbqtfni7b56ykrldyrb;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-10.3.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/axom-develop-xiuioy7dxvykmlob3vudqstogdvorl4v/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/axom-develop-xiuioy7dxvykmlob3vudqstogdvorl4v/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/c2c-1.8.0-fahftlekwziw2ls4bezzaviuke4kvqyz/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/gcc-runtime-10.3.1-yxmwjg76ccmk3rbqtfni7b56ykrldyrb/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/conduit-0.9.1-2gxyktbxfdki7l62knbd2gcv2po5mnnz/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/hdf5-1.8.23-qdwxt3e3mv7bjt3xqcybad7beymgxcsn/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/zlib-ng-2.1.5-shzp76r665h2g3lnqspfmluapd7jxtrt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/metis-5.1.0-au7rbsfu6yv7cazug6635jzvb2gwy7st/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/parmetis-4.0.3-olkucdyohy6nglxyp6yqvflfxhhtjji4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/mfem-4.6.0-72vdexr6wsfxessfqnjamz4yw7bbimzv/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/hypre-2.24.0-fqukfipx623hwcdtl44ul6m7gf436bea/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/py-jsonschema-2.6.0-lxk3nz6n2wxarwsyghge5l6jio4pze63/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/raja-2024.02.0-lgda75dl72dsc3fpkaboonrastlb533i/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/camp-2024.02.0-54ph6bxcskqc6vyj2yumw2c453rdw3ms/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/dtcmp-1.1.4-fhlas27vbqequpdrt7hs4z5y7fu6fcux/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/lwgrp-1.0.5-xy2pfakxxt737yqixkijiopg5aqe6qy4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/libyogrt-1.33-5ylxltz7yzkytfwjqsdy7alvfpvblpfa/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/scr-3.0.1-nimozblni7qmgxh7m4lpclv4ducbwmd7/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/axl-0.7.1-it2ovw5easrshsv2ii3y7ui7sykejtl3/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/kvtree-1.3.0-ox6ll5w2vlux2gncxlxp6f7sduc5we3k/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/er-0.2.0-ssi5sg74fzuszg64bx4w36k74aylefbs/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/rankstr-0.1.0-rtae4hecutfnw3p2c3pw2r23wel57wxe/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/redset-0.2.0-26dcmicvi4gl3n7bezyvvt6tzxgfhyt4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/shuffile-0.2.0-2dqga6mipogmwwnegz6ruroxjjpuydns/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/spath-0.2.0-vy4oatc22e4yhneh564uexojguzk64hl/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/umpire-2024.02.0-2edi7papg24dx6cmzuu4cvli6gn5ula4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/fmt-10.2.1-vsppemwn4lv42jffltnu2m5wk7pa4mh4/lib64;/collab/usr/global/tools/tce4/packages/gcc/gcc-10.3.1/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/axom-develop-xiuioy7dxvykmlob3vudqstogdvorl4v/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/axom-develop-xiuioy7dxvykmlob3vudqstogdvorl4v/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/c2c-1.8.0-fahftlekwziw2ls4bezzaviuke4kvqyz/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/gcc-runtime-10.3.1-yxmwjg76ccmk3rbqtfni7b56ykrldyrb/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/conduit-0.9.1-2gxyktbxfdki7l62knbd2gcv2po5mnnz/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/hdf5-1.8.23-qdwxt3e3mv7bjt3xqcybad7beymgxcsn/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/zlib-ng-2.1.5-shzp76r665h2g3lnqspfmluapd7jxtrt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/metis-5.1.0-au7rbsfu6yv7cazug6635jzvb2gwy7st/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/parmetis-4.0.3-olkucdyohy6nglxyp6yqvflfxhhtjji4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/mfem-4.6.0-72vdexr6wsfxessfqnjamz4yw7bbimzv/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/hypre-2.24.0-fqukfipx623hwcdtl44ul6m7gf436bea/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/py-jsonschema-2.6.0-lxk3nz6n2wxarwsyghge5l6jio4pze63/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/raja-2024.02.0-lgda75dl72dsc3fpkaboonrastlb533i/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/camp-2024.02.0-54ph6bxcskqc6vyj2yumw2c453rdw3ms/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/dtcmp-1.1.4-fhlas27vbqequpdrt7hs4z5y7fu6fcux/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/lwgrp-1.0.5-xy2pfakxxt737yqixkijiopg5aqe6qy4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/libyogrt-1.33-5ylxltz7yzkytfwjqsdy7alvfpvblpfa/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/scr-3.0.1-nimozblni7qmgxh7m4lpclv4ducbwmd7/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/axl-0.7.1-it2ovw5easrshsv2ii3y7ui7sykejtl3/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/kvtree-1.3.0-ox6ll5w2vlux2gncxlxp6f7sduc5we3k/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/er-0.2.0-ssi5sg74fzuszg64bx4w36k74aylefbs/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/rankstr-0.1.0-rtae4hecutfnw3p2c3pw2r23wel57wxe/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/redset-0.2.0-26dcmicvi4gl3n7bezyvvt6tzxgfhyt4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/shuffile-0.2.0-2dqga6mipogmwwnegz6ruroxjjpuydns/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/spath-0.2.0-vy4oatc22e4yhneh564uexojguzk64hl/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/umpire-2024.02.0-2edi7papg24dx6cmzuu4cvli6gn5ula4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1/fmt-10.2.1-vsppemwn4lv42jffltnu2m5wk7pa4mh4/lib64;/collab/usr/global/tools/tce4/packages/gcc/gcc-10.3.1/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -31,8 +37,6 @@ else() endif() -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -67,44 +71,66 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_27_04_50_44/gcc-10.3.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/gcc-10.3.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-wngwwhpllk2gjewlizsk4plakvdu4beu" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-2gxyktbxfdki7l62knbd2gcv2po5mnnz" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-bsohtsh5a73tmmxlndgjuhzz6lzoif5j" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-fahftlekwziw2ls4bezzaviuke4kvqyz" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-uyempb4k6nefxh36lxnbfb2dynpyaezr" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-72vdexr6wsfxessfqnjamz4yw7bbimzv" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-wikz2sxdo4zf76fdfl5do4mekkixf4yv" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-qdwxt3e3mv7bjt3xqcybad7beymgxcsn" CACHE PATH "") set(LUA_DIR "/usr" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-sq37cauj2vgwwkl66vngtztqu34pemzs" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-lgda75dl72dsc3fpkaboonrastlb533i" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-2edi7papg24dx6cmzuu4cvli6gn5ula4" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-54ph6bxcskqc6vyj2yumw2c453rdw3ms" CACHE PATH "") + +set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-nimozblni7qmgxh7m4lpclv4ducbwmd7" CACHE PATH "") + +set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-ox6ll5w2vlux2gncxlxp6f7sduc5we3k" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-yvwkknlopetovjrbxfs3qjhifjsf4xmh" CACHE PATH "") +set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-fhlas27vbqequpdrt7hs4z5y7fu6fcux" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-gjcfvl7y56sgldblilf4pktgdlnhflzp" CACHE PATH "") +set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-vy4oatc22e4yhneh564uexojguzk64hl" CACHE PATH "") -# scr not built +set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-it2ovw5easrshsv2ii3y7ui7sykejtl3" CACHE PATH "") + +set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-xy2pfakxxt737yqixkijiopg5aqe6qy4" CACHE PATH "") + +set(ER_DIR "${TPL_ROOT}/er-0.2.0-ssi5sg74fzuszg64bx4w36k74aylefbs" CACHE PATH "") + +set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-rtae4hecutfnw3p2c3pw2r23wel57wxe" CACHE PATH "") + +set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-26dcmicvi4gl3n7bezyvvt6tzxgfhyt4" CACHE PATH "") + +set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-2dqga6mipogmwwnegz6ruroxjjpuydns" CACHE PATH "") + +set(LIBYOGRT_DIR "${TPL_ROOT}/libyogrt-1.33-5ylxltz7yzkytfwjqsdy7alvfpvblpfa" CACHE PATH "") #------------------------------------------------------------------------------ # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_05_18_11_52_05/._view/btoxy5ovdbouub2brzxcmjwzdhvzatlc" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-lxk3nz6n2wxarwsyghge5l6jio4pze63/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/quartz-toss_4_x86_64_ib-intel@2022.1.0.cmake b/host-configs/quartz-toss_4_x86_64_ib-intel@2022.1.0.cmake new file mode 100644 index 0000000000..653b0e59b0 --- /dev/null +++ b/host-configs/quartz-toss_4_x86_64_ib-intel@2022.1.0.cmake @@ -0,0 +1,116 @@ +#------------------------------------------------------------------------------ +# !!!! This is a generated file, edit at own risk !!!! +#------------------------------------------------------------------------------ +# CMake executable path: /usr/tce/bin/cmake +#------------------------------------------------------------------------------ + +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/umpire-2024.02.0-4nxnup6vxwkwkinxdzzinkxul6vk2lsj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/raja-2024.02.0-v5ckygwjzmo7e2rts5qxwgfswhhpeqta;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/py-jsonschema-2.6.0-scktpdojmezaljg2bxfbzmf5lx3nmwvc;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/mfem-4.6.0-hma2wvr5tv3fkry6kdqfxmtsnqg6fv4d;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/hypre-2.24.0-czbxd2tmdjbl7v4nwommsh7xgw7ewgla;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/conduit-0.9.1-t745zbwmn5ffzo7whgwxmz5p5w2ym37z;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/parmetis-4.0.3-hattuaxqypmcfeqr3nvedmojwbgiora2;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/hdf5-1.8.23-2l37bduu2kjsgmhjxbfdgchsha2di2of;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/blt-0.6.1.4-3p2ecutmo7drpwwvvsgtcqxakxjoy573;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/fmt-10.2.1-jltnp6nb3minlrrafmdenoakubdzom57;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/camp-2024.02.0-xyur27wnppnansskdldrlqyzormhcr4e;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/zlib-ng-2.1.5-jtmqc4b5fqadcqbwagtun6kwe6geexbw;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/metis-5.1.0-hk6ipui6fnixwdyloqmqbsixqhtv5hxw;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/gmake-4.4.1-giduhrefimvdwblsuh6cmqipc474toi5;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/c2c-1.8.0-ovky3pniupirnys6mtf24ke5sb64mkbr;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/axom-develop-ma6pw2s3obh5afi3kvbgksqemjcs3ty7/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/axom-develop-ma6pw2s3obh5afi3kvbgksqemjcs3ty7/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/c2c-1.8.0-ovky3pniupirnys6mtf24ke5sb64mkbr/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/conduit-0.9.1-t745zbwmn5ffzo7whgwxmz5p5w2ym37z/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/hdf5-1.8.23-2l37bduu2kjsgmhjxbfdgchsha2di2of/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/zlib-ng-2.1.5-jtmqc4b5fqadcqbwagtun6kwe6geexbw/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/metis-5.1.0-hk6ipui6fnixwdyloqmqbsixqhtv5hxw/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/parmetis-4.0.3-hattuaxqypmcfeqr3nvedmojwbgiora2/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/mfem-4.6.0-hma2wvr5tv3fkry6kdqfxmtsnqg6fv4d/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/hypre-2.24.0-czbxd2tmdjbl7v4nwommsh7xgw7ewgla/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/py-jsonschema-2.6.0-scktpdojmezaljg2bxfbzmf5lx3nmwvc/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/raja-2024.02.0-v5ckygwjzmo7e2rts5qxwgfswhhpeqta/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/camp-2024.02.0-xyur27wnppnansskdldrlqyzormhcr4e/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/umpire-2024.02.0-4nxnup6vxwkwkinxdzzinkxul6vk2lsj/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/fmt-10.2.1-jltnp6nb3minlrrafmdenoakubdzom57/lib64;/usr/tce/backend/installations/linux-rhel8-x86_64/gcc-10.3.1/intel-oneapi-compilers-2022.1.0-43xp3r52jx2q2rkf3ctzvskqu572xbky/compiler/2022.1.0/linux/compiler/lib/intel64_lin;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/axom-develop-ma6pw2s3obh5afi3kvbgksqemjcs3ty7/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/axom-develop-ma6pw2s3obh5afi3kvbgksqemjcs3ty7/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/c2c-1.8.0-ovky3pniupirnys6mtf24ke5sb64mkbr/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/conduit-0.9.1-t745zbwmn5ffzo7whgwxmz5p5w2ym37z/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/hdf5-1.8.23-2l37bduu2kjsgmhjxbfdgchsha2di2of/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/zlib-ng-2.1.5-jtmqc4b5fqadcqbwagtun6kwe6geexbw/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/metis-5.1.0-hk6ipui6fnixwdyloqmqbsixqhtv5hxw/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/parmetis-4.0.3-hattuaxqypmcfeqr3nvedmojwbgiora2/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/mfem-4.6.0-hma2wvr5tv3fkry6kdqfxmtsnqg6fv4d/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/hypre-2.24.0-czbxd2tmdjbl7v4nwommsh7xgw7ewgla/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/py-jsonschema-2.6.0-scktpdojmezaljg2bxfbzmf5lx3nmwvc/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/raja-2024.02.0-v5ckygwjzmo7e2rts5qxwgfswhhpeqta/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/camp-2024.02.0-xyur27wnppnansskdldrlqyzormhcr4e/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/umpire-2024.02.0-4nxnup6vxwkwkinxdzzinkxul6vk2lsj/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0/fmt-10.2.1-jltnp6nb3minlrrafmdenoakubdzom57/lib64;/usr/tce/backend/installations/linux-rhel8-x86_64/gcc-10.3.1/intel-oneapi-compilers-2022.1.0-43xp3r52jx2q2rkf3ctzvskqu572xbky/compiler/2022.1.0/linux/compiler/lib/intel64_lin;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") + +#------------------------------------------------------------------------------ +# Compilers +#------------------------------------------------------------------------------ +# Compiler Spec: intel@=2022.1.0 +#------------------------------------------------------------------------------ +if(DEFINED ENV{SPACK_CC}) + + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/intel/icc" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/intel/icpc" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/spack/lib/spack/env/intel/ifort" CACHE PATH "") + +else() + + set(CMAKE_C_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/icx" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/icpx" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/ifx" CACHE PATH "") + +endif() + +set(ENABLE_FORTRAN ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# MPI +#------------------------------------------------------------------------------ + +set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpicc" CACHE PATH "") + +set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpicxx" CACHE PATH "") + +set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpif90" CACHE PATH "") + +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") + +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Hardware +#------------------------------------------------------------------------------ + +#------------------------------------------------ +# Hardware Specifics +#------------------------------------------------ + +set(ENABLE_OPENMP ON CACHE BOOL "") + +set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# TPLs +#------------------------------------------------------------------------------ + +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_06_16_55_14/intel-2022.1.0" CACHE PATH "") + +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-t745zbwmn5ffzo7whgwxmz5p5w2ym37z" CACHE PATH "") + +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-ovky3pniupirnys6mtf24ke5sb64mkbr" CACHE PATH "") + +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-hma2wvr5tv3fkry6kdqfxmtsnqg6fv4d" CACHE PATH "") + +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-2l37bduu2kjsgmhjxbfdgchsha2di2of" CACHE PATH "") + +set(LUA_DIR "/usr" CACHE PATH "") + +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-v5ckygwjzmo7e2rts5qxwgfswhhpeqta" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-4nxnup6vxwkwkinxdzzinkxul6vk2lsj" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-xyur27wnppnansskdldrlqyzormhcr4e" CACHE PATH "") + +# scr not built + +#------------------------------------------------------------------------------ +# Devtools +#------------------------------------------------------------------------------ + +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") + +set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") + +set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/python3.10" CACHE PATH "") + +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-scktpdojmezaljg2bxfbzmf5lx3nmwvc/bin/jsonschema" CACHE PATH "") + +set(ENABLE_DOCS ON CACHE BOOL "") + +set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") + +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") + +set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") + +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") + + diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@10.0.1.1.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@10.0.1.1.cmake index 4ba0042877..1186b7b47d 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@10.0.1.1.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@10.0.1.1.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/umpire-2023.06.0-x4j2bn55oz5hlsbgawepoej3kc3s3ama;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/raja-2023.06.0-r2xeiifolea4xkrfluvkeehaynhvaipr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/camp-2023.06.0-55emwjpfri4sr52rqvnfb5fiqitgkyml;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/mfem-4.5.2-dbebdqverfh4lwgj5nal5d2vgmmvl4xb;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/hypre-2.24.0-vrxf2vyvdlmylt5u2cu3vy4dqdc76yvq;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/lua-5.4.4-o6kjgr3nt6ssvrj3mmonawxj3sbbcnel;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/conduit-0.8.8-yguteoqfyvdqs5qgcsxlvykqbn3jy6fl;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/parmetis-4.0.3-aivfy5rovu5bwsiryry63apan5cdtc4m;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/metis-5.1.0-k7t53hncr4qxzqoyzhekte5rqrorclyh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/hdf5-1.8.22-ydeu5u4foixvz5oczqac5otuky4jq7en;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/zlib-1.2.13-aple3eiihvtvpurrdvosba4qab7rgdnr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/c2c-1.8.0-alkiietbi3stbihkzci37tecdzdyxpwh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1/blt-0.5.3-e5rbowq4pvwwuchttguahzyjcpa5zvgr;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/umpire-2024.02.0-3fzuqd3tqb3kh2lai5yqmgom24mlcior;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/raja-2024.02.0-btiwe3jepovgjlxdtuqm4xssselzimcx;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/py-jsonschema-2.6.0-szvkvnsgmp3mys5qwxkzidfljbrx2lc4;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/mfem-4.6.0-izljwvlcbrcbcueewxc74qbs7l3vy3rk;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/hypre-2.24.0-euib2ua4oleljrkszmkexls4kw5cvrr7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/lua-5.4.4-aovjhut3d6o67vxccjkyhfbrxc2eg4de;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/conduit-0.9.1-dfi65iel4lwlrvhi2i7n2hbvxuzlf3fv;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/parmetis-4.0.3-djitip36l7hy2ubwbvrnqmfeodhnjtpk;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/hdf5-1.8.23-ifirj3a475sf7jrliip2tj7laqyidak6;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/blt-0.6.1.4-7qqqx4bcdk5wy7ycpymq6engsddxn4y2;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/fmt-10.2.1-sscbhyiiak2butrj6656mn7nfx37rpr6;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/camp-2024.02.0-zxgjohy7qy2v3nqg4eaba3azthsqhcga;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/metis-5.1.0-e5ov7trmcxxc4pa6cbysd525iyiswtkn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/c2c-1.8.0-vlmxcctikvg2swezpvdqweczpsueuyrl;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/axom-develop-wpre5jwym4gwxknegvw5mdlqmnqxgv3b/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/axom-develop-wpre5jwym4gwxknegvw5mdlqmnqxgv3b/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/c2c-1.8.0-vlmxcctikvg2swezpvdqweczpsueuyrl/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/conduit-0.9.1-dfi65iel4lwlrvhi2i7n2hbvxuzlf3fv/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/hdf5-1.8.23-ifirj3a475sf7jrliip2tj7laqyidak6/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/metis-5.1.0-e5ov7trmcxxc4pa6cbysd525iyiswtkn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/parmetis-4.0.3-djitip36l7hy2ubwbvrnqmfeodhnjtpk/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/lua-5.4.4-aovjhut3d6o67vxccjkyhfbrxc2eg4de/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/mfem-4.6.0-izljwvlcbrcbcueewxc74qbs7l3vy3rk/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/hypre-2.24.0-euib2ua4oleljrkszmkexls4kw5cvrr7/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/py-jsonschema-2.6.0-szvkvnsgmp3mys5qwxkzidfljbrx2lc4/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/raja-2024.02.0-btiwe3jepovgjlxdtuqm4xssselzimcx/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/camp-2024.02.0-zxgjohy7qy2v3nqg4eaba3azthsqhcga/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/umpire-2024.02.0-3fzuqd3tqb3kh2lai5yqmgom24mlcior/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/fmt-10.2.1-sscbhyiiak2butrj6656mn7nfx37rpr6/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8;/usr/tce/packages/clang/clang-ibm-10.0.1/release/lib;/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/release/lib" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/axom-develop-wpre5jwym4gwxknegvw5mdlqmnqxgv3b/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/axom-develop-wpre5jwym4gwxknegvw5mdlqmnqxgv3b/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/c2c-1.8.0-vlmxcctikvg2swezpvdqweczpsueuyrl/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/conduit-0.9.1-dfi65iel4lwlrvhi2i7n2hbvxuzlf3fv/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/hdf5-1.8.23-ifirj3a475sf7jrliip2tj7laqyidak6/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/metis-5.1.0-e5ov7trmcxxc4pa6cbysd525iyiswtkn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/parmetis-4.0.3-djitip36l7hy2ubwbvrnqmfeodhnjtpk/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/lua-5.4.4-aovjhut3d6o67vxccjkyhfbrxc2eg4de/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/mfem-4.6.0-izljwvlcbrcbcueewxc74qbs7l3vy3rk/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/hypre-2.24.0-euib2ua4oleljrkszmkexls4kw5cvrr7/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/py-jsonschema-2.6.0-szvkvnsgmp3mys5qwxkzidfljbrx2lc4/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/raja-2024.02.0-btiwe3jepovgjlxdtuqm4xssselzimcx/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/camp-2024.02.0-zxgjohy7qy2v3nqg4eaba3azthsqhcga/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/umpire-2024.02.0-3fzuqd3tqb3kh2lai5yqmgom24mlcior/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1/fmt-10.2.1-sscbhyiiak2butrj6656mn7nfx37rpr6/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8;/usr/tce/packages/clang/clang-ibm-10.0.1/release/lib;/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/release/lib" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -37,8 +43,6 @@ set(CMAKE_CXX_STANDARD_LIBRARIES "-lgfortran" CACHE STRING "") set(CMAKE_Fortran_STANDARD_LIBRARIES "-lgfortran" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/lib" CACHE STRING "Adds a missing libstdc++ rpath") @@ -69,7 +73,7 @@ set(BLT_MPI_COMMAND_APPEND "mpibind" CACHE STRING "") # Hardware Specifics #------------------------------------------------ -set(ENABLE_OPENMP OFF CACHE BOOL "") +set(ENABLE_OPENMP ON CACHE BOOL "") set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") @@ -79,23 +83,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-yguteoqfyvdqs5qgcsxlvykqbn3jy6fl" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-dfi65iel4lwlrvhi2i7n2hbvxuzlf3fv" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-alkiietbi3stbihkzci37tecdzdyxpwh" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-vlmxcctikvg2swezpvdqweczpsueuyrl" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-dbebdqverfh4lwgj5nal5d2vgmmvl4xb" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-izljwvlcbrcbcueewxc74qbs7l3vy3rk" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-ydeu5u4foixvz5oczqac5otuky4jq7en" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-ifirj3a475sf7jrliip2tj7laqyidak6" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-o6kjgr3nt6ssvrj3mmonawxj3sbbcnel" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-aovjhut3d6o67vxccjkyhfbrxc2eg4de" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-r2xeiifolea4xkrfluvkeehaynhvaipr" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-btiwe3jepovgjlxdtuqm4xssselzimcx" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-x4j2bn55oz5hlsbgawepoej3kc3s3ama" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-3fzuqd3tqb3kh2lai5yqmgom24mlcior" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-55emwjpfri4sr52rqvnfb5fiqitgkyml" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-zxgjohy7qy2v3nqg4eaba3azthsqhcga" CACHE PATH "") # scr not built @@ -103,20 +107,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-55emwjpfri4sr52rqvnfb5fiqitgkyml" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-szvkvnsgmp3mys5qwxkzidfljbrx2lc4/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@10.0.1.2_cuda.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@10.0.1.2_cuda.cmake index 1bb2d87f8e..62f8d9ee4e 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@10.0.1.2_cuda.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@10.0.1.2_cuda.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/umpire-2023.06.0-pfofk6xf3eat7ptoitibuzmnycnwrlfb;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/raja-2023.06.0-26jb32x7kl6lvfhvwvzv6seoiyjd2fe4;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/camp-2023.06.0-mbobtec63kl2etao43ylvvln3ivokfzn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/cub-2.1.0-p5pq3qyp3tthknvf4evygd4yaoay32tu;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/mfem-4.5.2-5aoi62ejerozb42y5awjlgucluokakho;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/hypre-2.24.0-cfxkqrgvzhhkau6afaoohfe3zvmxhr7l;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/lua-5.4.4-27btgrl45gsrfpectq4nqwg3uep2lbcn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/conduit-0.8.8-k25pxkfamv77gz7cplvupfseutwule7o;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/parmetis-4.0.3-ae4f6v6uuhhbv776uy73zl4zqoralhbc;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/metis-5.1.0-ttpdauwjjvuesdbpa2pzh2inam3xgg7u;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/hdf5-1.8.22-ix4txea5c6dbzixdj3ef6dstpnlt6xvb;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/zlib-1.2.13-ywvuuomigfzzbq4fxcgkdrnvnnwkj7zt;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/c2c-1.8.0-icsf7aewc7ocohld45ibjxvygujkq3zd;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2/blt-0.5.3-pytnag7yitffjizxs6mtsgj6amwvpd4v;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/usr/tce/packages/cuda/cuda-11.2.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/umpire-2024.02.0-gdid6sheotanplgeox4xo25w6gqqsztl;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/raja-2024.02.0-o7rjribikrvq6wydxxz22wdo544ai4z2;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/camp-2024.02.0-2jxkuw2qyj7egsho3lshh2ceoa6n3srm;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/py-jsonschema-2.6.0-jzezi7fphud2hpmaepsb5s456tz2dqol;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/mfem-4.6.0-63jbjowv2dojriwkpag6ws3tbm4erk7v;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/hypre-2.24.0-olonyxmliyqz7gjwd5jkenyxuphjff2d;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/lua-5.4.4-5okbr3yhq4vyonc2yt22lich6jkdgp3i;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/conduit-0.9.1-mypcbb7eqvp4oqjftdvw53oql5f5wemd;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/parmetis-4.0.3-gxoxo6iesczbj7ltl3he3vxlv2xb6bdo;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/hdf5-1.8.23-5n6b7og6vcevg2pkbjjrhf54ta4fhl2i;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/blt-0.6.1.4-niyj5uvj7qaxuceaoycpenida5z56ied;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/fmt-10.2.1-rvh2rhnae6757hi6saunbnnicoowhtns;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/cub-2.1.0-ib4hkd2iic3p7ni4lhz5bqd5yivtxo7r;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/metis-5.1.0-5t5rx3oakpli3ywkum4kfhzdiacrdkso;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/c2c-1.8.0-ouuns7euqd3fbobccnfh2zcfgxo2nsss;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/cuda/cuda-11.2.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/axom-develop-ndiry4fjmug7ogvh36noblti67rdegj2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/axom-develop-ndiry4fjmug7ogvh36noblti67rdegj2/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/c2c-1.8.0-ouuns7euqd3fbobccnfh2zcfgxo2nsss/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/conduit-0.9.1-mypcbb7eqvp4oqjftdvw53oql5f5wemd/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/hdf5-1.8.23-5n6b7og6vcevg2pkbjjrhf54ta4fhl2i/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/metis-5.1.0-5t5rx3oakpli3ywkum4kfhzdiacrdkso/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/parmetis-4.0.3-gxoxo6iesczbj7ltl3he3vxlv2xb6bdo/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/lua-5.4.4-5okbr3yhq4vyonc2yt22lich6jkdgp3i/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/mfem-4.6.0-63jbjowv2dojriwkpag6ws3tbm4erk7v/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/hypre-2.24.0-olonyxmliyqz7gjwd5jkenyxuphjff2d/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/py-jsonschema-2.6.0-jzezi7fphud2hpmaepsb5s456tz2dqol/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/raja-2024.02.0-o7rjribikrvq6wydxxz22wdo544ai4z2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/camp-2024.02.0-2jxkuw2qyj7egsho3lshh2ceoa6n3srm/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/umpire-2024.02.0-gdid6sheotanplgeox4xo25w6gqqsztl/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/fmt-10.2.1-rvh2rhnae6757hi6saunbnnicoowhtns/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8;/usr/tce/packages/clang/clang-ibm-10.0.1/release/lib;/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/release/lib" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/axom-develop-ndiry4fjmug7ogvh36noblti67rdegj2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/axom-develop-ndiry4fjmug7ogvh36noblti67rdegj2/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/c2c-1.8.0-ouuns7euqd3fbobccnfh2zcfgxo2nsss/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/conduit-0.9.1-mypcbb7eqvp4oqjftdvw53oql5f5wemd/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/hdf5-1.8.23-5n6b7og6vcevg2pkbjjrhf54ta4fhl2i/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/metis-5.1.0-5t5rx3oakpli3ywkum4kfhzdiacrdkso/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/parmetis-4.0.3-gxoxo6iesczbj7ltl3he3vxlv2xb6bdo/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/lua-5.4.4-5okbr3yhq4vyonc2yt22lich6jkdgp3i/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/mfem-4.6.0-63jbjowv2dojriwkpag6ws3tbm4erk7v/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/hypre-2.24.0-olonyxmliyqz7gjwd5jkenyxuphjff2d/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-gcc-7.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/py-jsonschema-2.6.0-jzezi7fphud2hpmaepsb5s456tz2dqol/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/raja-2024.02.0-o7rjribikrvq6wydxxz22wdo544ai4z2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/camp-2024.02.0-2jxkuw2qyj7egsho3lshh2ceoa6n3srm/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/umpire-2024.02.0-gdid6sheotanplgeox4xo25w6gqqsztl/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2/fmt-10.2.1-rvh2rhnae6757hi6saunbnnicoowhtns/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8;/usr/tce/packages/clang/clang-ibm-10.0.1/release/lib;/usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/release/lib" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -37,8 +43,6 @@ set(CMAKE_CXX_STANDARD_LIBRARIES "-lgfortran" CACHE STRING "") set(CMAKE_Fortran_STANDARD_LIBRARIES "-lgfortran" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") set(BLT_EXE_LINKER_FLAGS " -Xlinker -rpath -Xlinker /usr/tce/packages/clang/clang-ibm-10.0.1-gcc-8.3.1/lib" CACHE STRING "Adds a missing libstdc++ rpath") @@ -97,7 +101,7 @@ set(gtest_disable_pthreads ON CACHE BOOL "") # Hardware Specifics #------------------------------------------------ -set(ENABLE_OPENMP OFF CACHE BOOL "") +set(ENABLE_OPENMP ON CACHE BOOL "") set(ENABLE_GTEST_DEATH_TESTS OFF CACHE BOOL "") @@ -107,23 +111,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/clang-10.0.1.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/clang-10.0.1.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-k25pxkfamv77gz7cplvupfseutwule7o" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-mypcbb7eqvp4oqjftdvw53oql5f5wemd" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-icsf7aewc7ocohld45ibjxvygujkq3zd" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-ouuns7euqd3fbobccnfh2zcfgxo2nsss" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-5aoi62ejerozb42y5awjlgucluokakho" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-63jbjowv2dojriwkpag6ws3tbm4erk7v" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-ix4txea5c6dbzixdj3ef6dstpnlt6xvb" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-5n6b7og6vcevg2pkbjjrhf54ta4fhl2i" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-27btgrl45gsrfpectq4nqwg3uep2lbcn" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-5okbr3yhq4vyonc2yt22lich6jkdgp3i" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-26jb32x7kl6lvfhvwvzv6seoiyjd2fe4" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-o7rjribikrvq6wydxxz22wdo544ai4z2" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-pfofk6xf3eat7ptoitibuzmnycnwrlfb" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-gdid6sheotanplgeox4xo25w6gqqsztl" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-mbobtec63kl2etao43ylvvln3ivokfzn" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-2jxkuw2qyj7egsho3lshh2ceoa6n3srm" CACHE PATH "") # scr not built @@ -131,20 +135,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-mbobtec63kl2etao43ylvvln3ivokfzn" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-jzezi7fphud2hpmaepsb5s456tz2dqol/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@8.3.1.1.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@8.3.1.1.cmake index afc2eb18c5..40c54cf48b 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@8.3.1.1.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@8.3.1.1.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/umpire-2023.06.0-bftoz5wfuvfwldjwe3szsi54hdpw2hfi;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/raja-2023.06.0-tv34emklwgpl4ddrggbpkthu6utweo2a;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/camp-2023.06.0-vuk2xmgpzxl2xb2jupm3uxqxbgrzrmbf;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/lua-5.4.4-e7cdhkbaxuyqljoyozzxrt2n57erhszx;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/conduit-0.8.8-3li2jcc2mecqbanoew5tznr4uzl2k2jg;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/parmetis-4.0.3-c2ub4mddqt7faykccls5eae7xogpi32w;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/metis-5.1.0-t6qk2khpceidsormndy6gj56qbnehxai;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/hdf5-1.8.22-nydokvym7klek6hqoyijbwf3tbmd32ux;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/zlib-1.2.13-zd2x25bmmjwxhw7siucfywjgk7oc262j;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/c2c-1.8.0-zgwmbota3vhdxcdjlwxbhomlwllwhvnc;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1/blt-0.5.3-zghdcshuqlqnbrezcylwnefie7pkvsab;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/umpire-2024.02.0-3fyzeztrclnysexhwf75pm2nxel77776;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/fmt-10.2.1-2vqr6w6s2qq7bt4iq7mdrfiqgfiw6f5l;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/raja-2024.02.0-e6tn6qcf3j2hqkz5ht3xrmlbddp3ngnn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/camp-2024.02.0-avtdwxn6q374o2nqe4rqkjzasuvmudta;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/py-jsonschema-2.6.0-me5qygs6iauo7miussleiado3nbnw5ot;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/lua-5.4.4-v5n5ab5npmyxguqaja6xdmyl6r3gsc5a;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/conduit-0.9.1-7fwf4minhh6ymveutjnb4zetvxwurm66;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/parmetis-4.0.3-p5pmp73u6nshwemscw43atzgaerk4ulu;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/metis-5.1.0-devoja547pbzdundjnarm3hug2hhay2l;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/hdf5-1.8.23-7cjtcdwjrtfgcnqoiyfrufybdw5g6i6h;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/c2c-1.8.0-vj22dsxnnfc6hx73lfgpdmlhithbd5bq;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/blt-0.6.1.4-6lng5thw5prsyymfu2yzy7xdwtwij6ij;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/gcc-runtime-8.3.1.1-pykxuo3lctv7fu6i325szadkdcwrrkim;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/axom-develop-mrrvgirrsjrtdsyltswvulji3his36xi/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/axom-develop-mrrvgirrsjrtdsyltswvulji3his36xi/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/c2c-1.8.0-vj22dsxnnfc6hx73lfgpdmlhithbd5bq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/gcc-runtime-8.3.1.1-pykxuo3lctv7fu6i325szadkdcwrrkim/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/conduit-0.9.1-7fwf4minhh6ymveutjnb4zetvxwurm66/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/hdf5-1.8.23-7cjtcdwjrtfgcnqoiyfrufybdw5g6i6h/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/metis-5.1.0-devoja547pbzdundjnarm3hug2hhay2l/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/parmetis-4.0.3-p5pmp73u6nshwemscw43atzgaerk4ulu/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/lua-5.4.4-v5n5ab5npmyxguqaja6xdmyl6r3gsc5a/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/py-jsonschema-2.6.0-me5qygs6iauo7miussleiado3nbnw5ot/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/raja-2024.02.0-e6tn6qcf3j2hqkz5ht3xrmlbddp3ngnn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/camp-2024.02.0-avtdwxn6q374o2nqe4rqkjzasuvmudta/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/umpire-2024.02.0-3fyzeztrclnysexhwf75pm2nxel77776/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/fmt-10.2.1-2vqr6w6s2qq7bt4iq7mdrfiqgfiw6f5l/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/axom-develop-mrrvgirrsjrtdsyltswvulji3his36xi/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/axom-develop-mrrvgirrsjrtdsyltswvulji3his36xi/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/c2c-1.8.0-vj22dsxnnfc6hx73lfgpdmlhithbd5bq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/gcc-runtime-8.3.1.1-pykxuo3lctv7fu6i325szadkdcwrrkim/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/conduit-0.9.1-7fwf4minhh6ymveutjnb4zetvxwurm66/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/hdf5-1.8.23-7cjtcdwjrtfgcnqoiyfrufybdw5g6i6h/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/metis-5.1.0-devoja547pbzdundjnarm3hug2hhay2l/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/parmetis-4.0.3-p5pmp73u6nshwemscw43atzgaerk4ulu/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/lua-5.4.4-v5n5ab5npmyxguqaja6xdmyl6r3gsc5a/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/py-jsonschema-2.6.0-me5qygs6iauo7miussleiado3nbnw5ot/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/raja-2024.02.0-e6tn6qcf3j2hqkz5ht3xrmlbddp3ngnn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/camp-2024.02.0-avtdwxn6q374o2nqe4rqkjzasuvmudta/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/umpire-2024.02.0-3fyzeztrclnysexhwf75pm2nxel77776/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1/fmt-10.2.1-2vqr6w6s2qq7bt4iq7mdrfiqgfiw6f5l/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -31,8 +37,6 @@ else() endif() -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -71,23 +75,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-3li2jcc2mecqbanoew5tznr4uzl2k2jg" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-7fwf4minhh6ymveutjnb4zetvxwurm66" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-zgwmbota3vhdxcdjlwxbhomlwllwhvnc" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-vj22dsxnnfc6hx73lfgpdmlhithbd5bq" CACHE PATH "") # MFEM not built -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-nydokvym7klek6hqoyijbwf3tbmd32ux" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-7cjtcdwjrtfgcnqoiyfrufybdw5g6i6h" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-e7cdhkbaxuyqljoyozzxrt2n57erhszx" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-v5n5ab5npmyxguqaja6xdmyl6r3gsc5a" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-tv34emklwgpl4ddrggbpkthu6utweo2a" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-e6tn6qcf3j2hqkz5ht3xrmlbddp3ngnn" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-bftoz5wfuvfwldjwe3szsi54hdpw2hfi" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-3fyzeztrclnysexhwf75pm2nxel77776" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-vuk2xmgpzxl2xb2jupm3uxqxbgrzrmbf" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-avtdwxn6q374o2nqe4rqkjzasuvmudta" CACHE PATH "") # scr not built @@ -95,20 +99,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-vuk2xmgpzxl2xb2jupm3uxqxbgrzrmbf" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-me5qygs6iauo7miussleiado3nbnw5ot/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@8.3.1.2_cuda.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@8.3.1.2_cuda.cmake index c086aae93b..67dab0234b 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@8.3.1.2_cuda.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@8.3.1.2_cuda.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/umpire-2023.06.0-mhaqbzgmrizieszsedhkq5j6zr56mtue;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/raja-2023.06.0-5ao6zh3anztpvifl7pi3lx6dalgabreh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/camp-2023.06.0-5yw6pcjgrzzupk3ptfneaygwjewo7sx6;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/cub-2.1.0-zpxcavwsek3eamis6c2ekyd4wpc2aff7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/lua-5.4.4-uzsm5gerahtqcinqqfwleer62mlgl6xt;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/conduit-0.8.8-pslusbff27xjqw5sct3jnddyeqlyide3;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/parmetis-4.0.3-bcniwrmmygfl3ngqqy4ogyuopuilgfy2;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/metis-5.1.0-tht2h2hqk4psrvunj7egarksgyayew3d;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/hdf5-1.8.22-h2labsbvwxgxwvphjb5i357an3dgjhqp;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/zlib-1.2.13-obyznlavcvoyytpvwwyi65s5ngcnpigv;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/c2c-1.8.0-snpbqgmnulnruetig5di7nef2gir354f;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2/blt-0.5.3-umf5hhz3yl7vspds2fejsjdbmy2npyqb;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/usr/tce/packages/cuda/cuda-11.2.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/umpire-2024.02.0-ax6j3jggtgph2kx53njdclhij5457lnr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/fmt-10.2.1-zv6ntw5mnzrvvm2mfyyjjly7cmixmgqr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/raja-2024.02.0-qz732p5cbhzuecyyn47d67h55wir7owh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/camp-2024.02.0-drrgkykr3onmqdkoc2jg6hzxzszakj35;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/cub-2.1.0-i64fir4ytcl7w527jny2bj67irxva2pu;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/py-jsonschema-2.6.0-5rwlawwpfl75pzasnxiulrkcxmznmijx;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/lua-5.4.4-saqxtlwqxhm5xszi6ohoalufvorkont7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/conduit-0.9.1-66pob6ova32wkqvnbdbskk5zk44tjbnk;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/parmetis-4.0.3-2h2xjxkc3qwi237ui476jgsqi2e4kpkh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/metis-5.1.0-3de4wffnqmwqslyiizuoheny6abmfkkn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/hdf5-1.8.23-ada6dnl7e76lppixolnsjy7gmi4adfoh;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/c2c-1.8.0-c76hxrgyy2igrclt6cnsvydrkd77ufvm;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/blt-0.6.1.4-ldmftyubptq3py7xr6wirrg2eorm357z;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/gcc-runtime-8.3.1.2-7lxa2lyos6dnjfydj2ewpv4wlnnvp2hh;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/cuda/cuda-11.2.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/axom-develop-qewlj77x5de57xeii6pfarnsgahvapao/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/axom-develop-qewlj77x5de57xeii6pfarnsgahvapao/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/c2c-1.8.0-c76hxrgyy2igrclt6cnsvydrkd77ufvm/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/gcc-runtime-8.3.1.2-7lxa2lyos6dnjfydj2ewpv4wlnnvp2hh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/conduit-0.9.1-66pob6ova32wkqvnbdbskk5zk44tjbnk/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/hdf5-1.8.23-ada6dnl7e76lppixolnsjy7gmi4adfoh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/metis-5.1.0-3de4wffnqmwqslyiizuoheny6abmfkkn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/parmetis-4.0.3-2h2xjxkc3qwi237ui476jgsqi2e4kpkh/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/lua-5.4.4-saqxtlwqxhm5xszi6ohoalufvorkont7/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/py-jsonschema-2.6.0-5rwlawwpfl75pzasnxiulrkcxmznmijx/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/raja-2024.02.0-qz732p5cbhzuecyyn47d67h55wir7owh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/camp-2024.02.0-drrgkykr3onmqdkoc2jg6hzxzszakj35/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/umpire-2024.02.0-ax6j3jggtgph2kx53njdclhij5457lnr/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/fmt-10.2.1-zv6ntw5mnzrvvm2mfyyjjly7cmixmgqr/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/axom-develop-qewlj77x5de57xeii6pfarnsgahvapao/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/axom-develop-qewlj77x5de57xeii6pfarnsgahvapao/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/c2c-1.8.0-c76hxrgyy2igrclt6cnsvydrkd77ufvm/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/gcc-runtime-8.3.1.2-7lxa2lyos6dnjfydj2ewpv4wlnnvp2hh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/conduit-0.9.1-66pob6ova32wkqvnbdbskk5zk44tjbnk/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/hdf5-1.8.23-ada6dnl7e76lppixolnsjy7gmi4adfoh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/metis-5.1.0-3de4wffnqmwqslyiizuoheny6abmfkkn/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/parmetis-4.0.3-2h2xjxkc3qwi237ui476jgsqi2e4kpkh/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/lua-5.4.4-saqxtlwqxhm5xszi6ohoalufvorkont7/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/py-jsonschema-2.6.0-5rwlawwpfl75pzasnxiulrkcxmznmijx/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/raja-2024.02.0-qz732p5cbhzuecyyn47d67h55wir7owh/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/camp-2024.02.0-drrgkykr3onmqdkoc2jg6hzxzszakj35/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/umpire-2024.02.0-ax6j3jggtgph2kx53njdclhij5457lnr/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2/fmt-10.2.1-zv6ntw5mnzrvvm2mfyyjjly7cmixmgqr/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -31,8 +37,6 @@ else() endif() -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -99,23 +103,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/gcc-8.3.1.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/gcc-8.3.1.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-pslusbff27xjqw5sct3jnddyeqlyide3" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-66pob6ova32wkqvnbdbskk5zk44tjbnk" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-snpbqgmnulnruetig5di7nef2gir354f" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-c76hxrgyy2igrclt6cnsvydrkd77ufvm" CACHE PATH "") # MFEM not built -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-h2labsbvwxgxwvphjb5i357an3dgjhqp" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-ada6dnl7e76lppixolnsjy7gmi4adfoh" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-uzsm5gerahtqcinqqfwleer62mlgl6xt" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-saqxtlwqxhm5xszi6ohoalufvorkont7" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-5ao6zh3anztpvifl7pi3lx6dalgabreh" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-qz732p5cbhzuecyyn47d67h55wir7owh" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-mhaqbzgmrizieszsedhkq5j6zr56mtue" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-ax6j3jggtgph2kx53njdclhij5457lnr" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-5yw6pcjgrzzupk3ptfneaygwjewo7sx6" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-drrgkykr3onmqdkoc2jg6hzxzszakj35" CACHE PATH "") # scr not built @@ -123,20 +127,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-5yw6pcjgrzzupk3ptfneaygwjewo7sx6" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-5rwlawwpfl75pzasnxiulrkcxmznmijx/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1.1.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1.1.cmake index 14069119a2..0d74d794e8 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1.1.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1.1.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/umpire-2023.06.0-gfmhpqkxawfjbwtufn3qeg6gkzmlahr7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/raja-2023.06.0-pkp4pk4dybnbq74652a2ayzf6zvzonsy;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/camp-2023.06.0-ilclfpsbzrbirjnwqimbnwoanvxwcvwd;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/mfem-4.5.2-5tpknd5eztbbomidbr3qcs75hyvdqegw;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/hypre-2.24.0-kgmrxqyc3pjlwgzvgbchceub5u4v4tgt;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/lua-5.4.4-22nibaxxfzwid5jk3udivaptba2xtw4r;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/conduit-0.8.8-tnyxf6f7sh7kg3pzvt5acfp4btsprsp7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/parmetis-4.0.3-zsfvlzuxwixta5mjt4dqwikslhx6l6dd;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/metis-5.1.0-hpfbnba3mgk2opmqn3efr2mmda76yacg;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/hdf5-1.8.22-eduvgrxspycy6xfw2t6i6uogdtzgnygm;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/zlib-1.2.13-tnpzx5nxltbrlx27lozjehkg2lkb7lew;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/c2c-1.8.0-vxyvicuyswybrekljpj7khd56uobpc62;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1/blt-0.5.3-zleps37vlw57krmv2zruxq6bpxpn6fik;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/umpire-2024.02.0-kglsalrxtcw2bh4hnsnc5gq5jevvv7bl;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/py-jsonschema-2.6.0-7skzmrvuuo6gtwscj6b6fbdyo7sioz5h;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/mfem-4.6.0-2qilfn4m5dmpxjm2evip6nusosmiqrsz;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/hypre-2.24.0-scxx626pb345r4bpsmn4idus6dt42jcs;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/lua-5.4.4-b43zhs5fpjqoog4hrtfrtxuetq7pwd4b;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/conduit-0.9.1-gds2atmvlsftghczkaxrbdi4fotbl2a3;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/parmetis-4.0.3-unks4pi2gc6heogvv2m3cvjvgc2etfp4;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/hdf5-1.8.23-ur6rpcf7qqngwf25ezjwei6en7rcsnxq;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/blt-0.6.1.4-neovqnvk3tazh7clai422vfazmbjeaqp;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/fmt-10.2.1-iknryrusj34wtt4nk4pn2ybgwa77grms;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/camp-2024.02.0-a2mltgoskoemplkmkkup5cs4pmfn64j7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/raja-2024.02.0-kimeva5su2xhbqpy54xx5lnmvypbavab;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/metis-5.1.0-qww4ax3mkehdlf7akdbjzokbf4wxws5m;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/c2c-1.8.0-bbzy4skytx3akdcm2fvslpxn44vhsq2y;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/axom-develop-mwe36w3aijwdbfu4ckdjv2wksrvqbsj2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/axom-develop-mwe36w3aijwdbfu4ckdjv2wksrvqbsj2/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/c2c-1.8.0-bbzy4skytx3akdcm2fvslpxn44vhsq2y/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/conduit-0.9.1-gds2atmvlsftghczkaxrbdi4fotbl2a3/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/hdf5-1.8.23-ur6rpcf7qqngwf25ezjwei6en7rcsnxq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/metis-5.1.0-qww4ax3mkehdlf7akdbjzokbf4wxws5m/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/parmetis-4.0.3-unks4pi2gc6heogvv2m3cvjvgc2etfp4/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/lua-5.4.4-b43zhs5fpjqoog4hrtfrtxuetq7pwd4b/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/mfem-4.6.0-2qilfn4m5dmpxjm2evip6nusosmiqrsz/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/hypre-2.24.0-scxx626pb345r4bpsmn4idus6dt42jcs/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/py-jsonschema-2.6.0-7skzmrvuuo6gtwscj6b6fbdyo7sioz5h/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/raja-2024.02.0-kimeva5su2xhbqpy54xx5lnmvypbavab/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/camp-2024.02.0-a2mltgoskoemplkmkkup5cs4pmfn64j7/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/umpire-2024.02.0-kglsalrxtcw2bh4hnsnc5gq5jevvv7bl/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/fmt-10.2.1-iknryrusj34wtt4nk4pn2ybgwa77grms/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/axom-develop-mwe36w3aijwdbfu4ckdjv2wksrvqbsj2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/axom-develop-mwe36w3aijwdbfu4ckdjv2wksrvqbsj2/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/c2c-1.8.0-bbzy4skytx3akdcm2fvslpxn44vhsq2y/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/conduit-0.9.1-gds2atmvlsftghczkaxrbdi4fotbl2a3/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/hdf5-1.8.23-ur6rpcf7qqngwf25ezjwei6en7rcsnxq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/metis-5.1.0-qww4ax3mkehdlf7akdbjzokbf4wxws5m/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/parmetis-4.0.3-unks4pi2gc6heogvv2m3cvjvgc2etfp4/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/lua-5.4.4-b43zhs5fpjqoog4hrtfrtxuetq7pwd4b/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/mfem-4.6.0-2qilfn4m5dmpxjm2evip6nusosmiqrsz/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/hypre-2.24.0-scxx626pb345r4bpsmn4idus6dt42jcs/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/py-jsonschema-2.6.0-7skzmrvuuo6gtwscj6b6fbdyo7sioz5h/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/raja-2024.02.0-kimeva5su2xhbqpy54xx5lnmvypbavab/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/camp-2024.02.0-a2mltgoskoemplkmkkup5cs4pmfn64j7/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/umpire-2024.02.0-kglsalrxtcw2bh4hnsnc5gq5jevvv7bl/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1/fmt-10.2.1-iknryrusj34wtt4nk4pn2ybgwa77grms/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -37,8 +43,6 @@ set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRI set(CMAKE_Fortran_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -83,23 +87,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-tnyxf6f7sh7kg3pzvt5acfp4btsprsp7" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-gds2atmvlsftghczkaxrbdi4fotbl2a3" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-vxyvicuyswybrekljpj7khd56uobpc62" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-bbzy4skytx3akdcm2fvslpxn44vhsq2y" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-5tpknd5eztbbomidbr3qcs75hyvdqegw" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-2qilfn4m5dmpxjm2evip6nusosmiqrsz" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-eduvgrxspycy6xfw2t6i6uogdtzgnygm" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-ur6rpcf7qqngwf25ezjwei6en7rcsnxq" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-22nibaxxfzwid5jk3udivaptba2xtw4r" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-b43zhs5fpjqoog4hrtfrtxuetq7pwd4b" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-pkp4pk4dybnbq74652a2ayzf6zvzonsy" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-kimeva5su2xhbqpy54xx5lnmvypbavab" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-gfmhpqkxawfjbwtufn3qeg6gkzmlahr7" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-kglsalrxtcw2bh4hnsnc5gq5jevvv7bl" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-ilclfpsbzrbirjnwqimbnwoanvxwcvwd" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-a2mltgoskoemplkmkkup5cs4pmfn64j7" CACHE PATH "") # scr not built @@ -107,20 +111,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-ilclfpsbzrbirjnwqimbnwoanvxwcvwd" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-7skzmrvuuo6gtwscj6b6fbdyo7sioz5h/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1.2_cuda.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1.2_cuda.cmake index d96438a2ce..38742862c5 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1.2_cuda.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1.2_cuda.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/umpire-2023.06.0-3rafuldohvpy7vxbdjpv3khllaqhgwp5;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/raja-2023.06.0-rzllz6mlecs2kg7dtqwqtl7wvw34ul2q;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/camp-2023.06.0-zpwybznbb32yltcpzmiplykwdlqe2afw;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/cub-2.1.0-45sgqog6spfots46rohzcokfoaxjil4p;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/mfem-4.5.2-264o4xkxhcafenixttd6lw5k466a62b3;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/hypre-2.24.0-x2zforves4hmpcuwjskxbvxu55i5kpfx;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/lua-5.4.4-6yyyruucztcz5p4w33mhydqn5kiywkjn;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/conduit-0.8.8-pil6joltz2jsp4vcdsfgndntfkqoi3na;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/parmetis-4.0.3-ogq2nkkjvarhjgaweb6b5lglfcmes3hm;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/metis-5.1.0-7ojc3lx2y6dk2g7gvl6m5n4fq5yewukb;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/hdf5-1.8.22-y23h3hgemr7s6terq2mvsz5if5u327sr;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/zlib-1.2.13-nd6r3ccnozxmd7jdwyxbgvqg5y2bn3ds;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/c2c-1.8.0-ckwviu4jwtot52xykd3kuryozuw5o35p;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2/blt-0.5.3-47zfyusaljp2e7x3lsq3iggqvapxox6t;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14;/usr/tce/packages/cuda/cuda-11.2.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19-cuda-11.2.0;/usr/tcetmp;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/umpire-2024.02.0-57lf4jwgiqrgzpeaj7uerwej3ht4wgyt;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/raja-2024.02.0-kghzomlpcrlcri3dky476kdizqatfe5c;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/camp-2024.02.0-ppwilytkx2rffmtiroong3ucsojgc2o7;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/py-jsonschema-2.6.0-qpksngigqtckjhj62aeckyiptsyrquwo;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/mfem-4.6.0-giwvzuwtccsd4dt3y6co4ul3x2lkgmpw;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/hypre-2.24.0-njvlsye4yxx7gzho7hpvfaiyugfztlef;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/lua-5.4.4-6jtix4lxlnmvpkuahs62qqbjk5yubmux;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/conduit-0.9.1-wh6qi5s3jncyggsy6w4dxdlcg3n3feag;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/parmetis-4.0.3-buyj5iliasgoeiauw335rdrvht4l46ut;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/hdf5-1.8.23-vlybikhncayldwo36udsi225qyan7dos;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/blt-0.6.1.4-lhkhl33mqna6lfzkqz5fbwzy6by5effo;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/fmt-10.2.1-fl5fgyfjfnworql33rfi4oufl2fyx2ec;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/cub-2.1.0-gk54nvuh77yqhzft2rlourfzd7aqvs6i;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/metis-5.1.0-wzyd4pwtce4c22uw3tq3dljdjpfjrd3z;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/c2c-1.8.0-jklapw7gpgw7rftjwecmk22p7wz4qpc2;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0;/usr/tce/packages/cuda/cuda-11.2.0;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19-cuda-11.2.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/graphviz-7.1.0;/usr/tcetmp;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9;/usr/tce/packages/cmake/cmake-3.21.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/axom-develop-woz7ol2eqtmsmfz3sckoddilap5hixzq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/axom-develop-woz7ol2eqtmsmfz3sckoddilap5hixzq/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/c2c-1.8.0-jklapw7gpgw7rftjwecmk22p7wz4qpc2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/conduit-0.9.1-wh6qi5s3jncyggsy6w4dxdlcg3n3feag/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/hdf5-1.8.23-vlybikhncayldwo36udsi225qyan7dos/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/metis-5.1.0-wzyd4pwtce4c22uw3tq3dljdjpfjrd3z/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/parmetis-4.0.3-buyj5iliasgoeiauw335rdrvht4l46ut/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19-cuda-11.2.0/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/lua-5.4.4-6jtix4lxlnmvpkuahs62qqbjk5yubmux/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/mfem-4.6.0-giwvzuwtccsd4dt3y6co4ul3x2lkgmpw/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/hypre-2.24.0-njvlsye4yxx7gzho7hpvfaiyugfztlef/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/py-jsonschema-2.6.0-qpksngigqtckjhj62aeckyiptsyrquwo/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/raja-2024.02.0-kghzomlpcrlcri3dky476kdizqatfe5c/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/camp-2024.02.0-ppwilytkx2rffmtiroong3ucsojgc2o7/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/umpire-2024.02.0-57lf4jwgiqrgzpeaj7uerwej3ht4wgyt/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/fmt-10.2.1-fl5fgyfjfnworql33rfi4oufl2fyx2ec/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/axom-develop-woz7ol2eqtmsmfz3sckoddilap5hixzq/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/axom-develop-woz7ol2eqtmsmfz3sckoddilap5hixzq/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/c2c-1.8.0-jklapw7gpgw7rftjwecmk22p7wz4qpc2/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/conduit-0.9.1-wh6qi5s3jncyggsy6w4dxdlcg3n3feag/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/hdf5-1.8.23-vlybikhncayldwo36udsi225qyan7dos/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/metis-5.1.0-wzyd4pwtce4c22uw3tq3dljdjpfjrd3z/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/parmetis-4.0.3-buyj5iliasgoeiauw335rdrvht4l46ut/lib;/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2022.08.19-cuda-11.2.0/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/lua-5.4.4-6jtix4lxlnmvpkuahs62qqbjk5yubmux/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/mfem-4.6.0-giwvzuwtccsd4dt3y6co4ul3x2lkgmpw/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/hypre-2.24.0-njvlsye4yxx7gzho7hpvfaiyugfztlef/lib;/usr/tcetmp/packages/lapack/lapack-3.9.0-P9-xl-2020.11.12/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/py-jsonschema-2.6.0-qpksngigqtckjhj62aeckyiptsyrquwo/lib;/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/raja-2024.02.0-kghzomlpcrlcri3dky476kdizqatfe5c/lib;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/camp-2024.02.0-ppwilytkx2rffmtiroong3ucsojgc2o7/lib;/usr/tce/packages/cuda/cuda-11.2.0/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/umpire-2024.02.0-57lf4jwgiqrgzpeaj7uerwej3ht4wgyt/lib64;/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2/fmt-10.2.1-fl5fgyfjfnworql33rfi4oufl2fyx2ec/lib64;/usr/tce/packages/gcc/gcc-8.3.1/rh/usr/lib/gcc/ppc64le-redhat-linux/8" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -37,8 +43,6 @@ set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRI set(CMAKE_Fortran_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") #------------------------------------------------------------------------------ @@ -111,23 +115,23 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2023_07_26_18_11_07/xl-16.1.1.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2024_03_07_00_02_23/xl-16.1.1.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-pil6joltz2jsp4vcdsfgndntfkqoi3na" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-wh6qi5s3jncyggsy6w4dxdlcg3n3feag" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-ckwviu4jwtot52xykd3kuryozuw5o35p" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-jklapw7gpgw7rftjwecmk22p7wz4qpc2" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-264o4xkxhcafenixttd6lw5k466a62b3" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-giwvzuwtccsd4dt3y6co4ul3x2lkgmpw" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-y23h3hgemr7s6terq2mvsz5if5u327sr" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-vlybikhncayldwo36udsi225qyan7dos" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-6yyyruucztcz5p4w33mhydqn5kiywkjn" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-6jtix4lxlnmvpkuahs62qqbjk5yubmux" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-rzllz6mlecs2kg7dtqwqtl7wvw34ul2q" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-kghzomlpcrlcri3dky476kdizqatfe5c" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-3rafuldohvpy7vxbdjpv3khllaqhgwp5" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-57lf4jwgiqrgzpeaj7uerwej3ht4wgyt" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-zpwybznbb32yltcpzmiplykwdlqe2afw" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-ppwilytkx2rffmtiroong3ucsojgc2o7" CACHE PATH "") # scr not built @@ -135,20 +139,22 @@ set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-zpwybznbb32yltcpzmiplykwdlqe2afw" CACHE # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_04_18_13_41_48/._view/srxt35kojgk77f2222mk6mgv7z5jyyzz" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/2023_10_17_10_41_04/._view/5gug4et2qymmckk7yvtub4qcapp3figm" 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.10.10/bin/python3.10" CACHE PATH "") +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-qpksngigqtckjhj62aeckyiptsyrquwo/bin/jsonschema" CACHE PATH "") + set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") 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 deleted file mode 100644 index 8dde121f5d..0000000000 --- a/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake +++ /dev/null @@ -1,136 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake -#------------------------------------------------------------------------------ - -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/umpire-2023.06.0-z2h5kuxhzuk2ngcw67dwkhsqn7sltlq6;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/scr-3.0.1-adlfle3mstudvzjj3jcl5i52xiq4awvu;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/spath-0.2.0-wqlfyvi364xtbgefjc6l3nd6go7fmpew;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/er-0.2.0-fggkkdogojtdhw4ev6qcjnnpmg4wf3ad;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/shuffile-0.2.0-5cvrs5bt7gz3flr4vf35p2qcvmwhkqm7;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/redset-0.2.0-eruhluyu3zolyubz6old5esoe6s7egnw;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/rankstr-0.1.0-6likqktizvniim2xk5bwqzgrxzgegqiu;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/dtcmp-1.1.4-36lvuzlbgpldrpgq45tjypw4ueuasbye;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/lwgrp-1.0.5-7uynxmvjh5mioqxhmecf3373gi6c3wet;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/axl-0.7.1-c2kw4eaq2hlqoxkulm37ha6smv4rg4eo;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/kvtree-1.3.0-nguzbsyrpbv2a3t5ff7fk75iwhnqbpu3;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/raja-2023.06.0-l7kla4y4ico2fy5xo6c3ppxbbbhu4nyt;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/camp-2023.06.0-axyc4xacawmyaisubksrhutnemqy2f2j;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/mfem-4.5.2-tgwkub4fbu6y3espxylvfr6j7tckcv66;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/hypre-2.24.0-yurrucgn7r7ue6pblx3rq6wxlj2seitx;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/lua-5.4.4-jhnm2657v5fkpuw6nwmvwi6g62f5v7db;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/ncurses-6.4-dqyeo6k4n3exna7br27zcoynyhhkcnq5;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/conduit-0.8.8-d6u5xy5jwoy73cj26v2guvoc4spmjphw;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/parmetis-4.0.3-sq7p4yzdffk4xxarmknaswkzauirozca;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/metis-5.1.0-kh3dxirgwdtvoon5iqdzedgh73suanet;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/hdf5-1.8.22-xfyqrfajjk54crvde7pgnyvpp5r2icbg;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/c2c-1.8.0-wi6af4qoa35kfgmuso32x7hjyb24qtv3;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/gmake-4.4.1-5ves23fzy2xoislpirqho4whgttpy6sk;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0/blt-0.5.3-e5zxyfyfkpordzyjdfugcdgeikzirlwy;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") - -set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: clang@=10.0.0 -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/clang/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/clang/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/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.3.1/bin/gfortran" CACHE PATH "") - -endif() - -set(CMAKE_C_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "") - -set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "") - -set(CMAKE_GENERATOR "Unix Makefiles" 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") - -#------------------------------------------------------------------------------ -# 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 -#------------------------------------------------------------------------------ - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-10.0.0" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-d6u5xy5jwoy73cj26v2guvoc4spmjphw" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-wi6af4qoa35kfgmuso32x7hjyb24qtv3" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-tgwkub4fbu6y3espxylvfr6j7tckcv66" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-xfyqrfajjk54crvde7pgnyvpp5r2icbg" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-jhnm2657v5fkpuw6nwmvwi6g62f5v7db" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-l7kla4y4ico2fy5xo6c3ppxbbbhu4nyt" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-z2h5kuxhzuk2ngcw67dwkhsqn7sltlq6" CACHE PATH "") - -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-axyc4xacawmyaisubksrhutnemqy2f2j" CACHE PATH "") - -set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-adlfle3mstudvzjj3jcl5i52xiq4awvu" CACHE PATH "") - -set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-nguzbsyrpbv2a3t5ff7fk75iwhnqbpu3" CACHE PATH "") - -set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-36lvuzlbgpldrpgq45tjypw4ueuasbye" CACHE PATH "") - -set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-wqlfyvi364xtbgefjc6l3nd6go7fmpew" CACHE PATH "") - -set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-c2kw4eaq2hlqoxkulm37ha6smv4rg4eo" CACHE PATH "") - -set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-7uynxmvjh5mioqxhmecf3373gi6c3wet" CACHE PATH "") - -set(ER_DIR "${TPL_ROOT}/er-0.2.0-fggkkdogojtdhw4ev6qcjnnpmg4wf3ad" CACHE PATH "") - -set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-6likqktizvniim2xk5bwqzgrxzgegqiu" CACHE PATH "") - -set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-eruhluyu3zolyubz6old5esoe6s7egnw" CACHE PATH "") - -set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-5cvrs5bt7gz3flr4vf35p2qcvmwhkqm7" CACHE PATH "") - -set(LIBYOGRT_DIR "/usr" CACHE PATH "") - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/2023_04_18_13_40_46/._view/2axci4znbttcg4i676h7tlgjoffyysqt" 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.10.10/bin/python3.10" CACHE PATH "") - -set(ENABLE_DOCS ON CACHE BOOL "") - -set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") - -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") - -set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") - -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" 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 deleted file mode 100644 index de0eee36d6..0000000000 --- a/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake +++ /dev/null @@ -1,116 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake -#------------------------------------------------------------------------------ - -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/umpire-2023.06.0-pxc3luewglsrjheqbmy4ethzzhtkp4wa;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/raja-2023.06.0-7s6l5urylci3jmqtttose3jarycrizpp;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/camp-2023.06.0-ojipssq33pvvq6qwllhxtb3rm7mygyby;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/mfem-4.5.2-os7vuxxmcxl2kwlxktmcyzfijg7nbcxn;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/hypre-2.24.0-k5mky734f76cd3wf4nsn7cu6ojb4qlng;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/lua-5.4.4-llfbtjxhew4bndeno5yiuhcsnhonmhx3;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/ncurses-6.4-vibranrcfja4nnd7363fxffvddp6cvan;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/conduit-0.8.8-adu2oxc6b3dgj2euult7r5jbqdhe4jsc;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/parmetis-4.0.3-feep6z2o6motj6ewaiyypzfixyvfuj6x;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/metis-5.1.0-gm5mheorgemz444kl4u452kpk37st3ip;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/hdf5-1.8.22-m6ch4naxrmq7eve3se5wkyetakirqp2x;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/c2c-1.8.0-l2mnatxn4h33nrbij5s5iq5fwy3egoch;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/gmake-4.4.1-7g2ykynv7s3hgjbm4qcxafa7ejhblyso;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0/blt-0.5.3-au7nouiccwpfdujjkvk66k33g4d7fw3g;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3-clang-9.0.0;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") - -set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: clang@=9.0.0 -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/clang/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/clang/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/clang/gfortran" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/clang/clang-9.0.0/bin/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-9.0.0/bin/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran" CACHE PATH "") - -endif() - -set(CMAKE_C_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "") - -set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1" CACHE STRING "") - -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,/usr/tce/packages/clang/clang-9.0.0/lib" CACHE STRING "Adds a missing libstdc++ rpath") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-9.0.0/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-9.0.0/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-9.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 -#------------------------------------------------------------------------------ - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/clang-9.0.0" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-adu2oxc6b3dgj2euult7r5jbqdhe4jsc" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-l2mnatxn4h33nrbij5s5iq5fwy3egoch" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-os7vuxxmcxl2kwlxktmcyzfijg7nbcxn" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-m6ch4naxrmq7eve3se5wkyetakirqp2x" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-llfbtjxhew4bndeno5yiuhcsnhonmhx3" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-7s6l5urylci3jmqtttose3jarycrizpp" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-pxc3luewglsrjheqbmy4ethzzhtkp4wa" CACHE PATH "") - -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-ojipssq33pvvq6qwllhxtb3rm7mygyby" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/2023_04_18_13_40_46/._view/2axci4znbttcg4i676h7tlgjoffyysqt" 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.10.10/bin/python3.10" CACHE PATH "") - -set(ENABLE_DOCS ON CACHE BOOL "") - -set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") - -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") - -set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") - -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") - - diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0_nofortran.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0_nofortran.cmake deleted file mode 100644 index 8cd863d8f2..0000000000 --- a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0_nofortran.cmake +++ /dev/null @@ -1,128 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake -#------------------------------------------------------------------------------ - -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/umpire-2023.06.0-gjdqn4ak7icylqiws4oiocqeozqayl52;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/scr-3.0.1-57v5d2kgeskys7pvhqumaeudj4jc62e3;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/spath-0.2.0-i4jj5grbwakdvhlhify3kzz5opomwyny;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/er-0.2.0-pmsfzcrxgdwyozmi5p5hkyztamh3mwax;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/shuffile-0.2.0-vwjpmnvcdx34bibz47kw4us5zgx7shbl;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/redset-0.2.0-qb5orvh6dzrfl3bkdm5qokkkwsjshq3c;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/rankstr-0.1.0-svws2lhtrvsl2enn2mkfn3pksjhu3h5v;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/dtcmp-1.1.4-xjhkvaqwwurxrjwuemnm7q3aye5mes76;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/lwgrp-1.0.5-tvd246ukitcjukvnlaovhvjnmufcioex;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/axl-0.7.1-xfrinfrl23xnds6psui7rhfn4m7kjfl7;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/kvtree-1.3.0-ausnjow5nnsworkbrptparlvmdir5f3c;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/raja-2023.06.0-7dt45inc7wkugafoj6i23gwtmp2sjsvz;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/camp-2023.06.0-4tyifsgcn4nbb7bpmz37hjwvaw5dtwrk;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/lua-5.4.4-57tfdw4tof6qhsuxnaaznfmsrplldoz2;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/ncurses-6.4-jcr73xssadvreprbmfpbk2xnf3p6hzax;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/conduit-0.8.8-fiv75zpvehkazrqkdevc2jixmmdkldwk;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/parmetis-4.0.3-zpcbdbwhfrjpxznnnubo2hlp7idf5uwz;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/metis-5.1.0-cr54mbalvgkv33vcfdckbre3zu7gxuzw;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/hdf5-1.8.22-zl7uzlzpzb55jzwdixp2duowqnq7ef2e;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/c2c-1.8.0-bxnyix3t2vt2hestvo3ig4kod7yyjhiz;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/gmake-4.4.1-iodcwdajnghbmtscfiuu5ockdpruvaay;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0/blt-0.5.3-clo3ueqx6blmg6it4hbxc2jopdnn77vu;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.1.0;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") - -set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: gcc@=8.1.0 -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/gcc/g++" CACHE PATH "") - - # No Fortran compiler defined in spec -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/gcc/gcc-8.1.0/bin/gcc" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/gcc/gcc-8.1.0/bin/g++" CACHE PATH "") - - # No Fortran compiler defined in spec -endif() - -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - -set(ENABLE_FORTRAN OFF CACHE BOOL "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.1.0/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.1.0/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.1.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 -#------------------------------------------------------------------------------ - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.1.0" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-fiv75zpvehkazrqkdevc2jixmmdkldwk" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-bxnyix3t2vt2hestvo3ig4kod7yyjhiz" CACHE PATH "") - -# MFEM not built - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-zl7uzlzpzb55jzwdixp2duowqnq7ef2e" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-57tfdw4tof6qhsuxnaaznfmsrplldoz2" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-7dt45inc7wkugafoj6i23gwtmp2sjsvz" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-gjdqn4ak7icylqiws4oiocqeozqayl52" CACHE PATH "") - -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-4tyifsgcn4nbb7bpmz37hjwvaw5dtwrk" CACHE PATH "") - -set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-57v5d2kgeskys7pvhqumaeudj4jc62e3" CACHE PATH "") - -set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-ausnjow5nnsworkbrptparlvmdir5f3c" CACHE PATH "") - -set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-xjhkvaqwwurxrjwuemnm7q3aye5mes76" CACHE PATH "") - -set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-i4jj5grbwakdvhlhify3kzz5opomwyny" CACHE PATH "") - -set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-xfrinfrl23xnds6psui7rhfn4m7kjfl7" CACHE PATH "") - -set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-tvd246ukitcjukvnlaovhvjnmufcioex" CACHE PATH "") - -set(ER_DIR "${TPL_ROOT}/er-0.2.0-pmsfzcrxgdwyozmi5p5hkyztamh3mwax" CACHE PATH "") - -set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-svws2lhtrvsl2enn2mkfn3pksjhu3h5v" CACHE PATH "") - -set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-qb5orvh6dzrfl3bkdm5qokkkwsjshq3c" CACHE PATH "") - -set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-vwjpmnvcdx34bibz47kw4us5zgx7shbl" CACHE PATH "") - -set(LIBYOGRT_DIR "/usr" CACHE PATH "") - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/2023_04_18_13_40_46/._view/2axci4znbttcg4i676h7tlgjoffyysqt" 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.10.10/bin/python3.10" CACHE PATH "") - -set(ENABLE_DOCS ON CACHE BOOL "") - -set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") - -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") - -set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") - -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") - - diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.3.1.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.3.1.cmake deleted file mode 100644 index e20408cdd4..0000000000 --- a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.3.1.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.21.1/bin/cmake -#------------------------------------------------------------------------------ - -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/umpire-2023.06.0-4lqubknlmrlwyto2dmh7hkuxfc7dnmyr;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/scr-3.0.1-5c6fxrzejvkngts2gvaji25m3aikqotq;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/spath-0.2.0-cyf7c2ckovj7asynsnujlmcadwivwgo5;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/er-0.2.0-s6lj66k6o7udxbs5nivliay3ynkbmtue;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/shuffile-0.2.0-bzfolkf7fgnbja5ezrj6yymcb4tat6ya;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/redset-0.2.0-bnahpcvz5vrxvqgnmojdkddlbj7nb6kk;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/rankstr-0.1.0-5gksa6boymqygb3vxg7gffg7mh7mhz2f;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/dtcmp-1.1.4-gyi6h3ontslodbkt7wrbvbusj6ugpsj4;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/lwgrp-1.0.5-gaxorio4wbj6rwb25wlmevijp4mxq6nd;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/axl-0.7.1-qxdmeyuoryegcqelx3nmnph5cmryxexr;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/kvtree-1.3.0-hgauqgxu2ywylnfvwbfgq45xbkz2rb3z;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/raja-2023.06.0-ibkvsozbs444xs2aulxi2d6oz3oxkpd4;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/camp-2023.06.0-jmcfsgj7oqds43xfe64sufk2lbwilvg7;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/mfem-4.5.2-swbpowqpbmk6dhiur7juteihcw5zyae6;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/hypre-2.24.0-s6sb4aierrpgfdi3bez7mwji53zoplzu;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/lua-5.4.4-jn6kavdbewwqf7hqiltjzevvxnwuzk6x;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/ncurses-6.4-nofrz54iun2qczh2wzjlbszqqo3nqtm3;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/conduit-0.8.8-4fl5aa5u5q534xzce7x4dg5rg263xmde;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/parmetis-4.0.3-gb6lyk4lbx5nrh7cmixhbx4g2oxb2pzf;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/metis-5.1.0-yfdg6ffxtu6cy2yzzedexxhtcojuxjg4;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/hdf5-1.8.22-kswk4j5erlowjuscpcwda3mbomiqbvhd;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/c2c-1.8.0-s73y627jl7vz2g5pbhxpkf7ikcjjoivf;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/gmake-4.4.1-2hex2dpiveahunyaxdqatq3mdu65a67p;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1/blt-0.5.3-sdn67yf6o75nerspuntv2kxkl3ayhvnv;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") - -set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: gcc@=8.3.1 -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/gcc/g++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/gcc/gcc-8.3.1/bin/g++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran" CACHE PATH "") - -endif() - -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/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 -#------------------------------------------------------------------------------ - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/gcc-8.3.1" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-4fl5aa5u5q534xzce7x4dg5rg263xmde" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-s73y627jl7vz2g5pbhxpkf7ikcjjoivf" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-swbpowqpbmk6dhiur7juteihcw5zyae6" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-kswk4j5erlowjuscpcwda3mbomiqbvhd" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-jn6kavdbewwqf7hqiltjzevvxnwuzk6x" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-ibkvsozbs444xs2aulxi2d6oz3oxkpd4" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-4lqubknlmrlwyto2dmh7hkuxfc7dnmyr" CACHE PATH "") - -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-jmcfsgj7oqds43xfe64sufk2lbwilvg7" CACHE PATH "") - -set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-5c6fxrzejvkngts2gvaji25m3aikqotq" CACHE PATH "") - -set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-hgauqgxu2ywylnfvwbfgq45xbkz2rb3z" CACHE PATH "") - -set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-gyi6h3ontslodbkt7wrbvbusj6ugpsj4" CACHE PATH "") - -set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-cyf7c2ckovj7asynsnujlmcadwivwgo5" CACHE PATH "") - -set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-qxdmeyuoryegcqelx3nmnph5cmryxexr" CACHE PATH "") - -set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-gaxorio4wbj6rwb25wlmevijp4mxq6nd" CACHE PATH "") - -set(ER_DIR "${TPL_ROOT}/er-0.2.0-s6lj66k6o7udxbs5nivliay3ynkbmtue" CACHE PATH "") - -set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-5gksa6boymqygb3vxg7gffg7mh7mhz2f" CACHE PATH "") - -set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-bnahpcvz5vrxvqgnmojdkddlbj7nb6kk" CACHE PATH "") - -set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-bzfolkf7fgnbja5ezrj6yymcb4tat6ya" CACHE PATH "") - -set(LIBYOGRT_DIR "/usr" CACHE PATH "") - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/2023_04_18_13_40_46/._view/2axci4znbttcg4i676h7tlgjoffyysqt" 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.10.10/bin/python3.10" CACHE PATH "") - -set(ENABLE_DOCS ON CACHE BOOL "") - -set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") - -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") - -set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") - -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" 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 deleted file mode 100644 index 7741e5fc6a..0000000000 --- a/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake +++ /dev/null @@ -1,116 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.21.1/bin/cmake -#------------------------------------------------------------------------------ - -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/umpire-2023.06.0-spxsyq3od3jpw7xarmaf27zkhpreokce;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/raja-2023.06.0-ddsf5gvw3o7fmxx6tqaboufen5rtq3z4;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/camp-2023.06.0-pl43tuxmbj3l3humx76qa2dnglwieb7u;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/mfem-4.5.2-gncr6owa7f72rqhpzooxegqm7mmpzrxo;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/hypre-2.24.0-3nrszj6z3zarr6ret4vogidku5l3dk4h;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/lua-5.4.4-zljt4isbv6foy6qelg5nbabt2qdrny22;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/ncurses-6.4-kdjhmjhd6mde3prcrx4n6yuon7ifsg6b;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/conduit-0.8.8-oe5nxzus2z6e4fkaig2qw6jjznvmbc54;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/parmetis-4.0.3-gll7fwyzerdprkjo6pfqtg53ucbtcwgh;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/metis-5.1.0-sbxpvwpfbuqmi7xahz577tegotyhxi7n;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/hdf5-1.8.22-q7z46mq5v45ezkpbskhjgzpovqwwjorl;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/c2c-1.8.0-a52qggtffivtdp7ef2zw5bdapzo3zg5o;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/gmake-4.4.1-mubwfgd2o6j6mfms6bkw5ppbzpitibqs;/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4/blt-0.5.3-ujtkyhrx64yk64oy2jpcsgxpbdz7tzsn;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10;/usr/tce/packages/clang/clang-10.0.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/graphviz-7.1.0;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3-intel-19.0.0;/usr/tce/packages/cmake/cmake-3.21.1" CACHE PATH "") - -set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: intel@=19.0.4 -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/intel/icc" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/intel/icpc" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/spack/lib/spack/env/intel/ifort" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/intel/intel-19.0.4/bin/icc" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/intel/intel-19.0.4/bin/icpc" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/tce/packages/intel/intel-19.0.4/bin/ifort" CACHE PATH "") - -endif() - -set(CMAKE_C_FLAGS "-gcc-name=/usr/tce/packages/gcc/gcc-8.1.0/bin/gcc" CACHE STRING "") - -set(CMAKE_CXX_FLAGS "-gxx-name=/usr/tce/packages/gcc/gcc-8.1.0/bin/g++" CACHE STRING "") - -set(CMAKE_Fortran_FLAGS "-gcc-name=/usr/tce/packages/gcc/gcc-8.1.0/bin/gcc" CACHE STRING "") - -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-intel-19.0.0/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-intel-19.0.0/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-intel-19.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 OFF CACHE BOOL "") - -set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# TPLs -#------------------------------------------------------------------------------ - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2023_07_26_17_28_34/intel-19.0.4" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-oe5nxzus2z6e4fkaig2qw6jjznvmbc54" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-a52qggtffivtdp7ef2zw5bdapzo3zg5o" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-gncr6owa7f72rqhpzooxegqm7mmpzrxo" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-q7z46mq5v45ezkpbskhjgzpovqwwjorl" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-zljt4isbv6foy6qelg5nbabt2qdrny22" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-ddsf5gvw3o7fmxx6tqaboufen5rtq3z4" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-spxsyq3od3jpw7xarmaf27zkhpreokce" CACHE PATH "") - -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-pl43tuxmbj3l3humx76qa2dnglwieb7u" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/2023_04_18_13_40_46/._view/2axci4znbttcg4i676h7tlgjoffyysqt" 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.10.10/bin/python3.10" CACHE PATH "") - -set(ENABLE_DOCS ON CACHE BOOL "") - -set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") - -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") - -set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") - -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") - - diff --git a/host-configs/rzgenie-toss_4_x86_64_ib-clang@14.0.6.cmake b/host-configs/rzgenie-toss_4_x86_64_ib-clang@14.0.6.cmake new file mode 100644 index 0000000000..31da21925c --- /dev/null +++ b/host-configs/rzgenie-toss_4_x86_64_ib-clang@14.0.6.cmake @@ -0,0 +1,138 @@ +#------------------------------------------------------------------------------ +# !!!! This is a generated file, edit at own risk !!!! +#------------------------------------------------------------------------------ +# CMake executable path: /usr/tce/bin/cmake +#------------------------------------------------------------------------------ + +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/umpire-2024.02.0-jhuql5fc2vhya4sdl7g4nlcrzaoycqai;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/scr-3.0.1-t7t35dyvwswfrk3lp2k4tcjpiyyylgr6;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/spath-0.2.0-5ypljdbn6yf6ab3jabzpeeuxxvbm6vix;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/er-0.2.0-pfk7tzcycgqnc73twpnleapauynyrmuo;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/shuffile-0.2.0-lcyevsv6yv4cwtahb3kt5h4emqtfwwvb;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/redset-0.2.0-yg22aoerdpabedvtormddcankg4lkitu;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/rankstr-0.1.0-t7qtfe3uihx4s2ia5gft2rvwmbfsaqcz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/dtcmp-1.1.4-scoxi2onj4nu3g5em5dgc4imwzihgfjj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/lwgrp-1.0.5-rdvuqikm56okeru5jkroem5tpaybke3q;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/axl-0.7.1-dvovqn3v6stb27lftz5c2jv7ykyt74o3;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/kvtree-1.3.0-3lkpy2ktv66bhbyxtg7r6xca2shap6sw;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/raja-2024.02.0-i7u43vvuic25rvjjhkeblvxeitkvzjwy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/py-jsonschema-2.6.0-6j5dc4xbppedseqpxhmnvdsvfm5nohqz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/mfem-4.6.0-2o3e3zv4evsmrgwpwroyhpmj2pot7fgj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/hypre-2.24.0-k33flgav4be3pqx5hlzmgxqsege5er4p;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/conduit-0.9.1-sioyszp7ze6fzubtdslxlpkxzojic7hq;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/parmetis-4.0.3-de7rslbjz6xchwd4jlec2iswp6yf4yt7;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/hdf5-1.8.23-j75364eqyn3yxqzod7t4v3hpbaw3zqg4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/blt-0.6.1.4-oouarzy7h3sj5quygkhjaduigaxbj4at;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/fmt-10.2.1-lfndxhuits6wwazxaoj5dxl3ix3hw2cc;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/camp-2024.02.0-ejjy6cua3jj5bnwbk3r6x46ffgqe6tip;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/zlib-ng-2.1.5-lkg7eg7nky6w74eujzgmp6hnhkaf2w7p;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/libyogrt-1.33-z45arsyuiqgmqeo3vnzdiosnbyksfypl;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/metis-5.1.0-ggcpxjmhkbi3nwtqmgu7dal2rsedyza5;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/gmake-4.4.1-jimcbwsnakmlfui3jg7a4e6327ry222f;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/c2c-1.8.0-eojdjy4bkke6p7mtj47tsbk35f3ag3us;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-clang-14.0.6;/usr/tce/packages/clang/clang-14.0.6" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/axom-develop-5hpzhtmywppnpol3crmlzn4oxctfyukn/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/axom-develop-5hpzhtmywppnpol3crmlzn4oxctfyukn/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/c2c-1.8.0-eojdjy4bkke6p7mtj47tsbk35f3ag3us/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/conduit-0.9.1-sioyszp7ze6fzubtdslxlpkxzojic7hq/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/hdf5-1.8.23-j75364eqyn3yxqzod7t4v3hpbaw3zqg4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/zlib-ng-2.1.5-lkg7eg7nky6w74eujzgmp6hnhkaf2w7p/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/metis-5.1.0-ggcpxjmhkbi3nwtqmgu7dal2rsedyza5/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/parmetis-4.0.3-de7rslbjz6xchwd4jlec2iswp6yf4yt7/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/mfem-4.6.0-2o3e3zv4evsmrgwpwroyhpmj2pot7fgj/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/hypre-2.24.0-k33flgav4be3pqx5hlzmgxqsege5er4p/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/py-jsonschema-2.6.0-6j5dc4xbppedseqpxhmnvdsvfm5nohqz/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/raja-2024.02.0-i7u43vvuic25rvjjhkeblvxeitkvzjwy/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/camp-2024.02.0-ejjy6cua3jj5bnwbk3r6x46ffgqe6tip/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/dtcmp-1.1.4-scoxi2onj4nu3g5em5dgc4imwzihgfjj/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/lwgrp-1.0.5-rdvuqikm56okeru5jkroem5tpaybke3q/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/libyogrt-1.33-z45arsyuiqgmqeo3vnzdiosnbyksfypl/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/scr-3.0.1-t7t35dyvwswfrk3lp2k4tcjpiyyylgr6/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/axl-0.7.1-dvovqn3v6stb27lftz5c2jv7ykyt74o3/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/kvtree-1.3.0-3lkpy2ktv66bhbyxtg7r6xca2shap6sw/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/er-0.2.0-pfk7tzcycgqnc73twpnleapauynyrmuo/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/rankstr-0.1.0-t7qtfe3uihx4s2ia5gft2rvwmbfsaqcz/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/redset-0.2.0-yg22aoerdpabedvtormddcankg4lkitu/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/shuffile-0.2.0-lcyevsv6yv4cwtahb3kt5h4emqtfwwvb/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/spath-0.2.0-5ypljdbn6yf6ab3jabzpeeuxxvbm6vix/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/umpire-2024.02.0-jhuql5fc2vhya4sdl7g4nlcrzaoycqai/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/fmt-10.2.1-lfndxhuits6wwazxaoj5dxl3ix3hw2cc/lib64;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/axom-develop-5hpzhtmywppnpol3crmlzn4oxctfyukn/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/axom-develop-5hpzhtmywppnpol3crmlzn4oxctfyukn/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/c2c-1.8.0-eojdjy4bkke6p7mtj47tsbk35f3ag3us/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/conduit-0.9.1-sioyszp7ze6fzubtdslxlpkxzojic7hq/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/hdf5-1.8.23-j75364eqyn3yxqzod7t4v3hpbaw3zqg4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/zlib-ng-2.1.5-lkg7eg7nky6w74eujzgmp6hnhkaf2w7p/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/metis-5.1.0-ggcpxjmhkbi3nwtqmgu7dal2rsedyza5/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/parmetis-4.0.3-de7rslbjz6xchwd4jlec2iswp6yf4yt7/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/mfem-4.6.0-2o3e3zv4evsmrgwpwroyhpmj2pot7fgj/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/hypre-2.24.0-k33flgav4be3pqx5hlzmgxqsege5er4p/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/py-jsonschema-2.6.0-6j5dc4xbppedseqpxhmnvdsvfm5nohqz/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/raja-2024.02.0-i7u43vvuic25rvjjhkeblvxeitkvzjwy/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/camp-2024.02.0-ejjy6cua3jj5bnwbk3r6x46ffgqe6tip/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/dtcmp-1.1.4-scoxi2onj4nu3g5em5dgc4imwzihgfjj/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/lwgrp-1.0.5-rdvuqikm56okeru5jkroem5tpaybke3q/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/libyogrt-1.33-z45arsyuiqgmqeo3vnzdiosnbyksfypl/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/scr-3.0.1-t7t35dyvwswfrk3lp2k4tcjpiyyylgr6/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/axl-0.7.1-dvovqn3v6stb27lftz5c2jv7ykyt74o3/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/kvtree-1.3.0-3lkpy2ktv66bhbyxtg7r6xca2shap6sw/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/er-0.2.0-pfk7tzcycgqnc73twpnleapauynyrmuo/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/rankstr-0.1.0-t7qtfe3uihx4s2ia5gft2rvwmbfsaqcz/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/redset-0.2.0-yg22aoerdpabedvtormddcankg4lkitu/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/shuffile-0.2.0-lcyevsv6yv4cwtahb3kt5h4emqtfwwvb/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/spath-0.2.0-5ypljdbn6yf6ab3jabzpeeuxxvbm6vix/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/umpire-2024.02.0-jhuql5fc2vhya4sdl7g4nlcrzaoycqai/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6/fmt-10.2.1-lfndxhuits6wwazxaoj5dxl3ix3hw2cc/lib64;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") + +#------------------------------------------------------------------------------ +# Compilers +#------------------------------------------------------------------------------ +# Compiler Spec: clang@=14.0.6 +#------------------------------------------------------------------------------ +if(DEFINED ENV{SPACK_CC}) + + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/clang/clang" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/clang/clang++" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + +else() + + set(CMAKE_C_COMPILER "/usr/tce/packages/clang/clang-14.0.6/bin/clang" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-14.0.6/bin/clang++" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/tce/packages/gcc/gcc-10.3.1/bin/gfortran" CACHE PATH "") + +endif() + +set(ENABLE_FORTRAN ON CACHE BOOL "") + +set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,/usr/tce/packages/clang/clang-14.0.6/lib" CACHE STRING "Adds a missing libstdc++ rpath") + +#------------------------------------------------------------------------------ +# MPI +#------------------------------------------------------------------------------ + +set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/bin/mpicc" CACHE PATH "") + +set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/bin/mpicxx" CACHE PATH "") + +set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/bin/mpif90" CACHE PATH "") + +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") + +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Hardware +#------------------------------------------------------------------------------ + +#------------------------------------------------ +# Hardware Specifics +#------------------------------------------------ + +set(ENABLE_OPENMP ON CACHE BOOL "") + +set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# TPLs +#------------------------------------------------------------------------------ + +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/clang-14.0.6" CACHE PATH "") + +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-sioyszp7ze6fzubtdslxlpkxzojic7hq" CACHE PATH "") + +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-eojdjy4bkke6p7mtj47tsbk35f3ag3us" CACHE PATH "") + +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-2o3e3zv4evsmrgwpwroyhpmj2pot7fgj" CACHE PATH "") + +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-j75364eqyn3yxqzod7t4v3hpbaw3zqg4" CACHE PATH "") + +set(LUA_DIR "/usr" CACHE PATH "") + +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-i7u43vvuic25rvjjhkeblvxeitkvzjwy" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-jhuql5fc2vhya4sdl7g4nlcrzaoycqai" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-ejjy6cua3jj5bnwbk3r6x46ffgqe6tip" CACHE PATH "") + +set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-t7t35dyvwswfrk3lp2k4tcjpiyyylgr6" CACHE PATH "") + +set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-3lkpy2ktv66bhbyxtg7r6xca2shap6sw" CACHE PATH "") + +set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-scoxi2onj4nu3g5em5dgc4imwzihgfjj" CACHE PATH "") + +set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-5ypljdbn6yf6ab3jabzpeeuxxvbm6vix" CACHE PATH "") + +set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-dvovqn3v6stb27lftz5c2jv7ykyt74o3" CACHE PATH "") + +set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-rdvuqikm56okeru5jkroem5tpaybke3q" CACHE PATH "") + +set(ER_DIR "${TPL_ROOT}/er-0.2.0-pfk7tzcycgqnc73twpnleapauynyrmuo" CACHE PATH "") + +set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-t7qtfe3uihx4s2ia5gft2rvwmbfsaqcz" CACHE PATH "") + +set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-yg22aoerdpabedvtormddcankg4lkitu" CACHE PATH "") + +set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-lcyevsv6yv4cwtahb3kt5h4emqtfwwvb" CACHE PATH "") + +set(LIBYOGRT_DIR "${TPL_ROOT}/libyogrt-1.33-z45arsyuiqgmqeo3vnzdiosnbyksfypl" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Devtools +#------------------------------------------------------------------------------ + +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") + +set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") + +set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/python3.10" CACHE PATH "") + +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-6j5dc4xbppedseqpxhmnvdsvfm5nohqz/bin/jsonschema" CACHE PATH "") + +set(ENABLE_DOCS ON CACHE BOOL "") + +set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") + +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") + +set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") + +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") + + diff --git a/host-configs/rzgenie-toss_4_x86_64_ib-gcc@10.3.1.cmake b/host-configs/rzgenie-toss_4_x86_64_ib-gcc@10.3.1.cmake new file mode 100644 index 0000000000..090c2f62dc --- /dev/null +++ b/host-configs/rzgenie-toss_4_x86_64_ib-gcc@10.3.1.cmake @@ -0,0 +1,136 @@ +#------------------------------------------------------------------------------ +# !!!! This is a generated file, edit at own risk !!!! +#------------------------------------------------------------------------------ +# CMake executable path: /usr/tce/bin/cmake +#------------------------------------------------------------------------------ + +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/umpire-2024.02.0-2edi7papg24dx6cmzuu4cvli6gn5ula4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/fmt-10.2.1-vsppemwn4lv42jffltnu2m5wk7pa4mh4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/scr-3.0.1-53wid77fnqp54as4ssxj6yln3ebatfqc;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/spath-0.2.0-vy4oatc22e4yhneh564uexojguzk64hl;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/libyogrt-1.33-5ylxltz7yzkytfwjqsdy7alvfpvblpfa;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/er-0.2.0-ssi5sg74fzuszg64bx4w36k74aylefbs;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/shuffile-0.2.0-2dqga6mipogmwwnegz6ruroxjjpuydns;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/redset-0.2.0-26dcmicvi4gl3n7bezyvvt6tzxgfhyt4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/rankstr-0.1.0-rtae4hecutfnw3p2c3pw2r23wel57wxe;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/dtcmp-1.1.4-fhlas27vbqequpdrt7hs4z5y7fu6fcux;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/lwgrp-1.0.5-xy2pfakxxt737yqixkijiopg5aqe6qy4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/axl-0.7.1-it2ovw5easrshsv2ii3y7ui7sykejtl3;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/kvtree-1.3.0-ox6ll5w2vlux2gncxlxp6f7sduc5we3k;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/raja-2024.02.0-lgda75dl72dsc3fpkaboonrastlb533i;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/camp-2024.02.0-54ph6bxcskqc6vyj2yumw2c453rdw3ms;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/py-jsonschema-2.6.0-lxk3nz6n2wxarwsyghge5l6jio4pze63;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/mfem-4.6.0-72vdexr6wsfxessfqnjamz4yw7bbimzv;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/hypre-2.24.0-fqukfipx623hwcdtl44ul6m7gf436bea;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/gmake-4.4.1-hnowwppvujezizfysc64xc2myqqulzcn;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/conduit-0.9.1-2gxyktbxfdki7l62knbd2gcv2po5mnnz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/parmetis-4.0.3-olkucdyohy6nglxyp6yqvflfxhhtjji4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/metis-5.1.0-au7rbsfu6yv7cazug6635jzvb2gwy7st;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/hdf5-1.8.23-qdwxt3e3mv7bjt3xqcybad7beymgxcsn;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/zlib-ng-2.1.5-shzp76r665h2g3lnqspfmluapd7jxtrt;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/c2c-1.8.0-fahftlekwziw2ls4bezzaviuke4kvqyz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/blt-0.6.1.4-ee4ftwhz24yhie53n4ximxniibs3wair;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/gcc-runtime-10.3.1-yxmwjg76ccmk3rbqtfni7b56ykrldyrb;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-10.3.1" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/axom-develop-7y7edht7m7fpp3mt27ogvq6ymbcldzmq/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/axom-develop-7y7edht7m7fpp3mt27ogvq6ymbcldzmq/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/c2c-1.8.0-fahftlekwziw2ls4bezzaviuke4kvqyz/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/gcc-runtime-10.3.1-yxmwjg76ccmk3rbqtfni7b56ykrldyrb/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/conduit-0.9.1-2gxyktbxfdki7l62knbd2gcv2po5mnnz/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/hdf5-1.8.23-qdwxt3e3mv7bjt3xqcybad7beymgxcsn/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/zlib-ng-2.1.5-shzp76r665h2g3lnqspfmluapd7jxtrt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/metis-5.1.0-au7rbsfu6yv7cazug6635jzvb2gwy7st/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/parmetis-4.0.3-olkucdyohy6nglxyp6yqvflfxhhtjji4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/mfem-4.6.0-72vdexr6wsfxessfqnjamz4yw7bbimzv/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/hypre-2.24.0-fqukfipx623hwcdtl44ul6m7gf436bea/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/py-jsonschema-2.6.0-lxk3nz6n2wxarwsyghge5l6jio4pze63/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/raja-2024.02.0-lgda75dl72dsc3fpkaboonrastlb533i/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/camp-2024.02.0-54ph6bxcskqc6vyj2yumw2c453rdw3ms/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/dtcmp-1.1.4-fhlas27vbqequpdrt7hs4z5y7fu6fcux/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/lwgrp-1.0.5-xy2pfakxxt737yqixkijiopg5aqe6qy4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/libyogrt-1.33-5ylxltz7yzkytfwjqsdy7alvfpvblpfa/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/scr-3.0.1-53wid77fnqp54as4ssxj6yln3ebatfqc/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/axl-0.7.1-it2ovw5easrshsv2ii3y7ui7sykejtl3/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/kvtree-1.3.0-ox6ll5w2vlux2gncxlxp6f7sduc5we3k/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/er-0.2.0-ssi5sg74fzuszg64bx4w36k74aylefbs/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/rankstr-0.1.0-rtae4hecutfnw3p2c3pw2r23wel57wxe/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/redset-0.2.0-26dcmicvi4gl3n7bezyvvt6tzxgfhyt4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/shuffile-0.2.0-2dqga6mipogmwwnegz6ruroxjjpuydns/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/spath-0.2.0-vy4oatc22e4yhneh564uexojguzk64hl/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/umpire-2024.02.0-2edi7papg24dx6cmzuu4cvli6gn5ula4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/fmt-10.2.1-vsppemwn4lv42jffltnu2m5wk7pa4mh4/lib64;/collab/usr/global/tools/tce4/packages/gcc/gcc-10.3.1/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/axom-develop-7y7edht7m7fpp3mt27ogvq6ymbcldzmq/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/axom-develop-7y7edht7m7fpp3mt27ogvq6ymbcldzmq/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/c2c-1.8.0-fahftlekwziw2ls4bezzaviuke4kvqyz/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/gcc-runtime-10.3.1-yxmwjg76ccmk3rbqtfni7b56ykrldyrb/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/conduit-0.9.1-2gxyktbxfdki7l62knbd2gcv2po5mnnz/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/hdf5-1.8.23-qdwxt3e3mv7bjt3xqcybad7beymgxcsn/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/zlib-ng-2.1.5-shzp76r665h2g3lnqspfmluapd7jxtrt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/metis-5.1.0-au7rbsfu6yv7cazug6635jzvb2gwy7st/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/parmetis-4.0.3-olkucdyohy6nglxyp6yqvflfxhhtjji4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/mfem-4.6.0-72vdexr6wsfxessfqnjamz4yw7bbimzv/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/hypre-2.24.0-fqukfipx623hwcdtl44ul6m7gf436bea/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/py-jsonschema-2.6.0-lxk3nz6n2wxarwsyghge5l6jio4pze63/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/raja-2024.02.0-lgda75dl72dsc3fpkaboonrastlb533i/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/camp-2024.02.0-54ph6bxcskqc6vyj2yumw2c453rdw3ms/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/dtcmp-1.1.4-fhlas27vbqequpdrt7hs4z5y7fu6fcux/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/lwgrp-1.0.5-xy2pfakxxt737yqixkijiopg5aqe6qy4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/libyogrt-1.33-5ylxltz7yzkytfwjqsdy7alvfpvblpfa/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/scr-3.0.1-53wid77fnqp54as4ssxj6yln3ebatfqc/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/axl-0.7.1-it2ovw5easrshsv2ii3y7ui7sykejtl3/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/kvtree-1.3.0-ox6ll5w2vlux2gncxlxp6f7sduc5we3k/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/er-0.2.0-ssi5sg74fzuszg64bx4w36k74aylefbs/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/rankstr-0.1.0-rtae4hecutfnw3p2c3pw2r23wel57wxe/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/redset-0.2.0-26dcmicvi4gl3n7bezyvvt6tzxgfhyt4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/shuffile-0.2.0-2dqga6mipogmwwnegz6ruroxjjpuydns/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/spath-0.2.0-vy4oatc22e4yhneh564uexojguzk64hl/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/umpire-2024.02.0-2edi7papg24dx6cmzuu4cvli6gn5ula4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1/fmt-10.2.1-vsppemwn4lv42jffltnu2m5wk7pa4mh4/lib64;/collab/usr/global/tools/tce4/packages/gcc/gcc-10.3.1/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") + +#------------------------------------------------------------------------------ +# Compilers +#------------------------------------------------------------------------------ +# Compiler Spec: gcc@=10.3.1 +#------------------------------------------------------------------------------ +if(DEFINED ENV{SPACK_CC}) + + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/gcc/g++" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + +else() + + set(CMAKE_C_COMPILER "/usr/tce/packages/gcc/gcc-10.3.1/bin/gcc" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/tce/packages/gcc/gcc-10.3.1/bin/g++" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/tce/packages/gcc/gcc-10.3.1/bin/gfortran" CACHE PATH "") + +endif() + +set(ENABLE_FORTRAN ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# MPI +#------------------------------------------------------------------------------ + +set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/bin/mpicc" CACHE PATH "") + +set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/bin/mpicxx" CACHE PATH "") + +set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/bin/mpif90" CACHE PATH "") + +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") + +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Hardware +#------------------------------------------------------------------------------ + +#------------------------------------------------ +# Hardware Specifics +#------------------------------------------------ + +set(ENABLE_OPENMP ON CACHE BOOL "") + +set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# TPLs +#------------------------------------------------------------------------------ + +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/gcc-10.3.1" CACHE PATH "") + +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-2gxyktbxfdki7l62knbd2gcv2po5mnnz" CACHE PATH "") + +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-fahftlekwziw2ls4bezzaviuke4kvqyz" CACHE PATH "") + +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-72vdexr6wsfxessfqnjamz4yw7bbimzv" CACHE PATH "") + +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-qdwxt3e3mv7bjt3xqcybad7beymgxcsn" CACHE PATH "") + +set(LUA_DIR "/usr" CACHE PATH "") + +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-lgda75dl72dsc3fpkaboonrastlb533i" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-2edi7papg24dx6cmzuu4cvli6gn5ula4" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-54ph6bxcskqc6vyj2yumw2c453rdw3ms" CACHE PATH "") + +set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-53wid77fnqp54as4ssxj6yln3ebatfqc" CACHE PATH "") + +set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-ox6ll5w2vlux2gncxlxp6f7sduc5we3k" CACHE PATH "") + +set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-fhlas27vbqequpdrt7hs4z5y7fu6fcux" CACHE PATH "") + +set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-vy4oatc22e4yhneh564uexojguzk64hl" CACHE PATH "") + +set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-it2ovw5easrshsv2ii3y7ui7sykejtl3" CACHE PATH "") + +set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-xy2pfakxxt737yqixkijiopg5aqe6qy4" CACHE PATH "") + +set(ER_DIR "${TPL_ROOT}/er-0.2.0-ssi5sg74fzuszg64bx4w36k74aylefbs" CACHE PATH "") + +set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-rtae4hecutfnw3p2c3pw2r23wel57wxe" CACHE PATH "") + +set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-26dcmicvi4gl3n7bezyvvt6tzxgfhyt4" CACHE PATH "") + +set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-2dqga6mipogmwwnegz6ruroxjjpuydns" CACHE PATH "") + +set(LIBYOGRT_DIR "${TPL_ROOT}/libyogrt-1.33-5ylxltz7yzkytfwjqsdy7alvfpvblpfa" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Devtools +#------------------------------------------------------------------------------ + +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") + +set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") + +set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/python3.10" CACHE PATH "") + +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-lxk3nz6n2wxarwsyghge5l6jio4pze63/bin/jsonschema" CACHE PATH "") + +set(ENABLE_DOCS ON CACHE BOOL "") + +set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") + +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") + +set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") + +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") + + diff --git a/host-configs/rzgenie-toss_4_x86_64_ib-intel@2022.1.0.cmake b/host-configs/rzgenie-toss_4_x86_64_ib-intel@2022.1.0.cmake new file mode 100644 index 0000000000..69fe3de6c4 --- /dev/null +++ b/host-configs/rzgenie-toss_4_x86_64_ib-intel@2022.1.0.cmake @@ -0,0 +1,116 @@ +#------------------------------------------------------------------------------ +# !!!! This is a generated file, edit at own risk !!!! +#------------------------------------------------------------------------------ +# CMake executable path: /usr/tce/bin/cmake +#------------------------------------------------------------------------------ + +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/umpire-2024.02.0-4nxnup6vxwkwkinxdzzinkxul6vk2lsj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/raja-2024.02.0-v5ckygwjzmo7e2rts5qxwgfswhhpeqta;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/py-jsonschema-2.6.0-scktpdojmezaljg2bxfbzmf5lx3nmwvc;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/mfem-4.6.0-hma2wvr5tv3fkry6kdqfxmtsnqg6fv4d;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/hypre-2.24.0-czbxd2tmdjbl7v4nwommsh7xgw7ewgla;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/conduit-0.9.1-t745zbwmn5ffzo7whgwxmz5p5w2ym37z;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/parmetis-4.0.3-hattuaxqypmcfeqr3nvedmojwbgiora2;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/hdf5-1.8.23-2l37bduu2kjsgmhjxbfdgchsha2di2of;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/blt-0.6.1.4-3p2ecutmo7drpwwvvsgtcqxakxjoy573;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/fmt-10.2.1-jltnp6nb3minlrrafmdenoakubdzom57;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/camp-2024.02.0-xyur27wnppnansskdldrlqyzormhcr4e;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/zlib-ng-2.1.5-jtmqc4b5fqadcqbwagtun6kwe6geexbw;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/metis-5.1.0-hk6ipui6fnixwdyloqmqbsixqhtv5hxw;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/gmake-4.4.1-giduhrefimvdwblsuh6cmqipc474toi5;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/c2c-1.8.0-ovky3pniupirnys6mtf24ke5sb64mkbr;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/axom-develop-ma6pw2s3obh5afi3kvbgksqemjcs3ty7/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/axom-develop-ma6pw2s3obh5afi3kvbgksqemjcs3ty7/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/c2c-1.8.0-ovky3pniupirnys6mtf24ke5sb64mkbr/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/conduit-0.9.1-t745zbwmn5ffzo7whgwxmz5p5w2ym37z/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/hdf5-1.8.23-2l37bduu2kjsgmhjxbfdgchsha2di2of/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/zlib-ng-2.1.5-jtmqc4b5fqadcqbwagtun6kwe6geexbw/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/metis-5.1.0-hk6ipui6fnixwdyloqmqbsixqhtv5hxw/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/parmetis-4.0.3-hattuaxqypmcfeqr3nvedmojwbgiora2/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/mfem-4.6.0-hma2wvr5tv3fkry6kdqfxmtsnqg6fv4d/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/hypre-2.24.0-czbxd2tmdjbl7v4nwommsh7xgw7ewgla/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/py-jsonschema-2.6.0-scktpdojmezaljg2bxfbzmf5lx3nmwvc/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/raja-2024.02.0-v5ckygwjzmo7e2rts5qxwgfswhhpeqta/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/camp-2024.02.0-xyur27wnppnansskdldrlqyzormhcr4e/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/umpire-2024.02.0-4nxnup6vxwkwkinxdzzinkxul6vk2lsj/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/fmt-10.2.1-jltnp6nb3minlrrafmdenoakubdzom57/lib64;/usr/tce/backend/installations/linux-rhel8-x86_64/gcc-10.3.1/intel-oneapi-compilers-2022.1.0-43xp3r52jx2q2rkf3ctzvskqu572xbky/compiler/2022.1.0/linux/compiler/lib/intel64_lin;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/axom-develop-ma6pw2s3obh5afi3kvbgksqemjcs3ty7/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/axom-develop-ma6pw2s3obh5afi3kvbgksqemjcs3ty7/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/c2c-1.8.0-ovky3pniupirnys6mtf24ke5sb64mkbr/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/conduit-0.9.1-t745zbwmn5ffzo7whgwxmz5p5w2ym37z/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/hdf5-1.8.23-2l37bduu2kjsgmhjxbfdgchsha2di2of/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/zlib-ng-2.1.5-jtmqc4b5fqadcqbwagtun6kwe6geexbw/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/metis-5.1.0-hk6ipui6fnixwdyloqmqbsixqhtv5hxw/lib;/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/parmetis-4.0.3-hattuaxqypmcfeqr3nvedmojwbgiora2/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/mfem-4.6.0-hma2wvr5tv3fkry6kdqfxmtsnqg6fv4d/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/hypre-2.24.0-czbxd2tmdjbl7v4nwommsh7xgw7ewgla/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/py-jsonschema-2.6.0-scktpdojmezaljg2bxfbzmf5lx3nmwvc/lib;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/raja-2024.02.0-v5ckygwjzmo7e2rts5qxwgfswhhpeqta/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/camp-2024.02.0-xyur27wnppnansskdldrlqyzormhcr4e/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/umpire-2024.02.0-4nxnup6vxwkwkinxdzzinkxul6vk2lsj/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0/fmt-10.2.1-jltnp6nb3minlrrafmdenoakubdzom57/lib64;/usr/tce/backend/installations/linux-rhel8-x86_64/gcc-10.3.1/intel-oneapi-compilers-2022.1.0-43xp3r52jx2q2rkf3ctzvskqu572xbky/compiler/2022.1.0/linux/compiler/lib/intel64_lin;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") + +#------------------------------------------------------------------------------ +# Compilers +#------------------------------------------------------------------------------ +# Compiler Spec: intel@=2022.1.0 +#------------------------------------------------------------------------------ +if(DEFINED ENV{SPACK_CC}) + + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/intel/icc" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/intel/icpc" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/spack/lib/spack/env/intel/ifort" CACHE PATH "") + +else() + + set(CMAKE_C_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/icx" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/icpx" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/ifx" CACHE PATH "") + +endif() + +set(ENABLE_FORTRAN ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# MPI +#------------------------------------------------------------------------------ + +set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpicc" CACHE PATH "") + +set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpicxx" CACHE PATH "") + +set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpif90" CACHE PATH "") + +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") + +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Hardware +#------------------------------------------------------------------------------ + +#------------------------------------------------ +# Hardware Specifics +#------------------------------------------------ + +set(ENABLE_OPENMP ON CACHE BOOL "") + +set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# TPLs +#------------------------------------------------------------------------------ + +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2024_03_07_00_00_58/intel-2022.1.0" CACHE PATH "") + +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-t745zbwmn5ffzo7whgwxmz5p5w2ym37z" CACHE PATH "") + +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-ovky3pniupirnys6mtf24ke5sb64mkbr" CACHE PATH "") + +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-hma2wvr5tv3fkry6kdqfxmtsnqg6fv4d" CACHE PATH "") + +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-2l37bduu2kjsgmhjxbfdgchsha2di2of" CACHE PATH "") + +set(LUA_DIR "/usr" CACHE PATH "") + +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-v5ckygwjzmo7e2rts5qxwgfswhhpeqta" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-4nxnup6vxwkwkinxdzzinkxul6vk2lsj" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-xyur27wnppnansskdldrlqyzormhcr4e" CACHE PATH "") + +# scr not built + +#------------------------------------------------------------------------------ +# Devtools +#------------------------------------------------------------------------------ + +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") + +set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") + +set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/python3.10" CACHE PATH "") + +set(JSONSCHEMA_EXECUTABLE "${TPL_ROOT}/py-jsonschema-2.6.0-scktpdojmezaljg2bxfbzmf5lx3nmwvc/bin/jsonschema" CACHE PATH "") + +set(ENABLE_DOCS ON CACHE BOOL "") + +set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") + +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") + +set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") + +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") + + diff --git a/host-configs/rzvernal-toss_4_x86_64_ib_cray-cce@15.0.1_hip.cmake b/host-configs/rzvernal-toss_4_x86_64_ib_cray-cce@15.0.1_hip.cmake index ffac9bee7c..5d6731bb92 100644 --- a/host-configs/rzvernal-toss_4_x86_64_ib_cray-cce@15.0.1_hip.cmake +++ b/host-configs/rzvernal-toss_4_x86_64_ib_cray-cce@15.0.1_hip.cmake @@ -37,7 +37,7 @@ set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") set(ENABLE_FORTRAN ON CACHE BOOL "") -set(CMAKE_CXX_FLAGS "-O1" CACHE STRING "") +set(CMAKE_CXX_FLAGS_DEBUG "-O1 -g -DNDEBUG" CACHE STRING "") #------------------------------------------------------------------------------ # MPI diff --git a/host-configs/rzvernal-toss_4_x86_64_ib_cray-clang@16.0.0_hip.cmake b/host-configs/rzvernal-toss_4_x86_64_ib_cray-clang@16.0.0_hip.cmake index ab32c1faba..2feecca36c 100644 --- a/host-configs/rzvernal-toss_4_x86_64_ib_cray-clang@16.0.0_hip.cmake +++ b/host-configs/rzvernal-toss_4_x86_64_ib_cray-clang@16.0.0_hip.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/umpire-2023.06.0-yeccv6q7zasapkqmulwukmay2xfq5hyu;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/raja-2023.06.0-7y7neucz73mp5aidhw7kfbmqhwgsr4ww;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/camp-2023.06.0-zu25serllpaiepsclsd3o7w4clj5k2bs;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/mfem-4.5.2-znyrzghqsshldarhqa6gweqgukahiyjw;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/hypre-2.24.0-hodcjhfvx7c6fupyaw5kgoiuazbxcaij;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/lua-5.4.4-j446jxtxyu4x2byxkcvzv4ek4w5pr3fh;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/ncurses-6.4-sqvzpcbeunczs72a55mzrqi7rpl7aojx;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/conduit-0.8.8-nexjzr5p6zy3lb7kbkojaqbmvn64bwnf;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/parmetis-4.0.3-l3yx62tarv37nnultafaw2q7yows6c22;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/metis-5.1.0-gwyy4vhrzd77gbdxd4thjxtxwrjads4l;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/hdf5-1.8.22-gph5gvans7w7rhb3acho7c3yydyxbck6;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/c2c-1.8.0-oht7wdi5u5r4zlf7mcdk36xcuvt3y5j7;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0/blt-0.5.3-no74mmcw3sf324mpvpdzlu57kmg2xwby;/opt/rocm-5.6.0;/opt/rocm-5.6.0/llvm;/opt/rocm-5.6.0;/opt/rocm-5.6.0/hip;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.6.0;/usr/tce" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/umpire-2024.02.0-rjjfznegq3beeahbio7h4voasmljpnef;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/raja-2024.02.0-2i63uxx4gs2hv6bseeo53vnvpqxvq53a;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/camp-2024.02.0-z6vcrbxgnq44voxaiplbkss7xkeuezam;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/mfem-4.6.0-rqn67zhr6wo6mgcfqjrb3kzzh4neg52v;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/hypre-2.24.0-ki5iqwndtm6rvb4nrb7ebbvl3x24q3vt;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/lua-5.4.4-k44ecokhewutosgyh3v4ifqejiqxxkwk;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/conduit-0.9.1-weyusx6lu3gczfg24vwaji4dy53ekfc5;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/parmetis-4.0.3-ll2czqc5pmp3olgjpu47krq4jgxksmdt;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/hdf5-1.8.23-iuu6knfssyy4j2uv6qo7oqmm2afqw5jv;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/blt-0.6.1.4-rsolo2redxjrxxepfboqczt24wsewi2r;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/fmt-10.2.1-nr2acfkfdgyihxps6ekcgfn4fk56v5rb;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/zlib-ng-2.1.5-c4toe533t23gocizsqebzf4s662hyxlt;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/metis-5.1.0-rjek5dokihv3f6afzrhphjgg6xcjrfvk;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/ncurses-6.4-ezqmnqki7vits7vrigam3pwcidzycnny;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/c2c-1.8.0-fg73ebtjbsm2kpd5s44vxa6jjsybwbbb;/opt/rocm-5.6.0/llvm;/opt/rocm-5.6.0;/opt/rocm-5.6.0/hip;/opt/rocm-5.6.0;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.6.0;/usr/tce" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/axom-develop-uidv2vofjqx7373o6tz53up2jxpgkev4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/axom-develop-uidv2vofjqx7373o6tz53up2jxpgkev4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/c2c-1.8.0-fg73ebtjbsm2kpd5s44vxa6jjsybwbbb/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/conduit-0.9.1-weyusx6lu3gczfg24vwaji4dy53ekfc5/lib;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.6.0/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/hdf5-1.8.23-iuu6knfssyy4j2uv6qo7oqmm2afqw5jv/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/zlib-ng-2.1.5-c4toe533t23gocizsqebzf4s662hyxlt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/metis-5.1.0-rjek5dokihv3f6afzrhphjgg6xcjrfvk/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/parmetis-4.0.3-ll2czqc5pmp3olgjpu47krq4jgxksmdt/lib;/opt/rocm-5.6.0/hip/lib;/opt/rocm-5.6.0/lib;/opt/rocm-5.6.0/llvm/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/lua-5.4.4-k44ecokhewutosgyh3v4ifqejiqxxkwk/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/ncurses-6.4-ezqmnqki7vits7vrigam3pwcidzycnny/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/mfem-4.6.0-rqn67zhr6wo6mgcfqjrb3kzzh4neg52v/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/hypre-2.24.0-ki5iqwndtm6rvb4nrb7ebbvl3x24q3vt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/raja-2024.02.0-2i63uxx4gs2hv6bseeo53vnvpqxvq53a/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/camp-2024.02.0-z6vcrbxgnq44voxaiplbkss7xkeuezam/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/umpire-2024.02.0-rjjfznegq3beeahbio7h4voasmljpnef/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/fmt-10.2.1-nr2acfkfdgyihxps6ekcgfn4fk56v5rb/lib64;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/axom-develop-uidv2vofjqx7373o6tz53up2jxpgkev4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/axom-develop-uidv2vofjqx7373o6tz53up2jxpgkev4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/c2c-1.8.0-fg73ebtjbsm2kpd5s44vxa6jjsybwbbb/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/conduit-0.9.1-weyusx6lu3gczfg24vwaji4dy53ekfc5/lib;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.6.0/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/hdf5-1.8.23-iuu6knfssyy4j2uv6qo7oqmm2afqw5jv/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/zlib-ng-2.1.5-c4toe533t23gocizsqebzf4s662hyxlt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/metis-5.1.0-rjek5dokihv3f6afzrhphjgg6xcjrfvk/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/parmetis-4.0.3-ll2czqc5pmp3olgjpu47krq4jgxksmdt/lib;/opt/rocm-5.6.0/hip/lib;/opt/rocm-5.6.0/lib;/opt/rocm-5.6.0/llvm/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/lua-5.4.4-k44ecokhewutosgyh3v4ifqejiqxxkwk/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/ncurses-6.4-ezqmnqki7vits7vrigam3pwcidzycnny/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/mfem-4.6.0-rqn67zhr6wo6mgcfqjrb3kzzh4neg52v/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/hypre-2.24.0-ki5iqwndtm6rvb4nrb7ebbvl3x24q3vt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/raja-2024.02.0-2i63uxx4gs2hv6bseeo53vnvpqxvq53a/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/camp-2024.02.0-z6vcrbxgnq44voxaiplbkss7xkeuezam/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/umpire-2024.02.0-rjjfznegq3beeahbio7h4voasmljpnef/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0/fmt-10.2.1-nr2acfkfdgyihxps6ekcgfn4fk56v5rb/lib64;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -33,11 +39,9 @@ endif() set(CMAKE_Fortran_FLAGS "-Mfreeform" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") -set(CMAKE_CXX_FLAGS "-O1" CACHE STRING "") +set(CMAKE_CXX_FLAGS_DEBUG "-O1 -g -DNDEBUG" CACHE STRING "") #------------------------------------------------------------------------------ # MPI @@ -67,6 +71,8 @@ set(HIP_ROOT_DIR "/opt/rocm-5.6.0/hip" CACHE PATH "") set(HIP_CXX_COMPILER "/opt/rocm-5.6.0/hip/bin/hipcc" CACHE PATH "") +set(CMAKE_HIP_COMPILER "/opt/rocm-5.6.0/llvm/bin/clang++" CACHE FILEPATH "") + set(CMAKE_HIP_ARCHITECTURES "gfx90a" CACHE STRING "") set(AMDGPU_TARGETS "gfx90a" CACHE STRING "") @@ -98,23 +104,23 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_18_12_45/clang-16.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_07_00_03_21/clang-16.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-nexjzr5p6zy3lb7kbkojaqbmvn64bwnf" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-weyusx6lu3gczfg24vwaji4dy53ekfc5" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-oht7wdi5u5r4zlf7mcdk36xcuvt3y5j7" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-fg73ebtjbsm2kpd5s44vxa6jjsybwbbb" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-znyrzghqsshldarhqa6gweqgukahiyjw" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-rqn67zhr6wo6mgcfqjrb3kzzh4neg52v" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-gph5gvans7w7rhb3acho7c3yydyxbck6" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-iuu6knfssyy4j2uv6qo7oqmm2afqw5jv" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-j446jxtxyu4x2byxkcvzv4ek4w5pr3fh" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-k44ecokhewutosgyh3v4ifqejiqxxkwk" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-7y7neucz73mp5aidhw7kfbmqhwgsr4ww" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-2i63uxx4gs2hv6bseeo53vnvpqxvq53a" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-yeccv6q7zasapkqmulwukmay2xfq5hyu" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-rjjfznegq3beeahbio7h4voasmljpnef" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-zu25serllpaiepsclsd3o7w4clj5k2bs" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-z6vcrbxgnq44voxaiplbkss7xkeuezam" CACHE PATH "") # scr not built diff --git a/host-configs/rzwhippet-toss_4_x86_64_ib-clang@14.0.6.cmake b/host-configs/rzwhippet-toss_4_x86_64_ib-clang@14.0.6.cmake index 8020c21cb5..fe5c49492b 100644 --- a/host-configs/rzwhippet-toss_4_x86_64_ib-clang@14.0.6.cmake +++ b/host-configs/rzwhippet-toss_4_x86_64_ib-clang@14.0.6.cmake @@ -4,7 +4,7 @@ # CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/umpire-2022.10.0-uodpwwx6coxrf3isbzabbolovpq7umem;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/raja-2022.10.5-b77ownnc7eiwf34g76faw47gcxzrp6p2;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/camp-2022.10.1-vgacotbv33odgskjpihdzflygusbjcp2;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/mfem-4.5.2-lwet4c3edrdvipij3r4itukmse2jklvy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/hypre-2.24.0-bwh42bebp4hiuwzlwcthpgkawape6dp3;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/conduit-0.8.8-inqrhwboacvngevqbvavhpisx4aeqpvy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/parmetis-4.0.3-jthqwflsj5bpe6onwsb5r2zi5wbx6pq4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/metis-5.1.0-imzig3eih3itpztvvk4yildzgq6aeelo;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/hdf5-1.8.22-5mfm2r7fo5krpj7vvmayz24qksnluryl;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/c2c-1.8.0-5smd5ktj7yjc2egeyum4t5vlwmw3jktt;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/gmake-4.4.1-6lgy76r7dbvqm6mbwb2jkpcuycf7tb27;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6/blt-0.5.3-xa3bmu75nkolqiewb5ftk5tp2jpzw57n;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-clang-14.0.6;/usr/tce/packages/clang/clang-14.0.6" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/umpire-2023.06.0-ubadmsj3l2zavunhkkt7nxevkpmssdvy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/scr-3.0.1-5edtc4k2wstti2dh4kp2tno7rmwr3lyd;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/spath-0.2.0-gvlnzegcdph7ien3w4tjcxevblf2xe4r;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/libyogrt-1.33-3joihut3xh67qmtalrqadzujfzxwpodj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/er-0.2.0-befo66qsdjjulpnhaxvhk4uil45ynd6u;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/shuffile-0.2.0-j5blkpa2h3keb562qb5pdnfiuzyaecfd;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/redset-0.2.0-tllpyzklkik7oa32us3tigl7vdvil42o;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/rankstr-0.1.0-jkgwo3kyvegaapdtm67mg4aknu44foyn;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/dtcmp-1.1.4-u376uqcnt3y7ebu5ocfvk7bovkr2febv;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/lwgrp-1.0.5-am6sfml4trdhzlds365vbepezgdvdocz;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/axl-0.7.1-t7yboywzjziqb3hbgidynhbk5vd33jc7;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/kvtree-1.3.0-4zcbvvaqpbkdt7xc4pbu7urlkdywjjd7;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/raja-2023.06.0-55ypap77cpmjgq24vaquanhsshjm3gqh;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/camp-2023.06.0-e6mknahsrmbbifbfv3umemetvqzoh3he;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/mfem-4.5.2-lwet4c3edrdvipij3r4itukmse2jklvy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/hypre-2.24.0-bwh42bebp4hiuwzlwcthpgkawape6dp3;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/conduit-0.8.8-inqrhwboacvngevqbvavhpisx4aeqpvy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/parmetis-4.0.3-jthqwflsj5bpe6onwsb5r2zi5wbx6pq4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/metis-5.1.0-imzig3eih3itpztvvk4yildzgq6aeelo;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/hdf5-1.8.22-5mfm2r7fo5krpj7vvmayz24qksnluryl;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/c2c-1.8.0-5smd5ktj7yjc2egeyum4t5vlwmw3jktt;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/gmake-4.4.1-6lgy76r7dbvqm6mbwb2jkpcuycf7tb27;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6/blt-0.5.3-xa3bmu75nkolqiewb5ftk5tp2jpzw57n;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-clang-14.0.6;/usr/tce/packages/clang/clang-14.0.6" CACHE PATH "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +15,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -47,12 +47,12 @@ set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/bin set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6/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 "") +set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") + #------------------------------------------------------------------------------ # Hardware #------------------------------------------------------------------------------ @@ -69,7 +69,7 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/clang-14.0.6" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/clang-14.0.6" CACHE PATH "") set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-inqrhwboacvngevqbvavhpisx4aeqpvy" CACHE PATH "") @@ -81,19 +81,39 @@ set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-5mfm2r7fo5krpj7vvmayz24qksnluryl" CACHE PA set(LUA_DIR "/usr" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2022.10.5-b77ownnc7eiwf34g76faw47gcxzrp6p2" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-55ypap77cpmjgq24vaquanhsshjm3gqh" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-ubadmsj3l2zavunhkkt7nxevkpmssdvy" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-e6mknahsrmbbifbfv3umemetvqzoh3he" CACHE PATH "") + +set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-5edtc4k2wstti2dh4kp2tno7rmwr3lyd" CACHE PATH "") + +set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-4zcbvvaqpbkdt7xc4pbu7urlkdywjjd7" CACHE PATH "") + +set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-u376uqcnt3y7ebu5ocfvk7bovkr2febv" CACHE PATH "") + +set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-gvlnzegcdph7ien3w4tjcxevblf2xe4r" CACHE PATH "") + +set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-t7yboywzjziqb3hbgidynhbk5vd33jc7" CACHE PATH "") + +set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-am6sfml4trdhzlds365vbepezgdvdocz" CACHE PATH "") + +set(ER_DIR "${TPL_ROOT}/er-0.2.0-befo66qsdjjulpnhaxvhk4uil45ynd6u" CACHE PATH "") + +set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-jkgwo3kyvegaapdtm67mg4aknu44foyn" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2022.10.0-uodpwwx6coxrf3isbzabbolovpq7umem" CACHE PATH "") +set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-tllpyzklkik7oa32us3tigl7vdvil42o" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2022.10.1-vgacotbv33odgskjpihdzflygusbjcp2" CACHE PATH "") +set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-j5blkpa2h3keb562qb5pdnfiuzyaecfd" CACHE PATH "") -# scr not built +set(LIBYOGRT_DIR "${TPL_ROOT}/libyogrt-1.33-3joihut3xh67qmtalrqadzujfzxwpodj" CACHE PATH "") #------------------------------------------------------------------------------ # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_05_18_11_52_05/._view/btoxy5ovdbouub2brzxcmjwzdhvzatlc" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") @@ -103,10 +123,10 @@ set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/rzwhippet-toss_4_x86_64_ib-gcc@10.3.1.cmake b/host-configs/rzwhippet-toss_4_x86_64_ib-gcc@10.3.1.cmake index dc41f1ea22..9a90dd375b 100644 --- a/host-configs/rzwhippet-toss_4_x86_64_ib-gcc@10.3.1.cmake +++ b/host-configs/rzwhippet-toss_4_x86_64_ib-gcc@10.3.1.cmake @@ -4,7 +4,7 @@ # CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/umpire-2022.10.0-qnxnt3o54jhszr4d4qjliewtek4w5dqf;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/raja-2022.10.5-emvpcryyxpdsitaoke4uksoqup5sfxjr;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/camp-2022.10.1-ecm3kxkv7wdg4mttgiwmhhanwbjyxq3l;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/mfem-4.5.2-uyempb4k6nefxh36lxnbfb2dynpyaezr;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/hypre-2.24.0-lof7hdy7wsyuei436d6uhilprsgmr3ik;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/conduit-0.8.8-wngwwhpllk2gjewlizsk4plakvdu4beu;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/parmetis-4.0.3-lq6aryhur6qn3trc2qxizvz4nae5ngzf;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/metis-5.1.0-pyrzcrzqvl6q27kk637o2nwi3j7ibseb;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/hdf5-1.8.22-wikz2sxdo4zf76fdfl5do4mekkixf4yv;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/c2c-1.8.0-bsohtsh5a73tmmxlndgjuhzz6lzoif5j;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/gmake-4.4.1-y2kaxrqjbg3dcwo7dzfphztusfjqoowq;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1/blt-0.5.3-iljv7wrfi4r5i4drs4yf65rgsuunaxjn;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.8.14;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-10.3.1" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/umpire-2023.06.0-z2ts74flz56i67azbbp5zyiwvwgwucrr;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/scr-3.0.1-znr5hvdmrpg2wwtcrepv3bzh32visddj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/spath-0.2.0-scp7lun3jtdgorfmd4mzhtieqkjko57q;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/libyogrt-1.33-riegwpsbfjywz6pumvit2eadroiosowy;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/er-0.2.0-m7mypt2brwrodmfun3ya2cwpkuwpccnv;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/shuffile-0.2.0-74ysb2qi6xkrx7u5vsa2jnmcqof3q4je;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/redset-0.2.0-7bhg5tua2jns5ob7r6stbgitzlfggdax;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/rankstr-0.1.0-yuunbkeetjd4y563p4dzxp23rsdcc6tr;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/dtcmp-1.1.4-bk55ioptacxzxnpxcgu27vwk2nacb35s;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/lwgrp-1.0.5-zhpxnopjtpr5cchaqufivi2sn4crkgwn;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/axl-0.7.1-b3zz33f7lmeal5thbfyuc6cmbdfek2vv;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/kvtree-1.3.0-oeqjobwdjxemywgc77pfuv4nnpxk6buj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/raja-2023.06.0-ca64lzglcihqwwjcmxuzfdvg7bhsd5rq;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/camp-2023.06.0-k4v6kc3zhnika36o2jvhncwiwcaifxqp;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/mfem-4.5.2-uyempb4k6nefxh36lxnbfb2dynpyaezr;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/hypre-2.24.0-lof7hdy7wsyuei436d6uhilprsgmr3ik;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/conduit-0.8.8-wngwwhpllk2gjewlizsk4plakvdu4beu;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/parmetis-4.0.3-lq6aryhur6qn3trc2qxizvz4nae5ngzf;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/metis-5.1.0-pyrzcrzqvl6q27kk637o2nwi3j7ibseb;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/hdf5-1.8.22-wikz2sxdo4zf76fdfl5do4mekkixf4yv;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/c2c-1.8.0-bsohtsh5a73tmmxlndgjuhzz6lzoif5j;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/gmake-4.4.1-y2kaxrqjbg3dcwo7dzfphztusfjqoowq;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1/blt-0.5.3-iljv7wrfi4r5i4drs4yf65rgsuunaxjn;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1;/usr/tce;/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-10.3.1" CACHE PATH "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +15,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -45,12 +45,12 @@ set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/bin/m set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1/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 "") +set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") + #------------------------------------------------------------------------------ # Hardware #------------------------------------------------------------------------------ @@ -67,7 +67,7 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_07_13_22_05_10/gcc-10.3.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/gcc-10.3.1" CACHE PATH "") set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-wngwwhpllk2gjewlizsk4plakvdu4beu" CACHE PATH "") @@ -79,19 +79,39 @@ set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-wikz2sxdo4zf76fdfl5do4mekkixf4yv" CACHE PA set(LUA_DIR "/usr" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2022.10.5-emvpcryyxpdsitaoke4uksoqup5sfxjr" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-ca64lzglcihqwwjcmxuzfdvg7bhsd5rq" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-z2ts74flz56i67azbbp5zyiwvwgwucrr" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-k4v6kc3zhnika36o2jvhncwiwcaifxqp" CACHE PATH "") + +set(SCR_DIR "${TPL_ROOT}/scr-3.0.1-znr5hvdmrpg2wwtcrepv3bzh32visddj" CACHE PATH "") + +set(KVTREE_DIR "${TPL_ROOT}/kvtree-1.3.0-oeqjobwdjxemywgc77pfuv4nnpxk6buj" CACHE PATH "") + +set(DTCMP_DIR "${TPL_ROOT}/dtcmp-1.1.4-bk55ioptacxzxnpxcgu27vwk2nacb35s" CACHE PATH "") + +set(SPATH_DIR "${TPL_ROOT}/spath-0.2.0-scp7lun3jtdgorfmd4mzhtieqkjko57q" CACHE PATH "") + +set(AXL_DIR "${TPL_ROOT}/axl-0.7.1-b3zz33f7lmeal5thbfyuc6cmbdfek2vv" CACHE PATH "") + +set(LWGRP_DIR "${TPL_ROOT}/lwgrp-1.0.5-zhpxnopjtpr5cchaqufivi2sn4crkgwn" CACHE PATH "") + +set(ER_DIR "${TPL_ROOT}/er-0.2.0-m7mypt2brwrodmfun3ya2cwpkuwpccnv" CACHE PATH "") + +set(RANKSTR_DIR "${TPL_ROOT}/rankstr-0.1.0-yuunbkeetjd4y563p4dzxp23rsdcc6tr" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2022.10.0-qnxnt3o54jhszr4d4qjliewtek4w5dqf" CACHE PATH "") +set(REDSET_DIR "${TPL_ROOT}/redset-0.2.0-7bhg5tua2jns5ob7r6stbgitzlfggdax" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2022.10.1-ecm3kxkv7wdg4mttgiwmhhanwbjyxq3l" CACHE PATH "") +set(SHUFFILE_DIR "${TPL_ROOT}/shuffile-0.2.0-74ysb2qi6xkrx7u5vsa2jnmcqof3q4je" CACHE PATH "") -# scr not built +set(LIBYOGRT_DIR "${TPL_ROOT}/libyogrt-1.33-riegwpsbfjywz6pumvit2eadroiosowy" CACHE PATH "") #------------------------------------------------------------------------------ # Devtools #------------------------------------------------------------------------------ -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_05_18_11_52_05/._view/btoxy5ovdbouub2brzxcmjwzdhvzatlc" CACHE PATH "") +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") @@ -101,10 +121,10 @@ set(ENABLE_DOCS ON CACHE BOOL "") set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/shroud" CACHE PATH "") +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") diff --git a/host-configs/rzwhippet-toss_4_x86_64_ib-intel@2022.1.0.cmake b/host-configs/rzwhippet-toss_4_x86_64_ib-intel@2022.1.0.cmake new file mode 100644 index 0000000000..c492e852d9 --- /dev/null +++ b/host-configs/rzwhippet-toss_4_x86_64_ib-intel@2022.1.0.cmake @@ -0,0 +1,110 @@ +#------------------------------------------------------------------------------ +# !!!! This is a generated file, edit at own risk !!!! +#------------------------------------------------------------------------------ +# CMake executable path: /usr/tce/bin/cmake +#------------------------------------------------------------------------------ + +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/umpire-2023.06.0-6wmifjy5c2er4kkfqw7m5s4in7esiln5;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/raja-2023.06.0-urtfojwbjummyvyev7k4zn2oix53f4up;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/camp-2023.06.0-ovewmmz43udq34jrdlokh2zuzgkzrum4;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/mfem-4.5.2-dbvjel6jhwnwf6wzm76w6ghbjpy3v4gj;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/hypre-2.24.0-qdjyl5ibcpl4nxb6t5godfgvi5bb6hac;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/conduit-0.8.8-22refnw4twba4zznewcuczky2udimj7i;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/parmetis-4.0.3-nqxoj5gqogj32hfo5ognkcb6vg24zdlc;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/metis-5.1.0-tb5bijmooj2d6d2npjpajcj4fyu4yd4y;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/hdf5-1.8.22-6oeginq7kyyix35utjgsfxeghcnujtpg;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/c2c-1.8.0-gvlftgplgmtput3k4fy2nssecldmmlsa;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/gmake-4.4.1-e3r4ry6vgi7zp4mbwfokypkutqwpctek;/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0/blt-0.5.3-i7qltms7ksyz4xltznzbtsafywrykq7b;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6;/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9;/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0;/usr/tce" CACHE PATH "") + +set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") + +#------------------------------------------------------------------------------ +# Compilers +#------------------------------------------------------------------------------ +# Compiler Spec: intel@=2022.1.0 +#------------------------------------------------------------------------------ +if(DEFINED ENV{SPACK_CC}) + + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/intel/icc" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/intel/icpc" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/spack/lib/spack/env/intel/ifort" CACHE PATH "") + +else() + + set(CMAKE_C_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/icx" CACHE PATH "") + + set(CMAKE_CXX_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/icpx" CACHE PATH "") + + set(CMAKE_Fortran_COMPILER "/usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/ifx" CACHE PATH "") + +endif() + +set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") + +set(ENABLE_FORTRAN ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# MPI +#------------------------------------------------------------------------------ + +set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpicc" CACHE PATH "") + +set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpicxx" CACHE PATH "") + +set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0/bin/mpif90" CACHE PATH "") + +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") + +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Hardware +#------------------------------------------------------------------------------ + +#------------------------------------------------ +# Hardware Specifics +#------------------------------------------------ + +set(ENABLE_OPENMP ON CACHE BOOL "") + +set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") + +#------------------------------------------------------------------------------ +# TPLs +#------------------------------------------------------------------------------ + +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib/2023_10_30_15_05_41/intel-2022.1.0" CACHE PATH "") + +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-22refnw4twba4zznewcuczky2udimj7i" CACHE PATH "") + +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-gvlftgplgmtput3k4fy2nssecldmmlsa" CACHE PATH "") + +set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-dbvjel6jhwnwf6wzm76w6ghbjpy3v4gj" CACHE PATH "") + +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-6oeginq7kyyix35utjgsfxeghcnujtpg" CACHE PATH "") + +set(LUA_DIR "/usr" CACHE PATH "") + +set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-urtfojwbjummyvyev7k4zn2oix53f4up" CACHE PATH "") + +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-6wmifjy5c2er4kkfqw7m5s4in7esiln5" CACHE PATH "") + +set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-ovewmmz43udq34jrdlokh2zuzgkzrum4" CACHE PATH "") + +# scr not built + +#------------------------------------------------------------------------------ +# Devtools +#------------------------------------------------------------------------------ + +set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/2023_10_17_16_15_32/._view/ypfidjpdm7fhkqcpekza67w5xgiaw7yg" CACHE PATH "") + +set(CLANGFORMAT_EXECUTABLE "/collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0/bin/clang-format" CACHE PATH "") + +set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/python3.10" CACHE PATH "") + +set(ENABLE_DOCS ON CACHE BOOL "") + +set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.10.10/bin/sphinx-build" CACHE PATH "") + +set(SHROUD_EXECUTABLE "/collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0/bin/shroud" CACHE PATH "") + +set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-2.9/bin/cppcheck" CACHE PATH "") + +set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.9.6/bin/doxygen" CACHE PATH "") + + diff --git a/host-configs/tioga-toss_4_x86_64_ib_cray-cce@15.0.1_hip.cmake b/host-configs/tioga-toss_4_x86_64_ib_cray-cce@15.0.1_hip.cmake deleted file mode 100644 index 5054698ed3..0000000000 --- a/host-configs/tioga-toss_4_x86_64_ib_cray-cce@15.0.1_hip.cmake +++ /dev/null @@ -1,133 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/bin/cmake -#------------------------------------------------------------------------------ - -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/umpire-2023.06.0-znpux7jjwwb3gb2hr4vi6nbhyrkfo5mo;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/raja-2023.06.0-ovzqujoxykloaaitzbtkg6egqp6qjr2v;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/camp-2023.06.0-nsepimnez7uuv3dxqiji2twih3swa6cr;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/mfem-4.5.2-7rrla6up5iou2fic4riu776n4isvt4wf;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/hypre-2.24.0-ci2qpkdifjovd7ki22dscgl6goyjefai;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/lua-5.4.4-gduannh2dcxphs7odrtkrpnmabgcikom;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/ncurses-6.4-cnq7lljngizvsdryq3csevc3tbh4k7vh;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/conduit-0.8.8-w5ybmdn2qvfbkooexazuzxnmvyc4zfyl;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/parmetis-4.0.3-u2udk5n4552zcftdccg5ol33mtulfq2i;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/metis-5.1.0-lssxpp454fp6c4fbcl2d6rwugzcrpgvm;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/hdf5-1.8.22-uvl6nsaahk6vl3mvoq6a432lontoo6zv;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/c2c-1.8.0-drh2lcdrfn627tcfkocetim7snaakicw;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1/blt-0.5.3-xxkf276amm4zj5wm5dx44clspivj42vx;/opt/rocm-5.4.3;/opt/rocm-5.4.3/llvm;/opt/rocm-5.4.3;/opt/rocm-5.4.3/hip;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.4.3-cce-15.0.1;/usr/tce" CACHE PATH "") - -set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: cce@=15.0.1 -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/cce/craycc" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/cce/case-insensitive/crayCC" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/cce/crayftn" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/cce-tce/cce-15.0.1/bin/craycc" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/cce-tce/cce-15.0.1/bin/crayCC" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/tce/packages/cce-tce/cce-15.0.1/bin/crayftn" CACHE PATH "") - -endif() - -set(CMAKE_Fortran_FLAGS "-ef" CACHE STRING "") - -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -set(CMAKE_CXX_FLAGS "-O1" CACHE STRING "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.4.3-cce-15.0.1/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.4.3-cce-15.0.1/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.4.3-cce-15.0.1/bin/mpif90" CACHE PATH "") - -set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") - -set(ENABLE_MPI ON CACHE BOOL "") - -set(MPIEXEC_EXECUTABLE "/usr/global/tools/flux_wrappers/bin/srun" CACHE PATH "") - -#------------------------------------------------------------------------------ -# Hardware -#------------------------------------------------------------------------------ - -#------------------------------------------------ -# ROCm -#------------------------------------------------ - -set(HIP_ROOT_DIR "/opt/rocm-5.4.3/hip" CACHE PATH "") - -set(HIP_CXX_COMPILER "/opt/rocm-5.4.3/hip/bin/hipcc" CACHE PATH "") - -set(CMAKE_HIP_ARCHITECTURES "gfx90a" CACHE STRING "") - -set(AMDGPU_TARGETS "gfx90a" CACHE STRING "") - -set(GPU_TARGETS "gfx90a" CACHE STRING "") - -#------------------------------------------------------------------------------ - -# Axom ROCm specifics - -#------------------------------------------------------------------------------ - - -set(ENABLE_HIP ON CACHE BOOL "") - -set(HIP_CLANG_INCLUDE_PATH "/opt/rocm-5.4.3/hip/../llvm/lib/clang/15.0.0/include" CACHE PATH "") - -set(BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE "unwind" CACHE STRING "") - -set(CMAKE_EXE_LINKER_FLAGS " -L/opt/rocm-5.4.3/hip/../lib64 -Wl,-rpath,/opt/rocm-5.4.3/hip/../lib64 -L/opt/rocm-5.4.3/hip/../lib -Wl,-rpath,/opt/rocm-5.4.3/hip/../lib -lamd_comgr -lhsa-runtime64 " CACHE STRING "") - -#------------------------------------------------ -# Hardware Specifics -#------------------------------------------------ - -set(ENABLE_OPENMP OFF CACHE BOOL "") - -set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# TPLs -#------------------------------------------------------------------------------ - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/cce-15.0.1" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-w5ybmdn2qvfbkooexazuzxnmvyc4zfyl" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-drh2lcdrfn627tcfkocetim7snaakicw" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-7rrla6up5iou2fic4riu776n4isvt4wf" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-uvl6nsaahk6vl3mvoq6a432lontoo6zv" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-gduannh2dcxphs7odrtkrpnmabgcikom" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-ovzqujoxykloaaitzbtkg6egqp6qjr2v" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-znpux7jjwwb3gb2hr4vi6nbhyrkfo5mo" CACHE PATH "") - -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-nsepimnez7uuv3dxqiji2twih3swa6cr" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -# ClangFormat disabled due to llvm and devtools not in spec - -set(ENABLE_CLANGFORMAT OFF CACHE BOOL "") - -set(ENABLE_DOCS OFF CACHE BOOL "") - - diff --git a/host-configs/tioga-toss_4_x86_64_ib_cray-clang@14.0.0_hip.cmake b/host-configs/tioga-toss_4_x86_64_ib_cray-clang@14.0.0_hip.cmake deleted file mode 100644 index 6c4968c3c7..0000000000 --- a/host-configs/tioga-toss_4_x86_64_ib_cray-clang@14.0.0_hip.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/bin/cmake -#------------------------------------------------------------------------------ - -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/umpire-2023.06.0-5shsoyik6cl37unfukgypuy5wq3xrf5d;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/raja-2023.06.0-mihlyyxgy5ksjvblaztoa7lernlfuq5c;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/camp-2023.06.0-kjnl6w2c7g7373mmyy6z2kmnvwqcjiat;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/mfem-4.5.2-z5scxsmafi5skftjzrszn2cgfg5smgxr;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/hypre-2.24.0-kirtgmu2tqj5qeewzcgwxekiw2mjjvnq;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/lua-5.4.4-s6rzmz2h2k53z53grnpe237uwwzr4nz3;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/ncurses-6.4-wwijdtdjzvmf4224vzbzcntupmetijri;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/conduit-0.8.8-2kuebxwabtkkcikcqclqytfllwm3qwhg;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/parmetis-4.0.3-g4rtt7uakthoyf32g4ug6nntsxsh3im3;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/metis-5.1.0-bhi2eebvzv5maenn2vbmxsr2ftlqqv5n;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/hdf5-1.8.22-fo5wthv72ys3e263kvxykonmixg2sxun;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/c2c-1.8.0-56n4sm5x4ecvwmdazemuqvikg5ngwdwf;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0/blt-0.5.3-2z65cg5imrjg7ktgft4ob5tgxg2cvn4f;/opt/rocm-5.2.3;/opt/rocm-5.2.3/llvm;/opt/rocm-5.2.3;/opt/rocm-5.2.3/hip;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.16-rocmcc-5.2.3;/usr/tce" CACHE PATH "") - -set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: clang@=14.0.0 -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/flang" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/opt/rocm-5.2.3/llvm/bin/amdclang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/opt/rocm-5.2.3/llvm/bin/amdclang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/opt/rocm-5.2.3/llvm/bin/amdflang" CACHE PATH "") - -endif() - -set(CMAKE_Fortran_FLAGS "-Mfreeform" CACHE STRING "") - -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.16-rocmcc-5.2.3/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.16-rocmcc-5.2.3/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.16-rocmcc-5.2.3/bin/mpif90" CACHE PATH "") - -set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") - -set(ENABLE_MPI ON CACHE BOOL "") - -set(MPIEXEC_EXECUTABLE "/usr/global/tools/flux_wrappers/bin/srun" CACHE PATH "") - -#------------------------------------------------------------------------------ -# Hardware -#------------------------------------------------------------------------------ - -#------------------------------------------------ -# ROCm -#------------------------------------------------ - -set(HIP_ROOT_DIR "/opt/rocm-5.2.3/hip" CACHE PATH "") - -set(HIP_CXX_COMPILER "/opt/rocm-5.2.3/hip/bin/hipcc" CACHE PATH "") - -set(CMAKE_HIP_ARCHITECTURES "gfx90a" CACHE STRING "") - -set(AMDGPU_TARGETS "gfx90a" CACHE STRING "") - -set(GPU_TARGETS "gfx90a" CACHE STRING "") - -#------------------------------------------------------------------------------ - -# Axom ROCm specifics - -#------------------------------------------------------------------------------ - - -set(ENABLE_HIP ON CACHE BOOL "") - -set(HIP_CLANG_INCLUDE_PATH "/opt/rocm-5.2.3/hip/../llvm/lib/clang/14.0.0/include" CACHE PATH "") - -set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags -L/opt/rocm-5.2.3/hip/../llvm/lib -L/opt/rocm-5.2.3/hip/lib -Wl,-rpath,/opt/rocm-5.2.3/hip/../llvm/lib:/opt/rocm-5.2.3/hip/lib -lpgmath -lflang -lflangrti -lompstub -lamdhip64 -L/opt/rocm-5.2.3/hip/../lib64 -Wl,-rpath,/opt/rocm-5.2.3/hip/../lib64 -L/opt/rocm-5.2.3/hip/../lib -Wl,-rpath,/opt/rocm-5.2.3/hip/../lib -lamd_comgr -lhsa-runtime64 " CACHE STRING "") - -#------------------------------------------------ -# Hardware Specifics -#------------------------------------------------ - -set(ENABLE_OPENMP OFF CACHE BOOL "") - -set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# TPLs -#------------------------------------------------------------------------------ - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-14.0.0" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-2kuebxwabtkkcikcqclqytfllwm3qwhg" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-56n4sm5x4ecvwmdazemuqvikg5ngwdwf" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-z5scxsmafi5skftjzrszn2cgfg5smgxr" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-fo5wthv72ys3e263kvxykonmixg2sxun" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-s6rzmz2h2k53z53grnpe237uwwzr4nz3" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-mihlyyxgy5ksjvblaztoa7lernlfuq5c" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-5shsoyik6cl37unfukgypuy5wq3xrf5d" CACHE PATH "") - -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-kjnl6w2c7g7373mmyy6z2kmnvwqcjiat" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -# ClangFormat disabled due to llvm and devtools not in spec - -set(ENABLE_CLANGFORMAT OFF CACHE BOOL "") - -set(ENABLE_DOCS OFF CACHE BOOL "") - - diff --git a/host-configs/tioga-toss_4_x86_64_ib_cray-clang@15.0.0_hip.cmake b/host-configs/tioga-toss_4_x86_64_ib_cray-clang@15.0.0_hip.cmake deleted file mode 100644 index 86e9fe071a..0000000000 --- a/host-configs/tioga-toss_4_x86_64_ib_cray-clang@15.0.0_hip.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/bin/cmake -#------------------------------------------------------------------------------ - -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/umpire-2023.06.0-qlza5hxkti4qhuvnywz6js5xwouogfq5;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/raja-2023.06.0-vcdxhm5vuta43rgiuayko2slnfksxf7f;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/camp-2023.06.0-lhl3jkmzbdahxa633diszo6r4drszuy6;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/mfem-4.5.2-qu3gj4kd7xsetoefz23bofifgyufllhi;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/hypre-2.24.0-qbm2npjkwsp4vryixh65wbi2vohvpvbv;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/lua-5.4.4-nciboohbuioaqb35wwibitzc3ypfjbvp;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/ncurses-6.4-aqfvdlf2fuogw7pvfsg33qvvsdskwxn3;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/conduit-0.8.8-hqffdgfu3fhgmjlctcuywp66hp5ldg7e;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/parmetis-4.0.3-22wxjkvf6g6l74z2ztuk3imydnmpi7gq;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/metis-5.1.0-i4fcjmmgu4qquorg5pjbuipwd7m3viy6;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/hdf5-1.8.22-eoxieadxuddhem2eot4dqfdj47xngqpj;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/c2c-1.8.0-da5avt3ikppaabh4do3vgximikvvsjhy;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0/blt-0.5.3-57fuyfjl4ksfli3zskcbvykyrwtrwfne;/opt/rocm-5.4.3;/opt/rocm-5.4.3/llvm;/opt/rocm-5.4.3;/opt/rocm-5.4.3/hip;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.4.3;/usr/tce" CACHE PATH "") - -set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: clang@=15.0.0 -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/flang" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/opt/rocm-5.4.3/llvm/bin/amdclang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/opt/rocm-5.4.3/llvm/bin/amdclang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/opt/rocm-5.4.3/llvm/bin/amdflang" CACHE PATH "") - -endif() - -set(CMAKE_Fortran_FLAGS "-Mfreeform" CACHE STRING "") - -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.4.3/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.4.3/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.4.3/bin/mpif90" CACHE PATH "") - -set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") - -set(ENABLE_MPI ON CACHE BOOL "") - -set(MPIEXEC_EXECUTABLE "/usr/global/tools/flux_wrappers/bin/srun" CACHE PATH "") - -#------------------------------------------------------------------------------ -# Hardware -#------------------------------------------------------------------------------ - -#------------------------------------------------ -# ROCm -#------------------------------------------------ - -set(HIP_ROOT_DIR "/opt/rocm-5.4.3/hip" CACHE PATH "") - -set(HIP_CXX_COMPILER "/opt/rocm-5.4.3/hip/bin/hipcc" CACHE PATH "") - -set(CMAKE_HIP_ARCHITECTURES "gfx90a" CACHE STRING "") - -set(AMDGPU_TARGETS "gfx90a" CACHE STRING "") - -set(GPU_TARGETS "gfx90a" CACHE STRING "") - -#------------------------------------------------------------------------------ - -# Axom ROCm specifics - -#------------------------------------------------------------------------------ - - -set(ENABLE_HIP ON CACHE BOOL "") - -set(HIP_CLANG_INCLUDE_PATH "/opt/rocm-5.4.3/hip/../llvm/lib/clang/15.0.0/include" CACHE PATH "") - -set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags -L/opt/rocm-5.4.3/hip/../llvm/lib -L/opt/rocm-5.4.3/hip/lib -Wl,-rpath,/opt/rocm-5.4.3/hip/../llvm/lib:/opt/rocm-5.4.3/hip/lib -lpgmath -lflang -lflangrti -lompstub -lamdhip64 -L/opt/rocm-5.4.3/hip/../lib64 -Wl,-rpath,/opt/rocm-5.4.3/hip/../lib64 -L/opt/rocm-5.4.3/hip/../lib -Wl,-rpath,/opt/rocm-5.4.3/hip/../lib -lamd_comgr -lhsa-runtime64 " CACHE STRING "") - -#------------------------------------------------ -# Hardware Specifics -#------------------------------------------------ - -set(ENABLE_OPENMP OFF CACHE BOOL "") - -set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# TPLs -#------------------------------------------------------------------------------ - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-15.0.0" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-hqffdgfu3fhgmjlctcuywp66hp5ldg7e" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-da5avt3ikppaabh4do3vgximikvvsjhy" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-qu3gj4kd7xsetoefz23bofifgyufllhi" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-eoxieadxuddhem2eot4dqfdj47xngqpj" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-nciboohbuioaqb35wwibitzc3ypfjbvp" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-vcdxhm5vuta43rgiuayko2slnfksxf7f" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-qlza5hxkti4qhuvnywz6js5xwouogfq5" CACHE PATH "") - -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-lhl3jkmzbdahxa633diszo6r4drszuy6" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -# ClangFormat disabled due to llvm and devtools not in spec - -set(ENABLE_CLANGFORMAT OFF CACHE BOOL "") - -set(ENABLE_DOCS OFF CACHE BOOL "") - - diff --git a/host-configs/tioga-toss_4_x86_64_ib_cray-clang@16.0.0_hip.cmake b/host-configs/tioga-toss_4_x86_64_ib_cray-clang@16.0.0_hip.cmake index bf5bdb292f..c64236a377 100644 --- a/host-configs/tioga-toss_4_x86_64_ib_cray-clang@16.0.0_hip.cmake +++ b/host-configs/tioga-toss_4_x86_64_ib_cray-clang@16.0.0_hip.cmake @@ -4,7 +4,13 @@ # CMake executable path: /usr/tce/bin/cmake #------------------------------------------------------------------------------ -set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/umpire-2023.06.0-yeccv6q7zasapkqmulwukmay2xfq5hyu;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/raja-2023.06.0-7y7neucz73mp5aidhw7kfbmqhwgsr4ww;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/camp-2023.06.0-zu25serllpaiepsclsd3o7w4clj5k2bs;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/mfem-4.5.2-znyrzghqsshldarhqa6gweqgukahiyjw;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/hypre-2.24.0-hodcjhfvx7c6fupyaw5kgoiuazbxcaij;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/lua-5.4.4-j446jxtxyu4x2byxkcvzv4ek4w5pr3fh;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/ncurses-6.4-sqvzpcbeunczs72a55mzrqi7rpl7aojx;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/conduit-0.8.8-nexjzr5p6zy3lb7kbkojaqbmvn64bwnf;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/parmetis-4.0.3-l3yx62tarv37nnultafaw2q7yows6c22;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/metis-5.1.0-gwyy4vhrzd77gbdxd4thjxtxwrjads4l;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/hdf5-1.8.22-gph5gvans7w7rhb3acho7c3yydyxbck6;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/c2c-1.8.0-oht7wdi5u5r4zlf7mcdk36xcuvt3y5j7;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0/blt-0.5.3-no74mmcw3sf324mpvpdzlu57kmg2xwby;/opt/rocm-5.6.0;/opt/rocm-5.6.0/llvm;/opt/rocm-5.6.0;/opt/rocm-5.6.0/hip;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.6.0;/usr/tce" CACHE PATH "") +set(CMAKE_PREFIX_PATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/umpire-2024.02.0-rjjfznegq3beeahbio7h4voasmljpnef;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/raja-2024.02.0-2i63uxx4gs2hv6bseeo53vnvpqxvq53a;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/camp-2024.02.0-z6vcrbxgnq44voxaiplbkss7xkeuezam;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/mfem-4.6.0-rqn67zhr6wo6mgcfqjrb3kzzh4neg52v;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/hypre-2.24.0-ki5iqwndtm6rvb4nrb7ebbvl3x24q3vt;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/lua-5.4.4-k44ecokhewutosgyh3v4ifqejiqxxkwk;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/conduit-0.9.1-weyusx6lu3gczfg24vwaji4dy53ekfc5;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/parmetis-4.0.3-ll2czqc5pmp3olgjpu47krq4jgxksmdt;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/hdf5-1.8.23-iuu6knfssyy4j2uv6qo7oqmm2afqw5jv;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/blt-0.6.1.4-rsolo2redxjrxxepfboqczt24wsewi2r;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/fmt-10.2.1-nr2acfkfdgyihxps6ekcgfn4fk56v5rb;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/zlib-ng-2.1.5-c4toe533t23gocizsqebzf4s662hyxlt;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/metis-5.1.0-rjek5dokihv3f6afzrhphjgg6xcjrfvk;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/ncurses-6.4-ezqmnqki7vits7vrigam3pwcidzycnny;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/c2c-1.8.0-fg73ebtjbsm2kpd5s44vxa6jjsybwbbb;/opt/rocm-5.6.0/llvm;/opt/rocm-5.6.0;/opt/rocm-5.6.0/hip;/opt/rocm-5.6.0;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.6.0;/usr/tce" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE STRING "") + +set(CMAKE_BUILD_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/axom-develop-uidv2vofjqx7373o6tz53up2jxpgkev4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/axom-develop-uidv2vofjqx7373o6tz53up2jxpgkev4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/c2c-1.8.0-fg73ebtjbsm2kpd5s44vxa6jjsybwbbb/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/conduit-0.9.1-weyusx6lu3gczfg24vwaji4dy53ekfc5/lib;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.6.0/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/hdf5-1.8.23-iuu6knfssyy4j2uv6qo7oqmm2afqw5jv/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/zlib-ng-2.1.5-c4toe533t23gocizsqebzf4s662hyxlt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/metis-5.1.0-rjek5dokihv3f6afzrhphjgg6xcjrfvk/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/parmetis-4.0.3-ll2czqc5pmp3olgjpu47krq4jgxksmdt/lib;/opt/rocm-5.6.0/hip/lib;/opt/rocm-5.6.0/lib;/opt/rocm-5.6.0/llvm/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/lua-5.4.4-k44ecokhewutosgyh3v4ifqejiqxxkwk/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/ncurses-6.4-ezqmnqki7vits7vrigam3pwcidzycnny/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/mfem-4.6.0-rqn67zhr6wo6mgcfqjrb3kzzh4neg52v/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/hypre-2.24.0-ki5iqwndtm6rvb4nrb7ebbvl3x24q3vt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/raja-2024.02.0-2i63uxx4gs2hv6bseeo53vnvpqxvq53a/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/camp-2024.02.0-z6vcrbxgnq44voxaiplbkss7xkeuezam/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/umpire-2024.02.0-rjjfznegq3beeahbio7h4voasmljpnef/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/fmt-10.2.1-nr2acfkfdgyihxps6ekcgfn4fk56v5rb/lib64;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") + +set(CMAKE_INSTALL_RPATH "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/axom-develop-uidv2vofjqx7373o6tz53up2jxpgkev4/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/axom-develop-uidv2vofjqx7373o6tz53up2jxpgkev4/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/c2c-1.8.0-fg73ebtjbsm2kpd5s44vxa6jjsybwbbb/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/conduit-0.9.1-weyusx6lu3gczfg24vwaji4dy53ekfc5/lib;/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.25-rocmcc-5.6.0/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/hdf5-1.8.23-iuu6knfssyy4j2uv6qo7oqmm2afqw5jv/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/zlib-ng-2.1.5-c4toe533t23gocizsqebzf4s662hyxlt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/metis-5.1.0-rjek5dokihv3f6afzrhphjgg6xcjrfvk/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/parmetis-4.0.3-ll2czqc5pmp3olgjpu47krq4jgxksmdt/lib;/opt/rocm-5.6.0/hip/lib;/opt/rocm-5.6.0/lib;/opt/rocm-5.6.0/llvm/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/lua-5.4.4-k44ecokhewutosgyh3v4ifqejiqxxkwk/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/ncurses-6.4-ezqmnqki7vits7vrigam3pwcidzycnny/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/mfem-4.6.0-rqn67zhr6wo6mgcfqjrb3kzzh4neg52v/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/hypre-2.24.0-ki5iqwndtm6rvb4nrb7ebbvl3x24q3vt/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/raja-2024.02.0-2i63uxx4gs2hv6bseeo53vnvpqxvq53a/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/camp-2024.02.0-z6vcrbxgnq44voxaiplbkss7xkeuezam/lib;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/umpire-2024.02.0-rjjfznegq3beeahbio7h4voasmljpnef/lib64;/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0/fmt-10.2.1-nr2acfkfdgyihxps6ekcgfn4fk56v5rb/lib64;/opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10" CACHE STRING "") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") @@ -15,11 +21,11 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -33,11 +39,9 @@ endif() set(CMAKE_Fortran_FLAGS "-Mfreeform" CACHE STRING "") -set(CMAKE_GENERATOR "Unix Makefiles" CACHE STRING "") - set(ENABLE_FORTRAN ON CACHE BOOL "") -set(CMAKE_CXX_FLAGS "-O1" CACHE STRING "") +set(CMAKE_CXX_FLAGS_DEBUG "-O1 -g -DNDEBUG" CACHE STRING "") #------------------------------------------------------------------------------ # MPI @@ -67,6 +71,8 @@ set(HIP_ROOT_DIR "/opt/rocm-5.6.0/hip" CACHE PATH "") set(HIP_CXX_COMPILER "/opt/rocm-5.6.0/hip/bin/hipcc" CACHE PATH "") +set(CMAKE_HIP_COMPILER "/opt/rocm-5.6.0/llvm/bin/clang++" CACHE FILEPATH "") + set(CMAKE_HIP_ARCHITECTURES "gfx90a" CACHE STRING "") set(AMDGPU_TARGETS "gfx90a" CACHE STRING "") @@ -98,23 +104,23 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # TPLs #------------------------------------------------------------------------------ -set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2023_07_26_17_41_54/clang-16.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_4_x86_64_ib_cray/2024_03_06_20_25_59/clang-16.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.8.8-nexjzr5p6zy3lb7kbkojaqbmvn64bwnf" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.9.1-weyusx6lu3gczfg24vwaji4dy53ekfc5" CACHE PATH "") -set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-oht7wdi5u5r4zlf7mcdk36xcuvt3y5j7" CACHE PATH "") +set(C2C_DIR "${TPL_ROOT}/c2c-1.8.0-fg73ebtjbsm2kpd5s44vxa6jjsybwbbb" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.5.2-znyrzghqsshldarhqa6gweqgukahiyjw" CACHE PATH "") +set(MFEM_DIR "${TPL_ROOT}/mfem-4.6.0-rqn67zhr6wo6mgcfqjrb3kzzh4neg52v" CACHE PATH "") -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22-gph5gvans7w7rhb3acho7c3yydyxbck6" CACHE PATH "") +set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.23-iuu6knfssyy4j2uv6qo7oqmm2afqw5jv" CACHE PATH "") -set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-j446jxtxyu4x2byxkcvzv4ek4w5pr3fh" CACHE PATH "") +set(LUA_DIR "${TPL_ROOT}/lua-5.4.4-k44ecokhewutosgyh3v4ifqejiqxxkwk" CACHE PATH "") -set(RAJA_DIR "${TPL_ROOT}/raja-2023.06.0-7y7neucz73mp5aidhw7kfbmqhwgsr4ww" CACHE PATH "") +set(RAJA_DIR "${TPL_ROOT}/raja-2024.02.0-2i63uxx4gs2hv6bseeo53vnvpqxvq53a" CACHE PATH "") -set(UMPIRE_DIR "${TPL_ROOT}/umpire-2023.06.0-yeccv6q7zasapkqmulwukmay2xfq5hyu" CACHE PATH "") +set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.02.0-rjjfznegq3beeahbio7h4voasmljpnef" CACHE PATH "") -set(CAMP_DIR "${TPL_ROOT}/camp-2023.06.0-zu25serllpaiepsclsd3o7w4clj5k2bs" CACHE PATH "") +set(CAMP_DIR "${TPL_ROOT}/camp-2024.02.0-z6vcrbxgnq44voxaiplbkss7xkeuezam" CACHE PATH "") # scr not built diff --git a/scripts/azure-pipelines/linux-build_and_test.sh b/scripts/azure-pipelines/linux-build_and_test.sh index 25b5ffc873..880f30fc79 100755 --- a/scripts/azure-pipelines/linux-build_and_test.sh +++ b/scripts/azure-pipelines/linux-build_and_test.sh @@ -1,6 +1,6 @@ #!/bin/bash ############################################################################## -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -33,9 +33,9 @@ if [[ "$DO_BUILD" == "yes" ]] ; then or_die cd build-$HOST_CONFIG-${BUILD_TYPE,,} echo "~~~~~~ BUILDING ~~~~~~~~" if [[ ${CMAKE_EXTRA_FLAGS} == *COVERAGE* ]] ; then - or_die make -j 10 + or_die make -j 8 else - or_die make -j 10 VERBOSE=1 + or_die make -j 8 VERBOSE=1 fi if [[ "${DO_TEST}" == "yes" ]] ; then echo "~~~~~~ RUNNING TESTS ~~~~~~~~" diff --git a/scripts/azure-pipelines/linux-check.sh b/scripts/azure-pipelines/linux-check.sh index 3bebcc3e97..94be36a049 100755 --- a/scripts/azure-pipelines/linux-check.sh +++ b/scripts/azure-pipelines/linux-check.sh @@ -1,6 +1,6 @@ #!/bin/bash ############################################################################## -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/copyrightPrepender.py b/scripts/copyrightPrepender.py index 88af8ada5b..8362a02014 100755 --- a/scripts/copyrightPrepender.py +++ b/scripts/copyrightPrepender.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -9,20 +9,18 @@ # # The script takes a directory and checks all files in the directory. # If the second line in the file does not match the copyright string, we add it. -# -# Modified from an initial script by P. Sinha import os import sys import argparse -axom_copyright_str = """// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +axom_copyright_str = """// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) \n\n""" -axom_copyright_begin_str = "Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and" +axom_copyright_begin_str = "Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and" def checkAndAddCopyrightHeader(filename, testOnly=False): @@ -30,11 +28,11 @@ def checkAndAddCopyrightHeader(filename, testOnly=False): first_line = f.readline() # First line might be a c-style comment opener second_line = f.readline() # So, we also check the second line - print " Processing file:", filename, + print(" Processing file:", filename, end=' ') if not axom_copyright_begin_str in first_line and not axom_copyright_begin_str in second_line: if testOnly: - print "\t missing copyright statement." + print("\t missing copyright statement.") else: lines = f.readlines() f.seek(0) @@ -42,9 +40,9 @@ def checkAndAddCopyrightHeader(filename, testOnly=False): f.write(first_line) f.write(second_line) f.writelines(lines) - print "\t prepended copyright statement." + print("\t prepended copyright statement.") else: - print "\t already has copyright statement." + print("\t already has copyright statement.") def fileNameGenerator(rootDir, validExtensions, isRecursive=False): @@ -85,7 +83,7 @@ def fileNameGenerator(rootDir, validExtensions, isRecursive=False): args = parser.parse_args() ## Iterate through files, check for and add copyright notice - print "Looking at directory {}".format( args.dir ) + print("Looking at directory {}".format( args.dir )) for fullFileName in fileNameGenerator(args.dir, valid_extensions, args.isRecursive): checkAndAddCopyrightHeader(fullFileName, args.test) diff --git a/scripts/docker/dockerfile_gcc-9_cuda-11 b/scripts/docker/dockerfile_gcc-9_cuda-11 new file mode 100644 index 0000000000..ca77c8e23f --- /dev/null +++ b/scripts/docker/dockerfile_gcc-9_cuda-11 @@ -0,0 +1,69 @@ +# Docker image for Axom tutorial with CUDA support. +# Docker container runs a VS Code server accessible through a web browser. +# Docker and openvscode setup based on the RAJA suite tutorial: +# https://github.com/LLNL/raja-suite-tutorial/tree/main/containers/tutorial + +# This script can be run with the following command from the root axom directory: +# docker build --build-arg branch= -t "axom/tpls:gcc-9-cuda-11" -f ./scripts/docker/dockerfile_gcc-9_cuda-11 . + +# Command to launch openvscode server with the resulting docker image: +# docker run --init --gpus all --restart=always -p 3000:3000 + +FROM ghcr.io/rse-ops/cuda-ubuntu-20.04:cuda-11.1.1 +# Tutorial branch +ARG branch=develop +ARG USER=axomdev +ENV HOME /home/${USER} + +SHELL ["/bin/bash", "-c"] +RUN sudo apt-get update -y +RUN sudo apt-get install -y supervisor +RUN sudo useradd --create-home --shell /bin/bash ${USER} +RUN sudo apt-get install doxygen gfortran graphviz language-pack-en-base less libopenblas-dev libomp-dev mpich python3-sphinx ssh texlive-full tree -fy + +WORKDIR /opt/archives +RUN curl -L https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.69.1/openvscode-server-v1.69.1-linux-x64.tar.gz > \ + /opt/archives/openvscode-server-v1.69.1-linux-x64.tar.gz +RUN tar xzf openvscode-server-v1.69.1-linux-x64.tar.gz && chown -R ${USER}:${USER} openvscode-server-v1.69.1-linux-x64 + +WORKDIR ${HOME} +USER ${USER} + +# Clone axom at axom_repo directory +RUN git clone --recursive --branch $branch https://github.com/LLNL/axom.git axom_repo + +# Build/install TPLs via spack and then remove the temporary build directory on success +RUN cd ${HOME}/axom_repo && python3 ./scripts/uberenv/uberenv.py --spack-env-file=./scripts/spack/configs/docker/ubuntu20_cuda/spack.yaml \ + --project-json=.uberenv_config.json \ + --spec="%gcc@9.3.0+mfem+cuda cuda_arch=70" \ + --prefix=${HOME}/axom_tpls -k \ + && rm -rf ${HOME}/axom_tpls/builds + +# Make sure the new hostconfig works with a release build +# Note: having high job slots causes build log to disappear and job to fail +# Omit testing step, hangs at slam_lulesh unit test (same behavior for azure pipeline images, as well) +RUN cd ${HOME}/axom_repo && python3 config-build.py -hc *cuda.cmake \ + -bp ${HOME}/axom_repo/build-release \ + -ip ${HOME}/axom_repo/install-release \ + -bt Release \ + && cd ${HOME}/axom_repo/build-release \ + && make -j4 install + +# Larger STL meshes for testing (optional) +# Note: These meshes are large, copied from local directory instead of +# downloaded from Github. +# COPY boxedSphere.stl car.stl porsche.stl ${HOME}/axom_repo/data/quest + + +# Create symlinks for easy access to tutorial material (optional) +# RUN ln -s ${HOME}/axom_repo/install-release/examples/axom/radiuss_tutorial/ ${HOME}/radiuss_tutorial \ +# && ln -s ${HOME}/axom_repo/data/quest ${HOME}/radiuss_tutorial/stl_meshes + +USER root +ADD ./scripts/docker/supervisord.conf /etc/supervisord.conf +RUN sed -i "s/XXX/${USER}/g" /etc/supervisord.conf + +RUN touch /var/log/openvscode-server.log && chown -R ${USER}:${USER} /var/log/openvscode-server.log + +CMD ["/usr/bin/supervisord"] + diff --git a/scripts/docker/supervisord.conf b/scripts/docker/supervisord.conf new file mode 100644 index 0000000000..9746046a2b --- /dev/null +++ b/scripts/docker/supervisord.conf @@ -0,0 +1,12 @@ +; Supervisor config file to run the OpenVSCode server + +[supervisord] + nodaemon = true + user = XXX + logfile = /tmp/supervisord.log + + [program:openvscode-server] + environment=HOME="/home/XXX",USER="XXX" + redirect_stderr = true + stdout_logfile = /var/log/openvscode-server.log + command = /opt/archives/openvscode-server-v1.69.1-linux-x64/bin/openvscode-server --without-connection-token --host 0.0.0.0 \ No newline at end of file diff --git a/scripts/gitsetup/hooks/commit-msg b/scripts/gitsetup/hooks/commit-msg index 13385e7225..9bc7721a11 100755 --- a/scripts/gitsetup/hooks/commit-msg +++ b/scripts/gitsetup/hooks/commit-msg @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/gitsetup/hooks/post-checkout b/scripts/gitsetup/hooks/post-checkout index 4accac8c75..a0669d600f 100755 --- a/scripts/gitsetup/hooks/post-checkout +++ b/scripts/gitsetup/hooks/post-checkout @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/gitsetup/setup-git-aliases.sh b/scripts/gitsetup/setup-git-aliases.sh index 425cfc198c..9ca150cfd0 100755 --- a/scripts/gitsetup/setup-git-aliases.sh +++ b/scripts/gitsetup/setup-git-aliases.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/gitsetup/setup-git-colors.sh b/scripts/gitsetup/setup-git-colors.sh index bb8eebffcb..de13b25702 100755 --- a/scripts/gitsetup/setup-git-colors.sh +++ b/scripts/gitsetup/setup-git-colors.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/gitsetup/setup-git-editor.sh b/scripts/gitsetup/setup-git-editor.sh index 0ea74d5d10..b9fdef9923 100755 --- a/scripts/gitsetup/setup-git-editor.sh +++ b/scripts/gitsetup/setup-git-editor.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/gitsetup/setup-git-hooks.sh b/scripts/gitsetup/setup-git-hooks.sh index 1d2b833e2f..4502a88fc5 100755 --- a/scripts/gitsetup/setup-git-hooks.sh +++ b/scripts/gitsetup/setup-git-hooks.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/gitsetup/setup-git-user.sh b/scripts/gitsetup/setup-git-user.sh index ea95cc3e5f..b5d05cf480 100755 --- a/scripts/gitsetup/setup-git-user.sh +++ b/scripts/gitsetup/setup-git-user.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/gitsetup/tips.sh b/scripts/gitsetup/tips.sh index 1910bf6d73..a5f24a4edb 100755 --- a/scripts/gitsetup/tips.sh +++ b/scripts/gitsetup/tips.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/llnl_scripts/archive_job.py b/scripts/llnl_scripts/archive_job.py index db930b280e..df915be5c9 100755 --- a/scripts/llnl_scripts/archive_job.py +++ b/scripts/llnl_scripts/archive_job.py @@ -1,7 +1,7 @@ #!/bin/sh "exec" "python" "-u" "-B" "$0" "$@" -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/llnl_scripts/batch_scripts/README.md b/scripts/llnl_scripts/batch_scripts/README.md deleted file mode 100644 index 89f26bae97..0000000000 --- a/scripts/llnl_scripts/batch_scripts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -[comment]: # (#################################################################) -[comment]: # (Copyright 2017-2021, Lawrence Livermore National Security, LLC) -[comment]: # (and Axom Project Developers. See the top-level LICENSE file) -[comment]: # (for details.) -[comment]: # -[comment]: # (# SPDX-License-Identifier: BSD-3-Clause) -[comment]: # (#################################################################) - - -This directory contains some batch scripts to build third-party libraries -or source for multiple configurations on different clusters at LLNL. - -About ------ -There are two types of batch scripts for each network and cluster type: -* The `src` scripts call `/scripts/llnl_scripts/build_src.py` - to build and test all configurations on the given cluster. -* The `all_compilers` scripts call `/scripts/llnl_scripts/build_tpls.py` - to build Axom's third-party libraries (via uberenv) on the given cluster. - As part of this process, it build and test the code using each of these configurations . - -Usage ------ -To use these scripts, log into a cluster on an LLNL network (`CZ` or `RZ`) and call the appropriate script: -* On `toss3` (e.g. `ruby`) use the `msub` scripts: `msub msub_llnl_{c,r}z_toss3_{src,all_compilers}.sh` -* On `blueos` (e.g. `lassen`) use the `bsub` scripts: `bsub < bsub_llnl_{c,r}z_blueos_{src,all_compilers}.sh` diff --git a/scripts/llnl_scripts/batch_scripts/bsub_llnl_cz_blueos_all_compilers.sh b/scripts/llnl_scripts/batch_scripts/bsub_llnl_cz_blueos_all_compilers.sh deleted file mode 100755 index e58dc3739d..0000000000 --- a/scripts/llnl_scripts/batch_scripts/bsub_llnl_cz_blueos_all_compilers.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#BSUB -W 240 -#BSUB -G wbronze -#BSUB -o b.out.cz.blueos.all.compilers.%J.txt -#BSUB -q pbatch -# -# usage: -# cd {to directory with this script} -# bsub < bsub_llnl_cz_blueos_all_compilers.sh -# - -date -cd .. -./build_tpls.py -date - diff --git a/scripts/llnl_scripts/batch_scripts/bsub_llnl_cz_blueos_src.sh b/scripts/llnl_scripts/batch_scripts/bsub_llnl_cz_blueos_src.sh deleted file mode 100755 index 0f90aad7a1..0000000000 --- a/scripts/llnl_scripts/batch_scripts/bsub_llnl_cz_blueos_src.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#BSUB -W 240 -#BSUB -G wbronze -#BSUB -o b.out.cz.blueos.src.%J.txt -#BSUB -q pbatch -# -# usage: -# cd {to directory with this script} -# bsub < bsub_llnl_cz_blueos_src.sh -# - -date -cd .. -./build_src.py -date - diff --git a/scripts/llnl_scripts/batch_scripts/bsub_llnl_rz_blueos_all_compilers.sh b/scripts/llnl_scripts/batch_scripts/bsub_llnl_rz_blueos_all_compilers.sh deleted file mode 100755 index 8327a5b0f1..0000000000 --- a/scripts/llnl_scripts/batch_scripts/bsub_llnl_rz_blueos_all_compilers.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#BSUB -W 240 -#BSUB -o b.out.rz.blueos.all.compilers.%J.txt -#BSUB -q pdebug -# -# usage: -# cd {to directory with this script} -# bsub < bsub_llnl_rz_blueos_all_compilers.sh -# - -date -cd .. -./build_tpls.py -date - diff --git a/scripts/llnl_scripts/batch_scripts/bsub_llnl_rz_blueos_src.sh b/scripts/llnl_scripts/batch_scripts/bsub_llnl_rz_blueos_src.sh deleted file mode 100755 index 3e356e7ca3..0000000000 --- a/scripts/llnl_scripts/batch_scripts/bsub_llnl_rz_blueos_src.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#BSUB -W 240 -#BSUB -G wbronze -#BSUB -o b.out.rz.blueos.src.%J.txt -#BSUB -q pbatch -# -# usage: -# cd {to directory with this script} -# bsub < bsub_llnl_rz_blueos_src.sh -# - -date -cd .. -./build_src.py -date - diff --git a/scripts/llnl_scripts/batch_scripts/msub_llnl_cz_toss3_all_compilers.sh b/scripts/llnl_scripts/batch_scripts/msub_llnl_cz_toss3_all_compilers.sh deleted file mode 100755 index 2307c2c57f..0000000000 --- a/scripts/llnl_scripts/batch_scripts/msub_llnl_cz_toss3_all_compilers.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#MSUB -l nodes=1 -#MSUB -q pbatch -#MSUB -l walltime=8:00:00 -#MSUB -A wbronze -#MSUB -j oe -#MSUB -o m.out.cz.uberenv.toss3.all.compilers.%j.%N.txt -# -# usage: -# cd {to directory with this script} -# msub -d `pwd` msub_llnl_cz_toss3_all_compilers.sh - -date -cd .. -./build_tpls.py -date - diff --git a/scripts/llnl_scripts/batch_scripts/msub_llnl_cz_toss3_src.sh b/scripts/llnl_scripts/batch_scripts/msub_llnl_cz_toss3_src.sh deleted file mode 100755 index 25dc377565..0000000000 --- a/scripts/llnl_scripts/batch_scripts/msub_llnl_cz_toss3_src.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#MSUB -l nodes=1 -#MSUB -q pbatch -#MSUB -l walltime=4:00:00 -#MSUB -A wbronze -#MSUB -j oe -#MSUB -o m.out.cz.uberenv.toss3.src.%j.%N.txt -# -# usage: -# cd {to directory with this script} -# msub -d `pwd` msub_llnl_cz_toss3_src.sh - -date -cd .. -./build_src.py -date - diff --git a/scripts/llnl_scripts/batch_scripts/msub_llnl_rz_toss3_all_compilers.sh b/scripts/llnl_scripts/batch_scripts/msub_llnl_rz_toss3_all_compilers.sh deleted file mode 100755 index 1d48243302..0000000000 --- a/scripts/llnl_scripts/batch_scripts/msub_llnl_rz_toss3_all_compilers.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#MSUB -l nodes=1:ppn=36 -#MSUB -q pdebug -#MSUB -l walltime=4:00:00 -#MSUB -j oe -#MSUB -o m.out.rz.uberenv.toss3.all.compilers.%j.%N.txt -# -# usage: -# cd {to directory with this script} -# msub -d `pwd` msub_llnl_rz_toss3_all_compilers.sh - -date -cd .. -./build_tpls.py -date - diff --git a/scripts/llnl_scripts/batch_scripts/msub_llnl_rz_toss3_src.sh b/scripts/llnl_scripts/batch_scripts/msub_llnl_rz_toss3_src.sh deleted file mode 100755 index 9de76195c5..0000000000 --- a/scripts/llnl_scripts/batch_scripts/msub_llnl_rz_toss3_src.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#MSUB -l nodes=1:ppn=36 -#MSUB -q pdebug -#MSUB -l walltime=4:00:00 -#MSUB -j oe -#MSUB -o m.out.rz.uberenv.toss3.src.%j.%N.txt -# -# usage: -# cd {to directory with this script} -# msub -d `pwd` msub_llnl_rz_toss3_src.sh - -date -cd .. -./build_src.py -date - diff --git a/scripts/llnl_scripts/batch_scripts/msub_llnl_test_uberenv_host_configs.sh b/scripts/llnl_scripts/batch_scripts/msub_llnl_test_uberenv_host_configs.sh deleted file mode 100755 index c0d853dc3e..0000000000 --- a/scripts/llnl_scripts/batch_scripts/msub_llnl_test_uberenv_host_configs.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#MSUB -l nodes=1 -#MSUB -q pbatch -#MSUB -l walltime=4:00:00 -#MSUB -A wbronze -#MSUB -j oe -#MSUB -v UBERENV_PREFIX -#MSUB -o m.out.r.uberenv.test.atk.build.and.install.%j.%N.txt -# -# usage: -# cd {to directory with this script} -# env UBERENV_PREFIX={test path} msub msub_llnl_test_uberenv_host_configs.sh - -date -cd .. -./build_src.py -date - diff --git a/scripts/llnl_scripts/build_devtools.py b/scripts/llnl_scripts/build_devtools.py index b358faa02a..d1300e0c16 100755 --- a/scripts/llnl_scripts/build_devtools.py +++ b/scripts/llnl_scripts/build_devtools.py @@ -1,7 +1,7 @@ #!/bin/sh "exec" "python3" "-u" "-B" "$0" "$@" -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/llnl_scripts/build_src.py b/scripts/llnl_scripts/build_src.py index b4641fa82e..1054cb7556 100755 --- a/scripts/llnl_scripts/build_src.py +++ b/scripts/llnl_scripts/build_src.py @@ -1,7 +1,7 @@ #!/bin/sh "exec" "python3" "-u" "-B" "$0" "$@" -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/llnl_scripts/build_tpls.py b/scripts/llnl_scripts/build_tpls.py index 74ce2a3962..245e330209 100755 --- a/scripts/llnl_scripts/build_tpls.py +++ b/scripts/llnl_scripts/build_tpls.py @@ -1,7 +1,7 @@ #!/bin/sh "exec" "python3" "-u" "-B" "$0" "$@" -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/llnl_scripts/find_unused_tpl_dirs.py b/scripts/llnl_scripts/find_unused_tpl_dirs.py index 8615c356df..dc413d2e1c 100755 --- a/scripts/llnl_scripts/find_unused_tpl_dirs.py +++ b/scripts/llnl_scripts/find_unused_tpl_dirs.py @@ -1,7 +1,7 @@ #!/bin/sh "exec" "python" "-u" "-B" "$0" "$@" -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/llnl_scripts/fix_permissions.py b/scripts/llnl_scripts/fix_permissions.py index 62589c3b98..0297cc394d 100755 --- a/scripts/llnl_scripts/fix_permissions.py +++ b/scripts/llnl_scripts/fix_permissions.py @@ -1,7 +1,7 @@ #!/bin/sh "exec" "python" "-u" "-B" "$0" "$@" -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/llnl_scripts/llnl_lc_build_tools.py b/scripts/llnl_scripts/llnl_lc_build_tools.py index 8195fbe7b1..dae857189f 100755 --- a/scripts/llnl_scripts/llnl_lc_build_tools.py +++ b/scripts/llnl_scripts/llnl_lc_build_tools.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -559,9 +559,7 @@ def build_devtools(builds_dir, timestamp): sys_type = get_system_type() project_file = "scripts/spack/devtools.json" - if "toss_3" in sys_type: - compiler_spec = "%gcc@8.1.0" - elif "toss_4" in sys_type: + if "toss_4" in sys_type: compiler_spec = "%gcc@10.3.1" elif "blueos" in sys_type: compiler_spec = "%gcc@8.3.1" @@ -683,7 +681,7 @@ def get_platform(): def get_supported_sys_types(): - return ["blueos_3_ppc64le_ib_p9", "darwin-x86_64", "toss_3_x86_64_ib", "toss_4_x86_64_ib", "toss_4_x86_64_ib_cray"] + return ["blueos_3_ppc64le_ib_p9", "darwin-x86_64", "toss_4_x86_64_ib", "toss_4_x86_64_ib_cray"] def get_username(): return getpass.getuser() diff --git a/scripts/llnl_scripts/move_unused_tpl_dirs_to_graveyard.py b/scripts/llnl_scripts/move_unused_tpl_dirs_to_graveyard.py index fe90df57b3..19280c46a4 100755 --- a/scripts/llnl_scripts/move_unused_tpl_dirs_to_graveyard.py +++ b/scripts/llnl_scripts/move_unused_tpl_dirs_to_graveyard.py @@ -1,7 +1,7 @@ #!/bin/sh "exec" "python" "-u" "-B" "$0" "$@" -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/llnl_scripts/report.py b/scripts/llnl_scripts/report.py index 1edb62b745..8d99bf72b4 100755 --- a/scripts/llnl_scripts/report.py +++ b/scripts/llnl_scripts/report.py @@ -1,7 +1,7 @@ #!/bin/sh "exec" "python" "-u" "-B" "$0" "$@" -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/make_release_tarball.sh b/scripts/make_release_tarball.sh index 974a412ea5..5b8fa4289d 100755 --- a/scripts/make_release_tarball.sh +++ b/scripts/make_release_tarball.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/setup-for-development.sh b/scripts/setup-for-development.sh index 68f7c957d4..c88fcaad79 100755 --- a/scripts/setup-for-development.sh +++ b/scripts/setup-for-development.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/spack/configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack/configs/blueos_3_ppc64le_ib_p9/spack.yaml index 226af97b89..166f47abfd 100644 --- a/scripts/spack/configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ b/scripts/spack/configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -113,6 +113,7 @@ spack: blas: [netlib-lapack] lapack: [netlib-lapack] mpi: [spectrum-mpi] + zlib-api: [zlib] # LLNL blueos CUDA cuda: @@ -266,6 +267,16 @@ spack: - spec: tar@1.26 prefix: /usr buildable: false + unzip: + buildable: false + externals: + - spec: unzip@6.0 + prefix: /usr + zlib: + buildable: false + externals: + - spec: zlib@1.2.7 + prefix: /usr # External dependencies for SCR lsf: @@ -293,21 +304,21 @@ spack: # Globally lock version of third party libraries camp: - require: "@2023.06.0" + require: "@2024.02.0" conduit: - require: "@0.8.8~shared~test~examples~utilities" + require: "@0.9.1~shared~test~examples~utilities" hdf5: variants: ~shared~mpi hypre: version: [2.24.0] mfem: - require: "@4.5.2" + require: "@4.6.0" raja: - require: "@2023.06.0~shared~examples~exercises" + require: "@2024.02.0~shared~examples~exercises" scr: require: "@3.0.1~shared~tests~examples" umpire: - require: "@2023.06.0~shared~examples" + require: "@2024.02.0~shared~examples" # Globally lock in versions of Devtools cmake: @@ -323,11 +334,11 @@ spack: - spec: cppcheck@2.9 prefix: /collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/cppcheck-2.9 doxygen: - version: [1.8.14] + version: [1.9.6] buildable: false externals: - - spec: doxygen@1.8.14 - prefix: /collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.8.14 + - spec: doxygen@1.9.6 + prefix: /collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/doxygen-1.9.6 graphviz: version: [7.1.0] buildable: false @@ -347,11 +358,11 @@ spack: - spec: python@3.10.10 prefix: /collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10 py-shroud: - version: [0.12.2] + version: [0.13.0] buildable: false externals: - - spec: py-shroud@0.12.2 - prefix: /collab/usr/gapps/axom/devtools/blueos_3_ppc64le_ib_p9/latest/python-3.10.10 + - spec: py-shroud@0.13.0 + prefix: /collab/usr/gapps/shroud/public/blueos_3_ppc64le_ib_p9/shroud-0.13.0 py-sphinx: version: [6.1.3] buildable: false diff --git a/scripts/spack/configs/darwin/spack.yaml b/scripts/spack/configs/darwin/spack.yaml index ab4c98230d..5da42d4017 100644 --- a/scripts/spack/configs/darwin/spack.yaml +++ b/scripts/spack/configs/darwin/spack.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/spack/configs/docker/ubuntu20/spack.yaml b/scripts/spack/configs/docker/ubuntu20/spack.yaml index 8f0ea2529d..8260933ac9 100644 --- a/scripts/spack/configs/docker/ubuntu20/spack.yaml +++ b/scripts/spack/configs/docker/ubuntu20/spack.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -132,22 +132,22 @@ spack: # Globally lock version of third party libraries camp: - require: "@2023.06.0" + require: "@2024.02.0" conduit: - require: "@0.8.8~shared~test~examples~utilities" + require: "@0.9.1~shared~test~examples~utilities" hdf5: variants: ~shared~mpi hypre: version: [2.24.0] # do shared mfem to allow PIC flag in mfem mfem: - require: "@4.5.2+shared~static" + require: "@4.6.0+shared~static" raja: - require: "@2023.06.0~shared~examples~exercises" + require: "@2024.02.0~shared~examples~exercises" scr: - require: "@develop~shared" + require: "@3.0.1~shared~tests~examples" umpire: - require: "@2023.06.0~shared~examples" + require: "@2024.02.0~shared~examples" # Globally lock in version of devtools cmake: diff --git a/scripts/spack/configs/docker/ubuntu20_cuda/spack.yaml b/scripts/spack/configs/docker/ubuntu20_cuda/spack.yaml new file mode 100644 index 0000000000..b7b409bc92 --- /dev/null +++ b/scripts/spack/configs/docker/ubuntu20_cuda/spack.yaml @@ -0,0 +1,201 @@ +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +# Axom Project Developers. See the top-level LICENSE file for details. +# +# SPDX-License-Identifier: (BSD-3-Clause) + +spack: + config: + install_tree: + root: $spack/.. + projections: + all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + build_stage:: + - $spack/../build_stage + + # Regular TPLs do not need views + view: false + + compilers:: + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: ubuntu20.04 + paths: + cc: /usr/bin/clang + cxx: /usr/bin/clang++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + spec: clang@10.0.0 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: ubuntu20.04 + paths: + cc: /usr/bin/gcc + cxx: /usr/bin/g++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + spec: gcc@11.1.0 + target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: + cflags: -pthread + cxxflags: -pthread + modules: [] + operating_system: ubuntu20.04 + paths: + cc: /usr/bin/gcc + cxx: /usr/bin/g++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + spec: gcc@9.3.0 + target: x86_64 + + packages: + all: + # This defaults us to machine specific flags of ivybridge which allows + # us to run on broadwell as well + target: [x86_64] + compiler: [gcc, intel, pgi, clang, xl, nag] + providers: + awk: [gawk] + blas: [openblas] + lapack: [openblas] + daal: [intel-daal] + elf: [elfutils] + golang: [gcc] + ipp: [intel-ipp] + java: [jdk] + mkl: [intel-mkl] + mpe: [mpe2] + mpi: [mpich] + opencl: [pocl] + openfoam: [openfoam-com, openfoam-org, foam-extend] + pil: [py-pillow] + scalapack: [netlib-scalapack] + szip: [libszip, libaec] + tbb: [intel-tbb] + jpeg: [libjpeg-turbo, libjpeg] + + # Spack may grab for mpi & we don't want to use them + mpi: + buildable: false + mpich: + externals: + - spec: mpich@3.3 + prefix: /usr + + # System level packages to not build + autotools: + buildable: false + externals: + - spec: autotools@2.69 + prefix: /usr + bzip2: + buildable: false + externals: + - spec: bzip2@1.0.6 + prefix: /usr + cuda: + buildable: false + externals: + - spec: cuda@11.1.1 + prefix: /usr/local/cuda + gettext: + buildable: false + externals: + - spec: gettext@0.19.8.1 + prefix: /usr + m4: + buildable: false + externals: + - spec: m4@1.4.18 + prefix: /usr + perl: + buildable: false + externals: + - spec: perl@5.26.1 + prefix: /usr + pkg-config: + buildable: false + externals: + - spec: pkg-config@0.29.1 + prefix: /usr + tar: + buildable: false + externals: + - spec: tar@1.29 + prefix: /usr + graphviz: + buildable: false + externals: + - spec: graphviz@2.40.1 + prefix: /usr + openblas: + buildable: false + externals: + - spec: openblas@0.2.20 + prefix: /usr + ncurses: + buildable: false + externals: + - spec: ncurses@6.2 + prefix: /opt/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/ + + # Globally lock version of third party libraries + camp: + require: "@2023.06.0" + conduit: + require: "@0.8.8~shared~test~examples~utilities" + hdf5: + variants: ~shared~mpi + hypre: + version: [2.24.0] + # do shared mfem to allow PIC flag in mfem + mfem: + require: "@4.5.2+shared~static" + raja: + require: "@2023.06.0~shared~examples~exercises" + scr: + require: "@develop~shared" + umpire: + require: "@2023.06.0~shared~examples" + + # Globally lock in version of devtools + cmake: + version: [3.20.4] + buildable: false + externals: + - spec: cmake@3.20.4 + prefix: /opt/view + doxygen: + version: [1.8.17] + buildable: false + externals: + - spec: doxygen@1.8.17 + prefix: /usr + llvm: + version: [10.0.0] + buildable: false + externals: + - spec: llvm@10.0.0+clang + prefix: /usr + py-sphinx: + version: [1.8.5] + buildable: false + externals: + - spec: py-sphinx@1.8.5 + prefix: /usr diff --git a/scripts/spack/configs/linux_ubuntu_20/spack.yaml b/scripts/spack/configs/linux_ubuntu_20/spack.yaml index 3b890f03d0..901e514028 100644 --- a/scripts/spack/configs/linux_ubuntu_20/spack.yaml +++ b/scripts/spack/configs/linux_ubuntu_20/spack.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/spack/configs/toss_3_x86_64_ib/spack.yaml b/scripts/spack/configs/toss_3_x86_64_ib/spack.yaml deleted file mode 100644 index 4b5a21c30f..0000000000 --- a/scripts/spack/configs/toss_3_x86_64_ib/spack.yaml +++ /dev/null @@ -1,344 +0,0 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -spack: - config: - install_tree: - root: $spack/.. - projections: - all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' - misc_cache: $spack/../misc_cache - test_stage: $spack/../test_stage - build_stage:: - - $spack/../build_stage - - # Regular TPLs do not need views - view: false - - compilers:: - - compiler: - environment: {} - extra_rpaths: [] - flags: - cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1 - cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1 - modules: - - clang/9.0.0 - operating_system: rhel7 - paths: - cc: /usr/tce/packages/clang/clang-9.0.0/bin/clang - cxx: /usr/tce/packages/clang/clang-9.0.0/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - spec: clang@9.0.0 - target: x86_64 - - compiler: - environment: {} - extra_rpaths: [] - flags: - cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1 - cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1 - modules: - - clang/10.0.0 - operating_system: rhel7 - paths: - cc: /usr/tce/packages/clang/clang-10.0.0/bin/clang - cxx: /usr/tce/packages/clang/clang-10.0.0/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - spec: clang@10.0.0 - target: x86_64 - - compiler: - environment: {} - extra_rpaths: [] - flags: {} - modules: [] - operating_system: rhel7 - paths: - cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - spec: gcc@8.3.1 - target: x86_64 - - compiler: - environment: {} - extra_rpaths: [] - flags: {} - modules: [] - operating_system: rhel7 - paths: - cc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.1.0/bin/g++ - f77: - fc: - # Note: Spack keeps having problems with specs with non-numerical compiler specs. - # This is a special compiler spec to test out not defining a fortran compiler. - spec: gcc@8.1.0 - target: x86_64 - - compiler: - environment: {} - extra_rpaths: [] - flags: - cflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.1.0/bin/gcc - cxxflags: -gxx-name=/usr/tce/packages/gcc/gcc-8.1.0/bin/g++ - fflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.1.0/bin/gcc - modules: [] - operating_system: rhel7 - paths: - cc: /usr/tce/packages/intel/intel-19.0.4/bin/icc - cxx: /usr/tce/packages/intel/intel-19.0.4/bin/icpc - f77: /usr/tce/packages/intel/intel-19.0.4/bin/ifort - fc: /usr/tce/packages/intel/intel-19.0.4/bin/ifort - spec: intel@19.0.4 - target: x86_64 - - packages: - all: - # This defaults us to machine specific flags of ivybridge which allows - # us to run on broadwell as well - target: [ivybridge] - compiler: [gcc, intel, pgi, clang, xl, nag] - providers: - blas: [netlib-lapack] - lapack: [netlib-lapack] - mpi: [mvapich2] - - # LLNL toss3 CUDA - cuda: - buildable: false - externals: - - spec: cuda@10.2 - prefix: /opt/cudatoolkit/10.2 - - # Lock down which MPI we are using - mpi: - buildable: false - mvapich2: - buildable: false - externals: - - spec: mvapich2@2.3%clang@9.0.0 process_managers=slurm arch=linux-rhel7-ivybridge - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-9.0.0 - - spec: mvapich2@2.3%clang@10.0.0 process_managers=slurm arch=linux-rhel7-ivybridge - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0 - - spec: mvapich2@2.3%gcc@8.1.0 process_managers=slurm arch=linux-rhel7-ivybridge - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.1.0 - - spec: mvapich2@2.3%gcc@8.3.1 process_managers=slurm arch=linux-rhel7-ivybridge - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1 - - spec: mvapich2@2.3%intel@19.0.4 process_managers=slurm arch=linux-rhel7-ivybridge - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-intel-19.0.0 - - # blas is a bit more complicated because its a virtual package so fake it with - # the following per spack docs - netlib-lapack: - buildable: false - externals: - - spec: netlib-lapack@3.6.1 - prefix: /usr - - # System level packages to not build - autoconf: - buildable: false - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - buildable: false - externals: - - spec: automake@1.13.4 - prefix: /usr - binutils: - buildable: false - externals: - - spec: binutils@2.27 - prefix: /usr - bzip2: - buildable: false - externals: - - spec: bzip2@1.0.6 - prefix: /usr - curl: - buildable: false - externals: - - spec: curl@7.29.0 - prefix: /usr - diffutils: - buildable: false - externals: - - spec: diffutils@3.3 - prefix: /usr - elfutils: - buildable: false - externals: - - spec: elfutils@0.176 - prefix: /usr - epoxy: - buildable: false - externals: - - spec: epoxy@1.5.2 - prefix: /usr - findutils: - buildable: false - externals: - - spec: findutils@4.5.11 - prefix: /usr - gettext: - buildable: false - externals: - - spec: gettext@0.19.8.1 - prefix: /usr - ghostscript: - buildable: false - externals: - - spec: ghostscript@9.25 - prefix: /usr - groff: - buildable: false - externals: - - spec: groff@1.22.2 - prefix: /usr - libtool: - buildable: false - externals: - - spec: libtool@2.4.2 - prefix: /usr - libunwind: - buildable: false - externals: - - spec: libunwind@8.0.1 - prefix: /usr - libx11: - buildable: false - externals: - - spec: libx11@1.20.4 - prefix: /usr - m4: - buildable: false - externals: - - spec: m4@1.4.16 - prefix: /usr - perl: - buildable: false - externals: - - spec: perl@5.16.3 - prefix: /usr - pkg-config: - buildable: false - externals: - - spec: pkg-config@0.27.1 - prefix: /usr - readline: - buildable: false - externals: - - spec: readline@6.2 - prefix: /usr - tar: - buildable: false - externals: - - spec: tar@1.26 - prefix: /usr - unzip: - buildable: false - externals: - - spec: unzip@6.0 - prefix: /usr - zlib: - buildable: false - externals: - - spec: zlib@1.2.7 - prefix: /usr - - - # External dependencies for SCR - lsf: - buildable: False - externals: - - spec: lsf@10.1 - prefix: /opt/ibm/spectrumcomputing/lsf/10.1 - slurm: - buildable: false - externals: - - spec: slurm@20 - prefix: /usr - libyogrt: - buildable: false - externals: - - spec: libyogrt@1.24 scheduler=lsf - prefix: /usr - - spec: libyogrt@1.24 scheduler=slurm - prefix: /usr - pdsh: - buildable: false - externals: - - spec: pdsh@2.33 - prefix: /usr - - # Globally lock version of third party libraries - camp: - require: "@2023.06.0" - conduit: - require: "@0.8.8~shared~test~examples~utilities" - hdf5: - variants: ~shared~mpi - hypre: - version: [2.24.0] - mfem: - require: "@4.5.2" - raja: - require: "@2023.06.0~shared~examples~exercises" - scr: - require: "@3.0.1~shared~tests~examples" - umpire: - require: "@2023.06.0~shared~examples" - - # Globally lock in versions of Devtools - cmake: - version: [3.21.1] - buildable: false - externals: - - spec: cmake@3.21.1 - prefix: /usr/tce/packages/cmake/cmake-3.21.1 - cppcheck: - version: [2.9] - buildable: false - externals: - - spec: cppcheck@2.9 - prefix: /collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/cppcheck-2.9 - doxygen: - version: [1.8.14] - buildable: false - externals: - - spec: doxygen@1.8.14 - prefix: /collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/doxygen-1.8.14 - graphviz: - version: [7.1.0] - buildable: false - externals: - - spec: graphviz@7.1.0 - prefix: /collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/graphviz-7.1.0 - llvm: - version: [10.0.0] - buildable: false - externals: - - spec: llvm@10.0.0+clang - prefix: /usr/tce/packages/clang/clang-10.0.0 - python: - version: [3.10.10] - buildable: false - externals: - - spec: python@3.10.10 - prefix: /collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10 - py-shroud: - version: [0.12.2] - buildable: false - externals: - - spec: py-shroud@0.12.2 - prefix: /collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10 - py-sphinx: - version: [6.1.3] - buildable: false - externals: - - spec: py-sphinx@6.1.3 - prefix: /collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/latest/python-3.10.10 diff --git a/scripts/spack/configs/toss_4_x86_64_ib/spack.yaml b/scripts/spack/configs/toss_4_x86_64_ib/spack.yaml index 031bdfc531..bd15768713 100644 --- a/scripts/spack/configs/toss_4_x86_64_ib/spack.yaml +++ b/scripts/spack/configs/toss_4_x86_64_ib/spack.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -46,6 +46,19 @@ spack: fc: /usr/tce/packages/gcc/gcc-10.3.1/bin/gfortran spec: gcc@10.3.1 target: x86_64 + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: rhel8 + paths: + cc: /usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/icx + cxx: /usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/icpx + f77: /usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/ifx + fc: /usr/tce/packages/intel/intel-2022.1.0/compiler/2022.1.0/linux/bin/ifx + spec: intel@2022.1.0 + target: x86_64 packages: all: @@ -82,10 +95,12 @@ spack: mvapich2: buildable: false externals: - - spec: mvapich2@2.3.6%clang@14.0.6 process_managers=slurm arch=linux-rhel8-ivybridge + - spec: mvapich2@2.3.6%clang@14.0.6~alloca~cuda~debug~hwloc_graphics~hwlocv2+regcache+wrapperrpath build_system=autotools ch3_rank_bits=32 fabrics=mrail file_systems=auto process_managers=slurm threads=multiple prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6 - - spec: mvapich2@2.3.6%gcc@10.3.1 process_managers=slurm arch=linux-rhel8-ivybridge + - spec: mvapich2@2.3.6%gcc@10.3.1~alloca~cuda~debug~hwloc_graphics~hwlocv2+regcache+wrapperrpath build_system=autotools ch3_rank_bits=32 fabrics=mrail file_systems=auto process_managers=slurm threads=multiple prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1 + - spec: mvapich2@2.3.6%intel@2022.1.0~alloca~cuda~debug~hwloc_graphics~hwlocv2+regcache+wrapperrpath build_system=autotools ch3_rank_bits=32 fabrics=mrail file_systems=auto process_managers=slurm threads=multiple + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-intel-2022.1.0 netlib-lapack: buildable: false @@ -253,21 +268,21 @@ spack: # Globally lock version of third party libraries camp: - require: "@2023.06.0" + require: "@2024.02.0" conduit: - require: "@0.8.8~shared~test~examples~utilities" + require: "@0.9.1~shared~test~examples~utilities" hdf5: variants: ~shared~mpi hypre: version: [2.24.0] mfem: - require: "@4.5.2" + require: "@4.6.0" raja: - require: "@2023.06.0~shared~examples~exercises" + require: "@2024.02.0~shared~examples~exercises" scr: require: "@3.0.1~shared~tests~examples" umpire: - require: "@2023.06.0~shared~examples" + require: "@2024.02.0~shared~examples" # Lock in versions of Devtools cmake: @@ -283,11 +298,11 @@ spack: - spec: cppcheck@2.9 prefix: /collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/cppcheck-2.9 doxygen: - version: [1.8.14] + version: [1.9.6] buildable: false externals: - - spec: doxygen@1.8.14 - prefix: /collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.8.14 + - spec: doxygen@1.9.6 + prefix: /collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/doxygen-1.9.6 # TODO: make installed clang 14.0.6 work llvm: version: [10.0.0] @@ -296,11 +311,11 @@ spack: - spec: llvm+clang@10.0.0 prefix: /collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/llvm-10.0.0 py-shroud: - version: [0.12.2] + version: [0.13.0] buildable: false externals: - - spec: py-shroud@0.12.2 - prefix: /collab/usr/gapps/axom/devtools/toss_4_x86_64_ib/latest/python-3.10.10 + - spec: py-shroud@0.13.0 + prefix: /collab/usr/gapps/shroud/public/toss_4_x86_64_ib/shroud-0.13.0 py-sphinx: version: [4.4.0] buildable: false diff --git a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml index c17903aedf..b6f2a47429 100644 --- a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml +++ b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -337,18 +337,25 @@ spack: # Globally lock version of third party libraries camp: - require: "@2023.06.0" + require: "@2024.02.0" conduit: - require: "@0.8.8~shared~test~examples~utilities" + require: "@0.9.1~shared~test~examples~utilities" hdf5: variants: ~shared~mpi hypre: version: [2.24.0] mfem: - require: "@4.5.2" + require: "@4.6.0" raja: - require: "@2023.06.0~shared~examples~exercises" + require: "@2024.02.0~shared~examples~exercises" scr: require: "@3.0.1~shared~tests~examples" umpire: - require: "@2023.06.0~shared~examples" + require: "@2024.02.0~shared~examples" + + py-shroud: + version: [0.13.0] + buildable: false + externals: + - spec: py-shroud@0.13.0 + prefix: /collab/usr/gapps/shroud/public/toss_4_x86_64_ib_cray/shroud-0.13.0 diff --git a/scripts/spack/devtools_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack/devtools_configs/blueos_3_ppc64le_ib_p9/spack.yaml index 70410f0dea..f0007bb6a7 100644 --- a/scripts/spack/devtools_configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ b/scripts/spack/devtools_configs/blueos_3_ppc64le_ib_p9/spack.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/spack/devtools_configs/toss_3_x86_64_ib/spack.yaml b/scripts/spack/devtools_configs/toss_3_x86_64_ib/spack.yaml deleted file mode 100644 index 1dd232eee1..0000000000 --- a/scripts/spack/devtools_configs/toss_3_x86_64_ib/spack.yaml +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) - -spack: - config: - install_tree: - root: $spack/.. - projections: - all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' - misc_cache: $spack/../misc_cache - test_stage: $spack/../test_stage - build_stage:: - - $spack/../build_stage - - view: - default: - root: ../view - projections: - all: '{name}-{version}' - - compilers:: - - compiler: - environment: {} - extra_rpaths: [] - flags: {} - modules: [] - operating_system: rhel7 - paths: - cc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.1.0/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - spec: gcc@8.1.0 - target: x86_64 - - packages: - all: - # This defaults us to machine specific flags of ivybridge which allows - # us to run on broadwell as well - target: [ivybridge] - compiler: [gcc, intel, pgi, clang, xl, nag] - providers: - blas: [netlib-lapack] - lapack: [netlib-lapack] - mpi: [mvapich2] - gl: [opengl] - glu: [openglu] - opengl: - buildable: false - externals: - - spec: opengl@1.7.0 - prefix: /usr - openglu: - buildable: false - externals: - - spec: openglu@1.3.1 - prefix: /usr - - # Lock down which MPI we are using - mpi: - buildable: false - - # blas is a bit more complicated because its a virtual package so fake it with - # the following per spack docs - netlib-lapack: - buildable: false - externals: - - spec: netlib-lapack@3.6.1 - prefix: /usr - - # System level packages to not build - autoconf: - buildable: false - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - buildable: false - externals: - - spec: automake@1.13.4 - prefix: /usr - binutils: - buildable: false - externals: - - spec: binutils@2.27 - prefix: /usr - bzip2: - buildable: false - externals: - - spec: bzip2@1.0.6 - prefix: /usr - diffutils: - buildable: false - externals: - - spec: diffutils@3.3 - prefix: /usr - epoxy: - buildable: false - externals: - - spec: epoxy@1.5.2 - prefix: /usr - findutils: - buildable: false - externals: - - spec: findutils@4.5.11 - prefix: /usr - gettext: - buildable: false - externals: - - spec: gettext@0.19.8.1 - prefix: /usr - ghostscript: - buildable: false - externals: - - spec: ghostscript@9.25 - prefix: /usr - groff: - buildable: false - externals: - - spec: groff@1.22.2 - prefix: /usr - libtool: - buildable: false - externals: - - spec: libtool@2.4.2 - prefix: /usr - libx11: - buildable: false - externals: - - spec: libx11@1.20.4 - prefix: /usr - m4: - buildable: false - externals: - - spec: m4@1.4.16 - prefix: /usr - perl: - buildable: false - externals: - - spec: perl@5.16.3 - prefix: /usr - pkg-config: - buildable: false - externals: - - spec: pkg-config@0.27.1 - prefix: /usr - readline: - buildable: false - externals: - - spec: readline@6.2 - prefix: /usr - tar: - buildable: false - externals: - - spec: tar@1.26 - prefix: /usr - unzip: - buildable: false - externals: - - spec: unzip@6.0 - prefix: /usr - xz: - buildable: false - externals: - - spec: xz@5.2.2 - prefix: /usr - zlib: - buildable: false - externals: - - spec: zlib@1.2.7 - prefix: /usr - - # Packages we may want to build in the future with specific versions - cmake: - version: [3.21.1] - buildable: false - externals: - - spec: cmake@3.21.1 - prefix: /usr/tce/packages/cmake/cmake-3.21.1 - llvm: - version: [10.0.0] - buildable: false - externals: - - spec: llvm@10.0.0+clang - prefix: /usr/tce/packages/clang/clang-10.0.0 - diff --git a/scripts/spack/devtools_configs/toss_4_x86_64_ib/spack.yaml b/scripts/spack/devtools_configs/toss_4_x86_64_ib/spack.yaml index 04cd1f7058..111e90d628 100644 --- a/scripts/spack/devtools_configs/toss_4_x86_64_ib/spack.yaml +++ b/scripts/spack/devtools_configs/toss_4_x86_64_ib/spack.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -17,7 +17,7 @@ spack: view: default: root: ../view - select: [llvm, cppcheck, doxygen, py-shroud, py-sphinx, python, ^python] + select: [llvm, cppcheck, doxygen, py-sphinx, python, ^python] projections: all: '{name}-{version}' diff --git a/scripts/spack/packages/axom/package.py b/scripts/spack/packages/axom/package.py index 8f3b473e7d..cd85f139a0 100644 --- a/scripts/spack/packages/axom/package.py +++ b/scripts/spack/packages/axom/package.py @@ -1,4 +1,4 @@ -# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -10,6 +10,7 @@ from spack.package import * from spack.util.executable import which_string + def get_spec_path(spec, package_name, path_replacements={}, use_bin=False): """Extracts the prefix path for the given spack package path_replacements is a dictionary with string replacements for the path. @@ -32,26 +33,28 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): """Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.""" - maintainers = ["white238"] + maintainers("white238") homepage = "https://github.com/LLNL/axom" git = "https://github.com/LLNL/axom.git" tags = ["radiuss"] + license("BSD-3-Clause") + version("main", branch="main") version("develop", branch="develop") - version("0.8.1", tag="v0.8.1") - version("0.8.0", tag="v0.8.0") - version("0.7.0", tag="v0.7.0") - version("0.6.1", tag="v0.6.1") - version("0.6.0", tag="v0.6.0") - version("0.5.0", tag="v0.5.0") - version("0.4.0", tag="v0.4.0") - version("0.3.3", tag="v0.3.3") - version("0.3.2", tag="v0.3.2") - version("0.3.1", tag="v0.3.1") - version("0.3.0", tag="v0.3.0") - version("0.2.9", tag="v0.2.9") + version("0.8.1", tag="v0.8.1", commit="0da8a5b1be596887158ac2fcd321524ba5259e15") + version("0.8.0", tag="v0.8.0", commit="71fab3262eb7e1aa44a04c21d072b77f06362f7b") + version("0.7.0", tag="v0.7.0", commit="ea5158191181c137117ae37959879bdc8b107f35") + version("0.6.1", tag="v0.6.1", commit="ee240d3963d7879ae0e9c392902195bd7b04e37d") + version("0.6.0", tag="v0.6.0", commit="65287dc00bc7c271a08cb86c632f5909c30e3506") + version("0.5.0", tag="v0.5.0", commit="db137349b3e28617c3e0570dbd18e4a91654da98") + version("0.4.0", tag="v0.4.0", commit="38c0d7495ece35a30fca5f5b578b8f9d54346bd2") + version("0.3.3", tag="v0.3.3", commit="f0539ef0525469ffda054d86144f310c15b4f9e0") + version("0.3.2", tag="v0.3.2", commit="c446b496e20e6118b8cba7e80f1f84c76a49e463") + version("0.3.1", tag="v0.3.1", commit="cbefc0457a229d8acfb70622360d0667e90e50a2") + version("0.3.0", tag="v0.3.0", commit="20068ccab4b4f70055918b4f17960ec3ed6dbce8") + version("0.2.9", tag="v0.2.9", commit="9e9a54ede3326817c05f35922738516e43b5ec3d") # https://github.com/spack/spack/issues/31829 patch("examples-oneapi.patch", when="@0.6.1 +examples %oneapi") @@ -96,12 +99,13 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): # Dependencies # ----------------------------------------------------------------------- # Basics - depends_on("cmake@3.14:", type="build", when="@:0.6.1") + depends_on("cmake@3.14:", type="build") depends_on("cmake@3.18:", type="build", when="@0.7.0:") depends_on("cmake@3.21:", type="build", when="+rocm") depends_on("blt", type="build") depends_on("blt@0.5.1:", type="build", when="@0.6.1:") + depends_on("blt@0.6.2:", type="build", when="@0.9:") depends_on("mpi", when="+mpi") @@ -119,27 +123,31 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("scr~fortran", when="+scr~fortran") with when("+umpire"): + depends_on("umpire@2024.02.0:", when="@0.9:") depends_on("umpire@2022.03.0:", when="@0.7.0:") depends_on("umpire@6.0.0", when="@0.6.0") depends_on("umpire@5:5.0.1", when="@:0.5.0") depends_on("umpire +openmp", when="+openmp") - depends_on("umpire +cuda", when="+cuda") with when("+raja"): + depends_on("raja@2024.02.0:", when="@0.9:") depends_on("raja@2022.03.0:", when="@0.7.0:") depends_on("raja@0.14.0", when="@0.6.0") depends_on("raja@:0.13.0", when="@:0.5.0") depends_on("raja~openmp", when="~openmp") depends_on("raja+openmp", when="+openmp") - depends_on("raja+cuda", when="+cuda") for val in CudaPackage.cuda_arch_values: - depends_on("raja cuda_arch={0}".format(val), when="+raja cuda_arch={0}".format(val)) - depends_on("umpire cuda_arch={0}".format(val), when="+umpire cuda_arch={0}".format(val)) + raja_cuda = "raja +cuda cuda_arch={0}".format(val) + umpire_cuda = "umpire +cuda cuda_arch={0}".format(val) + depends_on(raja_cuda, when="+{0}".format(raja_cuda)) + depends_on(umpire_cuda, when="+{0}".format(umpire_cuda)) for val in ROCmPackage.amdgpu_targets: - depends_on("raja amdgpu_target={0}".format(val), when="amdgpu_target={0}".format(val)) - depends_on("umpire amdgpu_target={0}".format(val), when="amdgpu_target={0}".format(val)) + raja_rocm = "raja +rocm amdgpu_target={0}".format(val) + umpire_rocm = "umpire +rocm amdgpu_target={0}".format(val) + depends_on(raja_rocm, when="+{0}".format(raja_rocm)) + depends_on(umpire_rocm, when="+{0}".format(umpire_rocm)) depends_on("rocprim", when="+rocm") @@ -159,6 +167,7 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("python", when="+devtools") depends_on("py-sphinx", when="+devtools") depends_on("py-shroud", when="+devtools") + depends_on("py-jsonschema", when="+devtools") depends_on("llvm+clang@10.0.0", when="+devtools", type="build") # Hard requirement after Axom 0.6.1 @@ -173,6 +182,8 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): conflicts("+openmp", when="+rocm") conflicts("+cuda", when="+rocm") + conflicts("^blt@:0.3.6", when="+rocm") + def flag_handler(self, name, flags): if self.spec.satisfies("%cce") and name == "fflags": flags.append("-ef") @@ -216,7 +227,7 @@ def cache_name(self): def initconfig_compiler_entries(self): spec = self.spec - entries = super(Axom, self).initconfig_compiler_entries() + entries = super().initconfig_compiler_entries() if "+fortran" in spec: entries.append(cmake_cache_option("ENABLE_FORTRAN", True)) @@ -225,7 +236,7 @@ def initconfig_compiler_entries(self): flags = "" for _libpath in [libdir, libdir + "64"]: if os.path.exists(_libpath): - if spec.satisfies('^cuda'): + if spec.satisfies("^cuda"): flags += " -Xlinker -rpath -Xlinker {0}".format(_libpath) else: flags += " -Wl,-rpath,{0}".format(_libpath) @@ -238,17 +249,17 @@ def initconfig_compiler_entries(self): if "+cpp14" in spec and spec.satisfies("@:0.6.1"): entries.append(cmake_cache_string("BLT_CXX_STD", "c++14", "")) - # Add optimization flag to workaround HIP compiler errors + # Add optimization flag workaround for Debug builds with + # cray compiler or newer HIP if "+rocm" in spec: - if "crayCC" in self.compiler.cxx or spec.satisfies("%clang@16"): - entries.append(cmake_cache_string("CMAKE_CXX_FLAGS","-O1")) - + if spec.satisfies("%cce") or spec.satisfies("%clang@16"): + entries.append(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", "-O1 -g -DNDEBUG")) return entries def initconfig_hardware_entries(self): spec = self.spec - entries = super(Axom, self).initconfig_hardware_entries() + entries = super().initconfig_hardware_entries() if "+cuda" in spec: entries.append(cmake_cache_option("ENABLE_CUDA", True)) @@ -260,8 +271,8 @@ def initconfig_hardware_entries(self): cudaflags = "-restrict --expt-extended-lambda " # Pass through any cxxflags to the host compiler via nvcc's Xcompiler flag - host_cxx_flags = spec.compiler_flags['cxxflags'] - cudaflags += ' '.join(['-Xcompiler=%s ' % flag for flag in host_cxx_flags]) + host_cxx_flags = spec.compiler_flags["cxxflags"] + cudaflags += " ".join(["-Xcompiler=%s " % flag for flag in host_cxx_flags]) if not spec.satisfies("cuda_arch=none"): cuda_arch = spec.variants["cuda_arch"].value[0] @@ -291,12 +302,19 @@ def initconfig_hardware_entries(self): rocm_root = hip_root + "/.." # Fix blt_hip getting HIP_CLANG_INCLUDE_PATH-NOTFOUND bad include directory - if (self.spec.satisfies('%cce') or self.spec.satisfies('%clang')) and 'toss_4' in self._get_sys_type(spec): + # TODO: verify that this is still needed and is indeed specific to LC + if ( + self.spec.satisfies("%cce") or self.spec.satisfies("%clang") + ) and "toss_4" in self._get_sys_type(spec): # Set the patch version to 0 if not already - clang_version= str(self.compiler.version)[:-1] + "0" - hip_clang_include_path = rocm_root + "/llvm/lib/clang/" + clang_version + "/include" + clang_version = str(self.compiler.version)[:-1] + "0" + hip_clang_include_path = ( + rocm_root + "/llvm/lib/clang/" + clang_version + "/include" + ) if os.path.isdir(hip_clang_include_path): - entries.append(cmake_cache_path("HIP_CLANG_INCLUDE_PATH", hip_clang_include_path)) + entries.append( + cmake_cache_path("HIP_CLANG_INCLUDE_PATH", hip_clang_include_path) + ) # Fixes for mpi for rocm until wrapper paths are fixed # These flags are already part of the wrapped compilers on TOSS4 systems @@ -309,8 +327,9 @@ def initconfig_hardware_entries(self): # Remove extra link library for crayftn if "+fortran" in spec and self.is_fortran_compiler("crayftn"): - entries.append(cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE", - "unwind")) + entries.append( + cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE", "unwind") + ) # Additional libraries for TOSS4 hip_link_flags += " -L{0}/../lib64 -Wl,-rpath,{0}/../lib64 ".format(hip_root) @@ -357,18 +376,22 @@ def initconfig_hardware_entries(self): ) ) - if "+openmp" in spec and \ - "clang" in self.compiler.cxx and \ - "+fortran" in spec and self.is_fortran_compiler("xlf"): - openmp_gen_exp = ( "$<$>:" - "-fopenmp=libomp>;$<$:-qsmp=omp>") + if ( + "+openmp" in spec + and "clang" in self.compiler.cxx + and "+fortran" in spec + and self.is_fortran_compiler("xlf") + ): + openmp_gen_exp = ( + "$<$>:" + "-fopenmp=libomp>;$<$:-qsmp=omp>" + ) description = "Different OpenMP linker flag between CXX and Fortran" - entries.append(cmake_cache_string( - "BLT_OPENMP_LINK_FLAGS", - openmp_gen_exp, - description)) + entries.append( + cmake_cache_string("BLT_OPENMP_LINK_FLAGS", openmp_gen_exp, description) + ) if spec.satisfies("target=ppc64le:"): # Fix for working around CMake adding implicit link directories @@ -385,8 +408,7 @@ def initconfig_hardware_entries(self): if _existing_paths: entries.append( cmake_cache_string( - "BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - ";".join(_existing_paths), + "BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", ";".join(_existing_paths) ) ) @@ -394,29 +416,33 @@ def initconfig_hardware_entries(self): def initconfig_mpi_entries(self): spec = self.spec - entries = super(Axom, self).initconfig_mpi_entries() + entries = super().initconfig_mpi_entries() if "+mpi" in spec: entries.append(cmake_cache_option("ENABLE_MPI", True)) if spec["mpi"].name == "spectrum-mpi": entries.append(cmake_cache_string("BLT_MPI_COMMAND_APPEND", "mpibind")) + + # Replace /usr/bin/srun path with srun flux wrapper path on TOSS 4 + # TODO: Remove this logic by adding `using_flux` case in + # spack/lib/spack/spack/build_systems/cached_cmake.py:196 and remove hard-coded + # path to srun in same file. + if "toss_4" in self._get_sys_type(spec): + srun_wrapper = which_string("srun") + mpi_exec_index = [ + index for index, entry in enumerate(entries) if "MPIEXEC_EXECUTABLE" in entry + ] + del entries[mpi_exec_index[0]] + entries.append(cmake_cache_path("MPIEXEC_EXECUTABLE", srun_wrapper)) else: entries.append(cmake_cache_option("ENABLE_MPI", False)) - # Replace /usr/bin/srun path with srun flux wrapper path on TOSS 4 - if 'toss_4' in self._get_sys_type(spec): - srun_wrapper = which_string("srun") - mpi_exec_index = [index for index,entry in enumerate(entries) - if "MPIEXEC_EXECUTABLE" in entry] - del entries[mpi_exec_index[0]] - entries.append(cmake_cache_path("MPIEXEC_EXECUTABLE", srun_wrapper)) - return entries def find_path_replacement(self, path1, path2, path_replacements, name, entries): root = os.path.commonprefix([path1, path2]) if root.endswith(os.path.sep): - root = root[:-len(os.path.sep)] + root = root[: -len(os.path.sep)] if root: path_replacements[root] = "${" + name + "}" entries.append(cmake_cache_path(name, root)) @@ -431,7 +457,7 @@ def initconfig_package_entries(self): entries.append("# TPLs") entries.append("#------------------{0}\n".format("-" * 60)) - # Try to find the common prefix of the TPL directory. + # Try to find the common prefix of the TPL directory. # If found, we will use this in the TPL paths path1 = os.path.realpath(spec["conduit"].prefix) path2 = os.path.realpath(self.prefix) @@ -505,6 +531,11 @@ def initconfig_package_entries(self): python_path = python_path.replace(key, path_replacements[key]) entries.append(cmake_cache_path("PYTHON_EXECUTABLE", python_path)) + if spec.satisfies("^py-jsonschema"): + jsonschema_dir = get_spec_path(spec, "py-jsonschema", path_replacements, use_bin=True) + jsonschema_path = os.path.join(jsonschema_dir, "jsonschema") + entries.append(cmake_cache_path("JSONSCHEMA_EXECUTABLE", jsonschema_path)) + enable_docs = spec.satisfies("^doxygen") or spec.satisfies("^py-sphinx") entries.append(cmake_cache_option("ENABLE_DOCS", enable_docs)) diff --git a/scripts/spack/packages/axomdevtools/package.py b/scripts/spack/packages/axomdevtools/package.py index b80f815775..f6c6e3118c 100644 --- a/scripts/spack/packages/axomdevtools/package.py +++ b/scripts/spack/packages/axomdevtools/package.py @@ -18,4 +18,6 @@ class Axomdevtools(BundlePackage): depends_on("graphviz") depends_on("py-sphinx") depends_on("py-shroud") + depends_on("py-sphinxcontrib-jquery") + depends_on("py-jsonschema") depends_on("llvm+clang@10.0.0") diff --git a/scripts/spack/packages/py-shroud/package.py b/scripts/spack/packages/py-shroud/package.py new file mode 100644 index 0000000000..1416aee3d7 --- /dev/null +++ b/scripts/spack/packages/py-shroud/package.py @@ -0,0 +1,29 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyShroud(PythonPackage): + """Create Fortran wrappers for a C++ library.""" + + homepage = "https://github.com/LLNL/shroud" + git = "https://github.com/LLNL/shroud.git" + tags = ["radiuss"] + + license("BSD-3-Clause") + + version("develop", branch="develop") + version("master", branch="master") + version("0.13.0", tag="v0.13.0", commit="4388ff1b689bbe450ba7d1b9bc4e1fe2563a4101") + version("0.12.2", tag="v0.12.2", commit="939ba0a3e8b5a885da3ddaebb92bf93cb12b0401") + version("0.12.1", tag="v0.12.1", commit="c09344655371885a42783f8c0ac8a31f2bbffc9f") + version("0.11.0", tag="v0.11.0", commit="503b852796d549199c5ab94b14e59ebd62988870") + version("0.10.1", tag="v0.10.1", commit="13a3c70bc5190e0e8531e17925928fbd7154acb5") + version("0.9.0", tag="v0.9.0", commit="94aa2831290d10b604df16cb87ee17aa722fb998") + version("0.8.0", tag="v0.8.0", commit="b58ac35f41514428d08849a578c45ad444bfddc9") + + depends_on("py-setuptools", type=("build", "run")) + depends_on("py-pyyaml@4.2:", type=("build", "run")) diff --git a/scripts/spack/radiuss-spack-configs b/scripts/spack/radiuss-spack-configs index 5dad973b73..d43946bed0 160000 --- a/scripts/spack/radiuss-spack-configs +++ b/scripts/spack/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 5dad973b737aa39bd984285c4376ad417e40c9cf +Subproject commit d43946bed028933a8b8770adca3dde78987f6626 diff --git a/scripts/spack/specs.json b/scripts/spack/specs.json index c46194c663..fed1c5f3a1 100644 --- a/scripts/spack/specs.json +++ b/scripts/spack/specs.json @@ -1,6 +1,6 @@ { "__comment__":"##############################################################################", - "__comment__":"# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and ", + "__comment__":"# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ", "__comment__":"# other Axom Project Developers. See the top-level LICENSE file for details. ", "__comment__":"# ", "__comment__":"# SPDX-License-Identifier: (BSD-3-Clause) ", @@ -13,29 +13,20 @@ "__comment__":"# ", "__comment__":"##############################################################################", - "toss_3_x86_64_ib": - [ "clang@9.0.0+devtools+mfem+c2c", - "clang@10.0.0+devtools+mfem+c2c+scr", - "gcc@8.3.1+devtools+mfem+c2c+scr", - "gcc@8.1.0~fortran+devtools~mfem+c2c+scr", - "intel@19.0.4~openmp+devtools+mfem+c2c" ], - "toss_4_x86_64_ib": - [ "gcc@10.3.1+devtools+hdf5+mfem+c2c", - "clang@14.0.6+devtools+hdf5+mfem+c2c" ], + [ "gcc@10.3.1+devtools+hdf5+mfem+c2c+scr", + "clang@14.0.6+devtools+hdf5+mfem+c2c+scr", + "intel@2022.1.0+devtools+hdf5+mfem+c2c" ], "__comment__":"# Use amdgpu_target=gfx90a for tioga/rzvernal; and gfx908 for rznevada", "__comment__":"# -Wno-int-conversion flag needed for building HDF5", "toss_4_x86_64_ib_cray": - [ "clang@14.0.0~openmp+rocm+mfem+c2c amdgpu_target=gfx90a ^hip@5.2.3 ^rocprim@5.2.3 ^hsa-rocr-dev@5.2.3 ^llvm-amdgpu@5.2.3 ^raja~openmp+rocm ^umpire~openmp+rocm", - "clang@15.0.0~openmp+rocm+mfem+c2c amdgpu_target=gfx90a ^hip@5.4.3 ^hsa-rocr-dev@5.4.3 ^llvm-amdgpu@5.4.3 ^rocprim@5.4.3 ^raja~openmp+rocm ^umpire~openmp+rocm ^hdf5 cflags=-Wno-int-conversion", - "cce@15.0.1~openmp+rocm+mfem+c2c amdgpu_target=gfx90a ^hip@5.4.3 ^hsa-rocr-dev@5.4.3 ^llvm-amdgpu@5.4.3 ^rocprim@5.4.3 ^raja~openmp+rocm ^umpire~openmp+rocm ^hdf5 cflags=-Wno-int-conversion", - "clang@16.0.0~openmp+rocm+mfem+c2c amdgpu_target=gfx90a ^hip@5.6.0 ^hsa-rocr-dev@5.6.0 ^llvm-amdgpu@5.6.0 ^rocprim@5.6.0 ^raja~openmp+rocm ^umpire~openmp+rocm ^hdf5 cflags=-Wno-int-conversion" ], + [ "clang@16.0.0~openmp+rocm+mfem+c2c amdgpu_target=gfx90a ^hip@5.6.0 ^hsa-rocr-dev@5.6.0 ^llvm-amdgpu@5.6.0 ^rocprim@5.6.0 ^raja~openmp+rocm ^umpire~openmp+rocm ^hdf5 cflags=-Wno-int-conversion" ], "__comment__":"# Note: clang-ibm + raja+openmp causes runtime failures, turning it off until there is an alternative", "blueos_3_ppc64le_ib_p9": - [ "clang@10.0.1.1~openmp+devtools+mfem+c2c", - "clang@10.0.1.2~openmp+devtools+mfem+c2c+cuda cuda_arch=70", + [ "clang@10.0.1.1+devtools+mfem+c2c", + "clang@10.0.1.2+devtools+mfem+c2c+cuda cuda_arch=70", "gcc@8.3.1.1+devtools~mfem+c2c", "gcc@8.3.1.2+devtools~mfem+c2c+cuda cuda_arch=70", "xl@16.1.1.1~openmp+devtools+mfem+c2c", diff --git a/scripts/uncrustfiy.bash b/scripts/uncrustfiy.bash index 74bb093d3d..44514c391a 100755 --- a/scripts/uncrustfiy.bash +++ b/scripts/uncrustfiy.bash @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/scripts/update_copyright_date.sh b/scripts/update_copyright_date.sh index d10df611ab..a205d981fb 100755 --- a/scripts/update_copyright_date.sh +++ b/scripts/update_copyright_date.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -43,28 +43,28 @@ for i in `cat files2change` do echo $i cp $i $i.sed.bak - sed "s/Copyright (c) 2017-2022/Copyright (c) 2017-2023/" $i.sed.bak > $i + sed "s/Copyright (c) 2017-2023/Copyright (c) 2017-2024/" $i.sed.bak > $i done echo LICENSE cp LICENSE LICENSE.sed.bak -sed "s/Copyright (c) 2017-2022/Copyright (c) 2017-2023/" LICENSE.sed.bak > LICENSE +sed "s/Copyright (c) 2017-2023/Copyright (c) 2017-2024/" LICENSE.sed.bak > LICENSE echo RELEASE cp RELEASE RELEASE.sed.bak -sed "s/2017-2022/2017-2023/" RELEASE.sed.bak > RELEASE +sed "s/2017-2023/2017-2024/" RELEASE.sed.bak > RELEASE echo README cp README.md README.md.sed.bak -sed "s/2017-2022/2017-2023/" README.md.sed.bak > README.md +sed "s/2017-2023/2017-2024/" README.md.sed.bak > README.md echo RELEASE-NOTES cp RELEASE-NOTES.md RELEASE-NOTES.md.sed.bak -sed "s/2017-2022/2017-2023/" RELEASE-NOTES.md.sed.bak > RELEASE-NOTES.md +sed "s/2017-2023/2017-2024/" RELEASE-NOTES.md.sed.bak > RELEASE-NOTES.md echo src/conf.py cp src/conf.py src/conf.py.sed.bak -sed "s/2017-2022/2017-2023/" src/conf.py.sed.bak > src/conf.py +sed "s/2017-2023/2017-2024/" src/conf.py.sed.bak > src/conf.py #============================================================================= # Remove temporary files created in the process diff --git a/scripts/vcpkg_ports/axom/portfile.cmake b/scripts/vcpkg_ports/axom/portfile.cmake index afd8199975..7df33f210e 100644 --- a/scripts/vcpkg_ports/axom/portfile.cmake +++ b/scripts/vcpkg_ports/axom/portfile.cmake @@ -3,7 +3,7 @@ message(STATUS "CURRENT_INSTALLED_DIR -- ${CURRENT_INSTALLED_DIR}") message(STATUS "PORT -- ${PORT}") set(_copyright [=[ -Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other Axom Project Developers. See the top-level LICENSE file for details. SPDX-License-Identifier: (BSD-3-Clause) @@ -14,7 +14,7 @@ set(_host-config_hdr [=[ #------------------------------------------------------------------------------ # !!!! This is a generated file, edit at own risk !!!! #------------------------------------------------------------------------------ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/share/axom/logo/axom_logo_transparent.png b/share/axom/logo/axom_logo_transparent.png new file mode 100644 index 0000000000..d539728952 Binary files /dev/null and b/share/axom/logo/axom_logo_transparent.png differ diff --git a/src/.clang-tidy b/src/.clang-tidy index e950a133fc..ae714d78be 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -1,6 +1,10 @@ -Checks: '-*,readability-braces-around-statements' +# Adds some checks to the code +# the following might also be useful: +# modernize-use-nullptr +# readability-static-definition-in-anonymous-namespace +Checks: '-*,readability-braces-around-statements,modernize-use-using' WarningsAsErrors: '' -HeaderFilterRegex: '.*' +HeaderFilterRegex: "^.*.hpp$|^.*.cpp$" AnalyzeTemporaryDtors: false FormatStyle: none CheckOptions: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c0a70aad7..a217514590 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -97,9 +97,8 @@ if (“${PROJECT_SOURCE_DIR}” STREQUAL “${CMAKE_SOURCE_DIR}”) set(ENABLE_GMOCK ON CACHE BOOL "") endif() - # Mark BLT's built-in third-party targets as EXPORTABLE so they can be added - # to the axom-targets export set - set(BLT_EXPORT_THIRDPARTY ON CACHE BOOL "") + # We use BLT's install targets logic + set(BLT_EXPORT_THIRDPARTY OFF CACHE BOOL "" FORCE) endif() if("${BLT_CXX_STD}" STREQUAL "c++98" OR "${BLT_CXX_STD}" STREQUAL "c++11") diff --git a/src/axom/CMakeLists.txt b/src/axom/CMakeLists.txt index 67674b6e9a..a78442837e 100644 --- a/src/axom/CMakeLists.txt +++ b/src/axom/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -45,6 +45,15 @@ install(EXPORT axom-targets NAMESPACE axom:: DESTINATION lib/cmake) +# Create alias targets for projects that include us as a subdirectory +add_library(axom INTERFACE) +target_link_libraries(axom INTERFACE ${AXOM_COMPONENTS_ENABLED}) + +foreach(_comp ${AXOM_COMPONENTS_ENABLED}) + add_library(axom::${_comp} ALIAS ${_comp}) +endforeach() + + #------------------------------------------------------------------------------ # Generate export symbols #------------------------------------------------------------------------------ diff --git a/src/axom/config.hpp.in b/src/axom/config.hpp.in index 2f111f14a4..e2f278e54f 100644 --- a/src/axom/config.hpp.in +++ b/src/axom/config.hpp.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and + * Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and * other Axom Project Developers. See the top-level LICENSE file for details. * * SPDX-License-Identifier: (BSD-3-Clause) @@ -80,6 +80,10 @@ #cmakedefine AXOM_USE_SPARSEHASH #cmakedefine AXOM_USE_UMPIRE +/* + * Compiler defines for third-party executables + */ +#cmakedefine JSONSCHEMA_EXECUTABLE "@JSONSCHEMA_EXECUTABLE@" /* * We need to explicitly add some definitions on Windows diff --git a/src/axom/core/Array.hpp b/src/axom/core/Array.hpp index dc79c623a6..79ecb009f4 100644 --- a/src/axom/core/Array.hpp +++ b/src/axom/core/Array.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -199,7 +199,7 @@ class Array : public ArrayBase> /*! * \brief Copy constructor for an Array instance */ - Array(const Array& other); + AXOM_HOST_DEVICE Array(const Array& other); /*! * \brief Move constructor for an Array instance @@ -257,12 +257,12 @@ class Array : public ArrayBase> { if(this != &other) { + this->clear(); static_cast>&>(*this) = other; m_allocator_id = other.m_allocator_id; m_resize_ratio = other.m_resize_ratio; - initialize(other.size(), other.capacity()); - // Use fill_range to ensure that copy constructors are invoked for each - // element. + setCapacity(other.capacity()); + // Use fill_range to ensure that copy constructors are invoked for each element MemorySpace srcSpace = SPACE; if(srcSpace == MemorySpace::Dynamic) { @@ -270,10 +270,11 @@ class Array : public ArrayBase> } OpHelper::fill_range(m_data, 0, - m_num_elements, + other.size(), m_allocator_id, other.data(), srcSpace); + updateNumElements(other.size()); } return *this; @@ -286,6 +287,7 @@ class Array : public ArrayBase> { if(this != &other) { + this->clear(); if(m_data != nullptr) { axom::deallocate(m_data); @@ -344,6 +346,23 @@ class Array : public ArrayBase> /// @} + /*! + @brief Convert 1D Array into a StackArray. + */ + template + AXOM_HOST_DEVICE inline + typename std::enable_if>::type + to_stack_array() const + { + axom::StackArray rval; + IndexType copyCount = LENGTH1D <= m_num_elements ? LENGTH1D : m_num_elements; + for(IndexType i = 0; i < copyCount; ++i) + { + rval[i] = m_data[i]; + } + return rval; + } + /// @} /// \name Array methods to modify the data. @@ -578,10 +597,13 @@ class Array : public ArrayBase> * \param [in] value the value to be added to the back. * * \note Reallocation is done if the new size will exceed the capacity. + * \note If used in a device kernel, the number of push_backs must not exceed + * the capacity, since device-side reallocations aren't supported. + * \note Array must be allocated in unified memory if calling on the device. * * \pre DIM == 1 */ - void push_back(const T& value); + AXOM_HOST_DEVICE void push_back(const T& value); /*! * \brief Push a value to the back of the array. @@ -589,10 +611,13 @@ class Array : public ArrayBase> * \param [in] value the value to move to the back. * * \note Reallocation is done if the new size will exceed the capacity. + * \note If used in a device kernel, the number of push_backs must not exceed + * the capacity, since device-side reallocations aren't supported. + * \note Array must be allocated in unified memory if calling on the device. * * \pre DIM == 1 */ - void push_back(T&& value); + AXOM_HOST_DEVICE void push_back(T&& value); /*! * \brief Inserts new element at the end of the Array. @@ -601,11 +626,14 @@ class Array : public ArrayBase> * * \note Reallocation is done if the new size will exceed the capacity. * \note The size increases by 1. + * \note If used in a device kernel, the number of push_backs must not exceed + * the capacity, since device-side reallocations aren't supported. + * \note Array must be allocated in unified memory if calling on the device. * * \pre DIM == 1 */ template - void emplace_back(Args&&... args); + AXOM_HOST_DEVICE void emplace_back(Args&&... args); /// @} @@ -706,29 +734,35 @@ class Array : public ArrayBase> * * \note Reallocation is done if the new size will exceed the capacity. */ - template > + template < + typename... Args, + typename Enable = typename std::enable_if< + sizeof...(Args) == DIM && detail::all_types_are_integral::value>::type> void resize(Args... args) { static_assert(std::is_default_constructible::value, "Cannot call Array::resize() when T is non-trivially-" "constructible. Use Array::reserve() and emplace_back()" "instead."); - const StackArray dims {static_cast(args)...}; + const StackArray dims {{static_cast(args)...}}; resizeImpl(dims, true); } /// \overload - template > + template < + typename... Args, + typename Enable = typename std::enable_if< + sizeof...(Args) == DIM && detail::all_types_are_integral::value>::type> void resize(ArrayOptions::Uninitialized, Args... args) { - const StackArray dims {static_cast(args)...}; + const StackArray dims {{static_cast(args)...}}; resizeImpl(dims, false); } template > void resize(IndexType size, const T& value) { - resizeImpl({size}, true, &value); + resizeImpl({{size}}, true, &value); } void resize(const StackArray& size, const T& value) @@ -832,6 +866,16 @@ class Array : public ArrayBase> */ T* reserveForInsert(IndexType n, IndexType pos); + /*! + * \brief Make space for a subsequent insertion into the array. + * + * \param [in] n the number of elements to insert. + * + * \note This version supports concurrent GPU insertions. + * \note Reallocation is not supported. + */ + AXOM_DEVICE IndexType reserveForDeviceInsert(IndexType n); + /*! * \brief Update the number of elements. * @@ -894,7 +938,7 @@ template template Array::Array(Args... args) : ArrayBase>( - StackArray {static_cast(args)...}) + StackArray {{static_cast(args)...}}) , m_allocator_id(axom::detail::getAllocatorID()) { static_assert(sizeof...(Args) == DIM, @@ -910,7 +954,7 @@ template template Array::Array(ArrayOptions::Uninitialized, Args... args) : ArrayBase>( - StackArray {static_cast(args)...}) + StackArray {{static_cast(args)...}}) , m_allocator_id(axom::detail::getAllocatorID()) { static_assert(sizeof...(Args) == DIM, @@ -981,11 +1025,22 @@ Array::Array(std::initializer_list elems, int allocator_id) //------------------------------------------------------------------------------ template -Array::Array(const Array& other) +AXOM_HOST_DEVICE Array::Array(const Array& other) : ArrayBase>( static_cast>&>(other)) , m_allocator_id(other.m_allocator_id) { +#if defined(AXOM_DEVICE_CODE) + #if defined(AXOM_DEBUG) + printf( + "axom::Array: cannot copy-construct on the device.\n" + "This is usually the result of capturing an array by-value in a lambda. " + "Use axom::ArrayView for value captures instead.\n"); + #endif + #if defined(__CUDA_ARCH__) + __trap(); + #endif +#else initialize(other.size(), other.capacity()); // Use fill_range to ensure that copy constructors are invoked for each // element. @@ -1000,6 +1055,7 @@ Array::Array(const Array& other) m_allocator_id, other.data(), srcSpace); +#endif } //------------------------------------------------------------------------------ @@ -1280,7 +1336,7 @@ inline typename Array::ArrayIterator Array::emplac //------------------------------------------------------------------------------ template -inline void Array::push_back(const T& value) +AXOM_HOST_DEVICE inline void Array::push_back(const T& value) { static_assert(DIM == 1, "push_back is only supported for 1D arrays"); emplace_back(value); @@ -1288,7 +1344,7 @@ inline void Array::push_back(const T& value) //------------------------------------------------------------------------------ template -inline void Array::push_back(T&& value) +AXOM_HOST_DEVICE inline void Array::push_back(T&& value) { static_assert(DIM == 1, "push_back is only supported for 1D arrays"); emplace_back(std::move(value)); @@ -1297,10 +1353,16 @@ inline void Array::push_back(T&& value) //------------------------------------------------------------------------------ template template -inline void Array::emplace_back(Args&&... args) +AXOM_HOST_DEVICE inline void Array::emplace_back(Args&&... args) { static_assert(DIM == 1, "emplace_back is only supported for 1D arrays"); +#ifdef AXOM_DEVICE_CODE + IndexType insertIndex = reserveForDeviceInsert(1); + // Construct in-place in uninitialized memory. + new(m_data + insertIndex) T(std::forward(args)...); +#else emplace(size(), std::forward(args)...); +#endif } //------------------------------------------------------------------------------ @@ -1419,15 +1481,15 @@ inline void Array::initialize_from_other( #endif m_allocator_id = axom::detail::getAllocatorID(); } - initialize(num_elements, num_elements); - // Use fill_range to ensure that copy constructors are invoked for each - // element. + this->setCapacity(num_elements); + // Use fill_range to ensure that copy constructors are invoked for each element OpHelper::fill_range(m_data, 0, - m_num_elements, + num_elements, m_allocator_id, other_data, other_data_space); + this->updateNumElements(num_elements); } //------------------------------------------------------------------------------ @@ -1455,6 +1517,37 @@ inline T* Array::reserveForInsert(IndexType n, IndexType pos) return m_data + pos; } +//------------------------------------------------------------------------------ +template +AXOM_DEVICE inline IndexType Array::reserveForDeviceInsert(IndexType n) +{ +#ifndef AXOM_DEVICE_CODE + // Host path: should never be called. + AXOM_UNUSED_VAR(n); + assert(false); + return {}; +#else + // Device path: supports insertion while m_num_elements < m_capacity + // Does not support insertions which require reallocating the underlying + // buffer. + IndexType new_pos = RAJA::atomicAdd(&m_num_elements, n); + if(new_pos >= m_capacity) + { + #ifdef AXOM_DEBUG + printf( + "Array::reserveForInsert: size() exceeded capacity() when inserting " + "on the device.\n"); + #endif + #ifdef AXOM_USE_CUDA + __trap(); + #elif defined(AXOM_USE_HIP) + abort(); + #endif + } + return new_pos; +#endif +} + //------------------------------------------------------------------------------ template inline void Array::updateNumElements(IndexType new_num_elements) @@ -1478,7 +1571,15 @@ inline void Array::setCapacity(IndexType new_capacity) updateNumElements(new_capacity); } - m_data = axom::reallocate(m_data, new_capacity, m_allocator_id); + // Create a new block of memory, and move the elements over. + T* new_data = axom::allocate(new_capacity, m_allocator_id); + OpHelper::realloc_move(new_data, m_num_elements, m_data, m_allocator_id); + + // Destroy the original array. + axom::deallocate(m_data); + + // Set the pointer and capacity to the new memory. + m_data = new_data; m_capacity = new_capacity; assert(m_data != nullptr || m_capacity <= 0); @@ -1506,8 +1607,7 @@ inline void Array::dynamicRealloc(IndexType new_num_elements) utilities::processAbort(); } - m_data = axom::reallocate(m_data, new_capacity, m_allocator_id); - m_capacity = new_capacity; + setCapacity(new_capacity); assert(m_data != nullptr || m_capacity <= 0); } diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index 610822f893..1e54da7a3d 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -231,7 +231,7 @@ class ArrayBase static_assert(sizeof...(Args) <= DIM, "Index dimensions different from array dimensions"); constexpr int UDim = sizeof...(Args); - const StackArray indices {static_cast(args)...}; + const StackArray indices {{static_cast(args)...}}; return (*this)[indices]; } /// \overload @@ -255,14 +255,14 @@ class ArrayBase */ AXOM_HOST_DEVICE SliceType<1> operator[](const IndexType idx) { - const StackArray slice {idx}; + const StackArray slice {{idx}}; return (*this)[slice]; } /// \overload AXOM_HOST_DEVICE ConstSliceType<1> operator[](const IndexType idx) const { - const StackArray slice {idx}; + const StackArray slice {{idx}}; return (*this)[slice]; } @@ -1007,6 +1007,21 @@ struct ArrayOpsBase array + dst); } } + + /*! + * \brief Moves a range of elements to a new allocation. + * + * \param [inout] array the array to move the elements to. + * \param [in] nelems the number of elements to move. + * \param [in] values the destination index of the range of elements + */ + static void realloc_move(T* array, IndexType nelems, T* values) + { + std::uninitialized_copy(std::make_move_iterator(values), + std::make_move_iterator(values + nelems), + array); + destroy(values, 0, nelems); + } }; #if defined(AXOM_USE_GPU) && defined(AXOM_GPUCC) && defined(AXOM_USE_UMPIRE) @@ -1255,6 +1270,21 @@ struct ArrayOpsBase axom::copy(array + dst, tmp_buf, nelems * sizeof(T)); axom::deallocate(tmp_buf); } + + /*! + * \brief Moves a range of elements to a new allocation. + * + * \param [inout] array the array to move the elements to. + * \param [in] nelems the number of elements to move. + * \param [in] values the destination index of the range of elements + */ + static void realloc_move(T* array, IndexType nelems, T* values) + { + // NOTE: technically this is incorrect for non-trivially relocatable types, + // but since we only support trivially-relocatable types on the GPU, a + // bitcopy will suffice. + axom::copy(array, values, nelems * sizeof(T)); + } }; #endif @@ -1322,6 +1352,12 @@ struct ArrayOps Base::move(array, src_begin, src_end, dst); } + static void realloc_move(T* array, IndexType nelems, T* values, int allocId) + { + AXOM_UNUSED_VAR(allocId); + Base::realloc_move(array, nelems, values); + } + template static void emplace(T* array, IndexType dst, IndexType allocId, Args&&... args) { @@ -1442,6 +1478,22 @@ struct ArrayOps Base::move(array, src_begin, src_end, dst); } + static void realloc_move(T* array, IndexType nelems, T* values, int allocId) + { +#if defined(AXOM_USE_GPU) && defined(AXOM_GPUCC) && defined(AXOM_USE_UMPIRE) + MemorySpace space = getAllocatorSpace(allocId); + + if(space == MemorySpace::Device) + { + BaseDevice::realloc_move(array, nelems, values); + return; + } +#else + AXOM_UNUSED_VAR(allocId); +#endif + Base::realloc_move(array, nelems, values); + } + template static void emplace(T* array, IndexType dst, IndexType allocId, Args&&... args) { diff --git a/src/axom/core/ArrayIteratorBase.hpp b/src/axom/core/ArrayIteratorBase.hpp index ded36734d5..e549ee981d 100644 --- a/src/axom/core/ArrayIteratorBase.hpp +++ b/src/axom/core/ArrayIteratorBase.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/ArrayView.hpp b/src/axom/core/ArrayView.hpp index 51c1f41d18..b98790bf20 100644 --- a/src/axom/core/ArrayView.hpp +++ b/src/axom/core/ArrayView.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -233,7 +233,8 @@ using MCArrayView = ArrayView; template template ArrayView::ArrayView(T* data, Args... args) - : ArrayView(data, StackArray {static_cast(args)...}) + : ArrayView(data, + StackArray {{static_cast(args)...}}) { static_assert(sizeof...(Args) == DIM, "Array size must match number of dimensions"); diff --git a/src/axom/core/CMakeLists.txt b/src/axom/core/CMakeLists.txt index 31ee8570a0..0d45eccc89 100644 --- a/src/axom/core/CMakeLists.txt +++ b/src/axom/core/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -48,6 +48,9 @@ set(core_headers numerics/matvecops.hpp numerics/polynomial_solvers.hpp + ## detail + detail/FlatTable.hpp + ## core Array.hpp ArrayBase.hpp @@ -56,6 +59,7 @@ set(core_headers IteratorBase.hpp Macros.hpp Map.hpp + FlatMap.hpp Path.hpp StackArray.hpp Types.hpp @@ -64,6 +68,7 @@ set(core_headers ## execution execution/execution_space.hpp execution/for_all.hpp + execution/runtime_policy.hpp execution/synchronize.hpp execution/internal/seq_exec.hpp @@ -117,6 +122,9 @@ axom_add_library(NAME core FOLDER axom/core ) +# Set file back to C++ due to nvcc compiler error +set_source_files_properties(utilities/System.cpp PROPERTIES LANGUAGE CXX) + # Basic includes that should be inherited to all Axom targets target_include_directories(core PUBLIC $ diff --git a/src/axom/core/FlatMap.hpp b/src/axom/core/FlatMap.hpp new file mode 100644 index 0000000000..db0bb4e345 --- /dev/null +++ b/src/axom/core/FlatMap.hpp @@ -0,0 +1,820 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#ifndef Axom_Core_FlatMap_HPP +#define Axom_Core_FlatMap_HPP + +#include +#include +#include +#include "axom/config.hpp" +#include "axom/core/Macros.hpp" +#include "axom/core/detail/FlatTable.hpp" + +namespace axom +{ +/*! + * \class FlatMap + * + * \brief Provides a generic associative key-value container. + * + * The FlatMap class is a container which maps unique keys to a single value. + * It supports insertion, removal, and lookup of key-value pairs in amortized + * constant time. + * + * \note FlatMap is designed to be a largely drop-in replacement for + * std::unordered_map. However, FlatMap is internally represented as an open- + * addressing, quadratic probing hash map; thus, the API differs from + * unordered_map in certain regards: + * + * - Operations which insert a new element may invalidate references and + * iterators to existing elements in the container, if a resize of the + * underlying array is triggered. + * - Methods which only make sense for a closed-addressing hash map, such as + * begin/end(bucket_index), or bucket(key), are not implemented. + * + * \tparam KeyType the type of the keys to hold + * \tparam ValueType the type of the values to hold + * \tparam Hash the hash to use with the key type + * + * \pre KeyType must be EqualityComparable + * \pre Hash is invocable with an instance of KeyType, and returns an integer + * value (32- or 64-bit) + */ +template > +class FlatMap + : detail::flat_map::SequentialLookupPolicy +{ +private: + using LookupPolicy = + detail::flat_map::SequentialLookupPolicy; + using LookupPolicy::NO_MATCH; + + constexpr static int BucketsPerGroup = detail::flat_map::GroupBucket::Size; + + template + class IteratorImpl; + + using KeyValuePair = std::pair; + + template + friend class IteratorImpl; + + using MixedHash = detail::flat_map::HashMixer64; + +public: + using key_type = KeyType; + using mapped_type = ValueType; + using size_type = IndexType; + using value_type = KeyValuePair; + using iterator = IteratorImpl; + using const_iterator = IteratorImpl; + + /*! + * \brief Constructs a FlatMap with no elements. + */ + FlatMap() : FlatMap(MIN_NUM_BUCKETS) { } + + /*! + * \brief Constructs a FlatMap with at least a given number of buckets. + * + * \param [in] bucket_count the minimum number of buckets to allocate + */ + explicit FlatMap(IndexType bucket_count); + + /*! + * \brief Constructs a FlatMap with a range of elements. + * + * \param [in] first iterator pointing to the beginning of the range + * \param [in] last iterator pointing to the end of the range + * \param [in] bucket_count minimum number of buckets to allocate (optional) + */ + template + FlatMap(InputIt first, InputIt last, IndexType bucket_count = -1) + : FlatMap(std::distance(first, last), first, last, bucket_count) + { } + + /*! + * \brief Constructs a FlatMap with a range of elements. + * + * \param [in] init a list of pairs to initialize the map with + * \param [in] bucket_count minimum number of buckets to allocate (optional) + */ + explicit FlatMap(std::initializer_list init, + IndexType bucket_count = -1) + : FlatMap(init.begin(), init.end(), bucket_count) + { } + + /*! + * \brief Move constructor for a FlatMap instance. + * + * \param other the FlatMap to move data from + */ + FlatMap(FlatMap&& other) : FlatMap() { swap(other); } + + /*! + * \brief Move assignment operator for a FlatMap instance. + * + * \param other the FlatMap to move data from + */ + FlatMap& operator=(FlatMap&& other) { swap(other); } + + /*! + * \brief Copy constructor for a FlatMap instance. + * + * \param other the FlatMap to copy data from + * + * \pre KeyType must be copy-constructible + * \pre ValueType must be copy-constructible + */ + FlatMap(const FlatMap& other) + : m_numGroups2(other.m_numGroups2) + , m_size(other.m_size) + , m_metadata(other.m_metadata) + , m_buckets(other.m_buckets.size()) + , m_loadCount(other.m_loadCount) + { + static_assert(std::is_copy_constructible::value, + "Cannot copy an axom::FlatMap when key type is not " + "copy-constructible."); + static_assert(std::is_copy_constructible::value, + "Cannot copy an axom::FlatMap when value type is not " + "copy-constructible."); + // Copy all elements. + const auto metadata = m_metadata.view(); + IndexType index = this->nextValidIndex(metadata, NO_MATCH); + while(index < bucket_count()) + { + new(&m_buckets[index].data) KeyValuePair(other.m_buckets[index].get()); + index = this->nextValidIndex(metadata, index); + } + } + + /*! + * \brief Copy assignment operator for a FlatMap instance. + * + * \param other the FlatMap to copy data from + * + * \pre KeyType must be copy-constructible + * \pre ValueType must be copy-constructible + */ + FlatMap& operator=(const FlatMap& other) + { + static_assert(std::is_copy_constructible::value, + "Cannot copy an axom::FlatMap when key type is not " + "copy-constructible."); + static_assert(std::is_copy_constructible::value, + "Cannot copy an axom::FlatMap when value type is not " + "copy-constructible."); + if(*this != other) + { + FlatMap new_map(other); + swap(new_map); + } + } + + /// \brief Destructor for a FlatMap instance. + ~FlatMap() + { + // Destroy all elements. + const auto metadata = m_metadata.view(); + IndexType index = this->nextValidIndex(metadata, NO_MATCH); + while(index < bucket_count()) + { + m_buckets[index].get().~KeyValuePair(); + index = this->nextValidIndex(metadata, index); + } + + // Unlike in clear() we don't need to reset metadata here. + } + + /*! + * \brief Swaps the contents of one FlatMap with another. + */ + void swap(FlatMap& other) + { + axom::utilities::swap(m_numGroups2, other.m_numGroups2); + axom::utilities::swap(m_size, other.m_size); + m_metadata.swap(other.m_metadata); + m_buckets.swap(other.m_buckets); + axom::utilities::swap(m_loadCount, other.m_loadCount); + } + + /*! + * \brief Returns an iterator to the first valid object in the bucket array. + */ + /// @{ + iterator begin() + { + IndexType firstBucketIndex = this->nextValidIndex(m_metadata, NO_MATCH); + return iterator(this, firstBucketIndex); + } + const_iterator begin() const + { + IndexType firstBucketIndex = this->nextValidIndex(m_metadata, NO_MATCH); + return const_iterator(this, firstBucketIndex); + } + const_iterator cbegin() const + { + IndexType firstBucketIndex = this->nextValidIndex(m_metadata, NO_MATCH); + return const_iterator(this, firstBucketIndex); + } + /// @} + + /*! + * \brief Returns an iterator to "one past" the last valid object in the + * bucket array. + */ + /// @{ + iterator end() { return iterator(this, bucket_count()); } + const_iterator end() const { return const_iterator(this, bucket_count()); } + const_iterator cend() const { return const_iterator(this, bucket_count()); } + /// @} + + /*! + * \brief Returns true if there are no entries in the FlatMap, false + * otherwise. + */ + bool empty() const { return m_size == 0; } + + /*! + * \brief Returns the number of entries stored in the FlatMap. + */ + IndexType size() const { return m_size; } + + /*! + * \brief Try to find an entry with a given key. + * + * \param [in] key the key to search for + * + * \return An iterator pointing to the corresponding key-value pair, or end() + * if the key wasn't found. + */ + /// @{ + iterator find(const KeyType& key); + const_iterator find(const KeyType& key) const; + /// @} + + /*! + * \brief Try to find an entry with a given key. + * + * \param [in] key the key to search for + * + * \return A reference to the corresponding value. + * \throw std::out_of_range if the key is not found. + */ + /// @{ + ValueType& at(const KeyType& key) + { + auto it = this->find(key); + if(it == end()) + { + throw std::out_of_range {"axom::FlatMap::find(): key not found"}; + } + return it->second; + } + const ValueType& at(const KeyType& key) const + { + auto it = this->find(key); + if(it == end()) + { + throw std::out_of_range {"axom::FlatMap::find(): key not found"}; + } + return it->second; + } + /// @} + + /*! + * \brief Find an entry with a given key. + * + * If a corresponding value does not exist, a default value for the value + * type will be inserted for the given key. + * + * \param [in] key the key to search for + * + * \return A reference to the corresponding value. + * + * \pre ValueType is default-constructible + */ + /// @{ + ValueType& operator[](const KeyType& key) + { + static_assert(std::is_default_constructible::value, + "Cannot use axom::FlatMap::operator[] when value type is not " + "default-constructible."); + return this->try_emplace(key).first->second; + } + const ValueType& operator[](const KeyType& key) const + { + static_assert(std::is_default_constructible::value, + "Cannot use axom::FlatMap::operator[] when value type is not " + "default-constructible."); + return this->try_emplace(key).first->second; + } + /// @} + + /*! + * \brief Return the number of entries matching a given key. + * + * This method will always return 0 or 1. + * + * \param [in] key the key to search for + */ + IndexType count(const KeyType& key) const + { + return contains(key) ? IndexType {1} : IndexType {0}; + } + + /*! + * \brief Return true if the FlatMap contains a key, false otherwise. + * + * \param [in] key the key to search for + */ + bool contains(const KeyType& key) const { return (find(key) != end()); } + + /*! + * \brief Erases all elements from the FlatMap. + */ + void clear() + { + // Destroy all elements. + IndexType index = this->nextValidIndex(m_metadata, NO_MATCH); + while(index < bucket_count()) + { + m_buckets[index].get().~KeyValuePair(); + index = this->nextValidIndex(m_metadata, index); + } + + // Also reset metadata. + for(int group_index = 0; group_index < m_metadata.size(); group_index++) + { + m_metadata[group_index] = detail::flat_map::GroupBucket {}; + } + m_metadata[m_metadata.size() - 1].setSentinel(); + m_size = 0; + m_loadCount = 0; + } + + /*! + * \brief Inserts a key-value pair into the FlatMap. + * + * If the key already exists in the FlatMap, insertion is skipped. + * Otherwise, the key-value mapping is inserted into the FlatMap. + * + * \param [in] value the key-value pair to insert + * + * \return A pair consisting of: + * - an iterator pointing to either the existing key-value pair, or the + * newly-inserted pair + * - true if a new pair was inserted, false otherwise + */ + /// @{ + std::pair insert(const value_type& value) + { + auto emplace_pos = getEmplacePos(value.first); + emplaceImpl(emplace_pos, false, value); + return emplace_pos; + } + std::pair insert(value_type&& value) + { + auto emplace_pos = getEmplacePos(value.first); + emplaceImpl(emplace_pos, false, std::move(value)); + return emplace_pos; + } + template + std::pair insert(InputPair&& pair) + { + return emplace(std::forward(pair)); + } + template + std::pair emplace(InputArgs&&... pair) + { + KeyValuePair kv {std::forward(pair)...}; + auto emplace_pos = getEmplacePos(kv.first); + emplaceImpl(emplace_pos, false, std::move(kv)); + return emplace_pos; + } + /// @} + + /*! + * \brief Inserts a range of key-value pairs into the FlatMap. + * + * If the key already exists in the FlatMap, insertion is skipped. + * Otherwise, the key-value mapping is inserted into the FlatMap. + * + * \param [in] first the beginning of the range of pairs + * \param [in] last the end of the range of pairs + */ + template + void insert(InputIt first, InputIt last); + + /*! + * \brief Inserts a key-value pair into the FlatMap. + * + * If the key already exists, assigns the value to the existing key in the + * FlatMap. + * + * \param [in] key the key to insert or assign + * \param [in] args arguments to construct the value with + * + * \return A pair consisting of: + * - an iterator pointing to either the existing key-value pair, or the + * newly-inserted pair + * - true if a new pair was inserted, false otherwise + */ + /// {@ + template + std::pair insert_or_assign(const KeyType& key, Args&&... args) + { + auto emplace_pos = getEmplacePos(key); + emplaceImpl(emplace_pos, + true, + std::piecewise_construct, + std::forward_as_tuple(key), + std::forward_as_tuple(std::forward(args)...)); + return emplace_pos; + } + template + std::pair insert_or_assign(KeyType&& key, Args&&... args) + { + auto emplace_pos = getEmplacePos(key); + emplaceImpl(emplace_pos, + true, + std::piecewise_construct, + std::forward_as_tuple(key), + std::forward_as_tuple(std::forward(args)...)); + return emplace_pos; + } + /// @} + + /*! + * \brief Inserts a key-value pair into the FlatMap. + * + * If the key already exists in the FlatMap, insertion is skipped. + * Otherwise, the key-value mapping is inserted into the FlatMap. + * + * Compared to emplace(), this method only moves-from the value arguments + * if the key does not exist; otherwise, the input arguments are left as-is. + * + * \param [in] key the key to insert or assign + * \param [in] args arguments to construct the value with. + * + * \return A pair consisting of: + * - an iterator pointing to either the existing key-value pair, or the + * newly-inserted pair + * - true if a new pair was inserted, false otherwise + */ + /// {@ + template + std::pair try_emplace(const KeyType& key, Args&&... args) + { + auto emplace_pos = getEmplacePos(key); + emplaceImpl(emplace_pos, + false, + std::piecewise_construct, + std::forward_as_tuple(key), + std::forward_as_tuple(std::forward(args)...)); + return emplace_pos; + } + template + std::pair try_emplace(KeyType&& key, Args&&... args) + { + auto emplace_pos = getEmplacePos(key); + emplaceImpl(emplace_pos, + false, + std::piecewise_construct, + std::forward_as_tuple(key), + std::forward_as_tuple(std::forward(args)...)); + return emplace_pos; + } + /// @} + + /*! + * \brief Remove a key-value pair from the FlatMap, specified by iterator. + * + * \param pos the iterator pointing to the key-value pair to remove + * + * \return an iterator to the next valid entry after the removed entry + */ + /// {@ + iterator erase(iterator pos) { return erase(const_iterator {pos}); } + iterator erase(const_iterator pos); + /// @} + + /*! + * \brief Remove a key-value pair from the FlatMap, specified by key. + * + * If the key doesn't exist in the FlatMap, does nothing. + * + * \param key the key to remove + * + * \return 1 if an entry was removed, 0 otherwise + */ + IndexType erase(const KeyType& key) + { + const_iterator it = find(key); + if(it != end()) + { + erase(it); + return 1; + } + return 0; + } + + /*! + * \brief Returns the number of buckets allocated in the FlatMap. + * + * The maximum number of elements that can be stored in the FlatMap without + * resizing and rehashing is bucket_count() * max_load_factor(). + */ + IndexType bucket_count() const { return m_buckets.size(); } + + /*! + * \brief Returns the current load factor of the FlatMap. + */ + double load_factor() const { return ((double)m_loadCount) / bucket_count(); } + + /*! + * \brief Returns the maximum load factor of the FlatMap. + */ + double max_load_factor() const { return MAX_LOAD_FACTOR; } + + /*! + * \brief Explicitly rehash the FlatMap with a given number of buckets. + * + * \param count the minimum number of buckets to allocate for the rehash + */ + void rehash(IndexType count) + { + FlatMap rehashed(m_size, + std::make_move_iterator(begin()), + std::make_move_iterator(end()), + count); + this->swap(rehashed); + } + + /*! + * \brief Reallocate and rehash the FlatMap, such that up to the specified + * number of elements may be inserted without a rehash. + * + * \param count the number of elements to fit without a rehash + */ + void reserve(IndexType count) { rehash(std::ceil(count / MAX_LOAD_FACTOR)); } + +private: + template + FlatMap(IndexType num_elems, InputIt first, InputIt last, IndexType bucket_count); + + std::pair getEmplacePos(const KeyType& key); + + template + void emplaceImpl(const std::pair& pos, + bool assign_on_existence, + Args&&... args); + + constexpr static IndexType MIN_NUM_BUCKETS {29}; + + IndexType m_numGroups2; // Number of groups of 15 buckets, expressed as a power of 2 + IndexType m_size; + axom::Array m_metadata; + + // Storage details: + using PairStorage = detail::flat_map::TypeErasedStorage; + axom::Array m_buckets; + + // Boost flat_unordered_map uses a fixed load factor. + constexpr static double MAX_LOAD_FACTOR = 0.875; + std::uint64_t m_loadCount; +}; + +template +template +class FlatMap::IteratorImpl +{ +private: + using MapType = FlatMap; + + template + friend class IteratorImpl; + + friend class FlatMap; + +public: + using iterator_category = std::forward_iterator_tag; + using value_type = MapType::value_type; + using difference_type = IndexType; + + using DataType = std::conditional_t; + using MapConstType = std::conditional_t; + using pointer = DataType*; + using reference = DataType&; + +public: + IteratorImpl(MapConstType* map, IndexType internalIdx) + : m_map(map) + , m_internalIdx(internalIdx) + { + assert(m_internalIdx >= 0 && m_internalIdx <= m_map->bucket_count()); + } + + template > + IteratorImpl(IteratorImpl non_const_iter) + : m_map(non_const_iter.m_map) + , m_internalIdx(non_const_iter.m_internalIdx) + { } + + friend bool operator==(const IteratorImpl& lhs, const IteratorImpl& rhs) + { + return lhs.m_internalIdx == rhs.m_internalIdx; + } + + friend bool operator!=(const IteratorImpl& lhs, const IteratorImpl& rhs) + { + return lhs.m_internalIdx != rhs.m_internalIdx; + } + + IteratorImpl& operator++() + { + m_internalIdx = m_map->nextValidIndex(m_map->m_metadata, m_internalIdx); + return *this; + } + + IteratorImpl operator++(int) + { + IteratorImpl next = *this; + ++(*this); + return next; + } + + reference operator*() const { return m_map->m_buckets[m_internalIdx].get(); } + + pointer operator->() const + { + return &(m_map->m_buckets[m_internalIdx].get()); + } + +private: + MapConstType* m_map; + IndexType m_internalIdx; +}; + +template +FlatMap::FlatMap(IndexType bucket_count) + : m_size(0) + , m_loadCount(0) +{ + IndexType minBuckets = MIN_NUM_BUCKETS; + bucket_count = axom::utilities::max(minBuckets, bucket_count); + // Get the smallest power-of-two number of groups satisfying: + // N * GroupSize - 1 >= minBuckets + // TODO: we should add a countl_zero overload for 64-bit integers + { + std::int32_t numGroups = + std::ceil((bucket_count + 1) / (double)BucketsPerGroup); + m_numGroups2 = 31 - (axom::utilities::countl_zero(numGroups)); + } + + IndexType numGroupsRounded = 1 << m_numGroups2; + IndexType numBuckets = numGroupsRounded * BucketsPerGroup - 1; + m_metadata.resize(numGroupsRounded); + m_metadata[numGroupsRounded - 1].setSentinel(); + m_buckets.resize(numBuckets); +} + +template +template +FlatMap::FlatMap(IndexType num_elems, + InputIt first, + InputIt last, + IndexType bucket_count) + : FlatMap(std::max(num_elems, bucket_count)) +{ + insert(first, last); +} + +template +auto FlatMap::find(const KeyType& key) -> iterator +{ + auto hash = MixedHash {}(key); + iterator found_iter = end(); + this->probeIndex(m_numGroups2, + m_metadata, + hash, + [&](IndexType bucket_index) -> bool { + if(this->m_buckets[bucket_index].get().first == key) + { + found_iter = iterator(this, bucket_index); + // Stop tracking. + return false; + } + return true; + }); + return found_iter; +} + +template +auto FlatMap::find(const KeyType& key) const + -> const_iterator +{ + auto hash = MixedHash {}(key); + const_iterator found_iter = end(); + this->probeIndex(m_numGroups2, + m_metadata, + hash, + [&](IndexType bucket_index) -> bool { + if(this->m_buckets[bucket_index].get().first == key) + { + found_iter = const_iterator(this, bucket_index); + // Stop tracking. + return false; + } + return true; + }); + return found_iter; +} + +template +template +void FlatMap::insert(InputIt first, InputIt last) +{ + while(first != last) + { + insert(*first); + first++; + } +} + +template +auto FlatMap::getEmplacePos(const KeyType& key) + -> std::pair +{ + auto hash = MixedHash {}(key); + + // If the key already exists, return the existing iterator. + iterator existing_elem = this->find(key); + if(existing_elem != this->end()) + { + return {existing_elem, false}; + } + // Resize to double the number of bucket groups if insertion would put us + // above the maximum load factor. + if(((m_loadCount + 1) / (double)bucket_count()) >= MAX_LOAD_FACTOR) + { + IndexType newNumGroups = m_metadata.size() * 2; + rehash(newNumGroups * BucketsPerGroup - 1); + } + + // Get an empty index to place the element into. + IndexType newBucket = this->probeEmptyIndex(m_numGroups2, m_metadata, hash); + + // Add a hash to the corresponding bucket slot. + this->setBucketHash(m_metadata, newBucket, hash); + m_size++; + m_loadCount++; + + // Return an iterator pointing to the just-found empty bucket. + iterator keyIterator = iterator(this, newBucket); + return {keyIterator, true}; +} + +template +template +void FlatMap::emplaceImpl( + const std::pair& pos, + bool assign_on_existence, + Args&&... args) +{ + IndexType bucketIndex = pos.first.m_internalIdx; + bool keyExistsAlready = !pos.second; + + if(!keyExistsAlready) + { + new(&m_buckets[bucketIndex].data) KeyValuePair(std::forward(args)...); + } + else if(keyExistsAlready && assign_on_existence) + { + KeyValuePair kv(std::forward(args)...); + m_buckets[bucketIndex].get().second = std::move(kv.second); + } +} + +template +auto FlatMap::erase(const_iterator pos) -> iterator +{ + assert(pos != end()); + auto hash = MixedHash {}(pos->first); + + bool midSequence = this->clearBucket(m_metadata, pos.m_internalIdx, hash); + pos->~KeyValuePair(); + if(!midSequence) + { + m_loadCount--; + } + return ++iterator(this, pos.m_internalIdx); +} + +} // namespace axom + +#endif // Axom_Core_FlatMap_HPP diff --git a/src/axom/core/IteratorBase.hpp b/src/axom/core/IteratorBase.hpp index 0d98da65e0..6b9df6c912 100644 --- a/src/axom/core/IteratorBase.hpp +++ b/src/axom/core/IteratorBase.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/Macros.hpp b/src/axom/core/Macros.hpp index 2e772ea69e..e5b9cb73fd 100644 --- a/src/axom/core/Macros.hpp +++ b/src/axom/core/Macros.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/Map.hpp b/src/axom/core/Map.hpp index 915924775a..7ff8cd30cb 100644 --- a/src/axom/core/Map.hpp +++ b/src/axom/core/Map.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -97,7 +97,7 @@ class Bucket * * \pre len > 0 */ - Bucket(int len) { init(len); } + Bucket(IndexType len) { init(len); } /*! * \brief If a Bucket instance is created with the default contructor, this @@ -107,7 +107,7 @@ class Bucket * * \pre len > 0 */ - void init(int len) + void init(IndexType len) { m_list = axom::allocate>(len); for(int i = 0; i < len - 1; i++) @@ -331,7 +331,7 @@ class Bucket axom_map::Node m_end; IndexType m_head; IndexType m_free; - int m_capacity, m_size; + IndexType m_capacity, m_size; }; /// @} @@ -371,7 +371,7 @@ class Map * \pre num_buckets > 0 * \pre bucket_len > 0 */ - Map(int num_buckets, int bucket_len = 10) + Map(IndexType num_buckets, IndexType bucket_len = 10) { init(num_buckets, bucket_len); m_end.key = Key {0}; @@ -392,7 +392,7 @@ class Map , m_load_factor(0) , m_bucket_fill(false) #if defined(AXOM_USE_OPENMP) && defined(AXOM_USE_RAJA) - , locks(nullptr) + , m_locks(nullptr) #endif { *this = std::move(other); @@ -419,7 +419,7 @@ class Map m_end = other.m_end; pol = other.pol; #if defined(AXOM_USE_OPENMP) && defined(AXOM_USE_RAJA) - locks = other.locks; + m_locks = other.m_locks; #endif other.m_buckets = nullptr; @@ -428,7 +428,7 @@ class Map other.m_size = 0; other.m_load_factor = 0; #if defined(AXOM_USE_OPENMP) && defined(AXOM_USE_RAJA) - other.locks = nullptr; + other.m_locks = nullptr; #endif } return *this; @@ -459,12 +459,12 @@ class Map * if used properly. However, since this highly manual process has room for error this implementation does * perform a check for if any bucket is now full. */ - bool rehash(int buckets = -1, int factor = -1) + bool rehash(IndexType buckets = -1, int factor = -1) { - int newlen = 0; + IndexType newlen = 0; IndexType ind; std::size_t hashed; - if(buckets != -1 && buckets > static_cast(m_bucket_count)) + if(buckets != -1 && buckets > m_bucket_count) { newlen = buckets; } @@ -481,7 +481,7 @@ class Map m_bucket_fill = false; axom_map::Bucket* new_list = alloc_map(newlen, m_bucket_len); - for(std::size_t i = 0; i < m_bucket_count; i++) + for(IndexType i = 0; i < m_bucket_count; i++) { ind = m_buckets[i].m_head; while(ind != -1) @@ -497,7 +497,7 @@ class Map destroy_locks(pol); m_buckets = new_list; m_bucket_count = newlen; - for(std::size_t i = 0; i < m_bucket_count; i++) + for(IndexType i = 0; i < m_bucket_count; i++) { if(m_buckets[i].get_size() == m_buckets[i].get_capacity()) { @@ -515,7 +515,7 @@ class Map */ void clear() { - for(std::size_t i = 0; i < m_bucket_count; i++) + for(IndexType i = 0; i < m_bucket_count; i++) { axom::deallocate(m_buckets[i].m_list); } @@ -532,7 +532,7 @@ class Map * Required if use is to continue after a clear(). * */ - void init(int num_buckets, int bucket_len = 10) + void init(IndexType num_buckets, IndexType bucket_len = 10) { m_bucket_count = num_buckets; m_bucket_len = bucket_len; @@ -575,7 +575,7 @@ class Map if(ret.second == true) { #ifdef AXOM_USE_RAJA - RAJA::atomicAdd(&m_size, 1); + RAJA::atomicAdd(&m_size, IndexType {1}); #else m_size++; #endif @@ -623,7 +623,7 @@ class Map if(ret.second == true) { #ifdef AXOM_USE_RAJA - RAJA::atomicAdd(&m_size, 1); + RAJA::atomicAdd(&m_size, IndexType {1}); #else m_size++; #endif @@ -678,7 +678,7 @@ class Map if(ret == true) { #ifdef AXOM_USE_RAJA - RAJA::atomicSub(&m_size, 1); + RAJA::atomicSub(&m_size, IndexType {1}); #else m_size--; #endif @@ -720,22 +720,22 @@ class Map * \brief Returns the maximum number of items per bucket. * \return bucket_len the maximum number of items per bucket. */ - int bucket_size() const { return m_bucket_len; } + IndexType bucket_size() const { return m_bucket_len; } /*! * \brief Returns the number of buckets in the Map. * \return bucket_count */ - int bucket_count() const { return m_bucket_count; } + IndexType bucket_count() const { return m_bucket_count; } /*! * \brief Returns the amount of items in the Map instance. * \return size the amount of items in the Map instance. */ - int size() const { return m_size; } + IndexType size() const { return m_size; } /*! * \brief Returns the overall capacity of the Map instance. * \return capacity the overall capacity of the Map instance. */ - int max_size() { return m_bucket_len * m_bucket_count; } + IndexType max_size() { return m_bucket_len * m_bucket_count; } /*! * \brief Checks if the container has no elements. * \return true if the container is empty, false otherwise @@ -804,11 +804,11 @@ class Map * * \return A pointer to the now-allocated array of linked lists. */ - axom_map::Bucket* alloc_map(int bucount, int bucklen) + axom_map::Bucket* alloc_map(IndexType bucount, IndexType bucklen) { axom_map::Bucket* tmp = axom::allocate>(bucount); - for(int i = 0; i < bucount; i++) + for(IndexType i = 0; i < bucount; i++) { tmp[i].init(bucklen); } @@ -883,7 +883,7 @@ class Map void bucket_lock(std::size_t index, axom::OMP_EXEC overload) const { AXOM_UNUSED_VAR(overload); - omp_set_lock(locks + index); + omp_set_lock(m_locks + index); } /*! @@ -894,7 +894,7 @@ class Map void bucket_unlock(std::size_t index, axom::OMP_EXEC overload) const { AXOM_UNUSED_VAR(overload); - omp_unset_lock(locks + index); + omp_unset_lock(m_locks + index); } /*! @@ -903,10 +903,10 @@ class Map void init_locks(axom::OMP_EXEC overload) const { AXOM_UNUSED_VAR(overload); - locks = axom::allocate(m_bucket_count); - for(std::size_t i = 0; i < m_bucket_count; i++) + m_locks = axom::allocate(m_bucket_count); + for(IndexType i = 0; i < m_bucket_count; i++) { - omp_init_lock(locks + i); + omp_init_lock(m_locks + i); } } @@ -916,11 +916,11 @@ class Map void destroy_locks(axom::OMP_EXEC overload) const { AXOM_UNUSED_VAR(overload); - for(std::size_t i = 0; i < m_bucket_count; i++) + for(IndexType i = 0; i < m_bucket_count; i++) { - omp_destroy_lock(locks + i); + omp_destroy_lock(m_locks + i); } - axom::deallocate(locks); + axom::deallocate(m_locks); } #endif /// @} @@ -929,14 +929,14 @@ class Map /// @{ axom_map::Bucket* m_buckets; /*!< array of pointers to linked lists containing data */ - std::size_t m_bucket_count; /*!< the number of buckets in the Map instance */ - int m_bucket_len; /*!< the number of items that can be contained in a bucket in this Map instance */ - int m_size; /*!< the number of items currently stored in this Map instance */ + IndexType m_bucket_count; /*!< the number of buckets in the Map instance */ + IndexType m_bucket_len; /*!< the number of items that can be contained in a bucket in this Map instance */ + IndexType m_size; /*!< the number of items currently stored in this Map instance */ float m_load_factor; /*!< currently unused value, used in STL unordered_map to determine when to resize, which we don't do internally at the moment */ axom_map::Node m_end; /*!< the sentinel node enabling verification of operation success or failure */ bool m_bucket_fill; /*!< status of buckets in general -- if at least one is full, this is set to true, false otherwise*/ #if defined(AXOM_USE_OPENMP) && defined(AXOM_USE_RAJA) - mutable omp_lock_t* locks; + mutable omp_lock_t* m_locks; #endif Policy pol; /// @} diff --git a/src/axom/core/Path.cpp b/src/axom/core/Path.cpp index e028cef9a7..faa84ba730 100644 --- a/src/axom/core/Path.cpp +++ b/src/axom/core/Path.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/Path.hpp b/src/axom/core/Path.hpp index 0c39ccf99d..787a867c48 100644 --- a/src/axom/core/Path.hpp +++ b/src/axom/core/Path.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/StackArray.hpp b/src/axom/core/StackArray.hpp index 08ad3f5217..e638e9ca69 100644 --- a/src/axom/core/StackArray.hpp +++ b/src/axom/core/StackArray.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/Types.cpp b/src/axom/core/Types.cpp index 8e1f47a171..ddadfc8aa7 100644 --- a/src/axom/core/Types.cpp +++ b/src/axom/core/Types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/Types.hpp b/src/axom/core/Types.hpp index 6e535d4a8e..519cfd8e5a 100644 --- a/src/axom/core/Types.hpp +++ b/src/axom/core/Types.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/detail/FlatTable.hpp b/src/axom/core/detail/FlatTable.hpp new file mode 100644 index 0000000000..490e8d0c9f --- /dev/null +++ b/src/axom/core/detail/FlatTable.hpp @@ -0,0 +1,334 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#ifndef Axom_Core_Detail_FlatTable_Hpp +#define Axom_Core_Detail_FlatTable_Hpp + +#include + +#include "axom/core/Array.hpp" +#include "axom/core/ArrayView.hpp" +#include "axom/core/utilities/BitUtilities.hpp" + +namespace axom +{ +namespace detail +{ +namespace flat_map +{ +struct QuadraticProbing +{ + /*! + * \brief Returns the next offset to jump given an iteration count. + * + * Each probe point for a given iteration is given by the formula + * H(i) = H_0 + i/2 + i^2/2 mod m. For m = 2^n, the sequence H(i) for + * i in [0, m-1) is a permutation on [0, m-1). + * + * We return the offset from H(i) to H(i+1), which is i+1. + */ + int getNext(int iter) const { return iter + 1; } +}; + +/*! + * \brief A bit mixer used to ensure avalanching of a hash function. + * + * Uses the "mxmxm" function described here: + * https://jonkagstrom.com/bit-mixer-construction/index.html + */ +template +struct HashMixer64 +{ + uint64_t operator()(const KeyType& key) const + { + uint64_t hash = HashFunc {}(key); + hash *= 0xbf58476d1ce4e5b9ULL; + hash ^= hash >> 32; + hash *= 0x94d049bb133111ebULL; + hash ^= hash >> 32; + hash *= 0x94d049bb133111ebULL; + return hash; + } +}; + +// We follow the design of boost::unordered_flat_map, which uses a 128-bit chunk +// of metadata for each group of 15 buckets. +// This is split up into an "overflow bit", and 15 bytes representing the +// state of each bucket. +// +// Each bucket byte has the value: +// - 0 if the bucket is "deleted" +// - 1 to signal the end of the bucket array. +// - if the bucket has an element, a reduced hash in the range [2, 255]. +// +// The overflow bit acts as a Bloom filter to determine if probing should +// terminate. +struct GroupBucket +{ + constexpr static std::uint8_t Empty = 0; + constexpr static std::uint8_t Sentinel = 1; + constexpr static int InvalidSlot = -1; + + constexpr static int Size = 15; + + GroupBucket() : data {0ULL, 0ULL} { } + + int getEmptyBucket() const + { + for(int i = 0; i < Size; i++) + { + if(metadata.buckets[i] == GroupBucket::Empty) + { + return i; + } + } + // Bucket not found. + return InvalidSlot; + } + + int nextFilledBucket(int start_index) const + { + for(int i = start_index + 1; i < Size; i++) + { + // We intentionally don't check for the sentinel here. This gives us the + // index of the sentinel bucket at the end, which is needed as a "stop" + // for forward iteration. + if(metadata.buckets[i] != GroupBucket::Empty) + { + return i; + } + } + return InvalidSlot; + } + + template + int visitHashBucket(std::uint8_t hash, Func&& visitor) const + { + std::uint8_t reducedHash = reduceHash(hash); + for(int i = 0; i < Size; i++) + { + if(metadata.buckets[i] == reducedHash) + { + visitor(i); + } + } + return InvalidSlot; + } + + void setBucket(int index, std::uint8_t hash) + { + metadata.buckets[index] = reduceHash(hash); + } + + void clearBucket(int index) { metadata.buckets[index] = Empty; } + + void setOverflow(std::uint8_t hash) + { + std::uint8_t hashOfwBit = 1 << (hash % 8); + metadata.ofw |= hashOfwBit; + } + + bool getMaybeOverflowed(std::uint8_t hash) const + { + std::uint8_t hashOfwBit = 1 << (hash % 8); + return (metadata.ofw & hashOfwBit); + } + + bool hasSentinel() const { return metadata.buckets[Size - 1] == Sentinel; } + + void setSentinel() { metadata.buckets[Size - 1] = Sentinel; } + + // We need to map hashes in the range [0, 255] to [2, 255], since 0 and 1 + // are taken by the "empty" and "sentinel" values respectively. + static std::uint8_t reduceHash(std::uint8_t hash) + { + return (hash < 2) ? (hash + 8) : hash; + } + + union alignas(16) + { + struct + { + std::uint8_t ofw; + std::uint8_t buckets[Size]; + } metadata; + std::uint64_t data[2]; + static_assert(sizeof(metadata) == sizeof(data), + "flat_map::GroupBucket: sizeof(data_bytes) != sizeof(data)"); + }; +}; + +static_assert(sizeof(GroupBucket) == 16, + "flat_map::GroupBucket: size != 16 bytes"); +static_assert(std::alignment_of::value == 16, + "flat_map::GroupBucket: alignment != 16 bytes"); +static_assert(std::is_standard_layout::value, + "flat_map::GroupBucket: not standard layout"); + +template +struct SequentialLookupPolicy : ProbePolicy +{ + constexpr static int NO_MATCH = -1; + + /*! + * \brief Inserts a hash into the first empty bucket in an array of groups + * for an open-addressing hash map. + * + * \param [in] ngroups_pow_2 the number of groups, expressed as a power of 2 + * \param [in] metadata the array of metadata for the groups in the hash map + * \param [in] hash the hash to insert + */ + IndexType probeEmptyIndex(int ngroups_pow_2, + ArrayView metadata, + HashType hash) const + { + // We use the k MSBs of the hash as the initial group probe point, + // where ngroups = 2^k. + int bitshift_right = ((CHAR_BIT * sizeof(HashType)) - ngroups_pow_2); + HashType curr_group = hash >> bitshift_right; + curr_group &= ((1 << ngroups_pow_2) - 1); + int empty_group = NO_MATCH; + int empty_bucket = NO_MATCH; + + std::uint8_t hash_8 = static_cast(hash); + for(int iteration = 0; iteration < metadata.size(); iteration++) + { + int tentative_empty_bucket = metadata[curr_group].getEmptyBucket(); + if(tentative_empty_bucket != GroupBucket::InvalidSlot && + empty_group == NO_MATCH) + { + empty_group = curr_group; + empty_bucket = tentative_empty_bucket; + } + + if((!metadata[curr_group].getMaybeOverflowed(hash_8) && + empty_group != NO_MATCH)) + { + // We've reached the last group that might contain the hash. + // Stop probing. + break; + } + else if(empty_group == NO_MATCH) + { + // Set the overflow bit and continue probing. + metadata[curr_group].setOverflow(hash_8); + } + curr_group = (curr_group + this->getNext(iteration)) % metadata.size(); + } + if(empty_group != NO_MATCH) + { + return empty_group * GroupBucket::Size + empty_bucket; + } + return NO_MATCH; + } + + /*! + * \brief Finds the next potential bucket index for a given hash in a group + * array for an open-addressing hash map. + * + * \param [in] ngroups_pow_2 the number of groups, expressed as a power of 2 + * \param [in] metadata the array of metadata for the groups in the hash map + * \param [in] hash the hash to insert + * \param [in] on_hash_found functor to call for a bucket index with a + * matching hash + */ + template + void probeIndex(int ngroups_pow_2, + ArrayView metadata, + HashType hash, + FoundIndex&& on_hash_found) const + { + // We use the k MSBs of the hash as the initial group probe point, + // where ngroups = 2^k. + int bitshift_right = ((CHAR_BIT * sizeof(HashType)) - ngroups_pow_2); + HashType curr_group = hash >> bitshift_right; + curr_group &= ((1 << ngroups_pow_2) - 1); + + std::uint8_t hash_8 = static_cast(hash); + bool keep_going = true; + for(int iteration = 0; iteration < metadata.size(); iteration++) + { + metadata[curr_group].visitHashBucket(hash_8, [&](IndexType bucket_index) { + keep_going = on_hash_found(curr_group * GroupBucket::Size + bucket_index); + }); + + if(!metadata[curr_group].getMaybeOverflowed(hash_8)) + { + // Stop probing if the "overflow" bit is not set. + keep_going = false; + curr_group = NO_MATCH; + } + + if(!keep_going) + { + break; + } + // Probe the next bucket. + curr_group = (curr_group + this->getNext(iteration)) % metadata.size(); + } + } + + void setBucketHash(ArrayView metadata, + IndexType bucket, + HashType hash) + { + int group_index = bucket / GroupBucket::Size; + int slot_index = bucket % GroupBucket::Size; + + metadata[group_index].setBucket(slot_index, hash); + } + + bool clearBucket(ArrayView metadata, IndexType bucket, HashType hash) + { + int group_index = bucket / GroupBucket::Size; + int slot_index = bucket % GroupBucket::Size; + + metadata[group_index].clearBucket(slot_index); + + // Return if the overflow bit is set on the bucket. That indicates whether + // we are deleting an element in the middle of a probing sequence. + return metadata[group_index].getMaybeOverflowed(hash); + } + + IndexType nextValidIndex(ArrayView metadata, + int last_bucket) const + { + if(last_bucket >= metadata.size() * GroupBucket::Size - 1) + { + return last_bucket; + } + int group_index = last_bucket / GroupBucket::Size; + int slot_index = last_bucket % GroupBucket::Size; + + do + { + slot_index = metadata[group_index].nextFilledBucket(slot_index); + if(slot_index == GroupBucket::InvalidSlot) + { + group_index++; + slot_index = -1; + } + } while(slot_index == GroupBucket::InvalidSlot && + group_index < metadata.size()); + + return group_index * GroupBucket::Size + slot_index; + } +}; + +template +struct alignas(T) TypeErasedStorage +{ + unsigned char data[sizeof(T)]; + + const T& get() const { return *(reinterpret_cast(&data)); } + + T& get() { return *(reinterpret_cast(&data)); } +}; + +} // namespace flat_map +} // namespace detail +} // namespace axom + +#endif // Axom_Core_Detail_FlatTable_Hpp diff --git a/src/axom/core/docs/sphinx/core_acceleration.rst b/src/axom/core/docs/sphinx/core_acceleration.rst index 005ae429ed..906cb04c72 100644 --- a/src/axom/core/docs/sphinx/core_acceleration.rst +++ b/src/axom/core/docs/sphinx/core_acceleration.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/docs/sphinx/core_containers.rst b/src/axom/core/docs/sphinx/core_containers.rst index 5e5d65028d..69dae01795 100644 --- a/src/axom/core/docs/sphinx/core_containers.rst +++ b/src/axom/core/docs/sphinx/core_containers.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/docs/sphinx/core_numerics.rst b/src/axom/core/docs/sphinx/core_numerics.rst index cb8682fcf5..0cc94714b7 100644 --- a/src/axom/core/docs/sphinx/core_numerics.rst +++ b/src/axom/core/docs/sphinx/core_numerics.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/docs/sphinx/core_utilities.rst b/src/axom/core/docs/sphinx/core_utilities.rst index eb945e8564..797fdac3ae 100644 --- a/src/axom/core/docs/sphinx/core_utilities.rst +++ b/src/axom/core/docs/sphinx/core_utilities.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/docs/sphinx/index.rst b/src/axom/core/docs/sphinx/index.rst index b994dd9d4e..106939d872 100644 --- a/src/axom/core/docs/sphinx/index.rst +++ b/src/axom/core/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/examples/CMakeLists.txt b/src/axom/core/examples/CMakeLists.txt index 37d8e98340..adcb21d57c 100644 --- a/src/axom/core/examples/CMakeLists.txt +++ b/src/axom/core/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/examples/core_acceleration.cpp b/src/axom/core/examples/core_acceleration.cpp index a33732a53f..b0345bddb6 100644 --- a/src/axom/core/examples/core_acceleration.cpp +++ b/src/axom/core/examples/core_acceleration.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index 194245231a..052d724fb4 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/examples/core_numerics.cpp b/src/axom/core/examples/core_numerics.cpp index c75adc94b2..5d25f09973 100644 --- a/src/axom/core/examples/core_numerics.cpp +++ b/src/axom/core/examples/core_numerics.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -192,7 +192,7 @@ void demoMatrix() // _eigs_start // Solve for eigenvectors and values using the power method // The power method calls rand(), so we need to initialize it with srand(). - std::srand(std::time(0)); + std::srand(std::time(nullptr)); double eigvec[nrows * ncols]; double eigval[nrows]; int res = numerics::eigen_solve(A, nrows, eigvec, eigval); diff --git a/src/axom/core/examples/core_utilities.cpp b/src/axom/core/examples/core_utilities.cpp index ae2d82170d..45ed474dd8 100644 --- a/src/axom/core/examples/core_utilities.cpp +++ b/src/axom/core/examples/core_utilities.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/execution/doc.hpp b/src/axom/core/execution/doc.hpp index 80ebe124f3..5363042105 100644 --- a/src/axom/core/execution/doc.hpp +++ b/src/axom/core/execution/doc.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/execution/execution_space.hpp b/src/axom/core/execution/execution_space.hpp index 7fab6976aa..1c23a74d90 100644 --- a/src/axom/core/execution/execution_space.hpp +++ b/src/axom/core/execution/execution_space.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -56,6 +56,8 @@ * * The execution spaces bind the corresponding RAJA execution policies and * default memory space. + * + * @see runtime_policy.hpp */ namespace axom diff --git a/src/axom/core/execution/for_all.hpp b/src/axom/core/execution/for_all.hpp index baf4c0297c..ef08f4f57c 100644 --- a/src/axom/core/execution/for_all.hpp +++ b/src/axom/core/execution/for_all.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/execution/internal/cuda_exec.hpp b/src/axom/core/execution/internal/cuda_exec.hpp index 72ec00064d..fc9144a1df 100644 --- a/src/axom/core/execution/internal/cuda_exec.hpp +++ b/src/axom/core/execution/internal/cuda_exec.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/execution/internal/hip_exec.hpp b/src/axom/core/execution/internal/hip_exec.hpp index 7c7edf0f8a..ed377380ea 100644 --- a/src/axom/core/execution/internal/hip_exec.hpp +++ b/src/axom/core/execution/internal/hip_exec.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/execution/internal/omp_exec.hpp b/src/axom/core/execution/internal/omp_exec.hpp index 39243fd1c9..448b0fc923 100644 --- a/src/axom/core/execution/internal/omp_exec.hpp +++ b/src/axom/core/execution/internal/omp_exec.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/execution/internal/seq_exec.hpp b/src/axom/core/execution/internal/seq_exec.hpp index 7fae6c69ae..9c50f80ee8 100644 --- a/src/axom/core/execution/internal/seq_exec.hpp +++ b/src/axom/core/execution/internal/seq_exec.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -34,10 +34,15 @@ template <> struct execution_space { #ifdef AXOM_USE_RAJA + #if RAJA_VERSION_MAJOR > 2022 + using loop_policy = RAJA::seq_exec; + using reduce_policy = RAJA::seq_reduce; + using atomic_policy = RAJA::seq_atomic; + #else using loop_policy = RAJA::loop_exec; - using reduce_policy = RAJA::loop_reduce; using atomic_policy = RAJA::loop_atomic; + #endif #else using loop_policy = void; using reduce_policy = void; diff --git a/src/axom/core/execution/runtime_policy.hpp b/src/axom/core/execution/runtime_policy.hpp new file mode 100644 index 0000000000..401cc82fdf --- /dev/null +++ b/src/axom/core/execution/runtime_policy.hpp @@ -0,0 +1,117 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#ifndef AXOM_CORE_EXECUTION_RUNTIME_POLICY_HPP_ +#define AXOM_CORE_EXECUTION_RUNTIME_POLICY_HPP_ + +#include "axom/config.hpp" /* for compile time defs. */ +#include "axom/fmt/format.h" /* for axom::fmt */ + +#include + +/*! + @file runtime_policy.hpp + + @brief Define runtime policies symbols for selecting. + + The policies are enums corresponding to + \a axom::execution_space template parameters. + The difference is that runtime policies are selected at + run time while \a axom::execution_space is specialized + at build time. + @see execution_space.hpp. + + The possible runtime parameters are + - @c seq: sequential execution on the host + - @c omp: OpenMP execution + - @c cuda: GPU execution via CUDA + - @c hip: GPU execution via HIP + + The available policies depend on how Axom is configured. + RAJA is required for using OpenMP, CUDA and HIP. + UMPIRE is required for using CUDA and HIP. + Sequential execution on host is always available. + + These macros are defined to indicate available non-sequential + policies. + - @c AXOM_RUNTIME_POLICY_USE_OPENMP + - @c AXOM_RUNTIME_POLICY_USE_CUDA + - @c AXOM_RUNTIME_POLICY_USE_HIP +*/ + +// Helper preprocessor defines for using OPENMP, CUDA, and HIP policies. +#if defined(AXOM_USE_RAJA) + #ifdef AXOM_USE_OPENMP + #define AXOM_RUNTIME_POLICY_USE_OPENMP + #endif + #if defined(__CUDACC__) && defined(AXOM_USE_CUDA) && defined(AXOM_USE_UMPIRE) + #define AXOM_RUNTIME_POLICY_USE_CUDA + #endif + #if defined(__HIPCC__) && defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) + #define AXOM_RUNTIME_POLICY_USE_HIP + #endif +#endif + +namespace axom +{ +namespace runtime_policy +{ +/// Execution policies. The supported set depends on Axom's configuration. +enum class Policy +{ + seq = 0 +#if defined(AXOM_RUNTIME_POLICY_USE_OPENMP) + , + omp = 1 +#endif +#if defined(AXOM_RUNTIME_POLICY_USE_CUDA) + , + cuda = 2 +#endif +#if defined(AXOM_RUNTIME_POLICY_USE_HIP) + , + hip = 3 +#endif +}; + +//! @brief Mapping from policy name to policy enum. +// clang-format off + static const std::map s_nameToPolicy + { + {"seq", Policy::seq} +#if defined(AXOM_RUNTIME_POLICY_USE_OPENMP) + , {"omp", Policy::omp} +#endif +#if defined(AXOM_RUNTIME_POLICY_USE_CUDA) + , {"cuda", Policy::cuda} +#endif +#if defined(AXOM_RUNTIME_POLICY_USE_HIP) + , {"hip", Policy::hip} +#endif + }; + + //! @brief Mapping from policy enum to policy name. + static const std::map s_policyToName + { + {Policy::seq, "seq"} +#if defined(AXOM_RUNTIME_POLICY_USE_OPENMP) + , {Policy::omp, "omp"} +#endif +#if defined(AXOM_RUNTIME_POLICY_USE_CUDA) + , {Policy::cuda, "cuda"} +#endif +#if defined(AXOM_RUNTIME_POLICY_USE_HIP) + , {Policy::hip, "hip"} +#endif + }; +// clang-format on + +/// Utility function to allow formating a Policy +static inline auto format_as(Policy pol) { return axom::fmt::underlying(pol); } + +} // end namespace runtime_policy +} // end namespace axom + +#endif /* AXOM_CORE_EXECUTION_RUNTIME_POLICY_HPP_ */ diff --git a/src/axom/core/execution/synchronize.hpp b/src/axom/core/execution/synchronize.hpp index 302888405b..83a961a470 100644 --- a/src/axom/core/execution/synchronize.hpp +++ b/src/axom/core/execution/synchronize.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/memory_management.hpp b/src/axom/core/memory_management.hpp index e0bf983b5a..7edbd51304 100644 --- a/src/axom/core/memory_management.hpp +++ b/src/axom/core/memory_management.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/Determinants.hpp b/src/axom/core/numerics/Determinants.hpp index b54c2de28a..b29bc8f7df 100644 --- a/src/axom/core/numerics/Determinants.hpp +++ b/src/axom/core/numerics/Determinants.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/LU.hpp b/src/axom/core/numerics/LU.hpp index fb352b2979..ebbb7fc6db 100644 --- a/src/axom/core/numerics/LU.hpp +++ b/src/axom/core/numerics/LU.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/Matrix.hpp b/src/axom/core/numerics/Matrix.hpp index 904fdd34ac..f60f410564 100644 --- a/src/axom/core/numerics/Matrix.hpp +++ b/src/axom/core/numerics/Matrix.hpp @@ -1,16 +1,18 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) #include "axom/config.hpp" -#include "axom/core/utilities/Utilities.hpp" // for utilities::swap() -#include "axom/core/memory_management.hpp" // for alloc(), free() +#include "axom/core/utilities/Utilities.hpp" +#include "axom/core/memory_management.hpp" + +#include "axom/fmt.hpp" // C/C++ includes -#include // for assert() -#include // for memcpy() -#include // for std::ostream +#include +#include +#include #ifndef AXOM_MATRIX_HPP_ #define AXOM_MATRIX_HPP_ @@ -37,6 +39,25 @@ class Matrix; template std::ostream& operator<<(std::ostream& os, const Matrix& A); +/*! + * \brief Checks if two matrices are component-wise equal + * + * \param [in] lhs first matrix + * \param [in] rhs second matrix + * \return status true if lhs==rhs, otherwise, false. + */ +template +bool operator==(const Matrix& lhs, const Matrix& rhs); + +/*! + * \brief Checks if two matrices are not component-wise equal + * + * \param [in] lhs first matrix + * \param [in] rhs second matrix + * \return status true if lhs!=rhs, otherwise, false. + */ +template +bool operator!=(const Matrix& lhs, const Matrix& rhs); /// @} /// \name Matrix Operators @@ -947,6 +968,37 @@ AXOM_HOST_DEVICE void Matrix::clear() // FREE METHODS //----------------------------------------------------------------------------- +template +bool operator==(const Matrix& lhs, const Matrix& rhs) +{ + const int R = lhs.getNumRows(); + const int C = lhs.getNumColumns(); + + if(R != rhs.getNumRows() || C != rhs.getNumColumns()) + { + return false; + } + + using axom::utilities::isNearlyEqual; + constexpr double EPS = 1e-12; + + for(int i = 0; i < R * C; ++i) + { + if(!isNearlyEqual(lhs.data()[i], rhs.data()[i], EPS)) + { + return false; + } + } + + return true; +} + +template +bool operator!=(const Matrix& lhs, const Matrix& rhs) +{ + return !(lhs == rhs); +} + //----------------------------------------------------------------------------- template Matrix lower_triangular(const Matrix& A, bool unit_diagonal) @@ -1040,4 +1092,9 @@ std::ostream& operator<<(std::ostream& os, const Matrix& M) } /* end namespace numerics */ } /* end namespace axom */ +/// Overload to format a numerics::Matrix using fmt +template +struct axom::fmt::formatter> : ostream_formatter +{ }; + #endif /* AXOM_MATRIX_HPP_ */ diff --git a/src/axom/core/numerics/eigen_solve.hpp b/src/axom/core/numerics/eigen_solve.hpp index b257b972b7..81fa50667b 100644 --- a/src/axom/core/numerics/eigen_solve.hpp +++ b/src/axom/core/numerics/eigen_solve.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/eigen_sort.hpp b/src/axom/core/numerics/eigen_sort.hpp index 6bf94cf619..62498a82e3 100644 --- a/src/axom/core/numerics/eigen_sort.hpp +++ b/src/axom/core/numerics/eigen_sort.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/floating_point_limits.hpp b/src/axom/core/numerics/floating_point_limits.hpp index 7f54510fd3..fdc3ce348a 100644 --- a/src/axom/core/numerics/floating_point_limits.hpp +++ b/src/axom/core/numerics/floating_point_limits.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/internal/matrix_norms.hpp b/src/axom/core/numerics/internal/matrix_norms.hpp index 5f93f526fc..78871a40b9 100644 --- a/src/axom/core/numerics/internal/matrix_norms.hpp +++ b/src/axom/core/numerics/internal/matrix_norms.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/jacobi_eigensolve.hpp b/src/axom/core/numerics/jacobi_eigensolve.hpp index 7c3949571b..5de1567831 100644 --- a/src/axom/core/numerics/jacobi_eigensolve.hpp +++ b/src/axom/core/numerics/jacobi_eigensolve.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/linear_solve.hpp b/src/axom/core/numerics/linear_solve.hpp index f0cc1c4f7d..7140f573b4 100644 --- a/src/axom/core/numerics/linear_solve.hpp +++ b/src/axom/core/numerics/linear_solve.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/matvecops.hpp b/src/axom/core/numerics/matvecops.hpp index d8f247d8c8..d3db788a82 100644 --- a/src/axom/core/numerics/matvecops.hpp +++ b/src/axom/core/numerics/matvecops.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/polynomial_solvers.cpp b/src/axom/core/numerics/polynomial_solvers.cpp index 69b04ce8d9..84586c1cab 100644 --- a/src/axom/core/numerics/polynomial_solvers.cpp +++ b/src/axom/core/numerics/polynomial_solvers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/numerics/polynomial_solvers.hpp b/src/axom/core/numerics/polynomial_solvers.hpp index 20200bfedf..0f08da66a4 100644 --- a/src/axom/core/numerics/polynomial_solvers.hpp +++ b/src/axom/core/numerics/polynomial_solvers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/CMakeLists.txt b/src/axom/core/tests/CMakeLists.txt index 38a92bd901..8d6ffc0e7e 100644 --- a/src/axom/core/tests/CMakeLists.txt +++ b/src/axom/core/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -23,6 +23,7 @@ set(core_serial_tests core_execution_for_all.hpp core_execution_space.hpp core_map.hpp + core_flatmap.hpp core_memory_management.hpp core_Path.hpp core_stack_array.hpp @@ -51,6 +52,7 @@ set(core_serial_tests set(core_test_depends core gtest + fmt ) #------------------------------------------------------------------------------ diff --git a/src/axom/core/tests/core_Path.hpp b/src/axom/core/tests/core_Path.hpp index 3255d00b85..7e5abc868f 100644 --- a/src/axom/core/tests/core_Path.hpp +++ b/src/axom/core/tests/core_Path.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_about.hpp b/src/axom/core/tests/core_about.hpp index 50bc4f5255..63bc18bd38 100644 --- a/src/axom/core/tests/core_about.hpp +++ b/src/axom/core/tests/core_about.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 6f7dd21603..af59a54541 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -2219,7 +2219,7 @@ void test_resize_with_stackarray(DataType value) const int K_DIMS = 7; axom::Array arr2; - axom::StackArray dims2 = {I_DIMS, J_DIMS}; + axom::StackArray dims2 = {{I_DIMS, J_DIMS}}; arr2.resize(dims2, value); EXPECT_EQ(arr2.size(), I_DIMS * J_DIMS); EXPECT_EQ(arr2.shape()[0], I_DIMS); @@ -2234,7 +2234,7 @@ void test_resize_with_stackarray(DataType value) axom::Array arr3; - axom::StackArray dims3 = {I_DIMS, J_DIMS, K_DIMS}; + axom::StackArray dims3 = {{I_DIMS, J_DIMS, K_DIMS}}; arr3.resize(dims3, value); EXPECT_EQ(arr3.size(), I_DIMS * J_DIMS * K_DIMS); EXPECT_EQ(arr3.shape()[0], I_DIMS); @@ -2257,3 +2257,205 @@ TEST(core_array, resize_stackarray) test_resize_with_stackarray(false); test_resize_with_stackarray(-1); } + +//------------------------------------------------------------------------------ +constexpr static int NONTRIVIAL_RELOC_MAGIC = 123; +struct NonTriviallyRelocatable +{ + NonTriviallyRelocatable() + : m_member(NONTRIVIAL_RELOC_MAGIC) + , m_localMemberPointer(&m_member) + { } + + NonTriviallyRelocatable(const NonTriviallyRelocatable& other) + : m_member(other.m_member) + , m_localMemberPointer(&m_member) + { } + + NonTriviallyRelocatable& operator=(const NonTriviallyRelocatable& other) + { + if(this != &other) + { + m_member = other.m_member; + } + return *this; + } + + ~NonTriviallyRelocatable() = default; + + int m_member; + int* m_localMemberPointer; +}; + +TEST(core_array, reserve_nontrivial_reloc) +{ + const int NUM_ELEMS = 1024; + axom::Array array(NUM_ELEMS, NUM_ELEMS); + + for(int i = 0; i < NUM_ELEMS; i++) + { + // Check initial values. + EXPECT_EQ(array[i].m_member, NONTRIVIAL_RELOC_MAGIC); + EXPECT_EQ(&(array[i].m_member), array[i].m_localMemberPointer); + } + + // Reallocation should work for non-trivially relocatable types. + array.reserve(NUM_ELEMS * 4); + + for(int i = 0; i < NUM_ELEMS; i++) + { + EXPECT_EQ(array[i].m_member, NONTRIVIAL_RELOC_MAGIC); + EXPECT_EQ(&(array[i].m_member), array[i].m_localMemberPointer); + } +} + +TEST(core_array, reserve_nontrivial_reloc_2) +{ + const int NUM_ELEMS = 1024; + axom::Array array(NUM_ELEMS, NUM_ELEMS); + + for(int i = 0; i < NUM_ELEMS; i++) + { + // Check initial values. + EXPECT_EQ(array[i].m_member, NONTRIVIAL_RELOC_MAGIC); + EXPECT_EQ(&(array[i].m_member), array[i].m_localMemberPointer); + } + + EXPECT_EQ(array.capacity(), NUM_ELEMS); + + // Emplace to trigger a resize. + array.emplace_back(NonTriviallyRelocatable {}); + EXPECT_GE(array.capacity(), NUM_ELEMS); + + for(int i = 0; i < NUM_ELEMS + 1; i++) + { + EXPECT_EQ(array[i].m_member, NONTRIVIAL_RELOC_MAGIC); + EXPECT_EQ(&(array[i].m_member), array[i].m_localMemberPointer); + } +} + +#if defined(AXOM_USE_GPU) && defined(AXOM_USE_UMPIRE) +TEST(core_array, reserve_nontrivial_reloc_um) +{ + const int NUM_ELEMS = 1024; + axom::Array array( + NUM_ELEMS, + NUM_ELEMS); + + for(int i = 0; i < NUM_ELEMS; i++) + { + // Check initial values. + EXPECT_EQ(array[i].m_member, NONTRIVIAL_RELOC_MAGIC); + EXPECT_EQ(&(array[i].m_member), array[i].m_localMemberPointer); + } + + // Reallocation should work for non-trivially relocatable types. + array.reserve(NUM_ELEMS * 4); + + for(int i = 0; i < NUM_ELEMS; i++) + { + EXPECT_EQ(array[i].m_member, NONTRIVIAL_RELOC_MAGIC); + EXPECT_EQ(&(array[i].m_member), array[i].m_localMemberPointer); + } +} +#endif + +// Regression test for a memory leak in axom::Array's copy/move/initialization +template +auto make_arr_data(int SZ1, int SZ2) + -> std::pair>, axom::Array>> +{ + using Arr1 = axom::Array>; + using Arr2 = axom::Array>; + + T1 val1 {}; + T2 val2 {}; + + Arr1 arr1(SZ1, 2 * SZ1); + for(int i = 0; i < SZ1; ++i) + { + arr1[i].resize(i + 10); + arr1[i].shrink(); + arr1[i].push_back(val1); + } + + Arr2 arr2(SZ2, 2 * SZ2); + for(int i = 0; i < SZ2; ++i) + { + arr2[i].resize(i + 10); + arr2[i].shrink(); + arr2[i].push_back(val2); + } + arr2.shrink(); + + return {std::move(arr1), std::move(arr2)}; +} + +TEST(core_array, regression_array_move) +{ + using T1 = int; + using Arr1 = axom::Array>; + + using T2 = NonTriviallyRelocatable; + using Arr2 = axom::Array>; + + using PArrArr = std::pair; + + constexpr int SZ1 = 20; + constexpr int SZ2 = 30; + + { + PArrArr pr; + pr = make_arr_data(SZ1, SZ2); + + EXPECT_EQ(SZ1, pr.first.size()); + EXPECT_EQ(2 * SZ1, pr.first.capacity()); + + EXPECT_EQ(SZ2, pr.second.size()); + EXPECT_EQ(SZ2, pr.second.capacity()); + } + + { + auto pr = make_arr_data(SZ1, SZ2); + + EXPECT_EQ(SZ1, pr.first.size()); + EXPECT_EQ(2 * SZ1, pr.first.capacity()); + + EXPECT_EQ(SZ2, pr.second.size()); + EXPECT_EQ(SZ2, pr.second.capacity()); + } + + { + auto pr = make_arr_data(SZ1, SZ2); + EXPECT_EQ(SZ1, pr.first.size()); + EXPECT_EQ(2 * SZ1, pr.first.capacity()); + EXPECT_EQ(SZ2, pr.second.size()); + EXPECT_EQ(SZ2, pr.second.capacity()); + + pr = make_arr_data(SZ2, SZ1); + EXPECT_EQ(SZ2, pr.first.size()); + EXPECT_EQ(2 * SZ2, pr.first.capacity()); + EXPECT_EQ(SZ1, pr.second.size()); + EXPECT_EQ(SZ1, pr.second.capacity()); + } + + // lots of copy and move assignments and constructions + { + auto pr = make_arr_data(SZ1, SZ2); + pr = make_arr_data(5, 7); + + auto pr2 = std::move(pr); + auto pr3 = pr2; + + pr2 = make_arr_data(13, 17); + + auto pr4 {make_arr_data(33, 44)}; + + auto pr5(std::move(pr4)); + + EXPECT_EQ(33, pr5.first.size()); + EXPECT_EQ(66, pr5.first.capacity()); + EXPECT_EQ(44, pr5.second.size()); + EXPECT_EQ(44, pr5.second.capacity()); + } +} \ No newline at end of file diff --git a/src/axom/core/tests/core_array_for_all.hpp b/src/axom/core/tests/core_array_for_all.hpp index 6ab55c4a8c..fb0ebdab91 100644 --- a/src/axom/core/tests/core_array_for_all.hpp +++ b/src/axom/core/tests/core_array_for_all.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -65,6 +65,36 @@ using MyTypes = ::testing::Types< TYPED_TEST_SUITE(core_array_for_all, MyTypes); +//------------------------------------------------------------------------------ +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(AXOM_USE_UMPIRE) +AXOM_CUDA_TEST(core_array_for_all, capture_test) +{ + using ExecSpace = axom::CUDA_EXEC<256>; + using KernelArray = axom::Array; + + EXPECT_DEATH_IF_SUPPORTED( + { + // Create an array of N items using default MemorySpace for ExecSpace + constexpr int N = 4; + KernelArray arr(N); + + // Capture of axom::Array should fail. + axom::for_all( + N, + AXOM_LAMBDA(axom::IndexType idx) { + if(arr[0]) return; + }); + + // handles synchronization, if necessary + if(axom::execution_space::async()) + { + axom::synchronize(); + } + }, + ""); +} +#endif + //------------------------------------------------------------------------------ AXOM_TYPED_TEST(core_array_for_all, explicit_ArrayView) { @@ -1147,4 +1177,92 @@ AXOM_TYPED_TEST(core_array_for_all, nontrivial_emplace) } } +//------------------------------------------------------------------------------ +constexpr int INSERT_ON_HOST = 1; +constexpr int INSERT_ON_DEVICE = 2; +struct DeviceInsert +{ + AXOM_HOST_DEVICE DeviceInsert(int value) : m_value(value) + { +#ifdef AXOM_DEVICE_CODE + m_host_or_device = INSERT_ON_DEVICE; +#else + m_host_or_device = INSERT_ON_HOST; +#endif + } + + int m_value; + int m_host_or_device; +}; + +AXOM_TYPED_TEST(core_array_for_all, device_insert) +{ + using ExecSpace = typename TestFixture::ExecSpace; + using DynamicArray = typename TestFixture::template DynamicTArray; + using DynamicArrayOfArrays = + typename TestFixture::template DynamicTArray; + + int kernelAllocID = axom::execution_space::allocatorID(); + + constexpr axom::IndexType N = 374; + + DynamicArrayOfArrays arr_container(1, 1, kernelAllocID); + arr_container[0] = DynamicArray(0, N, kernelAllocID); + const auto arr_v = arr_container.view(); + + EXPECT_EQ(arr_container[0].size(), 0); + EXPECT_EQ(arr_container[0].capacity(), N); + + axom::for_all( + N, + AXOM_LAMBDA(axom::IndexType idx) { +#if defined(AXOM_USE_OPENMP) && defined(AXOM_USE_RAJA) && \ + !defined(AXOM_DEVICE_CODE) + if(omp_in_parallel()) + { + #pragma omp critical + { + arr_v[0].emplace_back(3 * idx + 5); + } + } + else + { + arr_v[0].emplace_back(3 * idx + 5); + } +#else + arr_v[0].emplace_back(3 * idx + 5); +#endif + }); + + // handles synchronization, if necessary + if(axom::execution_space::async()) + { + axom::synchronize(); + } + + EXPECT_EQ(arr_container[0].size(), N); + EXPECT_EQ(arr_container[0].capacity(), N); + + // Device-side inserts may occur in any order. + // Sort them before we check the inserted values. + std::sort(arr_container[0].begin(), + arr_container[0].end(), + [](const DeviceInsert& a, const DeviceInsert& b) -> bool { + return a.m_value < b.m_value; + }); + + for(int i = 0; i < N; i++) + { + EXPECT_EQ(arr_container[0][i].m_value, 3 * i + 5); + if(axom::execution_space::onDevice()) + { + EXPECT_EQ(arr_container[0][i].m_host_or_device, INSERT_ON_DEVICE); + } + else + { + EXPECT_EQ(arr_container[0][i].m_host_or_device, INSERT_ON_HOST); + } + } +} + } // end namespace testing diff --git a/src/axom/core/tests/core_bit_utilities.hpp b/src/axom/core/tests/core_bit_utilities.hpp index 0746cbd238..af3cc03934 100644 --- a/src/axom/core/tests/core_bit_utilities.hpp +++ b/src/axom/core/tests/core_bit_utilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -39,23 +39,23 @@ TEST(core_bit_utilities, trailingZeroes) constexpr int BITS = axom::utilities::BitTraits::BITS_PER_WORD; ASSERT_EQ(64, BITS); - // Axom's trailingZeros will return 64 when given 0 + // Axom's countr_zero will return 64 when given 0 { - EXPECT_EQ(BITS, axom::utilities::trailingZeros(ZERO)); + EXPECT_EQ(BITS, axom::utilities::countr_zero(ZERO)); } // Test with a known trailing bit for(int i = 0; i < BITS; ++i) { std::uint64_t val = ::shifted(i); - EXPECT_EQ(i, axom::utilities::trailingZeros(val)); + EXPECT_EQ(i, axom::utilities::countr_zero(val)); // Value doesn't change when you set bits to left of trailing bit for(int j = i + 1; j < BITS; ++j) { std::uint64_t val2 = ::shifted(i) + ::shifted(j); - EXPECT_EQ(axom::utilities::trailingZeros(val), - axom::utilities::trailingZeros(val2)); + EXPECT_EQ(axom::utilities::countr_zero(val), + axom::utilities::countr_zero(val2)); } } @@ -73,11 +73,11 @@ TEST(core_bit_utilities, trailingZeroes) break; } } - EXPECT_EQ(bit, axom::utilities::trailingZeros(rand_val)); + EXPECT_EQ(bit, axom::utilities::countr_zero(rand_val)); } } -TEST(core_bit_utilities, popCount) +TEST(core_bit_utilities, popcount) { constexpr std::uint64_t ZERO = std::uint64_t(0); constexpr int BITS = axom::utilities::BitTraits::BITS_PER_WORD; @@ -85,16 +85,16 @@ TEST(core_bit_utilities, popCount) // Test pop count when zero bits are set { - EXPECT_EQ(0, axom::utilities::popCount(ZERO)); - EXPECT_EQ(BITS, axom::utilities::popCount(~ZERO)); + EXPECT_EQ(0, axom::utilities::popcount(ZERO)); + EXPECT_EQ(BITS, axom::utilities::popcount(~ZERO)); } // Test pop count when one bit is set for(int i = 0; i < BITS; ++i) { std::uint64_t val = ::shifted(i); - EXPECT_EQ(1, axom::utilities::popCount(val)); - EXPECT_EQ(BITS - 1, axom::utilities::popCount(~val)); + EXPECT_EQ(1, axom::utilities::popcount(val)); + EXPECT_EQ(BITS - 1, axom::utilities::popcount(~val)); } // Test pop count when two bits are set @@ -103,8 +103,8 @@ TEST(core_bit_utilities, popCount) for(int j = 0; j < i; ++j) { std::uint64_t val = shifted(i) + shifted(j); - EXPECT_EQ(2, axom::utilities::popCount(val)); - EXPECT_EQ(BITS - 2, axom::utilities::popCount(~val)); + EXPECT_EQ(2, axom::utilities::popcount(val)); + EXPECT_EQ(BITS - 2, axom::utilities::popcount(~val)); } } @@ -116,8 +116,8 @@ TEST(core_bit_utilities, popCount) for(int k = 0; k < j; ++k) { std::uint64_t val = shifted(i) + shifted(j) + shifted(k); - EXPECT_EQ(3, axom::utilities::popCount(val)); - EXPECT_EQ(BITS - 3, axom::utilities::popCount(~val)); + EXPECT_EQ(3, axom::utilities::popcount(val)); + EXPECT_EQ(BITS - 3, axom::utilities::popcount(~val)); } } } @@ -136,30 +136,30 @@ TEST(core_bit_utilities, popCount) } } - EXPECT_EQ(bits, axom::utilities::popCount(val)); + EXPECT_EQ(bits, axom::utilities::popcount(val)); } } -TEST(core_bit_utilities, leadingZeros) +TEST(core_bit_utilities, countl_zero) { constexpr std::int32_t ZERO = std::int32_t(0); constexpr int BITS = axom::utilities::BitTraits::BITS_PER_WORD; ASSERT_EQ(32, BITS); - // Axom's leadingZeros will return 32 when given 0 - EXPECT_EQ(BITS, axom::utilities::leadingZeros(ZERO)); + // Axom's countl_zero will return 32 when given 0 + EXPECT_EQ(BITS, axom::utilities::countl_zero(ZERO)); for(int i = 0; i < BITS; ++i) { std::int32_t val = ::shifted(i); - EXPECT_EQ(BITS - i - 1, axom::utilities::leadingZeros(val)); + EXPECT_EQ(BITS - i - 1, axom::utilities::countl_zero(val)); // Value doesn't change if you set bits to right of leading zero for(int j = 0; j < i; ++j) { std::int32_t val2 = ::shifted(i) + ::shifted(j); - EXPECT_EQ(axom::utilities::leadingZeros(val), - axom::utilities::leadingZeros(val2)); + EXPECT_EQ(axom::utilities::countl_zero(val), + axom::utilities::countl_zero(val2)); } } @@ -177,6 +177,6 @@ TEST(core_bit_utilities, leadingZeros) break; } } - EXPECT_EQ(bit, axom::utilities::leadingZeros(rand_val)); + EXPECT_EQ(bit, axom::utilities::countl_zero(rand_val)); } } diff --git a/src/axom/core/tests/core_execution_for_all.hpp b/src/axom/core/tests/core_execution_for_all.hpp index 5ba8f79816..5b93132811 100644 --- a/src/axom/core/tests/core_execution_for_all.hpp +++ b/src/axom/core/tests/core_execution_for_all.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_execution_space.hpp b/src/axom/core/tests/core_execution_space.hpp index a4405bd9d1..9bf2b7d0bf 100644 --- a/src/axom/core/tests/core_execution_space.hpp +++ b/src/axom/core/tests/core_execution_space.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -139,9 +139,15 @@ TEST(core_execution_space, check_seq_exec) int allocator_id = axom::getUmpireResourceAllocatorID(umpire::resource::Host); check_execution_mappings 2022 + RAJA::seq_exec, + RAJA::seq_reduce, + RAJA::seq_atomic, + #else RAJA::loop_exec, RAJA::loop_reduce, RAJA::loop_atomic, + #endif void>(allocator_id, IS_ASYNC, ON_DEVICE); } diff --git a/src/axom/core/tests/core_flatmap.hpp b/src/axom/core/tests/core_flatmap.hpp new file mode 100644 index 0000000000..bd69fd2da0 --- /dev/null +++ b/src/axom/core/tests/core_flatmap.hpp @@ -0,0 +1,687 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +// Axom includes +#include "axom/config.hpp" +#include "axom/core/Macros.hpp" +#include "axom/core/FlatMap.hpp" + +// gtest includes +#include "gtest/gtest.h" + +// Unit test for QuadraticProbing +TEST(core_flatmap_unit, quadratic_probing) +{ + axom::detail::flat_map::QuadraticProbing instance {}; + for(int array_size = 4; array_size <= 8192; array_size *= 2) + { + // Generate probe indices. + std::vector probe_index(array_size); + std::vector probe_index_mod(array_size); + int curr_offset = 0; + // Compute probe indices for an array of size N. + for(int i = 0; i < array_size; i++) + { + probe_index[i] = curr_offset; + probe_index_mod[i] = curr_offset % array_size; + curr_offset += instance.getNext(i); + } + + for(int i = 0; i < array_size; i++) + { + // Each probe index should match the formula: + // H(i) = H_0 + i/2 + i^2/2 mod m. + int expected_probe_index = i * (i + 1) / 2; + EXPECT_EQ(probe_index[i], expected_probe_index); + EXPECT_EQ(probe_index_mod[i], expected_probe_index % array_size); + } + + // Probe indices should be a permutation of the range [0, array_size - 1). + std::vector expected_permutation(array_size); + std::iota(expected_permutation.begin(), expected_permutation.end(), 0); + + // Sort the modular probe indexes and compare. + std::sort(probe_index_mod.begin(), probe_index_mod.end()); + EXPECT_EQ(probe_index_mod, expected_permutation); + } +} + +inline void flatmap_get_value(double key, std::string& out) +{ + out = std::to_string(key); +} + +inline void flatmap_get_value(int key, std::string& out) +{ + out = std::to_string(key); +} + +inline void flatmap_get_value(const std::string& key, double& out) +{ + out = std::stod(key); +} + +inline void flatmap_get_value(const std::string& key, int& out) +{ + out = std::stoi(key); +} + +template +inline void flatmap_get_value(T key, U& out) +{ + out = key; +} + +template +class core_flatmap : public ::testing::Test +{ +public: + using MapType = FlatMapType; + using KeyType = typename FlatMapType::key_type; + using ValueType = typename FlatMapType::mapped_type; + + template + KeyType getKey(T input) + { + KeyType key; + flatmap_get_value(input, key); + return key; + } + + template + ValueType getValue(T input) + { + ValueType val; + flatmap_get_value(input, val); + return val; + } + + ValueType getDefaultValue() { return ValueType(); } +}; + +using MyTypes = ::testing::Types, + axom::FlatMap, + axom::FlatMap, + axom::FlatMap>; + +TYPED_TEST_SUITE(core_flatmap, MyTypes); + +AXOM_TYPED_TEST(core_flatmap, default_init) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + EXPECT_EQ(0, test_map.size()); + EXPECT_EQ(true, test_map.empty()); +} + +AXOM_TYPED_TEST(core_flatmap, insert_only) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int NUM_ELEMS = 100; + + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i * 10.0 + 5.0); + const auto expected_size = i + 1; + // Initial insertion of a given key should succeed. + auto initial_insert = test_map.insert({key, value}); + EXPECT_EQ(test_map.size(), expected_size); + EXPECT_EQ(initial_insert.first, test_map.find(key)); + EXPECT_EQ(value, test_map.at(key)); + EXPECT_TRUE(initial_insert.second); + + int current_bucket_capacity = test_map.bucket_count(); + + // Inserting a duplicate key should not change the value. + auto value_dup = this->getValue(i * 10.0 + 5.0); + auto duplicate_insert = test_map.insert({key, value_dup}); + EXPECT_EQ(test_map.size(), expected_size); + EXPECT_EQ(duplicate_insert.first, test_map.find(key)); + EXPECT_EQ(value, test_map.at(key)); + EXPECT_FALSE(duplicate_insert.second); + + // Using operator[] with an already-existing key should return the + // existing value and not add a value. + auto value_indexed = test_map[key]; + EXPECT_EQ(value_indexed, value); + EXPECT_EQ(test_map.size(), expected_size); + + // Check that a rehash didn't occur on the second insertion. + EXPECT_EQ(duplicate_insert.first, initial_insert.first); + EXPECT_EQ(current_bucket_capacity, test_map.bucket_count()); + } +} + +AXOM_TYPED_TEST(core_flatmap, insert_or_assign) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int NUM_ELEMS = 100; + + // Test insert behavior of FlatMap::insert_or_assign. + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i * 10.0 + 5.0); + + auto result = test_map.insert_or_assign(key, value); + EXPECT_EQ(i + 1, test_map.size()); + EXPECT_EQ(value, test_map.at(key)); + EXPECT_EQ(result.first, test_map.find(key)); + EXPECT_TRUE(result.second); + } + + // Test assign behavior of FlatMap::insert_or_assign. + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i * 10.0 + 7.0); + + auto result = test_map.insert_or_assign(key, value); + EXPECT_EQ(value, test_map.at(key)); + EXPECT_EQ(result.first, test_map.find(key)); + EXPECT_FALSE(result.second); + } + + // Assignments should not change size of FlatMap. + EXPECT_EQ(NUM_ELEMS, test_map.size()); +} + +TEST(core_flatmap_moveonly, try_emplace) +{ + axom::FlatMap> test_map; + + const int NUM_ELEMS = 40; + + // Test behavior when key does not exist. + for(int i = 0; i < NUM_ELEMS; i++) + { + std::unique_ptr value {new double {i + 10.0}}; + auto result = test_map.try_emplace(i, std::move(value)); + EXPECT_EQ(*(test_map[i]), i + 10.0); + EXPECT_EQ(result.first, test_map.find(i)); + EXPECT_TRUE(result.second); + // Value should have been moved. + EXPECT_EQ(value.get(), nullptr); + } + + // Test behavior when key already exists. + for(int i = 0; i < NUM_ELEMS; i++) + { + std::unique_ptr value {new double {i + 20.0}}; + auto result = test_map.try_emplace(i, std::move(value)); + EXPECT_EQ(*(test_map[i]), i + 10.0); + EXPECT_EQ(result.first, test_map.find(i)); + EXPECT_FALSE(result.second); + // Since key already exists, value should NOT be moved. + EXPECT_NE(value.get(), nullptr); + EXPECT_EQ(*value, i + 20.0); + } +} + +AXOM_TYPED_TEST(core_flatmap, initializer_list) +{ + using MapType = typename TestFixture::MapType; + MapType test_map {{this->getKey(0), this->getValue(10.0)}, + {this->getKey(1), this->getValue(20.0)}, + {this->getKey(2), this->getValue(30.0)}}; + + EXPECT_EQ(3, test_map.size()); + + // Check consistency of added values. + const double expected_str[3] {10.0, 20.0, 30.0}; + for(int i = 0; i < 3; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(expected_str[i]); + + auto iterator = test_map.find(key); + EXPECT_NE(iterator, test_map.end()); + EXPECT_EQ(iterator->first, key); + EXPECT_EQ(iterator->second, value); + + // Using operator[] with an already-existing key should return the + // existing value and not add a value. + auto indexed_value = test_map[key]; + EXPECT_EQ(indexed_value, value); + EXPECT_EQ(test_map.size(), 3); + } +} + +AXOM_TYPED_TEST(core_flatmap, index_operator_default) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int NUM_ELEMS = 100; + + auto expected_default_value = this->getDefaultValue(); + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto default_value = test_map[key]; + + EXPECT_EQ(default_value, expected_default_value); + + auto new_value = this->getValue(i * 10.0 + 5.0); + test_map[key] = new_value; + } + + EXPECT_EQ(NUM_ELEMS, test_map.size()); + + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i * 10.0 + 5.0); + + auto iterator = test_map.find(key); + EXPECT_EQ(iterator->second, value); + } +} + +AXOM_TYPED_TEST(core_flatmap, init_and_clear) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + // Insert enough elements to trigger a resize of the buckets. + // This allows us to test that a clear() doesn't reset the allocated buckets. + int NUM_ELEMS_RESIZE = 100; + EXPECT_GT(NUM_ELEMS_RESIZE, test_map.bucket_count()); + + for(int i = 0; i < NUM_ELEMS_RESIZE; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i + 10.0); + + test_map[key] = value; + } + + EXPECT_EQ(NUM_ELEMS_RESIZE, test_map.size()); + + int buckets_before_clear = test_map.bucket_count(); + + test_map.clear(); + + EXPECT_EQ(test_map.size(), 0); + EXPECT_EQ(test_map.load_factor(), 0.0); + EXPECT_EQ(test_map.bucket_count(), buckets_before_clear); + for(int i = 0; i < NUM_ELEMS_RESIZE; i++) + { + auto key = this->getKey(i); + auto iterator = test_map.find(key); + EXPECT_EQ(iterator, test_map.end()); + } +} + +AXOM_TYPED_TEST(core_flatmap, init_and_move) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + int NUM_ELEMS = 40; + + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i + 10.0); + + test_map[key] = value; + } + + MapType moved_to_map = std::move(test_map); + + EXPECT_EQ(test_map.size(), 0); + EXPECT_EQ(test_map.load_factor(), 0); + EXPECT_EQ(moved_to_map.size(), NUM_ELEMS); + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i + 10.0); + EXPECT_EQ(moved_to_map[key], value); + + auto old_it = test_map.find(key); + EXPECT_EQ(old_it, test_map.end()); + } +} + +TEST(core_flatmap_moveonly, init_and_move_moveonly) +{ + axom::FlatMap> test_map; + int NUM_ELEMS = 40; + + for(int i = 0; i < NUM_ELEMS; i++) + { + test_map.emplace(i, new double {i + 10.0}); + } + + axom::FlatMap> int_to_dbl_move = + std::move(test_map); + + EXPECT_EQ(test_map.size(), 0); + EXPECT_EQ(test_map.load_factor(), 0); + EXPECT_EQ(int_to_dbl_move.size(), NUM_ELEMS); + for(int i = 0; i < NUM_ELEMS; i++) + { + EXPECT_EQ(*(int_to_dbl_move[i]), i + 10.0); + + auto old_it = test_map.find(i); + EXPECT_EQ(old_it, test_map.end()); + } +} + +AXOM_TYPED_TEST(core_flatmap, init_and_copy) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + int NUM_ELEMS = 40; + + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i + 10.0); + + test_map[key] = value; + } + + int expected_buckets = test_map.bucket_count(); + + MapType int_to_dbl_copy = test_map; + + EXPECT_EQ(test_map.size(), NUM_ELEMS); + EXPECT_EQ(test_map.bucket_count(), expected_buckets); + EXPECT_EQ(int_to_dbl_copy.size(), NUM_ELEMS); + EXPECT_EQ(int_to_dbl_copy.bucket_count(), expected_buckets); + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i + 10.0); + + EXPECT_EQ(test_map[key], value); + EXPECT_EQ(int_to_dbl_copy[key], value); + } +} + +AXOM_TYPED_TEST(core_flatmap, insert_until_rehash) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int INIT_CAPACITY = test_map.bucket_count(); + const double LOAD_FACTOR = test_map.max_load_factor(); + const int SIZE_NO_REHASH = LOAD_FACTOR * INIT_CAPACITY; + + for(int i = 0; i < SIZE_NO_REHASH; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(2. * i + 1); + + test_map.insert({key, value}); + } + EXPECT_EQ(test_map.bucket_count(), INIT_CAPACITY); + EXPECT_EQ(test_map.size(), SIZE_NO_REHASH); + + // Next insert should trigger a rehash. + { + auto key_rehash = this->getKey(SIZE_NO_REHASH); + auto value_rehash = this->getValue(2. * SIZE_NO_REHASH + 1); + + test_map.insert({key_rehash, value_rehash}); + } + EXPECT_GT(test_map.bucket_count(), INIT_CAPACITY); + EXPECT_EQ(test_map.size(), SIZE_NO_REHASH + 1); + + // Check consistency of values. + for(int i = 0; i < SIZE_NO_REHASH + 1; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(2. * i + 1); + + auto iterator = test_map.find(key); + EXPECT_NE(iterator, test_map.end()); + EXPECT_EQ(iterator->first, key); + EXPECT_EQ(iterator->second, value); + } +} + +AXOM_TYPED_TEST(core_flatmap, insert_then_delete) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int INIT_CAPACITY = test_map.bucket_count(); + const double LOAD_FACTOR = test_map.max_load_factor(); + const int NUM_INSERTS = LOAD_FACTOR * INIT_CAPACITY * 4; + + for(int i = 0; i < NUM_INSERTS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(2. * i + 1); + + test_map.insert({key, value}); + } + EXPECT_EQ(test_map.size(), NUM_INSERTS); + EXPECT_GE(test_map.bucket_count(), NUM_INSERTS); + + for(int i = 0; i < NUM_INSERTS; i += 3) + { + auto key = this->getKey(i); + + auto iterator_to_remove = test_map.find(key); + auto one_after_elem = iterator_to_remove; + one_after_elem++; + // Delete every third entry starting from 0, inclusive. + // (i.e. keys 0, 3, 6, ...) + auto deleted_iterator = test_map.erase(iterator_to_remove); + + EXPECT_EQ(deleted_iterator, one_after_elem); + } + + // Check consistency of values. + for(int i = 0; i < NUM_INSERTS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(2. * i + 1); + + auto iterator = test_map.find(key); + if(i % 3 == 0) + { + EXPECT_EQ(iterator, test_map.end()); + EXPECT_EQ(0, test_map.count(key)); + EXPECT_EQ(false, test_map.contains(key)); + } + else + { + EXPECT_NE(iterator, test_map.end()); + EXPECT_EQ(iterator->first, key); + EXPECT_EQ(iterator->second, value); + EXPECT_EQ(1, test_map.count(key)); + EXPECT_EQ(true, test_map.contains(key)); + } + } +} + +AXOM_TYPED_TEST(core_flatmap, iterator_loop) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int NUM_ELEMS = 100; + + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i * 10.0 + 5.0); + + test_map.insert({key, value}); + } + + std::vector have_iterator(NUM_ELEMS, 0); + + int iter_count = 0; + // Test constant iteration + for(typename MapType::const_iterator it = test_map.begin(); + it != test_map.end(); + ++it) + { + auto pair = *it; + auto iter_key = pair.first; + auto iter_value = pair.second; + + // Get the original integer value of the key. + int iter_key_int; + flatmap_get_value(iter_key, iter_key_int); + + // Check that the key value is in range. + EXPECT_GE(iter_key_int, 0); + EXPECT_LT(iter_key_int, NUM_ELEMS); + + // Count the key that we got. + have_iterator[iter_key_int]++; + + // Check that the value is what we expect for the given key.. + auto expected_value = this->getValue(iter_key_int * 10.0 + 5.0); + EXPECT_EQ(iter_value, expected_value); + + // Count the number of iterations. + iter_count++; + } + EXPECT_EQ(iter_count, NUM_ELEMS); + + for(int i = 0; i < NUM_ELEMS; i++) + { + // We should have iterated through every index exactly once. + EXPECT_EQ(have_iterator[i], 1); + } +} + +AXOM_TYPED_TEST(core_flatmap, iterator_loop_write) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int NUM_ELEMS = 100; + + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i * 10.0 + 5.0); + + test_map.insert({key, value}); + } + + // Test mutable iteration + for(typename MapType::iterator it = test_map.begin(); it != test_map.end(); ++it) + { + auto pair = *it; + auto iter_key = pair.first; + + // Get the original integer value of the key. + int iter_key_int; + flatmap_get_value(iter_key, iter_key_int); + + // Modify the stored value. + it->second = this->getValue(iter_key_int * 10.0 + 7.0); + } + + for(int i = 0; i < NUM_ELEMS; i++) + { + // All values should be set to the new value. + const auto key = this->getKey(i); + const auto expected_value = this->getValue(i * 10.0 + 7.0); + EXPECT_EQ(test_map[key], expected_value); + } +} + +AXOM_TYPED_TEST(core_flatmap, range_for_loop) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int NUM_ELEMS = 100; + + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i * 10.0 + 5.0); + + test_map.insert({key, value}); + } + + std::vector have_key(NUM_ELEMS, 0); + + int iter_count = 0; + // Test constant iteration + for(const auto& pair : test_map) + { + auto iter_key = pair.first; + auto iter_value = pair.second; + + // Get the original integer value of the key. + int iter_key_int; + flatmap_get_value(iter_key, iter_key_int); + + // Check that the key value is in range. + EXPECT_GE(iter_key_int, 0); + EXPECT_LT(iter_key_int, NUM_ELEMS); + + // Count the key that we got. + have_key[iter_key_int]++; + + // Check that the value is what we expect for the given key.. + auto expected_value = this->getValue(iter_key_int * 10.0 + 5.0); + EXPECT_EQ(iter_value, expected_value); + + // Count the number of iterations. + iter_count++; + } + EXPECT_EQ(iter_count, NUM_ELEMS); + + for(int i = 0; i < NUM_ELEMS; i++) + { + // We should have iterated through every index exactly once. + EXPECT_EQ(have_key[i], 1); + } +} + +AXOM_TYPED_TEST(core_flatmap, range_for_loop_write) +{ + using MapType = typename TestFixture::MapType; + MapType test_map; + + const int NUM_ELEMS = 100; + + for(int i = 0; i < NUM_ELEMS; i++) + { + auto key = this->getKey(i); + auto value = this->getValue(i * 10.0 + 5.0); + + test_map.insert({key, value}); + } + + // Test mutable iteration + for(auto& pair : test_map) + { + auto iter_key = pair.first; + + // Get the original integer value of the key. + int iter_key_int; + flatmap_get_value(iter_key, iter_key_int); + + // Modify the stored value. + pair.second = this->getValue(iter_key_int * 10.0 + 7.0); + } + + for(int i = 0; i < NUM_ELEMS; i++) + { + // All values should be set to the new value. + const auto key = this->getKey(i); + const auto expected_value = this->getValue(i * 10.0 + 7.0); + EXPECT_EQ(test_map[key], expected_value); + } +} diff --git a/src/axom/core/tests/core_map.hpp b/src/axom/core/tests/core_map.hpp index af6640e59f..22bbf1eb41 100644 --- a/src/axom/core/tests/core_map.hpp +++ b/src/axom/core/tests/core_map.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -396,7 +396,11 @@ TEST(core_map, bucket_return_value) EXPECT_EQ(0, bucket.get_size()); EXPECT_EQ(length, bucket.get_capacity()); + + // Note: Bucket's not intended to be used on its own; explicitly free the memory + axom::deallocate(bucket.m_list); } + { const int length = 5; auto fn = [](Key i) { return i * i; }; @@ -411,6 +415,9 @@ TEST(core_map, bucket_return_value) EXPECT_EQ(i, node.key); EXPECT_EQ(fn(i), node.value); } + + // Note: Bucket's not intended to be used on its own; explicitly free the memory + axom::deallocate(bucket.m_list); } { @@ -427,6 +434,9 @@ TEST(core_map, bucket_return_value) EXPECT_EQ(i, node.key); EXPECT_EQ(fn(i), node.value); } + + // Note: Bucket's not intended to be used on its own; explicitly free the memory + axom::deallocate(bucket.m_list); } } @@ -468,4 +478,4 @@ TEST(core_map, hashmap_return_value) } } } -} \ No newline at end of file +} diff --git a/src/axom/core/tests/core_memory_management.hpp b/src/axom/core/tests/core_memory_management.hpp index ddba1e3a37..669f6df6b9 100644 --- a/src/axom/core/tests/core_memory_management.hpp +++ b/src/axom/core/tests/core_memory_management.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_mpi_main.cpp b/src/axom/core/tests/core_mpi_main.cpp index 67e63d59ab..2aa78d07aa 100644 --- a/src/axom/core/tests/core_mpi_main.cpp +++ b/src/axom/core/tests/core_mpi_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_openmp_main.cpp b/src/axom/core/tests/core_openmp_main.cpp index 637e0f1823..2b5d73c22a 100644 --- a/src/axom/core/tests/core_openmp_main.cpp +++ b/src/axom/core/tests/core_openmp_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_openmp_map.hpp b/src/axom/core/tests/core_openmp_map.hpp index f75cc65b44..d1abe2bd49 100644 --- a/src/axom/core/tests/core_openmp_map.hpp +++ b/src/axom/core/tests/core_openmp_map.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_serial_main.cpp b/src/axom/core/tests/core_serial_main.cpp index 88e40e3c4f..68c93b6cfa 100644 --- a/src/axom/core/tests/core_serial_main.cpp +++ b/src/axom/core/tests/core_serial_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -15,6 +15,7 @@ #include "core_execution_for_all.hpp" #include "core_execution_space.hpp" #include "core_map.hpp" +#include "core_flatmap.hpp" #include "core_memory_management.hpp" #include "core_Path.hpp" #include "core_stack_array.hpp" diff --git a/src/axom/core/tests/core_stack_array.hpp b/src/axom/core/tests/core_stack_array.hpp index 4370322a44..1002d1d3f7 100644 --- a/src/axom/core/tests/core_stack_array.hpp +++ b/src/axom/core/tests/core_stack_array.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_types.hpp b/src/axom/core/tests/core_types.hpp index bf666e4e0e..6a5cfd4ce1 100644 --- a/src/axom/core/tests/core_types.hpp +++ b/src/axom/core/tests/core_types.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/core_utilities.hpp b/src/axom/core/tests/core_utilities.hpp index 808645542a..31b73981d4 100644 --- a/src/axom/core/tests/core_utilities.hpp +++ b/src/axom/core/tests/core_utilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_determinants.hpp b/src/axom/core/tests/numerics_determinants.hpp index a8579722f5..3f405f2eff 100644 --- a/src/axom/core/tests/numerics_determinants.hpp +++ b/src/axom/core/tests/numerics_determinants.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_eigen_solve.hpp b/src/axom/core/tests/numerics_eigen_solve.hpp index 5adbead5c5..4dfa0640fc 100644 --- a/src/axom/core/tests/numerics_eigen_solve.hpp +++ b/src/axom/core/tests/numerics_eigen_solve.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_eigen_sort.hpp b/src/axom/core/tests/numerics_eigen_sort.hpp index 230e372b40..8ab395d806 100644 --- a/src/axom/core/tests/numerics_eigen_sort.hpp +++ b/src/axom/core/tests/numerics_eigen_sort.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_floating_point_limits.hpp b/src/axom/core/tests/numerics_floating_point_limits.hpp index b3d7996b95..a9e4bab880 100644 --- a/src/axom/core/tests/numerics_floating_point_limits.hpp +++ b/src/axom/core/tests/numerics_floating_point_limits.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_jacobi_eigensolve.hpp b/src/axom/core/tests/numerics_jacobi_eigensolve.hpp index 201f933d48..53f3bb6367 100644 --- a/src/axom/core/tests/numerics_jacobi_eigensolve.hpp +++ b/src/axom/core/tests/numerics_jacobi_eigensolve.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_linear_solve.hpp b/src/axom/core/tests/numerics_linear_solve.hpp index a990163b5e..a10b64074b 100644 --- a/src/axom/core/tests/numerics_linear_solve.hpp +++ b/src/axom/core/tests/numerics_linear_solve.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_lu.hpp b/src/axom/core/tests/numerics_lu.hpp index 7ff4f54c0f..b3af348d4e 100644 --- a/src/axom/core/tests/numerics_lu.hpp +++ b/src/axom/core/tests/numerics_lu.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_matrix.hpp b/src/axom/core/tests/numerics_matrix.hpp index fb86fb78af..6e646e8c9c 100644 --- a/src/axom/core/tests/numerics_matrix.hpp +++ b/src/axom/core/tests/numerics_matrix.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -246,6 +246,85 @@ TEST(numerics_matrix, is_square) EXPECT_TRUE(A.isSquare()); } +//------------------------------------------------------------------------------ +TEST(numerics_matrix, equality) +{ + using Mtx = axom::numerics::Matrix; + constexpr double val = 2.2; + + { + Mtx a, b; + EXPECT_EQ(a, b); + EXPECT_EQ(b, a); + } + + { + Mtx a, b(5, 7); + EXPECT_NE(a, b); + + EXPECT_NE(b, a); + } + + { + Mtx a(5, 7, val), b(5, 7, val); + EXPECT_EQ(a, b); + EXPECT_EQ(b, a); + + a(3, 4) = 1; + EXPECT_NE(a, b); + EXPECT_NE(b, a); + } + + { + Mtx a = Mtx::identity(3); + Mtx b = Mtx::identity(4); + EXPECT_NE(a, b); + EXPECT_NE(b, a); + } + + { + Mtx a = Mtx::identity(3); + Mtx b = Mtx::identity(3); + EXPECT_EQ(a, b); + EXPECT_EQ(b, a); + } + + { + Mtx a = Mtx::zeros(3, 3); + Mtx b = Mtx::ones(3, 3); + EXPECT_NE(a, b); + EXPECT_NE(b, a); + } + + { + Mtx a = Mtx::identity(3); + Mtx b = Mtx::zeros(3, 3); + b(0, 0) = 1.; + b(1, 1) = 1.; + b(2, 2) = 1.; + + EXPECT_EQ(a, b); + EXPECT_EQ(b, a); + } + + { + Mtx a(7, 5); + Mtx b(5, 7); + EXPECT_NE(a, b); + EXPECT_NE(b, a); + + a(3, 4) = val; + b(4, 3) = val; + EXPECT_NE(a, b); + EXPECT_NE(b, a); + + Mtx a_tr(5, 7); + axom::numerics::matrix_transpose(a, a_tr); + EXPECT_EQ(a_tr, b); + EXPECT_EQ(b, a_tr); + } +} + //------------------------------------------------------------------------------ TEST(numerics_matrix, random_access_operators) { diff --git a/src/axom/core/tests/numerics_matvecops.hpp b/src/axom/core/tests/numerics_matvecops.hpp index 1ad8723d5c..88903a726c 100644 --- a/src/axom/core/tests/numerics_matvecops.hpp +++ b/src/axom/core/tests/numerics_matvecops.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/numerics_polynomial_solvers.hpp b/src/axom/core/tests/numerics_polynomial_solvers.hpp index 92f2bcc719..fe902f3141 100644 --- a/src/axom/core/tests/numerics_polynomial_solvers.hpp +++ b/src/axom/core/tests/numerics_polynomial_solvers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/utils_Timer.hpp b/src/axom/core/tests/utils_Timer.hpp index b8fc29b082..ad26de0ff1 100644 --- a/src/axom/core/tests/utils_Timer.hpp +++ b/src/axom/core/tests/utils_Timer.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/utils_config.cpp b/src/axom/core/tests/utils_config.cpp index 3709d80adf..6bc261d49b 100644 --- a/src/axom/core/tests/utils_config.cpp +++ b/src/axom/core/tests/utils_config.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/utils_endianness.hpp b/src/axom/core/tests/utils_endianness.hpp index 056d53a5b7..0579f1191b 100644 --- a/src/axom/core/tests/utils_endianness.hpp +++ b/src/axom/core/tests/utils_endianness.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -8,6 +8,8 @@ #include "axom/config.hpp" #include "axom/core/utilities/Utilities.hpp" +#include "axom/fmt.hpp" + #include #include @@ -21,6 +23,62 @@ TEST(utils_endianness, print_endianness) << std::endl; } +TEST(utils_endianness, basic) +{ + // compare and print the hex value and that of its swapped bytes + auto compare_and_dump = [](auto type, auto val) { + const auto rev = axom::utilities::byteswap(val); + const auto revrev = axom::utilities::byteswap(rev); + EXPECT_EQ(val, revrev); + + std::cout << axom::fmt::format("[{}], orig: '0x{:X}'; swapped '0x{:X}'\n", + type, + val, + rev); + }; + + { + constexpr auto orig = std::uint8_t(0xa); + compare_and_dump("U8", orig); + EXPECT_EQ(orig, axom::utilities::byteswap(orig)); + } + + { + constexpr auto orig = std::uint16_t(0xCAFE); + compare_and_dump("U16", orig); + EXPECT_NE(orig, axom::utilities::byteswap(orig)); + } + + { + constexpr auto orig = std::uint32_t(0xDEADBEEFu); + compare_and_dump("U32", orig); + EXPECT_NE(orig, axom::utilities::byteswap(orig)); + } + + { + constexpr auto orig = std::uint64_t {0x0123456789ABCDEFull}; + compare_and_dump("U64", orig); + EXPECT_NE(orig, axom::utilities::byteswap(orig)); + } +} + +TEST(utils_endianness, endianness_8) +{ + { + std::int8_t v1 = 5; + std::int8_t v2 = axom::utilities::byteswap(v1); + + EXPECT_EQ(v1, v2); + } + + { + std::uint8_t v1 = 5; + std::uint8_t v2 = axom::utilities::byteswap(v1); + + EXPECT_EQ(v1, v2); + } +} + TEST(utils_endianness, endianness_16) { union SixteenBit @@ -38,8 +96,8 @@ TEST(utils_endianness, endianness_16) // Test short { short v1 = valOrig.short_val; - short v2 = axom::utilities::swapEndian(v1); - short v3 = axom::utilities::swapEndian(v2); + short v2 = axom::utilities::byteswap(v1); + short v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.short_val, v1); EXPECT_EQ(valSwap.short_val, v2); @@ -49,8 +107,8 @@ TEST(utils_endianness, endianness_16) // Test unsigned short { unsigned short v1 = valOrig.ushort_val; - unsigned short v2 = axom::utilities::swapEndian(v1); - unsigned short v3 = axom::utilities::swapEndian(v2); + unsigned short v2 = axom::utilities::byteswap(v1); + unsigned short v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.ushort_val, v1); EXPECT_EQ(valSwap.ushort_val, v2); @@ -60,8 +118,8 @@ TEST(utils_endianness, endianness_16) // Test int16 { std::int16_t v1 = valOrig.i_val; - std::int16_t v2 = axom::utilities::swapEndian(v1); - std::int16_t v3 = axom::utilities::swapEndian(v2); + std::int16_t v2 = axom::utilities::byteswap(v1); + std::int16_t v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.i_val, v1); EXPECT_EQ(valSwap.i_val, v2); @@ -71,8 +129,8 @@ TEST(utils_endianness, endianness_16) // Test uint16 { std::uint16_t v1 = valOrig.i_val; - std::uint16_t v2 = axom::utilities::swapEndian(v1); - std::uint16_t v3 = axom::utilities::swapEndian(v2); + std::uint16_t v2 = axom::utilities::byteswap(v1); + std::uint16_t v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.ui_val, v1); EXPECT_EQ(valSwap.ui_val, v2); @@ -98,8 +156,8 @@ TEST(utils_endianness, endianness_32) // Test int { int v1 = valOrig.int_val; - int v2 = axom::utilities::swapEndian(v1); - int v3 = axom::utilities::swapEndian(v2); + int v2 = axom::utilities::byteswap(v1); + int v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.int_val, v1); EXPECT_EQ(valSwap.int_val, v2); @@ -109,8 +167,8 @@ TEST(utils_endianness, endianness_32) // Test unsigned int { unsigned int v1 = valOrig.uint_val; - unsigned int v2 = axom::utilities::swapEndian(v1); - unsigned int v3 = axom::utilities::swapEndian(v2); + unsigned int v2 = axom::utilities::byteswap(v1); + unsigned int v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.uint_val, v1); EXPECT_EQ(valSwap.uint_val, v2); @@ -120,8 +178,8 @@ TEST(utils_endianness, endianness_32) // Test int32 { std::int32_t v1 = valOrig.i_val; - std::int32_t v2 = axom::utilities::swapEndian(v1); - std::int32_t v3 = axom::utilities::swapEndian(v2); + std::int32_t v2 = axom::utilities::byteswap(v1); + std::int32_t v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.i_val, v1); EXPECT_EQ(valSwap.i_val, v2); @@ -131,8 +189,8 @@ TEST(utils_endianness, endianness_32) // Test uint32 { std::uint32_t v1 = valOrig.i_val; - std::uint32_t v2 = axom::utilities::swapEndian(v1); - std::uint32_t v3 = axom::utilities::swapEndian(v2); + std::uint32_t v2 = axom::utilities::byteswap(v1); + std::uint32_t v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.ui_val, v1); EXPECT_EQ(valSwap.ui_val, v2); @@ -142,8 +200,8 @@ TEST(utils_endianness, endianness_32) // Test float { float v1 = valOrig.f_val; - float v2 = axom::utilities::swapEndian(v1); - float v3 = axom::utilities::swapEndian(v2); + float v2 = axom::utilities::byteswap(v1); + float v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.f_val, v1); EXPECT_EQ(valSwap.f_val, v2); @@ -170,8 +228,8 @@ TEST(utils_endianness, endianness_64) // Test int64 { std::int64_t v1 = valOrig.i_val; - std::int64_t v2 = axom::utilities::swapEndian(v1); - std::int64_t v3 = axom::utilities::swapEndian(v2); + std::int64_t v2 = axom::utilities::byteswap(v1); + std::int64_t v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.i_val, v1); EXPECT_EQ(valSwap.i_val, v2); @@ -181,8 +239,8 @@ TEST(utils_endianness, endianness_64) // Test uint64 { std::uint64_t v1 = valOrig.i_val; - std::uint64_t v2 = axom::utilities::swapEndian(v1); - std::uint64_t v3 = axom::utilities::swapEndian(v2); + std::uint64_t v2 = axom::utilities::byteswap(v1); + std::uint64_t v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.ui_val, v1); EXPECT_EQ(valSwap.ui_val, v2); @@ -193,8 +251,8 @@ TEST(utils_endianness, endianness_64) // Test double { double v1 = valOrig.d_val; - double v2 = axom::utilities::swapEndian(v1); - double v3 = axom::utilities::swapEndian(v2); + double v2 = axom::utilities::byteswap(v1); + double v3 = axom::utilities::byteswap(v2); EXPECT_EQ(valOrig.d_val, v1); EXPECT_EQ(valSwap.d_val, v2); @@ -203,28 +261,7 @@ TEST(utils_endianness, endianness_64) } #if 0 -// Note: Checks that swapEndian static_asserts for types within invalid sizes. -// Commented out since it should lead to a compile error -TEST(utils_endianness,invalid_byte_width) -{ - { - std::int8_t v1 = 5; - std::int8_t v2 = axom::utilities::swapEndian(v1); - - EXPECT_EQ(v1, v2); - } - - { - std::uint8_t v1 = 5; - std::uint8_t v2 = axom::utilities::swapEndian(v1); - - EXPECT_EQ(v1, v2); - } -} -#endif - -#if 0 -// Note: Checks that swapEndian static_asserts for non-native types. +// Note: Checks that byteswap static_asserts for non-native types. // Commented out since it should lead to a compile error. TEST(utils_endianness,invalid_non_native_types) { @@ -238,7 +275,7 @@ TEST(utils_endianness,invalid_non_native_types) v1.a = 5; v1.b = 12; - AxomUtilsTestsNonNative v2 = axom::utilities::swapEndian(v1); + AxomUtilsTestsNonNative v2 = axom::utilities::byteswap(v1); EXPECT_NE(v1.a, v2.a); EXPECT_NE(v1.b, v2.b); diff --git a/src/axom/core/tests/utils_fileUtilities.hpp b/src/axom/core/tests/utils_fileUtilities.hpp index caf13bcecf..97de0bcc2f 100644 --- a/src/axom/core/tests/utils_fileUtilities.hpp +++ b/src/axom/core/tests/utils_fileUtilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/utils_locale.hpp b/src/axom/core/tests/utils_locale.hpp index 04e97a788e..fa72bf3662 100644 --- a/src/axom/core/tests/utils_locale.hpp +++ b/src/axom/core/tests/utils_locale.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/utils_nvtx_settings.hpp b/src/axom/core/tests/utils_nvtx_settings.hpp index 63a40595fe..59a2d85408 100644 --- a/src/axom/core/tests/utils_nvtx_settings.hpp +++ b/src/axom/core/tests/utils_nvtx_settings.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/utils_stringUtilities.hpp b/src/axom/core/tests/utils_stringUtilities.hpp index 90dc8c65bd..e05988828c 100644 --- a/src/axom/core/tests/utils_stringUtilities.hpp +++ b/src/axom/core/tests/utils_stringUtilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/utils_system.hpp b/src/axom/core/tests/utils_system.hpp index dbcdb6ea53..e143b9d6f5 100644 --- a/src/axom/core/tests/utils_system.hpp +++ b/src/axom/core/tests/utils_system.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/tests/utils_utilities.hpp b/src/axom/core/tests/utils_utilities.hpp index 8da634f4b0..6490951dd9 100644 --- a/src/axom/core/tests/utils_utilities.hpp +++ b/src/axom/core/tests/utils_utilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/About.cpp.in b/src/axom/core/utilities/About.cpp.in index 8176951e0e..499d2e5770 100644 --- a/src/axom/core/utilities/About.cpp.in +++ b/src/axom/core/utilities/About.cpp.in @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/About.hpp b/src/axom/core/utilities/About.hpp index 381a89d845..13594a0b9d 100644 --- a/src/axom/core/utilities/About.hpp +++ b/src/axom/core/utilities/About.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/AnnotationMacros.hpp b/src/axom/core/utilities/AnnotationMacros.hpp index 9299744471..28f5dbed94 100644 --- a/src/axom/core/utilities/AnnotationMacros.hpp +++ b/src/axom/core/utilities/AnnotationMacros.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/BitUtilities.hpp b/src/axom/core/utilities/BitUtilities.hpp index e57088362f..2ed603983f 100644 --- a/src/axom/core/utilities/BitUtilities.hpp +++ b/src/axom/core/utilities/BitUtilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -18,9 +18,12 @@ #include "axom/core/Macros.hpp" #include "axom/core/Types.hpp" +// CUDA intrinsics: https://docs.nvidia.com/cuda/cuda-math-api/group__CUDA__MATH__INTRINSIC__INT.html +// TODO: Support HIP intrinsics (https://rocm.docs.amd.com/projects/HIP/en/latest/reference/kernel_language.html) + // Check for and setup defines for platform-specific intrinsics // Note: `__GNUC__` is defined for the gnu, clang and intel compilers -#if defined(__CUDACC__) +#if defined(AXOM_USE_CUDA) // Intrinsics included implicitly #elif defined(_WIN64) && (_MSC_VER >= 1600) #define _AXOM_CORE_USE_INTRINSICS_MSVC @@ -81,10 +84,10 @@ struct BitTraits * \return The number of zeros to the right of the first set bit in \word, * starting with the least significant bit, or 64 if \a word == 0. */ -AXOM_HOST_DEVICE inline int trailingZeros(std::uint64_t word) +AXOM_HOST_DEVICE inline int countr_zero(std::uint64_t word) noexcept { /* clang-format off */ -#if defined(AXOM_DEVICE_CODE) && defined(AXOM_USE_CUDA) +#if defined(__CUDA_ARCH__) && defined(AXOM_USE_CUDA) return word != std::uint64_t(0) ? __ffsll(word) - 1 : 64; #elif defined(_AXOM_CORE_USE_INTRINSICS_MSVC) unsigned long cnt; @@ -118,10 +121,10 @@ AXOM_HOST_DEVICE inline int trailingZeros(std::uint64_t word) * \accelerated * \return number of bits in \a word that are set to 1 */ -AXOM_HOST_DEVICE inline int popCount(std::uint64_t word) +AXOM_HOST_DEVICE inline int popcount(std::uint64_t word) noexcept { /* clang-format off */ -#if defined(AXOM_DEVICE_CODE) && defined(AXOM_USE_CUDA) +#if defined(__CUDA_ARCH__) && defined(AXOM_USE_CUDA) // Use CUDA intrinsic for popcount return __popcll(word); #elif defined(_AXOM_CORE_USE_INTRINSICS_MSVC) @@ -157,10 +160,10 @@ AXOM_HOST_DEVICE inline int popCount(std::uint64_t word) * \return The number of zeros to the left of the first set bit in \word, * starting with the least significant bit. */ -AXOM_HOST_DEVICE inline std::int32_t leadingZeros(std::int32_t word) +AXOM_HOST_DEVICE inline std::int32_t countl_zero(std::int32_t word) noexcept { /* clang-format off */ -#if defined(AXOM_DEVICE_CODE) && defined(AXOM_USE_CUDA) +#if defined(__CUDA_ARCH__) && defined(AXOM_USE_CUDA) // Use CUDA intrinsic for count leading zeros return __clz(word); #elif defined(_AXOM_CORE_USE_INTRINSICS_MSVC) @@ -169,7 +172,7 @@ AXOM_HOST_DEVICE inline std::int32_t leadingZeros(std::int32_t word) #elif defined(_AXOM_CORE_USE_INTRINSICS_GCC) || defined(_AXOM_CORE_USE_INTRINSICS_PPC) return word != std::int32_t(0) ? __builtin_clz(word) : 32; #else - std::int32_t y; + std::int32_t y {}; std::int32_t n = 32; y = word >> 16; if(y != 0) { n -= 16; word = y;} y = word >> 8; if(y != 0) { n -= 8; word = y;} diff --git a/src/axom/core/utilities/FileUtilities.cpp b/src/axom/core/utilities/FileUtilities.cpp index b0b45e58de..c359ed9dd6 100644 --- a/src/axom/core/utilities/FileUtilities.cpp +++ b/src/axom/core/utilities/FileUtilities.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/FileUtilities.hpp b/src/axom/core/utilities/FileUtilities.hpp index 5c1da67e22..48a38666db 100644 --- a/src/axom/core/utilities/FileUtilities.hpp +++ b/src/axom/core/utilities/FileUtilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/StringUtilities.cpp b/src/axom/core/utilities/StringUtilities.cpp index 5c3c7da65d..6fe775304b 100644 --- a/src/axom/core/utilities/StringUtilities.cpp +++ b/src/axom/core/utilities/StringUtilities.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/StringUtilities.hpp b/src/axom/core/utilities/StringUtilities.hpp index 10b127b2e0..3f411fcd64 100644 --- a/src/axom/core/utilities/StringUtilities.hpp +++ b/src/axom/core/utilities/StringUtilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/System.cpp b/src/axom/core/utilities/System.cpp index e34de4a432..19aa48dfad 100644 --- a/src/axom/core/utilities/System.cpp +++ b/src/axom/core/utilities/System.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -97,7 +97,7 @@ std::locale locale(const std::string& name) } catch(std::runtime_error&) { - loc = std::locale(loc, "", std::locale::ctype); + loc = std::locale(loc, "C", std::locale::ctype); } return loc; diff --git a/src/axom/core/utilities/System.hpp b/src/axom/core/utilities/System.hpp index 45dc3fdffb..9873a685d8 100644 --- a/src/axom/core/utilities/System.hpp +++ b/src/axom/core/utilities/System.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/Timer.hpp b/src/axom/core/utilities/Timer.hpp index 0ffbd5297e..90dfbcece8 100644 --- a/src/axom/core/utilities/Timer.hpp +++ b/src/axom/core/utilities/Timer.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/Utilities.cpp b/src/axom/core/utilities/Utilities.cpp index c5fe262eef..7edf95d46f 100644 --- a/src/axom/core/utilities/Utilities.cpp +++ b/src/axom/core/utilities/Utilities.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/Utilities.hpp b/src/axom/core/utilities/Utilities.hpp index 260d5a6c61..a33cf61ce9 100644 --- a/src/axom/core/utilities/Utilities.hpp +++ b/src/axom/core/utilities/Utilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -265,24 +265,24 @@ inline bool isLittleEndian() } /*! - * \brief Swaps the endianness of the input value. - * \param [in] val The input value. - * \return The value with endianness swapped. + * \brief Reverses the bytes of the input value. + * \param [in] val The input value + * \return The value with swapped bytes * \note Assumes endianness is either little or big (not PDP). * \pre T is a native arithmetic type (i.e. integral or floating point). - * \pre sizeof(T) must be 2, 4, or 8 bytes. + * \pre sizeof(T) must be 1, 2, 4, or 8 bytes. */ template -T swapEndian(T val) +constexpr T byteswap(T val) noexcept { - const int NBYTES = sizeof(T); + constexpr int NBYTES = sizeof(T); AXOM_STATIC_ASSERT_MSG( - NBYTES == 2 || NBYTES == 4 || NBYTES == 8, - "swapEndian only valid for types of size 2, 4 or 8 bytes."); + NBYTES == 1 || NBYTES == 2 || NBYTES == 4 || NBYTES == 8, + "byteswap only valid for types of size 1, 2, 4 or 8 bytes."); AXOM_STATIC_ASSERT_MSG(std::is_arithmetic::value, - "swapEndian only valid for native arithmetic types"); + "byteswap only valid for native arithmetic types"); union { diff --git a/src/axom/core/utilities/nvtx/Macros.hpp b/src/axom/core/utilities/nvtx/Macros.hpp index fb42e62b3f..11eb77ad13 100644 --- a/src/axom/core/utilities/nvtx/Macros.hpp +++ b/src/axom/core/utilities/nvtx/Macros.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/nvtx/Range.cpp b/src/axom/core/utilities/nvtx/Range.cpp index 14549d3c21..fd7c382da8 100644 --- a/src/axom/core/utilities/nvtx/Range.cpp +++ b/src/axom/core/utilities/nvtx/Range.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/nvtx/Range.hpp b/src/axom/core/utilities/nvtx/Range.hpp index d179ae1f9d..7a67a7bd4c 100644 --- a/src/axom/core/utilities/nvtx/Range.hpp +++ b/src/axom/core/utilities/nvtx/Range.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/nvtx/interface.cpp b/src/axom/core/utilities/nvtx/interface.cpp index 92a418d55b..f409c9673c 100644 --- a/src/axom/core/utilities/nvtx/interface.cpp +++ b/src/axom/core/utilities/nvtx/interface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/core/utilities/nvtx/interface.hpp b/src/axom/core/utilities/nvtx/interface.hpp index ac8f6a5f67..ecec933106 100644 --- a/src/axom/core/utilities/nvtx/interface.hpp +++ b/src/axom/core/utilities/nvtx/interface.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -7,15 +7,14 @@ #define AXOM_NVTX_INTERFACE_HPP_ #include "axom/core/utilities/nvtx/Macros.hpp" +#include // For uint32_t namespace axom { namespace nvtx { -/*! - * \brief Predefined set of NVTX colors to use with NVTXRange. - */ -enum class Color : uint32_t +/// \brief Predefined set of NVTX colors to use with NVTXRange +enum class Color : std::uint32_t { BLACK = 0x00000000, GREEN = 0x0000FF00, diff --git a/src/axom/inlet/CMakeLists.txt b/src/axom/inlet/CMakeLists.txt index bf7d6a71df..e65d90b95d 100644 --- a/src/axom/inlet/CMakeLists.txt +++ b/src/axom/inlet/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/ConduitReader.cpp b/src/axom/inlet/ConduitReader.cpp index 657a1d70a3..e14ccd3a35 100644 --- a/src/axom/inlet/ConduitReader.cpp +++ b/src/axom/inlet/ConduitReader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/ConduitReader.hpp b/src/axom/inlet/ConduitReader.hpp index 8d8f5caf7e..0c7445920c 100644 --- a/src/axom/inlet/ConduitReader.hpp +++ b/src/axom/inlet/ConduitReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Container.cpp b/src/axom/inlet/Container.cpp index 198832cc41..78879f0b5f 100644 --- a/src/axom/inlet/Container.cpp +++ b/src/axom/inlet/Container.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Container.hpp b/src/axom/inlet/Container.hpp index 7672350dc6..a4eb740a05 100644 --- a/src/axom/inlet/Container.hpp +++ b/src/axom/inlet/Container.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Field.cpp b/src/axom/inlet/Field.cpp index 97bfaa2b0b..5455c211eb 100644 --- a/src/axom/inlet/Field.cpp +++ b/src/axom/inlet/Field.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Field.hpp b/src/axom/inlet/Field.hpp index a58c645e77..b895c0f92d 100644 --- a/src/axom/inlet/Field.hpp +++ b/src/axom/inlet/Field.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Function.cpp b/src/axom/inlet/Function.cpp index 7137a337e0..638a2a466d 100644 --- a/src/axom/inlet/Function.cpp +++ b/src/axom/inlet/Function.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Function.hpp b/src/axom/inlet/Function.hpp index 44b67a87b1..23c8113012 100644 --- a/src/axom/inlet/Function.hpp +++ b/src/axom/inlet/Function.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Inlet.cpp b/src/axom/inlet/Inlet.cpp index 11d9f86020..d610102eff 100644 --- a/src/axom/inlet/Inlet.cpp +++ b/src/axom/inlet/Inlet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Inlet.hpp b/src/axom/inlet/Inlet.hpp index dc9a1b1c4e..c3aec617bd 100644 --- a/src/axom/inlet/Inlet.hpp +++ b/src/axom/inlet/Inlet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/InletVector.hpp b/src/axom/inlet/InletVector.hpp index 9b0200c682..82f8e42a44 100644 --- a/src/axom/inlet/InletVector.hpp +++ b/src/axom/inlet/InletVector.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/JSONReader.hpp b/src/axom/inlet/JSONReader.hpp index ae2b7fe32c..c63e54a12b 100644 --- a/src/axom/inlet/JSONReader.hpp +++ b/src/axom/inlet/JSONReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/JSONSchemaWriter.cpp b/src/axom/inlet/JSONSchemaWriter.cpp index afbbc5c45e..41716da921 100644 --- a/src/axom/inlet/JSONSchemaWriter.cpp +++ b/src/axom/inlet/JSONSchemaWriter.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/JSONSchemaWriter.hpp b/src/axom/inlet/JSONSchemaWriter.hpp index c50d43395b..0d57e101fb 100644 --- a/src/axom/inlet/JSONSchemaWriter.hpp +++ b/src/axom/inlet/JSONSchemaWriter.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/LuaReader.cpp b/src/axom/inlet/LuaReader.cpp index ec7bad0449..e6b280a937 100644 --- a/src/axom/inlet/LuaReader.cpp +++ b/src/axom/inlet/LuaReader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/LuaReader.hpp b/src/axom/inlet/LuaReader.hpp index e2168eef59..5f9e5d6819 100644 --- a/src/axom/inlet/LuaReader.hpp +++ b/src/axom/inlet/LuaReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Proxy.cpp b/src/axom/inlet/Proxy.cpp index 2f090fb42b..a995587f85 100644 --- a/src/axom/inlet/Proxy.cpp +++ b/src/axom/inlet/Proxy.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Proxy.hpp b/src/axom/inlet/Proxy.hpp index d69a1e267c..7f6a867df9 100644 --- a/src/axom/inlet/Proxy.hpp +++ b/src/axom/inlet/Proxy.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Reader.hpp b/src/axom/inlet/Reader.hpp index bd8f4aba73..c66fc64b44 100644 --- a/src/axom/inlet/Reader.hpp +++ b/src/axom/inlet/Reader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/SphinxWriter.cpp b/src/axom/inlet/SphinxWriter.cpp index b280dbf384..adfc7622d8 100644 --- a/src/axom/inlet/SphinxWriter.cpp +++ b/src/axom/inlet/SphinxWriter.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/SphinxWriter.hpp b/src/axom/inlet/SphinxWriter.hpp index 7c4046093d..7400f61b1e 100644 --- a/src/axom/inlet/SphinxWriter.hpp +++ b/src/axom/inlet/SphinxWriter.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/VariantKey.cpp b/src/axom/inlet/VariantKey.cpp index 8bc751d4e9..b273be84af 100644 --- a/src/axom/inlet/VariantKey.cpp +++ b/src/axom/inlet/VariantKey.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/VariantKey.hpp b/src/axom/inlet/VariantKey.hpp index 0a801958be..adf6314c2b 100644 --- a/src/axom/inlet/VariantKey.hpp +++ b/src/axom/inlet/VariantKey.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -126,7 +126,7 @@ class VariantKey // Integer and string keys // With only two possible types a union is overkill - int m_int; + int m_int {}; std::string m_string; // Active key type diff --git a/src/axom/inlet/Verifiable.hpp b/src/axom/inlet/Verifiable.hpp index 4c747859d3..f8c06f0eff 100644 --- a/src/axom/inlet/Verifiable.hpp +++ b/src/axom/inlet/Verifiable.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/VerifiableScalar.cpp b/src/axom/inlet/VerifiableScalar.cpp index 71492e49a6..ff446abf0c 100644 --- a/src/axom/inlet/VerifiableScalar.cpp +++ b/src/axom/inlet/VerifiableScalar.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/VerifiableScalar.hpp b/src/axom/inlet/VerifiableScalar.hpp index ac5458ad45..9b052b43da 100644 --- a/src/axom/inlet/VerifiableScalar.hpp +++ b/src/axom/inlet/VerifiableScalar.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/Writer.hpp b/src/axom/inlet/Writer.hpp index 0cf3596a44..416a2e44f7 100644 --- a/src/axom/inlet/Writer.hpp +++ b/src/axom/inlet/Writer.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/YAMLReader.hpp b/src/axom/inlet/YAMLReader.hpp index b126777519..87892b1417 100644 --- a/src/axom/inlet/YAMLReader.hpp +++ b/src/axom/inlet/YAMLReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/CMakeLists.txt b/src/axom/inlet/examples/CMakeLists.txt index 8ddf34dff0..822270d66f 100644 --- a/src/axom/inlet/examples/CMakeLists.txt +++ b/src/axom/inlet/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/arrays.cpp b/src/axom/inlet/examples/arrays.cpp index 1a7d9d2c9f..67717ddb81 100644 --- a/src/axom/inlet/examples/arrays.cpp +++ b/src/axom/inlet/examples/arrays.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/containers.cpp b/src/axom/inlet/examples/containers.cpp index ac92a497ec..2549f321fe 100644 --- a/src/axom/inlet/examples/containers.cpp +++ b/src/axom/inlet/examples/containers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/documentation_generation.cpp b/src/axom/inlet/examples/documentation_generation.cpp index db956d21cf..c9748b4cf6 100644 --- a/src/axom/inlet/examples/documentation_generation.cpp +++ b/src/axom/inlet/examples/documentation_generation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/fields.cpp b/src/axom/inlet/examples/fields.cpp index ac50910940..01739830c6 100644 --- a/src/axom/inlet/examples/fields.cpp +++ b/src/axom/inlet/examples/fields.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/lua_library.cpp b/src/axom/inlet/examples/lua_library.cpp index b47b2045fe..b57a7b7f4c 100644 --- a/src/axom/inlet/examples/lua_library.cpp +++ b/src/axom/inlet/examples/lua_library.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/mfem_coefficient.cpp b/src/axom/inlet/examples/mfem_coefficient.cpp index f57d9df694..ba84c717d3 100644 --- a/src/axom/inlet/examples/mfem_coefficient.cpp +++ b/src/axom/inlet/examples/mfem_coefficient.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/nested_structs.cpp b/src/axom/inlet/examples/nested_structs.cpp index 6b2366f18b..82119fa736 100644 --- a/src/axom/inlet/examples/nested_structs.cpp +++ b/src/axom/inlet/examples/nested_structs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/user_defined_type.cpp b/src/axom/inlet/examples/user_defined_type.cpp index 99bcc56fda..e2047b2711 100644 --- a/src/axom/inlet/examples/user_defined_type.cpp +++ b/src/axom/inlet/examples/user_defined_type.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/examples/verification.cpp b/src/axom/inlet/examples/verification.cpp index f1eb6b352d..2dfc4c316a 100644 --- a/src/axom/inlet/examples/verification.cpp +++ b/src/axom/inlet/examples/verification.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/inlet_utils.cpp b/src/axom/inlet/inlet_utils.cpp index c65a1739e6..86596719b4 100644 --- a/src/axom/inlet/inlet_utils.cpp +++ b/src/axom/inlet/inlet_utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/inlet_utils.hpp b/src/axom/inlet/inlet_utils.hpp index 1dc61f1259..033ab89dd8 100644 --- a/src/axom/inlet/inlet_utils.hpp +++ b/src/axom/inlet/inlet_utils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/tests/CMakeLists.txt b/src/axom/inlet/tests/CMakeLists.txt index d2e0037738..706156ed82 100644 --- a/src/axom/inlet/tests/CMakeLists.txt +++ b/src/axom/inlet/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -19,11 +19,11 @@ axom_add_library(NAME inlet_test_utils # Add Serial GTests based tests set(gtest_inlet_tests inlet_Reader.cpp - inlet_jsonschema_writer.cpp inlet_restart.cpp inlet_errors.cpp ) blt_list_append(TO gtest_inlet_tests ELEMENTS inlet_function.cpp IF SOL_FOUND) +blt_list_append(TO gtest_inlet_tests ELEMENTS inlet_jsonschema_writer.cpp IF JSONSCHEMA_FOUND) foreach(test ${gtest_inlet_tests}) get_filename_component( test_name ${test} NAME_WE ) diff --git a/src/axom/inlet/tests/inlet_Inlet.cpp b/src/axom/inlet/tests/inlet_Inlet.cpp index acb97203a9..4a95cf9a1a 100644 --- a/src/axom/inlet/tests/inlet_Inlet.cpp +++ b/src/axom/inlet/tests/inlet_Inlet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/tests/inlet_Reader.cpp b/src/axom/inlet/tests/inlet_Reader.cpp index 7fab6160f7..85990cc664 100644 --- a/src/axom/inlet/tests/inlet_Reader.cpp +++ b/src/axom/inlet/tests/inlet_Reader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/tests/inlet_errors.cpp b/src/axom/inlet/tests/inlet_errors.cpp index 094b33a31e..d4c6f5915c 100644 --- a/src/axom/inlet/tests/inlet_errors.cpp +++ b/src/axom/inlet/tests/inlet_errors.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/tests/inlet_function.cpp b/src/axom/inlet/tests/inlet_function.cpp index f9192aa4bf..d7a2c44413 100644 --- a/src/axom/inlet/tests/inlet_function.cpp +++ b/src/axom/inlet/tests/inlet_function.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/tests/inlet_jsonschema_writer.cpp b/src/axom/inlet/tests/inlet_jsonschema_writer.cpp index 932e3ce7e3..2e1ef205e8 100644 --- a/src/axom/inlet/tests/inlet_jsonschema_writer.cpp +++ b/src/axom/inlet/tests/inlet_jsonschema_writer.cpp @@ -1,10 +1,11 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) #include "axom/slic.hpp" +#include "axom/config.hpp" #include "axom/inlet/Inlet.hpp" #include "axom/inlet/JSONSchemaWriter.hpp" #include "axom/inlet/tests/inlet_test_utils.hpp" @@ -21,8 +22,6 @@ using axom::inlet::Inlet; using axom::inlet::JSONSchemaWriter; -#define JSONSCHEMA_EXECUTABLE "jsonschema" - bool hasSchemaUtility() { const static bool hasUtility = diff --git a/src/axom/inlet/tests/inlet_object.cpp b/src/axom/inlet/tests/inlet_object.cpp index b19a737165..5c52d8efe1 100644 --- a/src/axom/inlet/tests/inlet_object.cpp +++ b/src/axom/inlet/tests/inlet_object.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/tests/inlet_restart.cpp b/src/axom/inlet/tests/inlet_restart.cpp index f991853911..2fc91eff7d 100644 --- a/src/axom/inlet/tests/inlet_restart.cpp +++ b/src/axom/inlet/tests/inlet_restart.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/tests/inlet_test_utils.cpp b/src/axom/inlet/tests/inlet_test_utils.cpp index e341fa5cfb..d70843e2f8 100644 --- a/src/axom/inlet/tests/inlet_test_utils.cpp +++ b/src/axom/inlet/tests/inlet_test_utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/inlet/tests/inlet_test_utils.hpp b/src/axom/inlet/tests/inlet_test_utils.hpp index 7a41c04b40..75750c202b 100644 --- a/src/axom/inlet/tests/inlet_test_utils.hpp +++ b/src/axom/inlet/tests/inlet_test_utils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/CMakeLists.txt b/src/axom/klee/CMakeLists.txt index 588cda5225..e49699aed9 100644 --- a/src/axom/klee/CMakeLists.txt +++ b/src/axom/klee/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/Dimensions.hpp b/src/axom/klee/Dimensions.hpp index 2bf4f6e5a8..41f08ce054 100644 --- a/src/axom/klee/Dimensions.hpp +++ b/src/axom/klee/Dimensions.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/Geometry.cpp b/src/axom/klee/Geometry.cpp index dac4e85a02..35fe74940c 100644 --- a/src/axom/klee/Geometry.cpp +++ b/src/axom/klee/Geometry.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/Geometry.hpp b/src/axom/klee/Geometry.hpp index 44b3e6f884..2e8e63abe8 100644 --- a/src/axom/klee/Geometry.hpp +++ b/src/axom/klee/Geometry.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/GeometryOperators.cpp b/src/axom/klee/GeometryOperators.cpp index 6a14f7d17c..e1f5c459bb 100644 --- a/src/axom/klee/GeometryOperators.cpp +++ b/src/axom/klee/GeometryOperators.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/GeometryOperators.hpp b/src/axom/klee/GeometryOperators.hpp index c39c260209..7f217cf2ff 100644 --- a/src/axom/klee/GeometryOperators.hpp +++ b/src/axom/klee/GeometryOperators.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/GeometryOperatorsIO.cpp b/src/axom/klee/GeometryOperatorsIO.cpp index 67d406e92c..b8c811bd6f 100644 --- a/src/axom/klee/GeometryOperatorsIO.cpp +++ b/src/axom/klee/GeometryOperatorsIO.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/GeometryOperatorsIO.hpp b/src/axom/klee/GeometryOperatorsIO.hpp index 169543c81a..04bf55f138 100644 --- a/src/axom/klee/GeometryOperatorsIO.hpp +++ b/src/axom/klee/GeometryOperatorsIO.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/IO.cpp b/src/axom/klee/IO.cpp index 2295e014be..dd0ef6c0df 100644 --- a/src/axom/klee/IO.cpp +++ b/src/axom/klee/IO.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/IO.hpp b/src/axom/klee/IO.hpp index 36301f1cff..ef2c398d6c 100644 --- a/src/axom/klee/IO.hpp +++ b/src/axom/klee/IO.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/IOUtil.cpp b/src/axom/klee/IOUtil.cpp index 19c6eaddef..06b02ea0e0 100644 --- a/src/axom/klee/IOUtil.cpp +++ b/src/axom/klee/IOUtil.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/IOUtil.hpp b/src/axom/klee/IOUtil.hpp index c98447e3af..0f1e1ded34 100644 --- a/src/axom/klee/IOUtil.hpp +++ b/src/axom/klee/IOUtil.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/KleeError.cpp b/src/axom/klee/KleeError.cpp index be7fc3c1d9..a83c068da4 100644 --- a/src/axom/klee/KleeError.cpp +++ b/src/axom/klee/KleeError.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/KleeError.hpp b/src/axom/klee/KleeError.hpp index 7ea2ffcada..5de2439f82 100644 --- a/src/axom/klee/KleeError.hpp +++ b/src/axom/klee/KleeError.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/Shape.cpp b/src/axom/klee/Shape.cpp index 022bd4a0c9..8835aea4a5 100644 --- a/src/axom/klee/Shape.cpp +++ b/src/axom/klee/Shape.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/Shape.hpp b/src/axom/klee/Shape.hpp index 875859d364..4cdaf262b0 100644 --- a/src/axom/klee/Shape.hpp +++ b/src/axom/klee/Shape.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/ShapeSet.cpp b/src/axom/klee/ShapeSet.cpp index 26ef119d9e..326000bce9 100644 --- a/src/axom/klee/ShapeSet.cpp +++ b/src/axom/klee/ShapeSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/ShapeSet.hpp b/src/axom/klee/ShapeSet.hpp index 46b5218a85..f8c197b31a 100644 --- a/src/axom/klee/ShapeSet.hpp +++ b/src/axom/klee/ShapeSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/Units.cpp b/src/axom/klee/Units.cpp index 385cdbe47a..827c9cc5c2 100644 --- a/src/axom/klee/Units.cpp +++ b/src/axom/klee/Units.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/Units.hpp b/src/axom/klee/Units.hpp index ccdf766734..7fe230c4c7 100644 --- a/src/axom/klee/Units.hpp +++ b/src/axom/klee/Units.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/docs/sphinx/index.rst b/src/axom/klee/docs/sphinx/index.rst index 9724cf30a0..cec475b040 100644 --- a/src/axom/klee/docs/sphinx/index.rst +++ b/src/axom/klee/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level COPYRIGHT file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/CMakeLists.txt b/src/axom/klee/tests/CMakeLists.txt index ea49dddc61..5602c649c7 100644 --- a/src/axom/klee/tests/CMakeLists.txt +++ b/src/axom/klee/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/KleeMatchers.hpp b/src/axom/klee/tests/KleeMatchers.hpp index 2497ea5bad..c25de3bfd0 100644 --- a/src/axom/klee/tests/KleeMatchers.hpp +++ b/src/axom/klee/tests/KleeMatchers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -61,13 +61,24 @@ class AlmostEqMatrixMatcher void DescribeTo(std::ostream*) const { } void DescribeNegationTo(std::ostream*) const { } + friend bool operator==(const AlmostEqMatrixMatcher& lhs, + const axom::numerics::Matrix& rhs) + { + return lhs.MatchAndExplain(rhs, nullptr); + } + + friend bool operator==(const axom::numerics::Matrix& lhs, + const AlmostEqMatrixMatcher& rhs) + { + return rhs == lhs; + } + private: const axom::numerics::Matrix m_mat; }; template -inline ::testing::Matcher&> AlmostEqMatrix( - const axom::numerics::Matrix& mat) +inline auto AlmostEqMatrix(const axom::numerics::Matrix& mat) { return AlmostEqMatrixMatcher(mat); } @@ -99,20 +110,30 @@ class AlmostEqArrMatcher void DescribeTo(std::ostream*) const { } void DescribeNegationTo(std::ostream*) const { } + friend bool operator==(const AlmostEqArrMatcher& lhs, const T& rhs) + { + return lhs.MatchAndExplain(rhs, nullptr); + } + + friend bool operator==(const T& lhs, const AlmostEqArrMatcher& rhs) + { + return rhs == lhs; + } + + explicit operator const T() const { return m_arr; } + private: const T m_arr; }; template -inline ::testing::Matcher&> AlmostEqVector( - const primal::Vector& vec) +inline auto AlmostEqVector(const primal::Vector& vec) { return AlmostEqArrMatcher>(vec); } template -inline ::testing::Matcher&> AlmostEqPoint( - const primal::Point& pt) +inline auto AlmostEqPoint(const primal::Point& pt) { return AlmostEqArrMatcher>(pt); } @@ -142,12 +163,23 @@ class AlmostEqSliceMatcher void DescribeTo(std::ostream*) const { } void DescribeNegationTo(std::ostream*) const { } + friend bool operator==(const AlmostEqSliceMatcher& lhs, + const klee::SliceOperator& rhs) + { + return lhs.MatchAndExplain(rhs, nullptr); + } + + friend bool operator==(const klee::SliceOperator& lhs, + const AlmostEqSliceMatcher& rhs) + { + return rhs == lhs; + } + private: const klee::SliceOperator m_slice; }; -inline ::testing::Matcher AlmostEqSlice( - const klee::SliceOperator& slice) +inline auto AlmostEqSlice(const klee::SliceOperator& slice) { return AlmostEqSliceMatcher(slice); } diff --git a/src/axom/klee/tests/KleeTestUtils.cpp b/src/axom/klee/tests/KleeTestUtils.cpp index 05c3819fc4..e4c4ae6031 100644 --- a/src/axom/klee/tests/KleeTestUtils.cpp +++ b/src/axom/klee/tests/KleeTestUtils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/KleeTestUtils.hpp b/src/axom/klee/tests/KleeTestUtils.hpp index 0ce9bbc8a1..c51dee9950 100644 --- a/src/axom/klee/tests/KleeTestUtils.hpp +++ b/src/axom/klee/tests/KleeTestUtils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_config.cpp b/src/axom/klee/tests/klee_config.cpp index 8d50ae2f15..9f22cd06e8 100644 --- a/src/axom/klee/tests/klee_config.cpp +++ b/src/axom/klee/tests/klee_config.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_geometry.cpp b/src/axom/klee/tests/klee_geometry.cpp index d72caf4221..220235dcdc 100644 --- a/src/axom/klee/tests/klee_geometry.cpp +++ b/src/axom/klee/tests/klee_geometry.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_geometry_operators.cpp b/src/axom/klee/tests/klee_geometry_operators.cpp index 06e758e858..82e7204bdc 100644 --- a/src/axom/klee/tests/klee_geometry_operators.cpp +++ b/src/axom/klee/tests/klee_geometry_operators.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_geometry_operators_io.cpp b/src/axom/klee/tests/klee_geometry_operators_io.cpp index ba2da0e30d..6326d8a156 100644 --- a/src/axom/klee/tests/klee_geometry_operators_io.cpp +++ b/src/axom/klee/tests/klee_geometry_operators_io.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_io.cpp b/src/axom/klee/tests/klee_io.cpp index 9f78611f71..ba1d391151 100644 --- a/src/axom/klee/tests/klee_io.cpp +++ b/src/axom/klee/tests/klee_io.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_io_util.cpp b/src/axom/klee/tests/klee_io_util.cpp index 77d82457e1..ae62274b07 100644 --- a/src/axom/klee/tests/klee_io_util.cpp +++ b/src/axom/klee/tests/klee_io_util.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_shape.cpp b/src/axom/klee/tests/klee_shape.cpp index 0cac876828..e7a489996c 100644 --- a/src/axom/klee/tests/klee_shape.cpp +++ b/src/axom/klee/tests/klee_shape.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_shape_set.cpp b/src/axom/klee/tests/klee_shape_set.cpp index 8c0952d21f..40be40a136 100644 --- a/src/axom/klee/tests/klee_shape_set.cpp +++ b/src/axom/klee/tests/klee_shape_set.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/klee/tests/klee_units.cpp b/src/axom/klee/tests/klee_units.cpp index 1fa10dc8f5..89d31a1e08 100644 --- a/src/axom/klee/tests/klee_units.cpp +++ b/src/axom/klee/tests/klee_units.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/BinaryTreeCommunicator.cpp b/src/axom/lumberjack/BinaryTreeCommunicator.cpp index 4c7315e55a..83db61965d 100644 --- a/src/axom/lumberjack/BinaryTreeCommunicator.cpp +++ b/src/axom/lumberjack/BinaryTreeCommunicator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/BinaryTreeCommunicator.hpp b/src/axom/lumberjack/BinaryTreeCommunicator.hpp index 241f2d7b5c..14b5d81fd9 100644 --- a/src/axom/lumberjack/BinaryTreeCommunicator.hpp +++ b/src/axom/lumberjack/BinaryTreeCommunicator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/CMakeLists.txt b/src/axom/lumberjack/CMakeLists.txt index cceb414fb9..97c2cdcbb1 100644 --- a/src/axom/lumberjack/CMakeLists.txt +++ b/src/axom/lumberjack/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -18,6 +18,7 @@ set(lumberjack_headers MPIUtility.hpp RootCommunicator.hpp TextEqualityCombiner.hpp + TextTagCombiner.hpp ) set(lumberjack_sources diff --git a/src/axom/lumberjack/Combiner.hpp b/src/axom/lumberjack/Combiner.hpp index 12f97721af..2ce94e36db 100644 --- a/src/axom/lumberjack/Combiner.hpp +++ b/src/axom/lumberjack/Combiner.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/Communicator.hpp b/src/axom/lumberjack/Communicator.hpp index fde029a95c..be4a3f1678 100644 --- a/src/axom/lumberjack/Communicator.hpp +++ b/src/axom/lumberjack/Communicator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/Lumberjack.cpp b/src/axom/lumberjack/Lumberjack.cpp index fc03663eed..4b9e82d18a 100644 --- a/src/axom/lumberjack/Lumberjack.cpp +++ b/src/axom/lumberjack/Lumberjack.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -23,7 +23,7 @@ void Lumberjack::initialize(Communicator* communicator, int ranksLimit) { m_communicator = communicator; m_ranksLimit = ranksLimit; - m_combiners.push_back(new TextEqualityCombiner); + m_combiners.push_back(new TextTagCombiner); } void Lumberjack::finalize() diff --git a/src/axom/lumberjack/Lumberjack.hpp b/src/axom/lumberjack/Lumberjack.hpp index d850d0fdd3..6d3f48878d 100644 --- a/src/axom/lumberjack/Lumberjack.hpp +++ b/src/axom/lumberjack/Lumberjack.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -22,7 +22,7 @@ #include "axom/lumberjack/Combiner.hpp" #include "axom/lumberjack/Communicator.hpp" #include "axom/lumberjack/Message.hpp" -#include "axom/lumberjack/TextEqualityCombiner.hpp" +#include "axom/lumberjack/TextTagCombiner.hpp" namespace axom { diff --git a/src/axom/lumberjack/MPIUtility.cpp b/src/axom/lumberjack/MPIUtility.cpp index 0e0b49c5e5..3698bae967 100644 --- a/src/axom/lumberjack/MPIUtility.cpp +++ b/src/axom/lumberjack/MPIUtility.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/MPIUtility.hpp b/src/axom/lumberjack/MPIUtility.hpp index e21b72c406..1d499ea839 100644 --- a/src/axom/lumberjack/MPIUtility.hpp +++ b/src/axom/lumberjack/MPIUtility.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/Message.cpp b/src/axom/lumberjack/Message.cpp index 17d3dde11f..c553ef2aeb 100644 --- a/src/axom/lumberjack/Message.cpp +++ b/src/axom/lumberjack/Message.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -278,8 +278,7 @@ const char* packMessages(const std::vector& messages) int totalSize = 1; // include size for null terminator - //Calculate total size of char array after all messages are - // combined. + //Calculate total size of char array after all messages are combined. std::vector packedMessages; std::vector sizeStrings; int currSize = 0; diff --git a/src/axom/lumberjack/Message.hpp b/src/axom/lumberjack/Message.hpp index f24b0dd37b..50ada6568f 100644 --- a/src/axom/lumberjack/Message.hpp +++ b/src/axom/lumberjack/Message.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -315,8 +315,7 @@ class Message /*! ***************************************************************************** - * \brief This packs all given Message classes into one const char - * buffer. + * \brief This packs all given Message classes into one const char buffer * * The messages are packed into the following format: * [**]... @@ -325,6 +324,7 @@ class Message * \param [in] messages Message classes to be packed for sending * * \return Packed char array of all given messages + * \note It is the caller's responsibility to deallocate the returned buffer ***************************************************************************** */ const char* packMessages(const std::vector& messages); @@ -339,6 +339,9 @@ const char* packMessages(const std::vector& messages); * This function only adds to the messages vector and does not alter the * packagedMessages parameter. * + * \note It is the caller's responsibility to deallocate the Message added + * to the \a messages vector + * * \param [in,out] messages Vector to append created messages to * \param [in] packedMessages Packed messages to be unpacked * \param [in] ranksLimit Limits how many ranks are tracked per Message. diff --git a/src/axom/lumberjack/RootCommunicator.cpp b/src/axom/lumberjack/RootCommunicator.cpp index 93593d70d9..15bfab036f 100644 --- a/src/axom/lumberjack/RootCommunicator.cpp +++ b/src/axom/lumberjack/RootCommunicator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/RootCommunicator.hpp b/src/axom/lumberjack/RootCommunicator.hpp index 54d67b7058..167788d02f 100644 --- a/src/axom/lumberjack/RootCommunicator.hpp +++ b/src/axom/lumberjack/RootCommunicator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/TextEqualityCombiner.hpp b/src/axom/lumberjack/TextEqualityCombiner.hpp index 84bb8a2660..c20c462200 100644 --- a/src/axom/lumberjack/TextEqualityCombiner.hpp +++ b/src/axom/lumberjack/TextEqualityCombiner.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -34,13 +34,16 @@ namespace lumberjack * you. If you want it removed call Lumberjack::removeCombiner with the string * "TextEqualityCombiner" as it's parameter. * + * \warning Using the TextEqualityCombiner with Message::tag has undefined + * behavior. + * * \see Combiner Lumberjack ******************************************************************************* */ class TextEqualityCombiner : public Combiner { public: - TextEqualityCombiner() : m_id("TextEqualityCombiner") { } + TextEqualityCombiner() { } /*! ***************************************************************************** @@ -65,11 +68,7 @@ class TextEqualityCombiner : public Combiner bool shouldMessagesBeCombined(const Message& leftMessage, const Message& rightMessage) { - if(leftMessage.text().compare(rightMessage.text()) == 0) - { - return true; - } - return false; + return (leftMessage.text().compare(rightMessage.text()) == 0); } /*! @@ -83,6 +82,8 @@ class TextEqualityCombiner : public Combiner * \param [in] combinee the Message that is combined into the other. * \param [in] ranksLimit The limit on how many individual ranks are tracked * in the combined Message. Message::rankCount is always incremented. + * + * \pre shouldMessagesBeCombined(combined, combinee) must be true ***************************************************************************** */ void combine(Message& combined, const Message& combinee, const int ranksLimit) @@ -91,7 +92,7 @@ class TextEqualityCombiner : public Combiner } private: - std::string m_id; + const std::string m_id = "TextEqualityCombiner"; }; } // end namespace lumberjack diff --git a/src/axom/lumberjack/TextTagCombiner.hpp b/src/axom/lumberjack/TextTagCombiner.hpp new file mode 100644 index 0000000000..9e0f52a3e1 --- /dev/null +++ b/src/axom/lumberjack/TextTagCombiner.hpp @@ -0,0 +1,100 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +/*! + ******************************************************************************* + * \file TextTagCombiner.hpp + * + * \brief This file contains the class implementation of the + * TextTagCombiner. + ******************************************************************************* + */ + +#ifndef TEXTTAGCOMBINER_HPP +#define TEXTTAGCOMBINER_HPP + +#include "axom/lumberjack/Combiner.hpp" +#include "axom/lumberjack/Message.hpp" + +#include + +namespace axom +{ +namespace lumberjack +{ +/*! + ******************************************************************************* + * \class TextTagCombiner + * + * \brief Combines Message classes if their Message::text and Message::tag + * are equal. + * + * This class can be added to Lumberjack's Lumberjack by calling + * Lumberjack::addCombiner with a + * TextTagCombiner instance as its parameter. + * + * \see Combiner Lumberjack + ******************************************************************************* + */ +class TextTagCombiner : public Combiner +{ +public: + TextTagCombiner() { } + + /*! + ***************************************************************************** + * \brief Returns the unique string identifier for this combiner. Used by + * Lumberjack to differentiate between other combiners. + ***************************************************************************** + */ + const std::string id() { return m_id; } + + /*! + ***************************************************************************** + * \brief Function used by Lumberjack to indicate whether two messages should + * be combined. + * + * They are not actually combined by this function. Message classes are + * triggered for combination if both Message::text and Message::tag are equal. + * + * \param [in] leftMessage One of the Messages to be compared. + * \param [in] rightMessage One of the Messages to be compared. + ***************************************************************************** + */ + bool shouldMessagesBeCombined(const Message& leftMessage, + const Message& rightMessage) + { + return (leftMessage.text().compare(rightMessage.text()) == 0 && + leftMessage.tag().compare(rightMessage.tag()) == 0); + } + + /*! + ***************************************************************************** + * \brief Combines the combinee into the combined Message. + * + * The only thing truly combined in this Combiner is the ranks from combinee + * to combined, since text is already equal. + * + * \param [in,out] combined the Message that will be modified. + * \param [in] combinee the Message that is combined into the other. + * \param [in] ranksLimit The limit on how many individual ranks are tracked + * in the combined Message. Message::rankCount is always incremented. + * + * \pre shouldMessagesBeCombined(combined, combinee) must be true + ***************************************************************************** + */ + void combine(Message& combined, const Message& combinee, const int ranksLimit) + { + combined.addRanks(combinee.ranks(), combinee.count(), ranksLimit); + } + +private: + const std::string m_id = "TextTagCombiner"; +}; + +} // end namespace lumberjack +} // end namespace axom + +#endif diff --git a/src/axom/lumberjack/docs/sphinx/combiner_class.rst b/src/axom/lumberjack/docs/sphinx/combiner_class.rst index eea64bed70..70dcc954d6 100644 --- a/src/axom/lumberjack/docs/sphinx/combiner_class.rst +++ b/src/axom/lumberjack/docs/sphinx/combiner_class.rst @@ -23,6 +23,18 @@ combine Combines the second message into the first. Concrete Instances ------------------ +.. _texttagcombiner_class_label: + +TextTagCombiner +^^^^^^^^^^^^^^^ + +This Combiner combines the two given Messages if the Message text strings and tag strings are equal. +It does so by adding the second Message's ranks to the first Message (if not past +the ranksLimit) and incrementing the Message's count as well. This is handled by +Message.addRanks(). + +.. note:: This is the only Combiner automatically added to Lumberjack for you. You can remove it by calling Lumberjack::removeCombiner("TextTagCombiner"). + .. _textequalitycombiner_class_label: TextEqualityCombiner @@ -33,4 +45,4 @@ It does so by adding the second Message's ranks to the first Message (if not pas the ranksLimit) and incrementing the Message's count as well. This is handled by Message.addRanks(). -.. note:: This is the only Combiner automatically added to Lumberjack for you. You can remove it by calling Lumberjack::removeCombiner("TextEqualityCombiner"). +.. note:: You can add this Combiner by calling Lumberjack::addCombiner(new TextEqualityCombiner). diff --git a/src/axom/lumberjack/docs/sphinx/core_concepts.rst b/src/axom/lumberjack/docs/sphinx/core_concepts.rst index 4d1db00602..99d90eacad 100644 --- a/src/axom/lumberjack/docs/sphinx/core_concepts.rst +++ b/src/axom/lumberjack/docs/sphinx/core_concepts.rst @@ -16,18 +16,18 @@ your program. It does so by giving the currently held Messages at the current n two at a time, to the Combiner classes that are currently registered to Lumberjack when a Push happens. -Lumberjack only provides one Combiner, the TextEqualityCombiner. You can write your own +Lumberjack provides one Combiner as default, the TextTagCombiner. You can write your own Combiners and register them with Lumberjack. The idea is that each Combiner would have its own criteria for whether a Message should be combined and how to combine that specific Message with another of the same type. Combiner's have two main functions, shouldMessagesBeCombined and combine. -The function shouldMessagesBeCombined, returns True if the pair of messages satisfy the associated criteria. For example in the TextEqualityCombiner, -if the Text strings are exactly equal, it signals they should be combined. +The function shouldMessagesBeCombined, returns True if the pair of messages satisfy the associated criteria. For example in the TextTagCombiner, +if the Text strings and tag strings are exactly equal, it signals they should be combined. The function combine, takes two Messages and combines them in the way that is specific -to that Combiner class. For example in the TextEqualityCombiner, the only thing +to that Combiner class. For example in the TextTagCombiner, the only thing that happens is the second Message's ranks gets added to the first and the message count is increased. This is because the text strings were equal. This may not be the case for all Combiners that you write yourself. diff --git a/src/axom/lumberjack/docs/sphinx/lumberjack_classes.rst b/src/axom/lumberjack/docs/sphinx/lumberjack_classes.rst index bb04be76d5..92721b2627 100644 --- a/src/axom/lumberjack/docs/sphinx/lumberjack_classes.rst +++ b/src/axom/lumberjack/docs/sphinx/lumberjack_classes.rst @@ -15,6 +15,7 @@ Combiners Handles Message combination and tests whether Message classes should be combined. * :ref:`Combiner ` - Abstract base class that all Combiners must inherit from. +* :ref:`TextTagCombiner ` - Combines Message classes that have equal Text and Tag member variables. * :ref:`TextEqualityCombiner ` - Combines Message classes that have equal Text member variables. diff --git a/src/axom/lumberjack/examples/CMakeLists.txt b/src/axom/lumberjack/examples/CMakeLists.txt index 9993d9aee9..4ee196c641 100644 --- a/src/axom/lumberjack/examples/CMakeLists.txt +++ b/src/axom/lumberjack/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/examples/basicExample.cpp b/src/axom/lumberjack/examples/basicExample.cpp index 6186af0e5f..a921ee6609 100644 --- a/src/axom/lumberjack/examples/basicExample.cpp +++ b/src/axom/lumberjack/examples/basicExample.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/tests/CMakeLists.txt b/src/axom/lumberjack/tests/CMakeLists.txt index f3188fa84b..7d95e8aff3 100644 --- a/src/axom/lumberjack/tests/CMakeLists.txt +++ b/src/axom/lumberjack/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -12,7 +12,8 @@ set(lumberjack_serial_tests lumberjack_Lumberjack.hpp lumberjack_Message.hpp - lumberjack_TextEqualityCombiner.hpp ) + lumberjack_TextEqualityCombiner.hpp + lumberjack_TextTagCombiner.hpp ) axom_add_executable(NAME lumberjack_serial_tests SOURCES lumberjack_serial_main.cpp diff --git a/src/axom/lumberjack/tests/lumberjack_BinaryCommunicator.hpp b/src/axom/lumberjack/tests/lumberjack_BinaryCommunicator.hpp index fcffe81368..86a59c7650 100644 --- a/src/axom/lumberjack/tests/lumberjack_BinaryCommunicator.hpp +++ b/src/axom/lumberjack/tests/lumberjack_BinaryCommunicator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -113,6 +113,13 @@ TEST(lumberjack_BinaryCommunicator, basic) c.finalize(); MPI_Barrier(MPI_COMM_WORLD); + + // cleanup allocated memory from received messages + for(auto& rm : receivedPackedMessages) + { + delete rm; + } + receivedPackedMessages.clear(); } TEST(lumberjack_BinaryCommunicator, pushNothing) diff --git a/src/axom/lumberjack/tests/lumberjack_Lumberjack.hpp b/src/axom/lumberjack/tests/lumberjack_Lumberjack.hpp index f9911dcde2..229a69cbfc 100644 --- a/src/axom/lumberjack/tests/lumberjack_Lumberjack.hpp +++ b/src/axom/lumberjack/tests/lumberjack_Lumberjack.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/tests/lumberjack_Message.hpp b/src/axom/lumberjack/tests/lumberjack_Message.hpp index 0bb02dfb52..f1ee3b0ac2 100644 --- a/src/axom/lumberjack/tests/lumberjack_Message.hpp +++ b/src/axom/lumberjack/tests/lumberjack_Message.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -637,6 +637,8 @@ TEST(lumberjack_Message, packMessagesIndividually) EXPECT_EQ(packedMessage, answer); + // cleanup + delete packedMessage; delete m; messages.clear(); } @@ -664,6 +666,14 @@ TEST(lumberjack_Message, packMessages) answer = std::to_string((int)testData.size()) + "*" + answer; EXPECT_EQ(packedMessages, answer); + + // cleanup + delete packedMessages; + for(auto* _m : messages) + { + delete _m; + } + messages.clear(); } TEST(lumberjack_Message, unpackMessagesIndividually) diff --git a/src/axom/lumberjack/tests/lumberjack_RootCommunicator.hpp b/src/axom/lumberjack/tests/lumberjack_RootCommunicator.hpp index b9255d8d2d..9d815a8f44 100644 --- a/src/axom/lumberjack/tests/lumberjack_RootCommunicator.hpp +++ b/src/axom/lumberjack/tests/lumberjack_RootCommunicator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -87,6 +87,13 @@ TEST(lumberjack_RootCommunicator, basic) c.finalize(); MPI_Barrier(MPI_COMM_WORLD); + + // cleanup allocated memory from received messages + for(auto& rm : receivedPackedMessages) + { + delete rm; + } + receivedPackedMessages.clear(); } TEST(lumberjack_RootCommunicator, pushNothing) diff --git a/src/axom/lumberjack/tests/lumberjack_TextEqualityCombiner.hpp b/src/axom/lumberjack/tests/lumberjack_TextEqualityCombiner.hpp index 81db0f0f6e..0970740be9 100644 --- a/src/axom/lumberjack/tests/lumberjack_TextEqualityCombiner.hpp +++ b/src/axom/lumberjack/tests/lumberjack_TextEqualityCombiner.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/tests/lumberjack_TextTagCombiner.hpp b/src/axom/lumberjack/tests/lumberjack_TextTagCombiner.hpp new file mode 100644 index 0000000000..cd21074d13 --- /dev/null +++ b/src/axom/lumberjack/tests/lumberjack_TextTagCombiner.hpp @@ -0,0 +1,110 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include "gtest/gtest.h" + +#include "axom/lumberjack/TextTagCombiner.hpp" + +TEST(lumberjack_TextTagCombiner, case01) +{ + //Test positive case: two equal texts and tags + std::string text = "I never wanted to do this job in the first place!"; + axom::lumberjack::Message m1; + m1.text(text); + m1.addRank(13, 5); + m1.fileName("foo.cpp"); + m1.lineNumber(154); + m1.tag("myTag"); + + axom::lumberjack::Message m2; + m2.text(text); + m2.addRank(14, 5); + m2.fileName("foo.cpp"); + m2.lineNumber(154); + m2.tag("myTag"); + + axom::lumberjack::TextTagCombiner c; + + bool shouldMessagesBeCombined = c.shouldMessagesBeCombined(m1, m2); + + c.combine(m1, m2, 5); + + EXPECT_EQ(shouldMessagesBeCombined, true); + EXPECT_EQ(m1.text().compare(text), 0); + EXPECT_EQ(m1.count(), 2); + EXPECT_EQ(m1.ranks()[0], 13); + EXPECT_EQ(m1.ranks()[1], 14); + EXPECT_EQ(m2.tag().compare("myTag"), 0); +} + +TEST(lumberjack_TextTagCombiner, case02) +{ + //Test negative case: two not-equal texts, but equal tags + std::string text1 = "I never wanted to do this job in the first place!"; + axom::lumberjack::Message m1; + m1.text(text1); + m1.addRank(13, 5); + m1.fileName("foo.cpp"); + m1.lineNumber(154); + m1.tag("myTag"); + + std::string text2 = "This text is not equal to the first."; + axom::lumberjack::Message m2; + m2.text(text2); + m2.addRank(14, 5); + m2.fileName("foo.cpp"); + m2.lineNumber(154); + m2.tag("myTag"); + + axom::lumberjack::TextTagCombiner c; + + bool shouldMessagesBeCombined = c.shouldMessagesBeCombined(m1, m2); + + EXPECT_EQ(shouldMessagesBeCombined, false); + EXPECT_EQ(m1.text().compare(text1), 0); + EXPECT_EQ(m1.count(), 1); + EXPECT_EQ(m1.ranks()[0], 13); + EXPECT_EQ(m1.tag().compare("myTag"), 0); + + EXPECT_EQ(m2.text().compare(text2), 0); + EXPECT_EQ(m2.count(), 1); + EXPECT_EQ(m2.ranks()[0], 14); + EXPECT_EQ(m2.tag().compare("myTag"), 0); +} + +TEST(lumberjack_TextTagCombiner, case03) +{ + //Test negative case: two equal texts, but not-equal tags + std::string text = "I never wanted to do this job in the first place!"; + + axom::lumberjack::Message m1; + m1.text(text); + m1.addRank(13, 5); + m1.fileName("foo.cpp"); + m1.lineNumber(154); + m1.tag("tag1"); + + axom::lumberjack::Message m2; + m2.text(text); + m2.addRank(14, 5); + m2.fileName("foo.cpp"); + m2.lineNumber(154); + m2.tag("tag2"); + + axom::lumberjack::TextTagCombiner c; + + bool shouldMessagesBeCombined = c.shouldMessagesBeCombined(m1, m2); + + EXPECT_EQ(shouldMessagesBeCombined, false); + EXPECT_EQ(m1.text().compare(text), 0); + EXPECT_EQ(m1.count(), 1); + EXPECT_EQ(m1.ranks()[0], 13); + EXPECT_EQ(m1.tag().compare("tag1"), 0); + + EXPECT_EQ(m2.text().compare(text), 0); + EXPECT_EQ(m2.count(), 1); + EXPECT_EQ(m2.ranks()[0], 14); + EXPECT_EQ(m2.tag().compare("tag2"), 0); +} diff --git a/src/axom/lumberjack/tests/lumberjack_mpi_main.cpp b/src/axom/lumberjack/tests/lumberjack_mpi_main.cpp index 4b5bbb60bb..616f7e45af 100644 --- a/src/axom/lumberjack/tests/lumberjack_mpi_main.cpp +++ b/src/axom/lumberjack/tests/lumberjack_mpi_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/lumberjack/tests/lumberjack_serial_main.cpp b/src/axom/lumberjack/tests/lumberjack_serial_main.cpp index 09c638bdd2..aa4f418266 100644 --- a/src/axom/lumberjack/tests/lumberjack_serial_main.cpp +++ b/src/axom/lumberjack/tests/lumberjack_serial_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -8,6 +8,7 @@ #include "lumberjack_Lumberjack.hpp" #include "lumberjack_Message.hpp" #include "lumberjack_TextEqualityCombiner.hpp" +#include "lumberjack_TextTagCombiner.hpp" int main(int argc, char** argv) { diff --git a/src/axom/lumberjack/tests/lumberjack_speedTest.cpp b/src/axom/lumberjack/tests/lumberjack_speedTest.cpp index 1ab6f361ae..32e33a82e6 100644 --- a/src/axom/lumberjack/tests/lumberjack_speedTest.cpp +++ b/src/axom/lumberjack/tests/lumberjack_speedTest.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/CMakeLists.txt b/src/axom/mint/CMakeLists.txt index a613a97220..36ea73cb71 100644 --- a/src/axom/mint/CMakeLists.txt +++ b/src/axom/mint/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/core/config.hpp.in b/src/axom/mint/core/config.hpp.in index 99bf5ece80..a429650685 100644 --- a/src/axom/mint/core/config.hpp.in +++ b/src/axom/mint/core/config.hpp.in @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/deprecated/MCArray.hpp b/src/axom/mint/deprecated/MCArray.hpp index f1b1bf1643..daa3df5cda 100644 --- a/src/axom/mint/deprecated/MCArray.hpp +++ b/src/axom/mint/deprecated/MCArray.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/deprecated/SidreMCArray.hpp b/src/axom/mint/deprecated/SidreMCArray.hpp index 25e004bdd3..9d2bc0faf7 100644 --- a/src/axom/mint/deprecated/SidreMCArray.hpp +++ b/src/axom/mint/deprecated/SidreMCArray.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/index.rst b/src/axom/mint/docs/sphinx/index.rst index 084858d27c..e6caa588d3 100644 --- a/src/axom/mint/docs/sphinx/index.rst +++ b/src/axom/mint/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/appendix.rst b/src/axom/mint/docs/sphinx/sections/appendix.rst index 1ee7b6ac05..580ebbf7f9 100644 --- a/src/axom/mint/docs/sphinx/sections/appendix.rst +++ b/src/axom/mint/docs/sphinx/sections/appendix.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/architecture.rst b/src/axom/mint/docs/sphinx/sections/architecture.rst index 48e07b3300..401f6b733d 100644 --- a/src/axom/mint/docs/sphinx/sections/architecture.rst +++ b/src/axom/mint/docs/sphinx/sections/architecture.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/citations.rst b/src/axom/mint/docs/sphinx/sections/citations.rst index d043c41ea4..1f73e17311 100644 --- a/src/axom/mint/docs/sphinx/sections/citations.rst +++ b/src/axom/mint/docs/sphinx/sections/citations.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/examples.rst b/src/axom/mint/docs/sphinx/sections/examples.rst index 9390852e32..6ba1beb244 100644 --- a/src/axom/mint/docs/sphinx/sections/examples.rst +++ b/src/axom/mint/docs/sphinx/sections/examples.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/execution_model.rst b/src/axom/mint/docs/sphinx/sections/execution_model.rst index f9cfe2d3d9..85294fc17e 100644 --- a/src/axom/mint/docs/sphinx/sections/execution_model.rst +++ b/src/axom/mint/docs/sphinx/sections/execution_model.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/faq.rst b/src/axom/mint/docs/sphinx/sections/faq.rst index 2a390d7133..05283901aa 100644 --- a/src/axom/mint/docs/sphinx/sections/faq.rst +++ b/src/axom/mint/docs/sphinx/sections/faq.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/fem.rst b/src/axom/mint/docs/sphinx/sections/fem.rst index 30fad342db..960458de94 100644 --- a/src/axom/mint/docs/sphinx/sections/fem.rst +++ b/src/axom/mint/docs/sphinx/sections/fem.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/getting_started.rst b/src/axom/mint/docs/sphinx/sections/getting_started.rst index 89410038fb..5d878942d2 100644 --- a/src/axom/mint/docs/sphinx/sections/getting_started.rst +++ b/src/axom/mint/docs/sphinx/sections/getting_started.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/mesh_representation.rst b/src/axom/mint/docs/sphinx/sections/mesh_representation.rst index 635b51ae3d..13a967a86e 100644 --- a/src/axom/mint/docs/sphinx/sections/mesh_representation.rst +++ b/src/axom/mint/docs/sphinx/sections/mesh_representation.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/mesh_types.rst b/src/axom/mint/docs/sphinx/sections/mesh_types.rst index 88e56eec79..bea332c493 100644 --- a/src/axom/mint/docs/sphinx/sections/mesh_types.rst +++ b/src/axom/mint/docs/sphinx/sections/mesh_types.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/preliminary_concepts.rst b/src/axom/mint/docs/sphinx/sections/preliminary_concepts.rst index c530c54cdf..84a788a8ae 100644 --- a/src/axom/mint/docs/sphinx/sections/preliminary_concepts.rst +++ b/src/axom/mint/docs/sphinx/sections/preliminary_concepts.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/docs/sphinx/sections/tutorial.rst b/src/axom/mint/docs/sphinx/sections/tutorial.rst index 213ecf9f39..365698dce9 100644 --- a/src/axom/mint/docs/sphinx/sections/tutorial.rst +++ b/src/axom/mint/docs/sphinx/sections/tutorial.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/examples/CMakeLists.txt b/src/axom/mint/examples/CMakeLists.txt index 2b8de0ea23..991b545028 100644 --- a/src/axom/mint/examples/CMakeLists.txt +++ b/src/axom/mint/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/examples/mint_curvilinear_mesh.cpp b/src/axom/mint/examples/mint_curvilinear_mesh.cpp index e957e22a44..c41127db87 100644 --- a/src/axom/mint/examples/mint_curvilinear_mesh.cpp +++ b/src/axom/mint/examples/mint_curvilinear_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/examples/mint_heat_equation.cpp b/src/axom/mint/examples/mint_heat_equation.cpp index 0d19b3f634..cc2b0b5e23 100644 --- a/src/axom/mint/examples/mint_heat_equation.cpp +++ b/src/axom/mint/examples/mint_heat_equation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -363,10 +363,8 @@ const std::string help_string = "-d INT, -dumpPeriod INT\n" "\tThe number of cycles to wait between writing a dump file.\n"; -/*! - * \brief A structure that holds the command line arguments. - */ -typedef struct +/// A structure that holds the command line arguments. +struct Arguments { double h; double lower_bound[2]; @@ -379,7 +377,7 @@ typedef struct double t_max; int period; std::string path; -} Arguments; +}; /*! * \brief Parses and validates the command line arguments. diff --git a/src/axom/mint/examples/mint_nbody_solver.cpp b/src/axom/mint/examples/mint_nbody_solver.cpp index 78f2c3548e..5046b3549f 100644 --- a/src/axom/mint/examples/mint_nbody_solver.cpp +++ b/src/axom/mint/examples/mint_nbody_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/examples/mint_particle_mesh.cpp b/src/axom/mint/examples/mint_particle_mesh.cpp index 3ababa30d2..32612f8696 100644 --- a/src/axom/mint/examples/mint_particle_mesh.cpp +++ b/src/axom/mint/examples/mint_particle_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/examples/mint_rectilinear_mesh.cpp b/src/axom/mint/examples/mint_rectilinear_mesh.cpp index c013e1abad..5938a1034e 100644 --- a/src/axom/mint/examples/mint_rectilinear_mesh.cpp +++ b/src/axom/mint/examples/mint_rectilinear_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/examples/mint_su2_mesh.cpp b/src/axom/mint/examples/mint_su2_mesh.cpp index c437e6123d..ba463a0db2 100644 --- a/src/axom/mint/examples/mint_su2_mesh.cpp +++ b/src/axom/mint/examples/mint_su2_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) 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 0c2a5acb12..8ee77da4e9 100644 --- a/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp +++ b/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) 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 2e8895cb10..bdda6cf47e 100644 --- a/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp +++ b/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/examples/user_guide/mint_getting_started.cpp b/src/axom/mint/examples/user_guide/mint_getting_started.cpp index 647d6f5f0f..6a3603dba8 100644 --- a/src/axom/mint/examples/user_guide/mint_getting_started.cpp +++ b/src/axom/mint/examples/user_guide/mint_getting_started.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -195,7 +195,7 @@ mint::Mesh* getUniformMesh() const double lo[] = {-5.0, -5.0}; const double hi[] = {5.0, 5.0}; mint::Mesh* m = new mint::UniformMesh(lo, hi, Arguments.res, Arguments.res); - return (m); + return m; } // sphinx_tutorial_walkthrough_construct_umesh_end @@ -278,7 +278,7 @@ mint::Mesh* getUnstructuredMesh() delete umesh; umesh = nullptr; - return (m); + return m; } // sphinx_tutorial_basic_example_end diff --git a/src/axom/mint/examples/user_guide/mint_tutorial.cpp b/src/axom/mint/examples/user_guide/mint_tutorial.cpp index 96c1d5a4b0..d0bcf8256c 100644 --- a/src/axom/mint/examples/user_guide/mint_tutorial.cpp +++ b/src/axom/mint/examples/user_guide/mint_tutorial.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/execution/interface.hpp b/src/axom/mint/execution/interface.hpp index 66b38b9fad..6c5174590c 100644 --- a/src/axom/mint/execution/interface.hpp +++ b/src/axom/mint/execution/interface.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/execution/internal/for_all_cells.hpp b/src/axom/mint/execution/internal/for_all_cells.hpp index 6c8e8c8191..6eef970aea 100644 --- a/src/axom/mint/execution/internal/for_all_cells.hpp +++ b/src/axom/mint/execution/internal/for_all_cells.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -187,6 +187,9 @@ inline void for_all_cells_impl(xargs::nodeids, const IndexType nodeKp = m.nodeKp(); const StackArray& offsets = m.getCellNodeOffsetsArray(); + // Note: gcc@10.3.1 emits a '-Warray-bounds' warning in callers of this function + // about the sizes of nodeIds and coords not matching due to the runtime switch on dimension + if(dimension == 1) { for_all_cells_impl( @@ -453,6 +456,9 @@ inline void for_all_cells_impl(xargs::coords, const double z0 = origin[2]; const double dz = spacing[2]; + // Note: gcc@10.3.1 emits a '-Warray-bounds' warning in callers of this function + // about the sizes of nodeIds and coords not matching due to the runtime switch on dimension + if(dimension == 1) { for_all_cells_impl( diff --git a/src/axom/mint/execution/internal/for_all_faces.hpp b/src/axom/mint/execution/internal/for_all_faces.hpp index 398916ae9e..b1a4482857 100644 --- a/src/axom/mint/execution/internal/for_all_faces.hpp +++ b/src/axom/mint/execution/internal/for_all_faces.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/execution/internal/for_all_nodes.hpp b/src/axom/mint/execution/internal/for_all_nodes.hpp index fcbe0b271e..d8162a6248 100644 --- a/src/axom/mint/execution/internal/for_all_nodes.hpp +++ b/src/axom/mint/execution/internal/for_all_nodes.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/execution/internal/helpers.hpp b/src/axom/mint/execution/internal/helpers.hpp index 0b303098e7..9b2f7e819c 100644 --- a/src/axom/mint/execution/internal/helpers.hpp +++ b/src/axom/mint/execution/internal/helpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/execution/internal/structured_exec.hpp b/src/axom/mint/execution/internal/structured_exec.hpp index fa5f76cb9a..909793bd6c 100644 --- a/src/axom/mint/execution/internal/structured_exec.hpp +++ b/src/axom/mint/execution/internal/structured_exec.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -49,17 +49,28 @@ struct structured_exec #ifdef AXOM_USE_RAJA /* clang-format off */ using loop2d_policy = RAJA::KernelPolicy< +#if RAJA_VERSION_MAJOR > 2022 + RAJA::statement::For< 1, RAJA::seq_exec, // j + RAJA::statement::For< 0, RAJA::seq_exec, // i +#else RAJA::statement::For< 1, RAJA::loop_exec, // j RAJA::statement::For< 0, RAJA::loop_exec, // i +#endif RAJA::statement::Lambda< 0 > > // END i > // END j >; // END kernel using loop3d_policy = RAJA::KernelPolicy< +#if RAJA_VERSION_MAJOR > 2022 + RAJA::statement::For< 2, RAJA::seq_exec, // k + RAJA::statement::For< 1, RAJA::seq_exec, // j + RAJA::statement::For< 0, RAJA::seq_exec, // i +#else RAJA::statement::For< 2, RAJA::loop_exec, // k RAJA::statement::For< 1, RAJA::loop_exec, // j RAJA::statement::For< 0, RAJA::loop_exec, // i +#endif RAJA::statement::Lambda< 0 > > // END i > // END j @@ -82,7 +93,11 @@ struct structured_exec using loop2d_policy = RAJA::KernelPolicy< RAJA::statement::For< 1, RAJA::omp_parallel_for_exec, // j +#if RAJA_VERSION_MAJOR > 2022 + RAJA::statement::For< 0, RAJA::seq_exec, // i +#else RAJA::statement::For< 0, RAJA::loop_exec, // i +#endif RAJA::statement::Lambda< 0 > > // END i > // END j @@ -90,8 +105,13 @@ struct structured_exec using loop3d_policy = RAJA::KernelPolicy< RAJA::statement::For< 2, RAJA::omp_parallel_for_exec, // k +#if RAJA_VERSION_MAJOR > 2022 + RAJA::statement::For< 1, RAJA::seq_exec, // j + RAJA::statement::For< 0, RAJA::seq_exec, // i +#else RAJA::statement::For< 1, RAJA::loop_exec, // j RAJA::statement::For< 0, RAJA::loop_exec, // i +#endif RAJA::statement::Lambda< 0 > > // END i > // END j diff --git a/src/axom/mint/execution/xargs.hpp b/src/axom/mint/execution/xargs.hpp index 2cdeb37506..64a91d9f2c 100644 --- a/src/axom/mint/execution/xargs.hpp +++ b/src/axom/mint/execution/xargs.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/FEBasis.hpp b/src/axom/mint/fem/FEBasis.hpp index 921895cad4..8f95082bed 100644 --- a/src/axom/mint/fem/FEBasis.hpp +++ b/src/axom/mint/fem/FEBasis.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/FEBasisTypes.hpp b/src/axom/mint/fem/FEBasisTypes.hpp index 60d160c250..354e0811e5 100644 --- a/src/axom/mint/fem/FEBasisTypes.hpp +++ b/src/axom/mint/fem/FEBasisTypes.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/FiniteElement.cpp b/src/axom/mint/fem/FiniteElement.cpp index 761188f8d7..dc8a3eb202 100644 --- a/src/axom/mint/fem/FiniteElement.cpp +++ b/src/axom/mint/fem/FiniteElement.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/FiniteElement.hpp b/src/axom/mint/fem/FiniteElement.hpp index 4a4d89c3d6..3baa000003 100644 --- a/src/axom/mint/fem/FiniteElement.hpp +++ b/src/axom/mint/fem/FiniteElement.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -499,7 +499,7 @@ class FiniteElement /// \name Reference Element Attributes /// @{ - typedef void (*ShapeFunctionPtr)(const double* lc, double* phi); + using ShapeFunctionPtr = void (*)(const double* lc, double* phi); ShapeFunctionPtr m_shapeFunction; /*! shape function functor */ ShapeFunctionPtr m_shapeFunctionDerivatives; /*! derivatives functor */ @@ -517,7 +517,7 @@ class FiniteElement DISABLE_MOVE_AND_ASSIGNMENT(FiniteElement); }; -} /* namespace mint */ +} // namespace mint } // namespace axom //------------------------------------------------------------------------------ @@ -534,8 +534,8 @@ void bind_basis(FiniteElement& fe) SLIC_ASSERT(fe.m_reference_center != nullptr); SLIC_ASSERT(fe.m_reference_coords != nullptr); - typedef mint::FEBasis FEBasisType; - typedef typename FEBasisType::ShapeFunctionType ShapeType; + using FEBasisType = mint::FEBasis; + using ShapeType = typename FEBasisType::ShapeFunctionType; if(CELLTYPE != fe.getCellType()) { diff --git a/src/axom/mint/fem/shape_functions/Lagrange.hpp b/src/axom/mint/fem/shape_functions/Lagrange.hpp index 2c1a3add75..76cc40d214 100644 --- a/src/axom/mint/fem/shape_functions/Lagrange.hpp +++ b/src/axom/mint/fem/shape_functions/Lagrange.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/shape_functions/ShapeFunction.hpp b/src/axom/mint/fem/shape_functions/ShapeFunction.hpp index 191f9944e6..0ec92232d2 100644 --- a/src/axom/mint/fem/shape_functions/ShapeFunction.hpp +++ b/src/axom/mint/fem/shape_functions/ShapeFunction.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_hexa_27.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_hexa_27.hpp index aa5bfa9e88..361508f48d 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_hexa_27.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_hexa_27.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_hexa_8.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_hexa_8.hpp index 18a86cbc7c..94a2c796d0 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_hexa_8.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_hexa_8.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_prism_6.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_prism_6.hpp index 0f132fdcdd..a093f4ce74 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_prism_6.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_prism_6.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_pyra_5.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_pyra_5.hpp index b6669f714f..9f86ebe440 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_pyra_5.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_pyra_5.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_quad_4.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_quad_4.hpp index a78969bb1a..f84852ef7b 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_quad_4.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_quad_4.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_quad_9.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_quad_9.hpp index e68114fec3..4845e90662 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_quad_9.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_quad_9.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) 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 9a9e1daa7e..144f31604e 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 @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) 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 4ee2a81232..7271900e9d 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 @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/CellTypes.hpp b/src/axom/mint/mesh/CellTypes.hpp index c65d83d029..fe3dae6ef2 100644 --- a/src/axom/mint/mesh/CellTypes.hpp +++ b/src/axom/mint/mesh/CellTypes.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -108,7 +108,7 @@ constexpr int NUM_CELL_TYPES = static_cast(CellType::NUM_CELL_TYPES); * * \brief Holds information associated with a given cell type. */ -typedef struct +struct CellInfo { CellType cell_type; /*!< cell type, e.g. mint::QUAD, mint::HEX */ const char* name; /*!< the name associated with the cell */ @@ -119,7 +119,7 @@ typedef struct int face_nodecount[MAX_CELL_FACES]; /*!< number of nodes for each of cell's faces */ CellType face_types[MAX_CELL_FACES]; /*!< face type, e.g. mint::SEGMENT, mint::QUAD */ IndexType face_nodes[MAX_ALL_FACES_NODES]; /*!< nodes for each of cell's faces */ -} CellInfo; +}; // This construct lets us pass literal arrays to function-like macros. // AR stands for ARray. diff --git a/src/axom/mint/mesh/ConnectivityArray.hpp b/src/axom/mint/mesh/ConnectivityArray.hpp index 2375bfc2f7..3bdab0944d 100644 --- a/src/axom/mint/mesh/ConnectivityArray.hpp +++ b/src/axom/mint/mesh/ConnectivityArray.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/CurvilinearMesh.cpp b/src/axom/mint/mesh/CurvilinearMesh.cpp index 5231b5ffaa..c8f3493f15 100644 --- a/src/axom/mint/mesh/CurvilinearMesh.cpp +++ b/src/axom/mint/mesh/CurvilinearMesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/CurvilinearMesh.hpp b/src/axom/mint/mesh/CurvilinearMesh.hpp index 623edcb4db..95483be9e7 100644 --- a/src/axom/mint/mesh/CurvilinearMesh.hpp +++ b/src/axom/mint/mesh/CurvilinearMesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/Field.hpp b/src/axom/mint/mesh/Field.hpp index 6e76904620..09f293ee13 100644 --- a/src/axom/mint/mesh/Field.hpp +++ b/src/axom/mint/mesh/Field.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/FieldAssociation.hpp b/src/axom/mint/mesh/FieldAssociation.hpp index 716718b336..ef509c75a4 100644 --- a/src/axom/mint/mesh/FieldAssociation.hpp +++ b/src/axom/mint/mesh/FieldAssociation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/FieldData.cpp b/src/axom/mint/mesh/FieldData.cpp index 279acbd6ae..2d14113a92 100644 --- a/src/axom/mint/mesh/FieldData.cpp +++ b/src/axom/mint/mesh/FieldData.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/FieldData.hpp b/src/axom/mint/mesh/FieldData.hpp index d2cdb5fae4..56cd29a8e2 100644 --- a/src/axom/mint/mesh/FieldData.hpp +++ b/src/axom/mint/mesh/FieldData.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/FieldTypes.hpp b/src/axom/mint/mesh/FieldTypes.hpp index 8bb38f5dc8..31941dbbc2 100644 --- a/src/axom/mint/mesh/FieldTypes.hpp +++ b/src/axom/mint/mesh/FieldTypes.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/FieldVariable.hpp b/src/axom/mint/mesh/FieldVariable.hpp index 038e1b0534..da13f638d4 100644 --- a/src/axom/mint/mesh/FieldVariable.hpp +++ b/src/axom/mint/mesh/FieldVariable.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/Mesh.cpp b/src/axom/mint/mesh/Mesh.cpp index 997d82bebf..fc54c38395 100644 --- a/src/axom/mint/mesh/Mesh.cpp +++ b/src/axom/mint/mesh/Mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/Mesh.hpp b/src/axom/mint/mesh/Mesh.hpp index 48ec43f3cf..f77e5e2279 100644 --- a/src/axom/mint/mesh/Mesh.hpp +++ b/src/axom/mint/mesh/Mesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/MeshCoordinates.cpp b/src/axom/mint/mesh/MeshCoordinates.cpp index 322947a7f6..0de27c710b 100644 --- a/src/axom/mint/mesh/MeshCoordinates.cpp +++ b/src/axom/mint/mesh/MeshCoordinates.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/MeshCoordinates.hpp b/src/axom/mint/mesh/MeshCoordinates.hpp index f61922ccb2..409dadcdb0 100644 --- a/src/axom/mint/mesh/MeshCoordinates.hpp +++ b/src/axom/mint/mesh/MeshCoordinates.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/MeshTypes.hpp b/src/axom/mint/mesh/MeshTypes.hpp index 7d6d2f9912..760cd9ca22 100644 --- a/src/axom/mint/mesh/MeshTypes.hpp +++ b/src/axom/mint/mesh/MeshTypes.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/ParticleMesh.cpp b/src/axom/mint/mesh/ParticleMesh.cpp index 14d310cb4f..926880651c 100644 --- a/src/axom/mint/mesh/ParticleMesh.cpp +++ b/src/axom/mint/mesh/ParticleMesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/ParticleMesh.hpp b/src/axom/mint/mesh/ParticleMesh.hpp index f490e69fa8..9a5eb97f2d 100644 --- a/src/axom/mint/mesh/ParticleMesh.hpp +++ b/src/axom/mint/mesh/ParticleMesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/RectilinearMesh.cpp b/src/axom/mint/mesh/RectilinearMesh.cpp index c3b5379149..c0ebe9c85b 100644 --- a/src/axom/mint/mesh/RectilinearMesh.cpp +++ b/src/axom/mint/mesh/RectilinearMesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/RectilinearMesh.hpp b/src/axom/mint/mesh/RectilinearMesh.hpp index 8b4425edcf..355b54cfa8 100644 --- a/src/axom/mint/mesh/RectilinearMesh.hpp +++ b/src/axom/mint/mesh/RectilinearMesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/StructuredMesh.cpp b/src/axom/mint/mesh/StructuredMesh.cpp index 08348e0d54..067028b821 100644 --- a/src/axom/mint/mesh/StructuredMesh.cpp +++ b/src/axom/mint/mesh/StructuredMesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -57,6 +57,7 @@ void StructuredMesh::setExtent(int ndims, const int64* extent) } SLIC_ASSERT(numNodes == getNumberOfNodes()); + AXOM_UNUSED_VAR(numNodes); #ifdef AXOM_MINT_USE_SIDRE if(hasSidreGroup()) diff --git a/src/axom/mint/mesh/StructuredMesh.hpp b/src/axom/mint/mesh/StructuredMesh.hpp index 3e7e987ed6..13e3eaef47 100644 --- a/src/axom/mint/mesh/StructuredMesh.hpp +++ b/src/axom/mint/mesh/StructuredMesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/UniformMesh.cpp b/src/axom/mint/mesh/UniformMesh.cpp index c9efa1a322..56243abf0a 100644 --- a/src/axom/mint/mesh/UniformMesh.cpp +++ b/src/axom/mint/mesh/UniformMesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/UniformMesh.hpp b/src/axom/mint/mesh/UniformMesh.hpp index 056eb6b8b0..c756c06397 100644 --- a/src/axom/mint/mesh/UniformMesh.hpp +++ b/src/axom/mint/mesh/UniformMesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/UnstructuredMesh.hpp b/src/axom/mint/mesh/UnstructuredMesh.hpp index 4878109ad7..4b17361588 100644 --- a/src/axom/mint/mesh/UnstructuredMesh.hpp +++ b/src/axom/mint/mesh/UnstructuredMesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/blueprint.cpp b/src/axom/mint/mesh/blueprint.cpp index 5eae830be3..19865c7312 100644 --- a/src/axom/mint/mesh/blueprint.cpp +++ b/src/axom/mint/mesh/blueprint.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/blueprint.hpp b/src/axom/mint/mesh/blueprint.hpp index a4302b13d7..9745b3e0aa 100644 --- a/src/axom/mint/mesh/blueprint.hpp +++ b/src/axom/mint/mesh/blueprint.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/internal/ConnectivityArrayHelpers.hpp b/src/axom/mint/mesh/internal/ConnectivityArrayHelpers.hpp index e42dc05113..eac075d62f 100644 --- a/src/axom/mint/mesh/internal/ConnectivityArrayHelpers.hpp +++ b/src/axom/mint/mesh/internal/ConnectivityArrayHelpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -137,8 +137,8 @@ inline CellType initializeFromGroup( "sidre::Group " << group->getPathName() << " does not conform to mesh blueprint."); - sidre::View* type_view = elems_group->getView("types"); - m_types = std::make_unique>(type_view); + sidre::View* elem_type_view = elems_group->getView("types"); + m_types = std::make_unique>(elem_type_view); } return cell_type; diff --git a/src/axom/mint/mesh/internal/ConnectivityArray_typed_indirection.hpp b/src/axom/mint/mesh/internal/ConnectivityArray_typed_indirection.hpp index 14fbf93f89..ffab4a83de 100644 --- a/src/axom/mint/mesh/internal/ConnectivityArray_typed_indirection.hpp +++ b/src/axom/mint/mesh/internal/ConnectivityArray_typed_indirection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/mesh/internal/MeshHelpers.cpp b/src/axom/mint/mesh/internal/MeshHelpers.cpp index 76906c3486..2541f64bc5 100644 --- a/src/axom/mint/mesh/internal/MeshHelpers.cpp +++ b/src/axom/mint/mesh/internal/MeshHelpers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -195,7 +195,8 @@ bool initFaces(Mesh* mesh, f2noffsets[facecount] = faceNodeOffset; // Step 4. Now that we have face IDs, record cell-to-face relation. - typedef std::unordered_map> CellFaceBuilderType; + using CellFaceBuilderType = + std::unordered_map>; CellFaceBuilderType cell_to_face; int cellFaceCount = 0; diff --git a/src/axom/mint/mesh/internal/MeshHelpers.hpp b/src/axom/mint/mesh/internal/MeshHelpers.hpp index c8097bc265..e1f4143944 100644 --- a/src/axom/mint/mesh/internal/MeshHelpers.hpp +++ b/src/axom/mint/mesh/internal/MeshHelpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/CMakeLists.txt b/src/axom/mint/tests/CMakeLists.txt index 2096506ec2..225db01769 100644 --- a/src/axom/mint/tests/CMakeLists.txt +++ b/src/axom/mint/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/StructuredMesh_helpers.hpp b/src/axom/mint/tests/StructuredMesh_helpers.hpp index 66f0c6fcc2..9049d6049c 100644 --- a/src/axom/mint/tests/StructuredMesh_helpers.hpp +++ b/src/axom/mint/tests/StructuredMesh_helpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_deprecated_mcarray.cpp b/src/axom/mint/tests/mint_deprecated_mcarray.cpp index f934d8683f..17b777d6ce 100644 --- a/src/axom/mint/tests/mint_deprecated_mcarray.cpp +++ b/src/axom/mint/tests/mint_deprecated_mcarray.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_execution_cell_traversals.cpp b/src/axom/mint/tests/mint_execution_cell_traversals.cpp index 838fc60a27..205e4c2446 100644 --- a/src/axom/mint/tests/mint_execution_cell_traversals.cpp +++ b/src/axom/mint/tests/mint_execution_cell_traversals.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_execution_face_traversals.cpp b/src/axom/mint/tests/mint_execution_face_traversals.cpp index a57c156d55..6fc4368309 100644 --- a/src/axom/mint/tests/mint_execution_face_traversals.cpp +++ b/src/axom/mint/tests/mint_execution_face_traversals.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_execution_node_traversals.cpp b/src/axom/mint/tests/mint_execution_node_traversals.cpp index 2964b3cd39..b1ac708536 100644 --- a/src/axom/mint/tests/mint_execution_node_traversals.cpp +++ b/src/axom/mint/tests/mint_execution_node_traversals.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_execution_xargs.cpp b/src/axom/mint/tests/mint_execution_xargs.cpp index 69f4012880..3889783de5 100644 --- a/src/axom/mint/tests/mint_execution_xargs.cpp +++ b/src/axom/mint/tests/mint_execution_xargs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_fem_shape_functions.cpp b/src/axom/mint/tests/mint_fem_shape_functions.cpp index b47961d819..ab1ea065b3 100644 --- a/src/axom/mint/tests/mint_fem_shape_functions.cpp +++ b/src/axom/mint/tests/mint_fem_shape_functions.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -34,8 +34,8 @@ namespace template void reference_element(double TOL = std::numeric_limits::epsilon()) { - typedef typename mint::FEBasis FEMType; - typedef typename FEMType::ShapeFunctionType ShapeFunctionType; + using FEMType = typename mint::FEBasis; + using ShapeFunctionType = typename FEMType::ShapeFunctionType; ShapeFunctionType sf; SLIC_INFO("checking " << mint::basis_name[BasisType] << " / " @@ -84,8 +84,8 @@ void reference_element(double TOL = std::numeric_limits::epsilon()) template void kronecker_delta() { - typedef typename mint::FEBasis FEMType; - typedef typename FEMType::ShapeFunctionType ShapeFunctionType; + using FEMType = typename mint::FEBasis; + using ShapeFunctionType = typename FEMType::ShapeFunctionType; ShapeFunctionType sf; SLIC_INFO("checking " << mint::basis_name[BasisType] << " / " @@ -122,8 +122,8 @@ void kronecker_delta() template void partition_of_unity() { - typedef typename mint::FEBasis FEMType; - typedef typename FEMType::ShapeFunctionType ShapeFunctionType; + using FEMType = typename mint::FEBasis; + using ShapeFunctionType = typename FEMType::ShapeFunctionType; ShapeFunctionType sf; SLIC_INFO("checking " << mint::basis_name[BasisType] << " / " diff --git a/src/axom/mint/tests/mint_fem_single_fe.cpp b/src/axom/mint/tests/mint_fem_single_fe.cpp index 675390e943..ac7e76e2ee 100644 --- a/src/axom/mint/tests/mint_fem_single_fe.cpp +++ b/src/axom/mint/tests/mint_fem_single_fe.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -802,6 +802,7 @@ void check_interp(double TOL = 1.e-9) // STEP 6: clean up delete fe; delete[] xc; + delete[] f; delete[] wgts; } diff --git a/src/axom/mint/tests/mint_mesh.cpp b/src/axom/mint/tests/mint_mesh.cpp index 59d654e53d..cc707aed21 100644 --- a/src/axom/mint/tests/mint_mesh.cpp +++ b/src/axom/mint/tests/mint_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_blueprint.cpp b/src/axom/mint/tests/mint_mesh_blueprint.cpp index c85f0082ed..5914bcd37b 100644 --- a/src/axom/mint/tests/mint_mesh_blueprint.cpp +++ b/src/axom/mint/tests/mint_mesh_blueprint.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_cell_types.cpp b/src/axom/mint/tests/mint_mesh_cell_types.cpp index bf321aa093..0a48cc841a 100644 --- a/src/axom/mint/tests/mint_mesh_cell_types.cpp +++ b/src/axom/mint/tests/mint_mesh_cell_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_connectivity_array.cpp b/src/axom/mint/tests/mint_mesh_connectivity_array.cpp index f2ec0faa31..6d25ce5bfd 100644 --- a/src/axom/mint/tests/mint_mesh_connectivity_array.cpp +++ b/src/axom/mint/tests/mint_mesh_connectivity_array.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -1399,6 +1399,7 @@ TEST(mint_connectivity_array, IndirectionExternalSet) /* Check that the external constructor functions properly. */ internal::checkExternalConstructor(ext_mixed); + delete[] initial_values; delete[] values; delete[] offsets; delete[] types; diff --git a/src/axom/mint/tests/mint_mesh_coordinates.cpp b/src/axom/mint/tests/mint_mesh_coordinates.cpp index f8c31a2681..f29855ef8e 100644 --- a/src/axom/mint/tests/mint_mesh_coordinates.cpp +++ b/src/axom/mint/tests/mint_mesh_coordinates.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_curvilinear_mesh.cpp b/src/axom/mint/tests/mint_mesh_curvilinear_mesh.cpp index f6d67c71da..778de2e43b 100644 --- a/src/axom/mint/tests/mint_mesh_curvilinear_mesh.cpp +++ b/src/axom/mint/tests/mint_mesh_curvilinear_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_face_relation.cpp b/src/axom/mint/tests/mint_mesh_face_relation.cpp index 0268ae140f..e0699912ce 100644 --- a/src/axom/mint/tests/mint_mesh_face_relation.cpp +++ b/src/axom/mint/tests/mint_mesh_face_relation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_field.cpp b/src/axom/mint/tests/mint_mesh_field.cpp index 2ae643cdef..6191a0a201 100644 --- a/src/axom/mint/tests/mint_mesh_field.cpp +++ b/src/axom/mint/tests/mint_mesh_field.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_field_data.cpp b/src/axom/mint/tests/mint_mesh_field_data.cpp index f1c58b288e..c2c83f76bc 100644 --- a/src/axom/mint/tests/mint_mesh_field_data.cpp +++ b/src/axom/mint/tests/mint_mesh_field_data.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_field_types.cpp b/src/axom/mint/tests/mint_mesh_field_types.cpp index a7c4c9ee5d..bc8f24102d 100644 --- a/src/axom/mint/tests/mint_mesh_field_types.cpp +++ b/src/axom/mint/tests/mint_mesh_field_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_field_variable.cpp b/src/axom/mint/tests/mint_mesh_field_variable.cpp index 0cbe334309..82f10b9fe8 100644 --- a/src/axom/mint/tests/mint_mesh_field_variable.cpp +++ b/src/axom/mint/tests/mint_mesh_field_variable.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_particle_mesh.cpp b/src/axom/mint/tests/mint_mesh_particle_mesh.cpp index d05df2d830..2e6a28d84c 100644 --- a/src/axom/mint/tests/mint_mesh_particle_mesh.cpp +++ b/src/axom/mint/tests/mint_mesh_particle_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_rectilinear_mesh.cpp b/src/axom/mint/tests/mint_mesh_rectilinear_mesh.cpp index ef0550f004..93bc43526a 100644 --- a/src/axom/mint/tests/mint_mesh_rectilinear_mesh.cpp +++ b/src/axom/mint/tests/mint_mesh_rectilinear_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_uniform_mesh.cpp b/src/axom/mint/tests/mint_mesh_uniform_mesh.cpp index 9aa86f9f52..cf03455adb 100644 --- a/src/axom/mint/tests/mint_mesh_uniform_mesh.cpp +++ b/src/axom/mint/tests/mint_mesh_uniform_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_mesh_unstructured_mesh.cpp b/src/axom/mint/tests/mint_mesh_unstructured_mesh.cpp index aba6dcabab..bdd1c301f3 100644 --- a/src/axom/mint/tests/mint_mesh_unstructured_mesh.cpp +++ b/src/axom/mint/tests/mint_mesh_unstructured_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_su2_io.cpp b/src/axom/mint/tests/mint_su2_io.cpp index 8b5c069877..48ac165f7e 100644 --- a/src/axom/mint/tests/mint_su2_io.cpp +++ b/src/axom/mint/tests/mint_su2_io.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_test_utilities.hpp b/src/axom/mint/tests/mint_test_utilities.hpp index 2ad9d3deb4..5ce51b259b 100644 --- a/src/axom/mint/tests/mint_test_utilities.hpp +++ b/src/axom/mint/tests/mint_test_utilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/tests/mint_util_write_vtk.cpp b/src/axom/mint/tests/mint_util_write_vtk.cpp index 31ac39a8b5..648ac3934a 100644 --- a/src/axom/mint/tests/mint_util_write_vtk.cpp +++ b/src/axom/mint/tests/mint_util_write_vtk.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/utils/ExternalArray.hpp b/src/axom/mint/utils/ExternalArray.hpp index f6ce501f1f..ec8d0dca53 100644 --- a/src/axom/mint/utils/ExternalArray.hpp +++ b/src/axom/mint/utils/ExternalArray.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/utils/su2_utils.cpp b/src/axom/mint/utils/su2_utils.cpp index 1a50b1defc..4f458331ed 100644 --- a/src/axom/mint/utils/su2_utils.cpp +++ b/src/axom/mint/utils/su2_utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/utils/su2_utils.hpp b/src/axom/mint/utils/su2_utils.hpp index 8e8f8c957c..a53fa09a0e 100644 --- a/src/axom/mint/utils/su2_utils.hpp +++ b/src/axom/mint/utils/su2_utils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/utils/vtk_utils.cpp b/src/axom/mint/utils/vtk_utils.cpp index 0193c2ed15..4469226ebd 100644 --- a/src/axom/mint/utils/vtk_utils.cpp +++ b/src/axom/mint/utils/vtk_utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/mint/utils/vtk_utils.hpp b/src/axom/mint/utils/vtk_utils.hpp index 442f0d7264..7440fea3b1 100644 --- a/src/axom/mint/utils/vtk_utils.hpp +++ b/src/axom/mint/utils/vtk_utils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/CMakeLists.txt b/src/axom/multimat/CMakeLists.txt index f439c67434..a26d66073a 100644 --- a/src/axom/multimat/CMakeLists.txt +++ b/src/axom/multimat/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/docs/sphinx/index.rst b/src/axom/multimat/docs/sphinx/index.rst index 167588a3d1..f063aa4d56 100644 --- a/src/axom/multimat/docs/sphinx/index.rst +++ b/src/axom/multimat/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/examples/CMakeLists.txt b/src/axom/multimat/examples/CMakeLists.txt index 74642c0a81..0f3eef4f07 100644 --- a/src/axom/multimat/examples/CMakeLists.txt +++ b/src/axom/multimat/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/examples/calculate.cpp b/src/axom/multimat/examples/calculate.cpp index a53eda814e..59904946fd 100644 --- a/src/axom/multimat/examples/calculate.cpp +++ b/src/axom/multimat/examples/calculate.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/examples/calculate_gpu.cpp b/src/axom/multimat/examples/calculate_gpu.cpp index 7dc6ed7327..0d309a08ee 100644 --- a/src/axom/multimat/examples/calculate_gpu.cpp +++ b/src/axom/multimat/examples/calculate_gpu.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/examples/helper.hpp b/src/axom/multimat/examples/helper.hpp index 73340dcd26..a95e54f3a8 100644 --- a/src/axom/multimat/examples/helper.hpp +++ b/src/axom/multimat/examples/helper.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/examples/traversal.cpp b/src/axom/multimat/examples/traversal.cpp index 025639303e..6e8704660f 100644 --- a/src/axom/multimat/examples/traversal.cpp +++ b/src/axom/multimat/examples/traversal.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -168,6 +168,8 @@ void various_traversal_methods(int nmats, timer.stop(); SLIC_INFO(" Field1D: " << timer.elapsed() << " sec"); SLIC_ASSERT(c_sum == sum); + AXOM_UNUSED_VAR(c_sum); + AXOM_UNUSED_VAR(sum); sum = 0; timer.reset(); @@ -203,6 +205,7 @@ void various_traversal_methods(int nmats, timer.stop(); SLIC_INFO(" Field2D: " << timer.elapsed() << " sec"); SLIC_ASSERT(x_sum == sum); + AXOM_UNUSED_VAR(x_sum); // ------- Dense Access ---------- SLIC_INFO("\n -- Dense Access via map-- "); diff --git a/src/axom/multimat/mmfield.hpp b/src/axom/multimat/mmfield.hpp index be992ea13c..fa164a167f 100644 --- a/src/axom/multimat/mmfield.hpp +++ b/src/axom/multimat/mmfield.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/mmsubfield.hpp b/src/axom/multimat/mmsubfield.hpp index e7c89a2e74..4ee6f15978 100644 --- a/src/axom/multimat/mmsubfield.hpp +++ b/src/axom/multimat/mmsubfield.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/multimat.cpp b/src/axom/multimat/multimat.cpp index c3d03f4c4b..c51cdf9c50 100644 --- a/src/axom/multimat/multimat.cpp +++ b/src/axom/multimat/multimat.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -27,7 +27,6 @@ #include "RAJA/RAJA.hpp" #endif -using namespace std; using namespace axom::multimat; namespace @@ -354,8 +353,9 @@ void MultiMat::setAllocatorID(int alloc_id) void MultiMat::setSlamAllocatorID(int alloc_id) { - bool hasCellDomRelation = hasValidStaticRelation(DataLayout::CELL_DOM); - bool hasMatDomRelation = hasValidStaticRelation(DataLayout::MAT_DOM); + const bool hasCellDomRelation = hasValidStaticRelation(DataLayout::CELL_DOM); + const bool hasMatDomRelation = hasValidStaticRelation(DataLayout::MAT_DOM); + m_slamAllocatorId = alloc_id; m_sets = axom::Array(m_sets, m_slamAllocatorId); @@ -365,6 +365,7 @@ void MultiMat::setSlamAllocatorID(int alloc_id) IndBufferType(m_cellMatRel_indicesVec, m_slamAllocatorId); m_cellMatRel_firstIndicesVec = IndBufferType(m_cellMatRel_firstIndicesVec, m_slamAllocatorId); + m_matCellRel_beginsVec = IndBufferType(m_matCellRel_beginsVec, m_slamAllocatorId); m_matCellRel_indicesVec = @@ -433,7 +434,7 @@ void MultiMat::setFieldAllocatorID(int alloc_id) } } -void MultiMat::setCellMatRel(const vector& vecarr, DataLayout layout) +void MultiMat::setCellMatRel(const std::vector& vecarr, DataLayout layout) { //Setup the SLAM cell to mat relation //This step is necessary if the volfrac field is sparse @@ -1802,7 +1803,7 @@ void MultiMat::print() const } sstr << "\n\n"; - cout << sstr.str() << endl; + std::cout << sstr.str() << std::endl; } bool MultiMat::isValid(bool verboseOutput) const diff --git a/src/axom/multimat/multimat.hpp b/src/axom/multimat/multimat.hpp index c0451987d3..1e2a1bdc07 100644 --- a/src/axom/multimat/multimat.hpp +++ b/src/axom/multimat/multimat.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -1055,21 +1055,21 @@ int MultiMat::addFieldArray_impl(const std::string& field_name, SLIC_ASSERT(m_fieldNameVec.size() == m_fieldSparsityLayoutVec.size()); SLIC_ASSERT(m_fieldNameVec.size() == m_fieldStrideVec.size()); - axom::IndexType set_size = 0; +#ifdef AXOM_DEBUG if(field_mapping == FieldMapping::PER_CELL_MAT) { const BivariateSetType* s = get_mapped_biSet(data_layout, sparsity_layout); SLIC_ASSERT(s != nullptr); - set_size = s->size(); + SLIC_ASSERT(s->size() * stride == data_arr.size()); } else { SLIC_ASSERT(field_mapping == FieldMapping::PER_CELL || field_mapping == FieldMapping::PER_MAT); const RangeSetType& s = *getMappedRangeSet(field_mapping); - set_size = s.size(); + SLIC_ASSERT(s.size() * stride == data_arr.size()); } - SLIC_ASSERT(set_size * stride == data_arr.size()); +#endif m_fieldBackingVec.back() = std::make_unique(data_arr, owned, m_fieldAllocatorId); diff --git a/src/axom/multimat/tests/CMakeLists.txt b/src/axom/multimat/tests/CMakeLists.txt index 91fd4e307d..735f3576ac 100644 --- a/src/axom/multimat/tests/CMakeLists.txt +++ b/src/axom/multimat/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/multimat/tests/multimat_test.cpp b/src/axom/multimat/tests/multimat_test.cpp index 33a416e7bf..2019088f04 100644 --- a/src/axom/multimat/tests/multimat_test.cpp +++ b/src/axom/multimat/tests/multimat_test.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/CMakeLists.txt b/src/axom/primal/CMakeLists.txt index 428d79c86f..a16b1d0236 100644 --- a/src/axom/primal/CMakeLists.txt +++ b/src/axom/primal/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -38,6 +38,7 @@ set( primal_headers geometry/Tetrahedron.hpp geometry/Octahedron.hpp geometry/Triangle.hpp + geometry/Quadrilateral.hpp geometry/Vector.hpp ## operators @@ -59,6 +60,7 @@ set( primal_headers operators/detail/clip_impl.hpp operators/detail/compute_moments_impl.hpp + operators/detail/fuzzy_comparators.hpp operators/detail/intersect_bezier_impl.hpp operators/detail/intersect_bounding_box_impl.hpp operators/detail/intersect_impl.hpp diff --git a/src/axom/primal/constants.hpp b/src/axom/primal/constants.hpp index 73d2c9053d..02d176badb 100644 --- a/src/axom/primal/constants.hpp +++ b/src/axom/primal/constants.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/docs/sphinx/primitive.rst b/src/axom/primal/docs/sphinx/primitive.rst index 8140e466c8..9520f16e47 100644 --- a/src/axom/primal/docs/sphinx/primitive.rst +++ b/src/axom/primal/docs/sphinx/primitive.rst @@ -6,9 +6,14 @@ Primal includes the following primitives: - Point - Segment, Ray, Vector - Plane, Triangle, Polygon +- Quadrilateral - Sphere - Tetrahedron +- Hexahedron - BoundingBox, OrientedBoundingBox +- Polyhedron + +.. note:: Primitives in Axom use a right-handed coordinate system. Primal also provides the NumericArray class, which implements arithmetic operations on numerical tuples and supports Primal's Point and Vector classes. diff --git a/src/axom/primal/examples/CMakeLists.txt b/src/axom/primal/examples/CMakeLists.txt index 37d8c5de3a..97ec32ffeb 100644 --- a/src/axom/primal/examples/CMakeLists.txt +++ b/src/axom/primal/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/examples/hex_tet_volume.cpp b/src/axom/primal/examples/hex_tet_volume.cpp index 6aa39291b0..a2a166de00 100644 --- a/src/axom/primal/examples/hex_tet_volume.cpp +++ b/src/axom/primal/examples/hex_tet_volume.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -239,7 +239,7 @@ void check_intersection_volumes(const Input& params) // reduce the number of operations. RAJA::ReduceSum total_intersect_vol(0.0); constexpr double EPS = 1e-10; - constexpr bool checkSign = true; + constexpr bool tryFixOrientation = true; // The lower of the two sizes (NUM_HEXES, NUM_TETS) is used to factor out // every pair of hexahedron and tetrahedron indices. @@ -251,7 +251,7 @@ void check_intersection_volumes(const Input& params) total_intersect_vol += intersection_volume(hexes_view[i / NUM_TETS], tets_view[i % NUM_TETS], EPS, - checkSign); + tryFixOrientation); }); } else @@ -262,7 +262,7 @@ void check_intersection_volumes(const Input& params) total_intersect_vol += intersection_volume(hexes_view[i % NUM_HEXES], tets_view[i / NUM_HEXES], EPS, - checkSign); + tryFixOrientation); }); } diff --git a/src/axom/primal/examples/primal_introduction.cpp b/src/axom/primal/examples/primal_introduction.cpp index 3e509a9098..1c74c543aa 100644 --- a/src/axom/primal/examples/primal_introduction.cpp +++ b/src/axom/primal/examples/primal_introduction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/geometry/BezierCurve.hpp b/src/axom/primal/geometry/BezierCurve.hpp index cabdaece1f..1da4960715 100644 --- a/src/axom/primal/geometry/BezierCurve.hpp +++ b/src/axom/primal/geometry/BezierCurve.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -68,8 +68,10 @@ class BezierCurve using BoundingBoxType = BoundingBox; using OrientedBoundingBoxType = OrientedBoundingBox; - AXOM_STATIC_ASSERT_MSG((NDIMS == 2) || (NDIMS == 3), - "A Bezier Curve object may be defined in 2-D or 3-D"); + AXOM_STATIC_ASSERT_MSG( + (NDIMS == 1) || (NDIMS == 2) || (NDIMS == 3), + "A Bezier Curve object may be defined in 1-, 2-, or 3-D"); + AXOM_STATIC_ASSERT_MSG( std::is_arithmetic::value, "A Bezier Curve must be defined using an arithmetic type"); @@ -338,17 +340,15 @@ class BezierCurve const int ord = getOrder(); axom::Array dCarray(ord + 1); - if(isRational()) + // If not rational, we can do standard de Casteljau + if(!isRational()) { - axom::Array dWarray(ord + 1); - - // Run algorithm from Farin '83 on each dimension + // Run de Casteljau algorithm on each dimension for(int i = 0; i < NDIMS; ++i) { for(int p = 0; p <= ord; ++p) { - dCarray[p] = m_controlPoints[p][i] * m_weights[p]; - dWarray[p] = m_weights[p]; + dCarray[p] = m_controlPoints[p][i]; } for(int p = 1; p <= ord; ++p) @@ -357,15 +357,60 @@ class BezierCurve for(int k = 0; k <= end; ++k) { dCarray[k] = lerp(dCarray[k], dCarray[k + 1], t); - dWarray[k] = lerp(dWarray[k], dWarray[k + 1], t); } } - ptval[i] = dCarray[0] / dWarray[0]; + ptval[i] = dCarray[0]; } return ptval; } - else // If ordinary Bezier curve + // If rational, construct 4D homogeneous curve to evaluate + else + { + // Store BezierCurve of projective weights, (wx, wy, wz) + // and BezierCurve of weights (w) + BezierCurve projective(ord); + BezierCurve weights(ord); + + for(int p = 0; p <= ord; ++p) + { + weights[p][0] = m_weights[p]; + + for(int i = 0; i < NDIMS; ++i) + { + projective[p][i] = m_controlPoints[p][i] * m_weights[p]; + } + } + + Point P = projective.evaluate(t); + Point W = weights.evaluate(t); + + for(int i = 0; i < NDIMS; ++i) + { + ptval[i] = P[i] / W[0]; + } + + return ptval; + } + } + + /*! + * \brief Computes the 0th and 1st derivative of a Bezier curve + * + * \param [in] t Parameter value at which to compute tangent + * \param [out] eval The value of the curve at \a t + * \param [out] Dt The tangent vector of the curve at \a t + */ + void evaluate_first_derivative(T t, PointType& eval, VectorType& Dt) const + { + using axom::utilities::lerp; + VectorType val; + + const int ord = getOrder(); + std::vector dCarray(ord + 1); + + // If the curve is nonrational, we can use standard de Casteljau + if(!isRational()) { // Run de Casteljau algorithm on each dimension for(int i = 0; i < NDIMS; ++i) @@ -375,7 +420,8 @@ class BezierCurve dCarray[p] = m_controlPoints[p][i]; } - for(int p = 1; p <= ord; ++p) + // stop one step early and take difference of last two values + for(int p = 1; p <= ord - 1; ++p) { const int end = ord - p; for(int k = 0; k <= end; ++k) @@ -383,15 +429,57 @@ class BezierCurve dCarray[k] = lerp(dCarray[k], dCarray[k + 1], t); } } - ptval[i] = dCarray[0]; + + if(ord == 0) + { + eval[i] = dCarray[0]; + Dt[i] = 0.0; + } + else + { + eval[i] = (1 - t) * dCarray[0] + t * dCarray[1]; + Dt[i] = ord * (dCarray[1] - dCarray[0]); + } + } + } + // If rational, construct the 4D homogeneous surface, + // which requires all first derivatives + else + { + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierCurve projective(ord); + BezierCurve weights(ord); + + for(int p = 0; p <= ord; ++p) + { + weights[p][0] = m_weights[p]; + + for(int i = 0; i < NDIMS; ++i) + { + projective[p][i] = m_controlPoints[p][i] * m_weights[p]; + } } - return ptval; + Point P; + Vector P_t; + + Point W; + Vector W_t; + + projective.evaluate_first_derivative(t, P, P_t); + weights.evaluate_first_derivative(t, W, W_t); + + for(int i = 0; i < NDIMS; ++i) + { + eval[i] = P[i] / W[0]; + Dt[i] = (P_t[i] - eval[i] * W_t[0]) / W[0]; + } } } /*! - * \brief Computes the tangent of a Bezier curve at a particular parameter value \a t + * \brief Computes the tangent of a Bezier curve at a particular parameter value \a t * * \param [in] t parameter value at which to compute tangent * \return p the tangent vector of the Bezier curve at t @@ -406,38 +494,98 @@ class BezierCurve const int ord = getOrder(); axom::Array dCarray(ord + 1); - if(isRational()) + // If the curve is nonrational, we can use standard de Casteljau + if(!isRational()) { - axom::Array dWarray(ord + 1); - - // Run algorithm from Farin '83 on each dimension + // Run de Casteljau algorithm on each dimension for(int i = 0; i < NDIMS; ++i) { for(int p = 0; p <= ord; ++p) { - dCarray[p] = m_controlPoints[p][i] * m_weights[p]; - dWarray[p] = m_weights[p]; + dCarray[p] = m_controlPoints[p][i]; } - // stop one step early and do calculation on last two values + // stop one step early and take difference of last two values for(int p = 1; p <= ord - 1; ++p) { const int end = ord - p; for(int k = 0; k <= end; ++k) { dCarray[k] = lerp(dCarray[k], dCarray[k + 1], t); - dWarray[k] = lerp(dWarray[k], dWarray[k + 1], t); } } - val[i] = ord * (dWarray[0] * dCarray[1] - dWarray[1] * dCarray[0]); - dWarray[0] = lerp(dWarray[0], dWarray[1], t); - val[i] /= dWarray[0] * dWarray[0]; + if(ord == 0) + { + val[i] = 0.0; + } + else + { + val[i] = ord * (dCarray[1] - dCarray[0]); + } } return val; } + // If rational, construct the 4D homogeneous surface, + // which requires all first derivatives else + { + VectorType val; + + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierCurve projective(ord); + BezierCurve weights(ord); + + for(int p = 0; p <= ord; ++p) + { + weights[p][0] = m_weights[p]; + + for(int i = 0; i < NDIMS; ++i) + { + projective[p][i] = m_controlPoints[p][i] * m_weights[p]; + } + } + + Point P; + Vector P_t; + + Point W; + Vector W_t; + + projective.evaluate_first_derivative(t, P, P_t); + weights.evaluate_first_derivative(t, W, W_t); + + for(int i = 0; i < NDIMS; ++i) + { + val[i] = (W[0] * P_t[i] - P[i] * W_t[0]) / (W[0] * W[0]); + } + + return val; + } + } + + /*! + * \brief Computes the 0th, 1st, and 2nd derivatives of a Bezier curve + * + * \param [in] t Parameter value at which to compute tangent + * \param [out] eval The value of the curve at \a t + * \param [out] Dt The tangent vector of the curve at \a t + */ + void evaluate_second_derivative(T t, + PointType& eval, + VectorType& Dt, + VectorType& DtDt) const + { + using axom::utilities::lerp; + VectorType val; + + const int ord = getOrder(); + std::vector dCarray(ord + 1); + + // If the curve is nonrational, we can use standard de Casteljau + if(!isRational()) { // Run de Casteljau algorithm on each dimension for(int i = 0; i < NDIMS; ++i) @@ -448,7 +596,7 @@ class BezierCurve } // stop one step early and take difference of last two values - for(int p = 1; p <= ord - 1; ++p) + for(int p = 1; p <= ord - 2; ++p) { const int end = ord - p; for(int k = 0; k <= end; ++k) @@ -456,7 +604,150 @@ class BezierCurve dCarray[k] = lerp(dCarray[k], dCarray[k + 1], t); } } - val[i] = ord * (dCarray[1] - dCarray[0]); + + if(ord == 0) + { + eval[i] = dCarray[0]; + Dt[i] = 0.0; + DtDt[i] = 0.0; + } + else if(ord == 1) + { + eval[i] = (1 - t) * dCarray[0] + t * dCarray[1]; + Dt[i] = ord * (dCarray[1] - dCarray[0]); + DtDt[i] = 0.0; + } + else + { + eval[i] = (1 - t) * (1 - t) * dCarray[0] + + 2 * (1 - t) * t * dCarray[1] + t * t * dCarray[2]; + Dt[i] = ord * + ((1 - t) * (dCarray[1] - dCarray[0]) + t * (dCarray[2] - dCarray[1])); + DtDt[i] = ord * (ord - 1) * (dCarray[2] - 2 * dCarray[1] + dCarray[0]); + } + } + } + // If rational, construct the 4D homogeneous surface, + // which requires all first derivatives + else + { + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierCurve projective(ord); + BezierCurve weights(ord); + + for(int p = 0; p <= ord; ++p) + { + weights[p][0] = m_weights[p]; + + for(int i = 0; i < NDIMS; ++i) + { + projective[p][i] = m_controlPoints[p][i] * m_weights[p]; + } + } + + Point P; + Vector P_t, P_tt; + + Point W; + Vector W_t, W_tt; + + projective.evaluate_second_derivative(t, P, P_t, P_tt); + weights.evaluate_second_derivative(t, W, W_t, W_tt); + + for(int i = 0; i < NDIMS; ++i) + { + eval[i] = P[i] / W[0]; + Dt[i] = (P_t[i] - eval[i] * W_t[0]) / W[0]; + DtDt[i] = (P_tt[i] - 2 * Dt[i] * W_t[0] - eval[i] * W_tt[0]) / W[0]; + } + } + } + + /*! + * \brief Computes the second derivative of a Bezier curve at a particular parameter value \a t + * + * \param [in] t parameter value at which to compute tangent + * \return p the 2nd derivative vector of the Bezier curve at t + * + * \note We typically find the second derivative of the curve at \a t between 0 and 1 + */ + VectorType dtdt(T t) const + { + using axom::utilities::lerp; + VectorType val; + + const int ord = getOrder(); + std::vector dCarray(ord + 1); + + // If the curve is nonrational, we can use standard de Casteljau + if(!isRational()) + { + // Run de Casteljau algorithm on each dimension + for(int i = 0; i < NDIMS; ++i) + { + for(int p = 0; p <= ord; ++p) + { + dCarray[p] = m_controlPoints[p][i]; + } + + // stop one step early and take difference of last two values + for(int p = 1; p <= ord - 2; ++p) + { + const int end = ord - p; + for(int k = 0; k <= end; ++k) + { + dCarray[k] = lerp(dCarray[k], dCarray[k + 1], t); + } + } + + if(ord <= 1) + { + val[i] = 0.0; + } + else + { + val[i] = ord * (ord - 1) * (dCarray[2] - 2 * dCarray[1] + dCarray[0]); + } + } + + return val; + } + // If rational, construct the 4D homogeneous surface, + // which requires all first derivatives + else + { + VectorType val; + + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierCurve projective(ord); + BezierCurve weights(ord); + + for(int p = 0; p <= ord; ++p) + { + weights[p][0] = m_weights[p]; + + for(int i = 0; i < NDIMS; ++i) + { + projective[p][i] = m_controlPoints[p][i] * m_weights[p]; + } + } + + Point P; + Vector P_t, P_tt; + + Point W; + Vector W_t, W_tt; + + projective.evaluate_second_derivative(t, P, P_t, P_tt); + weights.evaluate_second_derivative(t, W, W_t, W_tt); + + for(int i = 0; i < NDIMS; ++i) + { + val[i] = W[0] * W[0] * P_tt[i] - + 2 * (W[0] * P_t[i] - P[i] * W_t[0]) * W_t[0] - P[i] * W[0] * W_tt[0]; + val[i] /= (W[0] * W[0] * W[0]); } return val; diff --git a/src/axom/primal/geometry/BezierPatch.hpp b/src/axom/primal/geometry/BezierPatch.hpp index 86e0f9560e..54fae15c09 100644 --- a/src/axom/primal/geometry/BezierPatch.hpp +++ b/src/axom/primal/geometry/BezierPatch.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -32,12 +32,12 @@ namespace axom namespace primal { // Forward declare the templated classes and operator functions -template +template class BezierPatch; /*! \brief Overloaded output operator for Bezier Patches*/ -template -std::ostream& operator<<(std::ostream& os, const BezierPatch& bPatch); +template +std::ostream& operator<<(std::ostream& os, const BezierPatch& bPatch); /*! * \class BezierPatch @@ -55,22 +55,26 @@ std::ostream& operator<<(std::ostream& os, const BezierPatch& bPatch); * Gerald Farin, "Algorithms for rational Bezier curves" * Computer-Aided Design, Volume 15, Number 2, 1983, */ -template +template class BezierPatch { public: - using PointType = Point; - using VectorType = Vector; - using PlaneType = Plane; + using PointType = Point; + using VectorType = Vector; + using PlaneType = Plane; using CoordsVec = axom::Array; using CoordsMat = axom::Array; using WeightsVec = axom::Array; using WeightsMat = axom::Array; - using BoundingBoxType = BoundingBox; - using OrientedBoundingBoxType = OrientedBoundingBox; - using BezierCurveType = primal::BezierCurve; + using BoundingBoxType = BoundingBox; + using OrientedBoundingBoxType = OrientedBoundingBox; + using BezierCurveType = primal::BezierCurve; + + AXOM_STATIC_ASSERT_MSG( + (NDIMS == 1) || (NDIMS == 2) || (NDIMS == 3), + "A Bezier Patch object may be defined in 1-, 2-, or 3-D"); AXOM_STATIC_ASSERT_MSG( std::is_arithmetic::value, @@ -383,15 +387,15 @@ class BezierPatch }; /// Checks equality of two Bezier Patches - friend inline bool operator==(const BezierPatch& lhs, - const BezierPatch& rhs) + friend inline bool operator==(const BezierPatch& lhs, + const BezierPatch& rhs) { return (lhs.m_controlPoints == rhs.m_controlPoints) && (lhs.m_weights == rhs.m_weights); } - friend inline bool operator!=(const BezierPatch& lhs, - const BezierPatch& rhs) + friend inline bool operator!=(const BezierPatch& lhs, + const BezierPatch& rhs) { return !(lhs == rhs); } @@ -542,7 +546,12 @@ class BezierPatch } } - /// Return an isocurve for a fixed value of u + /*! + * \brief Returns an isocurve with a fixed value of u + * + * \param [in] u Parameter value fixed in the isocurve + * \return c The isocurve C(v) = S(u, v) for fixed u + */ BezierCurveType isocurve_u(T u) const { using axom::utilities::lerp; @@ -553,16 +562,14 @@ class BezierPatch BezierCurveType c(ord_v); axom::Array dCarray(ord_u + 1); - if(isRational()) + if(!isRational()) { - c.makeRational(); // If looking for an edge, don't need to use De Casteljau if(u == 0.0) { for(int q = 0; q <= ord_v; ++q) { c[q] = m_controlPoints(0, q); - c.setWeight(q, m_weights(0, q)); } return c; } @@ -571,21 +578,18 @@ class BezierPatch for(int q = 0; q <= ord_v; ++q) { c[q] = m_controlPoints(ord_u, q); - c.setWeight(q, m_weights(ord_u, q)); } return c; } - // Otherwise, do De Casteljau along the v-axis - axom::Array dWarray(ord_u + 1); + // Otherwise, do De Casteljau along the u-axis for(int q = 0; q <= ord_v; ++q) { - for(int i = 0; i < 3; ++i) + for(int i = 0; i < NDIMS; ++i) { for(int p = 0; p <= ord_u; ++p) { - dCarray[p] = m_controlPoints(p, q)[i] * m_weights(p, q); - dWarray[p] = m_weights(p, q); + dCarray[p] = m_controlPoints(p, q)[i]; } for(int p = 1; p <= ord_u; ++p) @@ -594,23 +598,26 @@ class BezierPatch for(int k = 0; k <= end; ++k) { dCarray[k] = lerp(dCarray[k], dCarray[k + 1], u); - dWarray[k] = lerp(dWarray[k], dWarray[k + 1], u); } } - c[q][i] = dCarray[0] / dWarray[0]; - c.setWeight(q, dWarray[0]); + c[q][i] = dCarray[0]; } } + + return c; } else { + c.makeRational(); + // If looking for an edge, don't need to use De Casteljau if(u == 0.0) { for(int q = 0; q <= ord_v; ++q) { c[q] = m_controlPoints(0, q); + c.setWeight(q, m_weights(0, q)); } return c; } @@ -619,37 +626,53 @@ class BezierPatch for(int q = 0; q <= ord_v; ++q) { c[q] = m_controlPoints(ord_u, q); + c.setWeight(q, m_weights(ord_u, q)); } return c; } - // Otherwise, do De Casteljau along the v-axis - for(int q = 0; q <= ord_v; ++q) + // Otherwise, do de Casteljau on the homogeneous control points + + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierPatch projective(ord_u, ord_v); + BezierPatch weights(ord_u, ord_v); + + for(int p = 0; p <= ord_u; ++p) { - for(int i = 0; i < 3; ++i) + for(int q = 0; q <= ord_v; ++q) { - for(int p = 0; p <= ord_u; ++p) - { - dCarray[p] = m_controlPoints(p, q)[i]; - } + weights(p, q)[0] = m_weights(p, q); - for(int p = 1; p <= ord_u; ++p) + for(int i = 0; i < NDIMS; ++i) { - const int end = ord_u - p; - for(int k = 0; k <= end; ++k) - { - dCarray[k] = lerp(dCarray[k], dCarray[k + 1], u); - } + projective(p, q)[i] = m_controlPoints(p, q)[i] * m_weights(p, q); } - c[q][i] = dCarray[0]; } } - } - return c; + BezierCurve P = projective.isocurve_u(u); + BezierCurve W = weights.isocurve_u(u); + + for(int q = 0; q <= ord_v; ++q) + { + for(int i = 0; i < NDIMS; ++i) + { + c[q][i] = P[q][i] / W[q][0]; + c.setWeight(q, W[q][0]); + } + } + + return c; + } } - /// Return an isocurve for a fixed value of v + /*! + * \brief Returns an isocurve with a fixed value of v + * + * \param [in] v Parameter value fixed in the isocurve + * \return c The isocurve C(u) = S(u, v) for fixed v + */ BezierCurveType isocurve_v(T v) const { using axom::utilities::lerp; @@ -660,17 +683,14 @@ class BezierPatch BezierCurveType c(ord_u); axom::Array dCarray(ord_v + 1); - if(isRational()) + if(!isRational()) { - c.makeRational(); - // If looking for an edge, don't need to use De Casteljau if(v == 0.0) { for(int p = 0; p <= ord_u; ++p) { c[p] = m_controlPoints(p, 0); - c.setWeight(p, m_weights(p, 0)); } return c; } @@ -679,21 +699,18 @@ class BezierPatch for(int p = 0; p <= ord_u; ++p) { c[p] = m_controlPoints(p, ord_v); - c.setWeight(p, m_weights(p, ord_v)); } return c; } // Otherwise, do De Casteljau along the u-axis - axom::Array dWarray(ord_v + 1); for(int p = 0; p <= ord_u; ++p) { - for(int i = 0; i < 3; ++i) + for(int i = 0; i < NDIMS; ++i) { for(int q = 0; q <= ord_v; ++q) { - dCarray[q] = m_controlPoints(p, q)[i] * m_weights(p, q); - dWarray[q] = m_weights(p, q); + dCarray[q] = m_controlPoints(p, q)[i]; } for(int q = 1; q <= ord_v; ++q) @@ -702,22 +719,26 @@ class BezierPatch for(int k = 0; k <= end; ++k) { dCarray[k] = lerp(dCarray[k], dCarray[k + 1], v); - dWarray[k] = lerp(dWarray[k], dWarray[k + 1], v); } } - c[p][i] = dCarray[0] / dWarray[0]; - c.setWeight(p, dWarray[0]); + + c[p][i] = dCarray[0]; } } + + return c; } else { + c.makeRational(); + // If looking for an edge, don't need to use De Casteljau if(v == 0.0) { for(int p = 0; p <= ord_u; ++p) { c[p] = m_controlPoints(p, 0); + c.setWeight(p, m_weights(p, 0)); } return c; } @@ -726,34 +747,45 @@ class BezierPatch for(int p = 0; p <= ord_u; ++p) { c[p] = m_controlPoints(p, ord_v); + c.setWeight(p, m_weights(p, ord_v)); } return c; } - // Otherwise, do De Casteljau along the u-axis + // Otherwise, do de Casteljau on the homogeneous control points + + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierPatch projective(ord_u, ord_v); + BezierPatch weights(ord_u, ord_v); + for(int p = 0; p <= ord_u; ++p) { - for(int i = 0; i < 3; ++i) + for(int q = 0; q <= ord_v; ++q) { - for(int q = 0; q <= ord_v; ++q) - { - dCarray[q] = m_controlPoints(p, q)[i]; - } + weights(p, q)[0] = m_weights(p, q); - for(int q = 1; q <= ord_v; ++q) + for(int i = 0; i < NDIMS; ++i) { - const int end = ord_v - q; - for(int k = 0; k <= end; ++k) - { - dCarray[k] = lerp(dCarray[k], dCarray[k + 1], v); - } + projective(p, q)[i] = m_controlPoints(p, q)[i] * m_weights(p, q); } - c[p][i] = dCarray[0]; } } - } - return c; + BezierCurve P = projective.isocurve_v(v); + BezierCurve W = weights.isocurve_v(v); + + for(int p = 0; p <= ord_u; ++p) + { + for(int i = 0; i < NDIMS; ++i) + { + c[p][i] = P[p][i] / W[p][0]; + c.setWeight(p, W[p][0]); + } + } + + return c; + } } /*! @@ -777,28 +809,833 @@ class BezierPatch } } + /*! + * \brief Evaluates all first derivatives Bezier patch at (\a u, \a v) + * + * \param [in] u Parameter value at which to evaluate on the first axis + * \param [in] v Parameter value at which to evaluate on the second axis + * \param [out] eval The point value of the Bezier patch at (u, v) + * \param [out] Du The vector value of S_u(u, v) + * \param [out] Dv The vector value of S_v(u, v) + * + * \note We typically evaluate the patch at \a u and \a v between 0 and 1 + */ + void evaluate_first_derivatives(T u, + T v, + Point& eval, + Vector& Du, + Vector& Dv) const + { + using axom::utilities::lerp; + const int ord_u = getOrder_u(); + const int ord_v = getOrder_v(); + + axom::Array dCmat(ord_u + 1, ord_v + 1); + + if(!isRational()) + { + // Do de Casteljau until we get a 2x2 + for(int i = 0; i < NDIMS; ++i) + { + for(int p = 0; p <= ord_u; ++p) + { + for(int q = 0; q <= ord_v; ++q) + { + dCmat(p, q) = m_controlPoints(p, q)[i]; + } + } + + // Store the size after each de Casteljau reduction is made + int end_u = ord_u; + int end_v = ord_v; + + // Do de Casteljau over the longer direction first + if(ord_u >= ord_v) + { + // Stop 1 steps early in u + while(end_u > 1) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= end_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + + // Stop 1 steps early in v + while(end_v > 1) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + } + else + { + // Stop 1 steps early in v + while(end_v > 1) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + + // Stop 2 steps early in v over the three columns + while(end_u > 1) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= end_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + } + + // By now, the first 2x2 submatrix of dCmat should have + // all the intermediate values needed + + // Compute first order derivatives + // clang-format off + if( end_u == 1 && end_v == 1 ) + { + Du[i] = ord_u * ( (1 - v) * (dCmat(1, 0) - dCmat(0, 0)) + + v * (dCmat(1, 1) - dCmat(0, 1)) ); + Dv[i] = ord_v * ( (1 - u) * (dCmat(0, 1) - dCmat(0, 0)) + + u * (dCmat(1, 1) - dCmat(1, 0)) ); + eval[i] = (1 - u) * (1 - v) * dCmat(0, 0) + u * (1 - v) * dCmat(1, 0) + (1 - u) * v * dCmat(0, 1) + u * v * dCmat(1, 1); + } + else if (end_u == 1 && end_v == 0) + { + Du[i] = ord_u * (dCmat(1, 0) - dCmat(0, 0)); + Dv[i] = 0.0; + eval[i] = (1 - u) * dCmat(0, 0) + u * dCmat(1, 0); + } + else if (end_u == 0 && end_v == 1) + { + Du[i] = 0.0; + Dv[i] = ord_v * (dCmat(0, 1) - dCmat(0, 0)); + eval[i] = (1 - v) * dCmat(0, 0) + v * dCmat(0, 1); + } + else + { + Du[i] = 0.0; + Dv[i] = 0.0; + eval[i] = dCmat(0, 0); + } + // clang-format on + } + } + else + { + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierPatch projective(ord_u, ord_v); + BezierPatch weights(ord_u, ord_v); + + for(int p = 0; p <= ord_u; ++p) + { + for(int q = 0; q <= ord_v; ++q) + { + weights(p, q)[0] = m_weights(p, q); + + for(int i = 0; i < NDIMS; ++i) + { + projective(p, q)[i] = m_controlPoints(p, q)[i] * m_weights(p, q); + } + } + } + + Point P; + Vector P_u, P_v, P_uu, P_vv, P_uv; + + Point W; + Vector W_u, W_v, W_uu, W_vv, W_uv; + + projective.evaluate_second_derivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv); + weights.evaluate_second_derivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv); + + for(int i = 0; i < NDIMS; ++i) + { + eval[i] = P[i] / W[0]; + Du[i] = (P_u[i] - eval[i] * W_u[0]) / W[0]; + Dv[i] = (P_v[i] - eval[i] * W_v[0]) / W[0]; + } + } + } + + /*! + * \brief Evaluates all linear derivatives Bezier patch at (\a u, \a v) + * + * \param [in] u Parameter value at which to evaluate on the first axis + * \param [in] v Parameter value at which to evaluate on the second axis + * \param [out] eval The point value of the Bezier patch at (u, v) + * \param [out] Du The vector value of S_u(u, v) + * \param [out] Dv The vector value of S_v(u, v) + * \param [out] DuDv The vector value of S_uv(u, v) == S_vu(u, v) + * + * \note We typically evaluate the patch at \a u and \a v between 0 and 1 + */ + void evaluate_linear_derivatives(T u, + T v, + Point& eval, + Vector& Du, + Vector& Dv, + Vector& DuDv) const + { + using axom::utilities::lerp; + const int ord_u = getOrder_u(); + const int ord_v = getOrder_v(); + + axom::Array dCmat(ord_u + 1, ord_v + 1); + + if(!isRational()) + { + // Do de Casteljau until we get a 2x2 + for(int i = 0; i < NDIMS; ++i) + { + for(int p = 0; p <= ord_u; ++p) + { + for(int q = 0; q <= ord_v; ++q) + { + dCmat(p, q) = m_controlPoints(p, q)[i]; + } + } + + // Store the size after each de Casteljau reduction is made + int end_u = ord_u; + int end_v = ord_v; + + // Do de Casteljau over the longer direction first + if(ord_u >= ord_v) + { + // Stop 1 steps early in u + while(end_u > 1) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= end_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + + // Stop 1 steps early in v + while(end_v > 1) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + } + else + { + // Stop 1 steps early in v + while(end_v > 1) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + + // Stop 2 steps early in v over the three columns + while(end_u > 1) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= end_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + } + + // By now, the first 2x2 submatrix of dCmat should have + // all the intermediate values needed + + // Compute first order derivatives + // clang-format off + if( end_u == 1 && end_v == 1 ) + { + Du[i] = ord_u * ( (1 - v) * (dCmat(1, 0) - dCmat(0, 0)) + + v * (dCmat(1, 1) - dCmat(0, 1)) ); + Dv[i] = ord_v * ( (1 - u) * (dCmat(0, 1) - dCmat(0, 0)) + + u * (dCmat(1, 1) - dCmat(1, 0)) ); + DuDv[i] = ord_u * ord_v * (dCmat(1, 1) - dCmat(1, 0) - dCmat(0, 1) + dCmat(0, 0)); + eval[i] = (1 - u) * (1 - v) * dCmat(0, 0) + u * (1 - v) * dCmat(1, 0) + (1 - u) * v * dCmat(0, 1) + u * v * dCmat(1, 1); + } + else if (end_u == 1 && end_v == 0) + { + Du[i] = ord_u * (dCmat(1, 0) - dCmat(0, 0)); + Dv[i] = 0.0; + DuDv[i] = 0.0; + eval[i] = (1 - u) * dCmat(0, 0) + u * dCmat(1, 0); + } + else if (end_u == 0 && end_v == 1) + { + Du[i] = 0.0; + Dv[i] = ord_v * (dCmat(0, 1) - dCmat(0, 0)); + DuDv[i] = 0.0; + eval[i] = (1 - v) * dCmat(0, 0) + v * dCmat(0, 1); + } + else + { + Du[i] = 0.0; + Dv[i] = 0.0; + DuDv[i] = 0.0; + eval[i] = dCmat(0, 0); + } + // clang-format on + } + } + else + { + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierPatch projective(ord_u, ord_v); + BezierPatch weights(ord_u, ord_v); + + for(int p = 0; p <= ord_u; ++p) + { + for(int q = 0; q <= ord_v; ++q) + { + weights(p, q)[0] = m_weights(p, q); + + for(int i = 0; i < NDIMS; ++i) + { + projective(p, q)[i] = m_controlPoints(p, q)[i] * m_weights(p, q); + } + } + } + + Point P; + Vector P_u, P_v, P_uu, P_vv, P_uv; + + Point W; + Vector W_u, W_v, W_uu, W_vv, W_uv; + + projective.evaluate_second_derivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv); + weights.evaluate_second_derivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv); + + for(int i = 0; i < NDIMS; ++i) + { + eval[i] = P[i] / W[0]; + Du[i] = (P_u[i] - eval[i] * W_u[0]) / W[0]; + Dv[i] = (P_v[i] - eval[i] * W_v[0]) / W[0]; + DuDv[i] = + (P_uv[i] - Du[i] * W_v[0] - Dv[i] * W_u[0] - eval[i] * W_uv[0]) / W[0]; + } + } + } + + /*! + * \brief Evaluates all second derivatives Bezier patch at (\a u, \a v) + * + * \param [in] u Parameter value at which to evaluate on the first axis + * \param [in] v Parameter value at which to evaluate on the second axis + * \param [out] eval The point value of the Bezier patch at (u, v) + * \param [out] Du The vector value of S_u(u, v) + * \param [out] Dv The vector value of S_v(u, v) + * \param [out] DuDu The vector value of S_uu(u, v) + * \param [out] DvDv The vector value of S_vv(u, v) + * \param [out] DuDv The vector value of S_uv(u, v) == S_vu(u, v) + * + * \note We typically evaluate the patch at \a u and \a v between 0 and 1 + */ + void evaluate_second_derivatives(T u, + T v, + Point& eval, + Vector& Du, + Vector& Dv, + Vector& DuDu, + Vector& DvDv, + Vector& DuDv) const + { + using axom::utilities::lerp; + const int ord_u = getOrder_u(); + const int ord_v = getOrder_v(); + + axom::Array dCmat(ord_u + 1, ord_v + 1); + + if(!isRational()) + { + // Do de Casteljau until we get a 3x3 + for(int i = 0; i < NDIMS; ++i) + { + for(int p = 0; p <= ord_u; ++p) + { + for(int q = 0; q <= ord_v; ++q) + { + dCmat(p, q) = m_controlPoints(p, q)[i]; + } + } + + // Store the size after each de Casteljau reduction is made + int end_u = ord_u; + int end_v = ord_v; + + // Do de Casteljau over the longer direction first + if(ord_u >= ord_v) + { + // Stop 2 steps early in u + while(end_u > 2) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= end_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + + // Stop 2 steps early in v + while(end_v > 2) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + } + else + { + // Stop 2 steps early in v + while(end_v > 2) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + + // Stop 2 steps early in v over the three columns + while(end_u > 2) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= end_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + } + + // By now, the first 3x3 submatrix of dCmat should have + // all the intermediate values needed + + // clang-format off + // Get second order derivatives + if( ord_u >= 2 ) + { + if (ord_v == 0) + { + DuDu[i] = (ord_u - 1) * ord_u * + (dCmat(2, 0) - 2 * dCmat(1, 0) + dCmat(0, 0)); + } + else if (ord_v == 1) + { + DuDu[i] = (ord_u - 1) * ord_u * + ( (1 - v) * (dCmat(2, 0) - 2 * dCmat(1, 0) + dCmat(0, 0)) + + v * (dCmat(2, 1) - 2 * dCmat(1, 1) + dCmat(0, 1)) ); + } + else + { + DuDu[i] = (ord_u - 1) * ord_u * + ( (1 - v) * (1 - v) * (dCmat(2, 0) - 2 * dCmat(1, 0) + dCmat(0, 0)) + + 2 * v * (1 - v) * (dCmat(2, 1) - 2 * dCmat(1, 1) + dCmat(0, 1)) + + v * v * (dCmat(2, 2) - 2 * dCmat(1, 2) + dCmat(0, 2)) ); + } + } + else + { + DuDu[i] = 0.0; + } + + if( ord_v >= 2 ) + { + if( ord_u == 0 ) + { + DvDv[i] = (ord_v - 1) * ord_v * + (dCmat(0, 2) - 2 * dCmat(0, 1) + dCmat(0, 0)); + } + else if (ord_u == 1) + { + DvDv[i] = (ord_v - 1) * ord_v * + ( (1 - u) * (dCmat(0, 2) - 2 * dCmat(0, 1) + dCmat(0, 0)) + + u * (dCmat(1, 2) - 2 * dCmat(1, 1) + dCmat(1, 0)) ); + } + else + { + DvDv[i] = (ord_v - 1) * ord_v * + ( (1 - u) * (1 - u) * (dCmat(0, 2) - 2 * dCmat(0, 1) + dCmat(0, 0)) + + 2 * u * (1 - u) * (dCmat(1, 2) - 2 * dCmat(1, 1) + dCmat(1, 0)) + + u * u * (dCmat(2, 2) - 2 * dCmat(2, 1) + dCmat(2, 0)) ); + } + } + else + { + DvDv[i] = 0.0; + } + + // Do one de Casteljau iteration in u + while( end_u > 1 ) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= end_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + + // Do (at most) one de Casteljau iteration in v + while(end_v > 1) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + + // Compute first order derivatives + // clang-format off + if( end_u == 1 && end_v == 1 ) + { + Du[i] = ord_u * ( (1 - v) * (dCmat(1, 0) - dCmat(0, 0)) + + v * (dCmat(1, 1) - dCmat(0, 1)) ); + Dv[i] = ord_v * ( (1 - u) * (dCmat(0, 1) - dCmat(0, 0)) + + u * (dCmat(1, 1) - dCmat(1, 0)) ); + DuDv[i] = ord_u * ord_v * (dCmat(1, 1) - dCmat(1, 0) - dCmat(0, 1) + dCmat(0, 0)); + eval[i] = (1 - u) * (1 - v) * dCmat(0, 0) + u * (1 - v) * dCmat(1, 0) + (1 - u) * v * dCmat(0, 1) + u * v * dCmat(1, 1); + } + else if (end_u == 1 && end_v == 0) + { + Du[i] = ord_u * (dCmat(1, 0) - dCmat(0, 0)); + Dv[i] = 0.0; + DuDv[i] = 0.0; + eval[i] = (1 - u) * dCmat(0, 0) + u * dCmat(1, 0); + } + else if (end_u == 0 && end_v == 1) + { + Du[i] = 0.0; + Dv[i] = ord_v * (dCmat(0, 1) - dCmat(0, 0)); + DuDv[i] = 0.0; + eval[i] = (1 - v) * dCmat(0, 0) + v * dCmat(0, 1); + } + else + { + Du[i] = 0.0; + Dv[i] = 0.0; + DuDv[i] = 0.0; + eval[i] = dCmat(0, 0); + } + // clang-format on + } + } + else + { + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierPatch projective(ord_u, ord_v); + BezierPatch weights(ord_u, ord_v); + + for(int p = 0; p <= ord_u; ++p) + { + for(int q = 0; q <= ord_v; ++q) + { + weights(p, q)[0] = m_weights(p, q); + + for(int i = 0; i < NDIMS; ++i) + { + projective(p, q)[i] = m_controlPoints(p, q)[i] * m_weights(p, q); + } + } + } + + Point P; + Vector P_u, P_v, P_uu, P_vv, P_uv; + + Point W; + Vector W_u, W_v, W_uu, W_vv, W_uv; + + projective.evaluate_second_derivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv); + weights.evaluate_second_derivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv); + + for(int i = 0; i < NDIMS; ++i) + { + eval[i] = P[i] / W[0]; + Du[i] = (P_u[i] - eval[i] * W_u[0]) / W[0]; + Dv[i] = (P_v[i] - eval[i] * W_v[0]) / W[0]; + DuDu[i] = (P_uu[i] - 2 * W_u[0] * Du[i] - eval[i] * W_uu[0]) / W[0]; + DvDv[i] = (P_vv[i] - 2 * W_v[0] * Dv[i] - eval[i] * W_vv[0]) / W[0]; + DuDv[i] = + (P_uv[i] - Du[i] * W_v[0] - Dv[i] * W_u[0] - eval[i] * W_uv[0]) / W[0]; + } + } + } + /*! * \brief Computes a tangent of a Bezier patch at a particular parameter value (\a u, \a v) along the u axis * * \param [in] u parameter value at which to evaluate on the first axis * \param [in] v parameter value at which to evaluate on the second axis - * \return vec a tangent vector of the Bezier patch at (u, v) + * \return vec a tangent vector in u of the Bezier patch at (u, v) * * \note We typically find the tangent of the patch at \a u and \a v between 0 and 1 */ VectorType du(T u, T v) const { return isocurve_v(v).dt(u); } + /*! + * \brief Computes the second derivative of a Bezier patch at (\a u, \a v) along the u axis + * + * \param [in] u Parameter value at which to evaluate on the first axis + * \param [in] v Parameter value at which to evaluate on the second axis + * \return vec The vector value of S_uu(u, v) + * + * \note We typically find the tangent of the patch at \a u and \a v between 0 and 1 + */ + VectorType dudu(T u, T v) const { return isocurve_v(v).dtdt(u); } + /*! * \brief Computes a tangent of a Bezier patch at a particular parameter value (\a u, \a v) along the v axis * * \param [in] u parameter value at which to evaluate on the first axis * \param [in] v parameter value at which to evaluate on the second axis - * \return vec a tangent vector of the Bezier patch at (u, v) + * \return vec a tangent vector in v of the Bezier patch at (u, v) * * \note We typically find the tangent of the patch at \a u and \a v between 0 and 1 */ VectorType dv(T u, T v) const { return isocurve_u(u).dt(v); } + /*! + * \brief Computes the second derivative of a Bezier patch at (\a u, \a v) along the v axis + * + * \param [in] u Parameter value at which to evaluate on the first axis + * \param [in] v Parameter value at which to evaluate on the second axis + * \return vec The vector value of S_vv(u, v) + * + * \note We typically find the tangent of the patch at \a u and \a v between 0 and 1 + */ + VectorType dvdv(T u, T v) const { return isocurve_u(u).dtdt(v); } + + /*! + * \brief Computes the mixed second derivative of a Bezier patch at (\a u, \a v) + * + * \param [in] u Parameter value at which to evaluate on the first axis + * \param [in] v Parameter value at which to evaluate on the second axis + * \return vec The vector value of S_uv(u, v) == S_vu(u, v) + * + * \note We typically find the tangent of the patch at \a u and \a v between 0 and 1 + */ + VectorType dudv(T u, T v) const + { + using axom::utilities::lerp; + + const int ord_u = getOrder_u(); + const int ord_v = getOrder_v(); + + // If the curve is nonrational, we can use standard de Casteljau + if(!isRational()) + { + Vector val; + + axom::Array dCmat(ord_u + 1, ord_v + 1); + axom::Array dWmat(ord_u + 1, ord_v + 1); + + // Do de Casteljau until we get a 2x2 + for(int i = 0; i < NDIMS; ++i) + { + for(int p = 0; p <= ord_u; ++p) + { + for(int q = 0; q <= ord_v; ++q) + { + dCmat(p, q) = m_controlPoints(p, q)[i]; + } + } + + // Store the size after each de Casteljau reduction is made + int end_u = ord_u; + int end_v = ord_v; + + // Do de Casteljau over the longer direction first + if(ord_u >= ord_v) + { + // Stop 1 steps early in u + while(end_u > 1) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= ord_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + + // Stop 1 steps early in u + while(end_v > 1) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + } + else + { + // Stop 1 step early in v + while(end_v > 1) + { + end_v -= 1; + for(int k = 0; k <= end_v; ++k) + { + for(int p = 0; p <= end_u; ++p) + { + dCmat(p, k) = lerp(dCmat(p, k), dCmat(p, k + 1), v); + } + } + } + + // Stop 1 step early in v over the two columns + while(end_u > 1) + { + end_u -= 1; + for(int k = 0; k <= end_u; ++k) + { + for(int q = 0; q <= ord_v; ++q) + { + dCmat(k, q) = lerp(dCmat(k, q), dCmat(k + 1, q), u); + } + } + } + } + + // Do the evaluation, accounting for insufficient control points + if(end_u == 0 || end_v == 0) + { + val[i] = 0.0; + } + else + { + // clang-format off + val[i] = (1 - u) * (1 - v) * dCmat(0, 0) + u * (1 - v) * dCmat(1, 0) + + (1 - u) * v * dCmat(0, 1) + u * v * dCmat(1, 1); + // clang-format on + } + } + + return val; + } + // If rational, construct the 4D homogeneous surface, + // which requires all first derivatives + else + { + Vector val; + + // Store BezierPatch of projective weights, (wx, wy, wz) + // and BezierPatch of weights (w) + BezierPatch projective(ord_u, ord_v); + BezierPatch weights(ord_u, ord_v); + + for(int p = 0; p <= ord_u; ++p) + { + for(int q = 0; q <= ord_v; ++q) + { + weights(p, q)[0] = m_weights(p, q); + + for(int i = 0; i < NDIMS; ++i) + { + projective(p, q)[i] = m_controlPoints(p, q)[i] * m_weights(p, q); + } + } + } + + Point P; + Vector P_u, P_v, P_uv; + + Point W; + Vector W_u, W_v, W_uv; + + projective.evaluate_linear_derivatives(u, v, P, P_u, P_v, P_uv); + weights.evaluate_linear_derivatives(u, v, W, W_u, W_v, W_uv); + + // Store values used in each coordinate computation + double weight_prod = 2 * W_u[0] * W_v[0] - W[0] * W_uv[0]; + double weight_cubed = W[0] * W[0] * W[0]; + for(int i = 0; i < NDIMS; ++i) + { + val[i] = W[0] * W[0] * P_uv[i] - + W[0] * (P_u[i] * W_v[0] + P_v[i] * W_u[0]) + P[i] * weight_prod; + val[i] /= weight_cubed; + } + + return val; + } + } + + /*! + * \brief Computes the mixed second derivative of a Bezier patch at (\a u, \a v) + * + * \param [in] u Parameter value at which to evaluate on the first axis + * \param [in] v Parameter value at which to evaluate on the second axis + * \return vec The vector value of S_uv(u, v) == S_vu(u, v) + * + * \note We typically find the tangent of the patch at \a u and \a v between 0 and 1 + */ + VectorType dvdu(T u, T v) const { return dudv(u, v); } + /*! * \brief Computes the normal vector of a Bezier patch at a particular parameter value (\a u, \a v) * @@ -810,7 +1647,10 @@ class BezierPatch */ VectorType normal(T u, T v) const { - return VectorType::cross_product(du(u, v), dv(u, v)); + Point eval; + Vector Du, Dv; + evaluate_first_derivatives(u, v, eval, Du, Dv); + return VectorType::cross_product(Du, Dv); } /*! @@ -870,7 +1710,7 @@ class BezierPatch double temp_weight = lerp(p2.getWeight(k, q), p2.getWeight(k + 1, q), u); - for(int i = 0; i < 3; ++i) + for(int i = 0; i < NDIMS; ++i) { p2(k, q)[i] = lerp(p2.getWeight(k, q) * p2(k, q)[i], p2.getWeight(k + 1, q) * p2(k + 1, q)[i], @@ -892,7 +1732,7 @@ class BezierPatch { p1(0, q) = m_controlPoints(0, q); - for(int i = 0; i < 3; ++i) + for(int i = 0; i < NDIMS; ++i) { for(int p = 1; p <= ord_u; ++p) { @@ -941,7 +1781,7 @@ class BezierPatch double temp_weight = lerp(p2.getWeight(p, k), p2.getWeight(p, k + 1), v); - for(int i = 0; i < 3; ++i) + for(int i = 0; i < NDIMS; ++i) { p2(p, k)[i] = lerp(p2.getWeight(p, k) * p2(p, k)[i], p2.getWeight(p, k + 1) * p2(p, k + 1)[i], @@ -963,7 +1803,7 @@ class BezierPatch { p1(p, 0) = m_controlPoints(p, 0); - for(int i = 0; i < 3; ++i) + for(int i = 0; i < NDIMS; ++i) { for(int q = 1; q <= ord_v; ++q) { @@ -1056,14 +1896,20 @@ class BezierPatch VectorType::scalar_triple_product(v1, v2, v3), 0.0, tol)) + { return false; + } // Find three points that produce a nonzero normal Vector3D plane_normal = VectorType::cross_product(v1, v2); if(axom::utilities::isNearlyEqual(plane_normal.norm(), 0.0, tol)) + { plane_normal = VectorType::cross_product(v1, v3); + } if(axom::utilities::isNearlyEqual(plane_normal.norm(), 0.0, tol)) + { plane_normal = VectorType::cross_product(v2, v3); + } plane_normal = plane_normal.unitVector(); double sqDist = 0.0; @@ -1096,18 +1942,42 @@ class BezierPatch const int ord_u = getOrder_u(); const int ord_v = getOrder_v(); - if(ord_u <= 0 && ord_v <= 0) return true; - if(ord_u == 1 && ord_v == 0) return true; - if(ord_u == 0 && ord_v == 1) return true; + if(ord_u <= 0 && ord_v <= 0) + { + return true; + } + if(ord_u == 1 && ord_v == 0) + { + return true; + } + if(ord_u == 0 && ord_v == 1) + { + return true; + } // Check if the patch is planar - if(!isPlanar(tol)) return false; + if(!isPlanar(tol)) + { + return false; + } // Check if each bounding curve is linear - if(!isocurve_u(0).isLinear(tol)) return false; - if(!isocurve_v(0).isLinear(tol)) return false; - if(!isocurve_u(1).isLinear(tol)) return false; - if(!isocurve_v(1).isLinear(tol)) return false; + if(!isocurve_u(0).isLinear(tol)) + { + return false; + } + if(!isocurve_v(0).isLinear(tol)) + { + return false; + } + if(!isocurve_u(1).isLinear(tol)) + { + return false; + } + if(!isocurve_v(1).isLinear(tol)) + { + return false; + } return true; } @@ -1188,8 +2058,8 @@ class BezierPatch //------------------------------------------------------------------------------ /// Free functions related to BezierPatch //------------------------------------------------------------------------------ -template -std::ostream& operator<<(std::ostream& os, const BezierPatch& bPatch) +template +std::ostream& operator<<(std::ostream& os, const BezierPatch& bPatch) { bPatch.print(os); return os; diff --git a/src/axom/primal/geometry/BoundingBox.hpp b/src/axom/primal/geometry/BoundingBox.hpp index c6774a24c3..0d739c4dfb 100644 --- a/src/axom/primal/geometry/BoundingBox.hpp +++ b/src/axom/primal/geometry/BoundingBox.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -100,6 +100,17 @@ class BoundingBox AXOM_HOST_DEVICE BoundingBox(const PointType* pts, int n); + /*! + * \brief Constructor. Creates a bounding box containing the + * initializer list of points. + * + * \param [in] pts an initializer list containing points + */ + AXOM_HOST_DEVICE + explicit BoundingBox(std::initializer_list pts) + : BoundingBox {pts.begin(), static_cast(pts.size())} + { } + /*! * \brief Constructor. Creates a bounding box with a given min and max point * The code ensures that the bounds are valid, if shouldFixBounds is true. @@ -129,14 +140,14 @@ class BoundingBox * \return const reference to the min corner of the bounding box. */ AXOM_HOST_DEVICE - const PointType& getMin() const { return m_min; }; + const PointType& getMin() const { return m_min; } /*! * \brief Returns const reference to the max corner of the bounding box. * \return const reference to the max corner of the bounding box. */ AXOM_HOST_DEVICE - const PointType& getMax() const { return m_max; }; + const PointType& getMax() const { return m_max; } /*! * \brief Returns the centroid (midpoint) of the bounding box. @@ -150,7 +161,7 @@ class BoundingBox * \return Vector from min point to max point of bounding box. */ AXOM_HOST_DEVICE - VectorType range() const { return VectorType(m_min, m_max); }; + VectorType range() const { return VectorType(m_min, m_max); } /*! * \brief Updates bounds to include the provided point. @@ -173,7 +184,7 @@ class BoundingBox * \post d >= 1. */ AXOM_HOST_DEVICE - int dimension() const { return NDIMS; }; + int dimension() const { return NDIMS; } /*! * \brief Finds the longest dimension of the bounding box @@ -244,6 +255,7 @@ class BoundingBox * \note We are allowing the other bounding box to have a different coordinate * type. This should work as long as the two Ts are comparable with * operator<(). + * \note If \a otherBB is empty, we return true */ template bool contains(const BoundingBox& otherBB) const; @@ -344,7 +356,7 @@ class BoundingBox AXOM_HOST_DEVICE inline void setMin(const PointType& newMin) { m_min = newMin; - }; + } /*! * \brief Sets the max point for this bounding box instance. @@ -353,7 +365,7 @@ class BoundingBox AXOM_HOST_DEVICE inline void setMax(const PointType& newMax) { m_max = newMax; - }; + } /*! * \brief Ensures that the bounds are valid. @@ -427,7 +439,9 @@ template template bool BoundingBox::contains(const BoundingBox& otherBB) const { - return this->contains(otherBB.getMin()) && this->contains(otherBB.getMax()); + return otherBB.isValid() + ? this->contains(otherBB.getMin()) && this->contains(otherBB.getMax()) + : true; } //------------------------------------------------------------------------------ diff --git a/src/axom/primal/geometry/CurvedPolygon.hpp b/src/axom/primal/geometry/CurvedPolygon.hpp index 04d27d2880..e794e53bfd 100644 --- a/src/axom/primal/geometry/CurvedPolygon.hpp +++ b/src/axom/primal/geometry/CurvedPolygon.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/geometry/Hexahedron.hpp b/src/axom/primal/geometry/Hexahedron.hpp index cceb18f060..c16a55886b 100644 --- a/src/axom/primal/geometry/Hexahedron.hpp +++ b/src/axom/primal/geometry/Hexahedron.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -39,16 +39,16 @@ namespace primal * * \verbatim * - * U +---------+ V +y - * |\ |\ +z - * | \ | \ < ^ - * | T + --------+ W \ | - * Q +---|-----+ R | \| + * S +---------+ R +y + * |\ |\ + * | \ | \ ^ + * | W + --------+ V | + * P +---|-----+ Q | | * \ | \ | -----> +x - * \ | \ | - * \ | \ | - * P +----------+ S - * + * \ | \ | \ + * \ | \ | \ + * T +----------+ U > + * +z * \endverbatim * */ @@ -71,7 +71,7 @@ class Hexahedron /*! * \brief Default constructor. Creates a degenerate hexahedron. */ - AXOM_HOST_DEVICE Hexahedron() { } + Hexahedron() = default; /*! * \brief Creates an hexahedron from the 8 points p,q,r,s,t,u,v,w. @@ -359,7 +359,14 @@ class Hexahedron } private: - PointType m_points[NUM_HEX_VERTS]; + PointType m_points[NUM_HEX_VERTS] {PointType {}, + PointType {}, + PointType {}, + PointType {}, + PointType {}, + PointType {}, + PointType {}, + PointType {}}; }; //------------------------------------------------------------------------------ diff --git a/src/axom/primal/geometry/NumericArray.hpp b/src/axom/primal/geometry/NumericArray.hpp index 011075f8ec..3e40fdb0e4 100644 --- a/src/axom/primal/geometry/NumericArray.hpp +++ b/src/axom/primal/geometry/NumericArray.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -150,21 +150,21 @@ std::ostream& operator<<(std::ostream& os, const NumericArray& arr); template struct NonChar { - typedef T type; /** The non-char type to return */ + using type = T; // The non-char type to return }; template <> struct NonChar { /** A non-char signed type to which we can cast a char for output */ - typedef int type; + using type = int; }; template <> struct NonChar { /** A non-char unsigned type to which we can cast a char for output */ - typedef unsigned int type; + using type = unsigned int; }; /*! diff --git a/src/axom/primal/geometry/Octahedron.hpp b/src/axom/primal/geometry/Octahedron.hpp index 29426ab65a..9916314724 100644 --- a/src/axom/primal/geometry/Octahedron.hpp +++ b/src/axom/primal/geometry/Octahedron.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/geometry/OrientationResult.hpp b/src/axom/primal/geometry/OrientationResult.hpp index c8734b49e3..f1a0a43029 100644 --- a/src/axom/primal/geometry/OrientationResult.hpp +++ b/src/axom/primal/geometry/OrientationResult.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/geometry/OrientedBoundingBox.hpp b/src/axom/primal/geometry/OrientedBoundingBox.hpp index 7c0f82a446..d45e1a0a48 100644 --- a/src/axom/primal/geometry/OrientedBoundingBox.hpp +++ b/src/axom/primal/geometry/OrientedBoundingBox.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -77,11 +77,11 @@ template class OrientedBoundingBox { public: - typedef T CoordType; - typedef Point PointType; - typedef Vector VectorType; - typedef OrientedBoundingBox OrientedBoxType; - typedef BoundingBox BoxType; + using CoordType = T; + using PointType = Point; + using VectorType = Vector; + using OrientedBoxType = OrientedBoundingBox; + using BoxType = BoundingBox; public: /*! @@ -181,10 +181,9 @@ class OrientedBoundingBox /*! * \brief Expands the box so it contains the passed in box. * \param obb [in] OBB to add in - * \note If obb is invalid, makes this invalid too. - * \note Expands the extents so this box contains obb. This loses - * optimality of the box; for a better fit use merge_boxes in - * primal/compute_bounding_box. + * \note If obb is invalid, this is a no-op + * \note Expands the extents so this box contains obb. This loses optimality of the box + * for a better fit use merge_boxes in primal/compute_bounding_box. * \post this->contains(obb) == true */ void addBox(OrientedBoxType obb); @@ -518,19 +517,15 @@ void OrientedBoundingBox::addPoint(Point pt) template void OrientedBoundingBox::addBox(OrientedBoundingBox obb) { - SLIC_CHECK_MSG(obb.isValid(), "Passed in OBB is invalid."); if(!obb.isValid()) { // don't do anything return; } - std::vector> res = obb.vertices(); - int size = static_cast(res.size()); - - for(int i = 0; i < size; i++) + for(const auto& vert : obb.vertices()) { - this->addPoint(res[i]); + this->addPoint(vert); } } diff --git a/src/axom/primal/geometry/Plane.hpp b/src/axom/primal/geometry/Plane.hpp index 755487bedf..15b556a872 100644 --- a/src/axom/primal/geometry/Plane.hpp +++ b/src/axom/primal/geometry/Plane.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/geometry/Point.hpp b/src/axom/primal/geometry/Point.hpp index 9957d00b8d..6c33efec5b 100644 --- a/src/axom/primal/geometry/Point.hpp +++ b/src/axom/primal/geometry/Point.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -250,8 +250,8 @@ class Point /// \name Pre-defined point types /// @{ -typedef Point Point2D; -typedef Point Point3D; +using Point2D = Point; +using Point3D = Point; /// @} diff --git a/src/axom/primal/geometry/Polygon.hpp b/src/axom/primal/geometry/Polygon.hpp index 91f36116dd..b97d173aa2 100644 --- a/src/axom/primal/geometry/Polygon.hpp +++ b/src/axom/primal/geometry/Polygon.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,6 +14,7 @@ #include "axom/core/Array.hpp" #include "axom/primal/geometry/Point.hpp" +#include "axom/primal/geometry/Vector.hpp" #include @@ -142,27 +143,23 @@ class Polygon typename std::enable_if::type area() const { const int nVerts = numVertices(); - double sum = 0.; // check for early return if(nVerts < 3) { - return sum; + return 0.0; } // Add up areas of triangles connecting polygon edges the vertex average + VectorType sum; const auto O = vertexMean(); // 'O' for (local) origin for(int curr = 0, prev = nVerts - 1; curr < nVerts; prev = curr++) { - const auto& P = m_vertices[prev]; - const auto& C = m_vertices[curr]; - // clang-format off - sum += axom::numerics::determinant(P[0] - O[0], C[0] - O[0], - P[1] - O[1], C[1] - O[1]); - // clang-format on + sum += + VectorType::cross_product(m_vertices[prev] - O, m_vertices[curr] - O); } - return axom::utilities::abs(0.5 * sum); + return 0.5 * axom::utilities::abs(sum.norm()); } /** @@ -257,4 +254,9 @@ std::ostream& operator<<(std::ostream& os, const Polygon& poly) } // namespace primal } // namespace axom +/// Overload to format a primal::Polygon using fmt +template +struct axom::fmt::formatter> : ostream_formatter +{ }; + #endif // AXOM_PRIMAL_POLYGON_HPP_ diff --git a/src/axom/primal/geometry/Polyhedron.hpp b/src/axom/primal/geometry/Polyhedron.hpp index 2014463a71..7fb6643971 100644 --- a/src/axom/primal/geometry/Polyhedron.hpp +++ b/src/axom/primal/geometry/Polyhedron.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -52,7 +52,7 @@ class NeighborCollection /*! * \brief Constructs an empty NeighborCollection. */ - AXOM_HOST_DEVICE NeighborCollection() : num_nbrs {0} { } + NeighborCollection() = default; /*! * \brief Clears the set of neighbors. @@ -228,14 +228,16 @@ class NeighborCollection * *
  *
- *          4--------5          +y
- *         /|       /|               +z
- *        / |      / |           ^  >
- *       7--------6  |           | /
- *       |  0-----|--1           |/
+ *          3--------2          +y
+ *         /|       /|
+ *        / |      / |           ^
+ *       7--------6  |           |
+ *       |  0-----|--1           |
  *       | /      | /            -----> +x
- *       |/       |/
- *       3--------2
+ *       |/       |/            /
+ *       4--------5            /
+ *                            <
+ *                           +z
  *
  *       
* @@ -261,7 +263,7 @@ class Polyhedron public: /*! Default constructor for an empty polyhedron */ - AXOM_HOST_DEVICE Polyhedron() : m_num_vertices(0) { } + Polyhedron() = default; /*! Return the number of vertices in the polyhedron */ AXOM_HOST_DEVICE int numVertices() const { return m_num_vertices; } @@ -501,16 +503,18 @@ class Polyhedron } /*! - * \brief Finds the volume of the polyhedron. + * \brief Computes the signed volume of the polyhedron. * - * \return The volume of the polyhedron + * \return The signed volume of the polyhedron * * \note Function is based off moments() in Mike Owen's PolyClipper. * * \pre polyhedron vertex neighbors are defined, and polyhedron is 3D + * + * \sa volume() */ AXOM_HOST_DEVICE - double volume() const + double signedVolume() const { double retVol = 0.0; @@ -519,13 +523,13 @@ class Polyhedron return retVol; } - // Finds the volume of tetrahedrons formed from vertices of the Polyhedron - // faces and an arbitrary origin (the first vertex) + // Computes the signed volume of tetrahedra formed from vertices of the + // Polyhedron faces and an arbitrary origin (the first vertex) else { SLIC_CHECK_MSG( hasNeighbors(), - "Polyhedron::volume() is only valid with vertex neighbors."); + "Polyhedron::signedVolume() is only valid with vertex neighbors."); // faces is an overestimation int faces[MAX_VERTS * MAX_VERTS]; @@ -555,6 +559,13 @@ class Polyhedron return retVol / 6.; } + /*! + * \brief Returns the absolute (unsigned) volume of the polyhedron + * \sa signedVolume() + */ + AXOM_HOST_DEVICE + double volume() const { return axom::utilities::abs(signedVolume()); } + /*! * \brief Simple formatted print of a polyhedron instance * @@ -658,40 +669,48 @@ class Polyhedron } /*! - * \brief Creates a Polyhedron from a given Hexahedron's vertices. - * - * \param [in] hex The hexahedron - * \param [in] checkSign If true (default is false), checks the volume of the - * Polyhedron is positive. If volume is negative, order of some - * vertices will be swapped. - * - * \return A Polyhedron with the Hexahedron's vertices and added - * vertex neighbors - * - * \note The Hexahedron is assumed to have a specific vertex order: - * \verbatim - * - * 7--------6 +y - * /| /| +z - * / | / | ^ > - * 3--------2 | | / - * | 4-----|--5 |/ - * | / | / -----> +x - * |/ |/ - * 0--------1 - * - * \endverbatim - * - * The Polyhedron's vertex neighbors are created assuming this vertex - * ordering. - * - * \note checkSign flag does not guarantee the Polyhedron's vertex order - * will be valid. It is the responsiblity of the caller to pass - * a Hexahedron with a valid vertex order. - */ + * \brief Creates a Polyhedron from a given Hexahedron's vertices. + * + * \param [in] hex The hexahedron + * \param [in] tryFixOrientation If true, checks if the signed volume of the + * Polyhedron is negative and swaps the order of some vertices + * in that shape to try to obtain a nonnegative signed volume. + * Defaults to false. + * + * \return A Polyhedron with the Hexahedron's vertices and added + * vertex neighbors + * + * \note The Hexahedron is assumed to have a specific vertex order: + * \verbatim + * + * 4--------7 +z + * /| /| +y + * / | / | ^ > + * 5--------6 | | / + * | 0-----|--3 |/ + * | / | / -----> +x + * |/ |/ + * 1--------2 + * + * \endverbatim + * + * The Polyhedron's vertex neighbors are created assuming this vertex + * ordering. + * + * \warning tryFixOrientation flag does not guarantee the Polyhedron's vertex order + * will be valid. It is the responsiblity of the caller to pass + * a Hexahedron with a valid vertex order. Otherwise, if the + * Hexahedron has an invalid vertex order, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + */ AXOM_HOST_DEVICE static Polyhedron from_primitive(const Hexahedron& hex, - bool checkSign = false) + bool tryFixOrientation = false) { // Initialize our polyhedron to return Polyhedron poly; @@ -714,10 +733,10 @@ class Polyhedron poly.addNeighbors(6, {2, 7, 5}); poly.addNeighbors(7, {3, 4, 6}); - // Reverses order of vertices 1,3 and 5,7 if volume is negative - if(checkSign) + // Reverses order of vertices 1,3 and 5,7 if signed volume is negative + if(tryFixOrientation) { - if(poly.volume() < 0) + if(poly.signedVolume() < 0) { axom::utilities::swap>(poly[1], poly[3]); axom::utilities::swap>(poly[5], poly[7]); @@ -728,40 +747,50 @@ class Polyhedron } /*! - * \brief Creates a Polyhedron from a given Octahedron's vertices. - * - * \param [in] oct The octahedron - * \param [in] checkSign If true (default is false), checks the volume of the - * Polyhedron is positive. If volume is negative, order of some - * vertices will be swapped. - * - * \return A Polyhedron with the Octahedron's vertices and added - * vertex neighbors - * - * \note The Octahedron is assumed to have a specific vertex order: - * \verbatim - * - * 0 +y - * /\ +z - * 4 --/ \-- 5 ^ > - * \/ \ / | / - * / \ |/ - * 2 -------- 1 -----> +x - * \/ - * 3 - * - * \endverbatim - * - * The Polyhedron's vertex neighbors are created assuming this vertex - * ordering. - * - * \note checkSign flag does not guarantee the Polyhedron's vertex order - * will be valid. It is the responsiblity of the caller to pass - * a Octahedron with a valid vertex order. - */ + * \brief Creates a Polyhedron from a given Octahedron's vertices. + * + * \param [in] oct The octahedron + * \param [in] tryFixOrientation If true, checks if the signed volume of the + * Polyhedron is negative and swaps the order of some vertices + * in that shape to try to obtain a nonnegative signed volume. + * Defaults to false. + * + * \return A Polyhedron with the Octahedron's vertices and added + * vertex neighbors + * + * \note The Octahedron is assumed to have a specific vertex order: + * (view looking down from +z axis): + * + * \verbatim + * + * 4 +z + * /\ +y + * 0 --/ \-- 2 ^ > + * \/ \ / | / + * / \ |/ + * 5 -------- 3 -----> +x + * \/ + * 1 + * + * \endverbatim + * + * The Polyhedron's vertex neighbors are created assuming this vertex + * ordering. + * + * \warning tryFixOrientation flag does not guarantee the Polyhedron's vertex order + * will be valid. It is the responsiblity of the caller to pass + * an Octahedron with a valid vertex order. Otherwise, if the + * Octahedron has an invalid vertex order, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + */ AXOM_HOST_DEVICE static Polyhedron from_primitive(const Octahedron& oct, - bool checkSign = false) + bool tryFixOrientation = false) { // Initialize our polyhedron to return Polyhedron poly; @@ -781,27 +810,12 @@ class Polyhedron poly.addNeighbors(5, {0, 1, 3, 4}); // Reverses order of vertices 1,2 and 4,5 if volume is negative. - // Expanded swap operations for HIP workaround. - if(checkSign) + if(tryFixOrientation) { - double vol = poly.volume(); - if(vol < 0) + if(poly.signedVolume() < 0) { - PointType p2({poly[4][0], poly[4][1], poly[4][2]}); - poly[4][0] = poly[5][0]; - poly[4][1] = poly[5][1]; - poly[4][2] = poly[5][2]; - poly[5][0] = p2[0]; - poly[5][1] = p2[1]; - poly[5][2] = p2[2]; - - PointType p1({poly[1][0], poly[1][1], poly[1][2]}); - poly[1][0] = poly[2][0]; - poly[1][1] = poly[2][1]; - poly[1][2] = poly[2][2]; - poly[2][0] = p1[0]; - poly[2][1] = p1[1]; - poly[2][2] = p1[2]; + axom::utilities::swap(poly[1], poly[2]); + axom::utilities::swap(poly[4], poly[5]); } } @@ -809,41 +823,49 @@ class Polyhedron } /*! - * \brief Creates a Polyhedron from a given Tetrahedron's vertices. - * - * \param [in] tet The tetrahedron - * \param [in] checkSign If true (default is false), checks the volume of the - * Polyhedron is positive. If volume is negative, order of some - * vertices will be swapped. - * - * \return A Polyhedron with the Tetrahedron's vertices and added - * vertex neighbors - * - * \note The Tetrahedron is assumed to have a specific vertex order: - * \verbatim - * - * 3 +y - * / \\ +z - * / \ \ ^ > - * / \ \ | / - * / \ \ |/ - * / \ 2 -----> +x - * / \ / - * /_____________\/ - * 0 1 - * - * \endverbatim - * - * The Polyhedron's vertex neighbors are created assuming this vertex - * ordering. - * - * \note checkSign flag does not guarantee the Polyhedron's vertex order - * will be valid. It is the responsiblity of the caller to pass - * a Tetrahedron with a valid vertex order. - */ + * \brief Creates a Polyhedron from a given Tetrahedron's vertices. + * + * \param [in] tet The tetrahedron + * \param [in] tryFixOrientation If true, checks if the signed volume of the + * Polyhedron is negative and swaps the order of some vertices + * in that shape to try to obtain a nonnegative signed volume. + * Defaults to false. + * + * \return A Polyhedron with the Tetrahedron's vertices and added + * vertex neighbors + * + * \note The Tetrahedron is assumed to have a specific vertex order: + * \verbatim + * + * 3 +z + * / \\ +y + * / \ \ ^ > + * / \ \ | / + * / \ \ |/ + * / \ 2 -----> +x + * / \ / + * /_____________\/ + * 0 1 + * + * \endverbatim + * + * The Polyhedron's vertex neighbors are created assuming this vertex + * ordering. + * + * \warning tryFixOrientation flag does not guarantee the Polyhedron's vertex + * order will be valid. It is the responsiblity of the caller to + * pass a Tetrahedron with a valid vertex order. Otherwise, if the + * Tetrahedron has an invalid vertex order, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + */ AXOM_HOST_DEVICE static Polyhedron from_primitive(const Tetrahedron& tet, - bool checkSign = false) + bool tryFixOrientation = false) { // Initialize our polyhedron to return Polyhedron poly; @@ -858,8 +880,8 @@ class Polyhedron poly.addNeighbors(2, {0, 3, 1}); poly.addNeighbors(3, {0, 1, 2}); - // Reverses order of vertices 1 and 2 if volume is negative - if(checkSign) + // Reverses order of vertices 1 and 2 if signed volume is negative + if(tryFixOrientation) { if(tet.signedVolume() < 0) { @@ -871,9 +893,16 @@ class Polyhedron } private: - int m_num_vertices; - Coords m_vertices; - Neighbors m_neighbors; + int m_num_vertices {0}; + Coords m_vertices {PointType {}, PointType {}, PointType {}, PointType {}, + PointType {}, PointType {}, PointType {}, PointType {}, + PointType {}, PointType {}, PointType {}, PointType {}, + PointType {}, PointType {}, PointType {}, PointType {}, + PointType {}, PointType {}, PointType {}, PointType {}, + PointType {}, PointType {}, PointType {}, PointType {}, + PointType {}, PointType {}, PointType {}, PointType {}, + PointType {}, PointType {}, PointType {}, PointType {}}; + Neighbors m_neighbors {}; }; //------------------------------------------------------------------------------ diff --git a/src/axom/primal/geometry/Quadrilateral.hpp b/src/axom/primal/geometry/Quadrilateral.hpp new file mode 100644 index 0000000000..0463e9f90a --- /dev/null +++ b/src/axom/primal/geometry/Quadrilateral.hpp @@ -0,0 +1,249 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#ifndef AXOM_PRIMAL_QUADRILATERAL_HPP_ +#define AXOM_PRIMAL_QUADRILATERAL_HPP_ + +#include "axom/config.hpp" +#include "axom/core.hpp" +#include "axom/slic/interface/slic.hpp" +#include "axom/fmt.hpp" + +#include "axom/primal/constants.hpp" +#include "axom/primal/geometry/Point.hpp" +#include "axom/primal/geometry/Triangle.hpp" + +#include +#include + +namespace axom +{ +namespace primal +{ +// Forward declare the templated classes and operator functions +template +class Quadrilateral; + +/** + * \brief Overloaded output operator for quadrilaterals + */ +template +std::ostream& operator<<(std::ostream& os, const Quadrilateral& quad); + +/*! + * \accelerated + * \class Quadrilateral + * + * \brief Represents a quadrilateral geometric shape defined by four points. + * + * \accelerated + * + * \tparam T the coordinate type, e.g., double, float, etc. + * \tparam NDIMS the number of dimensions + * + * There are four vertices in the quadrilateral, labeled A through D as the + * constructor's arguments. They are accessible using the square-brackets + * operator, with A being index 0, B index 1, C index 2, and D index 3. + * + * Here's a diagram showing a square with the labeled vertices. + * + * \verbatim + * + * D +---------+ C +y + * | | + * | | ^ + * | | | + * | | | + * A +---------+ B -----> +x + * + * \endverbatim + */ +template +class Quadrilateral +{ +public: + using PointType = Point; + using TriangleType = Triangle; + + static constexpr int DIM = NDIMS; + static constexpr int NUM_QUAD_VERTS = 4; + +public: + /// \brief Default constructor. Creates a degenerate quadrilateral. + Quadrilateral() = default; + + /*! + * \brief Custom Constructor. Creates a quadrilateral from the 4 points A, B, C, and D. + * \param [in] A point corresponding to vertex A of the quadrilateral. + * \param [in] B point corresponding to vertex B of the quadrilateral. + * \param [in] C point corresponding to vertex C of the quadrilateral. + * \param [in] D point corresponding to vertex D of the quadrilateral. + */ + AXOM_HOST_DEVICE + Quadrilateral(const PointType& A, + const PointType& B, + const PointType& C, + const PointType& D) + : m_points {A, B, C, D} + { } + + /*! + * \brief Quadrilateral constructor from an initializer list of Points + * + * \param [in] pts an initializer list containing 4 Points + */ + AXOM_HOST_DEVICE + explicit Quadrilateral(std::initializer_list pts) + { + SLIC_ASSERT(pts.size() == NUM_QUAD_VERTS); + + int i = 0; + for(const auto& pt : pts) + { + m_points[i] = pt; + i++; + } + } + + /*! + * \brief Quadrilateral constructor from an Array of Points. + * + * \param [in] pts An ArrayView containing 4 Points. + */ + AXOM_HOST_DEVICE + explicit Quadrilateral(const axom::ArrayView pts) + { + SLIC_ASSERT(pts.size() == NUM_QUAD_VERTS); + + for(int i = 0; i < NUM_QUAD_VERTS; i++) + { + m_points[i] = pts[i]; + } + } + + /*! + * \brief Index operator to get the i^th vertex + * \param idx The index of the desired vertex + * \pre idx is 0, 1, 2, or 3 + */ + AXOM_HOST_DEVICE + PointType& operator[](int idx) + { + SLIC_ASSERT(idx >= 0 && idx < NUM_QUAD_VERTS); + return m_points[idx]; + } + + /*! + * \brief Index operator to get the i^th vertex + * \param idx The index of the desired vertex + * \pre idx is 0, 1, 2, or 3 + */ + AXOM_HOST_DEVICE + const PointType& operator[](int idx) const + { + SLIC_ASSERT(idx >= 0 && idx < NUM_QUAD_VERTS); + return m_points[idx]; + } + + /// \brief Returns the area of the quadrilateral (2D specialization) + template + AXOM_HOST_DEVICE typename std::enable_if::type area() const + { + return axom::utilities::abs(signedArea()); + } + + /** + * \brief Returns the signed area of a 2D quadrilateral + * + * The area is positive when the vertices are oriented counter-clockwise. + * \note This function is only available for quadrilaterals in 2D since + * signed areas don't make sense for 3D quadrilaterals + * + * Compute the signed area by dividing the quadrilateral into two triangles + * as shown below and summing their signed area + * + * \verbatim + * + * D +----+ C +y + * | /| + * | / | ^ + * | / | | + * |/ | | + * A +----+ B -----> +x + * + * \endverbatim + */ + template + AXOM_HOST_DEVICE typename std::enable_if::type signedArea() const + { + // TODO: Investigate other algorithms for computing the area + // https://artofproblemsolving.com/wiki/index.php/Shoelace_Theorem + const PointType& A = m_points[0]; + const PointType& B = m_points[1]; + const PointType& C = m_points[2]; + const PointType& D = m_points[3]; + + // clang-format off + return TriangleType{A, B, C}.signedArea() + + TriangleType{C, D, A}.signedArea(); + // clang-format on + } + + /*! + * \brief Returns the volume of the quadrilateral (synonym for area()) + * \sa area() + */ + AXOM_HOST_DEVICE double volume() const { return area(); } + + /*! + * \brief Returns the signed volume of a 2D quadrilateral (synonym for signedArea()) + * \sa signedArea() + */ + template + AXOM_HOST_DEVICE typename std::enable_if::type signedVolume() const + { + return signedArea(); + } + + /*! + * \brief Simple formatted print of a quadrilateral instance + * \param os The output stream to write to + * \return A reference to the modified ostream + */ + std::ostream& print(std::ostream& os) const + { + os << "{" << m_points[0] << " " << m_points[1] << " " << m_points[2] << " " + << m_points[3] << "}"; + + return os; + } + +private: + PointType m_points[NUM_QUAD_VERTS] {PointType {}, + PointType {}, + PointType {}, + PointType {}}; +}; + +//------------------------------------------------------------------------------ +/// Free functions implementing Quadrilateral's operators +//------------------------------------------------------------------------------ +template +std::ostream& operator<<(std::ostream& os, const Quadrilateral& quad) +{ + quad.print(os); + return os; +} + +} // namespace primal +} // namespace axom + +/// Overload to format a primal::Quadrilateral using fmt +template +struct axom::fmt::formatter> + : ostream_formatter +{ }; + +#endif // AXOM_PRIMAL_QUADRILATERAL_HPP_ diff --git a/src/axom/primal/geometry/Ray.hpp b/src/axom/primal/geometry/Ray.hpp index f5f0f1f732..558d7cc504 100644 --- a/src/axom/primal/geometry/Ray.hpp +++ b/src/axom/primal/geometry/Ray.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -162,4 +162,9 @@ std::ostream& operator<<(std::ostream& os, const Ray& ray) } // namespace primal } // namespace axom +/// Overload to format a primal::Ray using fmt +template +struct axom::fmt::formatter> : ostream_formatter +{ }; + #endif // AXOM_PRIMAL_RAY_HPP_ diff --git a/src/axom/primal/geometry/Segment.hpp b/src/axom/primal/geometry/Segment.hpp index b603a13922..9c787a2889 100644 --- a/src/axom/primal/geometry/Segment.hpp +++ b/src/axom/primal/geometry/Segment.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/geometry/Sphere.hpp b/src/axom/primal/geometry/Sphere.hpp index bcdbef2c4f..db8d14ed9c 100644 --- a/src/axom/primal/geometry/Sphere.hpp +++ b/src/axom/primal/geometry/Sphere.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/geometry/Tetrahedron.hpp b/src/axom/primal/geometry/Tetrahedron.hpp index d3f8453cd3..2069e32f2f 100644 --- a/src/axom/primal/geometry/Tetrahedron.hpp +++ b/src/axom/primal/geometry/Tetrahedron.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -259,6 +259,20 @@ class Tetrahedron AXOM_HOST_DEVICE double volume() const { return axom::utilities::abs(signedVolume()); } + /*! + * \brief Swaps the order of vertices if the signed volume of the + * tetrahedron is negative. Signed volume will become positive. + * \sa signedVolume() + */ + AXOM_HOST_DEVICE + void checkAndFixOrientation() + { + if(signedVolume() < 0) + { + axom::utilities::swap(m_points[1], m_points[2]); + } + } + /** * \brief Returns the circumsphere (circumscribing sphere) of the tetrahedron * diff --git a/src/axom/primal/geometry/Triangle.hpp b/src/axom/primal/geometry/Triangle.hpp index 2905f07bd0..010999efb2 100644 --- a/src/axom/primal/geometry/Triangle.hpp +++ b/src/axom/primal/geometry/Triangle.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/geometry/Vector.hpp b/src/axom/primal/geometry/Vector.hpp index 50f1042ccf..9c00380b7f 100644 --- a/src/axom/primal/geometry/Vector.hpp +++ b/src/axom/primal/geometry/Vector.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -126,7 +126,7 @@ AXOM_HOST_DEVICE Vector operator*(const T scalar, /*! * \brief Scalar division of vector; Scalar on rhs. * \param [in] vec vector instance - * \param [in]n scalar user-supplied scalar. + * \param [in] scalar user-supplied scalar. * \return C resulting vector, \f$ \ni: C_i = vec_i / scalar, \forall i\f$ * \pre scalar != 0.0 */ @@ -422,8 +422,8 @@ class Vector /// \name Pre-defined Vector types /// @{ -typedef Vector Vector2D; -typedef Vector Vector3D; +using Vector2D = Vector; +using Vector3D = Vector; /// @} diff --git a/src/axom/primal/operators/clip.hpp b/src/axom/primal/operators/clip.hpp index b80a084081..3585015afc 100644 --- a/src/axom/primal/operators/clip.hpp +++ b/src/axom/primal/operators/clip.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -50,16 +50,13 @@ Polygon clip(const Triangle& tri, const BoundingBox& bbox) using PolygonType = Polygon; // Use two polygons with pointers for 'back-buffer'-like swapping - const int MAX_VERTS = 6; + constexpr int MAX_VERTS = 6; PolygonType poly[2] = {PolygonType(MAX_VERTS), PolygonType(MAX_VERTS)}; PolygonType* currentPoly = &poly[0]; PolygonType* prevPoly = &poly[1]; // First check if the triangle is contained in the bbox, if not we are empty - BoundingBoxType triBox; - triBox.addPoint(tri[0]); - triBox.addPoint(tri[1]); - triBox.addPoint(tri[2]); + BoundingBoxType triBox {tri[0], tri[1], tri[2]}; if(!bbox.intersectsWith(triBox)) { @@ -82,14 +79,13 @@ Polygon clip(const Triangle& tri, const BoundingBox& bbox) { // Optimization note: we should be able to save some work based on // the clipping plane and the triangle's bounding box - - if(triBox.getMax()[dim] > bbox.getMin()[dim]) + if(triBox.getMin()[dim] < bbox.getMin()[dim]) { axom::utilities::swap(prevPoly, currentPoly); detail::clipAxisPlane(prevPoly, currentPoly, 2 * dim + 0, bbox.getMin()[dim]); } - if(triBox.getMin()[dim] < bbox.getMax()[dim]) + if(triBox.getMax()[dim] > bbox.getMax()[dim]) { axom::utilities::swap(prevPoly, currentPoly); detail::clipAxisPlane(prevPoly, currentPoly, 2 * dim + 1, bbox.getMax()[dim]); @@ -117,26 +113,33 @@ Polygon clip(const Triangle& tri, const BoundingBox& bbox) * \param [in] hex The hexahedron to clip * \param [in] tet The tetrahedron to clip against * \param [in] eps The epsilon value - * \param [in] checkSign If true (default is false), checks the volume of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return A polyhedron of the hexahedron clipped against the tetrahedron. * * \note Function is based off clipPolyhedron() in Mike Owen's PolyClipper. * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned Polyhedron + * will have a non-positive and/or unexpected volume. * */ template AXOM_HOST_DEVICE Polyhedron clip(const Hexahedron& hex, const Tetrahedron& tet, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return detail::clipHexahedron(hex, tet, eps, checkSign); + return detail::clipHexahedron(hex, tet, eps, tryFixOrientation); } /*! @@ -157,26 +160,33 @@ AXOM_HOST_DEVICE Polyhedron clip(const Hexahedron& hex, * \param [in] tet The tetrahedron to clip against * \param [in] hex The hexahedron to clip * \param [in] eps The epsilon value - * \param [in] checkSign If true (default is false), checks the volume of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return A polyhedron of the hexahedron clipped against the tetrahedron. * * \note Function is based off clipPolyhedron() in Mike Owen's PolyClipper. * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned Polyhedron + * will have a non-positive and/or unexpected volume. * */ template AXOM_HOST_DEVICE Polyhedron clip(const Tetrahedron& tet, const Hexahedron& hex, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return clip(hex, tet, eps, checkSign); + return clip(hex, tet, eps, tryFixOrientation); } /*! @@ -197,26 +207,33 @@ AXOM_HOST_DEVICE Polyhedron clip(const Tetrahedron& tet, * \param [in] oct The octahedron to clip * \param [in] tet The tetrahedron to clip against * \param [in] eps The epsilon value - * \param [in] checkSign If true (default is false), checks the volume of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return A polyhedron of the octahedron clipped against the tetrahedron. * * \note Function is based off clipPolyhedron() in Mike Owen's PolyClipper. * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned Polyhedron + * will have a non-positive and/or unexpected volume. * */ template AXOM_HOST_DEVICE Polyhedron clip(const Octahedron& oct, const Tetrahedron& tet, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return detail::clipOctahedron(oct, tet, eps, checkSign); + return detail::clipOctahedron(oct, tet, eps, tryFixOrientation); } /*! @@ -238,26 +255,33 @@ AXOM_HOST_DEVICE Polyhedron clip(const Octahedron& oct, * \param [in] oct The octahedron to clip * \param [in] tet The tetrahedron to clip against * \param [in] eps The epsilon value - * \param [in] checkSign If true (default is false), checks the volume of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return A polyhedron of the octahedron clipped against the tetrahedron. * * \note Function is based off clipPolyhedron() in Mike Owen's PolyClipper. * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned Polyhedron + * will have a non-positive and/or unexpected volume. * */ template AXOM_HOST_DEVICE Polyhedron clip(const Tetrahedron& tet, const Octahedron& oct, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return clip(oct, tet, eps, checkSign); + return clip(oct, tet, eps, tryFixOrientation); } /*! @@ -277,26 +301,118 @@ AXOM_HOST_DEVICE Polyhedron clip(const Tetrahedron& tet, * \param [in] tet1 The tetrahedron to clip * \param [in] tet2 The tetrahedron to clip against * \param [in] eps The epsilon value - * \param [in] checkSign If true (default is false), checks the volume of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return A polyhedron of the tetrahedron clipped against * the other tetrahedron. * * \note Function is based off clipPolyhedron() in Mike Owen's PolyClipper. * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned Polyhedron + * will have a non-positive and/or unexpected volume. + * */ template AXOM_HOST_DEVICE Polyhedron clip(const Tetrahedron& tet1, const Tetrahedron& tet2, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) +{ + return detail::clipTetrahedron(tet1, tet2, eps, tryFixOrientation); +} + +/*! + * \brief Clips a 3D tetrahedron against the half-space defined by a plane + * and returns the resulting polyhedron + * + * This function clips a tetrahedron against the half-space defined by a + * plane. This involves finding new vertices at the intersection of the + * polyhedron edges and the plane, removing vertices from the polyhedron + * that are below the plane, and redefining the neighbors for each vertex + * (a vertex is a neighbor of another vertex if there is an edge between + * them). + * + * \param [in] tet The tetrahedron to clip + * \param [in] plane The plane defining the half-space used to clip the tetrahedron + * \param [in] eps The tolerance for plane point orientation + * \param [in] tryFixOrientation If true and the tetrahedron has a negative + * signed volume, swaps the order of some vertices in the + * tetrathedron to try to obtain a nonnegative signed volume. + * Defaults to false. + * + * \return The polyhedron obtained from clipping a tetrahedron against + * the half-space defined by a plane. + * + * \note Function is based off clipPolyhedron() in Mike Owen's PolyClipper. + * + * \warning tryFixOrientation flag does not guarantee the tetrahedron's vertex + * order will be valid. It is the responsiblity of the caller to pass + * a tetrahedron with a valid vertex order. Otherwise, the returned + * polyhedron will have a non-positive and/or unexpected volume. + * + * \warning If the tryFixOrientation flag is false and the tetrahedron has + * a negative signed volume, the returned polyhedron will have a + * non-positive and/or unexpected volume. + */ +template +AXOM_HOST_DEVICE Polyhedron clip(const Tetrahedron& tet, + const Plane& plane, + double eps = 1.e-10, + bool tryFixOrientation = false) +{ + return detail::clipTetrahedron(tet, plane, eps, tryFixOrientation); +} + +/*! + * \brief Clips a 3D tetrahedron against the half-space defined by a plane + * and returns the resulting polyhedron + * + * This function clips a tetrahedron against the half-space defined by a + * plane. This involves finding new vertices at the intersection of the + * polyhedron edges and the plane, removing vertices from the polyhedron + * that are below the plane, and redefining the neighbors for each vertex + * (a vertex is a neighbor of another vertex if there is an edge between + * them). + * + * \param [in] plane The plane defining the half-space used to clip the tetrahedron + * \param [in] tet The tetrahedron to clip + * \param [in] eps The tolerance for plane point orientation + * \param [in] tryFixOrientation If true and the tetrahedron has a negative + * signed volume, swaps the order of some vertices in the + * tetrathedron to try to obtain a nonnegative signed volume. + * Defaults to false. + * + * \return The polyhedron obtained from clipping a tetrahedron against + * the half-space defined by a plane. + * + * \note Function is based off clipPolyhedron() in Mike Owen's PolyClipper. + * + * \warning tryFixOrientation flag does not guarantee the tetrahedron's vertex + * order will be valid. It is the responsiblity of the caller to pass + * a tetrahedron with a valid vertex order. Otherwise, the returned + * polyhedron will have a non-positive and/or unexpected volume. + * + * \warning If the tryFixOrientation flag is false and the tetrahedron has + * a negative signed volume, the returned polyhedron will have a + * non-positive and/or unexpected volume. + */ +template +AXOM_HOST_DEVICE Polyhedron clip(const Plane& plane, + const Tetrahedron& tet, + double eps = 1.e-10, + bool tryFixOrientation = false) { - return detail::clipTetrahedron(tet1, tet2, eps, checkSign); + return clip(tet, plane, eps, tryFixOrientation); } } // namespace primal diff --git a/src/axom/primal/operators/closest_point.hpp b/src/axom/primal/operators/closest_point.hpp index 71a8542bd2..df9b55c28a 100644 --- a/src/axom/primal/operators/closest_point.hpp +++ b/src/axom/primal/operators/closest_point.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/compute_bounding_box.hpp b/src/axom/primal/operators/compute_bounding_box.hpp index dddbaa1620..edbf1ee3de 100644 --- a/src/axom/primal/operators/compute_bounding_box.hpp +++ b/src/axom/primal/operators/compute_bounding_box.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -21,6 +21,8 @@ #include "axom/primal/geometry/Hexahedron.hpp" #include "axom/primal/geometry/Point.hpp" #include "axom/primal/geometry/Triangle.hpp" +#include "axom/primal/geometry/Quadrilateral.hpp" +#include "axom/primal/geometry/Polygon.hpp" #include "axom/primal/geometry/Vector.hpp" #include "axom/primal/geometry/OrientedBoundingBox.hpp" @@ -113,12 +115,19 @@ template AXOM_HOST_DEVICE BoundingBox compute_bounding_box( const Triangle &tri) { - BoundingBox res(tri[0]); - for(int i = 1; i < 3; i++) - { - res.addPoint(tri[i]); - } - return res; + return BoundingBox {tri[0], tri[1], tri[2]}; +} + +/*! + * \brief Creates a bounding box around a Quadrilateral + * \accelerated + * \param [in] quad The Quadrilateral + */ +template +AXOM_HOST_DEVICE BoundingBox compute_bounding_box( + const Quadrilateral &quad) +{ + return BoundingBox {quad[0], quad[1], quad[2], quad[3]}; } /*! @@ -130,12 +139,7 @@ template AXOM_HOST_DEVICE BoundingBox compute_bounding_box( const Octahedron &oct) { - BoundingBox res(oct[0]); - for(int i = 1; i < 6; i++) - { - res.addPoint(oct[i]); - } - return res; + return BoundingBox {oct[0], oct[1], oct[2], oct[3], oct[4], oct[5]}; } /*! @@ -147,12 +151,14 @@ template AXOM_HOST_DEVICE BoundingBox compute_bounding_box( const Hexahedron &hex) { - BoundingBox res(hex[0]); - for(int i = 1; i < 8; i++) - { - res.addPoint(hex[i]); - } - return res; + return BoundingBox {hex[0], + hex[1], + hex[2], + hex[3], + hex[4], + hex[5], + hex[6], + hex[7]}; } /*! @@ -164,8 +170,8 @@ template AXOM_HOST_DEVICE BoundingBox compute_bounding_box( const Polyhedron &poly) { - BoundingBox res(poly[0]); - for(int i = 1; i < poly.numVertices(); i++) + BoundingBox res; + for(int i = 0; i < poly.numVertices(); i++) { res.addPoint(poly[i]); } @@ -175,16 +181,28 @@ AXOM_HOST_DEVICE BoundingBox compute_bounding_box( /*! * \brief Creates a bounding box around a Tetrahedron * - * \param [in] tet The Tetrahedron + * \param [in] tet The tetrahedron */ template AXOM_HOST_DEVICE BoundingBox compute_bounding_box( const Tetrahedron &tet) { - BoundingBox res(tet[0]); - for(int i = 1; i < 4; i++) + return BoundingBox {tet[0], tet[1], tet[2], tet[3]}; +} + +/*! + * \brief Creates a bounding box around a Polygon + * + * \param [in] poly The polygon + */ +template +AXOM_HOST_DEVICE BoundingBox compute_bounding_box( + const Polygon &poly) +{ + BoundingBox res; + for(int i = 0; i < poly.numVertices(); ++i) { - res.addPoint(tet[i]); + res.addPoint(poly[i]); } return res; } diff --git a/src/axom/primal/operators/compute_moments.hpp b/src/axom/primal/operators/compute_moments.hpp index 18590661c7..cb8eb3e18c 100644 --- a/src/axom/primal/operators/compute_moments.hpp +++ b/src/axom/primal/operators/compute_moments.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/detail/clip_impl.hpp b/src/axom/primal/operators/detail/clip_impl.hpp index d239028435..ecec7b3024 100644 --- a/src/axom/primal/operators/detail/clip_impl.hpp +++ b/src/axom/primal/operators/detail/clip_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -68,7 +68,7 @@ int classifyPointAxisPlane(const Point& pt, // Note: we are exploiting the fact that the planes are axis aligned // So the dot product is +/- the given coordinate. // In general, we would need to call distance(pt, plane) here - T dist = isEven(index) ? val - pt[index / 2] : pt[index / 2] - val; + const T dist = isEven(index) ? val - pt[index / 2] : pt[index / 2] - val; if(dist > eps) { @@ -106,10 +106,11 @@ Point findIntersectionPoint(const Point& a, // * pt = a + t * (b-a) // * pt[ index/2] == val - T t = (val - a[index / 2]) / (b[index / 2] - a[index / 2]); + const int coord = index / 2; + const T t = (val - a[coord]) / (b[coord] - a[coord]); SLIC_ASSERT(0. <= t && t <= 1.); - PointType ret = PointType(a.array() + t * (b.array() - a.array())); + const auto ret = PointType::lerp(a, b, t); SLIC_ASSERT(classifyPointAxisPlane(ret, index, val) == ON_BOUNDARY); return ret; @@ -142,7 +143,7 @@ void clipAxisPlane(const Polygon* prevPoly, using PointType = Point; currentPoly->clear(); - int numVerts = prevPoly->numVertices(); + const int numVerts = prevPoly->numVertices(); if(numVerts == 0) { @@ -156,7 +157,7 @@ void clipAxisPlane(const Polygon* prevPoly, for(int i = 0; i < numVerts; ++i) { const PointType* b = &(*prevPoly)[i]; - int bSide = classifyPointAxisPlane(*b, index, val); + const int bSide = classifyPointAxisPlane(*b, index, val); switch(bSide) { @@ -327,7 +328,7 @@ AXOM_HOST_DEVICE void poly_clip_fix_nbrs(Polyhedron& poly, } else { - int offset; + int offset {}; for(int oi = 0; oi < old_nbrs.getNumNeighbors(inext); oi++) { if(old_nbrs[inext][oi] == iprev) @@ -400,83 +401,90 @@ AXOM_HOST_DEVICE void poly_clip_reindex(Polyhedron& poly, } /*! - * \brief Finds the clipped intersection Polyhedron between Polyhedron - * poly and an array of Planes. - * - * \param [in] poly The polyhedron - * \param [in] planes The array of planes - * \param [in] eps The tolerance for plane point orientation. - * - * \return The Polyhedron formed from clipping the polyhedron with a set of planes. + * \brief Clips a polyhedron against a half-space defined by a plane * + * \param [inout] poly The polyhedron to clip + * \param [in] plane The plane defining the half-space used to clip the polyhedron + * \param [in] eps The tolerance for plane point orientation */ template -AXOM_HOST_DEVICE Polyhedron clipPolyhedron( - Polyhedron& poly, - axom::ArrayView> planes, - double eps) +AXOM_HOST_DEVICE void clipPolyhedron(Polyhedron& poly, + const Plane& plane, + double eps) { - using PointType = Point; using BoxType = BoundingBox; - using PlaneType = Plane; - - //Bounding Box of Polyhedron - BoxType polyBox(&poly[0], poly.numVertices()); - //Clip Polyhedron by each plane - for(PlaneType plane : planes) + // Check that plane intersects Polyhedron + if(intersect(plane, BoxType(&poly[0], poly.numVertices()), true, eps)) { - // Check that plane intersects Polyhedron - if(intersect(plane, polyBox, true, eps)) - { - int numVerts = poly.numVertices(); + int numVerts = poly.numVertices(); - // Each bit value indicates if that Polyhedron vertex is formed from - // Polyhedron clipping with a plane. - unsigned int clipped = 0; + // Each bit value indicates if that Polyhedron vertex is formed from + // Polyhedron clipping with a plane. + unsigned int clipped = 0; - // Clip polyhedron against current plane, generating extra vertices - // where edges meet the plane. - poly_clip_vertices(poly, plane, eps, clipped); + // Clip polyhedron against current plane, generating extra vertices + // where edges meet the plane. + poly_clip_vertices(poly, plane, eps, clipped); - // Adjust connectivity to link up newly-generated vertices. - poly_clip_fix_nbrs(poly, plane, numVerts, eps, clipped); + // Adjust connectivity to link up newly-generated vertices. + poly_clip_fix_nbrs(poly, plane, numVerts, eps, clipped); - // Reindex polyhedron connectivity by removing vertices on the negative - // side of the plane. - poly_clip_reindex(poly, clipped); + // Reindex polyhedron connectivity by removing vertices on the negative + // side of the plane. + poly_clip_reindex(poly, clipped); + } - // Generate new bounding box for polyhedron - polyBox = BoxType(); + // If entire polyhedron is below a plane (points can be on the plane), + // it is completely removed. + else + { + bool completeClip = true; - for(int i = 0; i < poly.numVertices(); i++) + for(int i = 0; i < poly.numVertices(); i++) + { + if(plane.getOrientation(poly[i], eps) == ON_POSITIVE_SIDE) { - polyBox.addPoint(PointType(poly[i])); + completeClip = false; + break; } } - // If entire polyhedron is below a plane (points can be on the plane), it is completely removed. - else + if(completeClip) { - bool completeClip = true; - for(int i = 0; i < poly.numVertices(); i++) - { - if(plane.getOrientation(poly[i], eps) == ON_POSITIVE_SIDE) - { - completeClip = false; - break; - } - } + poly.clear(); + } + } - if(completeClip) - { - poly.clear(); - return poly; - } + return; +} + +/*! + * \brief Clips a polyhedron against an array of planes + * + * \param [inout] poly The polyhedron to clip + * \param [in] planes The array of planes + * \param [in] eps The tolerance for plane point orientation + */ +template +AXOM_HOST_DEVICE void clipPolyhedron(Polyhedron& poly, + axom::ArrayView> planes, + double eps) +{ + using PlaneType = Plane; + + // Clip Polyhedron by each plane + for(const PlaneType& plane : planes) + { + clipPolyhedron(poly, plane, eps); + + if(poly.numVertices() == 0) + { + return; } } - return poly; + return; } /*! @@ -486,7 +494,7 @@ AXOM_HOST_DEVICE Polyhedron clipPolyhedron( * \param [in] hex The hexahedron * \param [in] tet The tetrahedron * \param [in] eps The tolerance for plane point orientation. - * \param [in] checkSign Checks the volumes of the shapes are positive. + * \param [in] tryFixOrientation Check if the signed volume of each shape is positive. * \return The Polyhedron formed from clipping the hexahedron with a tetrahedron. * */ @@ -495,13 +503,13 @@ AXOM_HOST_DEVICE Polyhedron clipHexahedron( const Hexahedron& hex, const Tetrahedron& tet, double eps, - bool checkSign) + bool tryFixOrientation) { using PlaneType = Plane; using PolyhedronType = Polyhedron; // Initialize our polyhedron to return - PolyhedronType poly = PolyhedronType::from_primitive(hex, checkSign); + PolyhedronType poly = PolyhedronType::from_primitive(hex, tryFixOrientation); // Initialize planes from tetrahedron vertices // (Ordering here matters to get the correct winding) @@ -510,10 +518,11 @@ AXOM_HOST_DEVICE Polyhedron clipHexahedron( make_plane(tet[0], tet[3], tet[1]), make_plane(tet[0], tet[1], tet[2])}; - // Adjusts planes in case tetrahedron volume is negative - if(checkSign) + // Adjusts planes in case tetrahedron signed volume is negative + if(tryFixOrientation) { - PolyhedronType tet_poly = PolyhedronType::from_primitive(tet, checkSign); + PolyhedronType tet_poly = + PolyhedronType::from_primitive(tet, tryFixOrientation); planes[0] = make_plane(tet_poly[1], tet_poly[3], tet_poly[2]); planes[1] = make_plane(tet_poly[0], tet_poly[2], tet_poly[3]); planes[2] = make_plane(tet_poly[0], tet_poly[3], tet_poly[1]); @@ -523,7 +532,8 @@ AXOM_HOST_DEVICE Polyhedron clipHexahedron( axom::StackArray planeSize = {4}; axom::ArrayView planesView(planes, planeSize); - return clipPolyhedron(poly, planesView, eps); + clipPolyhedron(poly, planesView, eps); + return poly; } /*! @@ -533,7 +543,7 @@ AXOM_HOST_DEVICE Polyhedron clipHexahedron( * \param [in] oct The octahedron * \param [in] tet The tetrahedron * \param [in] eps The tolerance for plane point orientation. - * \param [in] checkSign Checks the volumes of the shapes are positive. + * \param [in] tryFixOrientation Check if the signed volume of each shape is positive. * \return The Polyhedron formed from clipping the octahedron with a tetrahedron. * */ @@ -542,13 +552,13 @@ AXOM_HOST_DEVICE Polyhedron clipOctahedron( const Octahedron& oct, const Tetrahedron& tet, double eps, - bool checkSign) + bool tryFixOrientation) { using PlaneType = Plane; using PolyhedronType = Polyhedron; // Initialize our polyhedron to return - PolyhedronType poly = PolyhedronType::from_primitive(oct, checkSign); + PolyhedronType poly = PolyhedronType::from_primitive(oct, tryFixOrientation); // Initialize planes from tetrahedron vertices // (Ordering here matters to get the correct winding) @@ -557,10 +567,11 @@ AXOM_HOST_DEVICE Polyhedron clipOctahedron( make_plane(tet[0], tet[3], tet[1]), make_plane(tet[0], tet[1], tet[2])}; - // Adjusts planes in case tetrahedron volume is negative - if(checkSign) + // Adjusts planes in case tetrahedron signed volume is negative + if(tryFixOrientation) { - PolyhedronType tet_poly = PolyhedronType::from_primitive(tet, checkSign); + PolyhedronType tet_poly = + PolyhedronType::from_primitive(tet, tryFixOrientation); planes[0] = make_plane(tet_poly[1], tet_poly[3], tet_poly[2]); planes[1] = make_plane(tet_poly[0], tet_poly[2], tet_poly[3]); planes[2] = make_plane(tet_poly[0], tet_poly[3], tet_poly[1]); @@ -570,7 +581,8 @@ AXOM_HOST_DEVICE Polyhedron clipOctahedron( axom::StackArray planeSize = {4}; axom::ArrayView planesView(planes, planeSize); - return clipPolyhedron(poly, planesView, eps); + clipPolyhedron(poly, planesView, eps); + return poly; } /*! @@ -580,7 +592,7 @@ AXOM_HOST_DEVICE Polyhedron clipOctahedron( * \param [in] tet1 The tetrahedron to clip * \param [in] tet2 The tetrahedron to clip against * \param [in] eps The tolerance for plane point orientation. - * \param [in] checkSign Checks the volumes of the shapes are positive. + * \param [in] tryFixOrientation Check if the signed volume of each shape is positive. * \return The Polyhedron formed from clipping the tetrahedron with a tetrahedron. * */ @@ -589,13 +601,13 @@ AXOM_HOST_DEVICE Polyhedron clipTetrahedron( const Tetrahedron& tet1, const Tetrahedron& tet2, double eps, - bool checkSign) + bool tryFixOrientation) { using PlaneType = Plane; using PolyhedronType = Polyhedron; // Initialize our polyhedron to return - PolyhedronType poly = PolyhedronType::from_primitive(tet1, checkSign); + PolyhedronType poly = PolyhedronType::from_primitive(tet1, tryFixOrientation); // Initialize planes from tetrahedron vertices // (Ordering here matters to get the correct winding) @@ -604,10 +616,11 @@ AXOM_HOST_DEVICE Polyhedron clipTetrahedron( make_plane(tet2[0], tet2[3], tet2[1]), make_plane(tet2[0], tet2[1], tet2[2])}; - // Adjusts planes in case tetrahedron volume is negative - if(checkSign) + // Adjusts planes in case tetrahedron signed volume is negative + if(tryFixOrientation) { - PolyhedronType tet_poly = PolyhedronType::from_primitive(tet2, checkSign); + PolyhedronType tet_poly = + PolyhedronType::from_primitive(tet2, tryFixOrientation); planes[0] = make_plane(tet_poly[1], tet_poly[3], tet_poly[2]); planes[1] = make_plane(tet_poly[0], tet_poly[2], tet_poly[3]); planes[2] = make_plane(tet_poly[0], tet_poly[3], tet_poly[1]); @@ -617,7 +630,45 @@ AXOM_HOST_DEVICE Polyhedron clipTetrahedron( axom::StackArray planeSize = {4}; axom::ArrayView planesView(planes, planeSize); - return clipPolyhedron(poly, planesView, eps); + clipPolyhedron(poly, planesView, eps); + return poly; +} + +/*! + * \brief Clips a tetrahedron against the half-space defined by a plane + * and returns the resulting polyhedron + * + * \param [in] tet The tetrahedron to clip + * \param [in] plane The plane defining the half-space used to clip the tetrahedron + * \param [in] eps The tolerance for plane point orientation + * \param [in] tryFixOrientation If true and the tetrahedron has a negative + * signed volume, swaps the order of some vertices in the + * tetrathedron to try to obtain a nonnegative signed volume. + * Defaults to false. + * + * \return The polyhedron obtained from clipping a tetrahedron against + * the half-space defined a plane + * + * \warning tryFixOrientation flag does not guarantee the tetrahedron's vertex + * order will be valid. It is the responsiblity of the caller to pass + * a tetrahedron with a valid vertex order. Otherwise, the returned + * polyhedron will have a non-positive and/or unexpected volume. + * + * \warning If the tryFixOrientation flag is false and the tetrahedron has + * a negative signed volume, the returned polyhedron will have a + * non-positive and/or unexpected volume. + */ +template +AXOM_HOST_DEVICE Polyhedron clipTetrahedron( + const Tetrahedron& tet, + const Plane& plane, + double eps, + bool tryFixOrientation) +{ + using PolyhedronType = Polyhedron; + PolyhedronType poly = PolyhedronType::from_primitive(tet, tryFixOrientation); + clipPolyhedron(poly, plane, eps); + return poly; } } // namespace detail diff --git a/src/axom/primal/operators/detail/compute_moments_impl.hpp b/src/axom/primal/operators/detail/compute_moments_impl.hpp index 34e407f028..b22add439b 100644 --- a/src/axom/primal/operators/detail/compute_moments_impl.hpp +++ b/src/axom/primal/operators/detail/compute_moments_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/detail/evaluate_integral_impl.hpp b/src/axom/primal/operators/detail/evaluate_integral_impl.hpp index ca422944ec..cc5f170966 100644 --- a/src/axom/primal/operators/detail/evaluate_integral_impl.hpp +++ b/src/axom/primal/operators/detail/evaluate_integral_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/detail/fuzzy_comparators.hpp b/src/axom/primal/operators/detail/fuzzy_comparators.hpp new file mode 100644 index 0000000000..d68d4629ce --- /dev/null +++ b/src/axom/primal/operators/detail/fuzzy_comparators.hpp @@ -0,0 +1,96 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +/*! + * \file fuzzy_comparators.hpp + * + * This file provides helper functions for fuzzy comparisons + */ + +#ifndef AXOM_PRIMAL_FUZZY_COMPARATORS_HPP_ +#define AXOM_PRIMAL_FUZZY_COMPARATORS_HPP_ + +#include "axom/core/Macros.hpp" +#include "axom/core/utilities/Utilities.hpp" + +namespace axom +{ +namespace primal +{ +namespace detail +{ +/// \brief Checks if x > y, within a specified tolerance. +AXOM_HOST_DEVICE +inline bool isGt(double x, double y, double EPS = 1e-12) +{ + return ((x > y) && !(axom::utilities::isNearlyEqual(x, y, EPS))); +} + +/// \brief Checks if x < y, within a specified tolerance. +AXOM_HOST_DEVICE +inline bool isLt(double x, double y, double EPS = 1e-12) +{ + return ((x < y) && !(axom::utilities::isNearlyEqual(x, y, EPS))); +} + +/// \brief Checks if x <= y, within a specified tolerance. +AXOM_HOST_DEVICE +inline bool isLeq(double x, double y, double EPS = 1e-12) +{ + return !(isGt(x, y, EPS)); +} + +/// \brief Checks if x >= y, within a specified tolerance. +AXOM_HOST_DEVICE +inline bool isGeq(double x, double y, double EPS = 1e-12) +{ + return !(isLt(x, y, EPS)); +} + +/*! + * \brief Checks if x < y, or possibly x == y, within a specified tolerance. + * + * The check for equality is controlled by parameter includeEqual. This + * lets users specify at compile time whether triangles intersecting only on + * border points are reported as intersecting or not. + * + * Supports checkEdge and checkVertex + */ +AXOM_HOST_DEVICE +inline bool isLpeq(double x, double y, bool includeEqual = false, double EPS = 1e-12) +{ + if(includeEqual && axom::utilities::isNearlyEqual(x, y, EPS)) + { + return true; + } + + return isLt(x, y, EPS); +} + +/*! + * \brief Checks if x > y, or possibly x == y, within a specified tolerance. + * + * The check for equality is controlled by parameter includeEqual. This + * lets users specify at compile time whether triangles intersecting only on + * border points are reported as intersecting or not. + * + * Supports checkEdge and checkVertex + */ +AXOM_HOST_DEVICE +inline bool isGpeq(double x, double y, bool includeEqual = false, double EPS = 1e-12) +{ + if(includeEqual && axom::utilities::isNearlyEqual(x, y, EPS)) + { + return true; + } + + return isGt(x, y, EPS); +} + +} // namespace detail +} // namespace primal +} // namespace axom + +#endif // AXOM_PRIMAL_FUZZY_COMPARATORS_HPP_ \ No newline at end of file diff --git a/src/axom/primal/operators/detail/intersect_bezier_impl.hpp b/src/axom/primal/operators/detail/intersect_bezier_impl.hpp index d36755fd57..a87750c077 100644 --- a/src/axom/primal/operators/detail/intersect_bezier_impl.hpp +++ b/src/axom/primal/operators/detail/intersect_bezier_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/detail/intersect_bounding_box_impl.hpp b/src/axom/primal/operators/detail/intersect_bounding_box_impl.hpp index 7c49f15e10..b785bd76f9 100644 --- a/src/axom/primal/operators/detail/intersect_bounding_box_impl.hpp +++ b/src/axom/primal/operators/detail/intersect_bounding_box_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/detail/intersect_impl.hpp b/src/axom/primal/operators/detail/intersect_impl.hpp index aa3537c0a1..6978657eba 100644 --- a/src/axom/primal/operators/detail/intersect_impl.hpp +++ b/src/axom/primal/operators/detail/intersect_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -17,6 +17,7 @@ #include "axom/core/numerics/Determinants.hpp" #include "axom/core/utilities/Utilities.hpp" +#include "axom/primal/operators/detail/fuzzy_comparators.hpp" #include "axom/primal/geometry/BoundingBox.hpp" #include "axom/primal/geometry/OrientedBoundingBox.hpp" #include "axom/primal/geometry/Plane.hpp" @@ -39,24 +40,6 @@ using Triangle3 = primal::Triangle; using Triangle2 = primal::Triangle; using Point2 = primal::Point; -AXOM_HOST_DEVICE -bool isGt(double x, double y, double EPS = 1E-12); - -AXOM_HOST_DEVICE -bool isLt(double x, double y, double EPS = 1E-12); - -AXOM_HOST_DEVICE -bool isLeq(double x, double y, double EPS = 1E-12); - -AXOM_HOST_DEVICE -bool isLpeq(double x, double y, bool includeEqual = false, double EPS = 1E-12); - -AXOM_HOST_DEVICE -bool isGeq(double x, double y, double EPS = 1E-12); - -AXOM_HOST_DEVICE -bool isGpeq(double x, double y, bool includeEqual = false, double EPS = 1E-12); - AXOM_HOST_DEVICE bool nonzeroSignMatch(double x, double y, double z, double EPS = 1E-12); @@ -175,7 +158,7 @@ AXOM_HOST_DEVICE bool intersect_tri3D_tri3D(const Triangle& t1, bool includeBoundary, double EPS) { - typedef primal::Vector Vector3; + using Vector3 = primal::Vector; SLIC_CHECK_MSG(!t1.degenerate(), "\n\n WARNING \n\n Triangle " << t1 << " is degenerate"); @@ -566,76 +549,6 @@ inline double twoDcross(const Point2& A, const Point2& B, const Point2& C) return (((A[0] - C[0]) * (B[1] - C[1]) - (A[1] - C[1]) * (B[0] - C[0]))); } -/*! - * \brief Checks if x > y, within a specified tolerance. - */ -AXOM_HOST_DEVICE -inline bool isGt(double x, double y, double EPS) -{ - return ((x > y) && !(axom::utilities::isNearlyEqual(x, y, EPS))); -} - -/*! - * \brief Checks if x < y, within a specified tolerance. - */ -AXOM_HOST_DEVICE -inline bool isLt(double x, double y, double EPS) -{ - return ((x < y) && !(axom::utilities::isNearlyEqual(x, y, EPS))); -} - -/*! - * \brief Checks if x <= y, within a specified tolerance. - */ -AXOM_HOST_DEVICE -inline bool isLeq(double x, double y, double EPS) { return !(isGt(x, y, EPS)); } - -/*! - * \brief Checks if x < y, or possibly x == y, within a specified tolerance. - * - * The check for equality is controlled by parameter includeEqual. This - * lets users specify at compile time whether triangles intersecting only on - * border points are reported as intersecting or not. - * - * Supports checkEdge and checkVertex - */ -AXOM_HOST_DEVICE -inline bool isLpeq(double x, double y, bool includeEqual, double EPS) -{ - if(includeEqual && axom::utilities::isNearlyEqual(x, y, EPS)) - { - return true; - } - - return isLt(x, y, EPS); -} - -/*! - * \brief Checks if x >= y, within a specified tolerance. - */ -AXOM_HOST_DEVICE -inline bool isGeq(double x, double y, double EPS) { return !(isLt(x, y, EPS)); } - -/*! - * \brief Checks if x > y, or possibly x == y, within a specified tolerance. - * - * The check for equality is controlled by parameter includeEqual. This - * lets users specify at compile time whether triangles intersecting only on - * border points are reported as intersecting or not. - * - * Supports checkEdge and checkVertex - */ -AXOM_HOST_DEVICE -inline bool isGpeq(double x, double y, bool includeEqual, double EPS) -{ - if(includeEqual && axom::utilities::isNearlyEqual(x, y, EPS)) - { - return true; - } - - return isGt(x, y, EPS); -} - /*! * \brief Check if x, y, and z all have the same sign. */ @@ -849,7 +762,7 @@ bool intersect_tri_ray(const Triangle& tri, // I (Arlie Capps, Jan. 2017) don't understand the motivation at this // point, but I'll accept this for now. - typedef NumericArray NumArray; + using NumArray = NumericArray; const T zero = T(); //find out dimension where ray direction is maximal @@ -961,7 +874,7 @@ bool intersect_tri_segment(const Triangle& tri, T& t, Point& p) { - typedef Vector Vector3; + using Vector3 = Vector; Ray r(S.source(), Vector3(S.source(), S.target())); //Ray-triangle intersection does not check endpoints, so we explicitly check diff --git a/src/axom/primal/operators/detail/intersect_ray_impl.hpp b/src/axom/primal/operators/detail/intersect_ray_impl.hpp index d037af50ea..25c744a976 100644 --- a/src/axom/primal/operators/detail/intersect_ray_impl.hpp +++ b/src/axom/primal/operators/detail/intersect_ray_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/detail/winding_number_impl.hpp b/src/axom/primal/operators/detail/winding_number_impl.hpp index 02c492ac4d..2f3d652359 100644 --- a/src/axom/primal/operators/detail/winding_number_impl.hpp +++ b/src/axom/primal/operators/detail/winding_number_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -311,30 +311,56 @@ double stokes_winding_number(const Point& query, // Compute one of three vector field line integrals depending on // the orientation of the original surface, indicated through ax. - if(ax == SingularityAxis::x) + switch(ax) { + case(SingularityAxis::x): quadrature += quad_rule.IntPoint(q).weight * (node[2] * node[0] * node_dt[1] - node[1] * node[0] * node_dt[2]) / (node[1] * node[1] + node[2] * node[2]) / node_norm; - } - else if(ax == SingularityAxis::y) - { + break; + case(SingularityAxis::y): quadrature += quad_rule.IntPoint(q).weight * (node[0] * node[1] * node_dt[2] - node[2] * node[1] * node_dt[0]) / (node[0] * node[0] + node[2] * node[2]) / node_norm; - } - else // ax == SingularityAxis::z || ax == SingularityAxis::rotated - { + break; + case(SingularityAxis::z): + case(SingularityAxis::rotated): quadrature += quad_rule.IntPoint(q).weight * (node[1] * node[2] * node_dt[0] - node[0] * node[2] * node_dt[1]) / (node[0] * node[0] + node[1] * node[1]) / node_norm; + break; } } - // Adaptively refine quadrature over curves if query is not far enough away. + // Adaptively refine quadrature over curves if query is not far enough away + // from the singularity axis. If rotated, assume you need to adapt. + bool needs_adapt = false; BoundingBox cBox(curve.boundingBox()); - if(squared_distance(query, cBox.getCentroid()) <= - 2 * cBox.range().squared_norm()) + Point centroid = cBox.getCentroid(); + + switch(ax) + { + case(SingularityAxis::x): + needs_adapt = (query[1] - centroid[1]) * (query[1] - centroid[1]) + + (query[2] - centroid[2]) * (query[2] - centroid[2]) <= + cBox.range().squared_norm(); + break; + case(SingularityAxis::y): + needs_adapt = (query[0] - centroid[0]) * (query[0] - centroid[0]) + + (query[2] - centroid[2]) * (query[2] - centroid[2]) <= + cBox.range().squared_norm(); + break; + case(SingularityAxis::z): + needs_adapt = (query[0] - centroid[0]) * (query[0] - centroid[0]) * + (query[1] - centroid[1]) * (query[1] - centroid[1]) <= + cBox.range().squared_norm(); + break; + case(SingularityAxis::rotated): + needs_adapt = true; + break; + } + + if(needs_adapt) { return stokes_winding_number_adaptive(query, curve, @@ -358,6 +384,7 @@ double stokes_winding_number(const Point& query, * \param [in] quad_rule The mfem quadrature rule object * \param [in] quad_coarse The integral evaluated on the original curve * \param [in] quad_tol The maximum relative error allowed in each quadrature + * \param [in] depth The current recursive depth * * Recursively apply quadrature for one of three possible integrals along two halfs * of a curve. The sum of this integral along the subcurves should be equal to to @@ -394,23 +421,24 @@ double stokes_winding_number_adaptive(const Point& query, // Compute one of three vector field line integrals depending on // the orientation of the original surface, indicated through ax. - if(ax == SingularityAxis::x) + switch(ax) { + case(SingularityAxis::x): quad_fine[i] += quad_rule.IntPoint(q).weight * (node[2] * node[0] * node_dt[1] - node[1] * node[0] * node_dt[2]) / (node[1] * node[1] + node[2] * node[2]) / node_norm; - } - else if(ax == SingularityAxis::y) - { + break; + case(SingularityAxis::y): quad_fine[i] += quad_rule.IntPoint(q).weight * (node[0] * node[1] * node_dt[2] - node[2] * node[1] * node_dt[0]) / (node[0] * node[0] + node[2] * node[2]) / node_norm; - } - else // ax == SingularityAxis::z || ax == SingularityAxis::rotated - { + break; + case(SingularityAxis::z): + case(SingularityAxis::rotated): quad_fine[i] += quad_rule.IntPoint(q).weight * (node[1] * node[2] * node_dt[0] - node[0] * node[2] * node_dt[1]) / (node[0] * node[0] + node[1] * node[1]) / node_norm; + break; } } } @@ -420,7 +448,7 @@ double stokes_winding_number_adaptive(const Point& query, axom::utilities::isNearlyEqualRelative(quad_fine[0] + quad_fine[1], quad_coarse, quad_tol, - 0.0)) + 1e-10)) { return 0.25 * M_1_PI * (quad_fine[0] + quad_fine[1]); } diff --git a/src/axom/primal/operators/evaluate_integral.hpp b/src/axom/primal/operators/evaluate_integral.hpp index 7ac25a055f..8f65547f91 100644 --- a/src/axom/primal/operators/evaluate_integral.hpp +++ b/src/axom/primal/operators/evaluate_integral.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/in_curved_polygon.hpp b/src/axom/primal/operators/in_curved_polygon.hpp index bcac735b3a..bb1a8ae54e 100644 --- a/src/axom/primal/operators/in_curved_polygon.hpp +++ b/src/axom/primal/operators/in_curved_polygon.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/in_polygon.hpp b/src/axom/primal/operators/in_polygon.hpp index db118d7567..f29205bdf3 100644 --- a/src/axom/primal/operators/in_polygon.hpp +++ b/src/axom/primal/operators/in_polygon.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/in_polyhedron.hpp b/src/axom/primal/operators/in_polyhedron.hpp index 8a32e40e95..9a729120c1 100644 --- a/src/axom/primal/operators/in_polyhedron.hpp +++ b/src/axom/primal/operators/in_polyhedron.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/in_sphere.hpp b/src/axom/primal/operators/in_sphere.hpp index ba3a1204f5..e9aaf0e7bc 100644 --- a/src/axom/primal/operators/in_sphere.hpp +++ b/src/axom/primal/operators/in_sphere.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/intersect.hpp b/src/axom/primal/operators/intersect.hpp index 24d16801a3..57dbc11bf9 100644 --- a/src/axom/primal/operators/intersect.hpp +++ b/src/axom/primal/operators/intersect.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -402,7 +402,8 @@ bool intersect(const Segment& S, const BoundingBox& bb) * \return true iff bb1 intersects with bb2, otherwise, false. */ template -bool intersect(const BoundingBox& bb1, const BoundingBox& bb2) +AXOM_HOST_DEVICE bool intersect(const BoundingBox& bb1, + const BoundingBox& bb2) { return bb1.intersectsWith(bb2); } diff --git a/src/axom/primal/operators/intersection_volume.hpp b/src/axom/primal/operators/intersection_volume.hpp index 7599b527d4..1774e63c63 100644 --- a/src/axom/primal/operators/intersection_volume.hpp +++ b/src/axom/primal/operators/intersection_volume.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -26,134 +26,173 @@ namespace axom namespace primal { /*! - * \brief Finds the intersection volume between a hexahedron and a tetrahedron + * \brief Finds the absolute (unsigned) intersection volume between + * a hexahedron and a tetrahedron * * \param [in] hex The hexahedron * \param [in] tet The tetrahedron * \param [in] eps The tolerance for determining the intersection - * \param [in] checkSign If true (default is false), checks the volumes of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return Intersection volume between the hexahedron and tetrahedron * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned volume may be zero + * and/or unexpected. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned volume of intersection + * may be zero and/or unexpected. * */ template AXOM_HOST_DEVICE T intersection_volume(const Hexahedron& hex, const Tetrahedron& tet, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return clip(hex, tet, eps, checkSign).volume(); + return clip(hex, tet, eps, tryFixOrientation).volume(); } /*! - * \brief Finds the intersection volume between a tetrahedron and a hexahedron + * \brief Finds the absolute (unsigned) intersection volume between + * a tetrahedron and a hexahedron * * \param [in] hex The tetrahedron * \param [in] tet The hexahedron * \param [in] eps The tolerance for determining the intersection - * \param [in] checkSign If true (default is false), checks the volumes of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return Intersection volume between the tetrahedron and hexahedron * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned volume may be zero + * and/or unexpected. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned volume of intersection + * may be zero and/or unexpected. * */ template AXOM_HOST_DEVICE T intersection_volume(const Tetrahedron& tet, const Hexahedron& hex, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return intersection_volume(hex, tet, eps, checkSign); + return intersection_volume(hex, tet, eps, tryFixOrientation); } /*! - * \brief Finds the intersection volume between a octahedron and a tetrahedron + * \brief Finds the absolute (unsigned) intersection volume between + * a octahedron and a tetrahedron * * \param [in] oct The octahedron * \param [in] tet The tetrahedron * \param [in] eps The tolerance for determining the intersection - * \param [in] checkSign If true (default is false), checks the volumes of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return Intersection volume between the octahedron and tetrahedron * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned volume may be zero + * and/or unexpected. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned volume of intersection + * may be zero and/or unexpected. * */ template AXOM_HOST_DEVICE T intersection_volume(const Octahedron& oct, const Tetrahedron& tet, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return clip(oct, tet, eps, checkSign).volume(); + return clip(oct, tet, eps, tryFixOrientation).volume(); } /*! - * \brief Finds the intersection volume between a tetrahedron and a octahedron + * \brief Finds the absolute (unsigned) intersection volume between + * a tetrahedron and a octahedron * * \param [in] oct The tetrahedron * \param [in] tet The octahedron * \param [in] eps The tolerance for determining the intersection - * \param [in] checkSign If true (default is false), checks the volumes of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return Intersection volume between the tetrahedron and octahedron * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned volume may be zero + * and/or unexpected. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned volume of intersection + * may be zero and/or unexpected. * */ template AXOM_HOST_DEVICE T intersection_volume(const Tetrahedron& tet, const Octahedron& oct, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return intersection_volume(oct, tet, eps, checkSign); + return intersection_volume(oct, tet, eps, tryFixOrientation); } /*! - * \brief Finds the intersection volume between a tetrahedron and another - * tetrahedron + * \brief Finds the absolute (unsigned) intersection volume between + * a tetrahedron and another tetrahedron * * \param [in] tet1 The tetrahedron * \param [in] tet2 The other tetrahedron * \param [in] eps The tolerance for determining the intersection - * \param [in] checkSign If true (default is false), checks the volumes of the - * shapes are positive. If volume is negative, order of some - * vertices will be swapped. + * \param [in] tryFixOrientation If true, takes each shape with a negative + * signed volume and swaps the order of some vertices in that + * shape to try to obtain a nonnegative signed volume. + * Defaults to false. * * \return Intersection volume between the tetrahedra * - * \note checkSign flag does not guarantee the shapes' vertex orders - * will be valid. It is the responsiblity of the caller to pass - * shapes with a valid vertex order. + * \warning tryFixOrientation flag does not guarantee the shapes' vertex orders + * will be valid. It is the responsiblity of the caller to pass + * shapes with a valid vertex order. Otherwise, if the shapes have + * invalid vertex orders, the returned volume may be zero + * and/or unexpected. + * + * \warning If tryFixOrientation flag is false and some of the shapes have + * a negative signed volume, the returned volume of intersection + * may be zero and/or unexpected. * */ template AXOM_HOST_DEVICE T intersection_volume(const Tetrahedron& tet1, const Tetrahedron& tet2, double eps = 1.e-10, - bool checkSign = false) + bool tryFixOrientation = false) { - return clip(tet1, tet2, eps, checkSign).volume(); + return clip(tet1, tet2, eps, tryFixOrientation).volume(); } } // namespace primal diff --git a/src/axom/primal/operators/is_convex.hpp b/src/axom/primal/operators/is_convex.hpp index 8d6c32d165..06d2087487 100644 --- a/src/axom/primal/operators/is_convex.hpp +++ b/src/axom/primal/operators/is_convex.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -9,6 +9,7 @@ #include "axom/primal/geometry/Segment.hpp" #include "axom/primal/geometry/Polygon.hpp" #include "axom/primal/operators/orientation.hpp" +#include "axom/primal/operators/squared_distance.hpp" namespace axom { @@ -19,9 +20,10 @@ namespace primal * * \param [in] poly The polygon * - * Uses dot products to detect whether vertices extend in the "convex" direction. - * Uses the edge P[0]P[N] as a reference, meaning its adjacent edges are - * always considered to be oriented correctly. + * A 2D polygon is convex when every line that does not contain an edge + * intersects the shape at most twice. + * Checks whether for each pair of vertices P[i-1]P[i+1], the point + * P[i] and (P[0] or P[n]) lie on the same side of the line connecting them. * * Algorithm adapted from: * Y. L. Ma, W.T. Hewitt. "Point inversion and projection for NURBS curve @@ -54,7 +56,7 @@ bool is_convex(const Polygon& poly, double EPS = 1e-8) } // Ensure other point to check against isn't adjacent - if(res1 == orientation(poly[(i < n / 2) ? n : 0], seg, EPS)) + if(res1 == orientation(poly[(i <= n / 2) ? n : 0], seg, EPS)) { return false; } diff --git a/src/axom/primal/operators/orientation.hpp b/src/axom/primal/operators/orientation.hpp index d7668e9764..51f5a9cab4 100644 --- a/src/axom/primal/operators/orientation.hpp +++ b/src/axom/primal/operators/orientation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/split.hpp b/src/axom/primal/operators/split.hpp index 85b6e351c9..0fea650b4f 100644 --- a/src/axom/primal/operators/split.hpp +++ b/src/axom/primal/operators/split.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/squared_distance.hpp b/src/axom/primal/operators/squared_distance.hpp index 73f9e0c9f0..1ff3f1839a 100644 --- a/src/axom/primal/operators/squared_distance.hpp +++ b/src/axom/primal/operators/squared_distance.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/operators/winding_number.hpp b/src/axom/primal/operators/winding_number.hpp index 5ad0ac430d..8773a66c93 100644 --- a/src/axom/primal/operators/winding_number.hpp +++ b/src/axom/primal/operators/winding_number.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -454,7 +454,8 @@ int winding_number(const Point& query, } #ifdef AXOM_USE_MFEM -/*! + +/* * \brief Computes the solid angle winding number for a Bezier patch * * \param [in] query The query point to test @@ -463,6 +464,7 @@ int winding_number(const Point& query, * considered indistinguishable * \param [in] quad_tol The maximum relative error allowed in the quadrature * \param [in] EPS Miscellaneous numerical tolerance level for nonphysical distances + * \param [in] depth The current recursive depth * * Computes the generalized winding number for a Bezier patch using Stokes theorem. * @@ -473,7 +475,7 @@ int winding_number(const Point& query, */ template double winding_number(const Point& query, - const BezierPatch& bPatch, + const BezierPatch& bPatch, const double edge_tol = 1e-8, const double quad_tol = 1e-8, const double EPS = 1e-8, @@ -507,7 +509,7 @@ double winding_number(const Point& query, constexpr double edge_offset = 0.01; if(squared_distance(query, bPatch(0, 0)) <= edge_tol_sq) { - BezierPatch p1, p2, p3, p4; + BezierPatch p1, p2, p3, p4; bPatch.split(0.0 + edge_offset, 0.0 + edge_offset, p1, p2, p3, p4); double new_edge_tol = 0.5 * sqrt(axom::utilities::min( @@ -521,7 +523,7 @@ double winding_number(const Point& query, } if(squared_distance(query, bPatch(ord_u, 0)) <= edge_tol_sq) { - BezierPatch p1, p2, p3, p4; + BezierPatch p1, p2, p3, p4; bPatch.split(1.0 - edge_offset, 0.0 + edge_offset, p1, p2, p3, p4); double new_edge_tol = 0.5 * sqrt(axom::utilities::min( @@ -535,7 +537,7 @@ double winding_number(const Point& query, } if(squared_distance(query, bPatch(0, ord_v)) <= edge_tol_sq) { - BezierPatch p1, p2, p3, p4; + BezierPatch p1, p2, p3, p4; bPatch.split(0.0 + edge_offset, 1.0 - edge_offset, p1, p2, p3, p4); double new_edge_tol = 0.5 * sqrt(axom::utilities::min( @@ -549,7 +551,7 @@ double winding_number(const Point& query, } if(squared_distance(query, bPatch(ord_u, ord_v)) <= edge_tol_sq) { - BezierPatch p1, p2, p3, p4; + BezierPatch p1, p2, p3, p4; bPatch.split(1.0 - edge_offset, 1.0 - edge_offset, p1, p2, p3, p4); double new_edge_tol = 0.5 * sqrt(axom::utilities::min( @@ -602,7 +604,7 @@ double winding_number(const Point& query, OrientedBoundingBox oBox(bPatch.orientedBoundingBox().expand(edge_tol)); if(oBox.contains(query)) { - BezierPatch p1, p2, p3, p4; + BezierPatch p1, p2, p3, p4; bPatch.split(0.5, 0.5, p1, p2, p3, p4); return winding_number(query, p1, edge_tol, quad_tol, EPS, depth + 1) + winding_number(query, p2, edge_tol, quad_tol, EPS, depth + 1) + @@ -655,9 +657,13 @@ double winding_number(const Point& query, // Find the direction of a ray perpendicular to that Vector v1; if(axom::utilities::isNearlyEqual(v0[0], v0[1], EPS)) + { v1 = Vector({v0[2], v0[2], -v0[0] - v0[1]}).unitVector(); + } else + { v1 = Vector({-v0[1] - v0[2], v0[0], v0[0]}).unitVector(); + } // Rotate v0 around v1 until it is perpendicular to the plane spanned by k and v1 double ang = (v0[2] < 0 ? 1.0 : -1.0) * diff --git a/src/axom/primal/tests/CMakeLists.txt b/src/axom/primal/tests/CMakeLists.txt index c86789fa3e..bf5d2aaa20 100644 --- a/src/axom/primal/tests/CMakeLists.txt +++ b/src/axom/primal/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -37,6 +37,7 @@ set( primal_tests primal_tetrahedron.cpp primal_octahedron.cpp primal_triangle.cpp + primal_quadrilateral.cpp primal_vector.cpp primal_winding_number.cpp primal_zip.cpp diff --git a/src/axom/primal/tests/primal_bezier_curve.cpp b/src/axom/primal/tests/primal_bezier_curve.cpp index 755b22e946..00f4d350d5 100644 --- a/src/axom/primal/tests/primal_bezier_curve.cpp +++ b/src/axom/primal/tests/primal_bezier_curve.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -118,34 +118,85 @@ TEST(primal_beziercurve, evaluate) using PointType = primal::Point; using BezierCurveType = primal::BezierCurve; - const int order = 3; - PointType data[order + 1] = {PointType {0.6, 1.2, 1.0}, - PointType {1.3, 1.6, 1.8}, - PointType {2.9, 2.4, 2.3}, - PointType {3.2, 3.5, 3.0}}; + const int max_order = 3; + PointType data[max_order + 1] = {PointType {0.6, 1.2, 1.0}, + PointType {1.3, 1.6, 1.8}, + PointType {2.9, 2.4, 2.3}, + PointType {3.2, 3.5, 3.0}}; - BezierCurveType b2Curve(data, order); + // clang-format off + PointType exp_vals[4][3] = {{PointType {0.6, 1.2, 1.0}, PointType { 0.6, 1.2, 1.0}, PointType {0.6, 1.2, 1.0}}, + {PointType {0.6, 1.2, 1.0}, PointType { 0.95, 1.4, 1.4}, PointType {1.3, 1.6, 1.8}}, + {PointType {0.6, 1.2, 1.0}, PointType {1.525, 1.7, 1.725}, PointType {2.9, 2.4, 2.3}}, + {PointType {0.6, 1.2, 1.0}, PointType { 2.05, 2.0875, 2.0375}, PointType {3.2, 3.5, 3.0}}}; + // clang-format on + + // Test evaluation at various orders, using the first `ord` + // points in `data` as control points. + for(int ord = 0; ord <= max_order; ++ord) + { + BezierCurveType curve(data, ord); - PointType midtval {2.05, 2.0875, 2.0375}; + PointType calc_start = curve.evaluate(0.0); + PointType calc_mid = curve.evaluate(0.5); + PointType calc_end = curve.evaluate(1.0); - // Evaluate the curve at several parameter values - // Curve should interpolate endpoints - PointType eval0 = b2Curve.evaluate(0.0); - PointType eval1 = b2Curve.evaluate(1.0); - PointType evalMid = b2Curve.evaluate(0.5); + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_start[i], exp_vals[ord][0][i], 1e-15); + EXPECT_NEAR(calc_mid[i], exp_vals[ord][1][i], 1e-15); + EXPECT_NEAR(calc_end[i], exp_vals[ord][2][i], 1e-15); + } + } +} - for(int i = 0; i < DIM; ++i) +//------------------------------------------------------------------------------ +TEST(primal_beziercurve_, first_derivatives) +{ + SLIC_INFO("Testing Bezier derivative calculation"); + + const int DIM = 3; + using CoordType = double; + using PointType = primal::Point; + using VectorType = primal::Vector; + using BezierCurveType = primal::BezierCurve; + + const int max_order = 3; + PointType data[max_order + 1] = {PointType {0.6, 1.2, 1.0}, + PointType {1.3, 1.6, 1.8}, + PointType {2.9, 2.4, 2.3}, + PointType {3.2, 3.5, 3.0}}; + + // clang-format off + VectorType exp_vals[4][3] = {{VectorType {0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}, VectorType {0.0, 0.0, 0.0}}, + {VectorType {0.7, 0.4, 0.8}, VectorType { 0.7, 0.4, 0.8}, VectorType {0.7, 0.4, 0.8}}, + {VectorType {1.4, 0.8, 1.6}, VectorType { 2.3, 1.2, 1.3}, VectorType {3.2, 1.6, 1.0}}, + {VectorType {2.1, 1.2, 2.4}, VectorType {3.15, 2.325, 1.875}, VectorType {0.9, 3.3, 2.1}}}; + // clang-format on + + // Test derivative calculation at various orders, using the first `ord` + // points in `data` as control points. + for(int ord = 0; ord <= max_order; ++ord) { - EXPECT_DOUBLE_EQ(b2Curve[0][i], eval0[i]); - EXPECT_DOUBLE_EQ(b2Curve[order][i], eval1[i]); - EXPECT_DOUBLE_EQ(midtval[i], evalMid[i]); + BezierCurveType curve(data, ord); + + VectorType calc_start = curve.dt(0.0); + VectorType calc_mid = curve.dt(0.5); + VectorType calc_end = curve.dt(1.0); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_start[i], exp_vals[ord][0][i], 1e-15); + EXPECT_NEAR(calc_mid[i], exp_vals[ord][1][i], 1e-15); + EXPECT_NEAR(calc_end[i], exp_vals[ord][2][i], 1e-15); + } } } //------------------------------------------------------------------------------ -TEST(primal_beziercurve_, tangent) +TEST(primal_beziercurve_, second_derivative) { - SLIC_INFO("Testing Bezier tangent calculation"); + SLIC_INFO("Testing Bezier second derivative calculation"); const int DIM = 3; using CoordType = double; @@ -153,29 +204,75 @@ TEST(primal_beziercurve_, tangent) using VectorType = primal::Vector; using BezierCurveType = primal::BezierCurve; - const int order = 3; - PointType data[order + 1] = {PointType {0.6, 1.2, 1.0}, - PointType {1.3, 1.6, 1.8}, - PointType {2.9, 2.4, 2.3}, - PointType {3.2, 3.5, 3.0}}; + const int max_order = 3; + PointType data[max_order + 1] = {PointType {0.6, 1.2, 1.0}, + PointType {1.3, 1.6, 1.8}, + PointType {2.9, 2.4, 2.3}, + PointType {3.2, 3.5, 3.0}}; - BezierCurveType b2Curve(data, order); + // clang-format off + VectorType exp_vals[4][3] = {{VectorType {0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}}, + {VectorType {0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}}, + {VectorType {1.8, 0.8, -0.6}, VectorType { 1.8, 0.8, -0.6}, VectorType { 1.8, 0.8, -0.6}}, + {VectorType {5.4, 2.4, -1.8}, VectorType {-1.2, 2.1, -0.3}, VectorType {-7.8, 1.8, 1.2}}}; + // clang-format on + + // Test evaluation at various orders, using the first `ord` + // points in `data` as control points. + for(int ord = 0; ord <= max_order; ++ord) + { + BezierCurveType curve(data, ord); - VectorType midtval = VectorType {3.15, 2.325, 1.875}; - VectorType starttval = VectorType {2.1, 1.2, 2.4}; - VectorType endtval = VectorType {.9, 3.3, 2.1}; + VectorType calc_start = curve.dtdt(0.0); + VectorType calc_mid = curve.dtdt(0.5); + VectorType calc_end = curve.dtdt(1.0); - // Evaluate the curve at several parameter values - // Curve should be tangent to control net at endpoints - VectorType eval0 = b2Curve.dt(0.0); - VectorType eval1 = b2Curve.dt(1.0); - VectorType evalMid = b2Curve.dt(0.5); + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_start[i], exp_vals[ord][0][i], 1e-14); + EXPECT_NEAR(calc_mid[i], exp_vals[ord][1][i], 1e-14); + EXPECT_NEAR(calc_end[i], exp_vals[ord][2][i], 1e-14); + } + } +} - for(int i = 0; i < DIM; ++i) +//------------------------------------------------------------------------------ +TEST(primal_beziercurve_, batch_derivatives) +{ + SLIC_INFO("Testing Bezier batched derivative calculations"); + + const int DIM = 3; + using CoordType = double; + using PointType = primal::Point; + using VectorType = primal::Vector; + using BezierCurveType = primal::BezierCurve; + + const int max_order = 3; + PointType data[max_order + 1] = {PointType {0.6, 1.2, 1.0}, + PointType {1.3, 1.6, 1.8}, + PointType {2.9, 2.4, 2.3}, + PointType {3.2, 3.5, 3.0}}; + + const double t = 0.6; + PointType batch1_val, batch2_val; + VectorType batch1_dt, batch2_dt, batch2_dtdt; + + // Test the derivative calculations on various orders + for(int ord = 0; ord <= max_order; ++ord) { - EXPECT_NEAR(starttval[i], eval0[i], 1e-15); - EXPECT_NEAR(endtval[i], eval1[i], 1e-15); - EXPECT_NEAR(midtval[i], evalMid[i], 1e-15); + BezierCurveType curve(data, ord); + + curve.evaluate_first_derivative(t, batch1_val, batch1_dt); + curve.evaluate_second_derivative(t, batch2_val, batch2_dt, batch2_dtdt); + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(curve.evaluate(t)[i], batch1_val[i], 1e-15); + EXPECT_NEAR(curve.dt(t)[i], batch1_dt[i], 1e-15); + + EXPECT_NEAR(curve.evaluate(t)[i], batch2_val[i], 1e-15); + EXPECT_NEAR(curve.dt(t)[i], batch2_dt[i], 1e-15); + EXPECT_NEAR(curve.dtdt(t)[i], batch2_dtdt[i], 1e-15); + } } } diff --git a/src/axom/primal/tests/primal_bezier_intersect.cpp b/src/axom/primal/tests/primal_bezier_intersect.cpp index d4a615e09d..044e59bead 100644 --- a/src/axom/primal/tests/primal_bezier_intersect.cpp +++ b/src/axom/primal/tests/primal_bezier_intersect.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_bezier_patch.cpp b/src/axom/primal/tests/primal_bezier_patch.cpp index c6da191bfe..d5b092ea81 100644 --- a/src/axom/primal/tests/primal_bezier_patch.cpp +++ b/src/axom/primal/tests/primal_bezier_patch.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -22,7 +22,7 @@ namespace primal = axom::primal; TEST(primal_bezierpatch, constructor) { using CoordType = double; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; using CoordsMat = BezierPatchType::CoordsMat; { @@ -60,7 +60,7 @@ TEST(primal_bezierpatch, set_order) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; SLIC_INFO("Test adding control points to an empty Bezier patch"); @@ -104,7 +104,7 @@ TEST(primal_bezierpatch, array_constructors) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; SLIC_INFO("Testing point array constructor"); @@ -178,7 +178,7 @@ TEST(primal_bezierpatch, axom_array_constructors) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; SLIC_INFO("Testing point array constructor"); @@ -283,7 +283,7 @@ TEST(primal_bezierpatch, make_rational) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order_u = 1; const int order_v = 1; @@ -340,7 +340,7 @@ TEST(primal_bezierpatch, evaluate) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order_u = 3; const int order_v = 2; @@ -405,7 +405,7 @@ TEST(primal_bezierpatch, isocurve) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order_u = 3; const int order_v = 2; @@ -429,50 +429,6 @@ TEST(primal_bezierpatch, isocurve) EXPECT_EQ(bPatch.isocurve(0.5, 1).getOrder(), order_u); } -//------------------------------------------------------------------------------ -TEST(primal_bezierpatch, evaluate_tall) -{ - SLIC_INFO("Testing bezier Patch evaluation with axes swapped"); - - const int DIM = 3; - using CoordType = double; - using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; - - const int order_u = 2; - const int order_v = 3; - - // clang-format off - PointType controlPoints[(order_u + 1) * (order_v + 1)] = { - PointType {0, 0, 0}, PointType {2, 0, 6}, PointType {4, 0, 0}, PointType {6, 0, 0}, - PointType {0, 4, 0}, PointType {2, 4, 0}, PointType {4, 4, 0}, PointType {6, 4, -3}, - PointType {0, 8, -3}, PointType {2, 8, 0}, PointType {4, 8, 3}, PointType {6, 8, 0}}; - // clang-format on - - BezierPatchType bPatch(controlPoints, order_u, order_v); - - // Evaluate the patch at each of the four corners, where the patch interpolates - for(int i = 0; i < DIM; ++i) - { - EXPECT_DOUBLE_EQ(bPatch.evaluate(0, 0)[i], controlPoints[0][i]); - EXPECT_DOUBLE_EQ(bPatch.evaluate(0, 1)[i], controlPoints[3][i]); - EXPECT_DOUBLE_EQ(bPatch.evaluate(1, 0)[i], controlPoints[8][i]); - EXPECT_DOUBLE_EQ(bPatch.evaluate(1, 1)[i], controlPoints[11][i]); - } - - // Evaluate the patch at some interior points - PointType interior_1 {3.0, 4.0, 0.5625}; // (0.5, 0.5) - PointType interior_2 {1.5, 6.0, -171.0 / 512.0}; // (0.75, 0.25) - PointType interior_3 {4.5, 2.0, 39.0 / 512.0}; // (0.25, 0.75) - - for(int i = 0; i < DIM; ++i) - { - EXPECT_DOUBLE_EQ(bPatch.evaluate(0.5, 0.5)[i], interior_1[i]); - EXPECT_DOUBLE_EQ(bPatch.evaluate(0.75, 0.25)[i], interior_2[i]); - EXPECT_DOUBLE_EQ(bPatch.evaluate(0.25, 0.75)[i], interior_3[i]); - } -} - //------------------------------------------------------------------------------ TEST(primal_bezierpatch, evaluation_degenerate) { @@ -483,7 +439,7 @@ TEST(primal_bezierpatch, evaluation_degenerate) using CoordType = double; using PointType = primal::Point; using BezierCurveType = primal::BezierCurve; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order = 3; PointType data[order + 1] = {PointType {0.6, 1.2, 1.0}, @@ -494,7 +450,7 @@ TEST(primal_bezierpatch, evaluation_degenerate) BezierCurveType bCurve(data, order); BezierPatchType bPatch(data, order, 0); - for(double t = 0; t <= 1; t += 0.01) + for(double t = 0; t <= 1; t += 0.1) { for(int i = 0; i < DIM; ++i) { @@ -514,7 +470,7 @@ TEST(primal_bezierpatch, tangent) using CoordType = double; using PointType = primal::Point; using VectorType = primal::Vector; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order_u = 3; const int order_v = 2; @@ -566,7 +522,7 @@ TEST(primal_bezierpatch, normal) using CoordType = double; using PointType = primal::Point; using VectorType = primal::Vector; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order_u = 3; const int order_v = 2; @@ -596,6 +552,383 @@ TEST(primal_bezierpatch, normal) } } +//------------------------------------------------------------------------------ +TEST(primal_bezierpatch, rational_evaluation) +{ + constexpr int DIM = 3; + using CoordType = double; + using PointType = primal::Point; + using BezierPatchType = primal::BezierPatch; + + constexpr int max_order_u = 3; + constexpr int order_v = 4; + + // clang-format off + PointType controlPoints[(max_order_u + 1) * (order_v + 1)] = { + PointType {0, 0, 0}, PointType{0, 4, 0}, PointType{0, 8, -3}, PointType{0, 12, 1}, PointType{0, 16, 3}, + PointType {2, 0, 6}, PointType{2, 4, 5}, PointType{2, 8, 0}, PointType{4, 12, 2}, PointType{2, 16, 2}, + PointType {4, 0, 0}, PointType{4, 4, 5}, PointType{4, 8, 3}, PointType{2, 12, 3}, PointType{4, 16, 1}, + PointType {6, 0, 0}, PointType{6, 4, -3}, PointType{6, 8, 0}, PointType{6, 12, 2}, PointType{6, 16, 0}}; + + double weights[(max_order_u + 1) * (order_v + 1)] = { + 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 2.0, 3.0, 2.0, 1.0, + 1.0, 2.0, 3.0, 2.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0}; + + PointType exp_vals[4][3] = {{PointType {0.0, 0.0, 0.0}, PointType { 0.0, 6.4, -0.8064}, PointType {0.0, 16.0, 3.0}}, + {PointType {0.4, 0.0, 1.2}, PointType {1561./997., 6736./997., 1279./997.}, PointType {1.6, 16.0, 2.2}}, + {PointType {0.8, 0.0, 1.92}, PointType { 218./91., 8104./1183., 2579./1183.}, PointType {3.2, 16.0, 1.4}}, + {PointType {1.2, 0.0, 2.304}, PointType { 3.0, 8104./1183., 11157./4732.}, PointType {4.8, 16.0, 0.6}}}; + // clang-format on + + double u0 = 0.2, u1 = 0.5, u2 = 0.8; + double v0 = 0.0, v1 = 0.4, v2 = 1.0; + + // For each test order, construct a Bezier patch using the first order_u + 1 + // rows of control points and weights + for(int order_u = 0; order_u <= max_order_u; ++order_u) + { + BezierPatchType patch(controlPoints, weights, order_u, order_v); + + PointType calc_0 = patch.evaluate(u0, v0); + PointType calc_1 = patch.evaluate(u1, v1); + PointType calc_2 = patch.evaluate(u2, v2); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_0[i], exp_vals[order_u][0][i], 1e-15); + EXPECT_NEAR(calc_1[i], exp_vals[order_u][1][i], 1e-15); + EXPECT_NEAR(calc_2[i], exp_vals[order_u][2][i], 1e-15); + } + + patch.swapAxes(); + + calc_0 = patch.evaluate(v0, u0); + calc_1 = patch.evaluate(v1, u1); + calc_2 = patch.evaluate(v2, u2); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_0[i], exp_vals[order_u][0][i], 1e-15); + EXPECT_NEAR(calc_1[i], exp_vals[order_u][1][i], 1e-15); + EXPECT_NEAR(calc_2[i], exp_vals[order_u][2][i], 1e-15); + } + } +} + +//------------------------------------------------------------------------------ +TEST(primal_bezierpatch, rational_first_derivatives) +{ + const int DIM = 3; + using CoordType = double; + using PointType = primal::Point; + using VectorType = primal::Vector; + using BezierPatchType = primal::BezierPatch; + + const int max_order_u = 3; + const int order_v = 4; + + // clang-format off + PointType controlPoints[(max_order_u + 1) * (order_v + 1)] = { + PointType {0, 0, 0}, PointType{0, 4, 0}, PointType{0, 8, -3}, PointType{0, 12, 1}, PointType{0, 16, 3}, + PointType {2, 0, 6}, PointType{2, 4, 5}, PointType{2, 8, 0}, PointType{4, 12, 2}, PointType{2, 16, 2}, + PointType {4, 0, 0}, PointType{4, 4, 5}, PointType{4, 8, 3}, PointType{2, 12, 3}, PointType{4, 16, 1}, + PointType {6, 0, 0}, PointType{6, 4, -3}, PointType{6, 8, 0}, PointType{6, 12, 2}, PointType{6, 16, 0}}; + + double weights[(max_order_u + 1) * (order_v + 1)] = { + 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 2.0, 3.0, 2.0, 1.0, + 1.0, 2.0, 3.0, 2.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0}; + + VectorType exp_du[4][3] = {{VectorType {0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}, VectorType {0.0, 0.0, 0.0}}, + {VectorType {2.0, 0.0, 6.0}, VectorType {1951250./994009., 444000./994009., 2603726./994009.}, VectorType {2.0, 0.0, -1.0}}, + {VectorType {4.0, 0.0, 7.2}, VectorType { 301180./107653., 444000./1399489., 4232824./1399489.}, VectorType {4.0, 0.0, -2.0}}, + {VectorType {6.0, 0.0, 5.76}, VectorType { 330./91., 0.0, 2523./2366.}, VectorType {6.0, 0.0, -3.0}}}; + + VectorType exp_dv[4][3] = {{VectorType { 0.0, 16.0, 0.0}, VectorType { 0.0, 16.0, -0.064}, VectorType { 0.0, 16.0, 8.0}}, + {VectorType { 1.28, 19.2, 2.24}, VectorType {1276850./994009., 12622200./994009., -3524050./994009.}, VectorType {-14.08, 28.8, 2.24}}, + {VectorType {2.048, 21.76, 3.9552}, VectorType { 64650./107653., 16488700./1399489., -4637275./1399489.}, VectorType { 4.608, 31.36, -9.664}}, + {VectorType {2.304, 23.68, 5.46432}, VectorType { 0.0, 16488700./1399489., -12970725./5597956.}, VectorType { 6.912, 23.68, -11.328}}}; + // clang-format on + + double u0 = 0.2, u1 = 0.5, u2 = 0.8; + double v0 = 0.0, v1 = 0.4, v2 = 1.0; + + // For each test order, construct a Bezier patch using the first order_u + 1 + // rows of control points and weights + for(int order_u = 0; order_u <= max_order_u; ++order_u) + { + BezierPatchType patch(controlPoints, weights, order_u, order_v); + + VectorType calc_du_0 = patch.du(u0, v0); + VectorType calc_du_1 = patch.du(u1, v1); + VectorType calc_du_2 = patch.du(u2, v2); + + VectorType calc_dv_0 = patch.dv(u0, v0); + VectorType calc_dv_1 = patch.dv(u1, v1); + VectorType calc_dv_2 = patch.dv(u2, v2); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_du_0[i], exp_du[order_u][0][i], 1e-13); + EXPECT_NEAR(calc_du_1[i], exp_du[order_u][1][i], 1e-13); + EXPECT_NEAR(calc_du_2[i], exp_du[order_u][2][i], 1e-13); + + EXPECT_NEAR(calc_dv_0[i], exp_dv[order_u][0][i], 1e-13); + EXPECT_NEAR(calc_dv_1[i], exp_dv[order_u][1][i], 1e-13); + EXPECT_NEAR(calc_dv_2[i], exp_dv[order_u][2][i], 1e-13); + } + + // Swap the axes and check that the derivatives are correct + patch.swapAxes(); + + calc_du_0 = patch.dv(v0, u0); + calc_du_1 = patch.dv(v1, u1); + calc_du_2 = patch.dv(v2, u2); + + calc_dv_0 = patch.du(v0, u0); + calc_dv_1 = patch.du(v1, u1); + calc_dv_2 = patch.du(v2, u2); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_du_0[i], exp_du[order_u][0][i], 1e-13); + EXPECT_NEAR(calc_du_1[i], exp_du[order_u][1][i], 1e-13); + EXPECT_NEAR(calc_du_2[i], exp_du[order_u][2][i], 1e-13); + + EXPECT_NEAR(calc_dv_0[i], exp_dv[order_u][0][i], 1e-13); + EXPECT_NEAR(calc_dv_1[i], exp_dv[order_u][1][i], 1e-13); + EXPECT_NEAR(calc_dv_2[i], exp_dv[order_u][2][i], 1e-13); + } + } +} + +//------------------------------------------------------------------------------ +TEST(primal_bezierpatch, rational_second_derivatives) +{ + const int DIM = 3; + using CoordType = double; + using PointType = primal::Point; + using VectorType = primal::Vector; + using BezierPatchType = primal::BezierPatch; + + const int max_order_u = 3; + const int order_v = 4; + + // clang-format off + PointType controlPoints[(max_order_u + 1) * (order_v + 1)] = { + PointType {0, 0, 0}, PointType{0, 4, 0}, PointType{0, 8, -3}, PointType{0, 12, 1}, PointType{0, 16, 3}, + PointType {2, 0, 6}, PointType{2, 4, 5}, PointType{2, 8, 0}, PointType{4, 12, 2}, PointType{2, 16, 2}, + PointType {4, 0, 0}, PointType{4, 4, 5}, PointType{4, 8, 3}, PointType{2, 12, 3}, PointType{4, 16, 1}, + PointType {6, 0, 0}, PointType{6, 4, -3}, PointType{6, 8, 0}, PointType{6, 12, 2}, PointType{6, 16, 0}}; + + double weights[(max_order_u + 1) * (order_v + 1)] = { + 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 2.0, 3.0, 2.0, 1.0, + 1.0, 2.0, 3.0, 2.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0}; + + // Exact rational values get unwieldy here. For example, exp_dudu[1][1][0] = -2903460000/991026973 exactly. + VectorType exp_dudu[4][3] = {{VectorType {0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}, VectorType {0.0, 0.0, 0.0}}, + {VectorType {0.0, 0.0, 0.0}, VectorType {-2.92974871432, -0.666653903476, -3.90942365198}, VectorType {0.0, 0.0, 0.0}}, + {VectorType {0.0, 0.0, -24.0}, VectorType {-2.45334507849, -1.03357131222, -4.32849911}, VectorType {0.0, 0.0, 0.0}}, + {VectorType {0.0, 0.0, -50.4}, VectorType { 0.0, -1.90355193931, -13.2112292415}, VectorType {0.0, 0.0, 0.0}}}; + + VectorType exp_dvdv[4][3] = {{VectorType { 0.0, 0.0, -36.0}, VectorType { 0.0, 0.0, 23.52}, VectorType { 0.0, 0.0, -24.0}}, + {VectorType { -2.048, -11.52, -65.984}, VectorType {-0.114397491782, -7.89784961786, 17.3438006414}, VectorType {-166.912, 107.52, -48.064}}, + {VectorType {-5.89824, -28.1088, -93.470976}, VectorType {-0.786421266682, -8.69476156044, 10.1439670088}, VectorType {66.10944, 148.6848, -113.57952}}, + {VectorType {-8.84736, -44.8512, -116.0229888}, VectorType { 0.0, -8.69476156044, 4.56797689827}, VectorType {54.19008, 44.8512, -84.39552}}}; + + VectorType exp_dudv[4][3] = {{VectorType { 0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}}, + {VectorType { 4.8, 16.0, 6.4}, VectorType {0.882014338474, -4.30534194956, -5.33680771976}, VectorType {-11.2, 16.0, -10.4}}, + {VectorType {5.12, 25.6, 12.544}, VectorType {-2.58010892971, -3.12014017951, 0.484714839042}, VectorType {49.28, 6.4, -31.04}}, + {VectorType {0.96, 28.8, 19.872}, VectorType { -3.6032437554, 0.0, 5.97901269678}, VectorType {-2.88, -28.8, -0.48}}}; + // clang-format on + + double u0 = 0.2, u1 = 0.5, u2 = 0.8; + double v0 = 0.0, v1 = 0.4, v2 = 1.0; + + // For each test order, construct a Bezier patch using the first order_u + 1 + // rows of control points and weights + for(int order_u = 0; order_u <= max_order_u; ++order_u) + { + BezierPatchType patch(controlPoints, weights, order_u, order_v); + + VectorType calc_dudu_0 = patch.dudu(u0, v0); + VectorType calc_dudu_1 = patch.dudu(u1, v1); + VectorType calc_dudu_2 = patch.dudu(u2, v2); + + VectorType calc_dvdv_0 = patch.dvdv(u0, v0); + VectorType calc_dvdv_1 = patch.dvdv(u1, v1); + VectorType calc_dvdv_2 = patch.dvdv(u2, v2); + + VectorType calc_dudv_0 = patch.dudv(u0, v0); + VectorType calc_dudv_1 = patch.dudv(u1, v1); + VectorType calc_dudv_2 = patch.dudv(u2, v2); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_dudu_0[i], exp_dudu[order_u][0][i], 1e-10); + EXPECT_NEAR(calc_dudu_1[i], exp_dudu[order_u][1][i], 1e-10); + EXPECT_NEAR(calc_dudu_2[i], exp_dudu[order_u][2][i], 1e-10); + + EXPECT_NEAR(calc_dvdv_0[i], exp_dvdv[order_u][0][i], 1e-10); + EXPECT_NEAR(calc_dvdv_1[i], exp_dvdv[order_u][1][i], 1e-10); + EXPECT_NEAR(calc_dvdv_2[i], exp_dvdv[order_u][2][i], 1e-10); + + EXPECT_NEAR(calc_dudv_0[i], exp_dudv[order_u][0][i], 1e-10); + EXPECT_NEAR(calc_dudv_1[i], exp_dudv[order_u][1][i], 1e-10); + EXPECT_NEAR(calc_dudv_2[i], exp_dudv[order_u][2][i], 1e-10); + } + + // Swap the axes and check that the derivatives are correct + patch.swapAxes(); + + calc_dudu_0 = patch.dvdv(v0, u0); + calc_dudu_1 = patch.dvdv(v1, u1); + calc_dudu_2 = patch.dvdv(v2, u2); + + calc_dvdv_0 = patch.dudu(v0, u0); + calc_dvdv_1 = patch.dudu(v1, u1); + calc_dvdv_2 = patch.dudu(v2, u2); + + calc_dudv_0 = patch.dudv(v0, u0); + calc_dudv_1 = patch.dudv(v1, u1); + calc_dudv_2 = patch.dudv(v2, u2); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_dudu_0[i], exp_dudu[order_u][0][i], 1e-10); + EXPECT_NEAR(calc_dudu_1[i], exp_dudu[order_u][1][i], 1e-10); + EXPECT_NEAR(calc_dudu_2[i], exp_dudu[order_u][2][i], 1e-10); + + EXPECT_NEAR(calc_dvdv_0[i], exp_dvdv[order_u][0][i], 1e-10); + EXPECT_NEAR(calc_dvdv_1[i], exp_dvdv[order_u][1][i], 1e-10); + EXPECT_NEAR(calc_dvdv_2[i], exp_dvdv[order_u][2][i], 1e-10); + + EXPECT_NEAR(calc_dudv_0[i], exp_dudv[order_u][0][i], 1e-10); + EXPECT_NEAR(calc_dudv_1[i], exp_dudv[order_u][1][i], 1e-10); + EXPECT_NEAR(calc_dudv_2[i], exp_dudv[order_u][2][i], 1e-10); + } + } +} + +//------------------------------------------------------------------------------ +TEST(primal_bezierpatch, rational_batch_derivatives) +{ + const int DIM = 3; + using CoordType = double; + using PointType = primal::Point; + using VectorType = primal::Vector; + using BezierPatchType = primal::BezierPatch; + + const int max_order_u = 3; + const int order_v = 4; + + // clang-format off + PointType controlPoints[(max_order_u + 1) * (order_v + 1)] = { + PointType {0, 0, 0}, PointType{0, 4, 0}, PointType{0, 8, -3}, PointType{0, 12, 1}, PointType{0, 16, 3}, + PointType {2, 0, 6}, PointType{2, 4, 5}, PointType{2, 8, 0}, PointType{4, 12, 2}, PointType{2, 16, 2}, + PointType {4, 0, 0}, PointType{4, 4, 5}, PointType{4, 8, 3}, PointType{2, 12, 3}, PointType{4, 16, 1}, + PointType {6, 0, 0}, PointType{6, 4, -3}, PointType{6, 8, 0}, PointType{6, 12, 2}, PointType{6, 16, 0}}; + + double weights[(max_order_u + 1) * (order_v + 1)] = { + 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 2.0, 3.0, 2.0, 1.0, + 1.0, 2.0, 3.0, 2.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0}; + // clang-format on + + PointType batch1_val, batch2_val, batch3_val; + VectorType batch1_du, batch1_dv; + VectorType batch2_du, batch2_dv, batch2_dudv; + VectorType batch3_du, batch3_dv, batch3_dudu, batch3_dvdv, batch3_dudv; + + const double u = 0.4, v = 0.6; + + // For each test order, construct a Bezier patch using the first order_u + 1 + // rows of control points and weights + for(int order_u = 0; order_u <= max_order_u; ++order_u) + { + BezierPatchType patch(controlPoints, weights, order_u, order_v); + + patch.evaluate_first_derivatives(u, v, batch1_val, batch1_du, batch1_dv); + patch.evaluate_linear_derivatives(u, + v, + batch2_val, + batch2_du, + batch2_dv, + batch2_dudv); + patch.evaluate_second_derivatives(u, + v, + batch3_val, + batch3_du, + batch3_dv, + batch3_dudu, + batch3_dvdv, + batch3_dudv); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(patch.evaluate(u, v)[i], batch1_val[i], 1e-13); + EXPECT_NEAR(patch.du(u, v)[i], batch1_du[i], 1e-13); + EXPECT_NEAR(patch.dv(u, v)[i], batch1_dv[i], 1e-13); + + EXPECT_NEAR(patch.evaluate(u, v)[i], batch2_val[i], 1e-13); + EXPECT_NEAR(patch.du(u, v)[i], batch2_du[i], 1e-13); + EXPECT_NEAR(patch.dv(u, v)[i], batch2_dv[i], 1e-13); + EXPECT_NEAR(patch.dudv(u, v)[i], batch2_dudv[i], 1e-13); + + EXPECT_NEAR(patch.evaluate(u, v)[i], batch3_val[i], 1e-13); + EXPECT_NEAR(patch.du(u, v)[i], batch2_du[i], 1e-13); + EXPECT_NEAR(patch.dv(u, v)[i], batch2_dv[i], 1e-13); + EXPECT_NEAR(patch.dudu(u, v)[i], batch3_dudu[i], 1e-13); + EXPECT_NEAR(patch.dvdv(u, v)[i], batch3_dvdv[i], 1e-13); + EXPECT_NEAR(patch.dudv(u, v)[i], batch3_dudv[i], 1e-13); + } + + // Swap the axes and check that the derivatives are correct + patch.swapAxes(); + + patch.evaluate_first_derivatives(u, v, batch1_val, batch1_du, batch1_dv); + patch.evaluate_linear_derivatives(u, + v, + batch2_val, + batch2_du, + batch2_dv, + batch2_dudv); + patch.evaluate_second_derivatives(u, + v, + batch3_val, + batch3_du, + batch3_dv, + batch3_dudu, + batch3_dvdv, + batch3_dudv); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(patch.evaluate(u, v)[i], batch1_val[i], 1e-13); + EXPECT_NEAR(patch.du(u, v)[i], batch1_du[i], 1e-13); + EXPECT_NEAR(patch.dv(u, v)[i], batch1_dv[i], 1e-13); + + EXPECT_NEAR(patch.evaluate(u, v)[i], batch2_val[i], 1e-13); + EXPECT_NEAR(patch.du(u, v)[i], batch2_du[i], 1e-13); + EXPECT_NEAR(patch.dv(u, v)[i], batch2_dv[i], 1e-13); + EXPECT_NEAR(patch.dudv(u, v)[i], batch2_dudv[i], 1e-13); + + EXPECT_NEAR(patch.evaluate(u, v)[i], batch3_val[i], 1e-13); + EXPECT_NEAR(patch.du(u, v)[i], batch3_du[i], 1e-13); + EXPECT_NEAR(patch.dv(u, v)[i], batch3_dv[i], 1e-13); + EXPECT_NEAR(patch.dudu(u, v)[i], batch3_dudu[i], 1e-13); + EXPECT_NEAR(patch.dvdv(u, v)[i], batch3_dvdv[i], 1e-13); + EXPECT_NEAR(patch.dudv(u, v)[i], batch3_dudv[i], 1e-13); + } + } +} + //------------------------------------------------------------------------------ TEST(primal_bezierpatch, split_degenerate) { @@ -604,7 +937,7 @@ TEST(primal_bezierpatch, split_degenerate) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order_u = 0; const int order_v = 0; @@ -636,7 +969,7 @@ TEST(primal_bezierpatch, split_curve) using CoordType = double; using PointType = primal::Point; using BezierCurveType = primal::BezierCurve; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order = 3; PointType data[order + 1] = {PointType {0.6, 1.2, 1.0}, @@ -680,7 +1013,7 @@ TEST(primal_bezierpatch, split_plane) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order_u = 1; const int order_v = 1; @@ -717,7 +1050,7 @@ TEST(primal_bezierpatch, split_patch) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int order_u = 3; const int order_v = 2; @@ -757,7 +1090,7 @@ TEST(primal_bezierpatch, isPlanar) using CoordType = double; using PointType = primal::Point; using VectorType = primal::Vector; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; // order (0, 0) -- always true { @@ -837,7 +1170,7 @@ TEST(primal_bezierpatch, reverse_orientation) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; SLIC_INFO("Testing reverseOrientation(axis) on Bezier patches"); @@ -929,7 +1262,7 @@ TEST(primal_bezierpatch, rational_evaluation_split) const int DIM = 3; using CoordType = double; using PointType = primal::Point; - using BezierPatchType = primal::BezierPatch; + using BezierPatchType = primal::BezierPatch; const int ord_u = 3; const int ord_v = 3; diff --git a/src/axom/primal/tests/primal_bounding_box_intersect.cpp b/src/axom/primal/tests/primal_bounding_box_intersect.cpp index fbf3241962..9e8781b844 100644 --- a/src/axom/primal/tests/primal_bounding_box_intersect.cpp +++ b/src/axom/primal/tests/primal_bounding_box_intersect.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_boundingbox.cpp b/src/axom/primal/tests/primal_boundingbox.cpp index e928ef7a67..6c8f1ad8ec 100644 --- a/src/axom/primal/tests/primal_boundingbox.cpp +++ b/src/axom/primal/tests/primal_boundingbox.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,7 +14,7 @@ #include "axom/primal/geometry/Point.hpp" #include "axom/primal/geometry/BoundingBox.hpp" -using namespace axom; +namespace primal = axom::primal; //------------------------------------------------------------------------------ template @@ -48,10 +48,10 @@ void check_bb_policy() //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_default_constructor) { - static const int DIM = 2; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 2; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; QBBox bbox; EXPECT_FALSE(bbox.isValid()) << "Default constructed bounding box is invalid"; @@ -64,10 +64,10 @@ TEST(primal_boundingBox, bb_default_constructor) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_ctor_from_singlePt) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; QPoint pt1; QPoint pt2(2); @@ -92,10 +92,10 @@ TEST(primal_boundingBox, bb_ctor_from_singlePt) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_ctor_from_twoPoints) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; QPoint pt1(1); QPoint pt2(3); @@ -129,7 +129,6 @@ TEST(primal_boundingBox, bb_ctor_from_twoPoints) const int val = 10; QPoint pt101 = QPoint::make_point(val, 0, val); QPoint pt010 = QPoint::make_point(0, val, 0); - ; QPoint midPt2 = QPoint::midpoint(pt101, pt010); QBBox bbox3(pt101, pt010); @@ -146,10 +145,10 @@ TEST(primal_boundingBox, bb_ctor_from_twoPoints) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_ctor_from_many_points) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; // test single point QPoint pt1(0.); @@ -179,10 +178,10 @@ TEST(primal_boundingBox, bb_ctor_from_many_points) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_addPoint) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; QPoint pt1(1); QPoint pt2(3); @@ -203,8 +202,7 @@ TEST(primal_boundingBox, bb_addPoint) bbox1.addPoint(pt10); EXPECT_TRUE(bbox1.contains(pt10)); - // Testing that if we add a point, then points outside the bounds remain - // outside + // Testing that if we add a point, then points outside the bounds remain outside EXPECT_FALSE(bbox1.contains(pt30)); bbox1.addPoint(pt20); // note: adding 20, but testing 30 EXPECT_FALSE(bbox1.contains(pt30)); @@ -213,10 +211,10 @@ TEST(primal_boundingBox, bb_addPoint) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_test_clear) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; QPoint pt1(1); QPoint pt2(3); @@ -242,10 +240,10 @@ TEST(primal_boundingBox, bb_test_clear) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_copy_and_assignment) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; QPoint pt1(1); QPoint pt2(3); @@ -261,8 +259,7 @@ TEST(primal_boundingBox, bb_copy_and_assignment) EXPECT_EQ(bbox1.getMax(), bbox2.getMax()); EXPECT_TRUE(bbox2.contains(midPt)); - QBBox bbox3(pt2); // some initialization that we don't care - // about + QBBox bbox3(pt2); // some initialization that we don't care about EXPECT_TRUE(bbox3.isValid()); EXPECT_FALSE(bbox3.contains(pt1)); bbox3 = bbox1; // assignment operation @@ -284,10 +281,10 @@ TEST(primal_boundingBox, bb_copy_and_assignment) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_test_equality) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; QPoint pt1(1); QPoint pt2(3); @@ -325,10 +322,10 @@ TEST(primal_boundingBox, bb_test_equality) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_add_box) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; // SLIC_INFO("Testing addBox() for two simple bounding boxes"); @@ -395,12 +392,12 @@ TEST(primal_boundingBox, bb_add_box) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_different_coord_types) { - static const int DIM = 3; - typedef primal::Point PointD; - typedef primal::BoundingBox BBoxD; + constexpr int DIM = 3; + using PointD = primal::Point; + using BBoxD = primal::BoundingBox; - typedef primal::Point PointI; - typedef primal::BoundingBox BBoxI; + using PointI = primal::Point; + using BBoxI = primal::BoundingBox; // checking that an integer point is in the double bounding box BBoxD dBox(PointD(1.), PointD(3.)); @@ -428,13 +425,74 @@ TEST(primal_boundingBox, bb_different_coord_types) EXPECT_FALSE(iBox.contains(PointD(4.25))); } +//------------------------------------------------------------------------------ +TEST(primal_boundingBox, bb_contains_bb) +{ + constexpr int DIM = 3; + constexpr double ONE_THIRD = 1. / 3.; + constexpr double TWO_THIRDS = 2. / 3.; + + using PointD = primal::Point; + using BBoxD = primal::BoundingBox; + + BBoxD unit_box; + unit_box.addPoint(PointD(0.)); + unit_box.addPoint(PointD(1.)); + + const BBoxD empty_box; + const BBoxD empty_box2; + + // check identity + { + EXPECT_TRUE(unit_box.contains(unit_box)); + } + + // check contains w/ empty boxes + { + EXPECT_TRUE(unit_box.contains(empty_box)); + EXPECT_FALSE(empty_box.contains(unit_box)); + + EXPECT_TRUE(empty_box.contains(empty_box2)); + } + + // check full overlap + { + BBoxD other_box; + other_box.addPoint(PointD(ONE_THIRD)); + other_box.addPoint(PointD(TWO_THIRDS)); + + EXPECT_TRUE(unit_box.contains(other_box)); + EXPECT_FALSE(other_box.contains(unit_box)); + } + + // check full overlap, one point at boundary + { + BBoxD other_box; + other_box.addPoint(PointD(ONE_THIRD)); + other_box.addPoint(PointD(1.)); + + EXPECT_TRUE(unit_box.contains(other_box)); + EXPECT_FALSE(other_box.contains(unit_box)); + } + + // check partial overlap + { + BBoxD other_box; + other_box.addPoint(PointD(0.5)); + other_box.addPoint(PointD(1.5)); + + EXPECT_FALSE(unit_box.contains(other_box)); + EXPECT_FALSE(other_box.contains(unit_box)); + } +} + //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_expand) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; // SLIC_INFO("Testing bounding box inflate"); @@ -467,10 +525,10 @@ TEST(primal_boundingBox, bb_expand) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_scale) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; // SLIC_INFO("Testing bounding box scale"); @@ -515,11 +573,11 @@ TEST(primal_boundingBox, bb_scale) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_shift) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; - typedef primal::Vector QVec; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; + using QVec = primal::Vector; // SLIC_INFO("Testing bounding box shift"); @@ -545,9 +603,7 @@ TEST(primal_boundingBox, bb_shift) //------------------------------------------------------------------------------ TEST(primal_boundingBox, highest_lowest_values) { - using namespace axom::primal; - - static const int DIM = 3; + constexpr int DIM = 3; // Testing that our type trait for highest and lowest values // is doing the right thing in our CXX11 and pre-CXX11 compilers @@ -576,27 +632,24 @@ TEST(primal_boundingBox, highest_lowest_values) EXPECT_EQ(maxU, std::numeric_limits::max()); EXPECT_EQ(minU, std::numeric_limits::lowest()); - // Testing that our default constructor for bounding boxes is properly - // setting the range. + // Testing that our default constructor for bounding boxes is properly setting the range. - // Note: The bounds are intentionally in the reverse order -- this is how we - // ensure - // that adding a point to an empty bounding box always updates the bounds - // properly + // Note: The bounds are intentionally in the reverse order -- this is how we ensure + // that adding a point to an empty bounding box always updates the bounds properly - typedef primal::BoundingBox BBoxD; + using BBoxD = primal::BoundingBox; EXPECT_TRUE(BBoxD().getMin()[0] > 0); EXPECT_TRUE(BBoxD().getMax()[0] < 0); - typedef primal::BoundingBox BBoxF; + using BBoxF = primal::BoundingBox; EXPECT_TRUE(BBoxF().getMin()[0] > 0); EXPECT_TRUE(BBoxF().getMax()[0] < 0); - typedef primal::BoundingBox BBoxI; + using BBoxI = primal::BoundingBox; EXPECT_TRUE(BBoxI().getMin()[0] > 0); EXPECT_TRUE(BBoxI().getMax()[0] < 0); - typedef primal::BoundingBox BBoxU; + using BBoxU = primal::BoundingBox; EXPECT_TRUE(BBoxU().getMin()[0] > 0); EXPECT_TRUE(BBoxU().getMax()[0] == 0); } @@ -604,19 +657,19 @@ TEST(primal_boundingBox, highest_lowest_values) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_longest_dimension) { - typedef primal::Point PointType; - typedef primal::BoundingBox BoxType; + using PointType = primal::Point; + using BoxType = primal::BoundingBox; - BoxType bbox(PointType::zero(), PointType::make_point(5.0, 10.0)); - int longest_dimension = bbox.getLongestDimension(); + const BoxType bbox(PointType::zero(), PointType::make_point(5.0, 10.0)); + const int longest_dimension = bbox.getLongestDimension(); EXPECT_EQ(1, longest_dimension); } //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_bisect) { - typedef primal::Point PointType; - typedef primal::BoundingBox BoxType; + using PointType = primal::Point; + using BoxType = primal::BoundingBox; BoxType bbox(PointType::zero(), PointType::ones()); @@ -642,8 +695,8 @@ TEST(primal_boundingBox, bb_bisect) //------------------------------------------------------------------------------ TEST(primal_boundingBox, bb_get_centroid) { - typedef primal::Point PointType; - typedef primal::BoundingBox BoxType; + using PointType = primal::Point; + using BoxType = primal::BoundingBox; BoxType bbox(PointType::zero(), PointType::ones()); PointType centroid = bbox.getCentroid(); diff --git a/src/axom/primal/tests/primal_clip.cpp b/src/axom/primal/tests/primal_clip.cpp index 97257033f2..c3bfe21757 100644 --- a/src/axom/primal/tests/primal_clip.cpp +++ b/src/axom/primal/tests/primal_clip.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -20,6 +20,7 @@ #include "axom/primal/operators/clip.hpp" #include "axom/primal/operators/intersection_volume.hpp" #include "axom/primal/operators/split.hpp" +#include "axom/primal/operators/compute_bounding_box.hpp" #include @@ -41,62 +42,120 @@ using PolyhedronType = axom::primal::Polyhedron; TEST(primal_clip, simple_clip) { using namespace Primal3D; - BoundingBoxType bbox; - bbox.addPoint(PointType::zero()); - bbox.addPoint(PointType::ones()); - - PointType points[] = { - PointType {2, 2, 2}, - PointType {2, 2, 4}, - PointType {2, 4, 2}, - - PointType {-100, -100, 0.5}, - PointType {-100, 100, 0.5}, - PointType {100, 0, 0.5}, - - PointType {0.25, 0.25, 0.5}, - PointType {0.75, 0.25, 0.5}, - PointType {0.66, 0.5, 0.5}, - PointType {1.5, 0.5, 0.5}, - }; - - { - TriangleType tri(points[0], points[1], points[2]); - - PolygonType poly = axom::primal::clip(tri, bbox); - EXPECT_EQ(0, poly.numVertices()); - } - { - TriangleType tri(points[3], points[4], points[5]); + // all checks in this test are against the cube [-1,-1,-1] to [1,1,1] + BoundingBoxType bbox; + bbox.addPoint(PointType {-1, -1, -1}); + bbox.addPoint(PointType {1, 1, 1}); - PolygonType poly = axom::primal::clip(tri, bbox); - EXPECT_EQ(4, poly.numVertices()); + // define a slightly inflated bbox for containment tests + constexpr double EPS = 1e-8; + BoundingBoxType expanded_bbox(bbox); + expanded_bbox.expand(EPS); - SLIC_INFO("Intersection of triangle " << tri << " and bounding box " << bbox - << " is polygon" << poly); - } + std::vector> test_cases; + // add a bunch of test cases { - TriangleType tri(points[3], points[4], points[5]); - - PolygonType poly = axom::primal::clip(tri, bbox); - EXPECT_EQ(4, poly.numVertices()); - - EXPECT_EQ(PointType(.5), poly.vertexMean()); - - SLIC_INFO("Intersection of triangle " << tri << " and bounding box " << bbox - << " is polygon" << poly); + // this triangle is clearly outside the reference cube + test_cases.push_back(std::make_pair( + TriangleType {PointType {2, 2, 2}, PointType {2, 2, 4}, PointType {2, 4, 2}}, + 0)); + + // triangle at z=0 that spans entire cube + test_cases.push_back(std::make_pair(TriangleType {PointType {-100, -100, 0.}, + PointType {-100, 100, 0.}, + PointType {100, 0, 0.}}, + 4)); + + // triangle at z=0 w/ two vertices inside unit cube + test_cases.push_back(std::make_pair(TriangleType {PointType {0.25, 0.25, 0.}, + PointType {0.75, 0.25, 0.}, + PointType {1.5, 0.5, 0.}}, + 4)); + + // triangle at z=0 w/ vertices aligned w/ bounding box planes + test_cases.push_back(std::make_pair(TriangleType {PointType {2, 1, 0.}, + PointType {2, 2, 0.}, + PointType {1, 2, 0.}}, + 0)); + + // triangle at z=0 w/ one vertex coincident w/ cube + test_cases.push_back(std::make_pair(TriangleType {PointType {1, 2, 0.}, + PointType {1, 1, 0.}, + PointType {2, 1, 0.}}, + 0)); + + // triangle at z=0 w/ one edge midpoint coincident w/ cube + test_cases.push_back(std::make_pair(TriangleType {PointType {0, 2, 0.}, + PointType {2, 0, 0.}, + PointType {2, 2, 0.}}, + 0)); + + // triangle at z=0 w/ one edge coincident w/ unit cube and the other outside + test_cases.push_back(std::make_pair(TriangleType {PointType {-10, 1, 0.}, + PointType {10, 1, 0.}, + PointType {0, 10, 0.}}, + 0)); + + // triangle at z=0 w/ one edge coincident w/ unit cube and the last vertex inside + test_cases.push_back(std::make_pair(TriangleType {PointType {-10, 1, 0.}, + PointType {10, 1, 0.}, + PointType {0, 0, 0.}}, + 5)); + + // triangle at z=0 w/ one edge coincident w/ unit cube and the last vertex on the other side + test_cases.push_back(std::make_pair(TriangleType {PointType {-10, 1, 0.}, + PointType {10, 1, 0.}, + PointType {0, -10, 0.}}, + 4)); + + // triangle at z=1 w/ one edge coincident w/ unit cube and the last vertex on the other side + test_cases.push_back(std::make_pair(TriangleType {PointType {-10, 1, 1.}, + PointType {10, 1, 1.}, + PointType {0, -10, 1.}}, + 4)); + + // triangle at z=.5 w/ two vertices inside cube and one to the left + test_cases.push_back(std::make_pair(TriangleType {PointType {-2, .25, .5}, + PointType {.25, .25, .5}, + PointType {.25, .75, .5}}, + 4)); + + // triangle at z=.5 w/ two vertices inside cube and one to the left + test_cases.push_back(std::make_pair(TriangleType {PointType {-2, .25, .5}, + PointType {.75, .25, .5}, + PointType {.75, .75, .5}}, + 4)); + + // all vertices outside cube, one vertex above, one vertex to the left and one to the top left + test_cases.push_back(std::make_pair(TriangleType {PointType {.9, 100, .5}, + PointType {100, -1, .5}, + PointType {100, 100, .5}}, + 0)); } + // check each test case + for(const auto& pair : test_cases) { - TriangleType tri(points[6], points[7], points[9]); + const auto& tri = pair.first; + const int expected_verts = pair.second; PolygonType poly = axom::primal::clip(tri, bbox); - EXPECT_EQ(4, poly.numVertices()); - SLIC_INFO("Intersection of triangle " << tri << " and bounding box " << bbox - << " is polygon" << poly); + SLIC_INFO( + axom::fmt::format("Intersection of triangle {} and bbox {} is polygon {}", + tri, + bbox, + poly)); + + // The clipped polygon + // ... should have the expected number of vertices + EXPECT_EQ(expected_verts, poly.numVertices()); + // ... should lie inside the bounding box (inflated by EPS to deal w/ boundaries) + EXPECT_TRUE(expanded_bbox.contains(axom::primal::compute_bounding_box(poly))); + // ... and its area should be at most that of the original triangle + EXPECT_GE(tri.area(), poly.area()); } } @@ -362,7 +421,7 @@ void check_hex_tet_clip(double EPS) { using namespace Primal3D; - constexpr bool CHECK_SIGN = true; + constexpr bool CHECK_ORIENTATION = true; // Save current/default allocator const int current_allocator = axom::getDefaultAllocatorID(); @@ -397,7 +456,7 @@ void check_hex_tet_clip(double EPS) axom::primal::intersection_volume(hex[0], tet[0]), EPS); - // Test checkSign optional parameter using shapes with negative volumes + // Test tryFixOrientation optional parameter using shapes with negative volumes axom::utilities::swap(tet[0][1], tet[0][2]); axom::utilities::swap(hex[0][1], hex[0][3]); axom::utilities::swap(hex[0][5], hex[0][7]); @@ -408,14 +467,16 @@ void check_hex_tet_clip(double EPS) axom::for_all( 1, AXOM_LAMBDA(int i) { - res[i] = axom::primal::clip(hex[i], tet[i], EPS, CHECK_SIGN); + res[i] = axom::primal::clip(hex[i], tet[i], EPS, CHECK_ORIENTATION); }); EXPECT_NEAR(0.1666, res[0].volume(), EPS); - EXPECT_NEAR( - 0.1666, - axom::primal::intersection_volume(hex[0], tet[0], EPS, CHECK_SIGN), - EPS); + EXPECT_NEAR(0.1666, + axom::primal::intersection_volume(hex[0], + tet[0], + EPS, + CHECK_ORIENTATION), + EPS); axom::deallocate(tet); axom::deallocate(hex); @@ -429,7 +490,7 @@ void check_oct_tet_clip(double EPS) { using namespace Primal3D; - constexpr bool CHECK_SIGN = true; + constexpr bool CHECK_ORIENTATION = true; // Save current/default allocator const int current_allocator = axom::getDefaultAllocatorID(); @@ -463,7 +524,7 @@ void check_oct_tet_clip(double EPS) axom::primal::intersection_volume(oct[0], tet[0]), EPS); - // Test checkSign optional parameter using shapes with negative volumes + // Test tryFixOrientation optional parameter using shapes with negative volumes axom::utilities::swap(tet[0][1], tet[0][2]); axom::utilities::swap(oct[0][1], oct[0][2]); axom::utilities::swap(oct[0][4], oct[0][5]); @@ -473,14 +534,16 @@ void check_oct_tet_clip(double EPS) axom::for_all( 1, AXOM_LAMBDA(int i) { - res[i] = axom::primal::clip(oct[i], tet[i], EPS, CHECK_SIGN); + res[i] = axom::primal::clip(oct[i], tet[i], EPS, CHECK_ORIENTATION); }); EXPECT_NEAR(0.1666, res[0].volume(), EPS); - EXPECT_NEAR( - 0.1666, - axom::primal::intersection_volume(oct[0], tet[0], EPS, CHECK_SIGN), - EPS); + EXPECT_NEAR(0.1666, + axom::primal::intersection_volume(oct[0], + tet[0], + EPS, + CHECK_ORIENTATION), + EPS); axom::deallocate(tet); axom::deallocate(oct); @@ -494,7 +557,7 @@ void check_tet_tet_clip(double EPS) { using namespace Primal3D; - constexpr bool CHECK_SIGN = true; + constexpr bool CHECK_ORIENTATION = true; // Save current/default allocator const int current_allocator = axom::getDefaultAllocatorID(); @@ -526,7 +589,7 @@ void check_tet_tet_clip(double EPS) axom::primal::intersection_volume(tet1[0], tet2[0]), EPS); - // Test checkSign optional parameter using shapes with negative volumes + // Test tryFixOrientation optional parameter using shapes with negative volumes axom::utilities::swap(tet1[0][1], tet1[0][2]); axom::utilities::swap(tet2[0][1], tet2[0][2]); @@ -536,14 +599,16 @@ void check_tet_tet_clip(double EPS) axom::for_all( 1, AXOM_LAMBDA(int i) { - res[i] = axom::primal::clip(tet1[i], tet2[i], EPS, CHECK_SIGN); + res[i] = axom::primal::clip(tet1[i], tet2[i], EPS, CHECK_ORIENTATION); }); EXPECT_NEAR(0.0833, res[0].volume(), EPS); - EXPECT_NEAR( - 0.0833, - axom::primal::intersection_volume(tet1[0], tet2[0], EPS, CHECK_SIGN), - EPS); + EXPECT_NEAR(0.0833, + axom::primal::intersection_volume(tet1[0], + tet2[0], + EPS, + CHECK_ORIENTATION), + EPS); axom::deallocate(tet1); axom::deallocate(tet2); @@ -813,6 +878,50 @@ TEST(primal_clip, hex_tet_clip_point) EXPECT_EQ(axom::primal::clip(tet, hex).volume(), poly.volume()); } +// Tetrahedron with a negative volume clips hexahedron +TEST(primal_clip, hex_tet_negative_tet_vol) +{ + using namespace Primal3D; + constexpr double EPS = 1e-4; + constexpr bool CHECK_ORIENTATION = true; + + TetrahedronType tet(PointType {0.0774795, -11.3217, -33.5237}, + PointType {0.482086, -12.283, -33.5237}, + PointType {-0.503954, -12.216, -33.5237}, + PointType {0.0368068, -12.1403, -33.4339}); + HexahedronType hex(PointType {0, -12.1295, -33.6323}, + PointType {0, -12.2774, -33.6323}, + PointType {0.185429, -12.276, -33.6323}, + PointType {0.183195, -12.1281, -33.6323}, + PointType {0, -12.1295, -33.5186}, + PointType {0, -12.2774, -33.5186}, + PointType {0.185429, -12.276, -33.5186}, + PointType {0.183195, -12.1281, -33.5186}); + + // Clipped polyhedron has volume of zero due to tetrahedron orientation + PolyhedronType zeroPoly = axom::primal::clip(hex, tet); + + EXPECT_EQ(0.0, zeroPoly.volume()); + EXPECT_EQ(0.0, axom::primal::intersection_volume(hex, tet)); + EXPECT_EQ(0.0, axom::primal::intersection_volume(tet, hex)); + EXPECT_EQ(axom::primal::clip(tet, hex).volume(), zeroPoly.volume()); + + // Run clip operation with orientation flag enabled to fix tetrahedron + PolyhedronType fixedPoly = axom::primal::clip(hex, tet, EPS, CHECK_ORIENTATION); + + EXPECT_NEAR(0.00011, fixedPoly.volume(), EPS); + EXPECT_NEAR( + 0.00011, + axom::primal::intersection_volume(hex, tet, EPS, CHECK_ORIENTATION), + EPS); + EXPECT_NEAR( + 0.00011, + axom::primal::intersection_volume(tet, hex, EPS, CHECK_ORIENTATION), + EPS); + EXPECT_EQ(axom::primal::clip(tet, hex, EPS, CHECK_ORIENTATION).volume(), + fixedPoly.volume()); +} + // Tetrahedron does not clip octahedron. TEST(primal_clip, oct_tet_clip_nonintersect) { @@ -966,7 +1075,7 @@ TEST(primal_clip, oct_tet_clip_special_case_1) { using namespace Primal3D; constexpr double EPS = 1e-4; - constexpr bool CHECK_SIGN = true; + constexpr bool CHECK_ORIENTATION = true; TetrahedronType tet(PointType {0.5, 0.5, 0.5}, PointType {1, 1, 0}, @@ -999,18 +1108,18 @@ TEST(primal_clip, oct_tet_clip_special_case_1) EXPECT_NEAR(0.0251, octPoly.volume(), EPS); - PolyhedronType poly = axom::primal::clip(oct, tet, EPS, CHECK_SIGN); + PolyhedronType poly = axom::primal::clip(oct, tet, EPS, CHECK_ORIENTATION); EXPECT_NEAR(0.0041, poly.volume(), EPS); EXPECT_NEAR( 0.0041, - axom::primal::intersection_volume(oct, tet, EPS, CHECK_SIGN), + axom::primal::intersection_volume(oct, tet, EPS, CHECK_ORIENTATION), EPS); EXPECT_NEAR( 0.0041, - axom::primal::intersection_volume(tet, oct, EPS, CHECK_SIGN), + axom::primal::intersection_volume(tet, oct, EPS, CHECK_ORIENTATION), EPS); - EXPECT_NEAR(axom::primal::clip(tet, oct, EPS, CHECK_SIGN).volume(), + EXPECT_NEAR(axom::primal::clip(tet, oct, EPS, CHECK_ORIENTATION).volume(), poly.volume(), EPS); } @@ -1019,7 +1128,7 @@ TEST(primal_clip, oct_tet_clip_special_case_2) { using namespace Primal3D; constexpr double EPS = 1e-4; - constexpr bool CHECK_SIGN = true; + constexpr bool CHECK_ORIENTATION = true; TetrahedronType tet(PointType {0.5, 0.5, 0.5}, PointType {0, 1, 0}, @@ -1052,18 +1161,18 @@ TEST(primal_clip, oct_tet_clip_special_case_2) EXPECT_NEAR(0.0251, octPoly.volume(), EPS); - PolyhedronType poly = axom::primal::clip(oct, tet, EPS, CHECK_SIGN); + PolyhedronType poly = axom::primal::clip(oct, tet, EPS, CHECK_ORIENTATION); EXPECT_NEAR(0.0041, poly.volume(), EPS); EXPECT_NEAR( 0.0041, - axom::primal::intersection_volume(oct, tet, EPS, CHECK_SIGN), + axom::primal::intersection_volume(oct, tet, EPS, CHECK_ORIENTATION), EPS); EXPECT_NEAR( 0.0041, - axom::primal::intersection_volume(tet, oct, EPS, CHECK_SIGN), + axom::primal::intersection_volume(tet, oct, EPS, CHECK_ORIENTATION), EPS); - EXPECT_NEAR(axom::primal::clip(tet, oct, EPS, CHECK_SIGN).volume(), + EXPECT_NEAR(axom::primal::clip(tet, oct, EPS, CHECK_ORIENTATION).volume(), poly.volume(), EPS); } @@ -1223,7 +1332,7 @@ TEST(primal_clip, tet_tet_clip_split) { using namespace Primal3D; constexpr double EPS = 1e-4; - constexpr bool CHECK_SIGN = true; + constexpr bool CHECK_ORIENTATION = true; TetrahedronType tet(PointType {0.5, 0.5, 2}, PointType {2, -1, 0}, @@ -1253,7 +1362,7 @@ TEST(primal_clip, tet_tet_clip_split) for(int i = 0; i < split_tets.size(); i++) { tet_volumes += - (axom::primal::clip(split_tets[i], tet, EPS, CHECK_SIGN)).volume(); + (axom::primal::clip(split_tets[i], tet, EPS, CHECK_ORIENTATION)).volume(); } // Expected result should still be 0.3333 @@ -1264,7 +1373,7 @@ TEST(primal_clip, tet_tet_clip_special_case_1) { using namespace Primal3D; constexpr double EPS = 1e-10; - constexpr bool CHECK_SIGN = true; + constexpr bool CHECK_ORIENTATION = true; // Tets do not intersect, but share a face TetrahedronType tet1(PointType {0.5, 0.5, -0.125}, @@ -1277,19 +1386,209 @@ TEST(primal_clip, tet_tet_clip_special_case_1) PointType {0.125, 0, -0.25}, PointType {0.125, 0.0625, -0.234375}); - PolyhedronType poly = axom::primal::clip(tet1, tet2, EPS, CHECK_SIGN); + PolyhedronType poly = axom::primal::clip(tet1, tet2, EPS, CHECK_ORIENTATION); EXPECT_NEAR(0.00, poly.volume(), EPS); EXPECT_NEAR( 0.00, - axom::primal::intersection_volume(tet2, tet1, EPS, CHECK_SIGN), + axom::primal::intersection_volume(tet2, tet1, EPS, CHECK_ORIENTATION), EPS); EXPECT_NEAR( 0.00, - axom::primal::intersection_volume(tet1, tet2, EPS, CHECK_SIGN), + axom::primal::intersection_volume(tet1, tet2, EPS, CHECK_ORIENTATION), EPS); } +TEST(primal_clip, tet_plane_intersect_none_below) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Plane intersects one vertex of tet + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, 0.0, -1.0}, PointType {0.0, 0.0, -0.5}); + + PolyhedronType poly = axom::primal::clip(tet, plane, EPS, CHECK_SIGN); + + EXPECT_NEAR(0.0, poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_intersect_none_above) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Plane intersects one vertex of tet + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, 0.0, 1.0}, PointType {0.0, 0.0, -0.5}); + + PolyhedronType poly = axom::primal::clip(tet, plane, EPS, CHECK_SIGN); + + EXPECT_NEAR(tet.signedVolume(), poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_border_vertex_below) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Plane intersects one vertex of tet + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, 0.0, 1.0}, PointType {0.0, 0.0, 1.0}); + + PolyhedronType poly = axom::primal::clip(tet, plane, EPS, CHECK_SIGN); + + EXPECT_NEAR(0.0, poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_border_vertex_above) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Plane intersects one vertex of tet + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, 0.0, -1.0}, PointType {0.0, 0.0, 1.0}); + + PolyhedronType poly = axom::primal::clip(tet, plane, EPS, CHECK_SIGN); + + EXPECT_NEAR(tet.signedVolume(), poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_border_edge_below) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Plane intersects one edge of tet + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, -1.0, -1.0}, 0.0); + + PolyhedronType poly = axom::primal::clip(tet, plane, EPS, CHECK_SIGN); + + EXPECT_NEAR(0.0, poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_border_edge_above) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Plane intersects one edge of tet + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, 1.0, 1.0}, 0.0); + + PolyhedronType poly = axom::primal::clip(tet, plane, EPS, CHECK_SIGN); + + EXPECT_NEAR(tet.signedVolume(), poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_border_face_below) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Tet and plane do not intersect, but border each other + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, 0.0, -1.0}, 0.0); + + PolyhedronType poly = axom::primal::clip(plane, tet, EPS, CHECK_SIGN); + + EXPECT_NEAR(0.0, poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_border_face_above) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Tet and plane do not intersect, but border each other + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, 0.0, 1.0}, 0.0); + + PolyhedronType poly = axom::primal::clip(plane, tet, EPS, CHECK_SIGN); + + EXPECT_NEAR(tet.signedVolume(), poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_intersect_three_edges) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Plane intersects three edges of tet + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 0.0, 0.0}, + PointType {0.0, 1.0, 0.0}, + PointType {0.0, 0.0, 1.0}); + + PlaneType plane(VectorType {-1.0, 0.0, 1.0}, 0.0); + + PolyhedronType poly = axom::primal::clip(plane, tet, EPS, CHECK_SIGN); + + EXPECT_NEAR(tet.signedVolume() / 2.0, poly.signedVolume(), EPS); +} + +TEST(primal_clip, tet_plane_intersect_four_edges) +{ + using namespace Primal3D; + constexpr double EPS = 1e-10; + constexpr bool CHECK_SIGN = true; + + // Plane intersects four edges of tet + TetrahedronType tet(PointType {0.0, 0.0, 0.0}, + PointType {1.0, 1.0, 0.0}, + PointType {0.0, 1.0, 1.0}, + PointType {1.0, 0.0, 1.0}); + + PlaneType plane(VectorType {0.0, 0.0, 1.0}, 0.5); + + PolyhedronType poly = axom::primal::clip(plane, tet, EPS, CHECK_SIGN); + + EXPECT_NEAR(tet.signedVolume() / 2.0, poly.signedVolume(), EPS); +} + //------------------------------------------------------------------------------ int main(int argc, char* argv[]) { diff --git a/src/axom/primal/tests/primal_closest_point.cpp b/src/axom/primal/tests/primal_closest_point.cpp index 69b2db3dd0..770af91f29 100644 --- a/src/axom/primal/tests/primal_closest_point.cpp +++ b/src/axom/primal/tests/primal_closest_point.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_compute_bounding_box.cpp b/src/axom/primal/tests/primal_compute_bounding_box.cpp index 6060cdb0c7..1f4ab4bc7c 100644 --- a/src/axom/primal/tests/primal_compute_bounding_box.cpp +++ b/src/axom/primal/tests/primal_compute_bounding_box.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -12,17 +12,18 @@ #include "axom/primal/geometry/Point.hpp" #include "axom/primal/geometry/Vector.hpp" #include "axom/primal/geometry/OrientedBoundingBox.hpp" +#include "axom/primal/geometry/Polygon.hpp" #include "axom/primal/operators/compute_bounding_box.hpp" -using namespace axom; +namespace primal = axom::primal; TEST(primal_compute_bounding_box, compute_oriented_box_test) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::Vector QVector; - typedef primal::OrientedBoundingBox QOBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QVector = primal::Vector; + using QOBBox = primal::OrientedBoundingBox; QPoint pt1; // origin QVector u[DIM]; // make standard axes @@ -66,11 +67,11 @@ TEST(primal_compute_bounding_box, compute_oriented_box_test) TEST(primal_compute_bounding_box, merge_oriented_box_test) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::Vector QVector; - typedef primal::OrientedBoundingBox QOBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QVector = primal::Vector; + using QOBBox = primal::OrientedBoundingBox; const double ONE_OVER_SQRT_TWO = 0.7071; QPoint pt1; // origin @@ -105,11 +106,11 @@ TEST(primal_compute_bounding_box, merge_oriented_box_test) TEST(primal_compute_bounding_box, merge_aligned_box_test) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::Vector QVector; - typedef primal::BoundingBox QBBox; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QVector = primal::Vector; + using QBBox = primal::BoundingBox; QPoint pt1(0.); QPoint pt2(1.); @@ -129,13 +130,61 @@ TEST(primal_compute_bounding_box, merge_aligned_box_test) EXPECT_TRUE(bbox5.contains(bbox4)); } +TEST(primal_compute_bounding_box, compute_quad_2d_box_test) +{ + constexpr int DIM = 2; + using CoordinateType = double; + using PointType = primal::Point; + using BoundingBoxType = primal::BoundingBox; + using QuadrilateralType = primal::Quadrilateral; + + PointType A {-1.0, 0.1}; + PointType B {-0.1, 0.5}; + PointType C {2.0, 0.0}; + PointType D {0.0, 1.0}; + + QuadrilateralType quad {A, B, C, D}; + BoundingBoxType box = primal::compute_bounding_box(quad); + + EXPECT_TRUE(box.contains(A)); + EXPECT_TRUE(box.contains(B)); + EXPECT_TRUE(box.contains(C)); + EXPECT_TRUE(box.contains(D)); + EXPECT_EQ(box.getMin(), (PointType {-1.0, 0.0})); + EXPECT_EQ(box.getMax(), (PointType {2.0, 1.0})); +} + +TEST(primal_compute_bounding_box, compute_quad_3d_box_test) +{ + constexpr int DIM = 3; + using CoordinateType = double; + using PointType = primal::Point; + using BoundingBoxType = primal::BoundingBox; + using QuadrilateralType = primal::Quadrilateral; + + PointType A {-1.0, 0.1, 0.0}; + PointType B {-0.1, 0.5, 0.0}; + PointType C {2.0, 0.0, 1.0}; + PointType D {0.0, 1.0, 1.0}; + + QuadrilateralType quad {A, B, C, D}; + BoundingBoxType box = primal::compute_bounding_box(quad); + + EXPECT_TRUE(box.contains(A)); + EXPECT_TRUE(box.contains(B)); + EXPECT_TRUE(box.contains(C)); + EXPECT_TRUE(box.contains(D)); + EXPECT_EQ(box.getMin(), (PointType {-1.0, 0.0, 0.0})); + EXPECT_EQ(box.getMax(), (PointType {2.0, 1.0, 1.0})); +} + TEST(primal_compute_bounding_box, compute_oct_box_test) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; - typedef primal::Octahedron QOct; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; + using QOct = primal::Octahedron; QPoint p1({1, 0, 0}); QPoint p2({1, 1, 0}); @@ -159,11 +208,11 @@ TEST(primal_compute_bounding_box, compute_oct_box_test) TEST(primal_compute_bounding_box, compute_poly_box_test) { - static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::BoundingBox QBBox; - typedef primal::Polyhedron QPoly; + constexpr int DIM = 3; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; + using QPoly = primal::Polyhedron; QPoly poly; QPoint p1({0, 0, 0}); @@ -197,9 +246,52 @@ TEST(primal_compute_bounding_box, compute_poly_box_test) EXPECT_EQ(box.getMax(), QPoint::ones()); } +TEST(primal_compute_bounding_box, compute_polygon_2) +{ + constexpr int DIM = 2; + using CoordType = double; + using QPoint = primal::Point; + using QBBox = primal::BoundingBox; + using QPoly = primal::Polygon; + + // empty polygon generates an empty (invalid) bounding box + { + QPoly empty_poly; + QBBox box = primal::compute_bounding_box(empty_poly); + EXPECT_FALSE(box.isValid()); + } + + // non-empty polygon generates expected axis-aligned bounding box + { + QPoint p1({1, 0}); + QPoint p2({5, 0}); + QPoint p3({7, 2}); + QPoint p4({9, 4}); + QPoint p5({-1, 4}); + + QPoly polygon(5); + polygon.addVertex(p1); + polygon.addVertex(p2); + polygon.addVertex(p3); + polygon.addVertex(p4); + polygon.addVertex(p5); + + QBBox box = primal::compute_bounding_box(polygon); + EXPECT_TRUE(box.contains(p1)); + EXPECT_TRUE(box.contains(p2)); + EXPECT_TRUE(box.contains(p3)); + EXPECT_TRUE(box.contains(p4)); + EXPECT_TRUE(box.contains(p5)); + + EXPECT_EQ(box.getMin(), (QPoint {-1., 0.})); + EXPECT_EQ(box.getMax(), (QPoint {9., 4.})); + } +} + int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); + axom::slic::SimpleLogger logger; #ifdef COMPUTE_BOUNDING_BOX_TESTER_SHOULD_SEED std::srand(std::time(0)); diff --git a/src/axom/primal/tests/primal_compute_moments.cpp b/src/axom/primal/tests/primal_compute_moments.cpp index 8d9ee8cd12..bf60bf5c1c 100644 --- a/src/axom/primal/tests/primal_compute_moments.cpp +++ b/src/axom/primal/tests/primal_compute_moments.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_curved_polygon.cpp b/src/axom/primal/tests/primal_curved_polygon.cpp index ce2ffce77b..46f23d88a9 100644 --- a/src/axom/primal/tests/primal_curved_polygon.cpp +++ b/src/axom/primal/tests/primal_curved_polygon.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -81,8 +81,7 @@ primal::CurvedPolygon createPolygon( subCP[i] = ControlPoints[i + iter]; } - BezierCurveType addCurve(subCP, orders[j]); - bPolygon.addEdge(addCurve); + bPolygon.addEdge(BezierCurveType {subCP, orders[j]}); iter += (orders[j]); } @@ -101,7 +100,7 @@ TEST(primal_curvedpolygon, constructor) SLIC_INFO("Testing default CurvedPolygon constructor "); CurvedPolygonType bPolygon; - int expNumEdges = 0; + const int expNumEdges = 0; EXPECT_EQ(expNumEdges, bPolygon.numEdges()); EXPECT_EQ(expNumEdges, bPolygon.getEdges().size()); EXPECT_EQ(axom::Array(), bPolygon.getEdges()); @@ -111,7 +110,7 @@ TEST(primal_curvedpolygon, constructor) SLIC_INFO("Testing CurvedPolygon numEdges constructor "); CurvedPolygonType bPolygon(1); - int expNumEdges = 1; + const int expNumEdges = 1; EXPECT_EQ(expNumEdges, bPolygon.numEdges()); EXPECT_EQ(expNumEdges, static_cast(bPolygon.getEdges().size())); } diff --git a/src/axom/primal/tests/primal_hexahedron.cpp b/src/axom/primal/tests/primal_hexahedron.cpp index 86ff5021c3..2543cc93aa 100644 --- a/src/axom/primal/tests/primal_hexahedron.cpp +++ b/src/axom/primal/tests/primal_hexahedron.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -17,7 +17,7 @@ namespace primal = axom::primal; namespace { -double volume_tet_decomp(primal::Hexahedron hex) +double signed_volume_tet_decomp(primal::Hexahedron hex) { double retVol = 0.0; axom::StackArray, 24> tets; @@ -26,7 +26,8 @@ double volume_tet_decomp(primal::Hexahedron hex) for(int i = 0; i < 24; i++) { - retVol += tets[i].volume(); + // Get the signed volumes + retVol += tets[i].signedVolume(); } return retVol; @@ -46,19 +47,45 @@ class HexahedronTest : public ::testing::Test protected: virtual void SetUp() { - EPS = 1e-12; - - // Define coordinates for first hexahedron + EPS = 1e-8; + + /* + * Define coordinates for first hexahedron: + * + * 7 +---------+ 6 +z + * |\ |\ +y + * | \ | \ < ^ + * | 4 + --------+ 5 \ | + * 3 +---|-----+ 2 | \| + * \ | \ | -----> +x + * \ | \ | + * \ | \ | + * 0 +----------+ 1 + * + */ qData0[0] = QPoint {0, 0, 0}; - qData0[1] = QPoint {0, 0, 1}; - qData0[2] = QPoint {1, 0, 1}; - qData0[3] = QPoint {1, 0, 0}; - qData0[4] = QPoint {0, 1, 0}; - qData0[5] = QPoint {0, 1, 1}; + qData0[1] = QPoint {1, 0, 0}; + qData0[2] = QPoint {1, 1, 0}; + qData0[3] = QPoint {0, 1, 0}; + qData0[4] = QPoint {0, 0, 1}; + qData0[5] = QPoint {1, 0, 1}; qData0[6] = QPoint {1, 1, 1}; - qData0[7] = QPoint {1, 1, 0}; - - // Define coordinates for second hexahedron + qData0[7] = QPoint {0, 1, 1}; + + /* + * Define coordinates for second hexahedron: + * + * 3 +---------+ 2 +y + * |\ |\ + * | \ | \ ^ + * | 7 + --------+ 6 | + * 0 +---|-----+ 1 | | + * \ | \ | -----> +x + * \ | \ | \ + * \ | \ | \ + * 4 +----------+ 5 > + * +z + */ qData1[0] = QPoint {-1, 0, 0}; qData1[1] = QPoint {0, 0, 0}; qData1[2] = QPoint {0, 1, 0}; @@ -78,11 +105,30 @@ class HexahedronTest : public ::testing::Test qData2[5] = QPoint {1.5, 1, 3.5}; qData2[6] = QPoint {3.5, 1, 3.5}; qData2[7] = QPoint {3.5, 1, 1.5}; + + // Reproducer Test Case + qData3[0] = + QPoint {-70 - (5.0 / 6.0), -165.0000000000000, -238.0000000000000}; + qData3[1] = + QPoint {-70 - (5.0 / 6.0), -143.0000000000000, -238.0000000000000}; + qData3[2] = + QPoint {-52.0000000000000, -143.0000000000000, -238.0000000000000}; + qData3[3] = + QPoint {-52.0000000000000, -165.0000000000000, -238.0000000000000}; + qData3[4] = + QPoint {-70 - (5.0 / 6.0), -165.0000000000000, -221.0000000000000}; + qData3[5] = + QPoint {-70 - (5.0 / 6.0), -143.0000000000000, -221.0000000000000}; + qData3[6] = + QPoint {-52.0000000000000, -143.0000000000000, -221.0000000000000}; + qData3[7] = + QPoint {-52.0000000000000, -165.0000000000000, -221.0000000000000}; } QPoint qData0[8]; QPoint qData1[8]; QPoint qData2[8]; + QPoint qData3[8]; double EPS; }; @@ -180,25 +226,61 @@ TEST_F(HexahedronTest, volume) const QPoint* pt0 = this->qData0; const QPoint* pt1 = this->qData1; const QPoint* pt2 = this->qData2; + const QPoint* pt3 = this->qData3; + + const QPoint non_planar_pt1 {0, -1, 0}; + const QPoint non_planar_pt2 {-0.5, -0.5, -0.5}; + const QPoint non_planar_pt3 {1.25, 1.25, 1.25}; // Initialize hexahedrons QHex hex0(pt0[0], pt0[1], pt0[2], pt0[3], pt0[4], pt0[5], pt0[6], pt0[7]); QHex hex1(pt1[0], pt1[1], pt1[2], pt1[3], pt1[4], pt1[5], pt1[6], pt1[7]); QHex hex2(pt2[0], pt2[1], pt2[2], pt2[3], pt2[4], pt2[5], pt2[6], pt2[7]); + QHex hex3(pt3[0], pt3[1], pt3[2], pt3[3], pt3[4], pt3[5], pt3[6], pt3[7]); + + // Hexahedron with one nonplanar side + QHex hex4(non_planar_pt1, pt0[1], pt0[2], pt0[3], pt0[4], pt0[5], pt0[6], pt0[7]); + + // Hexahedron with three nonplanar sides + QHex hex5(non_planar_pt2, pt0[1], pt0[2], pt0[3], pt0[4], pt0[5], pt0[6], pt0[7]); + + // Hexahedron with all nonplanar sides + QHex hex6(non_planar_pt2, + pt0[1], + pt0[2], + pt0[3], + pt0[4], + pt0[5], + non_planar_pt3, + pt0[7]); // Check volume EXPECT_DOUBLE_EQ(hex0.signedVolume(), 1); EXPECT_DOUBLE_EQ(hex1.signedVolume(), 1); EXPECT_DOUBLE_EQ(hex2.signedVolume(), 13); - + EXPECT_NEAR(hex3.signedVolume(), -7043.66666666, EPS); + EXPECT_DOUBLE_EQ(hex4.signedVolume(), 1.25); + EXPECT_DOUBLE_EQ(hex5.signedVolume(), 1.375); + EXPECT_DOUBLE_EQ(hex6.signedVolume(), 1.5625); EXPECT_DOUBLE_EQ(hex0.volume(), 1); EXPECT_DOUBLE_EQ(hex1.volume(), 1); EXPECT_DOUBLE_EQ(hex2.volume(), 13); + EXPECT_NEAR(hex3.volume(), 7043.66666666, EPS); + EXPECT_DOUBLE_EQ(hex4.volume(), 1.25); + EXPECT_DOUBLE_EQ(hex5.volume(), 1.375); + EXPECT_DOUBLE_EQ(hex6.volume(), 1.5625); // Check hexahedron volume against 24-tetrahedron subvolumes - EXPECT_DOUBLE_EQ(hex0.volume(), volume_tet_decomp(hex0)); - EXPECT_DOUBLE_EQ(hex1.volume(), volume_tet_decomp(hex1)); - EXPECT_DOUBLE_EQ(hex2.volume(), volume_tet_decomp(hex2)); + EXPECT_DOUBLE_EQ(hex0.volume(), signed_volume_tet_decomp(hex0)); + EXPECT_DOUBLE_EQ(hex1.volume(), signed_volume_tet_decomp(hex1)); + EXPECT_DOUBLE_EQ(hex2.volume(), signed_volume_tet_decomp(hex2)); + + // Negative volume expected + EXPECT_DOUBLE_EQ(hex3.signedVolume(), signed_volume_tet_decomp(hex3)); + + EXPECT_DOUBLE_EQ(hex4.volume(), signed_volume_tet_decomp(hex4)); + EXPECT_DOUBLE_EQ(hex5.volume(), signed_volume_tet_decomp(hex5)); + EXPECT_DOUBLE_EQ(hex6.volume(), signed_volume_tet_decomp(hex6)); } TEST_F(HexahedronTest, equals) diff --git a/src/axom/primal/tests/primal_in_sphere.cpp b/src/axom/primal/tests/primal_in_sphere.cpp index 3f0cc54f88..5d294f3bf2 100644 --- a/src/axom/primal/tests/primal_in_sphere.cpp +++ b/src/axom/primal/tests/primal_in_sphere.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_integral.cpp b/src/axom/primal/tests/primal_integral.cpp index a4fd2d940b..9960a1c07a 100644 --- a/src/axom/primal/tests/primal_integral.cpp +++ b/src/axom/primal/tests/primal_integral.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_intersect.cpp b/src/axom/primal/tests/primal_intersect.cpp index 2f8e38418c..e98035d12d 100644 --- a/src/axom/primal/tests/primal_intersect.cpp +++ b/src/axom/primal/tests/primal_intersect.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_intersect_impl.cpp b/src/axom/primal/tests/primal_intersect_impl.cpp index cb40045699..59d742a8b3 100644 --- a/src/axom/primal/tests/primal_intersect_impl.cpp +++ b/src/axom/primal/tests/primal_intersect_impl.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_numeric_array.cpp b/src/axom/primal/tests/primal_numeric_array.cpp index f7d9f1df32..ba27011679 100644 --- a/src/axom/primal/tests/primal_numeric_array.cpp +++ b/src/axom/primal/tests/primal_numeric_array.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_octahedron.cpp b/src/axom/primal/tests/primal_octahedron.cpp index 5dd131a8d0..c836e19686 100644 --- a/src/axom/primal/tests/primal_octahedron.cpp +++ b/src/axom/primal/tests/primal_octahedron.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -23,15 +23,30 @@ class OctahedronTest : public ::testing::Test public: static const int DIM = 3; - typedef double CoordType; - typedef primal::Point QPoint; - typedef primal::Octahedron QOct; + using CoordType = double; + using QPoint = primal::Point; + using QOct = primal::Octahedron; protected: virtual void SetUp() { EPS = 1e-12; + /* + * Define coordinates for first octahedron + * (view looking down from +z axis): + * + * 4 +z + * /\ +y + * 0 --/ \-- 2 ^ > + * \/ \ / | / + * / \ |/ + * 5 -------- 3 -----> +x + * \/ + * 1 + * + */ + // Define coordinates for first octahedron qData0[0] = QPoint::make_point(1, 0, 0); qData0[1] = QPoint::make_point(1, 1, 0); @@ -40,6 +55,28 @@ class OctahedronTest : public ::testing::Test qData0[4] = QPoint::make_point(0, 0, 1); qData0[5] = QPoint::make_point(1, 0, 1); + /* + * Define coordinates for second octahedron (regular octahedron): + * + * 3 +z + * / \\ +y + * / \ \ ^ > + * / \ \ | / + * / \ \ |/ + * 4- - - - -\- 2 -----> +x + * / \ / + * /_____________/ + * 5 1 + * \ / + * \ / + * \ / + * \ / + * \ / + * \ / + * \/ + * 0 + */ + // Define coordinates for second octahedron qData1[0] = QPoint::make_point(0, 0, -1); qData1[1] = QPoint::make_point(1, 0, 0); @@ -57,8 +94,8 @@ class OctahedronTest : public ::testing::Test //------------------------------------------------------------------------------ TEST_F(OctahedronTest, defaultConstructor) { - typedef OctahedronTest::QPoint QPoint; - typedef OctahedronTest::QOct QOct; + using QPoint = OctahedronTest::QPoint; + using QOct = OctahedronTest::QOct; const QOct oct; @@ -76,8 +113,8 @@ TEST_F(OctahedronTest, defaultConstructor) TEST_F(OctahedronTest, constructFromPoints) { - typedef OctahedronTest::QPoint QPoint; - typedef OctahedronTest::QOct QOct; + using QPoint = OctahedronTest::QPoint; + using QOct = OctahedronTest::QOct; // Access the test data const QPoint* pt = this->qData0; @@ -130,8 +167,8 @@ TEST_F(OctahedronTest, constructFromPoints) TEST_F(OctahedronTest, equals) { - typedef OctahedronTest::QPoint QPoint; - typedef OctahedronTest::QOct QOct; + using QPoint = OctahedronTest::QPoint; + using QOct = OctahedronTest::QOct; // Access the test data const QPoint* pt0 = this->qData0; diff --git a/src/axom/primal/tests/primal_orientation.cpp b/src/axom/primal/tests/primal_orientation.cpp index 412460e85d..442f865c9a 100644 --- a/src/axom/primal/tests/primal_orientation.cpp +++ b/src/axom/primal/tests/primal_orientation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_orientedboundingbox.cpp b/src/axom/primal/tests/primal_orientedboundingbox.cpp index e7c8aaa87b..01f57dfe14 100644 --- a/src/axom/primal/tests/primal_orientedboundingbox.cpp +++ b/src/axom/primal/tests/primal_orientedboundingbox.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -9,6 +9,8 @@ #include "gtest/gtest.h" #include "axom/config.hpp" +#include "axom/slic.hpp" + #include "axom/primal/geometry/NumericArray.hpp" #include "axom/primal/geometry/Point.hpp" #include "axom/primal/geometry/Vector.hpp" @@ -270,7 +272,7 @@ TEST(primal_OBBox, obb_test_add_box) obbox3.addBox(obbox4); EXPECT_TRUE(obbox3.contains(obbox1)); - // adding invalid box should make it invalid + // adding empty/invalid box is a no-op QOBBox obbox5; obbox3.addBox(obbox5); EXPECT_FALSE(obbox5.isValid()); @@ -604,6 +606,7 @@ TEST(primal_OBBox, obb_test_furthest_point) int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); + axom::slic::SimpleLogger logger; #ifdef ORIENTEDBOUNDINGBOX_TESTER_SHOULD_SEED std::srand(std::time(0)); diff --git a/src/axom/primal/tests/primal_plane.cpp b/src/axom/primal/tests/primal_plane.cpp index cca73086a2..3e3487a413 100644 --- a/src/axom/primal/tests/primal_plane.cpp +++ b/src/axom/primal/tests/primal_plane.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_point.cpp b/src/axom/primal/tests/primal_point.cpp index 73bf672c60..debe7368e8 100644 --- a/src/axom/primal/tests/primal_point.cpp +++ b/src/axom/primal/tests/primal_point.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -37,8 +37,8 @@ void check_point_policy() TEST(primal_point, point_default_constructor) { static const int DIM = 2; - typedef double CoordType; - typedef primal::Point QPoint; + using CoordType = double; + using QPoint = primal::Point; QPoint pt; @@ -50,8 +50,8 @@ TEST(primal_point, point_default_constructor) TEST(primal_point, point_singleVal_constructor) { static const int DIM = 5; - typedef int CoordType; - typedef primal::Point QPoint; + using CoordType = int; + using QPoint = primal::Point; const int singleVal = 10; // @@ -103,8 +103,8 @@ TEST(primal_point, point_singleVal_constructor) TEST(primal_point, point_array_constructor) { static const int DIM = 5; - typedef int CoordType; - typedef primal::Point QPoint; + using CoordType = int; + using QPoint = primal::Point; // Set elt i of input array to i CoordType arr[DIM]; @@ -167,9 +167,9 @@ TEST(primal_point, point_array_constructor) TEST(primal_point, point_numericArray_constructor) { static const int DIM = 5; - typedef int CoordType; - typedef primal::NumericArray QArray; - typedef primal::Point QPoint; + using CoordType = int; + using QArray = primal::NumericArray; + using QPoint = primal::Point; // Set elt i of input array to i CoordType arr[DIM]; @@ -226,8 +226,8 @@ TEST(primal_point, point_initializerList_constructor) TEST(primal_point, point_copy_and_assignment) { static const int DIM = 5; - typedef int CoordType; - typedef primal::Point QPoint; + using CoordType = int; + using QPoint = primal::Point; // Set elt i of input array to i CoordType arr[DIM]; @@ -262,8 +262,8 @@ TEST(primal_point, point_copy_and_assignment) TEST(primal_point, point_equality) { static const int DIM = 5; - typedef int CoordType; - typedef primal::Point QPoint; + using CoordType = int; + using QPoint = primal::Point; // Set elt i of input array to i CoordType arr[DIM]; @@ -297,8 +297,8 @@ TEST(primal_point, point_equality) TEST(primal_point, point_to_array) { static const int DIM = 5; - typedef int CoordType; - typedef primal::Point QPoint; + using CoordType = int; + using QPoint = primal::Point; // Set elt i of input array to i CoordType arr[DIM]; @@ -321,8 +321,8 @@ TEST(primal_point, point_to_array) TEST(primal_point, point_make_point) { static const int DIM = 3; - typedef int CoordType; - typedef primal::Point QPoint; + using CoordType = int; + using QPoint = primal::Point; const int x = 10; const int y = 20; @@ -346,8 +346,8 @@ TEST(primal_point, point_make_point) TEST(primal_point, point_midpoint) { static const int DIM = 3; - typedef int CoordType; - typedef primal::Point QPoint; + using CoordType = int; + using QPoint = primal::Point; QPoint p10(10); QPoint p30(30); diff --git a/src/axom/primal/tests/primal_polygon.cpp b/src/axom/primal/tests/primal_polygon.cpp index bf448225b7..8d2384be6f 100644 --- a/src/axom/primal/tests/primal_polygon.cpp +++ b/src/axom/primal/tests/primal_polygon.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -10,6 +10,11 @@ #include #include "gtest/gtest.h" +namespace +{ +constexpr double EPS = 1e-8; +} + //------------------------------------------------------------------------------ TEST(primal_polygon, empty) { @@ -244,43 +249,57 @@ TEST(primal_polygon, convexity) poly.addVertex(PointType {0, 1}); EXPECT_TRUE(is_convex(poly)); - // Duplicate points should not affect convexity - vertices = axom::Array( + axom::Array convex_verts = axom::Array( {PointType {0, 0}, PointType {0, 1}, PointType {1, 1}, PointType {1, 0}}); + axom::Array concave_verts = axom::Array( + {PointType {0, 0}, PointType {0, 1}, PointType {0.1, 0.1}, PointType {1, 0}}); + axom::Array nonsimple_verts = axom::Array( + {PointType {0, 0}, PointType {1, 1}, PointType {0, 1}, PointType {1, 0}}); + poly.clear(); + + // Duplicate points and straight edges should not affect convexity for(int i = 0; i < 4; i++) { for(int j = 0; j < 3; j++) // Duplicate each element 3 times { - poly.addVertex(vertices[i]); + poly.addVertex(convex_verts[i]); } + + // Add midpoints between each duplicated vertex + poly.addVertex( + PointType::midpoint(convex_verts[i], convex_verts[(i + 1) % 4])); } EXPECT_TRUE(is_convex(poly)); // Verify checks up to rotation of vertices - vertices = axom::Array( - {PointType {0, 0}, PointType {1, 1}, PointType {1, 0}, PointType {0, 1}}); - for(int i = 0; i < 4; i++) { poly.clear(); for(int j = 0; j < 4; j++) { - poly.addVertex(vertices[(j + i) % 4]); + poly.addVertex(concave_verts[(j + i) % 4]); } EXPECT_FALSE(is_convex(poly)); } - vertices = axom::Array( - {PointType {0, 0}, PointType {0, 1}, PointType {1, 1}, PointType {1, 0}}); + for(int i = 0; i < 4; i++) + { + poly.clear(); + for(int j = 0; j < 4; j++) + { + poly.addVertex(nonsimple_verts[(j + i) % 4]); + } + EXPECT_FALSE(is_convex(poly)); + } for(int i = 0; i < 4; i++) { poly.clear(); for(int j = 0; j < 4; j++) { - poly.addVertex(vertices[(j + i) % 4]); + poly.addVertex(convex_verts[(j + i) % 4]); } EXPECT_TRUE(is_convex(poly)); } @@ -339,7 +358,7 @@ TEST(primal_polygon, signed_area_2d) } //------------------------------------------------------------------------------ -TEST(primal_polygon, area_2d_3d) +TEST(primal_polygon, area_2d_3d_axis_aligned) { using Polygon2D = axom::primal::Polygon; using Point2D = axom::primal::Point; @@ -348,40 +367,260 @@ TEST(primal_polygon, area_2d_3d) using Point3D = axom::primal::Point; // test a simple right triangle - // use same xy-data in 2D and 3D - { - Polygon2D poly2D({Point2D {0, 0}, Point2D {1, 0}, Point2D {1, 1}}); - EXPECT_DOUBLE_EQ(.5, poly2D.area()); + Polygon2D poly2D({Point2D {0, 0}, Point2D {1, 0}, Point2D {1, 1}}); + EXPECT_DOUBLE_EQ(.5, poly2D.area()); - Polygon3D poly3Da({Point3D {0, 0, 0}, Point3D {1, 0, 0}, Point3D {1, 1, 0}}); - EXPECT_DOUBLE_EQ(.5, poly3Da.area()); + // in xy-plane + Polygon3D poly3Da({Point3D {0, 0, 0}, Point3D {1, 0, 0}, Point3D {1, 1, 0}}); + EXPECT_DOUBLE_EQ(.5, poly3Da.area()); - Polygon3D poly3Db({Point3D {0, 0, 1}, Point3D {1, 0, 1}, Point3D {1, 1, 1}}); - EXPECT_DOUBLE_EQ(.5, poly3Db.area()); - } + // in xz-plane + Polygon3D poly3Db({Point3D {0, 0, 0}, Point3D {1, 0, 0}, Point3D {1, 0, 1}}); + EXPECT_DOUBLE_EQ(.5, poly3Db.area()); - // test regular polygons - // use same xy-data in 2D and 3D - for(int nSides = 3; nSides < 10; ++nSides) - { - Polygon2D poly2D(nSides); - Polygon3D poly3D(nSides); + // in yz-plane + Polygon3D poly3Dc({Point3D {0, 0, 0}, Point3D {0, 1, 0}, Point3D {0, 1, 1}}); + EXPECT_DOUBLE_EQ(.5, poly3Dc.area()); +} + +//------------------------------------------------------------------------------ +TEST(primal_polygon, area_2d_3d_affine_transforms) +{ + using Polygon2D = axom::primal::Polygon; + using Point2D = axom::primal::Point; + + using Polygon3D = axom::primal::Polygon; + using Point3D = axom::primal::Point; + using Vector3D = axom::primal::Vector; + + using TransformMatrix = axom::numerics::Matrix; - // choose an arbitrary z_offset for 3D polygon - const double z_offset = 5.; + // lambda to generate a regular n-sided 2D polygon centered around origin + auto generateNSidedPolygon = [](int nSides) { + Polygon2D polygon(nSides); for(int i = 0; i < nSides; ++i) { const double angle = 2. * M_PI * i / nSides; - poly2D.addVertex(Point2D {cos(angle), sin(angle)}); - poly3D.addVertex(Point3D {cos(angle), sin(angle), z_offset}); + polygon.addVertex(Point2D {cos(angle), sin(angle)}); } - const double expected_area = nSides / 2. * sin(2 * M_PI / nSides); + return polygon; + }; + + // lambda to generate an affine transformation matrix for 2D points + auto generateTransformMatrix2D = + [](const Point2D& scale, const Point2D& translate, double rotation_angle) { + // create scaling matrix + auto sc_matx = TransformMatrix::identity(3); + { + sc_matx(0, 0) = scale[0]; + sc_matx(1, 1) = scale[1]; + } + + // create rotation matrix + auto rot_matx = TransformMatrix::identity(3); + { + const double sinT = std::sin(rotation_angle); + const double cosT = std::cos(rotation_angle); + + rot_matx(0, 0) = cosT; + rot_matx(0, 1) = -sinT; + rot_matx(1, 0) = sinT; + rot_matx(1, 1) = cosT; + } + + // create translation matrix + auto tr_matx = TransformMatrix::identity(3); + { + tr_matx(0, 2) = translate[0]; + tr_matx(1, 2) = translate[1]; + } + + // multiply them to get the final transform + TransformMatrix affine_matx1(3, 3); + matrix_multiply(rot_matx, sc_matx, affine_matx1); + + TransformMatrix affine_matx2(3, 3); + matrix_multiply(tr_matx, affine_matx1, affine_matx2); + + EXPECT_NEAR(scale[0] * scale[1], determinant(affine_matx2), EPS); + return affine_matx2; + }; + + // lambda to generate an affine transformation matrix for 2D points + auto generateTransformMatrix3D = [](const Point3D& scale, + const Point3D& translate, + const Vector3D& axis, + double angle) { + // create scaling matrix + auto sc_matx = TransformMatrix::identity(4); + { + sc_matx(0, 0) = scale[0]; + sc_matx(1, 1) = scale[1]; + sc_matx(2, 2) = scale[2]; + } + + // create rotation matrix + auto rot_matx = TransformMatrix::zeros(4, 4); + { + const double sinT = std::sin(angle); + const double cosT = std::cos(angle); + + const auto unitAxis = axis.unitVector(); + const double& ux = unitAxis[0]; + const double& uy = unitAxis[1]; + const double& uz = unitAxis[2]; + + rot_matx(0, 0) = cosT + ux * ux * (1 - cosT); + rot_matx(0, 1) = ux * uy * (1 - cosT) - uz * sinT; + rot_matx(0, 2) = ux * uz * (1 - cosT) + uy * sinT; + rot_matx(1, 0) = uy * ux * (1 - cosT) + uz * sinT; + rot_matx(1, 1) = cosT + uy * uy * (1 - cosT); + rot_matx(1, 2) = uy * uz * (1 - cosT) - ux * sinT; + rot_matx(2, 0) = uz * ux * (1 - cosT) - uy * sinT; + rot_matx(2, 1) = uz * uy * (1 - cosT) + ux * sinT; + rot_matx(2, 2) = cosT + uz * uz * (1 - cosT); + rot_matx(3, 3) = 1; + } + + // create translation matrix + auto tr_matx = TransformMatrix::identity(4); + { + tr_matx(0, 3) = translate[0]; + tr_matx(1, 3) = translate[1]; + tr_matx(2, 3) = translate[2]; + } + + // multiply them to get the final transform + TransformMatrix affine_matx1(4, 4); + matrix_multiply(rot_matx, sc_matx, affine_matx1); + TransformMatrix affine_matx2(4, 4); + matrix_multiply(tr_matx, affine_matx1, affine_matx2); + + EXPECT_NEAR(scale[0] * scale[1] * scale[2], determinant(affine_matx2), EPS); + return affine_matx2; + }; + + // lambda to transform a 2D polygon into 2D + auto transformedPolygon2d = [](const Polygon2D& poly, + const TransformMatrix& matx) { + Polygon2D xformed(poly.numVertices()); + for(int i = 0; i < poly.numVertices(); ++i) + { + const double vec_in[3] = {poly[i][0], poly[i][1], 1.}; + double vec_out[3] = {0., 0., 0.}; + axom::numerics::matrix_vector_multiply(matx, vec_in, vec_out); + xformed.addVertex(Point2D {vec_out[0], vec_out[1]}); + } + return xformed; + }; + + // lambda to transform a 2D polygon into 3D + auto transformedPolygon3d = [](const Polygon2D& poly, + const TransformMatrix& matx) { + Polygon3D xformed(poly.numVertices()); + for(int i = 0; i < poly.numVertices(); ++i) + { + const double vec_in[4] = {poly[i][0], poly[i][1], 0., 1.}; + double vec_out[4] = {0., 0., 0., 0.}; + axom::numerics::matrix_vector_multiply(matx, vec_in, vec_out); + xformed.addVertex(Point3D {vec_out[0], vec_out[1], vec_out[2]}); + } + return xformed; + }; + + const auto scales = axom::Array({-3., -1., -.5, 0., 0.01, 1., 42.3}); + const auto translations = axom::Array({-.5, 0., 1., 42.3}); + const auto angles = axom::Array({-.57, 0., 2. / 3. * M_PI}); + const auto axes = axom::Array({ + Vector3D {0., 0., 1.}, + Vector3D {0., 1., 0.}, + Vector3D {1., 0., 0.}, + Vector3D {1., 0., 1.}, + Vector3D {1., 1., 1.}, + Vector3D {-2., -5., 0.}, + }); - EXPECT_DOUBLE_EQ(expected_area, poly2D.area()); - EXPECT_DOUBLE_EQ(expected_area, poly3D.area()); - EXPECT_DOUBLE_EQ(poly2D.area(), poly3D.area()); + for(int nSides = 3; nSides < 10; ++nSides) + { + Polygon2D polygon2d = generateNSidedPolygon(nSides); + const double unscaled_area = nSides / 2. * sin(2 * M_PI / nSides); + EXPECT_DOUBLE_EQ(unscaled_area, polygon2d.area()); + + // check area of 2D polygons after affine transforms + for(double sc_x : scales) + { + for(double sc_y : scales) + { + for(double tr_x : translations) + { + for(double tr_y : translations) + { + for(double theta : angles) + { + const auto sc = Point2D {sc_x, sc_y}; + const auto tr = Point2D {tr_x, tr_y}; + auto affine_matx = generateTransformMatrix2D(sc, tr, theta); + auto xformed_polygon = transformedPolygon2d(polygon2d, affine_matx); + + const double expected_area = + unscaled_area * determinant(affine_matx); + EXPECT_NEAR(expected_area, xformed_polygon.signedArea(), EPS); + + if(nSides == 3) + { + axom::primal::Triangle tri(xformed_polygon[0], + xformed_polygon[1], + xformed_polygon[2]); + EXPECT_NEAR(xformed_polygon.signedArea(), tri.signedArea(), EPS); + } + } + } + } + } + } + + // check area of 3D polygons after affine transforms + for(double sc_x : scales) + { + for(double sc_y : scales) + { + for(double tr_x : translations) + { + for(double tr_y : translations) + { + for(double tr_z : translations) + { + for(const auto& axis : axes) + { + for(double theta : angles) + { + const auto sc = Point3D {sc_x, sc_y, 1.}; + const auto tr = Point3D {tr_x, tr_y, tr_z}; + auto affine_matx = + generateTransformMatrix3D(sc, tr, axis, theta); + auto xformed_polygon = + transformedPolygon3d(polygon2d, affine_matx); + + const auto expected_area = unscaled_area * + axom::utilities::abs(determinant(affine_matx)); + EXPECT_NEAR(expected_area, xformed_polygon.area(), EPS); + + if(nSides == 3) + { + axom::primal::Triangle tri(xformed_polygon[0], + xformed_polygon[1], + xformed_polygon[2]); + EXPECT_NEAR(xformed_polygon.area(), tri.area(), EPS); + } + } + } + } + } + } + } + } } } diff --git a/src/axom/primal/tests/primal_polyhedron.cpp b/src/axom/primal/tests/primal_polyhedron.cpp index 4f5f70a31b..2aadb91c68 100644 --- a/src/axom/primal/tests/primal_polyhedron.cpp +++ b/src/axom/primal/tests/primal_polyhedron.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -255,6 +255,7 @@ TEST(primal_polyhedron, polyhedron_octahedron) octA.addNeighbors(octA[5], {0, 1, 3, 4}); EXPECT_NEAR(1.3333, octA.volume(), EPS); + EXPECT_NEAR(1.3333, octA.signedVolume(), EPS); PolyhedronType octB; octB.addVertex({1, 0, 0}); @@ -272,6 +273,7 @@ TEST(primal_polyhedron, polyhedron_octahedron) octB.addNeighbors(octB[5], {0, 1, 3, 4}); EXPECT_NEAR(0.6666, octB.volume(), EPS); + EXPECT_NEAR(0.6666, octB.signedVolume(), EPS); } //------------------------------------------------------------------------------ @@ -707,16 +709,21 @@ TEST(primal_polyhedron, polyhedron_from_primitive) poly = Polyhedron3D::from_primitive(hex, false); EXPECT_NEAR(1.0, poly.volume(), EPS); + // Check signed volume + EXPECT_NEAR(1.0, poly.signedVolume(), EPS); + EXPECT_NEAR(hex.signedVolume(), poly.signedVolume(), EPS); + // Negative volume axom::utilities::swap(hex[1], hex[3]); axom::utilities::swap(hex[5], hex[7]); poly = Polyhedron3D::from_primitive(hex, false); - EXPECT_NEAR(-1.0, poly.volume(), EPS); + EXPECT_NEAR(-1.0, poly.signedVolume(), EPS); + EXPECT_NEAR(-1.0, hex.signedVolume(), EPS); // Check sign poly = Polyhedron3D::from_primitive(hex, CHECK_SIGN); - EXPECT_NEAR(1.0, poly.volume(), EPS); + EXPECT_NEAR(1.0, poly.signedVolume(), EPS); // Valid octahedron Octahedron3D oct(Point3D {1, 0, 0}, @@ -734,11 +741,11 @@ TEST(primal_polyhedron, polyhedron_from_primitive) axom::utilities::swap(oct[4], oct[5]); poly = Polyhedron3D::from_primitive(oct, false); - EXPECT_NEAR(-0.6666, poly.volume(), EPS); + EXPECT_NEAR(-0.6666, poly.signedVolume(), EPS); // Check sign poly = Polyhedron3D::from_primitive(oct, CHECK_SIGN); - EXPECT_NEAR(0.6666, poly.volume(), EPS); + EXPECT_NEAR(0.6666, poly.signedVolume(), EPS); // Valid tetrahedron Tetrahedron3D tet(Point3D {1, 1, 1}, @@ -749,15 +756,20 @@ TEST(primal_polyhedron, polyhedron_from_primitive) poly = Polyhedron3D::from_primitive(tet, false); EXPECT_NEAR(2.6666, poly.volume(), EPS); + // Check signed volume + EXPECT_NEAR(2.6666, poly.signedVolume(), EPS); + EXPECT_NEAR(tet.signedVolume(), poly.signedVolume(), EPS); + // Negative volume axom::utilities::swap(tet[1], tet[2]); poly = Polyhedron3D::from_primitive(tet, false); - EXPECT_NEAR(-2.6666, poly.volume(), EPS); + EXPECT_NEAR(-2.6666, poly.signedVolume(), EPS); + EXPECT_NEAR(tet.signedVolume(), poly.signedVolume(), EPS); // Check sign poly = Polyhedron3D::from_primitive(tet, CHECK_SIGN); - EXPECT_NEAR(2.6666, poly.volume(), EPS); + EXPECT_NEAR(2.6666, poly.signedVolume(), EPS); } //------------------------------------------------------------------------------ diff --git a/src/axom/primal/tests/primal_quadrilateral.cpp b/src/axom/primal/tests/primal_quadrilateral.cpp new file mode 100644 index 0000000000..3836f339af --- /dev/null +++ b/src/axom/primal/tests/primal_quadrilateral.cpp @@ -0,0 +1,88 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include "axom/config.hpp" +#include "axom/slic.hpp" +#include "axom/primal.hpp" + +#include "gtest/gtest.h" + +namespace primal = axom::primal; + +TEST(primal_quadrilateral, construct_from_points) +{ + constexpr int DIM = 2; + using CoordinateType = double; + using PointType = primal::Point; + using QuadrilateralType = primal::Quadrilateral; + + PointType A {-1.0, 0.1}; + PointType B {-0.1, 0.5}; + PointType C {2.0, 0.0}; + PointType D {0.0, 1.0}; + + QuadrilateralType quad {A, B, C, D}; + + EXPECT_EQ(A, quad[0]); + EXPECT_EQ(B, quad[1]); + EXPECT_EQ(C, quad[2]); + EXPECT_EQ(D, quad[3]); +} + +TEST(primal_quadrilateral, construct_from_array_view) +{ + constexpr int DIM = 3; + using CoordinateType = double; + using PointType = primal::Point; + using QuadrilateralType = primal::Quadrilateral; + + // This is a concave quadrilateral + PointType quadPoints[QuadrilateralType::NUM_QUAD_VERTS] { + PointType {-1.0, 0.1, 0.0}, + PointType {-0.1, 0.5, 0.0}, + PointType {2.0, 0.0, 1.0}, + PointType {0.0, 1.0, 1.0}}; + + QuadrilateralType quad { + axom::ArrayView {quadPoints, QuadrilateralType::NUM_QUAD_VERTS}}; + + for(int i = 0; i < QuadrilateralType::NUM_QUAD_VERTS; ++i) + { + EXPECT_EQ(quadPoints[i], quad[i]); + } +} + +TEST(primal_quadrilateral, area_2D) +{ + constexpr int DIM = 2; + constexpr double EPS = 1e-12; + using CoordinateType = double; + using PointType = primal::Point; + using QuadrilateralType = primal::Quadrilateral; + + // This is a concave quadrilateral + QuadrilateralType quad {PointType {-1.0, 0.1}, + PointType {-0.1, 0.5}, + PointType {2.0, 0.0}, + PointType {0.0, 1.0}}; + + const CoordinateType signedArea = quad.signedArea(); + const CoordinateType area = quad.area(); + + EXPECT_NEAR(0.755, signedArea, EPS); + EXPECT_NEAR(0.755, area, EPS); +} + +//---------------------------------------------------------------------- +//---------------------------------------------------------------------- + +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + axom::slic::SimpleLogger logger(axom::slic::message::Info); + + int result = RUN_ALL_TESTS(); + return result; +} diff --git a/src/axom/primal/tests/primal_rational_bezier.cpp b/src/axom/primal/tests/primal_rational_bezier.cpp index 2f9ea7a711..a7d14d973b 100644 --- a/src/axom/primal/tests/primal_rational_bezier.cpp +++ b/src/axom/primal/tests/primal_rational_bezier.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -17,8 +17,6 @@ #include "axom/slic.hpp" #include "axom/fmt.hpp" -#include - namespace primal = axom::primal; //------------------------------------------------------------------------------ @@ -81,36 +79,43 @@ TEST(primal_rationalbezier, evaluate) using PointType = primal::Point; using BezierCurveType = primal::BezierCurve; - const int order = 3; - PointType data[order + 1] = {PointType {0.6, 1.2, 1.0}, - PointType {1.3, 1.6, 1.8}, - PointType {2.9, 2.4, 2.3}, - PointType {3.2, 3.5, 3.0}}; - - double weights[order + 1] = {1, 2, 3, 4}; - - BezierCurveType b2Curve(data, weights, order); - - PointType midtval {2.365, 2.32, 2.225}; + const int max_order = 3; + PointType data[max_order + 1] = {PointType {0.6, 1.2, 1.0}, + PointType {1.3, 1.6, 1.8}, + PointType {2.9, 2.4, 2.3}, + PointType {3.2, 3.5, 3.0}}; + double weights[max_order + 1] = {1, 2, 3, 4}; + + // clang-format off + PointType exp_vals[4][3] = {{PointType {0.6, 1.2, 1.0}, PointType { 0.6, 1.2, 1.0}, PointType {0.6, 1.2, 1.0}}, + {PointType {0.6, 1.2, 1.0}, PointType {16./15., 22./15., 23./15.}, PointType {1.3, 1.6, 1.8}}, + {PointType {0.6, 1.2, 1.0}, PointType { 1.8125, 1.85, 1.8875}, PointType {2.9, 2.4, 2.3}}, + {PointType {0.6, 1.2, 1.0}, PointType { 2.365, 2.32, 2.225}, PointType {3.2, 3.5, 3.0}}}; + // clang-format on + + // Test evaluation at various orders, using the first `ord` + // points in `data` as control points. + for(int ord = 0; ord <= max_order; ++ord) + { + BezierCurveType curve(data, weights, ord); - // Evaluate the curve at several parameter values - // Curve should interpolate endpoints - PointType eval0 = b2Curve.evaluate(0.0); - PointType eval1 = b2Curve.evaluate(1.0); - PointType evalMid = b2Curve.evaluate(0.5); + PointType calc_start = curve.evaluate(0.0); + PointType calc_mid = curve.evaluate(0.5); + PointType calc_end = curve.evaluate(1.0); - for(int i = 0; i < DIM; ++i) - { - EXPECT_DOUBLE_EQ(b2Curve[0][i], eval0[i]); - EXPECT_DOUBLE_EQ(b2Curve[order][i], eval1[i]); - EXPECT_DOUBLE_EQ(midtval[i], evalMid[i]); + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_start[i], exp_vals[ord][0][i], 1e-15); + EXPECT_NEAR(calc_mid[i], exp_vals[ord][1][i], 1e-15); + EXPECT_NEAR(calc_end[i], exp_vals[ord][2][i], 1e-15); + } } } //------------------------------------------------------------------------------ -TEST(primal_rationalbezier, tangent) +TEST(primal_rationalbezier, first_derivative) { - SLIC_INFO("Testing Rational Bezier tangent calculation"); + SLIC_INFO("Testing Rational Bezier derivative calculation"); const int DIM = 3; using CoordType = double; @@ -118,31 +123,80 @@ TEST(primal_rationalbezier, tangent) using VectorType = primal::Vector; using BezierCurveType = primal::BezierCurve; - const int order = 3; - PointType data[order + 1] = {PointType {0.6, 1.2, 1.0}, - PointType {1.3, 1.6, 1.8}, - PointType {2.9, 2.4, 2.3}, - PointType {3.2, 3.5, 3.0}}; + const int max_order = 3; + PointType data[max_order + 1] = {PointType {0.6, 1.2, 1.0}, + PointType {1.3, 1.6, 1.8}, + PointType {2.9, 2.4, 2.3}, + PointType {3.2, 3.5, 3.0}}; + double weights[max_order + 1] = {1, 2, 3, 4}; + + // clang-format off + VectorType exp_vals[4][3] = {{VectorType {0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}}, + {VectorType {1.4, 0.8, 1.6}, VectorType {28./45., 16./45., 32./45.}, VectorType { 0.35, 0.2, 0.4}}, + {VectorType {2.8, 1.6, 3.2}, VectorType { 2.2375, 1.15, 1.0625}, VectorType {32./15., 16./15., 2./3.}}, + {VectorType {4.2, 2.4, 4.8}, VectorType { 2.652, 2.256, 1.62}, VectorType { 0.675, 2.475, 1.575}}}; + // clang-format on + + // Test derivative calculation at various orders, using the first `ord` + // points in `data` as control points. + for(int ord = 0; ord <= max_order; ++ord) + { + BezierCurveType curve(data, weights, ord); - double weights[order + 1] = {1, 2, 3, 4}; + VectorType calc_start = curve.dt(0.0); + VectorType calc_mid = curve.dt(0.5); + VectorType calc_end = curve.dt(1.0); - BezierCurveType b2Curve(data, weights, order); + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_start[i], exp_vals[ord][0][i], 1e-15); + EXPECT_NEAR(calc_mid[i], exp_vals[ord][1][i], 1e-15); + EXPECT_NEAR(calc_end[i], exp_vals[ord][2][i], 1e-15); + } + } +} - VectorType midtval = VectorType {2.652, 2.256, 1.62}; - VectorType starttval = VectorType {4.2, 2.4, 4.8}; - VectorType endtval = VectorType {0.675, 2.475, 1.575}; +//------------------------------------------------------------------------------ +TEST(primal_rationalbezier, second_derivative) +{ + SLIC_INFO("Testing Rational Bezier second derivative calculation"); - // Evaluate the curve at several parameter values - // Curve should be tangent to control net at endpoints - VectorType eval0 = b2Curve.dt(0.0); - VectorType eval1 = b2Curve.dt(1.0); - VectorType evalMid = b2Curve.dt(0.5); + const int DIM = 3; + using CoordType = double; + using PointType = primal::Point; + using VectorType = primal::Vector; + using BezierCurveType = primal::BezierCurve; - for(int i = 0; i < DIM; ++i) + const int max_order = 3; + PointType data[max_order + 1] = {PointType {0.6, 1.2, 1.0}, + PointType {1.3, 1.6, 1.8}, + PointType {2.9, 2.4, 2.3}, + PointType {3.2, 3.5, 3.0}}; + double weights[max_order + 1] = {1, 2, 3, 4}; + + // clang-format off + VectorType exp_vals[4][3] = {{VectorType { 0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}, VectorType { 0.0, 0.0, 0.0}}, + {VectorType {-2.8, -1.6, -3.2}, VectorType {-112./135., -64./135., -128./135.}, VectorType { -0.35, -0.2, -0.4}}, + {VectorType {-3.0, -2.4, -11.4}, VectorType { -0.375, -0.3, -1.425}, VectorType { -1./9., -8./90., -19./45.}}, + {VectorType {-0.6, -2.4, -24.6}, VectorType { -3.8448, 0.3456, -0.888}, VectorType {-4.0125, 0.4875, 0.3375}}}; + // clang-format on + + // Test derivative calculation at various orders, using the first `ord` + // points in `data` as control points. + for(int ord = 0; ord <= max_order; ++ord) { - EXPECT_NEAR(starttval[i], eval0[i], 1e-14); - EXPECT_NEAR(endtval[i], eval1[i], 1e-14); - EXPECT_NEAR(midtval[i], evalMid[i], 1e-14); + BezierCurveType curve(data, weights, ord); + + VectorType calc_start = curve.dtdt(0.0); + VectorType calc_mid = curve.dtdt(0.5); + VectorType calc_end = curve.dtdt(1.0); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_NEAR(calc_start[i], exp_vals[ord][0][i], 1e-14); + EXPECT_NEAR(calc_mid[i], exp_vals[ord][1][i], 1e-14); + EXPECT_NEAR(calc_end[i], exp_vals[ord][2][i], 1e-14); + } } } diff --git a/src/axom/primal/tests/primal_ray_intersect.cpp b/src/axom/primal/tests/primal_ray_intersect.cpp index 975000bd47..c63ea2d2ed 100644 --- a/src/axom/primal/tests/primal_ray_intersect.cpp +++ b/src/axom/primal/tests/primal_ray_intersect.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_segment.cpp b/src/axom/primal/tests/primal_segment.cpp index d343a8ced6..3bc0297c0d 100644 --- a/src/axom/primal/tests/primal_segment.cpp +++ b/src/axom/primal/tests/primal_segment.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_solid_angle.cpp b/src/axom/primal/tests/primal_solid_angle.cpp index a81ca4e2f3..ab16a6bb7f 100644 --- a/src/axom/primal/tests/primal_solid_angle.cpp +++ b/src/axom/primal/tests/primal_solid_angle.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -484,7 +484,7 @@ TEST(primal_solid_angle, planar_bezierpatch) using Point3D = primal::Point; using Vector3D = primal::Vector; using Polygon = primal::Polygon; - using BezierPatch = primal::BezierPatch; + using BezierPatch = primal::BezierPatch; // Define normal vector for the quadrilateral Vector3D v1 = Vector3D({0.0, 1.0, 2.0}).unitVector(); @@ -542,7 +542,7 @@ TEST(primal_integral, bezierpatch_sphere) { using Point3D = primal::Point; using Vector3D = primal::Vector; - using BPatch = primal::BezierPatch; + using BPatch = primal::BezierPatch; double rt2 = sqrt(2), rt3 = sqrt(3), rt6 = sqrt(6); @@ -582,7 +582,9 @@ TEST(primal_integral, bezierpatch_sphere) { const int idx = 5 * i + j; for(int n = 0; n < 6; ++n) + { sphere_faces[n].setWeight(i, j, weight_data[idx]); + } // Set up each face by rotating one of the patch faces sphere_faces[0](i, j)[0] = node_data[idx][1]; diff --git a/src/axom/primal/tests/primal_sphere.cpp b/src/axom/primal/tests/primal_sphere.cpp index 333be776f2..453053a4ae 100644 --- a/src/axom/primal/tests/primal_sphere.cpp +++ b/src/axom/primal/tests/primal_sphere.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_split.cpp b/src/axom/primal/tests/primal_split.cpp index ad958253d6..ab76148be8 100644 --- a/src/axom/primal/tests/primal_split.cpp +++ b/src/axom/primal/tests/primal_split.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_squared_distance.cpp b/src/axom/primal/tests/primal_squared_distance.cpp index aead022de2..d780694a49 100644 --- a/src/axom/primal/tests/primal_squared_distance.cpp +++ b/src/axom/primal/tests/primal_squared_distance.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_tetrahedron.cpp b/src/axom/primal/tests/primal_tetrahedron.cpp index 4b70c70bd6..8a54c56eb3 100644 --- a/src/axom/primal/tests/primal_tetrahedron.cpp +++ b/src/axom/primal/tests/primal_tetrahedron.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -20,6 +20,7 @@ #include "axom/fmt.hpp" #include +#include // std::next_permutation namespace primal = axom::primal; @@ -49,8 +50,8 @@ class TetrahedronTest : public ::testing::Test // Define coordinates for second tetrahedron qData1[0] = QPoint {1, 0, 0}; qData1[1] = QPoint {0, 1, 0}; - qData1[2] = QPoint {0, 0, 1}; - qData1[3] = QPoint {0, 0, 0}; + qData1[2] = QPoint {0, 0, 0}; + qData1[3] = QPoint {0, 0, 1}; double angles[3]; for(int i = 0; i < 3; ++i) @@ -623,6 +624,39 @@ TEST_F(TetrahedronTest, regularTetrahedron) EXPECT_EQ(primal::ON_POSITIVE_SIDE, primal::orientation(pt, tri)); } } + +TEST_F(TetrahedronTest, checkAndFixOrientation) +{ + using QTet = TetrahedronTest::QTet; + + int indices[] = {0, 1, 2, 3}; + + for(int i = 0; i < this->numTetrahedra(); ++i) + { + QTet tet = this->getTet(i); + double expVolume = tet.signedVolume(); + + // Run sign check through all vertex permutations for the tetrahedron + do + { + QTet tetPermuted = + QTet(tet[indices[0]], tet[indices[1]], tet[indices[2]], tet[indices[3]]); + + double preCheckAbsoluteVolume = tetPermuted.volume(); + + tetPermuted.checkAndFixOrientation(); + + double postCheckAbsoluteVolume = tetPermuted.volume(); + + EXPECT_NEAR(expVolume, postCheckAbsoluteVolume, this->EPS); + + // Verify absolute value of volume is still the same + EXPECT_NEAR(preCheckAbsoluteVolume, postCheckAbsoluteVolume, this->EPS); + + } while(std::next_permutation(indices, indices + QTet::NUM_VERTS)); + } +} + //---------------------------------------------------------------------- //---------------------------------------------------------------------- int main(int argc, char* argv[]) diff --git a/src/axom/primal/tests/primal_triangle.cpp b/src/axom/primal/tests/primal_triangle.cpp index 28c0ea4357..cc652ea694 100644 --- a/src/axom/primal/tests/primal_triangle.cpp +++ b/src/axom/primal/tests/primal_triangle.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_vector.cpp b/src/axom/primal/tests/primal_vector.cpp index 15299307c8..730ae168d3 100644 --- a/src/axom/primal/tests/primal_vector.cpp +++ b/src/axom/primal/tests/primal_vector.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_winding_number.cpp b/src/axom/primal/tests/primal_winding_number.cpp index 976a4c7fbb..488b85a15f 100644 --- a/src/axom/primal/tests/primal_winding_number.cpp +++ b/src/axom/primal/tests/primal_winding_number.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/tests/primal_zip.cpp b/src/axom/primal/tests/primal_zip.cpp index 3b8026c2a1..18ef0eeb2a 100644 --- a/src/axom/primal/tests/primal_zip.cpp +++ b/src/axom/primal/tests/primal_zip.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/utils/ZipBoundingBox.hpp b/src/axom/primal/utils/ZipBoundingBox.hpp index d097a0c1ca..62eac6f2e6 100644 --- a/src/axom/primal/utils/ZipBoundingBox.hpp +++ b/src/axom/primal/utils/ZipBoundingBox.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/utils/ZipIndexable.hpp b/src/axom/primal/utils/ZipIndexable.hpp index 6097513aea..834423988a 100644 --- a/src/axom/primal/utils/ZipIndexable.hpp +++ b/src/axom/primal/utils/ZipIndexable.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/utils/ZipPoint.hpp b/src/axom/primal/utils/ZipPoint.hpp index 67e9b0515c..6a7c44bdaf 100644 --- a/src/axom/primal/utils/ZipPoint.hpp +++ b/src/axom/primal/utils/ZipPoint.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/utils/ZipRay.hpp b/src/axom/primal/utils/ZipRay.hpp index e6b310da71..2f0d610379 100644 --- a/src/axom/primal/utils/ZipRay.hpp +++ b/src/axom/primal/utils/ZipRay.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/primal/utils/ZipVector.hpp b/src/axom/primal/utils/ZipVector.hpp index ed12956171..9d7c01da89 100644 --- a/src/axom/primal/utils/ZipVector.hpp +++ b/src/axom/primal/utils/ZipVector.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/AllNearestNeighbors.cpp b/src/axom/quest/AllNearestNeighbors.cpp index 81b7b3d81b..d53fdd7be2 100644 --- a/src/axom/quest/AllNearestNeighbors.cpp +++ b/src/axom/quest/AllNearestNeighbors.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -31,10 +31,10 @@ void all_nearest_neighbors(const double* x, // points in this and neighboring UniformGrid bins (out to distance limit) // and report result. - typedef spin::UniformGrid GridType; - typedef GridType::BoxType BoxType; - typedef GridType::PointType PointType; - typedef BoxType::VectorType VectorType; + using GridType = spin::UniformGrid; + using BoxType = GridType::BoxType; + using PointType = GridType::PointType; + using VectorType = BoxType::VectorType; double sqlimit = limit * limit; diff --git a/src/axom/quest/AllNearestNeighbors.hpp b/src/axom/quest/AllNearestNeighbors.hpp index cbcf486fc4..fa5d4c6684 100644 --- a/src/axom/quest/AllNearestNeighbors.hpp +++ b/src/axom/quest/AllNearestNeighbors.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/ArrayIndexer.hpp b/src/axom/quest/ArrayIndexer.hpp new file mode 100644 index 0000000000..fbd53e7681 --- /dev/null +++ b/src/axom/quest/ArrayIndexer.hpp @@ -0,0 +1,371 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#ifndef QUEST_ARRAYINDEXER_HPP_ +#define QUEST_ARRAYINDEXER_HPP_ + +#include "axom/slic.hpp" +#include "axom/core/StackArray.hpp" +#include "axom/core/numerics/matvecops.hpp" + +#include +#include + +namespace axom +{ +/*! + @brief Indicator for stride ordering. + + Multidimensional array data can be in row-major order, column-major order, + or some arbitrarily permuted order. Row and column major ordering are the + same thing if the array is 1D. +*/ +enum class ArrayStrideOrder : int +{ + ARBITRARY = 0, // Neither row nor column + ROW = 1, // Row-major + COLUMN = 2, // Column-major + BOTH = ROW | COLUMN // 1D arrays are both +}; + +/*! + @brief Indexing into a multidimensional structured array. + + Supports row-major and column-major ordering and arbitrary + permutations of the ordering. +*/ +template +class ArrayIndexer +{ + axom::StackArray m_strides; + axom::StackArray m_slowestDirs; + +public: + /*! + @brief Constructor for row- or column-major indexing. + @param [in] shape Shape of the array + @param [in] arrayStrideOrder A order indicator from + ArrayStrideOrder. + @param [in] fastestStrideLength Stride in the fastest + direction. + */ + ArrayIndexer(const axom::StackArray& shape, + axom::ArrayStrideOrder arrayStrideOrder, + int fastestStrideLength = 1) + { + initializeShape(shape, arrayStrideOrder, fastestStrideLength); + } + + /*! + @brief Constructor for a given order permutation. + @param [in] shape Shape of the array + @param [in] slowestDirs permutation vector, where + slowestDirs[0] is the slowest direction and + slowestDirs[DIM-1] is the fastest. + */ + ArrayIndexer(const axom::StackArray& shape, + const axom::StackArray& slowestDirs) + { + initializeShape(shape, slowestDirs); + } + + /*! + @brief Constructor for a given shape with the ordering of an + existing ArrayIndexer. + + @param [in] shape Shape of the array + @param [in] orderSource ArrayIndex to copy stride order + from. + */ + ArrayIndexer(const axom::StackArray& shape, + const axom::ArrayIndexer& orderSource) + { + initializeShape(shape, orderSource); + } + + /*! + @brief Constructor for arbitrary-stride indexing. + + @param [i] strides Strides. Must be unique when DIM > 1. + If not unique, use default constructor and initializeStrides(). + + @internal We could add the ArrayStrideOrder preference to this constructor + to handle the degenerate case of non-unique strides. But that would + clash with the more prevalent usage of constructing from the array's + shape. + */ + ArrayIndexer(const axom::StackArray& strides) : m_strides(strides) + { + initializeStrides(strides); + } + + /*! + @brief Default constructor + + Object must be initialized before use. + */ + ArrayIndexer() = default; + + /*! + @brief Initialize for row- or column-major indexing. + @param [in] shape Shape of the array + @param [in] arrayStrideOrder An order indicator from + ArrayStrideOrder. + @param [in] fastestStrideLength Stride in the fastest + direction. + */ + inline AXOM_HOST_DEVICE void initializeShape(const axom::StackArray& shape, + ArrayStrideOrder arrayStrideOrder, + int fastestStrideLength = 1) + { + SLIC_ASSERT(arrayStrideOrder == ArrayStrideOrder::COLUMN || + arrayStrideOrder == ArrayStrideOrder::ROW || + (DIM == 1 && arrayStrideOrder == ArrayStrideOrder::BOTH)); + if(arrayStrideOrder == ArrayStrideOrder::COLUMN) + { + for(int d = 0; d < DIM; ++d) + { + m_slowestDirs[d] = DIM - 1 - d; + } + m_strides[0] = fastestStrideLength; + for(int d = 1; d < DIM; ++d) + { + m_strides[d] = m_strides[d - 1] * shape[d - 1]; + } + } + else + { + for(int d = 0; d < DIM; ++d) + { + m_slowestDirs[d] = d; + } + m_strides[DIM - 1] = fastestStrideLength; + for(int d = DIM - 2; d >= 0; --d) + { + m_strides[d] = m_strides[d + 1] * shape[d + 1]; + } + } + } + + /*! + @brief Initialize for a given order permutation. + @param [in] shape Shape of the array + @param [in] slowestDirs permutation vector, where + slowestDirs[0] is the slowest direction and + slowestDirs[DIM-1] is the fastest. + */ + inline AXOM_HOST_DEVICE void initializeShape( + const axom::StackArray& shape, + const axom::StackArray& slowestDirs) + { + SLIC_ASSERT(isPermutation(slowestDirs)); + m_slowestDirs = slowestDirs; + m_strides[m_slowestDirs[DIM - 1]] = 1; + for(int d = DIM - 2; d >= 0; --d) + { + int dir = m_slowestDirs[d]; + int fasterDir = m_slowestDirs[d + 1]; + m_strides[dir] = m_strides[fasterDir] * shape[fasterDir]; + } + } + + /*! + @brief Initialize for a given shape with the ordering of an + existing ArrayIndexer. + + @param [in] shape Shape of the array + @param [in] orderSource ArrayIndex to copy stride order + from. + */ + inline AXOM_HOST_DEVICE void initializeShape( + const axom::StackArray& shape, + const axom::ArrayIndexer& orderSource) + { + initializeShape(shape, orderSource.slowestDirs()); + } + + /*! + @brief Initialize for arbitrary-stride indexing. + + @param [i] strides Strides. Must be unique when DIM > 1. + If not satisfied, you must use one of the other initializers. + */ + inline AXOM_HOST_DEVICE void initializeStrides( + const axom::StackArray& strides) + { + if(DIM > 1 && !stridesAreUnique(strides)) + { +#if !defined(AXOM_DEVICE_CODE) + std::ostringstream os; + os << "("; + for(int d = 0; d < DIM - 1; ++d) + { + os << strides[d] << ","; + } + os << strides[DIM - 1] << ")"; + std::cerr << "ERROR: ArrayIndexer: Non-unique strides " << os.str() << ".\n" + << "Likely, multi-dim array shape is 1 in some direction.\n" + << "Impossible to compute index ordering.\n" + << "Please use a different ArrayIndexer initializer.\n"; +#endif + utilities::processAbort(); + } + + // 2nd argument doesn't matter because strides are unique. + initializeStrides(strides, axom::ArrayStrideOrder::COLUMN); + } + + /*! + @brief Initialize for arbitrary-stride indexing, + with ordering preference for non-unique strides. + + @param [i] strides Strides. + @param [i] orderPref Ordering preference value + (from ArrayStrideOrder) if strides are non-unique. + */ + inline AXOM_HOST_DEVICE void initializeStrides( + const axom::StackArray& strides, + ArrayStrideOrder orderPref) + { + SLIC_ASSERT(orderPref == axom::ArrayStrideOrder::COLUMN || + orderPref == axom::ArrayStrideOrder::ROW); + + m_strides = strides; + for(int d = 0; d < DIM; ++d) + { + m_slowestDirs[d] = + orderPref == axom::ArrayStrideOrder::COLUMN ? d : DIM - 1 - d; + } + for(int s = 0; s < DIM; ++s) + { + for(int d = s; d < DIM; ++d) + { + if(m_strides[m_slowestDirs[s]] < m_strides[m_slowestDirs[d]]) + { + // Swap values. + auto tmp = m_slowestDirs[s]; + m_slowestDirs[s] = m_slowestDirs[d]; + m_slowestDirs[d] = tmp; + } + } + } + } + + static AXOM_HOST_DEVICE bool stridesAreUnique(const axom::StackArray& strides) + { + bool repeats = false; + for(int d = 1; d < DIM; ++d) + { + for(int e = 0; e < d; ++e) + { + repeats |= strides[d] == strides[e]; + } + } + return !repeats; + } + + inline AXOM_HOST_DEVICE bool operator==(const ArrayIndexer& other) const + { + return m_slowestDirs == other.m_slowestDirs && m_strides == other.m_strides; + } + + //!@brief Index directions, ordered from slowest to fastest. + inline AXOM_HOST_DEVICE const axom::StackArray& slowestDirs() const + { + return m_slowestDirs; + } + + //!@brief Strides. + inline AXOM_HOST_DEVICE const axom::StackArray& strides() const + { + return m_strides; + } + + //!@brief Whether a StackArray represents a permutation. + bool isPermutation(const axom::StackArray& v) + { + // v is a permutation if all its values are unique and in [0, DIM). + axom::StackArray found; + for(int d = 0; d < DIM; ++d) + { + found[d] = false; + } + for(int d = 0; d < DIM; ++d) + { + if(v[d] < 0 || v[d] >= DIM) + { + return false; // Out of range. + } + if(found[v[d]] == true) + { + return false; // Repeated index. + } + found[v[d]] = true; + } + return true; + } + + /*! + @brief Get the stride order (row- or column-major, or something else). + + @return Value from ArrayStrideOrder, indicating column order, + row order, both column and row (1D only) or arbitrary order. + */ + inline AXOM_HOST_DEVICE ArrayStrideOrder getStrideOrder() const + { + int ord = int(ArrayStrideOrder::BOTH); + for(int d = 0; d < DIM - 1; ++d) + { + ord &= m_slowestDirs[d] < m_slowestDirs[d + 1] + ? int(ArrayStrideOrder::ROW) + : int(ArrayStrideOrder::COLUMN); + } + static ArrayStrideOrder s_intToOrder[4] = {ArrayStrideOrder::ARBITRARY, + ArrayStrideOrder::ROW, + ArrayStrideOrder::COLUMN, + ArrayStrideOrder::BOTH}; + return s_intToOrder[ord]; + } + + //!@brief Convert multidimensional index to flat index. + inline AXOM_HOST_DEVICE T toFlatIndex(const axom::StackArray& multiIndex) const + { + T rval = numerics::dot_product(multiIndex.begin(), m_strides.begin(), DIM); + return rval; + } + + //!@brief Convert flat index to multidimensional index. + inline AXOM_HOST_DEVICE axom::StackArray toMultiIndex(T flatIndex) const + { + axom::StackArray multiIndex; + for(int d = 0; d < DIM; ++d) + { + int dir = m_slowestDirs[d]; + multiIndex[dir] = flatIndex / m_strides[dir]; + flatIndex -= multiIndex[dir] * m_strides[dir]; + } + return multiIndex; + } + + friend std::ostream& operator<<(std::ostream& os, const ArrayIndexer& a) + { + os << "ArrayIndexer: strides=(" << a.m_strides[0]; + for(int d = 1; d < DIM; ++d) + { + os << ',' << a.m_strides[d]; + } + os << ") slowestDirs=(" << a.m_slowestDirs[0]; + for(int d = 1; d < DIM; ++d) + { + os << ',' << a.m_slowestDirs[d]; + } + os << ')'; + return os; + } +}; + +} // end namespace axom + +#endif // QUEST_ARRAYINDEXER_HPP_ diff --git a/src/axom/quest/CMakeLists.txt b/src/axom/quest/CMakeLists.txt index aecc6e21cb..7daceb2ea3 100644 --- a/src/axom/quest/CMakeLists.txt +++ b/src/axom/quest/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -58,6 +58,8 @@ set( quest_headers interface/signed_distance.hpp util/mesh_helpers.hpp + MeshViewUtil.hpp + ArrayIndexer.hpp ) set( quest_sources @@ -102,20 +104,28 @@ if(AXOM_ENABLE_SIDRE) endif() if(CONDUIT_FOUND AND AXOM_ENABLE_MPI) - list(APPEND quest_headers DistributedClosestPoint.hpp ) + blt_list_append( + TO quest_headers + ELEMENTS DistributedClosestPoint.hpp + detail/DistributedClosestPointImpl.hpp + ) + blt_list_append( + TO quest_sources + ELEMENTS DistributedClosestPoint.cpp + ) list(APPEND quest_depends_on conduit::conduit conduit::conduit_mpi) endif() blt_list_append( TO quest_headers - ELEMENTS MarchingCubes.hpp detail/MarchingCubesImpl.hpp + ELEMENTS MarchingCubes.hpp detail/MarchingCubesSingleDomain.hpp detail/MarchingCubesImpl.hpp IF CONDUIT_FOUND ) blt_list_append( TO quest_sources - ELEMENTS MarchingCubes.cpp + ELEMENTS MarchingCubes.cpp detail/MarchingCubesSingleDomain.cpp IF CONDUIT_FOUND ) diff --git a/src/axom/quest/Delaunay.hpp b/src/axom/quest/Delaunay.hpp index 1d4d094ad8..a3fd97896a 100644 --- a/src/axom/quest/Delaunay.hpp +++ b/src/axom/quest/Delaunay.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/Discretize.cpp b/src/axom/quest/Discretize.cpp index 771a2be2a7..065a6aec2f 100644 --- a/src/axom/quest/Discretize.cpp +++ b/src/axom/quest/Discretize.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -188,7 +188,6 @@ double octPolyVolume(const OctType& o) { // Convert Octahedron into Polyhedrom PolyhedronType octPoly; - double octVolume; octPoly.addVertex(o[0]); octPoly.addVertex(o[1]); @@ -204,16 +203,7 @@ double octPolyVolume(const OctType& o) octPoly.addNeighbors(4, {0, 5, 3, 2}); octPoly.addNeighbors(5, {0, 1, 3, 4}); - octVolume = octPoly.volume(); - - // Flip sign if volume is negative - // (expected when vertex order is reversed) - if(octVolume < 0) - { - octVolume = -octVolume; - } - - return octVolume; + return octPoly.volume(); } } // namespace diff --git a/src/axom/quest/Discretize.hpp b/src/axom/quest/Discretize.hpp index da85f22a71..e97efafd4e 100644 --- a/src/axom/quest/Discretize.hpp +++ b/src/axom/quest/Discretize.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/DistributedClosestPoint.cpp b/src/axom/quest/DistributedClosestPoint.cpp new file mode 100644 index 0000000000..64d53db346 --- /dev/null +++ b/src/axom/quest/DistributedClosestPoint.cpp @@ -0,0 +1,336 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include "axom/config.hpp" +#include "axom/slic.hpp" +#include "axom/core/memory_management.hpp" +#include "axom/core/execution/execution_space.hpp" +#include "axom/core/execution/runtime_policy.hpp" +#include "axom/quest/DistributedClosestPoint.hpp" +#include "axom/quest/detail/DistributedClosestPointImpl.hpp" + +#include "axom/fmt.hpp" + +#include "conduit_blueprint.hpp" +#include "conduit_blueprint_mpi.hpp" +#include "conduit_relay_mpi.hpp" + +#include +#include + +#ifndef AXOM_USE_MPI + #error This file requires Axom to be configured with MPI +#endif +#include "mpi.h" + +namespace axom +{ +namespace quest +{ +DistributedClosestPoint::DistributedClosestPoint() + : m_mpiComm(MPI_COMM_WORLD) + , m_mpiCommIsPrivate(false) + , m_allocatorID(axom::INVALID_ALLOCATOR_ID) + , m_sqDistanceThreshold(std::numeric_limits::max()) +{ + setDefaultAllocatorID(); + setMpiCommunicator(MPI_COMM_WORLD); +} + +DistributedClosestPoint::~DistributedClosestPoint() +{ + if(m_mpiCommIsPrivate) + { + int mpiIsFinalized = 0; + MPI_Finalized(&mpiIsFinalized); + if(!mpiIsFinalized) + { + MPI_Comm_free(&m_mpiComm); + } + } +} + +void DistributedClosestPoint::setDefaultAllocatorID() +{ + int defaultAllocatorID = axom::INVALID_ALLOCATOR_ID; + switch(m_runtimePolicy) + { + case RuntimePolicy::seq: + defaultAllocatorID = axom::execution_space::allocatorID(); + break; + +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + case RuntimePolicy::omp: + defaultAllocatorID = axom::execution_space::allocatorID(); + break; +#endif + +#ifdef __CUDACC__ + #ifdef AXOM_RUNTIME_POLICY_USE_CUDA + case RuntimePolicy::cuda: + defaultAllocatorID = + axom::execution_space>::allocatorID(); + break; + #endif +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + case RuntimePolicy::hip: + defaultAllocatorID = + axom::execution_space>::allocatorID(); + break; +#endif + } + if(defaultAllocatorID == axom::INVALID_ALLOCATOR_ID) + { + SLIC_ERROR( + axom::fmt::format("There is no default allocator for runtime policy {}", + m_runtimePolicy)); + } + setAllocatorID(defaultAllocatorID); +} + +void DistributedClosestPoint::setAllocatorID(int allocatorID) +{ + SLIC_ASSERT_MSG(allocatorID != axom::INVALID_ALLOCATOR_ID, + "Invalid allocator id."); + m_allocatorID = allocatorID; + + if(m_dcp_2 != nullptr) + { + m_dcp_2->setAllocatorID(m_allocatorID); + } + if(m_dcp_3 != nullptr) + { + m_dcp_3->setAllocatorID(m_allocatorID); + } +} + +void DistributedClosestPoint::setMpiCommunicator(MPI_Comm mpiComm, bool duplicate) +{ + if(m_mpiCommIsPrivate) + { + MPI_Comm_free(&m_mpiComm); + } + + if(duplicate) + { + MPI_Comm_dup(mpiComm, &m_mpiComm); + } + else + { + m_mpiComm = mpiComm; + } + m_mpiCommIsPrivate = duplicate; +} + +void DistributedClosestPoint::setDimension(int dim) +{ + SLIC_ERROR_IF(dim < 2 || dim > 3, + "DistributedClosestPoint query only supports 2D or 3D queries"); + m_dimension = dim; +} + +void DistributedClosestPoint::setDistanceThreshold(double threshold) +{ + SLIC_ERROR_IF(threshold < 0.0, "Distance threshold must be non-negative."); + m_sqDistanceThreshold = threshold * threshold; +} + +void DistributedClosestPoint::setOutput(const std::string& field, bool on) +{ + // clang-format off + bool* f + = field == "cp_rank" ? &m_outputRank + : field == "cp_index" ? &m_outputIndex + : field == "cp_distance" ? &m_outputDistance + : field == "cp_coords" ? &m_outputCoords + : field == "cp_domain_index" ? &m_outputDomainIndex + : nullptr; + // clang-format on + SLIC_ERROR_IF(f == nullptr, + axom::fmt::format( + "Invalid field '{}' should be one of these: " + "cp_rank, cp_index, cp_distance, cp_coords, cp_domain_index", + field)); + *f = on; +} + +void DistributedClosestPoint::setObjectMesh(const conduit::Node& meshNode, + const std::string& topologyName) +{ + SLIC_ASSERT(this->isValidBlueprint(meshNode)); + + const bool isMultidomain = conduit::blueprint::mesh::is_multi_domain(meshNode); + + // If meshNode isn't multidomain, create a temporary multidomain representation. + std::shared_ptr tmpNode; + if(!isMultidomain) + { + tmpNode = std::make_shared(); + conduit::blueprint::mesh::to_multi_domain(meshNode, *tmpNode); + } + const conduit::Node& mdMeshNode(isMultidomain ? meshNode : *tmpNode); + verifyTopologyName(mdMeshNode, topologyName); + + auto domainCount = conduit::blueprint::mesh::number_of_domains(mdMeshNode); + + // Extract the dimension from the coordinate values group + // use allreduce since some ranks might be empty + { + int localDim = -1; + if(domainCount > 0) + { + const conduit::Node& domain0 = mdMeshNode.child(0); + const conduit::Node& topology = + domain0.fetch_existing("topologies/" + topologyName); + const std::string coordsetName = + topology.fetch_existing("coordset").as_string(); + const conduit::Node& coordset = + domain0.fetch_existing("coordsets/" + coordsetName); + const conduit::Node& coordsetValues = coordset.fetch_existing("values"); + localDim = internal::extractDimension(coordsetValues); + } + int dim = -1; + MPI_Allreduce(&localDim, &dim, 1, MPI_INT, MPI_MAX, m_mpiComm); + setDimension(dim); + } + + allocateQueryInstance(); + + switch(m_dimension) + { + case 2: + m_dcp_2->importObjectPoints(mdMeshNode, topologyName); + break; + case 3: + m_dcp_3->importObjectPoints(mdMeshNode, topologyName); + break; + } + + return; +} + +bool DistributedClosestPoint::generateBVHTree() +{ + SLIC_ASSERT_MSG(m_objectMeshCreated, + "Must call 'setObjectMesh' before calling generateBVHTree"); + + bool success = false; + + // dispatch to implementation class over dimension + switch(m_dimension) + { + case 2: + success = m_dcp_2->generateBVHTree(); + break; + case 3: + success = m_dcp_3->generateBVHTree(); + break; + } + + return success; +} + +void DistributedClosestPoint::computeClosestPoints(conduit::Node& query_node, + const std::string& topology) +{ + SLIC_ASSERT_MSG(m_objectMeshCreated, + "Must call 'setObjectMesh' before calling generateBVHTree"); + + SLIC_ASSERT(this->isValidBlueprint(query_node)); + + // dispatch to implementation class over dimension + switch(m_dimension) + { + case 2: + m_dcp_2->setSquaredDistanceThreshold(m_sqDistanceThreshold); + m_dcp_2->setMpiCommunicator(m_mpiComm); + m_dcp_2->setOutputSwitches(m_outputRank, + m_outputIndex, + m_outputDistance, + m_outputCoords, + m_outputDomainIndex); + m_dcp_2->computeClosestPoints(query_node, topology); + break; + case 3: + m_dcp_3->setSquaredDistanceThreshold(m_sqDistanceThreshold); + m_dcp_3->setMpiCommunicator(m_mpiComm); + m_dcp_3->setOutputSwitches(m_outputRank, + m_outputIndex, + m_outputDistance, + m_outputCoords, + m_outputDomainIndex); + m_dcp_3->computeClosestPoints(query_node, topology); + break; + } +} + +void DistributedClosestPoint::allocateQueryInstance() +{ + SLIC_ASSERT_MSG(m_objectMeshCreated == false, "Object mesh already created"); + + switch(m_dimension) + { + case 2: + m_dcp_2 = + std::make_unique>(m_runtimePolicy, + m_allocatorID, + m_isVerbose); + m_objectMeshCreated = true; + break; + case 3: + m_dcp_3 = + std::make_unique>(m_runtimePolicy, + m_allocatorID, + m_isVerbose); + m_objectMeshCreated = true; + break; + } + + SLIC_ASSERT_MSG( + m_objectMeshCreated, + "Called allocateQueryInstance, but did not create an instance"); +} + +bool DistributedClosestPoint::isValidBlueprint(const conduit::Node& mesh_node) const +{ + bool success = true; + conduit::Node info; + if(!conduit::blueprint::mpi::verify("mesh", mesh_node, info, m_mpiComm)) + { + SLIC_INFO("Invalid blueprint for particle mesh: \n" << info.to_yaml()); + success = false; + } + + return success; +} + +void DistributedClosestPoint::verifyTopologyName(const conduit::Node& meshNode, + const std::string& topologyName) +{ + std::string coordsetPath; + const std::string topologyPath = + axom::fmt::format("topologies/{}", topologyName); + for(axom::IndexType d = 0; d < meshNode.number_of_children(); ++d) + { + const auto& domain = meshNode.child(d); + if(!domain.has_path(topologyPath)) + { + auto errMsg = fmt::format("No such topology '{}' found.", topologyName); + if(domain.has_path("coordsets/" + topologyName)) + { + errMsg += fmt::format( + " You may have mistakenly specified a coordset name." + " The interface has changed to use topology name" + " instead of coordset."); + } + SLIC_ERROR(errMsg); + } + } +} + +} // end namespace quest +} // end namespace axom diff --git a/src/axom/quest/DistributedClosestPoint.hpp b/src/axom/quest/DistributedClosestPoint.hpp index 1967801cba..0dda02c891 100644 --- a/src/axom/quest/DistributedClosestPoint.hpp +++ b/src/axom/quest/DistributedClosestPoint.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -7,1386 +7,28 @@ #define QUEST_DISTRIBUTED_CLOSEST_POINT_H_ #include "axom/config.hpp" -#include "axom/core.hpp" -#include "axom/slic.hpp" -#include "axom/slam.hpp" -#include "axom/sidre.hpp" -#include "axom/primal.hpp" -#include "axom/spin.hpp" +#include "axom/core/execution/runtime_policy.hpp" -#include "axom/fmt.hpp" - -#include "conduit_blueprint.hpp" -#include "conduit_blueprint_mcarray.hpp" -#include "conduit_blueprint_mpi.hpp" -#include "conduit_relay_mpi.hpp" -#include "conduit_relay_io.hpp" +#include "conduit_node.hpp" #include -#include #include -#include -#include #ifndef AXOM_USE_MPI #error This file requires Axom to be configured with MPI #endif #include "mpi.h" -// Add some helper preprocessor defines for using OPENMP, CUDA, and HIP policies -// within the distributed closest point query. -#if defined(AXOM_USE_RAJA) - #ifdef AXOM_USE_OPENMP - #define _AXOM_DCP_USE_OPENMP - #endif - #if defined(AXOM_USE_CUDA) && defined(AXOM_USE_UMPIRE) - #define _AXOM_DCP_USE_CUDA - #endif - #if defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) - #define _AXOM_DCP_USE_HIP - #endif -#endif - namespace axom { namespace quest { -/// Enum for runtime execution policy -enum class DistributedClosestPointRuntimePolicy -{ - seq = 0, - omp = 1, - cuda = 2, - hip = 3 -}; - -/// Utility function to allow formating a DistributedClosestPointRuntimePolicy -inline auto format_as(DistributedClosestPointRuntimePolicy pol) -{ - return fmt::underlying(pol); -} - namespace internal { -// Utility function to dump a conduit node on each rank, e.g. for debugging -inline void dump_node(const conduit::Node& n, - const std::string&& fname, - const std::string& protocol = "json") -{ - conduit::relay::io::save(n, fname, protocol); -} - -/** - * \brief Utility function to get a typed pointer to the beginning of an array - * stored by a conduit::Node - */ -template -T* getPointer(conduit::Node& node) -{ - T* ptr = node.value(); - return ptr; -} - -/** - * \brief Utility function to create an axom::ArrayView over the array - * of native types stored by a conduit::Node - */ -template -axom::ArrayView ArrayView_from_Node(conduit::Node& node, int sz) -{ - T* ptr = node.value(); - return axom::ArrayView(ptr, sz); -} - -/** - * \brief Template specialization of ArrayView_from_Node for Point - * - * \warning Assumes the underlying data is an MCArray with stride 2 access - */ -template <> -inline axom::ArrayView> ArrayView_from_Node( - conduit::Node& node, - int sz) -{ - using PointType = primal::Point; - - PointType* ptr = static_cast(node.data_ptr()); - return axom::ArrayView(ptr, sz); -} - -/** - * \brief Template specialization of ArrayView_from_Node for Point - * - * \warning Assumes the underlying data is an MCArray with stride 3 access - */ -template <> -inline axom::ArrayView> ArrayView_from_Node( - conduit::Node& node, - int sz) -{ - using PointType = primal::Point; - - PointType* ptr = static_cast(node.data_ptr()); - return axom::ArrayView(ptr, sz); -} - -/** - * \brief Put BoundingBox into a Conduit Node. - */ -template -void put_bounding_box_to_conduit_node(const primal::BoundingBox& bb, - conduit::Node& node) -{ - node["dim"].set(bb.dimension()); - if(bb.isValid()) - { - node["lo"].set(bb.getMin().data(), bb.dimension()); - node["hi"].set(bb.getMax().data(), bb.dimension()); - } +template +class DistributedClosestPointImpl; } -/** - * \brief Get BoundingBox from a Conduit Node. - */ -template -void get_bounding_box_from_conduit_node(primal::BoundingBox& bb, - const conduit::Node& node) -{ - using PointType = primal::Point; - - SLIC_ASSERT(NDIMS == node.fetch_existing("dim").as_int()); - - bb.clear(); - - if(node.has_child("lo")) - { - bb.addPoint(PointType(node.fetch_existing("lo").as_double_ptr(), NDIMS)); - bb.addPoint(PointType(node.fetch_existing("hi").as_double_ptr(), NDIMS)); - } -} - -/// Helper function to extract the dimension from the coordinate values group -/// of a mesh blueprint coordset -inline int extractDimension(const conduit::Node& values_node) -{ - SLIC_ASSERT(values_node.has_child("x")); - return values_node.has_child("z") ? 3 : (values_node.has_child("y") ? 2 : 1); -} - -/// Helper function to extract the number of points from the coordinate values group -/// of a mesh blueprint coordset -inline int extractSize(const conduit::Node& values_node) -{ - SLIC_ASSERT(values_node.has_child("x")); - return values_node["x"].dtype().number_of_elements(); -} - -namespace relay -{ -namespace mpi -{ -/** - * \brief Sends a conduit node along with its schema using MPI_Isend - * - * \param [in] node node to send - * \param [in] dest ID of MPI rank to send to - * \param [in] tag tag for MPI message - * \param [in] comm MPI communicator to use - * \param [in] request object holding state for the sent data - * \note Adapted from conduit's relay::mpi's \a send_using_schema and \a isend to use - * non-blocking \a MPI_Isend instead of blocking \a MPI_Send - */ -inline int isend_using_schema(conduit::Node& node, - int dest, - int tag, - MPI_Comm comm, - conduit::relay::mpi::Request* request) -{ - conduit::Schema s_data_compact; - - // schema will only be valid if compact and contig - if(node.is_compact() && node.is_contiguous()) - { - s_data_compact = node.schema(); - } - else - { - node.schema().compact_to(s_data_compact); - } - const std::string snd_schema_json = s_data_compact.to_json(); - - conduit::Schema s_msg; - s_msg["schema_len"].set(conduit::DataType::int64()); - s_msg["schema"].set(conduit::DataType::char8_str(snd_schema_json.size() + 1)); - s_msg["data"].set(s_data_compact); - - // create a compact schema to use - conduit::Schema s_msg_compact; - s_msg.compact_to(s_msg_compact); - request->m_buffer.reset(); - request->m_buffer.set_schema(s_msg_compact); - - // set up the message's node using this schema - request->m_buffer["schema_len"].set((std::int64_t)snd_schema_json.length()); - request->m_buffer["schema"].set(snd_schema_json); - request->m_buffer["data"].update(node); - - // for wait_all, this must always be NULL except for - // the irecv cases where copy out is necessary - // isend case must always be NULL - request->m_rcv_ptr = nullptr; - - auto msg_data_size = request->m_buffer.total_bytes_compact(); - int mpi_error = MPI_Isend(const_cast(request->m_buffer.data_ptr()), - static_cast(msg_data_size), - MPI_BYTE, - dest, - tag, - comm, - &(request->m_request)); - - // Error checking -- Note: expansion of CONDUIT_CHECK_MPI_ERROR - if(static_cast(mpi_error) != MPI_SUCCESS) - { - char check_mpi_err_str_buff[MPI_MAX_ERROR_STRING]; - int check_mpi_err_str_len = 0; - MPI_Error_string(mpi_error, check_mpi_err_str_buff, &check_mpi_err_str_len); - - SLIC_ERROR( - fmt::format("MPI call failed: error code = {} error message = {}", - mpi_error, - check_mpi_err_str_buff)); - } - - return mpi_error; -} - -/// A modified version of the conduit method. -// This version works correctly when src is MPI_ANY_SOURCE -// and tag is MPI_ANY_TAG. When conduit supports this, -// this version can be removed. -inline int recv_using_schema(conduit::Node& node, int src, int tag, MPI_Comm comm) -{ - MPI_Status status; - - int mpi_error = MPI_Probe(src, tag, comm, &status); - - // CONDUIT_CHECK_MPI_ERROR(mpi_error); - // Expand the conduit macro: - if(static_cast(mpi_error) != MPI_SUCCESS) - { - char check_mpi_err_str_buff[MPI_MAX_ERROR_STRING]; - int check_mpi_err_str_len = 0; - MPI_Error_string(mpi_error, check_mpi_err_str_buff, &check_mpi_err_str_len); - - SLIC_ERROR( - fmt::format("MPI call failed: error code = {} error message = {}", - mpi_error, - check_mpi_err_str_buff)); - } - - int buffer_size = 0; - MPI_Get_count(&status, MPI_BYTE, &buffer_size); - - conduit::Node n_buffer(conduit::DataType::uint8(buffer_size)); - - mpi_error = MPI_Recv(n_buffer.data_ptr(), - buffer_size, - MPI_BYTE, - status.MPI_SOURCE, - status.MPI_TAG, - comm, - &status); - - std::uint8_t* n_buff_ptr = (std::uint8_t*)n_buffer.data_ptr(); - - conduit::Node n_msg; - // length of the schema is sent as a 64-bit signed int - // NOTE: we aren't using this value ... - n_msg["schema_len"].set_external((std::int64_t*)n_buff_ptr); - n_buff_ptr += 8; - // wrap the schema string - n_msg["schema"].set_external_char8_str((char*)(n_buff_ptr)); - // create the schema - conduit::Schema rcv_schema; - conduit::Generator gen(n_msg["schema"].as_char8_str()); - gen.walk(rcv_schema); - - // advance by the schema length - n_buff_ptr += n_msg["schema"].total_bytes_compact(); - - // apply the schema to the data - n_msg["data"].set_external(rcv_schema, n_buff_ptr); - - // copy out to our result node - node.update(n_msg["data"]); - - return mpi_error; -} - -} // namespace mpi -} // namespace relay - -/** - * \brief Implements the DistributedClosestPoint query for a specified dimension - * using a provided execution policy (e.g. sequential, openmp, cuda, hip) - * - * \tparam NDIMS The dimension of the object mesh and query points - */ -template -class DistributedClosestPointImpl -{ -public: - static constexpr int DIM = NDIMS; - using RuntimePolicy = DistributedClosestPointRuntimePolicy; - using PointType = primal::Point; - using BoxType = primal::BoundingBox; - using PointArray = axom::Array; - using BoxArray = axom::Array; - - using SeqBVHTree = spin::BVH; -#ifdef _AXOM_DCP_USE_OPENMP - using OmpBVHTree = spin::BVH; -#endif -#ifdef _AXOM_DCP_USE_CUDA - using CudaBVHTree = spin::BVH>; -#endif -#ifdef _AXOM_DCP_USE_HIP - using HipBVHTree = spin::BVH>; -#endif - -private: - struct MinCandidate - { - /// Squared distance to query point - double sqDist {numerics::floating_point_limits::max()}; - /// Index of domain of closest element - int domainIdx {-1}; - /// Index within domain of closest element - int pointIdx {-1}; - /// MPI rank of closest element - int rank {-1}; - }; - -public: - DistributedClosestPointImpl(RuntimePolicy runtimePolicy, - int allocatorID, - bool isVerbose) - : m_runtimePolicy(runtimePolicy) - , m_isVerbose(isVerbose) - , m_sqDistanceThreshold(std::numeric_limits::max()) - , m_allocatorID(allocatorID) - , m_mpiComm(MPI_COMM_NULL) - , m_rank(-1) - , m_nranks(-1) - , m_objectPtCoords(0, 0, allocatorID) - , m_objectPtDomainIds(0, 0, allocatorID) - { - SLIC_ASSERT(allocatorID != axom::INVALID_ALLOCATOR_ID); - - setMpiCommunicator(MPI_COMM_WORLD); - } - - /** - * \brief Set the MPI communicator. - */ - void setMpiCommunicator(MPI_Comm mpiComm) - { - m_mpiComm = mpiComm; - MPI_Comm_rank(m_mpiComm, &m_rank); - MPI_Comm_size(m_mpiComm, &m_nranks); - } - - /** - * \brief Sets the threshold for the query - * - * \param [in] threshold Ignore distances greater than this value. - */ - void setSquaredDistanceThreshold(double sqThreshold) - { - SLIC_ERROR_IF(sqThreshold < 0.0, - "Squared distance-threshold must be non-negative."); - m_sqDistanceThreshold = sqThreshold; - } - - /*! @brief Sets the allocator ID to the default associated with the - execution policy - */ - void setAllocatorID(int allocatorID) - { - SLIC_ASSERT(allocatorID != axom::INVALID_ALLOCATOR_ID); - // TODO: If appropriate, how to check for compatibility with runtime policy? - m_allocatorID = allocatorID; - } - -public: - /** - * Import object mesh points from the object blueprint mesh into internal memory. - * - * \param [in] mdMeshNode The blueprint mesh containing the object points. - * \param [in] valuesPath The path to the mesh points. - * \note This function currently supports mesh blueprints with the "point" topology - */ - void importObjectPoints(const conduit::Node& mdMeshNode, - const std::string& valuesPath) - { - // TODO: See if some of the copies in this method can be optimized out. - - SLIC_ASSERT(sizeof(double) * DIM == sizeof(PointType)); - - // Count points in the mesh. - int ptCount = 0; - for(const conduit::Node& domain : mdMeshNode.children()) - { - auto& values = domain.fetch_existing(valuesPath); - const int N = internal::extractSize(values); - ptCount += N; - } - - // Copy points to internal memory - PointArray coords(ptCount, ptCount); - axom::Array domIds(ptCount, ptCount); - std::size_t copiedCount = 0; - conduit::Node tmpValues; - for(conduit::index_t d = 0; d < mdMeshNode.number_of_children(); ++d) - { - const conduit::Node& domain = mdMeshNode.child(d); - - auto& values = domain.fetch_existing(valuesPath); - - bool isInterleaved = conduit::blueprint::mcarray::is_interleaved(values); - if(!isInterleaved) - { - conduit::blueprint::mcarray::to_interleaved(values, tmpValues); - } - const conduit::Node& copySrc = isInterleaved ? values : tmpValues; - - const int N = internal::extractSize(copySrc); - const std::size_t nBytes = sizeof(double) * DIM * N; - - axom::copy(coords.data() + copiedCount, - copySrc.fetch_existing("x").data_ptr(), - nBytes); - tmpValues.reset(); - - domIds.fill(d, copiedCount, N); - - copiedCount += N; - } - // copy computed data to ExecSpace - m_objectPtCoords = PointArray(coords, m_allocatorID); - m_objectPtDomainIds = axom::Array(domIds, m_allocatorID); - } - - /// Predicate to check if the BVH tree has been initialized - bool isBVHTreeInitialized() const - { - switch(m_runtimePolicy) - { - case RuntimePolicy::seq: - return m_bvh_seq.get() != nullptr; - - case RuntimePolicy::omp: -#ifdef _AXOM_DCP_USE_OPENMP - return m_bvh_omp.get() != nullptr; -#else - break; -#endif - - case RuntimePolicy::cuda: -#ifdef _AXOM_DCP_USE_CUDA - return m_bvh_cuda.get() != nullptr; -#else - break; -#endif - case RuntimePolicy::hip: -#ifdef _AXOM_DCP_USE_HIP - return m_bvh_hip.get() != nullptr; -#else - break; -#endif - } - - return false; - } - - /// Generates the BVH tree for the classes execution space - bool generateBVHTree() - { - // Delegates to generateBVHTreeImpl<> which uses - // the execution space templated bvh tree - - SLIC_ASSERT_MSG(!isBVHTreeInitialized(), "BVH tree already initialized"); - - // In case user changed the allocator after setObjectMesh, - // move the object point data to avoid repetitive page faults. - if(m_objectPtCoords.getAllocatorID() != m_allocatorID) - { - PointArray tmpPoints(m_objectPtCoords, m_allocatorID); - m_objectPtCoords.swap(tmpPoints); - } - - switch(m_runtimePolicy) - { - case RuntimePolicy::seq: - m_bvh_seq = std::make_unique(); - return generateBVHTreeImpl(m_bvh_seq.get()); - - case RuntimePolicy::omp: -#ifdef _AXOM_DCP_USE_OPENMP - m_bvh_omp = std::make_unique(); - return generateBVHTreeImpl(m_bvh_omp.get()); -#else - break; -#endif - - case RuntimePolicy::cuda: -#ifdef _AXOM_DCP_USE_CUDA - m_bvh_cuda = std::make_unique(); - return generateBVHTreeImpl(m_bvh_cuda.get()); -#else - break; -#endif - - case RuntimePolicy::hip: -#ifdef _AXOM_DCP_USE_HIP - m_bvh_hip = std::make_unique(); - return generateBVHTreeImpl(m_bvh_hip.get()); -#else - break; -#endif - } - - // Fail safe -- we should never reach this line! - SLIC_ERROR("Failed to initialize the BVH tree"); - - return false; - } - - /// Get local copy of all ranks BVH root bounding boxes. - void gatherBVHRoots() - { - SLIC_ASSERT_MSG( - isBVHTreeInitialized(), - "BVH tree must be initialized before calling 'gatherBVHRoots"); - - BoxType local_bb; - switch(m_runtimePolicy) - { - case RuntimePolicy::seq: - local_bb = m_bvh_seq->getBounds(); - break; - - case RuntimePolicy::omp: -#ifdef _AXOM_DCP_USE_OPENMP - local_bb = m_bvh_omp->getBounds(); - break; -#else - break; -#endif - - case RuntimePolicy::cuda: -#ifdef _AXOM_DCP_USE_CUDA - local_bb = m_bvh_cuda->getBounds(); - break; -#else - break; -#endif - - case RuntimePolicy::hip: -#ifdef _AXOM_DCP_USE_HIP - local_bb = m_bvh_hip->getBounds(); - break; -#else - break; -#endif - } - - gatherBoundingBoxes(local_bb, m_objectPartitionBbs); - } - - /// Allgather one bounding box from each rank. - void gatherBoundingBoxes(const BoxType& aabb, BoxArray& all_aabbs) const - { - axom::Array sendbuf(2 * DIM); - aabb.getMin().to_array(&sendbuf[0]); - aabb.getMax().to_array(&sendbuf[DIM]); - axom::Array recvbuf(m_nranks * sendbuf.size()); - // Note: Using axom::Array may reduce clutter a tad. - int errf = MPI_Allgather(sendbuf.data(), - 2 * DIM, - mpi_traits::type, - recvbuf.data(), - 2 * DIM, - mpi_traits::type, - m_mpiComm); - SLIC_ASSERT(errf == MPI_SUCCESS); - AXOM_UNUSED_VAR(errf); - - all_aabbs.clear(); - all_aabbs.reserve(m_nranks); - for(int i = 0; i < m_nranks; ++i) - { - PointType lower(&recvbuf[i * 2 * DIM]); - PointType upper(&recvbuf[i * 2 * DIM + DIM]); - all_aabbs.emplace_back(BoxType(lower, upper, false)); - } - } - - /// Compute bounding box for local part of a mesh. - BoxType computeMeshBoundingBox(conduit::Node& xferNode) const - { - BoxType rval; - - conduit::Node& xferDoms = xferNode.fetch_existing("xferDoms"); - for(conduit::Node& xferDom : xferDoms.children()) - { - const int qPtCount = xferDom.fetch_existing("qPtCount").value(); - - /// Extract fields from the input node as ArrayViews - auto queryPts = - ArrayView_from_Node(xferDom.fetch_existing("coords"), - qPtCount); - for(const auto& p : queryPts) - { - rval.addPoint(p); - } - } - - return rval; - } - - /*! - * Copy parts of query mesh partition to a conduit::Node for - * computation and communication. - * queryNode must be a blueprint multidomain mesh. - */ - void node_copy_query_to_xfer(conduit::Node& queryNode, - conduit::Node& xferNode, - const std::string& coordset) const - { - xferNode["homeRank"] = m_rank; - xferNode["is_first"] = 1; - - conduit::Node& xferDoms = xferNode["xferDoms"]; - for(auto& queryDom : queryNode.children()) - { - const std::string& domName = queryDom.name(); - conduit::Node& xferDom = xferDoms[domName]; - conduit::Node& fields = queryDom.fetch_existing("fields"); - conduit::Node& queryCoords = - queryDom.fetch_existing(fmt::format("coordsets/{}", coordset)); - conduit::Node& queryCoordsValues = queryCoords.fetch_existing("values"); - - // clang-format off - copy_components_to_interleaved(queryCoordsValues, xferDom["coords"]); - - xferDom["cp_index"].set_external(fields.fetch_existing("cp_index/values")); - xferDom["cp_rank"].set_external(fields.fetch_existing("cp_rank/values")); - copy_components_to_interleaved(fields.fetch_existing("cp_coords/values"), - xferDom["cp_coords"]); - xferDom["cp_domain_index"].set_external(fields.fetch_existing("cp_domain_index/values")); - - if(fields.has_path("cp_distance")) - { - xferDom["debug/cp_distance"].set_external(fields.fetch_existing("cp_distance/values")); - } - // clang-format on - - const int dim = internal::extractDimension(queryCoordsValues); - const int qPtCount = internal::extractSize(queryCoordsValues); - xferDom["qPtCount"] = qPtCount; - xferDom["dim"] = dim; - } - } - - /// Copy xferNode back to query mesh partition. - void node_copy_xfer_to_query(const conduit::Node& xferNode, - conduit::Node& queryNode) const - { - const conduit::Node& xferDoms = xferNode.fetch_existing("xferDoms"); - conduit::index_t childCount = queryNode.number_of_children(); - SLIC_ASSERT(xferDoms.number_of_children() == childCount); - for(conduit::index_t ci = 0; ci < childCount; ++ci) - { - const conduit::Node& xferDom = xferDoms.child(ci); - conduit::Node& queryDom = queryNode.child(ci); - conduit::Node& fields = queryDom.fetch_existing("fields"); - - { - auto& src = xferDom.fetch_existing("cp_rank"); - auto& dst = fields.fetch_existing("cp_rank/values"); - if(dst.data_ptr() != src.data_ptr()) - { - dst.update_compatible(src); - } - } - - { - auto& src = xferDom.fetch_existing("cp_index"); - auto& dst = fields.fetch_existing("cp_index/values"); - if(dst.data_ptr() != src.data_ptr()) - { - dst.update_compatible(src); - } - } - - { - auto& src = xferDom.fetch_existing("cp_domain_index"); - auto& dst = fields.fetch_existing("cp_domain_index/values"); - if(dst.data_ptr() != src.data_ptr()) - { - dst.update_compatible(src); - } - } - - copy_interleaved_to_components(xferDom.fetch_existing("cp_coords"), - fields.fetch_existing("cp_coords/values")); - - if(xferDom.has_path("debug/cp_distance")) - { - auto& src = xferDom.fetch_existing("debug/cp_distance"); - auto& dst = fields.fetch_existing("cp_distance/values"); - if(dst.data_ptr() != src.data_ptr()) - { - dst.update_compatible(src); - } - } - } - } - - /* - Special copy from coordinates (in a format that's not - necessarily interleaved) to a 1D array of interleaved values). - If coordinates are already interleaved, copy pointer. - */ - void copy_components_to_interleaved(conduit::Node& components, - conduit::Node& interleaved) const - { - const int dim = internal::extractDimension(components); - const int qPtCount = internal::extractSize(components); - bool interleavedSrc = conduit::blueprint::mcarray::is_interleaved(components); - if(interleavedSrc) - { - interleaved.set_external(internal::getPointer(components.child(0)), - dim * qPtCount); - } - else - { - // Copy from component-wise src to 1D-interleaved dst. - interleaved.reset(); - interleaved.set_dtype(conduit::DataType::float64(dim * qPtCount)); - for(int d = 0; d < dim; ++d) - { - auto src = components.child(d).as_float64_array(); - double* dst = interleaved.as_float64_ptr() + d; - for(int i = 0; i < qPtCount; ++i) - { - dst[i * dim] = src[i]; - } - } - } - } - - /* - Special copy from 1D interleaved coordinate values back to - component-wise storage. - This is a nop if they point to the same data. - */ - void copy_interleaved_to_components(const conduit::Node& interleaved, - conduit::Node& components) const - { - if(interleaved.data_ptr() != components.child(0).data_ptr()) - { - const int dim = internal::extractDimension(components); - const int qPtCount = internal::extractSize(components); - // Copy from 1D-interleaved src to component-wise dst. - for(int d = 0; d < dim; ++d) - { - const double* src = interleaved.as_float64_ptr() + d; - auto dst = components.child(d).as_float64_array(); - for(int i = 0; i < qPtCount; ++i) - { - dst[i] = src[i * dim]; - } - } - } - } - - /** - * \brief Computes the closest point within the objects for each query point - * in the mesh \a queryMesh. - * - * \param queryMesh The root node of a mesh blueprint for the query points - * Can be empty if there are no query points for the calling rank - * \param coordset The coordinate set for the query points - * - * When the query mesh contains query points, it uses the \a coordset coordinate set - * of the provided blueprint mesh and contains the following fields: - * - cp_rank: Will hold the rank of the object point containing the closest point - * - cp_domain_index: will hold the index of the object domain containing - * the closest points. - * - cp_index: Will hold the index of the closest object points. - * For multiple object mesh domains on a rank, cp_index is relative to - * each domain. - * - cp_coords: Will hold the coordinates of the closest points - * interleaved in a 1D array. - * - * \note The current implementation assumes that the coordinates and - * cp_coords are interleaved or contiguous. - * - * \note We're temporarily also using a cp_distance field while debugging this class. - * The code will use this field if it is present in \a queryMesh. - * - * We use non-blocking sends for performance and deadlock avoidance. - * The worst case could incur nranks^2 sends. To avoid excessive - * buffer usage, we occasionally check the sends for completion, - * using check_send_requests(). - */ - void computeClosestPoints(conduit::Node& queryMesh_, - const std::string& coordset) const - { - SLIC_ASSERT_MSG( - isBVHTreeInitialized(), - "BVH tree must be initialized before calling 'computeClosestPoints"); - - // If query mesh isn't multidomain, create a temporary multidomain representation. - const bool qmIsMultidomain = - conduit::blueprint::mesh::is_multi_domain(queryMesh_); - std::shared_ptr tmpNode; - if(!qmIsMultidomain) - { - tmpNode = std::make_shared(); - conduit::blueprint::mesh::to_multi_domain(queryMesh_, *tmpNode); - } - conduit::Node& queryMesh = qmIsMultidomain ? queryMesh_ : *tmpNode; - - std::map> xferNodes; - - // create conduit Node containing data that has to xfer between ranks. - // The node will be mostly empty if there are no domains on this rank - { - xferNodes[m_rank] = std::make_shared(); - conduit::Node& xferNode = *xferNodes[m_rank]; - node_copy_query_to_xfer(queryMesh, xferNode, coordset); - xferNode["homeRank"] = m_rank; - } - - BoxType myQueryBb = computeMeshBoundingBox(*xferNodes[m_rank]); - put_bounding_box_to_conduit_node(myQueryBb, xferNodes[m_rank]->fetch("aabb")); - BoxArray allQueryBbs; - gatherBoundingBoxes(myQueryBb, allQueryBbs); - - { - conduit::Node& xferNode = *xferNodes[m_rank]; - computeLocalClosestPointsByPolicy(xferNode); - } - - const auto& myObjectBb = m_objectPartitionBbs[m_rank]; - int remainingRecvs = 0; - for(int r = 0; r < m_nranks; ++r) - { - if(r != m_rank) - { - const auto& otherQueryBb = allQueryBbs[r]; - double sqDistance = - axom::primal::squared_distance(otherQueryBb, myObjectBb); - if(sqDistance <= m_sqDistanceThreshold) - { - ++remainingRecvs; - } - } - } - - // arbitrary tags for send/recv xferNode. - const int tag = 987342; - - std::list isendRequests; - - { - /* - Send local query mesh to next rank with close-enough object - partition, if any. Increase remainingRecvs, because this data - will come back. - */ - int firstRecipForMyQuery = next_recipient(*xferNodes[m_rank]); - if(m_nranks == 1) - { - SLIC_ASSERT(firstRecipForMyQuery == -1); - } - - if(firstRecipForMyQuery == -1) - { - // No need to send anywhere. Put computed data back into queryMesh. - node_copy_xfer_to_query(*xferNodes[m_rank], queryMesh); - xferNodes.erase(m_rank); - } - else - { - isendRequests.emplace_back(conduit::relay::mpi::Request()); - auto& req = isendRequests.back(); - relay::mpi::isend_using_schema(*xferNodes[m_rank], - firstRecipForMyQuery, - tag, - m_mpiComm, - &req); - ++remainingRecvs; - } - } - - while(remainingRecvs > 0) - { - SLIC_INFO_IF( - m_isVerbose, - fmt::format("======= {} receives remaining =======", remainingRecvs)); - - // Receive the next xferNode - std::shared_ptr recvXferNodePtr = - std::make_shared(); - relay::mpi::recv_using_schema(*recvXferNodePtr, - MPI_ANY_SOURCE, - tag, - m_mpiComm); - - const int homeRank = recvXferNodePtr->fetch_existing("homeRank").as_int(); - --remainingRecvs; - xferNodes[homeRank] = recvXferNodePtr; - conduit::Node& xferNode = *xferNodes[homeRank]; - - if(homeRank == m_rank) - { - node_copy_xfer_to_query(xferNode, queryMesh); - } - else - { - computeLocalClosestPointsByPolicy(xferNode); - - isendRequests.emplace_back(conduit::relay::mpi::Request()); - auto& isendRequest = isendRequests.back(); - int nextRecipient = next_recipient(xferNode); - SLIC_ASSERT(nextRecipient != -1); - relay::mpi::isend_using_schema(xferNode, - nextRecipient, - tag, - m_mpiComm, - &isendRequest); - - // Check non-blocking sends to free memory. - check_send_requests(isendRequests, false); - } - - } // remainingRecvs loop - - // Complete remaining non-blocking sends. - while(!isendRequests.empty()) - { - check_send_requests(isendRequests, true); - } - - MPI_Barrier(m_mpiComm); - slic::flushStreams(); - } - -private: - /// Distance search using local object partition and xferNode. - void computeLocalClosestPointsByPolicy(conduit::Node& xferNode) const - { - switch(m_runtimePolicy) - { - case RuntimePolicy::seq: - computeLocalClosestPoints(m_bvh_seq.get(), xferNode); - break; - - case RuntimePolicy::omp: -#ifdef _AXOM_DCP_USE_OPENMP - computeLocalClosestPoints(m_bvh_omp.get(), xferNode); -#endif - break; - - case RuntimePolicy::cuda: -#ifdef _AXOM_DCP_USE_CUDA - computeLocalClosestPoints(m_bvh_cuda.get(), xferNode); -#endif - break; - - case RuntimePolicy::hip: -#ifdef _AXOM_DCP_USE_HIP - computeLocalClosestPoints(m_bvh_hip.get(), xferNode); -#endif - break; - } - } - - /** - Determine the next rank (in ring order) with an object partition - close to the query points in xferNode. The intent is to send - xferNode there next. - */ - int next_recipient(const conduit::Node& xferNode) const - { - int homeRank = xferNode.fetch_existing("homeRank").value(); - BoxType bb; - get_bounding_box_from_conduit_node(bb, xferNode.fetch_existing("aabb")); - for(int i = 1; i < m_nranks; ++i) - { - int maybeNextRecip = (m_rank + i) % m_nranks; - if(maybeNextRecip == homeRank) - { - return maybeNextRecip; - } - double sqDistance = - primal::squared_distance(bb, m_objectPartitionBbs[maybeNextRecip]); - if(sqDistance <= m_sqDistanceThreshold) - { - return maybeNextRecip; - } - } - return -1; - } - - /// Wait for some non-blocking sends (if any) to finish. - void check_send_requests(std::list& isendRequests, - bool atLeastOne) const - { - std::vector reqs; - for(auto& isr : isendRequests) - { - reqs.push_back(isr.m_request); - } - - int inCount = static_cast(reqs.size()); - int outCount = 0; - std::vector indices(reqs.size(), -1); - if(atLeastOne) - { - MPI_Waitsome(inCount, - reqs.data(), - &outCount, - indices.data(), - MPI_STATUSES_IGNORE); - } - else - { - MPI_Testsome(inCount, - reqs.data(), - &outCount, - indices.data(), - MPI_STATUSES_IGNORE); - } - indices.resize(outCount); - - auto reqIter = isendRequests.begin(); - int prevIdx = 0; - for(const int idx : indices) - { - for(; prevIdx < idx; ++prevIdx) - { - ++reqIter; - } - reqIter = isendRequests.erase(reqIter); - ++prevIdx; - } - } - - /** - * \brief Extracts a field \a fieldName from the mesh blueprint - * - * \tparam T The type for the underlying array - * \param mesh_node The conduit node at the root of the mesh blueprint - * \param field_name The name of the field - * \param field_template Template string for the path to the field - * \param num_objectPts The size of the field - * \return An arrayview over the field data - */ - template - axom::ArrayView extractField(conduit::Node& mesh_node, - std::string&& field_name, - std::string&& path_template, - int num_objectPts) const - { - const std::string path = axom::fmt::format(path_template, field_name); - SLIC_ASSERT_MSG( - mesh_node.has_path(path), - fmt::format( - "Input to `computeClosestPoint()` must have a field named `{}`", - field_name)); - - return internal::ArrayView_from_Node(mesh_node[path], num_objectPts); - } - - // Note: following should be private, but nvcc complains about lambdas in private scope -public: - /// Templated implementation of generateBVHTree function - template - bool generateBVHTreeImpl(BVHTreeType* bvh) - { - using ExecSpace = typename BVHTreeType::ExecSpaceType; - - SLIC_ASSERT(bvh != nullptr); - - const int npts = m_objectPtCoords.size(); - axom::Array boxesArray(npts, npts, m_allocatorID); - auto boxesView = boxesArray.view(); - auto pointsView = m_objectPtCoords.view(); - - axom::for_all( - npts, - AXOM_LAMBDA(axom::IndexType i) { boxesView[i] = BoxType {pointsView[i]}; }); - - // Build bounding volume hierarchy - bvh->setAllocatorID(m_allocatorID); - int result = bvh->initialize(boxesView, npts); - - gatherBVHRoots(); - - return (result == spin::BVH_BUILD_OK); - } - - /** - * This method assumes xferNode is a blueprint single-domain mesh. - */ - template - void computeLocalClosestPoints(const BVHTreeType* bvh, - conduit::Node& xferNode) const - { - using ExecSpace = typename BVHTreeType::ExecSpaceType; - using axom::primal::squared_distance; - - // Note: There is some additional computation the first time this function - // is called for a query node, even if the local object mesh is empty - const bool hasObjectPoints = m_objectPtCoords.size() > 0; - const bool is_first = xferNode.has_path("is_first"); - if(!hasObjectPoints && !is_first) - { - return; - } - - conduit::Node& xferDoms = xferNode["xferDoms"]; - for(conduit::Node& xferDom : xferDoms.children()) - { - // --- Set up arrays and views in the execution space - // Arrays are initialized in that execution space the first time they are processed - // and are copied in during subsequent processing - - // Check dimension and extract the number of points - SLIC_ASSERT(xferDom.fetch_existing("dim").as_int() == NDIMS); - const int qPtCount = xferDom.fetch_existing("qPtCount").value(); - - /// Extract fields from the input node as ArrayViews - auto queryPts = - ArrayView_from_Node(xferDom.fetch_existing("coords"), - qPtCount); - auto cpIndexes = - ArrayView_from_Node(xferDom.fetch_existing("cp_index"), - qPtCount); - auto cpDomainIndexes = ArrayView_from_Node( - xferDom.fetch_existing("cp_domain_index"), - qPtCount); - auto cpRanks = - ArrayView_from_Node(xferDom.fetch_existing("cp_rank"), - qPtCount); - auto cpCoords = - ArrayView_from_Node(xferDom.fetch_existing("cp_coords"), - qPtCount); - - /// Create ArrayViews in ExecSpace that are compatible with fields - // This deep-copies host memory in xferDom to device memory. - // TODO: Avoid copying arrays (here and at the end) if both are on the host - auto cp_idx = is_first - ? axom::Array(qPtCount, qPtCount, m_allocatorID) - : axom::Array(cpIndexes, m_allocatorID); - auto cp_domidx = is_first - ? axom::Array(qPtCount, qPtCount, m_allocatorID) - : axom::Array(cpDomainIndexes, m_allocatorID); - auto cp_rank = is_first - ? axom::Array(qPtCount, qPtCount, m_allocatorID) - : axom::Array(cpRanks, m_allocatorID); - - /// PROBLEM: The striding does not appear to be retained by conduit relay - /// We might need to transform it? or to use a single array w/ pointers into it? - auto cp_pos = is_first - ? axom::Array(qPtCount, qPtCount, m_allocatorID) - : axom::Array(cpCoords, m_allocatorID); - - // DEBUG - const bool has_cp_distance = xferDom.has_path("debug/cp_distance"); - auto minDist = has_cp_distance - ? ArrayView_from_Node( - xferDom.fetch_existing("debug/cp_distance"), - qPtCount) - : ArrayView(); - - auto cp_dist = has_cp_distance - ? (is_first ? axom::Array(qPtCount, qPtCount, m_allocatorID) - : axom::Array(minDist, m_allocatorID)) - : axom::Array(0, 0, m_allocatorID); - // END DEBUG - - if(is_first) - { - cp_rank.fill(-1); - cp_idx.fill(-1); - cp_domidx.fill(-1); - const PointType nowhere(std::numeric_limits::signaling_NaN()); - cp_pos.fill(nowhere); - cp_dist.fill(std::numeric_limits::signaling_NaN()); - } - auto query_inds = cp_idx.view(); - auto query_doms = cp_domidx.view(); - auto query_ranks = cp_rank.view(); - auto query_pos = cp_pos.view(); - auto query_min_dist = cp_dist.view(); - - /// Create an ArrayView in ExecSpace that is compatible with queryPts - PointArray execPoints(queryPts, m_allocatorID); - auto query_pts = execPoints.view(); - - if(hasObjectPoints) - { - // Get a device-useable iterator - auto it = bvh->getTraverser(); - const int rank = m_rank; - - double* sqDistThresh = axom::allocate( - 1, - axom::execution_space::allocatorID()); - *sqDistThresh = m_sqDistanceThreshold; - - auto ptCoordsView = m_objectPtCoords.view(); - auto ptDomainIdsView = m_objectPtDomainIds.view(); - - AXOM_PERF_MARK_SECTION( - "ComputeClosestPoints", - axom::for_all( - qPtCount, - AXOM_LAMBDA(std::int32_t idx) mutable { - PointType qpt = query_pts[idx]; - - MinCandidate curr_min {}; - // Preset cur_min to the closest point found so far. - if(query_ranks[idx] >= 0) - { - curr_min.sqDist = squared_distance(qpt, query_pos[idx]); - curr_min.pointIdx = query_inds[idx]; - curr_min.domainIdx = query_doms[idx]; - curr_min.rank = query_ranks[idx]; - } - - auto checkMinDist = [&](std::int32_t current_node, - const std::int32_t* leaf_nodes) { - const int candidate_point_idx = leaf_nodes[current_node]; - const int candidate_domain_idx = - ptDomainIdsView[candidate_point_idx]; - const PointType candidate_pt = ptCoordsView[candidate_point_idx]; - const double sq_dist = squared_distance(qpt, candidate_pt); - - if(sq_dist < curr_min.sqDist) - { - curr_min.sqDist = sq_dist; - curr_min.pointIdx = candidate_point_idx; - curr_min.domainIdx = candidate_domain_idx; - curr_min.rank = rank; - } - }; - - auto traversePredicate = [&](const PointType& p, - const BoxType& bb) -> bool { - auto sqDist = squared_distance(p, bb); - return sqDist <= curr_min.sqDist && sqDist <= sqDistThresh[0]; - }; - - // Traverse the tree, searching for the point with minimum distance. - it.traverse_tree(qpt, checkMinDist, traversePredicate); - - // If modified, update the fields that changed - if(curr_min.rank == rank) - { - query_inds[idx] = curr_min.pointIdx; - query_doms[idx] = curr_min.domainIdx; - query_ranks[idx] = curr_min.rank; - query_pos[idx] = ptCoordsView[curr_min.pointIdx]; - - //DEBUG - if(has_cp_distance) - { - query_min_dist[idx] = sqrt(curr_min.sqDist); - } - } - });); - - axom::deallocate(sqDistThresh); - } - - axom::copy(cpIndexes.data(), - query_inds.data(), - cpIndexes.size() * sizeof(axom::IndexType)); - axom::copy(cpDomainIndexes.data(), - query_doms.data(), - cpDomainIndexes.size() * sizeof(axom::IndexType)); - axom::copy(cpRanks.data(), - query_ranks.data(), - cpRanks.size() * sizeof(axom::IndexType)); - axom::copy(cpCoords.data(), - query_pos.data(), - cpCoords.size() * sizeof(PointType)); - - // DEBUG - if(has_cp_distance) - { - axom::copy(minDist.data(), - query_min_dist.data(), - minDist.size() * sizeof(double)); - } - } - - // Data has now been initialized - if(is_first) - { - xferNode.remove_child("is_first"); - } - } - -private: - RuntimePolicy m_runtimePolicy; - bool m_isVerbose {false}; - double m_sqDistanceThreshold; - int m_allocatorID; - MPI_Comm m_mpiComm; - bool m_mpiCommIsPrivate; - int m_rank; - int m_nranks; - - /*! - @brief Object point coordindates array. - - Points from all local object mesh domains are flattened here. - */ - PointArray m_objectPtCoords; - - axom::Array m_objectPtDomainIds; - - /*! @brief Object partition bounding boxes, one per rank. - All are in physical space, not index space. - */ - BoxArray m_objectPartitionBbs; - - std::unique_ptr m_bvh_seq; - -#ifdef _AXOM_DCP_USE_OPENMP - std::unique_ptr m_bvh_omp; -#endif - -#ifdef _AXOM_DCP_USE_CUDA - std::unique_ptr m_bvh_cuda; -#endif - -#ifdef _AXOM_DCP_USE_HIP - std::unique_ptr m_bvh_hip; -#endif -}; // DistributedClosestPointImpl - -} // namespace internal - /** * \brief Encapsulated the Distributed closest point query for a collection of query points * over an "object mesh" @@ -1398,17 +40,15 @@ class DistributedClosestPointImpl * query points to all ranks whose object meshes might contain a * closest point. * - * \note The class currently supports object meshes that are comprised of a collection of points. - * In the future, we'd like to consider more general object meshes, e.g. triangle meshes. + * \note The class currently supports object meshes that are comprised + * of a collection of points. In the future, we'd like to consider + * more general object meshes, e.g. triangle meshes. * - * To use this class, first set some parameters, such as the runtime execution policy, - * then pass in the object mesh and build a spatial index over this mesh. - * Finally, compute the closest points in the object mesh to each point in a query mesh - * using the \a computeClosestPoints() function. - * - * \note The implementation currently assumes that the coordinates for the positions and vector field - * data are interleaved (i.e. xyzxyzxyz....). We will relax this assumption in the future to support both - * interleaved and strided data. + * To use this class, first set some parameters, such as the runtime + * execution policy, then pass in the object mesh and build a spatial + * index over this mesh. Finally, compute the closest points in the + * object mesh to each point in a query mesh using the \a + * computeClosestPoints() function. * * \note To prevent mixing unrelated MPI communications, you can set a * custom MPI Communicator using setMpiCommunicator(). @@ -1416,180 +56,59 @@ class DistributedClosestPointImpl class DistributedClosestPoint { public: - using RuntimePolicy = DistributedClosestPointRuntimePolicy; + using RuntimePolicy = axom::runtime_policy::Policy; public: - DistributedClosestPoint() - : m_mpiComm(MPI_COMM_WORLD) - , m_mpiCommIsPrivate(false) - { - setDefaultAllocatorID(); - setMpiCommunicator(MPI_COMM_WORLD); - } - - ~DistributedClosestPoint() - { - if(m_mpiCommIsPrivate) - { - int mpiIsFinalized = 0; - MPI_Finalized(&mpiIsFinalized); - if(!mpiIsFinalized) - { - MPI_Comm_free(&m_mpiComm); - } - } - } + DistributedClosestPoint(); - /// Set the runtime execution policy for the query - void setRuntimePolicy(RuntimePolicy policy) - { - SLIC_ASSERT_MSG( - isValidRuntimePolicy(policy), - fmt::format("Policy '{}' is not a valid runtime policy", policy)); - m_runtimePolicy = policy; - } + ~DistributedClosestPoint(); - /// Predicate to determine if a given \a RuntimePolicy is valid for this configuration - bool isValidRuntimePolicy(RuntimePolicy policy) const - { - switch(policy) - { - case RuntimePolicy::seq: - return true; - - case RuntimePolicy::omp: -#ifdef _AXOM_DCP_USE_OPENMP - return true; -#else - return false; -#endif - - case RuntimePolicy::cuda: -#ifdef _AXOM_DCP_USE_CUDA - return true; -#else - return false; -#endif - case RuntimePolicy::hip: -#ifdef _AXOM_DCP_USE_HIP - return true; -#else - return false; -#endif - } + /*! + @brief Set runtime execution policy for local queries - return false; - } + See axom::runtime_policy. + */ + void setRuntimePolicy(RuntimePolicy policy) { m_runtimePolicy = policy; } /*! @brief Sets the allocator ID to the default associated with the execution policy */ - void setDefaultAllocatorID() - { - int defaultAllocatorID = axom::INVALID_ALLOCATOR_ID; - switch(m_runtimePolicy) - { - case RuntimePolicy::seq: - defaultAllocatorID = axom::execution_space::allocatorID(); - break; - case RuntimePolicy::omp: -#ifdef _AXOM_DCP_USE_OPENMP - defaultAllocatorID = axom::execution_space::allocatorID(); -#endif - break; - - case RuntimePolicy::cuda: -#ifdef _AXOM_DCP_USE_CUDA - defaultAllocatorID = - axom::execution_space>::allocatorID(); -#endif - break; + void setDefaultAllocatorID(); - case RuntimePolicy::hip: -#ifdef _AXOM_DCP_USE_HIP - defaultAllocatorID = - axom::execution_space>::allocatorID(); -#endif - break; - } - if(defaultAllocatorID == axom::INVALID_ALLOCATOR_ID) - { - SLIC_ERROR( - axom::fmt::format("There is no default allocator for runtime policy {}", - m_runtimePolicy)); - } - setAllocatorID(defaultAllocatorID); - } + /*! @brief Sets the allocator ID. - /*! @brief Sets the allocator ID to the default associated with the - execution policy + If not explitly set, the allocator ID is the default is the id + associated with the runtime policy. */ - void setAllocatorID(int allocatorID) - { - SLIC_ASSERT_MSG(allocatorID != axom::INVALID_ALLOCATOR_ID, - "Invalid allocator id."); - m_allocatorID = allocatorID; - - if(m_dcp_2 != nullptr) - { - m_dcp_2->setAllocatorID(m_allocatorID); - } - if(m_dcp_3 != nullptr) - { - m_dcp_3->setAllocatorID(m_allocatorID); - } - } + void setAllocatorID(int allocatorID); /** * \brief Set the MPI communicator. * * By default, the communicator is MPI_COMM_WORLD. * - * \param mpiComm The MPI communicator to use. - * \param duplicate Whether to duplicate mpiComm for exclusive use + * \param [i] mpiComm The MPI communicator to use. + * \param [i] duplicate Whether to duplicate mpiComm for exclusive use */ - void setMpiCommunicator(MPI_Comm mpiComm, bool duplicate = false) - { - if(m_mpiCommIsPrivate) - { - MPI_Comm_free(&m_mpiComm); - } - - if(duplicate) - { - MPI_Comm_dup(mpiComm, &m_mpiComm); - } - else - { - m_mpiComm = mpiComm; - } - m_mpiCommIsPrivate = duplicate; - } - - /** - * \brief Sets the dimension for the query - * - * \note Users do not need to call this function explicitly. The dimension - * is set by the \a setObjectMesh function - */ - void setDimension(int dim) - { - SLIC_ERROR_IF( - dim < 2 || dim > 3, - "DistributedClosestPoint query only supports 2D or 3D queries"); - m_dimension = dim; - } + void setMpiCommunicator(MPI_Comm mpiComm, bool duplicate = false); /** * \brief Sets the threshold for the query * * \param [in] threshold Ignore distances greater than this value. */ - void setDistanceThreshold(double threshold) - { - SLIC_ERROR_IF(threshold < 0.0, "Distance threshold must be non-negative."); - m_sqDistanceThreshold = threshold * threshold; - } + void setDistanceThreshold(double threshold); + + /*! + @brief Set what fields to output. + + @param [i] field Must be one of these: + "cp_rank", "cp_index", "cp_distance", "cp_coords", "cp_domain_index". + @param [i] on Whether to enable outputing @c field. + + By default, all are on. + */ + void setOutput(const std::string& field, bool on); /// Sets the logging verbosity of the query. By default the query is not verbose void setVerbosity(bool isVerbose) { m_isVerbose = isVerbose; } @@ -1598,60 +117,13 @@ class DistributedClosestPoint * \brief Sets the object mesh for the query * * \param [in] meshNode Conduit node for the object mesh - * \param [in] coordset The name of the coordset for the object mesh's coordinates + * \param [in] topologyName The name of the topology for the object mesh * * \pre \a meshNode must follow the mesh blueprint convention. * \pre Dimension of the mesh must be 2D or 3D */ - void setObjectMesh(const conduit::Node& meshNode, const std::string& coordset) - { - SLIC_ASSERT(this->isValidBlueprint(meshNode)); - - const bool isMultidomain = - conduit::blueprint::mesh::is_multi_domain(meshNode); - - // If meshNode isn't multidomain, create a temporary multidomain representation. - std::shared_ptr tmpNode; - if(!isMultidomain) - { - tmpNode = std::make_shared(); - conduit::blueprint::mesh::to_multi_domain(meshNode, *tmpNode); - } - const conduit::Node& mdMeshNode(isMultidomain ? meshNode : *tmpNode); - - auto domainCount = conduit::blueprint::mesh::number_of_domains(mdMeshNode); - const std::string valuesPath = fmt::format("coordsets/{}/values", coordset); - - // Extract the dimension from the coordinate values group - // use allreduce since some ranks might be empty - { - int localDim = -1; - if(domainCount > 0) - { - const conduit::Node& domain0(mdMeshNode[0]); - SLIC_ASSERT(domain0.has_path(valuesPath)); - auto& values = domain0.fetch_existing(valuesPath); - localDim = internal::extractDimension(values); - } - int dim = -1; - MPI_Allreduce(&localDim, &dim, 1, MPI_INT, MPI_MAX, m_mpiComm); - setDimension(dim); - } - - allocateQueryInstance(); - - switch(m_dimension) - { - case 2: - m_dcp_2->importObjectPoints(mdMeshNode, valuesPath); - break; - case 3: - m_dcp_3->importObjectPoints(mdMeshNode, valuesPath); - break; - } - - return; - } + void setObjectMesh(const conduit::Node& meshNode, + const std::string& topologyName); /** * \brief Generates a BVH tree over the object mesh using the runtime execution policy @@ -1659,112 +131,65 @@ class DistributedClosestPoint * \pre Users must set the object mesh before generating the BVH tree * \sa setObjectMesh() */ - bool generateBVHTree() - { - SLIC_ASSERT_MSG(m_objectMeshCreated, - "Must call 'setObjectMesh' before calling generateBVHTree"); - - bool success = false; - - // dispatch to implementation class over dimension - switch(m_dimension) - { - case 2: - success = m_dcp_2->generateBVHTree(); - break; - case 3: - success = m_dcp_3->generateBVHTree(); - break; - } - - return success; - } + bool generateBVHTree(); /** * \brief Computes the closest point on the object mesh for each point * on the provided query mesh * - * \param [in] query_node conduit node containing the query points - * \param [in] coordset The name of the coordinates within query_node + * \param [in] query_node The root node of a mesh blueprint for the query points, + * which can be empty if there are no query points for the calling rank + * \param [in] topology The name of the topology within query_node + * + * @c queryMesh should have data on the host, regardless of the runtime + * policy setting. Data will be copied to device as needed. + * + * On completion, the query mesh contains the following fields: + * - cp_rank: will hold the rank of the object point containing the closest point + * - cp_domain_index: will hold the index of the object domain containing + * the closest points. + * - cp_index: Will hold the index of the closest object points. + * For multiple object mesh domains on a rank, cp_index is relative to + * each domain. + * - cp_coords: Will hold the coordinates of the closest points + * interleaved in a 1D array. + * - cp_distance: Will hold the distances to the closest points. + * See setOutput() to toggle these outputs. * - * \pre query_node must follow the conduit mesh blueprint convention + * \note The current implementation assumes that the mesh coordinates + * are interleaved or contiguous. The output cp_coords will be contiguous. */ - void computeClosestPoints(conduit::Node& query_node, const std::string& coordset) - { - SLIC_ASSERT_MSG(m_objectMeshCreated, - "Must call 'setObjectMesh' before calling generateBVHTree"); - - SLIC_ASSERT(this->isValidBlueprint(query_node)); - - // dispatch to implementation class over dimension - switch(m_dimension) - { - case 2: - m_dcp_2->setSquaredDistanceThreshold(m_sqDistanceThreshold); - m_dcp_2->setMpiCommunicator(m_mpiComm); - m_dcp_2->computeClosestPoints(query_node, coordset); - break; - case 3: - m_dcp_3->setSquaredDistanceThreshold(m_sqDistanceThreshold); - m_dcp_3->setMpiCommunicator(m_mpiComm); - m_dcp_3->computeClosestPoints(query_node, coordset); - break; - } - } + void computeClosestPoints(conduit::Node& query_node, + const std::string& topology); private: - void allocateQueryInstance() - { - SLIC_ASSERT_MSG(m_objectMeshCreated == false, "Object mesh already created"); - - switch(m_dimension) - { - case 2: - m_dcp_2 = std::make_unique>( - m_runtimePolicy, - m_allocatorID, - m_isVerbose); - m_objectMeshCreated = true; - break; - case 3: - m_dcp_3 = std::make_unique>( - m_runtimePolicy, - m_allocatorID, - m_isVerbose); - m_objectMeshCreated = true; - break; - } - - SLIC_ASSERT_MSG( - m_objectMeshCreated, - "Called allocateQueryInstance, but did not create an instance"); - } + //!@brief Create the implementation objects, either m_dcp_2 or m_dcp_3. + void allocateQueryInstance(); /// Check validity of blueprint group - bool isValidBlueprint(const conduit::Node& mesh_node) const - { - bool success = true; - conduit::Node info; - if(!conduit::blueprint::mpi::verify("mesh", mesh_node, info, m_mpiComm)) - { - SLIC_INFO("Invalid blueprint for particle mesh: \n" << info.to_yaml()); - success = false; - } + bool isValidBlueprint(const conduit::Node& mesh_node) const; - return success; - } + void verifyTopologyName(const conduit::Node& meshNode, + const std::string& topologyName); + + void setDimension(int dim); -private: RuntimePolicy m_runtimePolicy {RuntimePolicy::seq}; MPI_Comm m_mpiComm; bool m_mpiCommIsPrivate; - int m_allocatorID {axom::INVALID_ALLOCATOR_ID}; + int m_allocatorID; int m_dimension {-1}; bool m_isVerbose {false}; - double m_sqDistanceThreshold {std::numeric_limits::max()}; + double m_sqDistanceThreshold; bool m_objectMeshCreated {false}; + bool m_outputRank = true; + bool m_outputIndex = true; + bool m_outputDistance = true; + bool m_outputCoords = true; + bool m_outputDomainIndex = true; + // One instance per dimension std::unique_ptr> m_dcp_2; std::unique_ptr> m_dcp_3; @@ -1773,9 +198,4 @@ class DistributedClosestPoint } // end namespace quest } // end namespace axom -// Cleanup local #defines -#undef _AXOM_DCP_USE_OPENMP -#undef _AXOM_DCP_USE_CUDA -#undef _AXOM_DCP_USE_HIP - #endif // QUEST_DISTRIBUTED_CLOSEST_POINT_H_ diff --git a/src/axom/quest/InOutOctree.hpp b/src/axom/quest/InOutOctree.hpp index b70219bd93..4f52f1c9d2 100644 --- a/src/axom/quest/InOutOctree.hpp +++ b/src/axom/quest/InOutOctree.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -546,7 +546,7 @@ void InOutOctree::insertVertex(VertexIndex idx, int startingLevel) "Looking at block {} w/ blockBB {} indexing leaf vertex {}", pt, idx, - block, + axom::fmt::streamed(block), this->blockBoundingBox(block), blkData.dataIndex())); @@ -579,7 +579,7 @@ void InOutOctree::insertVertex(VertexIndex idx, int startingLevel) blkData.dataIndex() == DEBUG_VERT_IDX, fmt::format("-- vertex {} is indexed in block {}. Leaf vertex is {}", idx, - block, + axom::fmt::streamed(block), blkData.dataIndex())); } @@ -660,7 +660,7 @@ void InOutOctree::insertMeshCells() "\n\tDynamic data: {}" "\n\tBlock data: {}" "\n\tAbout to finalize? {}", - blk, + axom::fmt::streamed(blk), dynamicLeafData, blkData, (!isInternal && !isLeafThatMustRefine ? " yes" : "no"))); @@ -688,7 +688,7 @@ void InOutOctree::insertMeshCells() fmt::format("[Added block {} into tree as a gray leaf]." "\n\tDynamic data: {}" "\n\tBlock data: {}", - blk, + axom::fmt::streamed(blk), dynamicLeafData, blkData)); } @@ -788,7 +788,7 @@ void InOutOctree::insertMeshCells() tIdx, spaceTri, tBB, - childBlk[j], + axom::fmt::streamed(childBlk[j]), childBB[j], *childDataPtr[j], (shouldAddCell ? " yes" : "no"))); @@ -819,7 +819,7 @@ void InOutOctree::insertMeshCells() tIdx, spaceTri, fmt::join(m_meshWrapper.cellVertexIndices(tIdx), ", "), - childBlk[j], + axom::fmt::streamed(childBlk[j]), *(childDataPtr[j]))); } } @@ -941,9 +941,10 @@ bool InOutOctree::colorLeafAndNeighbors(const BlockIndex& leafBlk, { bool isColored = leafData.isColored(); - QUEST_OCTREE_DEBUG_LOG_IF( - leafBlk == DEBUG_BLOCK_1 || leafBlk == DEBUG_BLOCK_2, - fmt::format("Trying to color {} with data: {}", leafBlk, leafData)); + QUEST_OCTREE_DEBUG_LOG_IF(leafBlk == DEBUG_BLOCK_1 || leafBlk == DEBUG_BLOCK_2, + fmt::format("Trying to color {} with data: {}", + axom::fmt::streamed(leafBlk), + leafData)); if(!isColored) { @@ -962,11 +963,11 @@ bool InOutOctree::colorLeafAndNeighbors(const BlockIndex& leafBlk, "bounding box {} w/ midpoint {}" "\n\t\t from block {} with data {}, " "bounding box {} w/ midpoint {}.", - leafBlk, + axom::fmt::streamed(leafBlk), leafData, this->blockBoundingBox(leafBlk), this->blockBoundingBox(leafBlk).getCentroid(), - neighborBlk, + axom::fmt::streamed(neighborBlk), neighborData, this->blockBoundingBox(neighborBlk), this->blockBoundingBox(neighborBlk).getCentroid())); @@ -1004,7 +1005,7 @@ bool InOutOctree::colorLeafAndNeighbors(const BlockIndex& leafBlk, isColored && (DEBUG_BLOCK_1 == neighborBlk || DEBUG_BLOCK_2 == neighborBlk), fmt::format("Leaf block was colored -- {} now has data {}", - leafBlk, + axom::fmt::streamed(leafBlk), leafData)); } } @@ -1028,11 +1029,11 @@ bool InOutOctree::colorLeafAndNeighbors(const BlockIndex& leafBlk, "bounding box {} w/ midpoint {}" "\n\t\t to block {} with data {}, " "bounding box {} w/ midpoint {}.", - leafBlk, + axom::fmt::streamed(leafBlk), leafData, this->blockBoundingBox(leafBlk), this->blockBoundingBox(leafBlk).getCentroid(), - neighborBlk, + axom::fmt::streamed(neighborBlk), neighborData, this->blockBoundingBox(neighborBlk), this->blockBoundingBox(neighborBlk).getCentroid())); @@ -1070,7 +1071,7 @@ bool InOutOctree::colorLeafAndNeighbors(const BlockIndex& leafBlk, neighborData.isColored() && (DEBUG_BLOCK_1 == neighborBlk || DEBUG_BLOCK_2 == neighborBlk), fmt::format("Neighbor block was colored -- {} now has data {}", - neighborBlk, + axom::fmt::streamed(neighborBlk), neighborData)); } } @@ -1169,7 +1170,7 @@ typename std::enable_if::type InOutOctree::withinGrayBlock fmt::format("Checking if pt {} is within block {} with data {}, " "ray is {}, triangle point is {} on triangle with index {}.", queryPt, - leafBlk, + axom::fmt::streamed(leafBlk), leafData, ray, triPt, @@ -1228,8 +1229,8 @@ typename std::enable_if::type InOutOctree::withinGrayBlock return normal.dot(ray.direction()) > 0.; } - SLIC_DEBUG("Could not determine inside/outside for point " - << queryPt << " on block " << leafBlk); + // SLIC_DEBUG("Could not determine inside/outside for point " + // << queryPt << " on block " << leafBlk); return false; // query points on boundary might get here -- revisit this. } @@ -1285,7 +1286,7 @@ typename std::enable_if::type InOutOctree::withinGrayBlock fmt::format("Checking if pt {} is within block {} with data {}, " "ray is {}, segment point is {} on segment with index {}.", queryPt, - leafBlk, + axom::fmt::streamed(leafBlk), leafData, ray, segmentPt, diff --git a/src/axom/quest/IntersectionShaper.hpp b/src/axom/quest/IntersectionShaper.hpp index 5e4cfcf287..c12802b5ec 100644 --- a/src/axom/quest/IntersectionShaper.hpp +++ b/src/axom/quest/IntersectionShaper.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -294,14 +294,7 @@ class IntersectionShaper : public Shaper using TetrahedronType = primal::Tetrahedron; using SegmentMesh = mint::UnstructuredMesh; - /// Choose runtime policy for RAJA - enum ExecPolicy - { - seq = 0, - omp = 1, - cuda = 2, - hip = 3 - }; + using RuntimePolicy = axom::runtime_policy::Policy; static constexpr int DEFAULT_CIRCLE_REFINEMENT_LEVEL {7}; static constexpr double DEFAULT_REVOLVED_VOLUME {0.}; @@ -319,7 +312,7 @@ class IntersectionShaper : public Shaper void setLevel(int level) { m_level = level; } - void setExecPolicy(int policy) { m_execPolicy = (ExecPolicy)policy; } + void setExecPolicy(RuntimePolicy policy) { m_execPolicy = policy; } /*! * \brief Set the name of the material used to account for free volume fractions. @@ -518,7 +511,6 @@ class IntersectionShaper : public Shaper AXOM_LAMBDA(axom::IndexType i) { // Convert Octahedron into Polyhedrom PolyhedronType octPoly; - double octVolume; octPoly.addVertex(octs_view[i][0]); octPoly.addVertex(octs_view[i][1]); @@ -534,15 +526,7 @@ class IntersectionShaper : public Shaper octPoly.addNeighbors(4, {0, 5, 3, 2}); octPoly.addNeighbors(5, {0, 1, 3, 4}); - octVolume = octPoly.volume(); - - // Flip sign if volume is negative - // (expected when vertex order is reversed) - if(octVolume < 0) - { - octVolume = -octVolume; - } - total_oct_vol += octVolume; + total_oct_vol += octPoly.volume(); }); SLIC_INFO(axom::fmt::format( @@ -921,7 +905,7 @@ class IntersectionShaper : public Shaper " Calculating element overlap volume from each tet-shape pair ")); constexpr double EPS = 1e-10; - constexpr bool checkSign = true; + constexpr bool tryFixOrientation = true; AXOM_PERF_MARK_SECTION( "tet_shape_volume", @@ -935,19 +919,13 @@ class IntersectionShaper : public Shaper PolyhedronType poly = primal::clip(shapes_view[shapeIndex], tets_from_hexes_view[tetIndex], EPS, - checkSign); + tryFixOrientation); // Poly is valid if(poly.numVertices() >= 4) { - double clip_volume = poly.volume(); - // Flip sign if negative - if(clip_volume < 0) - { - clip_volume = -clip_volume; - } RAJA::atomicAdd(overlap_volumes_view.data() + index, - clip_volume); + poly.volume()); } });); @@ -1383,30 +1361,27 @@ class IntersectionShaper : public Shaper switch(m_execPolicy) { #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) - case seq: + case RuntimePolicy::seq: applyReplacementRulesImpl(shape); break; #if defined(AXOM_USE_OPENMP) - case omp: + case RuntimePolicy::omp: applyReplacementRulesImpl(shape); break; #endif // AXOM_USE_OPENMP #if defined(AXOM_USE_CUDA) - case cuda: + case RuntimePolicy::cuda: applyReplacementRulesImpl(shape); break; #endif // AXOM_USE_CUDA #if defined(AXOM_USE_HIP) - case hip: + case RuntimePolicy::hip: applyReplacementRulesImpl(shape); break; #endif // AXOM_USE_HIP #endif // AXOM_USE_RAJA && AXOM_USE_UMPIRE - default: - AXOM_UNUSED_VAR(shape); - SLIC_ERROR("Unhandled runtime policy case " << m_execPolicy); - break; } + AXOM_UNUSED_VAR(shape); } void finalizeShapeQuery() override @@ -1441,31 +1416,28 @@ class IntersectionShaper : public Shaper switch(m_execPolicy) { #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) - case seq: + case RuntimePolicy::seq: prepareShapeQueryImpl(shapeDimension, shape); break; #if defined(AXOM_USE_OPENMP) - case omp: + case RuntimePolicy::omp: prepareShapeQueryImpl(shapeDimension, shape); break; #endif // AXOM_USE_OPENMP #if defined(AXOM_USE_CUDA) - case cuda: + case RuntimePolicy::cuda: prepareShapeQueryImpl(shapeDimension, shape); break; #endif // AXOM_USE_CUDA #if defined(AXOM_USE_HIP) - case hip: + case RuntimePolicy::hip: prepareShapeQueryImpl(shapeDimension, shape); break; #endif // AXOM_USE_HIP #endif // AXOM_USE_RAJA && AXOM_USE_UMPIRE - default: - AXOM_UNUSED_VAR(shapeDimension); - AXOM_UNUSED_VAR(shape); - SLIC_ERROR("Unhandled runtime policy case " << m_execPolicy); - break; } + AXOM_UNUSED_VAR(shapeDimension); + AXOM_UNUSED_VAR(shape); // Restore m_percentError, m_level in case refineShape changed them. m_percentError = saved_percentError; @@ -1484,29 +1456,25 @@ class IntersectionShaper : public Shaper switch(m_execPolicy) { #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) - case seq: + case RuntimePolicy::seq: runShapeQueryImpl(shape, m_tets, m_tetcount); break; #if defined(AXOM_USE_OPENMP) - case omp: + case RuntimePolicy::omp: runShapeQueryImpl(shape, m_tets, m_tetcount); break; #endif // AXOM_USE_OPENMP #if defined(AXOM_USE_CUDA) - case cuda: + case RuntimePolicy::cuda: runShapeQueryImpl(shape, m_tets, m_tetcount); break; #endif // AXOM_USE_CUDA #if defined(AXOM_USE_HIP) - case hip: + case RuntimePolicy::hip: runShapeQueryImpl(shape, m_tets, m_tetcount); break; #endif // AXOM_USE_HIP #endif // AXOM_USE_RAJA && AXOM_USE_UMPIRE - default: - AXOM_UNUSED_VAR(shape); - SLIC_ERROR("Unhandled runtime policy case " << m_execPolicy); - break; } } else if(shapeFormat == "c2c") @@ -1514,29 +1482,25 @@ class IntersectionShaper : public Shaper switch(m_execPolicy) { #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) - case seq: + case RuntimePolicy::seq: runShapeQueryImpl(shape, m_octs, m_octcount); break; #if defined(AXOM_USE_OPENMP) - case omp: + case RuntimePolicy::omp: runShapeQueryImpl(shape, m_octs, m_octcount); break; #endif // AXOM_USE_OPENMP #if defined(AXOM_USE_CUDA) - case cuda: + case RuntimePolicy::cuda: runShapeQueryImpl(shape, m_octs, m_octcount); break; #endif // AXOM_USE_CUDA #if defined(AXOM_USE_HIP) - case hip: + case RuntimePolicy::hip: runShapeQueryImpl(shape, m_octs, m_octcount); break; #endif // AXOM_USE_HIP #endif // AXOM_USE_RAJA && AXOM_USE_UMPIRE - default: - AXOM_UNUSED_VAR(shape); - SLIC_ERROR("Unhandled runtime policy case " << m_execPolicy); - break; } } else @@ -2024,7 +1988,7 @@ class IntersectionShaper : public Shaper } private: - ExecPolicy m_execPolicy {seq}; + RuntimePolicy m_execPolicy {RuntimePolicy::seq}; int m_level {DEFAULT_CIRCLE_REFINEMENT_LEVEL}; double m_revolvedVolume {DEFAULT_REVOLVED_VOLUME}; int m_num_elements {0}; diff --git a/src/axom/quest/MarchingCubes.cpp b/src/axom/quest/MarchingCubes.cpp index d7f4e1d298..50fec43b75 100644 --- a/src/axom/quest/MarchingCubes.cpp +++ b/src/axom/quest/MarchingCubes.cpp @@ -1,43 +1,93 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) +#include "axom/config.hpp" + +// Implementation requires Conduit. +#ifndef AXOM_USE_CONDUIT + #error "MarchingCubes.cpp requires conduit" +#endif +#include "conduit_blueprint.hpp" + #include "axom/core/execution/execution_space.hpp" #include "axom/quest/MarchingCubes.hpp" +#include "axom/quest/detail/MarchingCubesSingleDomain.hpp" #include "axom/quest/detail/MarchingCubesImpl.hpp" -#include "conduit_blueprint.hpp" #include "axom/fmt.hpp" namespace axom { namespace quest { +const axom::StackArray twoZeros {0, 0}; + MarchingCubes::MarchingCubes(RuntimePolicy runtimePolicy, - const conduit::Node& bpMesh, - const std::string& coordsetName, - const std::string& maskField) + int allocatorID, + MarchingCubesDataParallelism dataParallelism) : m_runtimePolicy(runtimePolicy) + , m_allocatorID(allocatorID) + , m_dataParallelism(dataParallelism) , m_singles() - , m_coordsetPath("coordsets/" + coordsetName) + , m_topologyName() + , m_fcnFieldName() , m_fcnPath() - , m_maskPath(maskField.empty() ? std::string() : "fields/" + maskField) + , m_maskFieldName() + , m_maskPath() + , m_facetIndexOffsets(0, 0) + , m_facetCount(0) + , m_caseIdsFlat(0, 0, m_allocatorID) + , m_crossingFlags(0, 0, m_allocatorID) + , m_scannedFlags(0, 0, m_allocatorID) + , m_facetIncrs(0, 0, m_allocatorID) + , m_facetNodeIds(twoZeros, m_allocatorID) + , m_facetNodeCoords(twoZeros, m_allocatorID) + , m_facetParentIds(0, 0, m_allocatorID) + , m_facetDomainIds(0, 0, m_allocatorID) +{ } + +// Set the object up for a blueprint mesh state. +void MarchingCubes::setMesh(const conduit::Node& bpMesh, + const std::string& topologyName, + const std::string& maskField) { - const bool isMultidomain = conduit::blueprint::mesh::is_multi_domain(bpMesh); SLIC_ASSERT_MSG( - isMultidomain, + conduit::blueprint::mesh::is_multi_domain(bpMesh), "MarchingCubes class input mesh must be in multidomain format."); - m_singles.reserve(conduit::blueprint::mesh::number_of_domains(bpMesh)); - for(auto& dom : bpMesh.children()) + clearMesh(); + + m_topologyName = topologyName; + m_maskFieldName = maskField; + + /* + To avoid slow memory allocations (especially on GPUs) keep the + single-domain objects around and just re-initialize them. Arrays + will be cleared, but not deallocated. The actual number of + domains is m_domainCount, not m_singles.size(). To *really* + deallocate memory, deallocate the MarchingCubes object. + */ + auto newDomainCount = conduit::blueprint::mesh::number_of_domains(bpMesh); + + while(m_singles.size() < newDomainCount) { m_singles.emplace_back( - new MarchingCubesSingleDomain(m_runtimePolicy, dom, coordsetName, maskField)); + new detail::marching_cubes::MarchingCubesSingleDomain(*this)); } + + for(int d = 0; d < newDomainCount; ++d) + { + const auto& dom = bpMesh.child(d); + m_singles[d]->setDomain(dom, m_topologyName, maskField); + } + + m_domainCount = newDomainCount; } void MarchingCubes::setFunctionField(const std::string& fcnField) { + m_fcnFieldName = fcnField; m_fcnPath = "fields/" + fcnField; for(auto& s : m_singles) { @@ -47,53 +97,95 @@ void MarchingCubes::setFunctionField(const std::string& fcnField) void MarchingCubes::computeIsocontour(double contourVal) { - SLIC_ASSERT_MSG(!m_fcnPath.empty(), - "You must call setFunctionField before computeIsocontour."); + AXOM_PERF_MARK_FUNCTION("MarchingCubes::computeIsoContour"); - for(int dId = 0; dId < m_singles.size(); ++dId) + // Mark and scan domains while adding up their + // facet counts to get the total facet counts. + m_facetIndexOffsets.resize(m_singles.size()); + for(axom::IndexType d = 0; d < m_singles.size(); ++d) { - std::unique_ptr& single = m_singles[dId]; - single->computeIsocontour(contourVal); + auto& single = *m_singles[d]; + single.setContourValue(contourVal); + single.markCrossings(); + single.scanCrossings(); + m_facetIndexOffsets[d] = m_facetCount; + m_facetCount += single.getContourCellCount(); } -} -axom::IndexType MarchingCubes::getContourCellCount() const -{ - axom::IndexType contourCellCount = 0; - for(int dId = 0; dId < m_singles.size(); ++dId) + allocateOutputBuffers(); + + // Tell singles where to put contour data. + auto facetNodeIdsView = m_facetNodeIds.view(); + auto facetNodeCoordsView = m_facetNodeCoords.view(); + auto facetParentIdsView = m_facetParentIds.view(); + for(axom::IndexType d = 0; d < m_singles.size(); ++d) + { + m_singles[d]->getImpl().setOutputBuffers(facetNodeIdsView, + facetNodeCoordsView, + facetParentIdsView, + m_facetIndexOffsets[d]); + } + + for(axom::IndexType d = 0; d < m_singles.size(); ++d) { - contourCellCount += m_singles[dId]->getContourCellCount(); + m_singles[d]->computeFacets(); + } + + for(axom::IndexType d = 0; d < m_singles.size(); ++d) + { + const auto domainId = m_singles[d]->getDomainId(d); + const auto domainFacetCount = + (d < m_singles.size() - 1 ? m_facetIndexOffsets[d + 1] : m_facetCount) - + m_facetIndexOffsets[d]; + m_facetDomainIds.fill(domainId, domainFacetCount, m_facetIndexOffsets[d]); } - return contourCellCount; } axom::IndexType MarchingCubes::getContourNodeCount() const { - axom::IndexType contourNodeCount = 0; - for(int dId = 0; dId < m_singles.size(); ++dId) + axom::IndexType contourNodeCount = + m_singles.empty() ? 0 : m_facetCount * m_singles[0]->spatialDimension(); + return contourNodeCount; +} + +void MarchingCubes::clearMesh() +{ + for(int d = 0; d < m_singles.size(); ++d) { - contourNodeCount += m_singles[dId]->getContourNodeCount(); + m_singles[d]->getImpl().clearDomain(); } - return contourNodeCount; + m_domainCount = 0; + m_facetNodeIds.clear(); + m_facetNodeCoords.clear(); + m_facetParentIds.clear(); +} + +void MarchingCubes::clearOutput() +{ + m_facetCount = 0; + m_facetNodeIds.clear(); + m_facetNodeCoords.clear(); + m_facetParentIds.clear(); + m_facetDomainIds.clear(); } void MarchingCubes::populateContourMesh( axom::mint::UnstructuredMesh& mesh, const std::string& cellIdField, - const std::string& domainIdField) + const std::string& domainIdField) const { + AXOM_PERF_MARK_FUNCTION("MarchingCubes::populateContourMesh"); if(!cellIdField.empty() && !mesh.hasField(cellIdField, axom::mint::CELL_CENTERED)) { - mesh.createField(cellIdField, - axom::mint::CELL_CENTERED, - mesh.getDimension()); + // Create cellId field, currently the multidimensional index of the parent cell. + mesh.createField(cellIdField, axom::mint::CELL_CENTERED); } if(!domainIdField.empty() && !mesh.hasField(domainIdField, axom::mint::CELL_CENTERED)) { - mesh.createField(domainIdField, axom::mint::CELL_CENTERED); + mesh.createField(domainIdField, axom::mint::CELL_CENTERED); } // Reserve space once for all local domains. @@ -102,150 +194,81 @@ void MarchingCubes::populateContourMesh( mesh.reserveCells(contourCellCount); mesh.reserveNodes(contourNodeCount); - // Populate mesh from single domains and add domain id if requested. - for(int dId = 0; dId < m_singles.size(); ++dId) + if(m_facetCount) { - std::unique_ptr& single = m_singles[dId]; - - auto nPrev = mesh.getNumberOfCells(); - single->populateContourMesh(mesh, cellIdField); - auto nNew = mesh.getNumberOfCells(); + // Put nodes and cells into the mesh. + // If data is not in host memory, copy to temporary host memory first. + axom::MemorySpace internalMemorySpace = + axom::detail::getAllocatorSpace(m_allocatorID); + const bool hostAndInternalMemoriesAreSeparate = + internalMemorySpace != axom::MemorySpace::Dynamic +#ifdef AXOM_USE_UMPIRE + && internalMemorySpace != axom::MemorySpace::Host +#endif + ; + const int hostAllocatorId = hostAndInternalMemoriesAreSeparate + ? +#ifdef AXOM_USE_UMPIRE + axom::detail::getAllocatorID() +#else + axom::detail::getAllocatorID() +#endif + : m_allocatorID; - if(nNew > nPrev && !domainIdField.empty()) + if(hostAndInternalMemoriesAreSeparate) { - auto* domainIdPtr = - mesh.getFieldPtr(domainIdField, - axom::mint::CELL_CENTERED); - // TODO: Verify that UnstructuredMesh only supports host memory. - axom::detail::ArrayOps::fill( - domainIdPtr, - nPrev, - nNew - nPrev, - execution_space::allocatorID(), - dId); + axom::Array tmpfacetNodeCoords(m_facetNodeCoords, + hostAllocatorId); + axom::Array tmpfacetNodeIds(m_facetNodeIds, + hostAllocatorId); + mesh.appendNodes(tmpfacetNodeCoords.data(), contourNodeCount); + mesh.appendCells(tmpfacetNodeIds.data(), contourCellCount); + } + else + { + mesh.appendNodes(m_facetNodeCoords.data(), contourNodeCount); + mesh.appendCells(m_facetNodeIds.data(), contourCellCount); } - } - SLIC_ASSERT(mesh.getNumberOfNodes() == contourNodeCount); - SLIC_ASSERT(mesh.getNumberOfCells() == contourCellCount); -} - -MarchingCubesSingleDomain::MarchingCubesSingleDomain(RuntimePolicy runtimePolicy, - const conduit::Node& dom, - const std::string& coordsetName, - const std::string& maskField) - : m_runtimePolicy(runtimePolicy) - , m_dom(nullptr) - , m_ndim(0) - , m_coordsetPath("coordsets/" + coordsetName) - , m_fcnPath() - , m_maskPath(maskField.empty() ? std::string() : "fields/" + maskField) -{ - SLIC_ASSERT_MSG( - isValidRuntimePolicy(runtimePolicy), - fmt::format("Policy '{}' is not a valid runtime policy", runtimePolicy)); - - setDomain(dom); - return; -} - -void MarchingCubesSingleDomain::setDomain(const conduit::Node& dom) -{ - SLIC_ASSERT_MSG( - !conduit::blueprint::mesh::is_multi_domain(dom), - "MarchingCubesSingleDomain is single-domain only. Try MarchingCubes."); - SLIC_ASSERT(dom.has_path(m_coordsetPath)); - SLIC_ASSERT(dom["topologies/mesh/type"].as_string() == "structured"); + if(!cellIdField.empty()) + { + // Put parent cell ids into the mesh. + axom::IndexType* cellIdPtr = + mesh.getFieldPtr(cellIdField, axom::mint::CELL_CENTERED); + axom::copy(cellIdPtr, + m_facetParentIds.data(), + m_facetCount * sizeof(axom::IndexType)); + } - if(!m_maskPath.empty()) - { - SLIC_ASSERT(dom.has_path(m_maskPath + "/values")); + if(!domainIdField.empty()) + { + // Put parent domain ids into the mesh. + auto* domainIdPtr = + mesh.getFieldPtr(domainIdField, axom::mint::CELL_CENTERED); + axom::copy(domainIdPtr, + m_facetDomainIds.data(), + m_facetCount * sizeof(axom::IndexType)); + } } - - m_dom = &dom; - - const conduit::Node& dimsNode = - m_dom->fetch_existing("topologies/mesh/elements/dims"); - - m_ndim = dimsNode.number_of_children(); - - SLIC_ASSERT(m_ndim >= 2 && m_ndim <= 3); - - const conduit::Node& coordsValues = dom[m_coordsetPath + "/values"]; - bool isInterleaved = conduit::blueprint::mcarray::is_interleaved(coordsValues); - SLIC_ASSERT_MSG( - !isInterleaved, - "MarchingCubes currently requires contiguous coordinates layout."); -} - -void MarchingCubesSingleDomain::setFunctionField(const std::string& fcnField) -{ - m_fcnPath = "fields/" + fcnField; - SLIC_ASSERT(m_dom->has_path(m_fcnPath)); - SLIC_ASSERT(m_dom->fetch_existing(m_fcnPath + "/association").as_string() == - "vertex"); - SLIC_ASSERT(m_dom->has_path(m_fcnPath + "/values")); } -void MarchingCubesSingleDomain::computeIsocontour(double contourVal) +void MarchingCubes::allocateOutputBuffers() { - SLIC_ASSERT_MSG(!m_fcnPath.empty(), - "You must call setFunctionField before computeIsocontour."); - - allocateImpl(); - m_impl->initialize(*m_dom, m_coordsetPath, m_fcnPath, m_maskPath); - m_impl->setContourValue(contourVal); - m_impl->markCrossings(); - m_impl->scanCrossings(); - m_impl->computeContour(); -} - -void MarchingCubesSingleDomain::allocateImpl() -{ - using namespace detail::marching_cubes; - if(m_runtimePolicy == RuntimePolicy::seq) - { - m_impl = m_ndim == 2 - ? std::unique_ptr( - new MarchingCubesImpl<2, axom::SEQ_EXEC, axom::SEQ_EXEC>) - : std::unique_ptr( - new MarchingCubesImpl<3, axom::SEQ_EXEC, axom::SEQ_EXEC>); - } -#ifdef _AXOM_MC_USE_OPENMP - else if(m_runtimePolicy == RuntimePolicy::omp) - { - m_impl = m_ndim == 2 - ? std::unique_ptr( - new MarchingCubesImpl<2, axom::OMP_EXEC, axom::SEQ_EXEC>) - : std::unique_ptr( - new MarchingCubesImpl<3, axom::OMP_EXEC, axom::SEQ_EXEC>); - } -#endif -#ifdef _AXOM_MC_USE_CUDA - else if(m_runtimePolicy == RuntimePolicy::cuda) - { - m_impl = m_ndim == 2 - ? std::unique_ptr( - new MarchingCubesImpl<2, axom::CUDA_EXEC<256>, axom::CUDA_EXEC<1>>) - : std::unique_ptr( - new MarchingCubesImpl<3, axom::CUDA_EXEC<256>, axom::CUDA_EXEC<1>>); - } -#endif -#ifdef _AXOM_MC_USE_HIP - else if(m_runtimePolicy == RuntimePolicy::hip) - { - m_impl = m_ndim == 2 - ? std::unique_ptr( - new MarchingCubesImpl<2, axom::HIP_EXEC<256>, axom::HIP_EXEC<1>>) - : std::unique_ptr( - new MarchingCubesImpl<3, axom::HIP_EXEC<256>, axom::HIP_EXEC<1>>); - } -#endif - else + AXOM_PERF_MARK_FUNCTION("MarchingCubes::allocateOutputBuffers"); + if(!m_singles.empty()) { - SLIC_ERROR(axom::fmt::format( - "MarchingCubesSingleDomain has no implementation for runtime policy {}", - m_runtimePolicy)); + int ndim = m_singles[0]->spatialDimension(); + const auto nodeCount = m_facetCount * ndim; + m_facetNodeIds.resize( + axom::StackArray {m_facetCount, ndim}, + 0); + m_facetNodeCoords.resize( + axom::StackArray {nodeCount, ndim}, + 0.0); + m_facetParentIds.resize(axom::StackArray {m_facetCount}, + 0); + m_facetDomainIds.resize(axom::StackArray {m_facetCount}, + 0); } } diff --git a/src/axom/quest/MarchingCubes.hpp b/src/axom/quest/MarchingCubes.hpp index 2e0bb275d1..bc053915a8 100644 --- a/src/axom/quest/MarchingCubes.hpp +++ b/src/axom/quest/MarchingCubes.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -10,66 +10,51 @@ * compute isocontour from a scalar field in a blueprint mesh. */ -#ifndef AXOM_PRIMAL_MARCHINGCUBES_H_ -#define AXOM_PRIMAL_MARCHINGCUBES_H_ +#ifndef AXOM_QUEST_MARCHINGCUBES_H_ +#define AXOM_QUEST_MARCHINGCUBES_H_ -// Axom includes #include "axom/config.hpp" -#include "axom/mint/mesh/UnstructuredMesh.hpp" - -// Conduit includes -#include "conduit_node.hpp" - -// C++ includes -#include - -// Add some helper preprocessor defines for using OPENMP, CUDA, and HIP policies -// within the marching cubes implementation. -#if defined(AXOM_USE_RAJA) - #ifdef AXOM_USE_OPENMP - #define _AXOM_MC_USE_OPENMP - #endif - #if defined(AXOM_USE_CUDA) && defined(AXOM_USE_UMPIRE) - #define _AXOM_MC_USE_CUDA - #endif - #if defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) - #define _AXOM_MC_USE_HIP - #endif -#endif + +// Implementation requires Conduit. +#ifdef AXOM_USE_CONDUIT + + // Axom includes + #include "axom/core/execution/runtime_policy.hpp" + #include "axom/mint/mesh/UnstructuredMesh.hpp" + + // Conduit includes + #include "conduit_node.hpp" + + // C++ includes + #include namespace axom { namespace quest { -/*! - @brief Enum for runtime execution policy - - The policy implicitly selects the execution space and allocator id. -*/ -enum class MarchingCubesRuntimePolicy -{ - seq = 0, - omp = 1, - cuda = 2, - hip = 3 -}; - -/// Utility function to allow formating a MarchingCubesRuntimePolicy -inline auto format_as(MarchingCubesRuntimePolicy pol) -{ - return fmt::underlying(pol); -} - namespace detail { namespace marching_cubes { -template -class MarchingCubesImpl; -} +class MarchingCubesSingleDomain; +} // namespace marching_cubes } // namespace detail -class MarchingCubesSingleDomain; +/*! + @brief Enum for implementation. + + Partial parallel implementation uses a non-parallizable loop and + processes less data. It has been shown to work well on CPUs. + Full parallel implementation processes more data, but parallelizes + fully and has been shown to work well on GPUs. byPolicy chooses + based on runtime policy. +*/ +enum class MarchingCubesDataParallelism +{ + byPolicy = 0, + hybridParallel = 1, + fullParallel = 2 +}; /*! * \@brief Class implementing marching cubes to compute a contour @@ -84,18 +69,19 @@ class MarchingCubesSingleDomain; * cubes). * * The input mesh is a Conduit::Node following the Mesh Blueprint - * convention. The mesh must be in multi-domain format. For - * single-domain, see MarchingCubesSingleDomain. + * convention. The mesh must be in multi-domain format. * * Usage example: * @beginverbatim * void foo( conduit::Node &meshNode, - * const std::string &coordsName, + * const std::string &topologyName, * const std::string &functionName, * double contourValue ) * { - * MarchingCubes mc(meshNode, coordsName); - * setFunctionField(functionName); + * MarchingCubes mc(axom::runtime_policy::Policy::seq, + * MarchingCubesDataParallelism::byPolicy, + * meshNode, topologyName); + * mc.setFunctionField(functionName); * mc.computeIsocontour(contourValue); * axom::mint::UnstructuredMesh * contourMesh(3, min::CellType::Triangle); @@ -106,39 +92,57 @@ class MarchingCubesSingleDomain; * To avoid confusion between the two meshes, we refer to the input * mesh with the scalar function as "parent" and the generated mesh * as the "contour". + * + * The output contour mesh format can be a mint::UnstructuredMesh or + * Array data. IDs of parent cell and domain that generated the + * individual contour facets are provided. Blueprint allows users to + * specify ids for the domains. If "state/domain_id" exists in the + * domains, it is used as the domain id. Otherwise, the domain's + * iteration index within the multidomain mesh is used. + * + * Output arrays use the allocator id specified in the constructor. + * However, the output mint mesh currently uses host data. The data + * output interfaces are interim and subject to change) */ class MarchingCubes { public: - using RuntimePolicy = MarchingCubesRuntimePolicy; + using RuntimePolicy = axom::runtime_policy::Policy; + using DomainIdType = axom::IndexType; /*! - * \brief Constructor sets up computational mesh and data for running the - * marching cubes algorithm. - * - * \param [in] runtimePolicy A value from MarchingCubesRuntimePolicy. - * The simplest policy is RuntimePolicy::seq, which specifies - * running sequentially on the CPU. - * \param [in] bpMesh Blueprint multi-domain mesh containing scalar field. - * \param [in] coordsetName Name of blueprint point coordinate set. - * \param [in] maskField Cell-based std::int32_t mask field. If provided, - * cells where this field evaluates to false are skipped. - * - * Array data in \a dom must be accessible in the \a runtimePolicy - * environment. It's an error if not, e.g., using CPU memory with - * a GPU policy. - * - * Some data from \a bpMesh may be cached by the constructor. - * Any change to it after the constructor leads to undefined behavior. - * - * The mesh coordinates should be contiguous. See - * conduit::blueprint::is_contiguous(). In the future, this - * requirement may be relaxed, possibly at the cost of a - * transformation and storage of the temporary contiguous layout. - */ + \brief Constructor sets up runtime preferences for the marching + cubes implementation. + + \param [in] runtimePolicy A value from RuntimePolicy. + The simplest policy is RuntimePolicy::seq, which specifies + running sequentially on the CPU. + \param [in] allocatorID Data allocator ID. Choose something compatible + with \c runtimePolicy. See \c execution_space. + \param [in] dataParallelism Data parallel implementation choice. + */ MarchingCubes(RuntimePolicy runtimePolicy, - const conduit::Node &bpMesh, - const std::string &coordsetName, - const std::string &maskField = {}); + int allocatorId, + MarchingCubesDataParallelism dataParallelism); + + /*! + @brief Set the input mesh. + \param [in] bpMesh Blueprint multi-domain mesh containing scalar field. + \param [in] topologyName Name of Blueprint topology to use in \a bpMesh. + \param [in] maskField Cell-based std::int32_t mask field. If provided, + cells where this field evaluates to false are skipped. + + Array data in \a bpMesh must be accessible in the \a runtimePolicy + environment specified in the constructor. It's an error if not, + e.g., using CPU memory with a GPU policy. + + Some metadata from \a bpMesh may be cached. Any change to it + after setMesh() leads to undefined behavior. + + @see clearMesh() + */ + void setMesh(const conduit::Node &bpMesh, + const std::string &topologyName, + const std::string &maskField = {}); /*! @brief Set the field containing the nodal function. @@ -149,238 +153,219 @@ class MarchingCubes /*! \brief Computes the isocontour. \param [in] contourVal isocontour value - */ + + Each computeIsocontour call adds to previously computed contour + mesh. + */ void computeIsocontour(double contourVal = 0.0); - //!@brief Get number of cells in the generated contour mesh. - axom::IndexType getContourCellCount() const; + //!@brief Get number of cells (facets) in the generated contour mesh. + axom::IndexType getContourCellCount() const { return m_facetCount; } + //!@brief Get number of cells (facets) in the generated contour mesh. + axom::IndexType getContourFacetCount() const { return m_facetCount; } //!@brief Get number of nodes in the generated contour mesh. axom::IndexType getContourNodeCount() const; + //@{ + //!@name Access to output contour mesh /*! @brief Put generated contour in a mint::UnstructuredMesh. @param mesh Output contour mesh - @param cellIdField Name of field to store the (axom::IndexType) - parent cell ids. If omitted, the data is not provided. - @param domainIdField Name of field to store the (axom::IndexType) - parent domain ids. If omitted, the data is not provided. + @param cellIdField Name of field to store the array of + parent cells ids, numbered in the row- or column-major + ordering of the nodal scalar function. + If empty, the data is not provided. + @param domainIdField Name of field to store the + parent domain ids. The type of this data is \c DomainIdType. + If omitted, the data is not provided. If the fields aren't in the mesh, they will be created. + + Important: mint::UnstructuredMesh only supports host memory, so + regardless of the allocator ID, this method always deep-copies + data to host memory. To access the data without deep-copying, see + the other output methods in this name group. */ void populateContourMesh( axom::mint::UnstructuredMesh &mesh, const std::string &cellIdField = {}, - const std::string &domainIdField = {}); + const std::string &domainIdField = {}) const; -private: - MarchingCubesRuntimePolicy m_runtimePolicy; + /*! + @brief Return view of facet corner node indices (connectivity) Array. - //! @brief Single-domain implementations. - axom::Array> m_singles; - const std::string m_coordsetPath; - std::string m_fcnPath; - std::string m_maskPath; + The array shape is (getContourCellCount(), ), where + the second index is index of the facet corner. + */ + axom::ArrayView getContourFacetCorners() const + { + return m_facetNodeIds.view(); + } - void setMesh(const conduit::Node &bpMesh); -}; + /*! + @brief Return view of node coordinates Array. -/*! - * \@brief Class implementing marching cubes algorithm for a single - * domain. - * - * \sa MarchingCubes - */ -class MarchingCubesSingleDomain -{ - template - friend class detail::marching_cubes::MarchingCubesImpl; + The array shape is (getContourNodeCount(), ), where + the second index is the spatial index. + */ + axom::ArrayView getContourNodeCoords() const + { + return m_facetNodeCoords.view(); + } -public: - using RuntimePolicy = MarchingCubesRuntimePolicy; /*! - * \brief Constructor for applying algorithm in a single domain. - * See MarchingCubes for the multi-domain implementation. - * - * \param [in] runtimePolicy A value from MarchingCubesRuntimePolicy. - * The simplest policy is RuntimePolicy::seq, which specifies - * running sequentially on the CPU. - * \param [in] dom Blueprint single-domain mesh containing scalar field. - * \param [in] coordsetName Name of blueprint point coordinate set. - * \param [in] maskField Cell-based std::int32_t mask field. If provided, - * cells where this field evaluates to false are skipped. - * - * Array data in \a dom must be accessible in the \a runtimePolicy - * environment. It's an error if not, e.g., using CPU memory with - * a GPU policy. - * - * Some data from \a dom may be cached by the constructor. - * Any change to it after the constructor leads to undefined behavior. - * See setDomain(const conduit::Node &) for requirements on \a dom. - * - * The mesh coordinates should be stored contiguously. See - * conduit::blueprint::is_contiguous(). In the future, this - * requirement may be relaxed, possibly at the cost of a - * transformation and storage of the temporary contiguous layout. - */ - MarchingCubesSingleDomain(RuntimePolicy runtimePolicy, - const conduit::Node &dom, - const std::string &coordsetName, - const std::string &maskfield); + @brief Return view of parent cell indices Array. - /*! - @brief Specify the field containing the nodal scalar function - in the input mesh. - \param [in] fcnField Name of node-based scalar function values. + The buffer size is getContourCellCount(). The parent ID is the + column-major ordered flat index of the cell in the parent domain + (see ArrayIndexer), not counting ghost cells. */ - void setFunctionField(const std::string &fcnField); + axom::ArrayView getContourFacetParents() const + { + return m_facetParentIds.view(); + } /*! - * \brief Compute the isocontour. - * - * \param [in] contourVal isocontour value - * - * Compute isocontour using the marching cubes algorithm. - * To get the isocontour mesh, use populateContourMesh. - */ - void computeIsocontour(double contourVal = 0.0); + @brief Return view of parent domain indices Array. + @param allocatorID Allocator id for the output data. If omitted, + use the id set in the constructor. - //!@brief Get number of cells in the generated contour mesh. - axom::IndexType getContourCellCount() const + The buffer size is getContourCellCount(). + */ + axom::ArrayView getContourFacetDomainIds() const { - SLIC_ASSERT_MSG( - m_impl, - "There is no contour mesh until you call computeIsocontour()"); - axom::IndexType cellCount = m_impl->getContourCellCount(); - return cellCount; + return m_facetDomainIds.view(); } - //!@brief Get number of nodes in the generated contour mesh. - axom::IndexType getContourNodeCount() const + /*! + @brief Give caller posession of the contour data. + + This efficiently gives the generated contour data to the caller, + to stay in scope after the MarchingCubes object is deleted. + + @param [i] facetNodeIds Node ids for the node at the corners of + each facet. @see getContourFacetCorners(). + @param [i] facetNodeCoords Coordinates of each facet node. + @see getContourNodeCoords(). + @param [i] facetParentIds Parent cell id of each facet. + @see getContourFacetParents(). + @param [i] facetDomainIds Domain id of each facet. + @see getContourFacetDomainIds(). + + @pre computeIsocontour() must have been called. + @post outputs can no longer be accessed from object, as though + clearOutput() has been called. + */ + void relinquishContourData(axom::Array &facetNodeIds, + axom::Array &facetNodeCoords, + axom::Array &facetParentIds, + axom::Array &facetDomainIds) { - return m_ndim * getContourCellCount(); + facetNodeIds.clear(); + facetNodeCoords.clear(); + facetParentIds.clear(); + facetDomainIds.clear(); + m_facetCount = 0; + + facetNodeIds.swap(m_facetNodeIds); + facetNodeCoords.swap(m_facetNodeCoords); + facetParentIds.swap(m_facetParentIds); + facetDomainIds.swap(m_facetDomainIds); } + //@} /*! - @brief Put generated contour surface in a mint::UnstructuredMesh + @brief Clear the input mesh data. + + The contour mesh is *not* cleared. See clearOutput() for this. + + After clearing, you have to call setMesh() as if it was a new object. - @param mesh Output mesh - @param cellIdField Name of field to store the prent cell ids. - If omitted, the data is not copied. + @internal For good GPU performance, memory is not deallocated. To + really deallocate memory, destruct this object and use another. */ - void populateContourMesh( - axom::mint::UnstructuredMesh &mesh, - const std::string &cellIdField = {}) const - { - m_impl->populateContourMesh(mesh, cellIdField); - } + void clearMesh(); /*! - @brief Determine whether a given \a MarchingCubesRuntimePolicy is - valid for the Axom build configuration. + @brief Clear the computed contour mesh. */ - inline bool isValidRuntimePolicy(MarchingCubesRuntimePolicy policy) const - { - switch(policy) - { - case MarchingCubesRuntimePolicy::seq: - return true; - - case MarchingCubesRuntimePolicy::omp: -#ifdef _AXOM_MC_USE_OPENMP - return true; -#else - return false; -#endif - - case MarchingCubesRuntimePolicy::cuda: -#ifdef _AXOM_MC_USE_CUDA - return true; -#else - return false; -#endif - case MarchingCubesRuntimePolicy::hip: -#ifdef _AXOM_MC_USE_HIP - return true; -#else - return false; -#endif - } - - return false; - } + void clearOutput(); + + // Allow single-domain code to share common scratch space. + friend detail::marching_cubes::MarchingCubesSingleDomain; private: - MarchingCubesRuntimePolicy m_runtimePolicy; + RuntimePolicy m_runtimePolicy; + int m_allocatorID = axom::INVALID_ALLOCATOR_ID; + + //@brief Choice of full or partial data-parallelism, or byPolicy. + MarchingCubesDataParallelism m_dataParallelism = + MarchingCubesDataParallelism::byPolicy; + + //!@brief Number of domains. + axom::IndexType m_domainCount; + /*! - \brief Computational mesh as a conduit::Node. + @brief Single-domain implementations. + + May be longer than m_domainCount (the real count). */ - const conduit::Node *m_dom; - int m_ndim; + axom::Array> m_singles; + std::string m_topologyName; + std::string m_fcnFieldName; + std::string m_fcnPath; + std::string m_maskFieldName; + std::string m_maskPath; - //!@brief Path to coordinate set in m_dom. - const std::string m_coordsetPath; + //!@brief First facet index from each parent domain. + axom::Array m_facetIndexOffsets; - //!@brief Path to nodal scalar function in m_dom. - std::string m_fcnPath; + //!@brief Facet count over all parent domains. + axom::IndexType m_facetCount = 0; - //!@brief Path to mask in m_dom. - const std::string m_maskPath; + //@{ + //!@name Scratch space from m_allocatorID, shared among singles + // Memory alloc is slow on CUDA, so this optimizes space AND time. + axom::Array m_caseIdsFlat; + axom::Array m_crossingFlags; + axom::Array m_scannedFlags; + axom::Array m_facetIncrs; + //@} + //@{ + //!@name Generated contour mesh, shared with singles. /*! - @brief Base class for implementations templated on dimension - and execution space. + @brief Corners (index into m_facetNodeCoords) of generated facets. + @see allocateOutputBuffers(). + */ + axom::Array m_facetNodeIds; - This class allows m_impl to refer to any implementation used - at runtime. + /*! + @brief Coordinates of generated surface mesh nodes. + @see allocateOutputBuffers(). */ - struct ImplBase - { - //!@brief Prepare internal data for operating on the given domain. - virtual void initialize(const conduit::Node &dom, - const std::string &coordsetPath, - const std::string &fcnPath, - const std::string &maskPath) = 0; - //!@brief Set the contour value - virtual void setContourValue(double contourVal) = 0; - //@{ - //!@name Phases of the computation - //!@brief Mark domain cells that cross the contour. - virtual void markCrossings() = 0; - //!@brief Precompute some metadata for contour mesh. - virtual void scanCrossings() = 0; - //!@brief Generate the contour mesh in internal data format. - virtual void computeContour() = 0; - //!@brief Get the number of contour mesh cells generated. - //@} - virtual axom::IndexType getContourCellCount() const = 0; - /*! - @brief Populate output mesh object with generated contour. - - Note: Output format is in flux. We will likely output - a blueprint object in the future. - */ - virtual void populateContourMesh( - axom::mint::UnstructuredMesh &mesh, - const std::string &cellIdField) const = 0; - virtual ~ImplBase() { } - }; - - std::unique_ptr m_impl; - //!@brief Allocate implementation object and set m_impl. - void allocateImpl(); + axom::Array m_facetNodeCoords; /*! - * \brief Set the blueprint single-domain mesh. - * - * Some data from \a dom may be cached by the constructor. - */ - void setDomain(const conduit::Node &dom); + @brief Flat index of parent cell of facets. + @see allocateOutputBuffers(). + */ + axom::Array m_facetParentIds; -}; // class MarchingCubesSingleDomain + /*! + @brief Domain ids of facets. + */ + axom::Array m_facetDomainIds; + //@} + + //!@brief Allocate output buffers corresponding to runtime policy. + void allocateOutputBuffers(); +}; } // namespace quest } // namespace axom -#endif // AXOM_PRIMAL_ISOSURFACE_H_ +#endif // AXOM_USE_CONDUIT +#endif // AXOM_QUEST_MARCHINGCUBES_H_ diff --git a/src/axom/quest/MeshTester.cpp b/src/axom/quest/MeshTester.cpp index 64d6b3cfb1..6681091ada 100644 --- a/src/axom/quest/MeshTester.cpp +++ b/src/axom/quest/MeshTester.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/MeshTester.hpp b/src/axom/quest/MeshTester.hpp index 0edd878c32..c9c1f71e4d 100644 --- a/src/axom/quest/MeshTester.hpp +++ b/src/axom/quest/MeshTester.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/MeshViewUtil.hpp b/src/axom/quest/MeshViewUtil.hpp new file mode 100644 index 0000000000..7c3098c6e5 --- /dev/null +++ b/src/axom/quest/MeshViewUtil.hpp @@ -0,0 +1,912 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#ifndef QUEST_MESH_VIEW_UTIL_H_ +#define QUEST_MESH_VIEW_UTIL_H_ + +#include "axom/config.hpp" + +// Implementation requires Conduit. +#ifdef AXOM_USE_CONDUIT + + #include "axom/core.hpp" + #include "axom/fmt.hpp" + #include "conduit_blueprint.hpp" + #include "conduit_blueprint_mcarray.hpp" + #ifdef AXOM_USE_MPI + #include "conduit_blueprint_mpi.hpp" + #include "conduit_relay_mpi_io_blueprint.hpp" + #endif + + #include + #include + #include + #include + #include + +namespace axom +{ +namespace quest +{ +namespace internal +{ +template +inline axom::StackArray makeStackArray(T v = std::numeric_limits::max()) +{ + axom::StackArray rval; + for(int d = 0; d < DIM; ++d) + { + rval[d] = v; + } + return rval; +} +template +inline axom::StackArray makeStackArray(const U* v) +{ + axom::StackArray rval; + for(int d = 0; d < DIM; ++d) + { + rval[d] = v[d]; + } + return rval; +} +template +static inline T product(const axom::StackArray& a) +{ + T prod = a[0]; + for(int d = 1; d < DIM; ++d) + { + prod *= a[d]; + } + return prod; +} + +//@{ +//!@name Conversions between shape specifications and strides-and-offsets. +/*! + @brief Convert shape specifications to blueprint-style + offsets and strides. + + @tparam IType Index type + @tparam DIM Spatial dimension + + @param realShape [i] + @param loPads [i] Ghost padding amount on low side. + @param hiPads [i] Ghost padding amount ont high side. + @param strideOrder [i] Fastest-to-slowest advancing + index directions. + @param minStride [i] Stride of fastest advancing + index direction. + @param offsets [o] Blueprint-style index offsets. + @param strides [o] Blueprint-style strides. + @param valuesCount [o] Number of values in + ghost-padded data. +*/ +template +static void shapesToStridesAndOffsets( + const axom::StackArray& realShape, + const axom::StackArray& loPads, + const axom::StackArray& hiPads, + const axom::StackArray& strideOrder, + IndexType minStride, + axom::StackArray& offsets, + axom::StackArray& strides, + IndexType& valuesCount) +{ + axom::StackArray paddedShape; + for(int d = 0; d < DIM; ++d) + { + offsets[d] = loPads[d]; + paddedShape[d] = realShape[d] + loPads[d] + hiPads[d]; + } + + strides[strideOrder[0]] = minStride; + for(int nd = 1; nd < DIM; ++nd) + { + const int& curDir = strideOrder[nd]; + const int& prevDir = strideOrder[nd - 1]; + strides[curDir] = strides[prevDir] * paddedShape[prevDir]; + } + auto slowestDir = strideOrder[DIM - 1]; + valuesCount = strides[slowestDir] * paddedShape[slowestDir]; +} + +/*! + @brief Convert blueprint-style offsets and strides to + shape specifications. + + @tparam IType Index type + @tparam DIM Spatial dimension + + @param realShape [i] + @param offsets [i] Blueprint-style index offsets. + @param strides [i] Blueprint-style strides. + @param valuesCount [i] Number of values in + ghost-padded data. + @param paddedShape [o] \a realShape + \a loPads + \a hiPads + @param loPads [o] Ghost padding amount on low side. + @param hiPads [o] Ghost padding amount ont high side. + @param minStride [i] Stride of fastest advancing + index direction. + @param strideOrder [i] Fastest-to-slowest advancing + index directions. +*/ +template +static void stridesAndOffsetsToShapes(const axom::StackArray& realShape, + const axom::StackArray& offsets, + const axom::StackArray& strides, + const IndexType& valuesCount, + axom::StackArray& paddedShape, + axom::StackArray& loPads, + axom::StackArray& hiPads, + axom::StackArray& strideOrder) +{ + // Sort directions from fastest to slowest. + for(int d = 0; d < DIM; ++d) + { + strideOrder[d] = d; + } + for(int s = 0; s < DIM; ++s) + { + for(int d = s; d < DIM; ++d) + { + if(strides[strideOrder[d]] < strides[strideOrder[s]]) + { + std::swap(strideOrder[s], strideOrder[d]); + } + } + } + + for(int nd = 0; nd < DIM - 1; ++nd) + { + const int& curDir = strideOrder[nd]; + const int& nextDir = strideOrder[nd + 1]; + paddedShape[curDir] = strides[nextDir] / strides[curDir]; + } + paddedShape[strideOrder[DIM - 1]] = valuesCount / strides[strideOrder[DIM - 1]]; + + for(int d = 0; d < DIM; ++d) + { + loPads[d] = offsets[d]; + hiPads[d] = paddedShape[d] - realShape[d] - loPads[d]; + } +} +//@} + +} // namespace internal + +/** + \brief Utility for high-level access into a blueprint mesh, + for structured mesh with explicit coordinates. + + Note: This class was written for a specific use and supports + only structured domains with explicit node values. + + Blueprint mesh data is sufficient but sparse, leaving users to + compute some intermediate data to get to high-level data of + interest, such as views into array data. This class encapsulates + those common functions. + + Views are single-domain-specific. They don't apply to multi-domain + meshes. They are also topology specific, with the topology name + given to the constructor. They are valid only while their domain + exists with no change to its data layout. + + This class recognizes potential ghost (a.k.a. phony, image) data + layers around the domain. Some methods and paramenters names refer + to the data with ghosts, while others refer to the data without + hosts (a.k.a. real data). + + TODO: Figure out if there's a better place for this utility. + It's only in axom/quest because the initial need was there. +*/ +template +class MeshViewUtil +{ +public: + using MdIndices = axom::StackArray; + using CoordsViewsType = + axom::StackArray, DIM>; + using ConstCoordsViewsType = + axom::StackArray, DIM>; + + //@{ + //@name Setting up + //!@brief Default constructor doesn't set up the view utility. + MeshViewUtil() + : m_dom(nullptr) + , m_topology(nullptr) + , m_coordset(nullptr) + , m_cdom(nullptr) + , m_ctopology(nullptr) + , m_ccoordset(nullptr) + { } + /*! + @brief Construct view of a non-const domain. + + @param [in] bpDomain Blueprint single domain. + @param [in] topologyName Name of topology in the domain. + + If \a topologyName is omitted, use the first topology. + + The topology dimension must match DIM. + */ + MeshViewUtil(conduit::Node& bpDomain, const std::string& topologyName = "") + : m_dom(&bpDomain) + , m_topologyName(topologyName) + { + if(m_topologyName.empty()) + { + m_topologyName = bpDomain.fetch_existing("topologies")[0].name(); + } + + const std::string topoPath = "topologies/" + m_topologyName; + m_topology = &m_dom->fetch_existing(topoPath); + + const std::string coordsetPath = + "coordsets/" + m_dom->fetch_existing(topoPath + "/coordset").as_string(); + m_coordset = &m_dom->fetch_existing(coordsetPath); + + m_cdom = m_dom; + m_ctopology = m_topology; + m_ccoordset = m_coordset; + + if(!isValid()) + { + SLIC_ERROR( + "Invalid domain in MeshViewUtil. Domain must be blueprint-valid," + " structured, with exlicit coordinates and dimension equal to " + " the template DIM parameter."); + } + + computeCoordsDataLayout(); + } + + /*! + @brief Construct view of a const domain. + + @param [in] bpDomain const Blueprint single domain. + @param [in] topologyName Name op topology in the domain. + + If \a topologyName is omitted, use the first topology. + The topology dimension must match DIM. + */ + MeshViewUtil(const conduit::Node& bpDomain, const std::string& topologyName) + : m_cdom(&bpDomain) + , m_topologyName(topologyName) + { + const std::string topoPath = "topologies/" + m_topologyName; + SLIC_ASSERT(m_cdom->has_path(topoPath)); + m_ctopology = &m_cdom->fetch_existing(topoPath); + + const std::string coordsetPath = + "coordsets/" + m_cdom->fetch_existing(topoPath + "/coordset").as_string(); + m_ccoordset = &m_cdom->fetch_existing(coordsetPath); + + if(!isValid()) + { + SLIC_ERROR( + "Invalid domain in MeshViewUtil. Domain must be blueprint-valid," + " structured, with exlicit coordinates. and dimension equal to " + " the template DIM parameter."); + } + + computeCoordsDataLayout(); + } + + /*! + @brief Whether the domain is a valid one for this utility. + + In addition to checking for blueprint validity (unless \a + checkBlueprint is false), this method checks against its own + requirements. + */ + bool isValid(bool checkBlueprint = false, bool printFailureCause = false) const + { + bool valA = true; + if(checkBlueprint) + { + conduit::Node info; + #ifdef AXOM_USE_MPI + valA = + conduit::blueprint::mpi::verify("mesh", *m_cdom, info, MPI_COMM_WORLD); + #else + valA = conduit::blueprint::verify("mesh", *m_cdom, info); + #endif + if(printFailureCause && !valA) + { + info.print(); + } + } + bool valB = m_ctopology->fetch_existing("type").as_string() == "structured"; + if(printFailureCause && !valB) + { + SLIC_INFO("MeshViewUtil domain is not structured"); + } + + bool valC = m_ccoordset->fetch_existing("type").as_string() == "explicit"; + if(printFailureCause && !valC) + { + SLIC_INFO("MeshViewUtil domain coords is not explicit"); + } + + bool valD = conduit::blueprint::mesh::coordset::dims(*m_ccoordset) == DIM; + if(printFailureCause && !valD) + { + SLIC_INFO("MeshViewUtil domain has wrong dimension"); + } + + return valA && valB && valC && valD; + } + //@} + + //@{ + //!@name Blueprint data organization + /*! + @brief Get the named topology. + + @return the Conduit node at "topologies/". + */ + const conduit::Node& getTopology() { return *m_topology; } + const conduit::Node& getTopology() const { return *m_ctopology; } + + //! @brief Get the coordinates conduit::Node for the named topology. + conduit::Node& getCoordSet() { return *m_coordset; } + const conduit::Node& getCoordSet() const { return *m_ccoordset; } + + //! @brief Get the spatial dimension of the named topology. + conduit::index_t getTopologyDim() const { return DIM; } + //@} + + //@{ + //!@name General sizes and shapes of domain + + //! @brief Get the number of cells in each direction of the domain. + MdIndices getCellShape() const { return m_cellShape; } + + //! @brief Get the number of nodes in each direction of the domain. + MdIndices getNodeShape() const { return m_nodeShape; } + + //! @brief Return number of (real) cells. + axom::IndexType getCellCount() const + { + return axom::quest::internal::product(m_cellShape); + } + + //! @brief Return number of (real) nodes. + axom::IndexType getNodeCount() const + { + return axom::quest::internal::product(m_nodeShape); + } + + //! @brief Return the real (ghost-free) shape of mesh data. + const MdIndices& getRealShape(const std::string& association) + { + if(association == "vertex") + { + return m_nodeShape; + } + else if(association == "element") + { + return m_cellShape; + } + + SLIC_ERROR( + axom::fmt::format("MeshVieuUtil only supports element and vertex data " + "association for now, not '{}'.", + association)); + + return m_cellShape; + } + //@} + + //@{ + //! @name Coordinates and field data sizes and shapes. + + /*! + @brief Return the array strides for ghost-free nodal + coordinates. + */ + MdIndices getCoordsStrides() const { return m_coordsStrides; } + + /*! + @brief Return the array index offsets for ghost-free nodal + coordinates. + */ + MdIndices getCoordsOffsets() const { return m_coordsOffsets; } + + //! @brief Return number of points, excluding ghosts. + axom::IndexType getCoordsCount() const { return getNodeCount(); } + + //! @brief Return number of points, including ghosts. + axom::IndexType getCoordsCountWithGhosts() const + { + const conduit::Node& valuesNode = m_ccoordset->fetch_existing("values"); + axom::IndexType rval = valuesNode[0].dtype().number_of_elements(); + return rval; + } + //@} + + //@{ + //!@name Coords and data views + + //!@brief Return the views of the DIM coordinates component data. + CoordsViewsType getCoordsViews(bool withGhosts = false) + { + conduit::Node& valuesNode = getCoordSet().fetch_existing("values"); + axom::StackArray, DIM> rval; + for(int d = 0; d < DIM; ++d) + { + auto* dataPtr = valuesNode[d].as_double_ptr(); + rval[d] = axom::ArrayView(dataPtr, + m_coordsPaddedShape, + m_coordsStrides); + } + + if(withGhosts == false) + { + // Compute a view without ghosts. + MdIndices offsets = + conduitIndicesToStackArray(m_ctopology->fetch_existing("elements/dims"), + "offsets", + 0); + MdIndices counts = m_nodeShape; + for(int d = 0; d < DIM; ++d) + { + auto rval1 = rval[d]; + rval[d] = rval1.subspan(offsets, counts); + } + } + + return rval; + } + + //!@brief Return the views of the DIM coordinates component data. + ConstCoordsViewsType getConstCoordsViews(bool withGhosts = false) const + { + const conduit::Node& valuesNode = getCoordSet().fetch_existing("values"); + axom::StackArray, DIM> rval; + for(int d = 0; d < DIM; ++d) + { + auto* dataPtr = valuesNode[d].as_double_ptr(); + rval[d] = axom::ArrayView(dataPtr, + m_coordsPaddedShape, + m_coordsStrides); + } + + if(withGhosts == false) + { + MdIndices offsets = + conduitIndicesToStackArray(m_ctopology->fetch_existing("elements/dims"), + "offsets", + 0); + MdIndices counts = m_cellShape; + for(int d = 0; d < DIM; ++d) + { + ++counts[d]; + } + for(int d = 0; d < DIM; ++d) + { + auto rval1 = rval[d]; + rval[d] = rval1.subspan(offsets, counts); + } + } + + return rval; + } + + /*! + @brief Return view to a scalar field variable. + + WARNING: The view returned has an allocator id determined by + \a MemSpace, regardless of the memory type. + + WARNING: Assuming, without checking, that the field contains + data of type \a T. User is responsible for using the correct + type. + */ + template + axom::ArrayView getFieldView(const std::string& fieldName, + bool withGhosts = false) + { + if(!m_dom) + { + SLIC_ERROR( + "Cannot use getFieldView from MeshViewUtil initialized with a const " + "conduit::Node. Use getConstFieldView."); + } + conduit::Node& fieldNode = m_dom->fetch_existing("fields/" + fieldName); + const std::string association = + fieldNode.fetch_existing("association").as_string(); + conduit::Node& valuesNode = fieldNode.fetch_existing("values"); + const axom::IndexType valuesCount = valuesNode.dtype().number_of_elements(); + + SLIC_ASSERT_MSG( + association == "vertex" || association == "element", + "MeshViewUtil only supports vertex and element-based fields right now."); + const bool onVertex = association == "vertex"; + + const auto& realShape = onVertex ? m_nodeShape : m_cellShape; + + MdIndices strides = conduitIndicesToStackArray(fieldNode, "strides"); + if(!fieldNode.has_child("strides")) + { + axom::IndexType tmpStride = 1; + for(int d = 0; d < DIM; ++d) + { + strides[d] = tmpStride; + tmpStride *= m_cellShape[d] + onVertex; + } + } + + MdIndices offsets = conduitIndicesToStackArray(fieldNode, "offsets", 0); + + MdIndices loPads, hiPads, paddedShape, strideOrder; + axom::quest::internal::stridesAndOffsetsToShapes(realShape, + offsets, + strides, + valuesCount, + paddedShape, + loPads, + hiPads, + strideOrder); + + T* dataPtr = static_cast(valuesNode.data_ptr()); + axom::ArrayView rval(dataPtr, paddedShape, strides); + + if(withGhosts == false) + { + auto rval1 = rval; + rval = rval1.subspan(offsets, realShape); + } + + return rval; + } + + /*! + @brief Return view to a scalar field variable. + + WARNING: The view returned has an allocator id determined by + \a MemSpace, regardless of the memory type. + + WARNING: Assuming, without checking, that the field contains + data of type \a T. User is responsible for using the correct + type. + */ + template + axom::ArrayView getConstFieldView( + const std::string& fieldName, + bool withGhosts = false) + { + const conduit::Node& fieldNode = + m_cdom->fetch_existing("fields/" + fieldName); + const std::string association = + fieldNode.fetch_existing("association").as_string(); + const conduit::Node& valuesNode = fieldNode.fetch_existing("values"); + const axom::IndexType valuesCount = valuesNode.dtype().number_of_elements(); + + SLIC_ASSERT_MSG( + association == "vertex" || association == "element", + "MeshViewUtil only supports vertex and element-based fields right now."); + const bool onVertex = association == "vertex"; + + const auto& realShape = onVertex ? m_nodeShape : m_cellShape; + + MdIndices strides = conduitIndicesToStackArray(fieldNode, "strides"); + if(!fieldNode.has_child("strides")) + { + axom::IndexType tmpStride = 1; + for(int d = 0; d < DIM; ++d) + { + strides[d] = tmpStride; + tmpStride *= m_cellShape[d] + onVertex; + } + } + + MdIndices offsets = conduitIndicesToStackArray(fieldNode, "offsets"); + if(!fieldNode.has_child("offsets")) + { + for(int d = 0; d < DIM; ++d) + { + offsets[d] = 0; + } + } + + MdIndices loPads, hiPads, paddedShape, strideOrder; + axom::quest::internal::stridesAndOffsetsToShapes(realShape, + offsets, + strides, + valuesCount, + paddedShape, + loPads, + hiPads, + strideOrder); + + const T* dataPtr = static_cast(valuesNode.data_ptr()); + axom::ArrayView rval(dataPtr, paddedShape, strides); + + if(withGhosts == false) + { + MdIndices offsets = conduitIndicesToStackArray(fieldNode, "offsets", 0); + auto rval1 = rval; + rval = rval1.subspan(offsets, realShape); + } + + return rval; + } + //@} + + //@{ + //!@name Creating data + + /*! + @brief Create a new scalar nodal data field with specified + strides and offsets. + + @param [in] fieldName + @param [in] association "vertex" or "element" + @param [in] dtype Conduit data type to put in the field. Must be at least + big enough for the strides and offsets specified. + @param [in] strides Data strides. Set to zero for no ghosts and default strides. + @param [in] offsets Data index offsets. Set to zero for no ghosts. + + Field data allocation is done by Conduit, so the data lives in + host memory. Conduit currently doesn't provide a means to allocate + the array in device memory. + + Creating a field with given strides and offsets may only be useful + for matching the strides and offsets of existing data. It's more + natural to create the field based on ghost layer thickness and + index advancement order (row-major, column-major or some other). + Use createFieldPadded() for this. + */ + void createField(const std::string& fieldName, + const std::string& association, + const conduit::DataType& dtype, + const MdIndices& strides, + const MdIndices& offsets) + { + SLIC_ERROR_IF( + m_dom == nullptr, + axom::fmt::format( + "Cannot create field {}." + " MeshViewUtil was not constructed with a non-const domain.", + fieldName)); + SLIC_ERROR_IF( + m_dom->has_path("fields/" + fieldName), + axom::fmt::format("Cannot create field {}. It already exists.", fieldName)); + + SLIC_ERROR_IF( + association != "vertex" && association != "element", + axom::fmt::format("MeshViewUtil doesn't support association '{}' yet.", + association)); + + const auto& realShape = getRealShape(association); + MdIndices loPads, hiPads, paddedShape, strideOrder; + axom::quest::internal::stridesAndOffsetsToShapes(realShape, + offsets, + strides, + dtype.number_of_elements(), + paddedShape, + loPads, + hiPads, + strideOrder); + for(int d = 0; d < DIM; ++d) + { + SLIC_ERROR_IF(offsets[d] < 0 || offsets[d] > paddedShape[d] - 1, + axom::fmt::format("Bad offsets {} for paddedShape {}", + offsets, + paddedShape)); + } + + conduit::Node& fieldNode = m_dom->fetch("fields/" + fieldName); + fieldNode["association"] = association; + fieldNode["topology"] = m_topologyName; + + constexpr bool isInt32 = std::is_same::value; + const conduit::DataType conduitDtype = + isInt32 ? conduit::DataType::int32(DIM) : conduit::DataType::int64(DIM); + // Make temporary non-const copies for the "set" methods. + auto tmpStrides = strides, tmpOffsets = offsets; + fieldNode["strides"].set(conduitDtype, &tmpStrides[0]); + fieldNode["offsets"].set(conduitDtype, &tmpOffsets[0]); + + axom::IndexType slowDir = strideOrder[DIM - 1]; + auto extras = dtype.number_of_elements() - + strides[slowDir] * (offsets[slowDir] + realShape[slowDir]); + if(extras < 0) + { + SLIC_ERROR( + axom::fmt::format("Insufficient space allocated for data, given the " + "offsets and strides.")); + } + + fieldNode["values"].set(dtype); + } + + /*! + @brief Create a new scalar nodal data field with specified + ghost paddings. + + @param [in] fieldName + @param [in] association "vertex" or "element" + @param [in] dtype Conduit data type to put in the field. + If dtype has too few elements, the minimum sufficient + size will be allocated. + @param loPads [i] Ghost padding amount on low side. + @param hiPads [i] Ghost padding amount ont high side. + @param strideOrder [i] Fastest-to-slowest advancing + index directions. + + Field data allocation is done by Conduit, so the data lives in + host memory. Conduit currently doesn't provide a means to allocate + the array in device memory. + */ + void createField(const std::string& fieldName, + const std::string& association, + const conduit::DataType& dtype, + const MdIndices& loPads, + const MdIndices& hiPads, + const MdIndices& strideOrder) + { + SLIC_ERROR_IF( + m_dom == nullptr, + axom::fmt::format( + "Cannot create field {}." + " MeshViewUtil was not constructed with a non-const domain.", + fieldName)); + SLIC_ERROR_IF( + m_dom->has_path("fields/" + fieldName), + axom::fmt::format("Cannot create field {}. It already exists.", fieldName)); + + SLIC_ERROR_IF( + association != "vertex" && association != "element", + axom::fmt::format("Not yet supporting association '{}'.", association)); + + axom::StackArray offsets; + axom::StackArray strides; + axom::IndexType valuesCount; + const auto& realShape = getRealShape(association); + axom::quest::internal::shapesToStridesAndOffsets(realShape, + loPads, + hiPads, + strideOrder, + 1, + offsets, + strides, + valuesCount); + + conduit::Node& fieldNode = m_dom->fetch("fields/" + fieldName); + fieldNode["association"] = association; + fieldNode["topology"] = m_topologyName; + + constexpr bool isInt32 = std::is_same::value; + const conduit::DataType conduitDtype = + isInt32 ? conduit::DataType::int32(DIM) : conduit::DataType::int64(DIM); + // Make temporary non-const copies for the "set" methods. + auto tmpStrides = strides, tmpOffsets = offsets; + fieldNode["strides"].set(conduitDtype, &tmpStrides[0]); + fieldNode["offsets"].set(conduitDtype, &tmpOffsets[0]); + + conduit::DataType bumpedDtype = dtype; + if(bumpedDtype.number_of_elements() < valuesCount) + { + bumpedDtype.set_number_of_elements(valuesCount); + } + fieldNode["values"].set(bumpedDtype); + } + //@} + +private: + conduit::Node* m_dom = nullptr; + conduit::Node* m_topology = nullptr; + conduit::Node* m_coordset = nullptr; + const conduit::Node* m_cdom = nullptr; + const conduit::Node* m_ctopology = nullptr; + const conduit::Node* m_ccoordset = nullptr; + std::string m_topologyName; + + MdIndices m_cellShape; + MdIndices m_nodeShape; + + MdIndices m_coordsStrides; + MdIndices m_coordsOffsets; + MdIndices m_coordsPaddedShape; + + MdIndices conduitIndicesToStackArray( + const conduit::Node& node, + const std::string& path, + axom::IndexType defaultVal = std::numeric_limits::max()) const + { + if(node.has_path(path)) + { + const auto& child = node.fetch_existing(path); + if(child.dtype().is_int32()) + { + const auto* ptr = node.fetch_existing(path).as_int32_ptr(); + return internal::makeStackArray(ptr); + } + else if(child.dtype().is_int64()) + { + const auto* ptr = node.fetch_existing(path).as_int64_ptr(); + return internal::makeStackArray(ptr); + } + else + { + SLIC_ERROR("MeshViewUtil internal error: Unanticipated type."); + } + } + return internal::makeStackArray(defaultVal); + } + + void computeCoordsDataLayout() + { + const conduit::Node& topologyDims = + m_ctopology->fetch_existing("elements/dims"); + + const std::string coordsetName = + m_ctopology->fetch_existing("coordset").as_string(); + const conduit::Node& coordsValues = m_cdom->fetch_existing( + axom::fmt::format("coordsets/{}/values", coordsetName)); + + const axom::IndexType coordValuesCount = + coordsValues[0].dtype().number_of_elements(); + + const bool coordsAreInterleaved = + conduit::blueprint::mcarray::is_interleaved(coordsValues); + + for(int i = 0; i < DIM; ++i) + { + m_cellShape[i] = topologyDims[i].to_value(); + m_nodeShape[i] = m_cellShape[i] + 1; + } + + m_coordsOffsets = conduitIndicesToStackArray(topologyDims, "offsets", 0); + m_coordsStrides = conduitIndicesToStackArray(topologyDims, "strides", -1); + + if(!topologyDims.has_child("strides")) + { + // Compute strides manually, assuming (as Conduit does) that + // direction 0 is fastest. + axom::IndexType tmpStride = coordsAreInterleaved ? DIM : 1; + for(int d = 0; d < DIM; ++d) + { + m_coordsStrides[d] = tmpStride; + tmpStride *= 1 + m_cellShape[d]; + } + } + + // Compute the padded shape of coords data. + MdIndices loPads; + MdIndices hiPads; + MdIndices strideOrder; + axom::quest::internal::stridesAndOffsetsToShapes(m_nodeShape, + m_coordsOffsets, + m_coordsStrides, + coordValuesCount, + m_coordsPaddedShape, + loPads, + hiPads, + strideOrder); + } + + bool isEqual(const MdIndices& a, const MdIndices& b) + { + for(int d = 0; d < DIM; ++d) + { + if(a[d] != b[d]) + { + return false; + } + } + return true; + } +}; + +} // end namespace quest +} // end namespace axom + +#endif // AXOM_USE_CONDUIT +#endif // QUEST_MESH_VIEW_UTIL_H_ diff --git a/src/axom/quest/PointInCell.hpp b/src/axom/quest/PointInCell.hpp index 3ed6e79c4b..ee2f50d2ca 100644 --- a/src/axom/quest/PointInCell.hpp +++ b/src/axom/quest/PointInCell.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/SamplingShaper.hpp b/src/axom/quest/SamplingShaper.hpp index 6af41e507d..215c05ad7c 100644 --- a/src/axom/quest/SamplingShaper.hpp +++ b/src/axom/quest/SamplingShaper.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -320,6 +320,18 @@ class SamplingShaper : public Shaper : Shaper(shapeSet, dc) { } + ~SamplingShaper() + { + m_inoutShapeQFuncs.DeleteData(true); + m_inoutShapeQFuncs.clear(); + + m_inoutMaterialQFuncs.DeleteData(true); + m_inoutMaterialQFuncs.clear(); + + m_inoutDofs.DeleteData(true); + m_inoutDofs.clear(); + } + //@{ //! @name Functions to get and set shaping parameters related to sampling; supplements parameters in base class @@ -464,8 +476,6 @@ class SamplingShaper : public Shaper void applyReplacementRules(const klee::Shape& shape) override { - using axom::utilities::string::rsplitN; - internal::ScopedLogLevelChanger logLevelChanger( this->isVerbose() ? slic::message::Debug : slic::message::Warning); @@ -513,7 +523,7 @@ class SamplingShaper : public Shaper } const bool shouldReplace = shape.replaces(otherMatName); - SLIC_DEBUG(axom::fmt::format( + SLIC_INFO(axom::fmt::format( "Should we replace material '{}' with shape '{}' of material '{}'? {}", otherMatName, shapeName, @@ -659,71 +669,36 @@ class SamplingShaper : public Shaper /// This function is intended to help with debugging void printRegisteredFieldNames(const std::string& initialMessage) { - std::stringstream sstr; - sstr << "List of registered fields in the SamplingShaper " << initialMessage - << std::endl; - { - std::vector names; - for(auto kv : m_dc->GetFieldMap()) - { - names.push_back(kv.first); - } - sstr << fmt::format("\t* Data collection grid funcs: {}", - fmt::join(names, ", ")) - << std::endl; - } - { - std::vector names; - for(auto kv : m_dc->GetQFieldMap()) + // helper lambda to extract the keys of a map as a vector of strings + auto extractKeys = [](const auto& map) { + std::vector keys; + for(const auto& kv : map) { - names.push_back(kv.first); + keys.push_back(kv.first); } - sstr << fmt::format("\t* Data collection qfuncs: {}", - fmt::join(names, ", ")) - << std::endl; - } + return keys; + }; - { - std::vector names; - for(auto name : m_knownMaterials) - { - names.push_back(name); - } - sstr << fmt::format("\t* Known materials: {}", fmt::join(names, ", ")) - << std::endl; - } + std::stringstream sstr; + sstr << "List of registered fields in the SamplingShaper " << initialMessage + << fmt::format("\n\t* Data collection grid funcs: {}", + fmt::join(extractKeys(m_dc->GetFieldMap()), ", ")) + << fmt::format("\n\t* Data collection qfuncs: {}", + fmt::join(extractKeys(m_dc->GetQFieldMap()), ", ")) + << fmt::format("\n\t* Known materials: {}", + fmt::join(m_knownMaterials, ", ")); if(m_vfSampling == shaping::VolFracSampling::SAMPLE_AT_QPTS) { - { - std::vector names; - for(auto kv : m_inoutShapeQFuncs) - { - names.push_back(kv.first); - } - sstr << fmt::format("\t* Shape qfuncs: {}", fmt::join(names, ", ")) - << std::endl; - } - { - std::vector names; - for(auto kv : m_inoutMaterialQFuncs) - { - names.push_back(kv.first); - } - sstr << fmt::format("\t* Mat qfuncs: {}", fmt::join(names, ", ")) - << std::endl; - } + sstr << fmt::format("\n\t* Shape qfuncs: {}", + fmt::join(extractKeys(m_inoutShapeQFuncs), ", ")) + << fmt::format("\n\t* Mat qfuncs: {}", + fmt::join(extractKeys(m_inoutMaterialQFuncs), ", ")); } else if(m_vfSampling == shaping::VolFracSampling::SAMPLE_AT_DOFS) { - std::vector names; - for(auto kv : m_inoutDofs) - { - names.push_back(kv.first); - } - sstr << fmt::format("\t* Shape samples at DOFs: {}", - fmt::join(names, ", ")) - << std::endl; + sstr << fmt::format("\n\t* Shape samples at DOFs: {}", + fmt::join(extractKeys(m_inoutDofs), ", ")); } SLIC_INFO(sstr.str()); } diff --git a/src/axom/quest/ScatteredInterpolation.hpp b/src/axom/quest/ScatteredInterpolation.hpp index 1afb15a130..996b967a91 100644 --- a/src/axom/quest/ScatteredInterpolation.hpp +++ b/src/axom/quest/ScatteredInterpolation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/Shaper.cpp b/src/axom/quest/Shaper.cpp index 443170c037..6c732aac70 100644 --- a/src/axom/quest/Shaper.cpp +++ b/src/axom/quest/Shaper.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/Shaper.hpp b/src/axom/quest/Shaper.hpp index 265a79eef4..01942de782 100644 --- a/src/axom/quest/Shaper.hpp +++ b/src/axom/quest/Shaper.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -48,11 +48,7 @@ class Shaper static constexpr double DEFAULT_VERTEX_WELD_THRESHOLD {1e-9}; /// Refinement type. - typedef enum - { - RefinementUniformSegments, - RefinementDynamic - } RefinementType; + using RefinementType = enum { RefinementUniformSegments, RefinementDynamic }; //@{ //! @name Functions to get and set shaping parameters diff --git a/src/axom/quest/SignedDistance.cpp b/src/axom/quest/SignedDistance.cpp index 934381d5b5..500cd53102 100644 --- a/src/axom/quest/SignedDistance.cpp +++ b/src/axom/quest/SignedDistance.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index dbc1b3868e..d6a5756837 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/AllNearestNeighbors_detail.hpp b/src/axom/quest/detail/AllNearestNeighbors_detail.hpp index 82d45c56c7..089fe7014b 100644 --- a/src/axom/quest/detail/AllNearestNeighbors_detail.hpp +++ b/src/axom/quest/detail/AllNearestNeighbors_detail.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/Discretize_detail.hpp b/src/axom/quest/detail/Discretize_detail.hpp index 954e6e0b10..6dcd076a1b 100644 --- a/src/axom/quest/detail/Discretize_detail.hpp +++ b/src/axom/quest/detail/Discretize_detail.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/DistributedClosestPointImpl.hpp b/src/axom/quest/detail/DistributedClosestPointImpl.hpp new file mode 100644 index 0000000000..0875eb889a --- /dev/null +++ b/src/axom/quest/detail/DistributedClosestPointImpl.hpp @@ -0,0 +1,1351 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#ifndef QUEST_DISTRIBUTED_CLOSEST_POINT_IMPL_H_ +#define QUEST_DISTRIBUTED_CLOSEST_POINT_IMPL_H_ + +#include "axom/config.hpp" +#include "axom/core.hpp" +#include "axom/slic.hpp" +#include "axom/primal.hpp" +#include "axom/spin.hpp" +#include "axom/core/execution/runtime_policy.hpp" + +#include "axom/fmt.hpp" + +#include "conduit_blueprint.hpp" +#include "conduit_blueprint_mcarray.hpp" +#include "conduit_blueprint_mpi.hpp" +#include "conduit_relay_mpi.hpp" +#include "conduit_relay_io.hpp" + +#include +#include +#include +#include +#include +#include + +#ifndef AXOM_USE_MPI + #error This file requires Axom to be configured with MPI +#endif +#include "mpi.h" + +namespace axom +{ +namespace quest +{ +namespace internal +{ +// Utility function to dump a conduit node on each rank, e.g. for debugging +inline void dump_node(const conduit::Node& n, + const std::string&& fname, + const std::string& protocol = "json") +{ + conduit::relay::io::save(n, fname, protocol); +} + +/** + * \brief Utility function to get a typed pointer to the beginning of an array + * stored by a conduit::Node + */ +template +T* getPointer(conduit::Node& node) +{ + T* ptr = node.value(); + return ptr; +} + +/** + * \brief Utility function to create an axom::ArrayView over the array + * of native types stored by a conduit::Node + */ +template +axom::ArrayView ArrayView_from_Node(conduit::Node& node, int sz) +{ + T* ptr = node.value(); + return axom::ArrayView(ptr, sz); +} + +/** + * \brief Template specialization of ArrayView_from_Node for Point + * + * \warning Assumes the underlying data is an MCArray with stride 2 access + */ +template <> +inline axom::ArrayView> ArrayView_from_Node( + conduit::Node& node, + int sz) +{ + using PointType = primal::Point; + + PointType* ptr = static_cast(node.data_ptr()); + return axom::ArrayView(ptr, sz); +} + +/** + * \brief Template specialization of ArrayView_from_Node for Point + * + * \warning Assumes the underlying data is an MCArray with stride 3 access + */ +template <> +inline axom::ArrayView> ArrayView_from_Node( + conduit::Node& node, + int sz) +{ + using PointType = primal::Point; + + PointType* ptr = static_cast(node.data_ptr()); + return axom::ArrayView(ptr, sz); +} + +/** + * \brief Put BoundingBox into a Conduit Node. + */ +template +void put_bounding_box_to_conduit_node(const primal::BoundingBox& bb, + conduit::Node& node) +{ + node["dim"].set(bb.dimension()); + if(bb.isValid()) + { + node["lo"].set(bb.getMin().data(), bb.dimension()); + node["hi"].set(bb.getMax().data(), bb.dimension()); + } +} + +/** + * \brief Get BoundingBox from a Conduit Node. + */ +template +void get_bounding_box_from_conduit_node(primal::BoundingBox& bb, + const conduit::Node& node) +{ + using PointType = primal::Point; + + SLIC_ASSERT(NDIMS == node.fetch_existing("dim").as_int()); + + bb.clear(); + + if(node.has_child("lo")) + { + bb.addPoint(PointType(node.fetch_existing("lo").as_double_ptr(), NDIMS)); + bb.addPoint(PointType(node.fetch_existing("hi").as_double_ptr(), NDIMS)); + } +} + +/// Helper function to extract the dimension from the coordinate values group +/// of a mesh blueprint coordset +inline int extractDimension(const conduit::Node& values_node) +{ + SLIC_ASSERT(values_node.has_child("x")); + return values_node.has_child("z") ? 3 : (values_node.has_child("y") ? 2 : 1); +} + +/// Helper function to extract the number of points from the coordinate values group +/// of a mesh blueprint coordset +inline int extractSize(const conduit::Node& values_node) +{ + SLIC_ASSERT(values_node.has_child("x")); + return values_node["x"].dtype().number_of_elements(); +} + +namespace relay +{ +namespace mpi +{ +/** + * \brief Sends a conduit node along with its schema using MPI_Isend + * + * \param [in] node node to send + * \param [in] dest ID of MPI rank to send to + * \param [in] tag tag for MPI message + * \param [in] comm MPI communicator to use + * \param [in] request object holding state for the sent data + * \note Adapted from conduit's relay::mpi's \a send_using_schema and \a isend + * to use non-blocking \a MPI_Isend instead of blocking \a MPI_Send + */ +inline int isend_using_schema(conduit::Node& node, + int dest, + int tag, + MPI_Comm comm, + conduit::relay::mpi::Request* request) +{ + conduit::Schema s_data_compact; + + // schema will only be valid if compact and contig + if(node.is_compact() && node.is_contiguous()) + { + s_data_compact = node.schema(); + } + else + { + node.schema().compact_to(s_data_compact); + } + const std::string snd_schema_json = s_data_compact.to_json(); + + conduit::Schema s_msg; + s_msg["schema_len"].set(conduit::DataType::int64()); + s_msg["schema"].set(conduit::DataType::char8_str(snd_schema_json.size() + 1)); + s_msg["data"].set(s_data_compact); + + // create a compact schema to use + conduit::Schema s_msg_compact; + s_msg.compact_to(s_msg_compact); + request->m_buffer.reset(); + request->m_buffer.set_schema(s_msg_compact); + + // set up the message's node using this schema + request->m_buffer["schema_len"].set((std::int64_t)snd_schema_json.length()); + request->m_buffer["schema"].set(snd_schema_json); + request->m_buffer["data"].update(node); + + // for wait_all, this must always be NULL except for + // the irecv cases where copy out is necessary + // isend case must always be NULL + request->m_rcv_ptr = nullptr; + + auto msg_data_size = request->m_buffer.total_bytes_compact(); + int mpi_error = MPI_Isend(const_cast(request->m_buffer.data_ptr()), + static_cast(msg_data_size), + MPI_BYTE, + dest, + tag, + comm, + &(request->m_request)); + + // Error checking -- Note: expansion of CONDUIT_CHECK_MPI_ERROR + if(static_cast(mpi_error) != MPI_SUCCESS) + { + char check_mpi_err_str_buff[MPI_MAX_ERROR_STRING]; + int check_mpi_err_str_len = 0; + MPI_Error_string(mpi_error, check_mpi_err_str_buff, &check_mpi_err_str_len); + + SLIC_ERROR( + fmt::format("MPI call failed: error code = {} error message = {}", + mpi_error, + check_mpi_err_str_buff)); + } + + return mpi_error; +} + +/// A modified version of the conduit method. +// This version works correctly when src is MPI_ANY_SOURCE +// and tag is MPI_ANY_TAG. When conduit supports this, +// this version can be removed. +inline int recv_using_schema(conduit::Node& node, int src, int tag, MPI_Comm comm) +{ + MPI_Status status; + + int mpi_error = MPI_Probe(src, tag, comm, &status); + + // CONDUIT_CHECK_MPI_ERROR(mpi_error); + // Expand the conduit macro: + if(static_cast(mpi_error) != MPI_SUCCESS) + { + char check_mpi_err_str_buff[MPI_MAX_ERROR_STRING]; + int check_mpi_err_str_len = 0; + MPI_Error_string(mpi_error, check_mpi_err_str_buff, &check_mpi_err_str_len); + + SLIC_ERROR( + fmt::format("MPI call failed: error code = {} error message = {}", + mpi_error, + check_mpi_err_str_buff)); + } + + int buffer_size = 0; + MPI_Get_count(&status, MPI_BYTE, &buffer_size); + + conduit::Node n_buffer(conduit::DataType::uint8(buffer_size)); + + mpi_error = MPI_Recv(n_buffer.data_ptr(), + buffer_size, + MPI_BYTE, + status.MPI_SOURCE, + status.MPI_TAG, + comm, + &status); + + std::uint8_t* n_buff_ptr = (std::uint8_t*)n_buffer.data_ptr(); + + conduit::Node n_msg; + // length of the schema is sent as a 64-bit signed int + // NOTE: we aren't using this value ... + n_msg["schema_len"].set_external((std::int64_t*)n_buff_ptr); + n_buff_ptr += 8; + // wrap the schema string + n_msg["schema"].set_external_char8_str((char*)(n_buff_ptr)); + // create the schema + conduit::Schema rcv_schema; + conduit::Generator gen(n_msg["schema"].as_char8_str()); + gen.walk(rcv_schema); + + // advance by the schema length + n_buff_ptr += n_msg["schema"].total_bytes_compact(); + + // apply the schema to the data + n_msg["data"].set_external(rcv_schema, n_buff_ptr); + + // copy out to our result node + node.update(n_msg["data"]); + + return mpi_error; +} + +} // namespace mpi +} // namespace relay + +/** + * \brief Implements the DistributedClosestPoint query for a specified dimension + * using a provided execution policy (e.g. sequential, openmp, cuda, hip) + * + * \tparam NDIMS The dimension of the object mesh and query points + */ +template +class DistributedClosestPointImpl +{ +public: + static constexpr int DIM = NDIMS; + using RuntimePolicy = axom::runtime_policy::Policy; + using PointType = primal::Point; + using BoxType = primal::BoundingBox; + using PointArray = axom::Array; + using BoxArray = axom::Array; + + using SeqBVHTree = spin::BVH; +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + using OmpBVHTree = spin::BVH; +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + using CudaBVHTree = spin::BVH>; +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + using HipBVHTree = spin::BVH>; +#endif + +private: + struct MinCandidate + { + /// Squared distance to query point + double sqDist {numerics::floating_point_limits::max()}; + /// Index of domain of closest element + int domainIdx {-1}; + /// Index within domain of closest element + int pointIdx {-1}; + /// MPI rank of closest element + int rank {-1}; + }; + +public: + /*! + @brief Constructor + + @param [i] runtimePolicy Indicates where local computations + are done. See axom::runtime_policy. + @param [i] allocatorID Allocator ID, which must be compatible with + @c runtimePolicy. See axom::allocate and axom::reallocate. + Also see setAllocatorID(). + @param [i[ isVerbose + */ + DistributedClosestPointImpl(RuntimePolicy runtimePolicy, + int allocatorID, + bool isVerbose) + : m_runtimePolicy(runtimePolicy) + , m_isVerbose(isVerbose) + , m_sqDistanceThreshold(std::numeric_limits::max()) + , m_allocatorID(allocatorID) + , m_mpiComm(MPI_COMM_NULL) + , m_rank(-1) + , m_nranks(-1) + , m_objectPtCoords(0, 0, allocatorID) + , m_objectPtDomainIds(0, 0, allocatorID) + { + SLIC_ASSERT(allocatorID != axom::INVALID_ALLOCATOR_ID); + + setMpiCommunicator(MPI_COMM_WORLD); + } + + /** + * \brief Set the MPI communicator. + */ + void setMpiCommunicator(MPI_Comm mpiComm) + { + m_mpiComm = mpiComm; + MPI_Comm_rank(m_mpiComm, &m_rank); + MPI_Comm_size(m_mpiComm, &m_nranks); + } + + /** + * \brief Sets the threshold for the query + * + * \param [in] threshold Ignore distances greater than this value. + */ + void setSquaredDistanceThreshold(double sqThreshold) + { + SLIC_ERROR_IF(sqThreshold < 0.0, + "Squared distance-threshold must be non-negative."); + m_sqDistanceThreshold = sqThreshold; + } + + /*! @brief Sets the allocator ID to the default associated with the + execution policy + */ + void setAllocatorID(int allocatorID) + { + SLIC_ASSERT(allocatorID != axom::INVALID_ALLOCATOR_ID); + // TODO: If appropriate, how to check for compatibility with runtime policy? + m_allocatorID = allocatorID; + } + + void setOutputSwitches(bool outputRank, + bool outputIndex, + bool outputDistance, + bool outputCoords, + bool outputDomainIndex) + { + m_outputRank = outputRank; + m_outputIndex = outputIndex; + m_outputDistance = outputDistance; + m_outputCoords = outputCoords; + m_outputDomainIndex = outputDomainIndex; + } + +public: + /** + * Import object mesh points from the object blueprint mesh into internal memory. + * + * \param [in] mdMeshNode The blueprint mesh containing the object points. + * \param [in] topologyName Name of the blueprint topology in \a mdMeshNode. + * \note This function currently supports mesh blueprints with the "point" topology + */ + void importObjectPoints(const conduit::Node& mdMeshNode, + const std::string& topologyName) + { + // TODO: See if some of the copies in this method can be optimized out. + + SLIC_ASSERT(sizeof(double) * DIM == sizeof(PointType)); + + // Count points in the mesh. + int ptCount = 0; + for(const conduit::Node& domain : mdMeshNode.children()) + { + const std::string coordsetName = + domain + .fetch_existing( + axom::fmt::format("topologies/{}/coordset", topologyName)) + .as_string(); + const std::string valuesPath = + axom::fmt::format("coordsets/{}/values", coordsetName); + auto& values = domain.fetch_existing(valuesPath); + const int N = internal::extractSize(values); + ptCount += N; + } + + // Copy points to internal memory + PointArray coords(ptCount, ptCount); + axom::Array domIds(ptCount, ptCount); + std::size_t copiedCount = 0; + conduit::Node tmpValues; + for(axom::IndexType d = 0; d < mdMeshNode.number_of_children(); ++d) + { + const conduit::Node& domain = mdMeshNode.child(d); + + axom::IndexType domainId = d; + if(domain.has_path("state/domain_id")) + { + domainId = domain.fetch_existing("state/domain_id").to_int32(); + } + + const std::string coordsetName = + domain + .fetch_existing( + axom::fmt::format("topologies/{}/coordset", topologyName)) + .as_string(); + const std::string valuesPath = + axom::fmt::format("coordsets/{}/values", coordsetName); + + auto& values = domain.fetch_existing(valuesPath); + + bool isInterleaved = conduit::blueprint::mcarray::is_interleaved(values); + if(!isInterleaved) + { + conduit::blueprint::mcarray::to_interleaved(values, tmpValues); + } + const conduit::Node& copySrc = isInterleaved ? values : tmpValues; + + const int N = internal::extractSize(copySrc); + const std::size_t nBytes = sizeof(double) * DIM * N; + + axom::copy(coords.data() + copiedCount, + copySrc.fetch_existing("x").data_ptr(), + nBytes); + tmpValues.reset(); + + domIds.fill(domainId, N, copiedCount); + + copiedCount += N; + } + // copy computed data to ExecSpace + m_objectPtCoords = PointArray(coords, m_allocatorID); + m_objectPtDomainIds = axom::Array(domIds, m_allocatorID); + } + + /// Predicate to check if the BVH tree has been initialized + bool isBVHTreeInitialized() const + { + switch(m_runtimePolicy) + { + case RuntimePolicy::seq: + return m_bvh_seq.get() != nullptr; + +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + case RuntimePolicy::omp: + return m_bvh_omp.get() != nullptr; +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + case RuntimePolicy::cuda: + return m_bvh_cuda.get() != nullptr; +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + case RuntimePolicy::hip: + return m_bvh_hip.get() != nullptr; +#endif + } + + return false; + } + + /// Generates the BVH tree for the classes execution space + bool generateBVHTree() + { + // Delegates to generateBVHTreeImpl<> which uses + // the execution space templated bvh tree + + SLIC_ASSERT_MSG(!isBVHTreeInitialized(), "BVH tree already initialized"); + + // In case user changed the allocator after setObjectMesh, + // move the object point data to avoid repetitive page faults. + if(m_objectPtCoords.getAllocatorID() != m_allocatorID) + { + PointArray tmpPoints(m_objectPtCoords, m_allocatorID); + m_objectPtCoords.swap(tmpPoints); + } + + switch(m_runtimePolicy) + { + case RuntimePolicy::seq: + m_bvh_seq = std::make_unique(); + return generateBVHTreeImpl(m_bvh_seq.get()); + +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + case RuntimePolicy::omp: + m_bvh_omp = std::make_unique(); + return generateBVHTreeImpl(m_bvh_omp.get()); +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + case RuntimePolicy::cuda: + m_bvh_cuda = std::make_unique(); + return generateBVHTreeImpl(m_bvh_cuda.get()); +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + case RuntimePolicy::hip: + m_bvh_hip = std::make_unique(); + return generateBVHTreeImpl(m_bvh_hip.get()); +#endif + } + + // Fail safe -- we should never reach this line! + SLIC_ERROR("Failed to initialize the BVH tree"); + + return false; + } + + /// Get local copy of all ranks BVH root bounding boxes. + void gatherBVHRoots() + { + SLIC_ASSERT_MSG( + isBVHTreeInitialized(), + "BVH tree must be initialized before calling 'gatherBVHRoots"); + + BoxType local_bb; + switch(m_runtimePolicy) + { + case RuntimePolicy::seq: + local_bb = m_bvh_seq->getBounds(); + break; + +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + case RuntimePolicy::omp: + local_bb = m_bvh_omp->getBounds(); + break; +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + case RuntimePolicy::cuda: + local_bb = m_bvh_cuda->getBounds(); + break; +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + case RuntimePolicy::hip: + local_bb = m_bvh_hip->getBounds(); + break; +#endif + } + + gatherBoundingBoxes(local_bb, m_objectPartitionBbs); + } + + /// Allgather one bounding box from each rank. + void gatherBoundingBoxes(const BoxType& aabb, BoxArray& all_aabbs) const + { + axom::Array sendbuf(2 * DIM); + aabb.getMin().to_array(&sendbuf[0]); + aabb.getMax().to_array(&sendbuf[DIM]); + axom::Array recvbuf(m_nranks * sendbuf.size()); + // Note: Using axom::Array may reduce clutter a tad. + int errf = MPI_Allgather(sendbuf.data(), + 2 * DIM, + mpi_traits::type, + recvbuf.data(), + 2 * DIM, + mpi_traits::type, + m_mpiComm); + SLIC_ASSERT(errf == MPI_SUCCESS); + AXOM_UNUSED_VAR(errf); + + all_aabbs.clear(); + all_aabbs.reserve(m_nranks); + for(int i = 0; i < m_nranks; ++i) + { + PointType lower(&recvbuf[i * 2 * DIM]); + PointType upper(&recvbuf[i * 2 * DIM + DIM]); + all_aabbs.emplace_back(BoxType(lower, upper, false)); + } + } + + /// Compute bounding box for local part of a mesh. + BoxType computeMeshBoundingBox(conduit::Node& xferNode) const + { + BoxType rval; + + conduit::Node& xferDoms = xferNode.fetch_existing("xferDoms"); + for(conduit::Node& xferDom : xferDoms.children()) + { + const int qPtCount = xferDom.fetch_existing("qPtCount").value(); + + /// Extract fields from the input node as ArrayViews + auto queryPts = + ArrayView_from_Node(xferDom.fetch_existing("coords"), + qPtCount); + for(const auto& p : queryPts) + { + rval.addPoint(p); + } + } + + return rval; + } + + /*! + * Copy parts of query mesh partition to a conduit::Node for + * computation and communication. + * queryNode must be a blueprint multidomain mesh. + */ + void node_copy_query_to_xfer(conduit::Node& queryNode, + conduit::Node& xferNode, + const std::string& topologyName) const + { + xferNode["homeRank"] = m_rank; + xferNode["is_first"] = 1; + + const bool isMultidomain = + conduit::blueprint::mesh::is_multi_domain(queryNode); + const auto domainCount = + conduit::blueprint::mesh::number_of_domains(queryNode); + conduit::Node& xferDoms = xferNode["xferDoms"]; + for(conduit::index_t domainNum = 0; domainNum < domainCount; ++domainNum) + { + auto& queryDom = isMultidomain ? queryNode.child(domainNum) : queryNode; + + const std::string coordsetName = + queryDom + .fetch_existing( + axom::fmt::format("topologies/{}/coordset", topologyName)) + .as_string(); + const std::string& domName = queryDom.name(); + conduit::Node& xferDom = xferDoms[domName]; + conduit::Node& queryCoords = + queryDom.fetch_existing(fmt::format("coordsets/{}", coordsetName)); + conduit::Node& queryCoordsValues = queryCoords.fetch_existing("values"); + + const int dim = internal::extractDimension(queryCoordsValues); + const int qPtCount = internal::extractSize(queryCoordsValues); + xferDom["qPtCount"] = qPtCount; + xferDom["dim"] = dim; + + copy_components_to_interleaved(queryCoordsValues, xferDom["coords"]); + + constexpr bool isInt32 = std::is_same::value; + auto dtype = + isInt32 ? conduit::DataType::int32() : conduit::DataType::int64(); + dtype.set_number_of_elements(qPtCount); + xferDom["cp_index"].set_dtype(dtype); + xferDom["cp_rank"].set_dtype(dtype); + xferDom["cp_domain_index"].set_dtype(dtype); + xferDom["debug/cp_distance"].set_dtype(conduit::DataType::float64(qPtCount)); + xferDom["cp_coords"].set_dtype(conduit::DataType::float64(dim * qPtCount)); + } + } + + /// Copy xferNode back to query mesh partition. + void node_copy_xfer_to_query(conduit::Node& xferNode, + conduit::Node& queryNode, + const std::string& topologyName) const + { + const bool isMultidomain = + conduit::blueprint::mesh::is_multi_domain(queryNode); + const auto domainCount = + conduit::blueprint::mesh::number_of_domains(queryNode); + conduit::Node& xferDoms = xferNode.fetch_existing("xferDoms"); + SLIC_ASSERT(xferDoms.number_of_children() == domainCount); + for(conduit::index_t domainNum = 0; domainNum < domainCount; ++domainNum) + { + auto& queryDom = isMultidomain ? queryNode.child(domainNum) : queryNode; + conduit::Node& xferDom = xferDoms.child(domainNum); + conduit::Node& fields = queryDom.fetch_existing("fields"); + + conduit::Node genericHeaders; + genericHeaders["association"] = "vertex"; + genericHeaders["topology"] = topologyName; + + if(m_outputRank) + { + auto& src = xferDom.fetch_existing("cp_rank"); + auto& dst = fields["cp_rank"]; + dst.set_node(genericHeaders); + dst["values"].move(src); + } + + if(m_outputIndex) + { + auto& src = xferDom.fetch_existing("cp_index"); + auto& dst = fields["cp_index"]; + dst.set_node(genericHeaders); + dst["values"].move(src); + } + + if(m_outputDomainIndex) + { + auto& src = xferDom.fetch_existing("cp_domain_index"); + auto& dst = fields["cp_domain_index"]; + dst.set_node(genericHeaders); + dst["values"].move(src); + } + + if(m_outputDistance) + { + auto& src = xferDom.fetch_existing("debug/cp_distance"); + auto& dst = fields["cp_distance"]; + dst.set_node(genericHeaders); + dst["values"].move(src); + } + + if(m_outputCoords) + { + auto& dst = fields["cp_coords"]; + dst.set_node(genericHeaders); + auto& dstValues = dst["values"]; + copy_interleaved_to_components(xferDom.fetch_existing("cp_coords"), + dstValues); + } + } + } + + /* + Special copy from coordinates (in a format that's not + necessarily interleaved) to a 1D array of interleaved values). + If coordinates are already interleaved, copy pointer. + */ + void copy_components_to_interleaved(conduit::Node& components, + conduit::Node& interleaved) const + { + const int dim = internal::extractDimension(components); + const int qPtCount = internal::extractSize(components); + bool interleavedSrc = conduit::blueprint::mcarray::is_interleaved(components); + if(interleavedSrc) + { + interleaved.set_external(internal::getPointer(components.child(0)), + dim * qPtCount); + } + else + { + // Copy from component-wise src to 1D-interleaved dst. + interleaved.reset(); + interleaved.set_dtype(conduit::DataType::float64(dim * qPtCount)); + for(int d = 0; d < dim; ++d) + { + auto src = components.child(d).as_float64_array(); + double* dst = interleaved.as_float64_ptr() + d; + for(int i = 0; i < qPtCount; ++i) + { + dst[i * dim] = src[i]; + } + } + } + } + + /* + Special copy from 1D interleaved coordinate values back to + component-wise storage. + This is a nop if they point to the same data. + */ + void copy_interleaved_to_components(const conduit::Node& interleaved, + conduit::Node& components) const + { + const int qPtCount = interleaved.dtype().number_of_elements() / DIM; + components.reset(); + // Copy from 1D-interleaved src to component-wise dst. + for(int d = 0; d < DIM; ++d) + { + const double* src = interleaved.as_float64_ptr() + d; + auto& dstNode = components.append(); + dstNode.set_dtype(conduit::DataType(interleaved.dtype().id(), qPtCount)); + double* dst = dstNode.as_float64_ptr(); + for(int i = 0; i < qPtCount; ++i) + { + dst[i] = src[i * DIM]; + } + } + } + + /** + * \brief Implementation of the user-facing + * DistributedClosestPoint::computeClosestPoints() method. + * + * We use non-blocking sends for performance and deadlock avoidance. + * The worst case could incur nranks^2 sends. To avoid excessive + * buffer usage, we occasionally check the sends for completion, + * using check_send_requests(). + */ + void computeClosestPoints(conduit::Node& queryMesh, + const std::string& topologyName) const + { + SLIC_ASSERT_MSG( + isBVHTreeInitialized(), + "BVH tree must be initialized before calling 'computeClosestPoints"); + + std::map> xferNodes; + + // create conduit Node containing data that has to xfer between ranks. + // The node will be mostly empty if there are no domains on this rank + { + xferNodes[m_rank] = std::make_shared(); + conduit::Node& xferNode = *xferNodes[m_rank]; + node_copy_query_to_xfer(queryMesh, xferNode, topologyName); + xferNode["homeRank"] = m_rank; + } + + BoxType myQueryBb = computeMeshBoundingBox(*xferNodes[m_rank]); + put_bounding_box_to_conduit_node(myQueryBb, xferNodes[m_rank]->fetch("aabb")); + BoxArray allQueryBbs; + gatherBoundingBoxes(myQueryBb, allQueryBbs); + + { + conduit::Node& xferNode = *xferNodes[m_rank]; + computeLocalClosestPointsByPolicy(xferNode); + } + + const auto& myObjectBb = m_objectPartitionBbs[m_rank]; + int remainingRecvs = 0; + for(int r = 0; r < m_nranks; ++r) + { + if(r != m_rank) + { + const auto& otherQueryBb = allQueryBbs[r]; + double sqDistance = + axom::primal::squared_distance(otherQueryBb, myObjectBb); + if(sqDistance <= m_sqDistanceThreshold) + { + ++remainingRecvs; + } + } + } + + // arbitrary tags for send/recv xferNode. + const int tag = 987342; + + std::list isendRequests; + + { + /* + Send local query mesh to next rank with close-enough object + partition, if any. Increase remainingRecvs, because this data + will come back. + */ + int firstRecipForMyQuery = next_recipient(*xferNodes[m_rank]); + if(m_nranks == 1) + { + SLIC_ASSERT(firstRecipForMyQuery == -1); + } + + if(firstRecipForMyQuery == -1) + { + // No need to send anywhere. Put computed data back into queryMesh. + node_copy_xfer_to_query(*xferNodes[m_rank], queryMesh, topologyName); + xferNodes.erase(m_rank); + } + else + { + isendRequests.emplace_back(conduit::relay::mpi::Request()); + auto& req = isendRequests.back(); + relay::mpi::isend_using_schema(*xferNodes[m_rank], + firstRecipForMyQuery, + tag, + m_mpiComm, + &req); + ++remainingRecvs; + } + } + + while(remainingRecvs > 0) + { + SLIC_INFO_IF( + m_isVerbose, + fmt::format("======= {} receives remaining =======", remainingRecvs)); + + // Receive the next xferNode + std::shared_ptr recvXferNodePtr = + std::make_shared(); + relay::mpi::recv_using_schema(*recvXferNodePtr, + MPI_ANY_SOURCE, + tag, + m_mpiComm); + + const int homeRank = recvXferNodePtr->fetch_existing("homeRank").as_int(); + --remainingRecvs; + xferNodes[homeRank] = recvXferNodePtr; + conduit::Node& xferNode = *xferNodes[homeRank]; + + if(homeRank == m_rank) + { + node_copy_xfer_to_query(xferNode, queryMesh, topologyName); + } + else + { + computeLocalClosestPointsByPolicy(xferNode); + + isendRequests.emplace_back(conduit::relay::mpi::Request()); + auto& isendRequest = isendRequests.back(); + int nextRecipient = next_recipient(xferNode); + SLIC_ASSERT(nextRecipient != -1); + relay::mpi::isend_using_schema(xferNode, + nextRecipient, + tag, + m_mpiComm, + &isendRequest); + + // Check non-blocking sends to free memory. + check_send_requests(isendRequests, false); + } + + } // remainingRecvs loop + + // Complete remaining non-blocking sends. + while(!isendRequests.empty()) + { + check_send_requests(isendRequests, true); + } + + MPI_Barrier(m_mpiComm); + slic::flushStreams(); + } + +private: + /// Distance search using local object partition and xferNode. + void computeLocalClosestPointsByPolicy(conduit::Node& xferNode) const + { + switch(m_runtimePolicy) + { + case RuntimePolicy::seq: + computeLocalClosestPoints(m_bvh_seq.get(), xferNode); + break; + +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + case RuntimePolicy::omp: + computeLocalClosestPoints(m_bvh_omp.get(), xferNode); +#endif + break; + +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + case RuntimePolicy::cuda: + computeLocalClosestPoints(m_bvh_cuda.get(), xferNode); +#endif + break; + +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + case RuntimePolicy::hip: + computeLocalClosestPoints(m_bvh_hip.get(), xferNode); +#endif + break; + } + } + + /** + Determine the next rank (in ring order) with an object partition + close to the query points in xferNode. The intent is to send + xferNode there next. + */ + int next_recipient(const conduit::Node& xferNode) const + { + int homeRank = xferNode.fetch_existing("homeRank").value(); + BoxType bb; + get_bounding_box_from_conduit_node(bb, xferNode.fetch_existing("aabb")); + for(int i = 1; i < m_nranks; ++i) + { + int maybeNextRecip = (m_rank + i) % m_nranks; + if(maybeNextRecip == homeRank) + { + return maybeNextRecip; + } + double sqDistance = + primal::squared_distance(bb, m_objectPartitionBbs[maybeNextRecip]); + if(sqDistance <= m_sqDistanceThreshold) + { + return maybeNextRecip; + } + } + return -1; + } + + /// Wait for some non-blocking sends (if any) to finish. + void check_send_requests(std::list& isendRequests, + bool atLeastOne) const + { + std::vector reqs; + for(auto& isr : isendRequests) + { + reqs.push_back(isr.m_request); + } + + int inCount = static_cast(reqs.size()); + int outCount = 0; + std::vector indices(reqs.size(), -1); + if(atLeastOne) + { + MPI_Waitsome(inCount, + reqs.data(), + &outCount, + indices.data(), + MPI_STATUSES_IGNORE); + } + else + { + MPI_Testsome(inCount, + reqs.data(), + &outCount, + indices.data(), + MPI_STATUSES_IGNORE); + } + indices.resize(outCount); + + auto reqIter = isendRequests.begin(); + int prevIdx = 0; + for(const int idx : indices) + { + for(; prevIdx < idx; ++prevIdx) + { + ++reqIter; + } + reqIter = isendRequests.erase(reqIter); + ++prevIdx; + } + } + + // Note: following should be private, but nvcc complains about lambdas in private scope +public: + /// Templated implementation of generateBVHTree function + template + bool generateBVHTreeImpl(BVHTreeType* bvh) + { + using ExecSpace = typename BVHTreeType::ExecSpaceType; + + SLIC_ASSERT(bvh != nullptr); + + const int npts = m_objectPtCoords.size(); + axom::Array boxesArray(npts, npts, m_allocatorID); + auto boxesView = boxesArray.view(); + auto pointsView = m_objectPtCoords.view(); + + axom::for_all( + npts, + AXOM_LAMBDA(axom::IndexType i) { boxesView[i] = BoxType {pointsView[i]}; }); + + // Build bounding volume hierarchy + bvh->setAllocatorID(m_allocatorID); + int result = bvh->initialize(boxesView, npts); + + gatherBVHRoots(); + + return (result == spin::BVH_BUILD_OK); + } + + template + void computeLocalClosestPoints(const BVHTreeType* bvh, + conduit::Node& xferNode) const + { + using ExecSpace = typename BVHTreeType::ExecSpaceType; + using axom::primal::squared_distance; + + // Note: There is some additional computation the first time this function + // is called for a query node, even if the local object mesh is empty + const bool hasObjectPoints = m_objectPtCoords.size() > 0; + const bool is_first = xferNode.has_path("is_first"); + if(!hasObjectPoints && !is_first) + { + return; + } + conduit::Node& xferDoms = xferNode["xferDoms"]; + for(conduit::Node& xferDom : xferDoms.children()) + { + // --- Set up arrays and views in the execution space + // Arrays are initialized in that execution space the first time + // they are processed and are copied in during subsequent + // processing + + // Check dimension and extract the number of points + SLIC_ASSERT(xferDom.fetch_existing("dim").as_int() == DIM); + const int qPtCount = xferDom.fetch_existing("qPtCount").value(); + + /// Extract fields from the input node as ArrayViews + auto queryPts = + ArrayView_from_Node(xferDom.fetch_existing("coords"), + qPtCount); + auto cpIndexes = + ArrayView_from_Node(xferDom.fetch_existing("cp_index"), + qPtCount); + auto cpDomainIndexes = ArrayView_from_Node( + xferDom.fetch_existing("cp_domain_index"), + qPtCount); + auto cpRanks = + ArrayView_from_Node(xferDom.fetch_existing("cp_rank"), + qPtCount); + auto cpCoords = + ArrayView_from_Node(xferDom.fetch_existing("cp_coords"), + qPtCount); + + /// Create ArrayViews in ExecSpace that are compatible with fields + // This deep-copies host memory in xferDom to device memory. + // TODO: Avoid copying arrays (here and at the end) if both are on the host + auto cp_idx = is_first + ? axom::Array(qPtCount, qPtCount, m_allocatorID) + : axom::Array(cpIndexes, m_allocatorID); + auto cp_domidx = is_first + ? axom::Array(qPtCount, qPtCount, m_allocatorID) + : axom::Array(cpDomainIndexes, m_allocatorID); + auto cp_rank = is_first + ? axom::Array(qPtCount, qPtCount, m_allocatorID) + : axom::Array(cpRanks, m_allocatorID); + + /// PROBLEM: The striding does not appear to be retained by conduit relay + /// We might need to transform it? or to use a single array w/ pointers into it? + auto cp_pos = is_first + ? axom::Array(qPtCount, qPtCount, m_allocatorID) + : axom::Array(cpCoords, m_allocatorID); + + // DEBUG + const bool has_cp_distance = xferDom.has_path("debug/cp_distance"); + auto minDist = has_cp_distance + ? ArrayView_from_Node( + xferDom.fetch_existing("debug/cp_distance"), + qPtCount) + : ArrayView(); + + auto cp_dist = has_cp_distance + ? (is_first ? axom::Array(qPtCount, qPtCount, m_allocatorID) + : axom::Array(minDist, m_allocatorID)) + : axom::Array(0, 0, m_allocatorID); + // END DEBUG + + if(is_first) + { + cp_rank.fill(-1); + cp_idx.fill(-1); + cp_domidx.fill(-1); + const PointType nowhere(std::numeric_limits::signaling_NaN()); + cp_pos.fill(nowhere); + cp_dist.fill(std::numeric_limits::signaling_NaN()); + } + auto query_inds = cp_idx.view(); + auto query_doms = cp_domidx.view(); + auto query_ranks = cp_rank.view(); + auto query_pos = cp_pos.view(); + auto query_min_dist = cp_dist.view(); + + /// Create an ArrayView in ExecSpace that is compatible with queryPts + PointArray execPoints(queryPts, m_allocatorID); + auto query_pts = execPoints.view(); + + if(hasObjectPoints) + { + // Get a device-useable iterator + auto it = bvh->getTraverser(); + const int rank = m_rank; + + double* sqDistThresh = axom::allocate( + 1, + axom::execution_space::allocatorID()); + *sqDistThresh = m_sqDistanceThreshold; + + auto ptCoordsView = m_objectPtCoords.view(); + auto ptDomainIdsView = m_objectPtDomainIds.view(); + + AXOM_PERF_MARK_SECTION( + "ComputeClosestPoints", + axom::for_all( + qPtCount, + AXOM_LAMBDA(std::int32_t idx) mutable { + PointType qpt = query_pts[idx]; + + MinCandidate curr_min {}; + // Preset cur_min to the closest point found so far. + if(query_ranks[idx] >= 0) + { + curr_min.sqDist = squared_distance(qpt, query_pos[idx]); + curr_min.pointIdx = query_inds[idx]; + curr_min.domainIdx = query_doms[idx]; + curr_min.rank = query_ranks[idx]; + } + + auto checkMinDist = [&](std::int32_t current_node, + const std::int32_t* leaf_nodes) { + const int candidate_point_idx = leaf_nodes[current_node]; + const int candidate_domain_idx = + ptDomainIdsView[candidate_point_idx]; + const PointType candidate_pt = ptCoordsView[candidate_point_idx]; + const double sq_dist = squared_distance(qpt, candidate_pt); + + if(sq_dist < curr_min.sqDist) + { + curr_min.sqDist = sq_dist; + curr_min.pointIdx = candidate_point_idx; + curr_min.domainIdx = candidate_domain_idx; + curr_min.rank = rank; + } + }; + + auto traversePredicate = [&](const PointType& p, + const BoxType& bb) -> bool { + auto sqDist = squared_distance(p, bb); + return sqDist <= curr_min.sqDist && sqDist <= sqDistThresh[0]; + }; + + // Traverse the tree, searching for the point with minimum distance. + it.traverse_tree(qpt, checkMinDist, traversePredicate); + + // If modified, update the fields that changed + if(curr_min.rank == rank) + { + query_inds[idx] = curr_min.pointIdx; + query_doms[idx] = curr_min.domainIdx; + query_ranks[idx] = curr_min.rank; + query_pos[idx] = ptCoordsView[curr_min.pointIdx]; + + //DEBUG + if(has_cp_distance) + { + query_min_dist[idx] = sqrt(curr_min.sqDist); + } + } + });); + + axom::deallocate(sqDistThresh); + } + + axom::copy(cpIndexes.data(), + query_inds.data(), + cpIndexes.size() * sizeof(axom::IndexType)); + axom::copy(cpDomainIndexes.data(), + query_doms.data(), + cpDomainIndexes.size() * sizeof(axom::IndexType)); + axom::copy(cpRanks.data(), + query_ranks.data(), + cpRanks.size() * sizeof(axom::IndexType)); + axom::copy(cpCoords.data(), + query_pos.data(), + cpCoords.size() * sizeof(PointType)); + + // DEBUG + if(has_cp_distance) + { + axom::copy(minDist.data(), + query_min_dist.data(), + minDist.size() * sizeof(double)); + } + } + + // Data has now been initialized + if(is_first) + { + xferNode.remove_child("is_first"); + } + } + +private: + RuntimePolicy m_runtimePolicy; + bool m_isVerbose {false}; + double m_sqDistanceThreshold; + int m_allocatorID; + MPI_Comm m_mpiComm; + bool m_mpiCommIsPrivate; + int m_rank; + int m_nranks; + + bool m_outputRank = true; + bool m_outputIndex = true; + bool m_outputDistance = true; + bool m_outputCoords = true; + bool m_outputDomainIndex = true; + + /*! + @brief Object point coordindates array. + + Points from all local object mesh domains are flattened here. + */ + PointArray m_objectPtCoords; + + axom::Array m_objectPtDomainIds; + + /*! @brief Object partition bounding boxes, one per rank. + All are in physical space, not index space. + */ + BoxArray m_objectPartitionBbs; + + std::unique_ptr m_bvh_seq; + +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + std::unique_ptr m_bvh_omp; +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + std::unique_ptr m_bvh_cuda; +#endif + +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + std::unique_ptr m_bvh_hip; +#endif +}; // DistributedClosestPointImpl + +} // namespace internal + +} // end namespace quest +} // end namespace axom + +#endif // QUEST_DISTRIBUTED_CLOSEST_POINT_IMPL_H_ diff --git a/src/axom/quest/detail/MarchingCubesImpl.hpp b/src/axom/quest/detail/MarchingCubesImpl.hpp index aa9b317581..eb46623177 100644 --- a/src/axom/quest/detail/MarchingCubesImpl.hpp +++ b/src/axom/quest/detail/MarchingCubesImpl.hpp @@ -1,15 +1,24 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) +#include "axom/config.hpp" + +// Implementation requires Conduit. +#ifndef AXOM_USE_CONDUIT + #error "MarchingCubesImpl.hpp requires conduit" +#endif +#include "conduit_blueprint.hpp" + #include "axom/core/execution/execution_space.hpp" -#include "axom/quest/MarchingCubes.hpp" -#include "axom/quest/detail/marching_cubes_lookup.hpp" +#include "axom/slic/interface/slic_macros.hpp" +#include "axom/quest/ArrayIndexer.hpp" +#include "axom/quest/MeshViewUtil.hpp" +#include "axom/quest/detail/MarchingCubesSingleDomain.hpp" #include "axom/primal/geometry/Point.hpp" #include "axom/primal/constants.hpp" #include "axom/mint/execution/internal/structured_exec.hpp" -#include "conduit_blueprint.hpp" #include "axom/fmt.hpp" namespace axom @@ -20,36 +29,15 @@ namespace detail { namespace marching_cubes { -template -static void add_to_StackArray(axom::StackArray& a, U b) -{ - for(int d = 0; d < DIM; ++d) - { - a[d] += b; - } -} - -//!@brief Reverse the order of a StackArray. -template -static void reverse(axom::StackArray& a) -{ - for(int d = 0; d < DIM / 2; ++d) - { - std::swap(a[d], a[DIM - 1 - d]); - } - return; -} - /*! @brief Computations for MarchingCubesSingleDomain - Spatial dimension templating is here, to keep out of higher level - classes MarchCubes and MarchingCubesSingleDomain. + Spatial dimension and execution space are here as template + parameters, to keep out of higher level classes MarchingCubes and + MarchingCubesSingleDomain. ExecSpace is the general execution space, like axom::SEQ_EXEC and - axom::CUDA_EXEC<256>. SequentialExecSpace is used for loops that - cannot be parallelized but must access data allocated for ExecSpace. - Use something like axom::SEQ_EXEC or axom::CUDA_EXEC<1>. + axom::CUDA_EXEC<256>. */ template class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase @@ -57,17 +45,50 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase public: using Point = axom::primal::Point; using MIdx = axom::StackArray; + using Indexer = axom::ArrayIndexer; + using FacetIdType = int; using LoopPolicy = typename execution_space::loop_policy; using ReducePolicy = typename execution_space::reduce_policy; +#if defined(AXOM_USE_RAJA) + // Intel oneAPI compiler segfaults with OpenMP RAJA scan + #ifdef __INTEL_LLVM_COMPILER + using ScanPolicy = typename axom::execution_space::loop_policy; + #else + using ScanPolicy = typename axom::execution_space::loop_policy; + #endif +#endif using SequentialLoopPolicy = typename execution_space::loop_policy; static constexpr auto MemorySpace = execution_space::memory_space; + + AXOM_HOST MarchingCubesImpl(int allocatorID, + axom::Array& caseIdsFlat, + axom::Array& crossingFlags, + axom::Array& scannedFlags, + axom::Array& facetIncrs) + : m_allocatorID(allocatorID) + , m_caseIds() + , m_caseIdsIndexer() + , m_caseIdsFlat(caseIdsFlat) + , m_crossingFlags(crossingFlags) + , m_scannedFlags(scannedFlags) + , m_facetIncrs(facetIncrs) + , m_crossingCases(0, 0, m_allocatorID) + , m_crossingParentIds(0, 0, m_allocatorID) + , m_firstFacetIds(0, 0, m_allocatorID) + { + SLIC_ASSERT(caseIdsFlat.getAllocatorID() == allocatorID); + SLIC_ASSERT(crossingFlags.getAllocatorID() == allocatorID); + SLIC_ASSERT(scannedFlags.getAllocatorID() == allocatorID); + SLIC_ASSERT(facetIncrs.getAllocatorID() == allocatorID); + } + /*! @brief Initialize data to a blueprint domain. @param dom Blueprint structured mesh domain - @param coordsetPath Where coordinates are in dom - @param fcnPath Where nodal function is in dom - @param maskPath Where cell mask function is in dom + @param topologyName Name of mesh topology (see blueprint + mesh documentation) + @param maskFieldName Name of integer cell mask function is in dom Set up views to domain data and allocate other data to work on the given domain. @@ -75,77 +96,55 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase The above data from the domain MUST be in a memory space compatible with ExecSpace. */ - AXOM_HOST void initialize(const conduit::Node& dom, - const std::string& coordsetPath, - const std::string& fcnPath, - const std::string& maskPath) override + AXOM_HOST void setDomain(const conduit::Node& dom, + const std::string& topologyName, + const std::string& maskFieldName) override { - clear(); + // Time this due to potentially slow memory allocation + AXOM_PERF_MARK_FUNCTION("MarchingCubesImpl::initialize"); + clearDomain(); - // Data sizes - const conduit::Node& dimsNode = - dom.fetch_existing("topologies/mesh/elements/dims"); - for(int d = 0; d < DIM; ++d) - { - m_bShape[d] = dimsNode[d].as_int(); - } - m_cShape = m_bShape; - reverse(m_cShape); - // This should work but breaks gcc11 on 64-bit linux: - // m_pShape = m_cShape + 1; - m_pShape = m_cShape; - add_to_StackArray(m_pShape, 1); - - m_bStrides[0] = 1; - for(int d = 1; d < DIM; ++d) - { - m_bStrides[d] = m_bStrides[d - 1] * m_bShape[d - 1]; - } + SLIC_ASSERT(conduit::blueprint::mesh::topology::dims(dom.fetch_existing( + axom::fmt::format("topologies/{}", topologyName))) == DIM); - // Domain's node coordinates - { - const conduit::Node& coordValues = - dom.fetch_existing(coordsetPath + "/values"); - const bool isInterleaved = - conduit::blueprint::mcarray::is_interleaved(coordValues); - const int coordSp = isInterleaved ? DIM : 1; - for(int d = 0; d < DIM; ++d) - { - const double* coordsPtr = coordValues[d].as_double_ptr(); - m_coordsViews[d] = - axom::ArrayView(coordsPtr, - m_pShape, - coordSp); - } - } + m_mvu = axom::quest::MeshViewUtil(dom, topologyName); - // Nodal function + m_bShape = m_mvu.getCellShape(); + m_coordsViews = m_mvu.getConstCoordsViews(false); + if(!maskFieldName.empty()) { - auto& fcnValues = dom.fetch_existing(fcnPath + "/values"); - const double* fcnPtr = fcnValues.as_double_ptr(); - m_fcnView = - axom::ArrayView(fcnPtr, m_pShape); + m_maskView = m_mvu.template getConstFieldView(maskFieldName, false); } + } + + AXOM_HOST void setDataParallelism(MarchingCubesDataParallelism dataPar) override + { + constexpr MarchingCubesDataParallelism autoPolicy = + std::is_same::value + ? MarchingCubesDataParallelism::hybridParallel +#if defined(AXOM_USE_OPENMP) && defined(AXOM_USE_RAJA) + : std::is_same::value + ? MarchingCubesDataParallelism::hybridParallel +#endif + : MarchingCubesDataParallelism::fullParallel; - // Mask + m_dataParallelism = dataPar; + + if(m_dataParallelism == axom::quest::MarchingCubesDataParallelism::byPolicy) { - const int* maskPtr = nullptr; - if(!maskPath.empty()) - { - auto& maskValues = dom.fetch_existing(maskPath + "/values"); - maskPtr = maskValues.as_int_ptr(); - } - if(maskPtr) - { - m_maskView = - axom::ArrayView(maskPtr, m_cShape); - } + m_dataParallelism = autoPolicy; } + } - m_caseIds = axom::Array(m_cShape); + /*! + @brief Set the scale field name + @param fcnFieldName Name of nodal function is in dom + */ + void setFunctionField(const std::string& fcnFieldName) override + { + m_fcnView = m_mvu.template getConstFieldView(fcnFieldName, false); } - //!@brief Set a value to find the contour for. void setContourValue(double contourVal) override { m_contourVal = contourVal; @@ -155,34 +154,76 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase @brief Implementation of virtual markCrossings. Virtual methods cannot be templated, so this implementation - delegates to a name templated on DIM. + delegates to an implementation templated on DIM. */ - void markCrossings() override { markCrossings_dim(); } + void markCrossings() override + { + AXOM_PERF_MARK_FUNCTION("MarchingCubesImpl::markCrossings"); + + m_caseIdsFlat.resize(m_mvu.getCellCount(), 0); + m_caseIdsFlat.fill(0); + + // Choose caseIds stride order to match function stride order. + Indexer fcnIndexer(m_fcnView.strides()); + m_caseIdsIndexer.initializeShape(m_bShape, fcnIndexer.slowestDirs()); + m_caseIds = axom::ArrayView( + m_caseIdsFlat.data(), + m_bShape, + m_caseIdsIndexer.strides()); + SLIC_ASSERT_MSG(Indexer(m_caseIds.strides()).getStrideOrder() == + fcnIndexer.getStrideOrder(), + "Mismatched order is inefficient."); + + markCrossings_dim(); + } //!@brief Populate m_caseIds with crossing indices. template typename std::enable_if::type markCrossings_dim() { - m_caseIds.fill(0); - MarkCrossings_Util mcu(m_caseIds, m_fcnView, m_maskView, m_contourVal); + auto order = m_caseIdsIndexer.getStrideOrder(); #if defined(AXOM_USE_RAJA) - RAJA::RangeSegment jRange(0, m_cShape[0]); - RAJA::RangeSegment iRange(0, m_cShape[1]); + RAJA::RangeSegment jRange(0, m_bShape[1]); + RAJA::RangeSegment iRange(0, m_bShape[0]); using EXEC_POL = typename axom::mint::internal::structured_exec::loop2d_policy; - RAJA::kernel( - RAJA::make_tuple(iRange, jRange), - AXOM_LAMBDA(axom::IndexType i, axom::IndexType j) { - mcu.computeCaseId(i, j); - }); + if(int(order) & int(axom::ArrayStrideOrder::COLUMN)) + { + RAJA::kernel( + RAJA::make_tuple(iRange, jRange), + AXOM_LAMBDA(axom::IndexType i, axom::IndexType j) { + mcu.computeCaseId(i, j); + }); + } + else + { + RAJA::kernel( + RAJA::make_tuple(jRange, iRange), + AXOM_LAMBDA(axom::IndexType j, axom::IndexType i) { + mcu.computeCaseId(i, j); + }); + } #else - for(int j = 0; j < m_cShape[0]; ++j) + if(int(order) & int(axom::ArrayStrideOrder::COLUMN)) { - for(int i = 0; i < m_cShape[1]; ++i) + for(int j = 0; j < m_bShape[1]; ++j) { - mcu.computeCaseId(i, j); + for(int i = 0; i < m_bShape[0]; ++i) + { + mcu.computeCaseId(i, j); + } + } + } + else + { + for(int i = 0; i < m_bShape[0]; ++i) + { + for(int j = 0; j < m_bShape[1]; ++j) + { + mcu.computeCaseId(i, j); + } } } #endif @@ -192,29 +233,56 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase template typename std::enable_if::type markCrossings_dim() { - m_caseIds.fill(0); - MarkCrossings_Util mcu(m_caseIds, m_fcnView, m_maskView, m_contourVal); + auto order = m_caseIdsIndexer.getStrideOrder(); + // order ^= axom::ArrayStrideOrder::BOTH; // Pick wrong ordering to test behavior. #if defined(AXOM_USE_RAJA) - RAJA::RangeSegment kRange(0, m_cShape[0]); - RAJA::RangeSegment jRange(0, m_cShape[1]); - RAJA::RangeSegment iRange(0, m_cShape[2]); + RAJA::RangeSegment kRange(0, m_bShape[2]); + RAJA::RangeSegment jRange(0, m_bShape[1]); + RAJA::RangeSegment iRange(0, m_bShape[0]); using EXEC_POL = typename axom::mint::internal::structured_exec::loop3d_policy; - RAJA::kernel( - RAJA::make_tuple(iRange, jRange, kRange), - AXOM_LAMBDA(axom::IndexType i, axom::IndexType j, axom::IndexType k) { - mcu.computeCaseId(i, j, k); - }); + if(int(order) & int(axom::ArrayStrideOrder::COLUMN)) + { + RAJA::kernel( + RAJA::make_tuple(iRange, jRange, kRange), + AXOM_LAMBDA(axom::IndexType i, axom::IndexType j, axom::IndexType k) { + mcu.computeCaseId(i, j, k); + }); + } + else + { + RAJA::kernel( + RAJA::make_tuple(kRange, jRange, iRange), + AXOM_LAMBDA(axom::IndexType k, axom::IndexType j, axom::IndexType i) { + mcu.computeCaseId(i, j, k); + }); + } #else - for(int k = 0; k < m_cShape[0]; ++k) + if(int(order) & int(axom::ArrayStrideOrder::COLUMN)) { - for(int j = 0; j < m_cShape[1]; ++j) + for(int k = 0; k < m_bShape[2]; ++k) { - for(int i = 0; i < m_cShape[2]; ++i) + for(int j = 0; j < m_bShape[1]; ++j) { - mcu.computeCaseId(i, j, k); + for(int i = 0; i < m_bShape[0]; ++i) + { + mcu.computeCaseId(i, j, k); + } + } + } + } + else + { + for(int i = 0; i < m_bShape[0]; ++i) + { + for(int j = 0; j < m_bShape[1]; ++j) + { + for(int k = 0; k < m_bShape[2]; ++k) + { + mcu.computeCaseId(i, j, k); + } } } } @@ -232,11 +300,11 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase axom::ArrayView fcnView; axom::ArrayView maskView; double contourVal; - MarkCrossings_Util(axom::Array& caseIds, + MarkCrossings_Util(axom::ArrayView& caseIds, axom::ArrayView& fcnView_, axom::ArrayView& maskView_, double contourVal_) - : caseIdsView(caseIds.view()) + : caseIdsView(caseIds) , fcnView(fcnView_) , maskView(maskView_) , contourVal(contourVal_) @@ -261,17 +329,17 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase AXOM_HOST_DEVICE inline typename std::enable_if::type computeCaseId(axom::IndexType i, axom::IndexType j) const { - const bool skipZone = !maskView.empty() && bool(maskView(j, i)); - if(!skipZone) + const bool useZone = maskView.empty() || bool(maskView(i, j)); + if(useZone) { // clang-format off - double nodalValues[CELL_CORNER_COUNT] = - {fcnView(j , i ), - fcnView(j , i + 1), - fcnView(j + 1, i + 1), - fcnView(j + 1, i )}; + double nodalValues[CELL_CORNER_COUNT] = + {fcnView(i , j ), + fcnView(i + 1, j ), + fcnView(i + 1, j + 1), + fcnView(i , j + 1)}; // clang-format on - caseIdsView(j, i) = computeCrossingCase(nodalValues); + caseIdsView(i, j) = computeCrossingCase(nodalValues); } } @@ -280,36 +348,153 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase AXOM_HOST_DEVICE inline typename std::enable_if::type computeCaseId(axom::IndexType i, axom::IndexType j, axom::IndexType k) const { - const bool skipZone = !maskView.empty() && bool(maskView(k, j, i)); - if(!skipZone) + const bool useZone = maskView.empty() || bool(maskView(i, j, k)); + if(useZone) { // clang-format off - double nodalValues[CELL_CORNER_COUNT] = - {fcnView(k , j , i + 1), - fcnView(k , j + 1, i + 1), - fcnView(k , j + 1, i ), - fcnView(k , j , i ), - fcnView(k + 1, j , i + 1), - fcnView(k + 1, j + 1, i + 1), - fcnView(k + 1, j + 1, i ), - fcnView(k + 1, j , i )}; + double nodalValues[CELL_CORNER_COUNT] = + {fcnView(i + 1, j , k ), + fcnView(i + 1, j + 1, k ), + fcnView(i , j + 1, k ), + fcnView(i , j , k ), + fcnView(i + 1, j , k + 1), + fcnView(i + 1, j + 1, k + 1), + fcnView(i , j + 1, k + 1), + fcnView(i , j , k + 1)}; // clang-format on - caseIdsView(k, j, i) = computeCrossingCase(nodalValues); + caseIdsView(i, j, k) = computeCrossingCase(nodalValues); } } }; // MarkCrossings_Util - /*! - @brief Populate the 1D m_crossings array, one entry for each - parent cell that crosses the contour. - - We sum up the number of contour surface cells from the crossings, - allocate space, then populate it. - */ void scanCrossings() override { + AXOM_PERF_MARK_FUNCTION("MarchingCubesImpl::scanCrossings"); + if(m_dataParallelism == + axom::quest::MarchingCubesDataParallelism::hybridParallel) + { + AXOM_PERF_MARK_SECTION("MarchingCubesImpl::scanCrossings:hybridParallel", + scanCrossings_hybridParallel();); + } + else if(m_dataParallelism == + axom::quest::MarchingCubesDataParallelism::fullParallel) + { + AXOM_PERF_MARK_SECTION("MarchingCubesImpl::scanCrossings:fullParallel", + scanCrossings_fullParallel();); + } + } + + void allocateIndexLists() + { + AXOM_PERF_MARK_FUNCTION("MarchingCubesImpl::allocateIndexLists"); + m_crossingParentIds.resize(m_crossingCount, 0); + m_crossingCases.resize(m_crossingCount, 0); + m_facetIncrs.resize(m_crossingCount, 0); + m_firstFacetIds.resize(1 + m_crossingCount, 0); + } + + void scanCrossings_fullParallel() + { + const axom::IndexType parentCellCount = m_caseIds.size(); + auto caseIdsView = m_caseIds; + + // + // Initialize m_crossingFlags, prefix-sum it, and count the + // crossings. + // + + m_crossingFlags.resize(m_mvu.getCellCount(), 0); + m_scannedFlags.resize(1 + m_mvu.getCellCount(), 0); + + auto crossingFlagsView = m_crossingFlags.view(); + AXOM_PERF_MARK_SECTION( + "MarchingCubesImpl::scanCrossings:set_flags", + axom::for_all( + 0, + parentCellCount, + AXOM_LAMBDA(axom::IndexType parentCellId) { + auto numContourCells = + num_contour_cells(caseIdsView.flatIndex(parentCellId)); + crossingFlagsView[parentCellId] = bool(numContourCells); + });); + + m_scannedFlags.fill(0, 1, 0); + AXOM_PERF_MARK_SECTION( + "MarchingCubesImpl::scanCrossings:scan_flags", +#if defined(AXOM_USE_RAJA) + RAJA::inclusive_scan( + RAJA::make_span(m_crossingFlags.data(), parentCellCount), + RAJA::make_span(m_scannedFlags.data() + 1, parentCellCount), + RAJA::operators::plus {}); +#else + for(axom::IndexType n = 0; n < parentCellCount; ++n) { + m_scannedFlags[n + 1] = m_scannedFlags[n] + m_crossingFlags[n]; + } +#endif + ); + + axom::copy(&m_crossingCount, + m_scannedFlags.data() + m_scannedFlags.size() - 1, + sizeof(axom::IndexType)); + + // + // Generate crossing info in compact arrays. + // + allocateIndexLists(); + auto scannedFlagsView = m_scannedFlags.view(); + auto crossingParentIdsView = m_crossingParentIds.view(); + auto crossingCasesView = m_crossingCases.view(); + auto facetIncrsView = m_facetIncrs.view(); + + AXOM_PERF_MARK_SECTION( + "MarchingCubesImpl::scanCrossings:set_incrs", + auto loopBody = + AXOM_LAMBDA(axom::IndexType parentCellId) { + if(scannedFlagsView[parentCellId] != scannedFlagsView[1 + parentCellId]) + { + auto crossingId = scannedFlagsView[parentCellId]; + auto caseId = caseIdsView.flatIndex(parentCellId); + auto facetIncr = num_contour_cells(caseId); + crossingParentIdsView[crossingId] = parentCellId; + crossingCasesView[crossingId] = caseId; + facetIncrsView[crossingId] = facetIncr; + } + }; + axom::for_all(0, parentCellCount, loopBody);); + + // + // Prefix-sum the facets counts to get first facet id for each crossing + // and the total number of facets. + // + + m_firstFacetIds.fill(0, 1, 0); + AXOM_PERF_MARK_SECTION( + "MarchingCubesImpl::scanCrossings:scan_incrs", +#if defined(AXOM_USE_RAJA) + RAJA::inclusive_scan( + RAJA::make_span(m_facetIncrs.data(), m_crossingCount), + RAJA::make_span(m_firstFacetIds.data() + 1, m_crossingCount), + RAJA::operators::plus {}); +#else + for(axom::IndexType n = 0; n < parentCellCount; ++n) { + m_firstFacetIds[n + 1] = m_firstFacetIds[n] + m_facetIncrs[n]; + } +#endif + ); + + axom::copy(&m_facetCount, + m_firstFacetIds.data() + m_firstFacetIds.size() - 1, + sizeof(axom::IndexType)); + // m_firstFacetIds.resize(m_crossingCount); + } + + void scanCrossings_hybridParallel() + { + // + // Compute number of crossings in m_caseIds + // const axom::IndexType parentCellCount = m_caseIds.size(); - auto caseIdsView = m_caseIds.view(); + auto caseIdsView = m_caseIds; #if defined(AXOM_USE_RAJA) RAJA::ReduceSum vsum(0); RAJA::forall( @@ -327,12 +512,13 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase m_crossingCount = vsum; #endif - m_crossings.resize(m_crossingCount, {0, 0}); - axom::ArrayView crossingsView = - m_crossings.view(); - - axom::Array addCells(m_crossingCount, m_crossingCount); - const axom::ArrayView addCellsView = addCells.view(); + // + // Allocate space for crossing info + // + allocateIndexLists(); + auto crossingParentIdsView = m_crossingParentIds.view(); + auto crossingCasesView = m_crossingCases.view(); + auto facetIncrsView = m_facetIncrs.view(); axom::IndexType* crossingId = axom::allocate( 1, @@ -344,18 +530,17 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase auto ccc = num_contour_cells(caseId); if(ccc != 0) { - addCellsView[*crossingId] = ccc; - crossingsView[*crossingId].caseNum = caseId; - crossingsView[*crossingId].parentCellNum = n; + crossingParentIdsView[*crossingId] = n; + crossingCasesView[*crossingId] = caseId; + facetIncrsView[*crossingId] = ccc; ++(*crossingId); } }; #if defined(AXOM_USE_RAJA) /* - The m_crossings filling loop isn't data-parallel and shouldn't - be parallelized. This contrived RAJA::forall forces it to run - sequentially. + loopBody isn't data-parallel and shouldn't be parallelized. + This contrived RAJA::forall forces it to run sequentially. */ RAJA::forall( RAJA::RangeSegment(0, 1), @@ -365,7 +550,6 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase { loopBody(n); } - // assert(*crossingId == m_crossingCount); }); #else *crossingId = 0; @@ -378,104 +562,128 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase axom::deallocate(crossingId); - axom::Array prefixSum(m_crossingCount, - m_crossingCount); - const axom::ArrayView prefixSumView = - prefixSum.view(); + m_firstFacetIds.fill(0, 1, 0); - auto copyFirstSurfaceCellId = AXOM_LAMBDA(axom::IndexType n) - { - crossingsView[n].firstSurfaceCellId = prefixSumView[n]; - }; + const auto firstFacetIdsView = m_firstFacetIds.view(); #if defined(AXOM_USE_RAJA) - RAJA::exclusive_scan( - RAJA::make_span(addCellsView.data(), m_crossingCount), - RAJA::make_span(prefixSumView.data(), m_crossingCount), + RAJA::inclusive_scan( + RAJA::make_span(facetIncrsView.data(), m_crossingCount), + RAJA::make_span(firstFacetIdsView.data() + 1, m_crossingCount), RAJA::operators::plus {}); - RAJA::forall(RAJA::RangeSegment(0, m_crossingCount), - copyFirstSurfaceCellId); #else - if(m_crossingCount > 0) + for(axom::IndexType i = 1; i < 1 + m_crossingCount; ++i) { - prefixSumView[0] = 0; - for(axom::IndexType i = 1; i < m_crossingCount; ++i) - { - prefixSumView[i] = prefixSumView[i - 1] + addCellsView[i - 1]; - } - for(axom::IndexType i = 0; i < m_crossingCount; ++i) - { - copyFirstSurfaceCellId(i); - } + firstFacetIdsView[i] = firstFacetIdsView[i - 1] + facetIncrsView[i - 1]; } #endif + axom::copy(&m_facetCount, + m_firstFacetIds.data() + m_firstFacetIds.size() - 1, + sizeof(axom::IndexType)); + // m_firstFacetIds.resize(m_crossingCount); + } - // Data from the last crossing tells us how many contour cells there are. - if(m_crossings.empty()) - { - m_contourCellCount = 0; - } - else + void computeFacets() override + { + AXOM_PERF_MARK_FUNCTION("MarchingCubesImpl::computeFacets"); + const auto firstFacetIdsView = m_firstFacetIds.view(); + const auto crossingParentIdsView = m_crossingParentIds.view(); + const auto crossingCasesView = m_crossingCases.view(); + + // Internal contour mesh data to populate + axom::ArrayView facetNodeIdsView = m_facetNodeIds; + axom::ArrayView facetNodeCoordsView = m_facetNodeCoords; + axom::ArrayView facetParentIdsView = m_facetParentIds; + const axom::IndexType facetIndexOffset = m_facetIndexOffset; + + ComputeFacets_Util cfu(m_contourVal, m_caseIdsIndexer, m_fcnView, m_coordsViews); + + auto gen_for_parent_cell = AXOM_LAMBDA(axom::IndexType crossingId) { - CrossingInfo back; - axom::copy(&back, - m_crossings.data() + m_crossings.size() - 1, - sizeof(CrossingInfo)); - m_contourCellCount = - back.firstSurfaceCellId + num_contour_cells(back.caseNum); - } + auto parentCellId = crossingParentIdsView[crossingId]; + auto caseId = crossingCasesView[crossingId]; + Point cornerCoords[CELL_CORNER_COUNT]; + double cornerValues[CELL_CORNER_COUNT]; + cfu.get_corner_coords_and_values(parentCellId, cornerCoords, cornerValues); + + auto additionalFacets = + firstFacetIdsView[crossingId + 1] - firstFacetIdsView[crossingId]; + auto firstFacetId = facetIndexOffset + firstFacetIdsView[crossingId]; + + for(axom::IndexType fId = 0; fId < additionalFacets; ++fId) + { + axom::IndexType newFacetId = firstFacetId + fId; + axom::IndexType firstCornerId = newFacetId * DIM; + + facetParentIdsView[newFacetId] = parentCellId; + + for(axom::IndexType d = 0; d < DIM; ++d) + { + axom::IndexType newCornerId = firstCornerId + d; + facetNodeIdsView[newFacetId][d] = newCornerId; + + int edge = cases_table(caseId, fId * DIM + d); + cfu.linear_interp(edge, + cornerCoords, + cornerValues, + &facetNodeCoordsView(newCornerId, 0)); + } + } + }; + + axom::for_all(0, m_crossingCount, gen_for_parent_cell); } /*! - @brief Implementation used by MarchingCubesImpl::computeContour(). + @brief Implementation used by MarchingCubesImpl::computeFacets(). containing just the objects needed for that part, to be made available on devices. */ - struct ComputeContour_Util + struct ComputeFacets_Util { double contourVal; - MIdx bStrides; + axom::ArrayIndexer indexer; axom::ArrayView fcnView; axom::StackArray, DIM> coordsViews; - ComputeContour_Util( + ComputeFacets_Util( double contourVal_, - const MIdx& bStrides_, + const axom::ArrayIndexer& parentIndexer_, const axom::ArrayView& fcnView_, const axom::StackArray, DIM> coordsViews_) : contourVal(contourVal_) - , bStrides(bStrides_) + , indexer(parentIndexer_) , fcnView(fcnView_) , coordsViews(coordsViews_) { } template AXOM_HOST_DEVICE typename std::enable_if::type - get_corner_coords_and_values(IndexType cellNum, + get_corner_coords_and_values(IndexType parentCellId, Point cornerCoords[], double cornerValues[]) const { const auto& x = coordsViews[0]; const auto& y = coordsViews[1]; - const auto c = multidim_cell_index(cellNum); + const auto c = indexer.toMultiIndex(parentCellId); const auto& i = c[0]; const auto& j = c[1]; // clang-format off - cornerCoords[0] = { x(j , i ), y(j , i ) }; - cornerCoords[1] = { x(j , i + 1), y(j , i + 1) }; - cornerCoords[2] = { x(j + 1, i + 1), y(j + 1, i + 1) }; - cornerCoords[3] = { x(j + 1, i ), y(j + 1, i ) }; - - cornerValues[0] = fcnView(j , i ); - cornerValues[1] = fcnView(j , i + 1); - cornerValues[2] = fcnView(j + 1, i + 1); - cornerValues[3] = fcnView(j + 1, i ); + cornerCoords[0] = { x(i , j ), y(i , j ) }; + cornerCoords[1] = { x(i+1, j ), y(i+1, j ) }; + cornerCoords[2] = { x(i+1, j+1), y(i+1, j+1) }; + cornerCoords[3] = { x(i , j+1), y(i , j+1) }; + + cornerValues[0] = fcnView(i , j ); + cornerValues[1] = fcnView(i+1, j ); + cornerValues[2] = fcnView(i+1, j+1); + cornerValues[3] = fcnView(i , j+1); // clang-format on } template AXOM_HOST_DEVICE typename std::enable_if::type - get_corner_coords_and_values(IndexType cellNum, + get_corner_coords_and_values(IndexType parentCellId, Point cornerCoords[], double cornerValues[]) const { @@ -483,29 +691,29 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase const auto& y = coordsViews[1]; const auto& z = coordsViews[2]; - const auto c = multidim_cell_index(cellNum); + const auto c = indexer.toMultiIndex(parentCellId); const auto& i = c[0]; const auto& j = c[1]; const auto& k = c[2]; // clang-format off - cornerCoords[0] = { x(k , j , i+1), y(k , j , i+1), z(k , j , i+1) }; - cornerCoords[1] = { x(k , j+1, i+1), y(k , j+1, i+1), z(k , j+1, i+1) }; - cornerCoords[2] = { x(k , j+1, i ), y(k , j+1, i ), z(k , j+1, i ) }; - cornerCoords[3] = { x(k , j , i ), y(k , j , i ), z(k , j , i ) }; - cornerCoords[4] = { x(k+1, j , i+1), y(k+1, j , i+1), z(k+1, j , i+1) }; - cornerCoords[5] = { x(k+1, j+1, i+1), y(k+1, j+1, i+1), z(k+1, j+1, i+1) }; - cornerCoords[6] = { x(k+1, j+1, i ), y(k+1, j+1, i ), z(k+1, j+1, i ) }; - cornerCoords[7] = { x(k+1, j , i ), y(k+1, j , i ), z(k+1, j , i ) }; - - cornerValues[0] = fcnView(k , j , i+1); - cornerValues[1] = fcnView(k , j+1, i+1); - cornerValues[2] = fcnView(k , j+1, i ); - cornerValues[3] = fcnView(k , j , i ); - cornerValues[4] = fcnView(k+1, j , i+1); - cornerValues[5] = fcnView(k+1, j+1, i+1); - cornerValues[6] = fcnView(k+1, j+1, i ); - cornerValues[7] = fcnView(k+1, j , i ); + cornerCoords[0] = { x(i+1, j , k ), y(i+1, j , k ), z(i+1, j , k ) }; + cornerCoords[1] = { x(i+1, j+1, k ), y(i+1, j+1, k ), z(i+1, j+1, k ) }; + cornerCoords[2] = { x(i , j+1, k ), y(i , j+1, k ), z(i , j+1, k ) }; + cornerCoords[3] = { x(i , j , k ), y(i , j , k ), z(i , j , k ) }; + cornerCoords[4] = { x(i+1, j , k+1), y(i+1, j , k+1), z(i+1, j , k+1) }; + cornerCoords[5] = { x(i+1, j+1, k+1), y(i+1, j+1, k+1), z(i+1, j+1, k+1) }; + cornerCoords[6] = { x(i , j+1, k+1), y(i , j+1, k+1), z(i , j+1, k+1) }; + cornerCoords[7] = { x(i , j , k+1), y(i , j , k+1), z(i , j , k+1) }; + + cornerValues[0] = fcnView(i+1, j , k ); + cornerValues[1] = fcnView(i+1, j+1, k ); + cornerValues[2] = fcnView(i , j+1, k ); + cornerValues[3] = fcnView(i , j , k ); + cornerValues[4] = fcnView(i+1, j , k+1); + cornerValues[5] = fcnView(i+1, j+1, k+1); + cornerValues[6] = fcnView(i , j+1, k+1); + cornerValues[7] = fcnView(i , j , k+1); // clang-format on } @@ -515,7 +723,7 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase int edgeIdx, const Point cornerCoords[4], const double nodeValues[4], - Point& crossingPt) const + double* /* Point& */ crossingPt) const { // STEP 0: get the edge node indices // 2 nodes define the edge. n1 and n2 are the indices of @@ -536,13 +744,15 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase if(axom::utilities::isNearlyEqual(contourVal, f1) || axom::utilities::isNearlyEqual(f1, f2)) { - crossingPt = p1; + crossingPt[0] = p1[0]; + crossingPt[1] = p1[1]; // crossingPt = p1; return; } if(axom::utilities::isNearlyEqual(contourVal, f2)) { - crossingPt = p2; + crossingPt[0] = p2[0]; + crossingPt[1] = p2[1]; // crossingPt = p2; return; } @@ -562,7 +772,7 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase int edgeIdx, const Point cornerCoords[8], const double nodeValues[8], - Point& crossingPt) const + double* /* Point& */ crossingPt) const { // STEP 0: get the edge node indices // 2 nodes define the edge. n1 and n2 are the indices of @@ -589,13 +799,17 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase if(axom::utilities::isNearlyEqual(contourVal, f1) || axom::utilities::isNearlyEqual(f1, f2)) { - crossingPt = p1; + crossingPt[0] = p1[0]; + crossingPt[1] = p1[1]; + crossingPt[2] = p1[2]; // crossingPt = p1; return; } if(axom::utilities::isNearlyEqual(contourVal, f2)) { - crossingPt = p2; + crossingPt[0] = p2[0]; + crossingPt[1] = p2[1]; + crossingPt[2] = p2[2]; // crossingPt = p2; return; } @@ -608,88 +822,15 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase crossingPt[d] = p1[d] + w * (p2[d] - p1[d]); } } - - AXOM_HOST_DEVICE inline axom::StackArray - multidim_cell_index(axom::IndexType flatId) const - { - axom::StackArray rval; - for(int d = DIM - 1; d >= 0; --d) - { - rval[d] = flatId / bStrides[d]; - flatId -= rval[d] * bStrides[d]; - } - return rval; - } - }; // ComputeContour_Util - - void computeContour() override - { - auto crossingsView = m_crossings.view(); - - /* - Reserve contour mesh data space so we can add data without - reallocation. - */ - const axom::IndexType contourNodeCount = DIM * m_contourCellCount; - m_contourNodeCoords.resize(contourNodeCount); - m_contourCellCorners.resize(m_contourCellCount); - m_contourCellParents.resize(m_contourCellCount); - - auto nodeCoordsView = m_contourNodeCoords.view(); - auto cellCornersView = m_contourCellCorners.view(); - auto cellParentsView = m_contourCellParents.view(); - - ComputeContour_Util ccu(m_contourVal, m_bStrides, m_fcnView, m_coordsViews); - - auto loopBody = AXOM_LAMBDA(axom::IndexType iCrossing) - { - const auto& crossingInfo = crossingsView[iCrossing]; - const IndexType crossingCellCount = num_contour_cells(crossingInfo.caseNum); - SLIC_ASSERT(crossingCellCount > 0); - - // Parent cell data for interpolating new node coordinates. - Point cornerCoords[CELL_CORNER_COUNT]; - double cornerValues[CELL_CORNER_COUNT]; - ccu.get_corner_coords_and_values(crossingInfo.parentCellNum, - cornerCoords, - cornerValues); - - /* - Create the new cell and its DIM nodes. New nodes are on - parent cell edges where the edge intersects the isocontour. - linear_interp for the exact coordinates. - - TODO: The varying crossingCellCount value may inhibit device - performance. Try grouping m_crossings items that have the - same values for crossingCellCount. - */ - for(int iCell = 0; iCell < crossingCellCount; ++iCell) - { - IndexType contourCellId = crossingInfo.firstSurfaceCellId + iCell; - cellParentsView[contourCellId] = crossingInfo.parentCellNum; - for(int d = 0; d < DIM; ++d) - { - IndexType contourNodeId = contourCellId * DIM + d; - cellCornersView[contourCellId][d] = contourNodeId; - - const int edge = cases_table(crossingInfo.caseNum, iCell * DIM + d); - ccu.linear_interp(edge, - cornerCoords, - cornerValues, - nodeCoordsView[contourNodeId]); - } - } - }; - axom::for_all(0, m_crossingCount, loopBody); - } + }; // ComputeFacets_Util // These 4 functions provide access to the look-up table // whether on host or device. Is there a more elegant way // to put static 1D and 2D arrays on both host and device? BTNG. template - AXOM_HOST_DEVICE inline typename std::enable_if::type - num_contour_cells(int iCase) const + static AXOM_HOST_DEVICE inline typename std::enable_if::type + num_contour_cells(int iCase) { #define _MC_LOOKUP_NUM_SEGMENTS #include "marching_cubes_lookup.hpp" @@ -699,8 +840,8 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase } template - AXOM_HOST_DEVICE inline typename std::enable_if::type - cases_table(int iCase, int iEdge) const + static AXOM_HOST_DEVICE inline typename std::enable_if::type + cases_table(int iCase, int iEdge) { #define _MC_LOOKUP_CASES2D #include "marching_cubes_lookup.hpp" @@ -710,8 +851,8 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase } template - AXOM_HOST_DEVICE inline typename std::enable_if::type - num_contour_cells(int iCase) const + static AXOM_HOST_DEVICE inline typename std::enable_if::type + num_contour_cells(int iCase) { #define _MC_LOOKUP_NUM_TRIANGLES #include "marching_cubes_lookup.hpp" @@ -721,8 +862,8 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase } template - AXOM_HOST_DEVICE inline typename std::enable_if::type - cases_table(int iCase, int iEdge) const + static AXOM_HOST_DEVICE inline typename std::enable_if::type + cases_table(int iCase, int iEdge) { #define _MC_LOOKUP_CASES3D #include "marching_cubes_lookup.hpp" @@ -731,112 +872,6 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase return cases3D[iCase][iEdge]; } - /*! - @brief Compute multidimensional index from flat cell index - in domain data. - */ - AXOM_HOST_DEVICE inline axom::StackArray - multidim_cell_index(axom::IndexType flatId) const - { - axom::StackArray rval; - for(int d = DIM - 1; d >= 0; --d) - { - rval[d] = flatId / m_bStrides[d]; - flatId -= rval[d] * m_bStrides[d]; - } - return rval; - } - - /*! - @brief Output contour mesh to a mint::UnstructuredMesh object. - - mint uses host memory. If internal memory isn't on the host, - make a temporary copy of it on the host. - */ - void populateContourMesh( - axom::mint::UnstructuredMesh& mesh, - const std::string& cellIdField) const override - { - auto internalAllocatorID = axom::execution_space::allocatorID(); - auto hostAllocatorID = axom::execution_space::allocatorID(); - if(internalAllocatorID == hostAllocatorID) - { - populateContourMesh(mesh, - cellIdField, - m_contourNodeCoords, - m_contourCellCorners, - m_contourCellParents); - } - else - { - axom::Array contourNodeCoords( - m_contourNodeCoords, - hostAllocatorID); - axom::Array contourCellCorners( - m_contourCellCorners, - hostAllocatorID); - axom::Array contourCellParents( - m_contourCellParents, - hostAllocatorID); - - populateContourMesh(mesh, - cellIdField, - contourNodeCoords, - contourCellCorners, - contourCellParents); - } - } - - void populateContourMesh( - axom::mint::UnstructuredMesh& mesh, - const std::string& cellIdField, - axom::Array contourNodeCoords, - axom::Array contourCellCorners, - axom::Array contourCellParents) const - { - if(!cellIdField.empty() && - !mesh.hasField(cellIdField, axom::mint::CELL_CENTERED)) - { - mesh.createField(cellIdField, - axom::mint::CELL_CENTERED, - DIM); - } - - const axom::IndexType addedCellCount = contourCellCorners.size(); - const axom::IndexType addedNodeCount = contourNodeCoords.size(); - if(addedCellCount != 0) - { - const axom::IndexType priorCellCount = mesh.getNumberOfCells(); - const axom::IndexType priorNodeCount = mesh.getNumberOfNodes(); - mesh.reserveNodes(priorNodeCount + addedNodeCount); - mesh.reserveCells(priorCellCount + addedCellCount); - - mesh.appendNodes((double*)contourNodeCoords.data(), - contourNodeCoords.size()); - for(int n = 0; n < addedCellCount; ++n) - { - MIdx cornerIds = contourCellCorners[n]; - add_to_StackArray(cornerIds, priorNodeCount); - mesh.appendCell(cornerIds); - } - axom::IndexType numComponents = -1; - axom::IndexType* dstPtr = - mesh.getFieldPtr(cellIdField, - axom::mint::CELL_CENTERED, - numComponents); - SLIC_ASSERT(numComponents == DIM); - // Bump corner indices by priorCellCount to avoid indices - // used by other parents domains. - axom::ArrayView> dstView( - (axom::StackArray*)dstPtr, - priorCellCount + addedCellCount); - for(axom::IndexType i = 0; i < addedCellCount; ++i) - { - dstView[priorCellCount + i] = multidim_cell_index(contourCellParents[i]); - } - } - } - //!@brief Compute the case index into cases2D or cases3D. AXOM_HOST_DEVICE inline int compute_crossing_case(const double* f) const { @@ -852,49 +887,34 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase return index; } - //!@brief Clear data so you can rerun with a different contour value. - void clear() - { - m_contourNodeCoords.clear(); - m_contourCellCorners.clear(); - m_contourCellParents.clear(); - m_crossingCount = 0; - m_contourCellCount = 0; - } - /*! @brief Constructor. */ - MarchingCubesImpl() - : m_allocatorID(execution_space::allocatorID()) - , m_crossings(0, 0) - , m_contourNodeCoords(0, 0) - , m_contourCellCorners(0, 0) - , m_contourCellParents(0, 0) - { } + MarchingCubesImpl() { } /*! - @brief Info for a parent cell intersecting the contour surface. + @brief Clear computed data (without deallocating memory). + + After clearing, you can change the field, contour value + and recompute the contour. */ - struct CrossingInfo + void clearDomain() override { - CrossingInfo() { } - CrossingInfo(axom::IndexType parentCellNum_, std::uint16_t caseNum_) - : parentCellNum(parentCellNum_) - , caseNum(caseNum_) - , firstSurfaceCellId(std::numeric_limits::max()) - { } - axom::IndexType parentCellNum; //!< @brief Flat index of parent cell. - std::uint16_t caseNum; //!< @brief Index in cases2D or cases3D - axom::IndexType firstSurfaceCellId; //!< @brief First index for generated cells. - }; + m_caseIdsFlat.clear(); + m_crossingFlags.clear(); + m_scannedFlags.clear(); + m_crossingParentIds.clear(); + m_facetIncrs.clear(); + m_firstFacetIds.clear(); + m_crossingCount = 0; + m_facetCount = 0; + } private: - const int m_allocatorID; //!< @brief ExecSpace-based allocator ID for all internal data - MIdx m_bShape; //!< @brief Blueprint cell data shape. - MIdx m_cShape; //!< @brief Cell-centered array shape for ArrayViews. - MIdx m_pShape; //!< @brief Node-centered array shape for ArrayViews. - MIdx m_bStrides; //!< @brief Strides for m_bShape arrays. + const int m_allocatorID; + + axom::quest::MeshViewUtil m_mvu; + MIdx m_bShape; //!< @brief Blueprint cell data shape. // Views of parent domain data. // DIM coordinate components, each on a DIM-dimensional mesh. @@ -904,37 +924,68 @@ class MarchingCubesImpl : public MarchingCubesSingleDomain::ImplBase axom::ArrayView m_fcnView; axom::ArrayView m_maskView; + /*! + @brief Crossing case for each computational mesh cell. + + This is a multidim view into 1D data from m_caseIdsFlat, + set up with help from m_caseIdsIndexer. + */ + axom::ArrayView m_caseIds; + /*! + @brief Multidim indexer to handle data ordering in + m_caseIdsFlat. + + We want caseIds ordering to match m_fcnView, but Array + only supports column-major ordering currently. To control + the order, we put caseIds in a 1D array and construct a + multidim view with the ordering we want. + */ + axom::ArrayIndexer m_caseIdsIndexer; + + // Array references refer to shared Arrays in MarchingCubes. + //!@brief Crossing case for each computational mesh cell. - axom::Array m_caseIds; + axom::Array& m_caseIdsFlat; - //!@brief Info on every parent cell that crosses the contour surface. - axom::Array m_crossings; + //!@brief Whether a parent cell crosses the contour. + axom::Array& m_crossingFlags; + + //!@brief Prefix sum of m_crossingFlags + axom::Array& m_scannedFlags; + + //!@brief Number of surface mesh facets added by each crossing. + axom::Array& m_facetIncrs; //!@brief Number of parent cells crossing the contour surface. axom::IndexType m_crossingCount = 0; - //!@brief Number of contour surface cells from crossings. - axom::IndexType m_contourCellCount = 0; - axom::IndexType getContourCellCount() const override - { - return m_contourCellCount; - } - //!@brief Number of corners (nodes) on each parent cell. - static constexpr std::uint8_t CELL_CORNER_COUNT = (DIM == 3) ? 8 : 4; + //!@brief Number of contour surface cells from all crossings. + axom::IndexType m_facetCount = 0; + axom::IndexType getContourCellCount() const override { return m_facetCount; } - //!@name Internal representation of generated contour mesh. - //@{ - //!@brief Coordinates of generated surface mesh nodes. - axom::Array m_contourNodeCoords; + //!@brief Case ids for found crossings. + axom::Array m_crossingCases; - //!@brief Corners (index into m_contourNodeCoords) of generated contour cells. - axom::Array m_contourCellCorners; + //!@brief Parent cell id (flat index into m_caseIds) for each crossing. + axom::Array m_crossingParentIds; - //!@brief Flat index of computational cell crossing the contour cell. - axom::Array m_contourCellParents; - //@} + //!@brief First index of facets for each crossing. + axom::Array m_firstFacetIds; + + //!@brief Number of corners (nodes) on each parent cell. + static constexpr std::uint8_t CELL_CORNER_COUNT = (DIM == 3) ? 8 : 4; double m_contourVal = 0.0; + + axom::StackArray emptyShape() + { + axom::StackArray rval; + for(int d = 0; d < DIM; ++d) + { + rval[d] = 0; + } + return rval; + } }; } // end namespace marching_cubes diff --git a/src/axom/quest/detail/MarchingCubesSingleDomain.cpp b/src/axom/quest/detail/MarchingCubesSingleDomain.cpp new file mode 100644 index 0000000000..b450a3774c --- /dev/null +++ b/src/axom/quest/detail/MarchingCubesSingleDomain.cpp @@ -0,0 +1,196 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include "axom/config.hpp" + +// Implementation requires Conduit. +#ifndef AXOM_USE_CONDUIT + #error "MarchingCubes.cpp requires conduit" +#endif +#include "conduit_blueprint.hpp" + +#include "axom/core/execution/execution_space.hpp" +#include "axom/quest/detail/MarchingCubesSingleDomain.hpp" +#include "axom/quest/detail/MarchingCubesImpl.hpp" +#include "axom/fmt.hpp" + +namespace axom +{ +namespace quest +{ +namespace detail +{ +namespace marching_cubes +{ +MarchingCubesSingleDomain::MarchingCubesSingleDomain(MarchingCubes& mc) + : m_mc(mc) + , m_runtimePolicy(mc.m_runtimePolicy) + , m_allocatorID(mc.m_allocatorID) + , m_dataParallelism(mc.m_dataParallelism) + , m_dom(nullptr) + , m_ndim(0) + , m_topologyName() + , m_fcnFieldName() + , m_fcnPath() + , m_maskFieldName() + , m_maskPath() +{ + return; +} + +void MarchingCubesSingleDomain::setDomain(const conduit::Node& dom, + const std::string& topologyName, + const std::string& maskField) +{ + m_topologyName = topologyName; + + SLIC_ASSERT_MSG(!conduit::blueprint::mesh::is_multi_domain(dom), + "Internal error. Attempt to set a multi-domain mesh in " + "MarchingCubesSingleDomain."); + SLIC_ASSERT( + dom.fetch_existing("topologies/" + m_topologyName + "/type").as_string() == + "structured"); + + const std::string coordsetPath = "coordsets/" + + dom.fetch_existing("topologies/" + m_topologyName + "/coordset").as_string(); + SLIC_ASSERT(dom.has_path(coordsetPath)); + + if(!m_maskPath.empty()) + { + m_maskPath = maskField.empty() ? std::string() : "fields/" + maskField; + SLIC_ASSERT(dom.has_path(m_maskPath + "/values")); + } + else + { + m_maskPath.clear(); + } + + m_dom = &dom; + + m_ndim = conduit::blueprint::mesh::topology::dims( + dom.fetch_existing(axom::fmt::format("topologies/{}", m_topologyName))); + SLIC_ASSERT(m_ndim >= 2 && m_ndim <= 3); + + SLIC_ASSERT_MSG( + !conduit::blueprint::mcarray::is_interleaved( + dom.fetch_existing(coordsetPath + "/values")), + "MarchingCubes currently requires contiguous coordinates layout."); + + m_impl = newMarchingCubesImpl(); + + m_impl->setDomain(dom, topologyName, maskField); + m_impl->setDataParallelism(m_dataParallelism); +} + +/*! + @brief Allocate a MarchingCubesImpl object, template-specialized + for caller-specified runtime policy and physical dimension. +*/ +std::unique_ptr +MarchingCubesSingleDomain::newMarchingCubesImpl() +{ + SLIC_ASSERT(m_ndim >= 2 && m_ndim <= 3); + std::unique_ptr impl; + if(m_runtimePolicy == MarchingCubes::RuntimePolicy::seq) + { + impl = m_ndim == 2 + ? std::unique_ptr( + new MarchingCubesImpl<2, axom::SEQ_EXEC, axom::SEQ_EXEC>( + m_mc.m_allocatorID, + m_mc.m_caseIdsFlat, + m_mc.m_crossingFlags, + m_mc.m_scannedFlags, + m_mc.m_facetIncrs)) + : std::unique_ptr( + new MarchingCubesImpl<3, axom::SEQ_EXEC, axom::SEQ_EXEC>( + m_mc.m_allocatorID, + m_mc.m_caseIdsFlat, + m_mc.m_crossingFlags, + m_mc.m_scannedFlags, + m_mc.m_facetIncrs)); + } +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + else if(m_runtimePolicy == MarchingCubes::RuntimePolicy::omp) + { + impl = m_ndim == 2 + ? std::unique_ptr( + new MarchingCubesImpl<2, axom::OMP_EXEC, axom::SEQ_EXEC>( + m_mc.m_allocatorID, + m_mc.m_caseIdsFlat, + m_mc.m_crossingFlags, + m_mc.m_scannedFlags, + m_mc.m_facetIncrs)) + : std::unique_ptr( + new MarchingCubesImpl<3, axom::OMP_EXEC, axom::SEQ_EXEC>( + m_mc.m_allocatorID, + m_mc.m_caseIdsFlat, + m_mc.m_crossingFlags, + m_mc.m_scannedFlags, + m_mc.m_facetIncrs)); + } +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + else if(m_runtimePolicy == MarchingCubes::RuntimePolicy::cuda) + { + impl = m_ndim == 2 + ? std::unique_ptr( + new MarchingCubesImpl<2, axom::CUDA_EXEC<256>, axom::CUDA_EXEC<1>>( + m_mc.m_allocatorID, + m_mc.m_caseIdsFlat, + m_mc.m_crossingFlags, + m_mc.m_scannedFlags, + m_mc.m_facetIncrs)) + : std::unique_ptr( + new MarchingCubesImpl<3, axom::CUDA_EXEC<256>, axom::CUDA_EXEC<1>>( + m_mc.m_allocatorID, + m_mc.m_caseIdsFlat, + m_mc.m_crossingFlags, + m_mc.m_scannedFlags, + m_mc.m_facetIncrs)); + } +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + else if(m_runtimePolicy == MarchingCubes::RuntimePolicy::hip) + { + impl = m_ndim == 2 + ? std::unique_ptr( + new MarchingCubesImpl<2, axom::HIP_EXEC<256>, axom::HIP_EXEC<1>>( + m_mc.m_allocatorID, + m_mc.m_caseIdsFlat, + m_mc.m_crossingFlags, + m_mc.m_scannedFlags, + m_mc.m_facetIncrs)) + : std::unique_ptr( + new MarchingCubesImpl<3, axom::HIP_EXEC<256>, axom::HIP_EXEC<1>>( + m_mc.m_allocatorID, + m_mc.m_caseIdsFlat, + m_mc.m_crossingFlags, + m_mc.m_scannedFlags, + m_mc.m_facetIncrs)); + } +#endif + else + { + SLIC_ERROR(axom::fmt::format( + "MarchingCubesSingleDomain has no implementation for runtime policy {}", + m_runtimePolicy)); + } + return impl; +} + +int32_t MarchingCubesSingleDomain::getDomainId(int32_t defaultId) const +{ + int rval = defaultId; + if(m_dom->has_path("state/domain_id")) + { + rval = m_dom->fetch_existing("state/domain_id").to_int32(); + } + return rval; +} + +} // namespace marching_cubes +} // namespace detail +} // end namespace quest +} // end namespace axom diff --git a/src/axom/quest/detail/MarchingCubesSingleDomain.hpp b/src/axom/quest/detail/MarchingCubesSingleDomain.hpp new file mode 100644 index 0000000000..007e3ce7dd --- /dev/null +++ b/src/axom/quest/detail/MarchingCubesSingleDomain.hpp @@ -0,0 +1,257 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +/*! + * \file MarchingCubesSingleDomain.hpp + * + * \brief Consists of classes implementing marching cubes algorithm to + * compute isocontour from a scalar field in a blueprint mesh. + */ + +#ifndef AXOM_QUEST_MARCHINGCUBESSINGLEDOMAIN_H_ +#define AXOM_QUEST_MARCHINGCUBESSINGLEDOMAIN_H_ + +#include "axom/config.hpp" + +// Implementation requires Conduit. +#ifdef AXOM_USE_CONDUIT + + // Axom includes + #include "axom/core/execution/runtime_policy.hpp" + #include "axom/mint/mesh/UnstructuredMesh.hpp" + #include "axom/quest/MarchingCubes.hpp" + + // Conduit includes + #include "conduit_node.hpp" + + // C++ includes + #include + +namespace axom +{ +namespace quest +{ +namespace detail +{ +namespace marching_cubes +{ +template +class MarchingCubesImpl; + +/*! + \@brief Class implementing marching cubes algorithm for a single + domain. + + This class is an internal detail for multi-domain implementation + MarchinCubes class, and should not be used outside it. + + \sa MarchingCubes +*/ +class MarchingCubesSingleDomain +{ +public: + using RuntimePolicy = axom::runtime_policy::Policy; + /*! + \brief Constructor for applying algorithm in a single domain. + */ + MarchingCubesSingleDomain(MarchingCubes &mc); + + ~MarchingCubesSingleDomain() { } + + /*! + @brief Intitialize object to a domain. + \param [in] dom Blueprint single-domain mesh containing scalar field. + \param [in] topologyName Name of Blueprint topology to use in \a dom + \param [in] maskField Cell-based std::int32_t mask field. If provided, + cells where this field evaluates to false are skipped. + + Array data in \a dom must be accessible in the the \a + runtimePolicy environment in the constructor. It's an error if + not, e.g., using CPU memory with a GPU policy. + + Some data from \a dom may be cached by the constructor. Any + change to it without re-initialization leads to undefined + behavior. + + The mesh coordinates should be stored contiguously. See + conduit::blueprint::is_contiguous(). In the future, this + requirement may be relaxed, possibly at the cost of a + transformation and storage of the temporary contiguous layout. + */ + void setDomain(const conduit::Node &dom, + const std::string &topologyName, + const std::string &maskfield); + + int spatialDimension() const { return m_ndim; } + + /*! + @brief Specify the field containing the nodal scalar function + in the input mesh. + \param [in] fcnField Name of node-based scalar function values. + */ + void setFunctionField(const std::string &fcnField) + { + m_fcnFieldName = fcnField; + m_fcnPath = "fields/" + fcnField; + SLIC_ASSERT(m_dom->has_path(m_fcnPath)); + SLIC_ASSERT(m_dom->fetch_existing(m_fcnPath + "/association").as_string() == + "vertex"); + SLIC_ASSERT(m_dom->has_path(m_fcnPath + "/values")); + m_impl->setFunctionField(fcnField); + } + + void setContourValue(double contourVal) + { + m_contourVal = contourVal; + if(m_impl) m_impl->setContourValue(m_contourVal); + } + + // Methods trivially delegated to implementation. + void markCrossings() { m_impl->markCrossings(); } + void scanCrossings() { m_impl->scanCrossings(); } + void computeFacets() { m_impl->computeFacets(); } + + /*! + @brief Get the Blueprint domain id specified in \a state/domain_id + if it is provided, or use the given default if not provided. + */ + int32_t getDomainId(int32_t defaultId) const; + + //!@brief Get number of cells in the generated contour mesh. + axom::IndexType getContourCellCount() const + { + return m_impl->getContourCellCount(); + } + + //!@brief Get number of nodes in the generated contour mesh. + axom::IndexType getContourNodeCount() const + { + return m_ndim * getContourCellCount(); + } + + /*! + @brief Base class for implementations templated on dimension DIM + and execution space ExecSpace. + + Implementation details templated on DIM and ExecSpace cannot + be in MarchingCubesSingleDomain so should live in this class. + + This class allows m_impl to refer to any implementation used + at runtime. + */ + struct ImplBase + { + /*! + @brief Prepare internal data for operating on the given domain. + + Put in here codes that can't be in MarchingCubesSingleDomain + due to template use (DIM and ExecSpace). + */ + virtual void setDomain(const conduit::Node &dom, + const std::string &topologyName, + const std::string &maskPath = {}) = 0; + + virtual void setFunctionField(const std::string &fcnFieldName) = 0; + virtual void setContourValue(double contourVal) = 0; + + virtual void setDataParallelism(MarchingCubesDataParallelism dataPar) = 0; + + //@{ + //!@name Distinct phases in contour generation. + //!@brief Compute the contour mesh. + //!@brief Mark parent cells that cross the contour value. + virtual void markCrossings() = 0; + //!@brief Scan operations to determine counts and offsets. + virtual void scanCrossings() = 0; + //!@brief Compute contour data. + virtual void computeFacets() = 0; + //@} + + //@{ + //!@name Output methods + //!@brief Return number of contour mesh facets generated. + virtual axom::IndexType getContourCellCount() const = 0; + //@} + + void setOutputBuffers(axom::ArrayView &facetNodeIds, + axom::ArrayView &facetNodeCoords, + axom::ArrayView &facetParentIds, + axom::IndexType facetIndexOffset) + { + m_facetNodeIds = facetNodeIds; + m_facetNodeCoords = facetNodeCoords; + m_facetParentIds = facetParentIds; + m_facetIndexOffset = facetIndexOffset; + } + + virtual ~ImplBase() { } + + virtual void clearDomain() = 0; + + MarchingCubesDataParallelism m_dataParallelism = + MarchingCubesDataParallelism::byPolicy; + + double m_contourVal = 0.0; + axom::ArrayView m_facetNodeIds; + axom::ArrayView m_facetNodeCoords; + axom::ArrayView m_facetParentIds; + axom::IndexType m_facetIndexOffset = -1; + }; + + ImplBase &getImpl() { return *m_impl; } + +private: + //!@brief Multi-domain implementation this object is under. + MarchingCubes &m_mc; + + RuntimePolicy m_runtimePolicy; + int m_allocatorID = axom::INVALID_ALLOCATOR_ID; + + //@brief Choice of full or partial data-parallelism, or byPolicy. + MarchingCubesDataParallelism m_dataParallelism = + MarchingCubesDataParallelism::byPolicy; + + /*! + \brief Computational mesh as a conduit::Node. + */ + const conduit::Node *m_dom; + int m_ndim; + + //!@brief Name of Blueprint topology in m_dom. + std::string m_topologyName; + + std::string m_fcnFieldName; + //!@brief Path to nodal scalar function in m_dom. + std::string m_fcnPath; + + std::string m_maskFieldName; + //!@brief Path to mask in m_dom. + std::string m_maskPath; + + double m_contourVal = 0.0; + + std::unique_ptr m_impl; + + /*! + * \brief Set the blueprint single-domain mesh. + * + * Some data from \a dom may be cached. + */ + void setDomain(const conduit::Node &dom); + + /*! + @brief Allocate MarchingCubesImpl object + */ + std::unique_ptr newMarchingCubesImpl(); + +}; // class MarchingCubesSingleDomain + +} // end namespace marching_cubes +} // end namespace detail +} // namespace quest +} // namespace axom + +#endif // AXOM_USE_CONDUIT +#endif // AXOM_QUEST_MARCHINGCUBES_H_ diff --git a/src/axom/quest/detail/MeshTester_detail.hpp b/src/axom/quest/detail/MeshTester_detail.hpp index 483bf1bf97..2a453138ee 100644 --- a/src/axom/quest/detail/MeshTester_detail.hpp +++ b/src/axom/quest/detail/MeshTester_detail.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/PointFinder.hpp b/src/axom/quest/detail/PointFinder.hpp index e710d5ecc1..2c3a1c0612 100644 --- a/src/axom/quest/detail/PointFinder.hpp +++ b/src/axom/quest/detail/PointFinder.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -195,8 +195,14 @@ class PointFinder totalCountReduce += countsPtr[i]; }); - // Step 2: exclusive scan for offsets in candidate array + // Step 2: exclusive scan for offsets in candidate array + // Intel oneAPI compiler segfaults with OpenMP RAJA scan + #ifdef __INTEL_LLVM_COMPILER + using exec_policy = + typename axom::execution_space::loop_policy; + #else using exec_policy = typename axom::execution_space::loop_policy; + #endif RAJA::exclusive_scan(RAJA::make_span(counts.data(), npts), RAJA::make_span(offsets.data(), npts), RAJA::operators::plus {}); diff --git a/src/axom/quest/detail/PointInCellMeshWrapper_mfem.hpp b/src/axom/quest/detail/PointInCellMeshWrapper_mfem.hpp index 1d1837cd3f..76e1e64395 100644 --- a/src/axom/quest/detail/PointInCellMeshWrapper_mfem.hpp +++ b/src/axom/quest/detail/PointInCellMeshWrapper_mfem.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/inout/BlockData.hpp b/src/axom/quest/detail/inout/BlockData.hpp index d8ab99e011..630b820f3d 100644 --- a/src/axom/quest/detail/inout/BlockData.hpp +++ b/src/axom/quest/detail/inout/BlockData.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -438,4 +438,9 @@ template <> struct axom::fmt::formatter : ostream_formatter { }; +/// Overload to format a quest::DynamicGrayBlockData using fmt +template <> +struct axom::fmt::formatter : ostream_formatter +{ }; + #endif // AXOM_QUEST_INOUT_OCTREE_BLOCKDATA__HPP_ diff --git a/src/axom/quest/detail/inout/InOutOctreeMeshDumper.hpp b/src/axom/quest/detail/inout/InOutOctreeMeshDumper.hpp index ff90877fae..6144530ccd 100644 --- a/src/axom/quest/detail/inout/InOutOctreeMeshDumper.hpp +++ b/src/axom/quest/detail/inout/InOutOctreeMeshDumper.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/inout/InOutOctreeStats.hpp b/src/axom/quest/detail/inout/InOutOctreeStats.hpp index 345088591f..75314004d1 100644 --- a/src/axom/quest/detail/inout/InOutOctreeStats.hpp +++ b/src/axom/quest/detail/inout/InOutOctreeStats.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/inout/InOutOctreeValidator.hpp b/src/axom/quest/detail/inout/InOutOctreeValidator.hpp index 5446190444..ac90e72b6f 100644 --- a/src/axom/quest/detail/inout/InOutOctreeValidator.hpp +++ b/src/axom/quest/detail/inout/InOutOctreeValidator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/inout/MeshWrapper.hpp b/src/axom/quest/detail/inout/MeshWrapper.hpp index 3f59018d7f..1f72ab339d 100644 --- a/src/axom/quest/detail/inout/MeshWrapper.hpp +++ b/src/axom/quest/detail/inout/MeshWrapper.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -26,7 +26,7 @@ namespace axom namespace quest { /** - * \brief A utility class that wraps access to the mesh data of and InOutOctree + * \brief A utility class that wraps access to the mesh data of an InOutOctree * * This class helps separate the specifics of accessing the underlying mesh * for an InOutOctree. It is customized for unstructured Segment meshes in 2D diff --git a/src/axom/quest/detail/marching_cubes_lookup.hpp b/src/axom/quest/detail/marching_cubes_lookup.hpp index 05c3bb2c72..feb1d36195 100644 --- a/src/axom/quest/detail/marching_cubes_lookup.hpp +++ b/src/axom/quest/detail/marching_cubes_lookup.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/detail/shaping/shaping_helpers.cpp b/src/axom/quest/detail/shaping/shaping_helpers.cpp index 7694a5ce65..0cac0b8958 100644 --- a/src/axom/quest/detail/shaping/shaping_helpers.cpp +++ b/src/axom/quest/detail/shaping/shaping_helpers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -30,8 +30,8 @@ void replaceMaterial(mfem::QuadratureFunction* shapeQFunc, SLIC_ASSERT(materialQFunc->Size() == shapeQFunc->Size()); const int SZ = materialQFunc->Size(); - double* mData = materialQFunc->GetData(); - double* sData = shapeQFunc->GetData(); + double* mData = materialQFunc->HostReadWrite(); + double* sData = shapeQFunc->HostReadWrite(); if(shapeReplacesMaterial) { @@ -61,8 +61,8 @@ void copyShapeIntoMaterial(const mfem::QuadratureFunction* shapeQFunc, SLIC_ASSERT(materialQFunc->Size() == shapeQFunc->Size()); const int SZ = materialQFunc->Size(); - double* mData = materialQFunc->GetData(); - const double* sData = shapeQFunc->GetData(); + double* mData = materialQFunc->HostReadWrite(); + const double* sData = shapeQFunc->HostRead(); // When reuseExisting, don't reset material values; otherwise, just copy values over if(reuseExisting) @@ -114,9 +114,11 @@ void generatePositionsQFunction(mfem::Mesh* mesh, const int nq = ir.GetNPoints(); const auto* geomFactors = mesh->GetGeometricFactors(ir, mfem::GeometricFactors::COORDINATES); + geomFactors->X.HostRead(); mfem::QuadratureFunction* pos_coef = new mfem::QuadratureFunction(sp, dim); pos_coef->SetOwnsSpace(true); + pos_coef->HostReadWrite(); // Rearrange positions into quadrature function { @@ -145,10 +147,9 @@ void computeVolumeFractions(const std::string& matField, QFunctionCollection& inoutQFuncs, int outputOrder) { - using axom::utilities::string::rsplitN; + SLIC_ASSERT(axom::utilities::string::startsWith(matField, "mat_inout_")); - auto matName = rsplitN(matField, 2, '_')[1]; - auto volFracName = axom::fmt::format("vol_frac_{}", matName); + const auto volFracName = axom::fmt::format("vol_frac_{}", matField.substr(10)); // Grab a pointer to the inout samples QFunc mfem::QuadratureFunction* inout = inoutQFuncs.Get(matField); @@ -187,6 +188,7 @@ void computeVolumeFractions(const std::string& matField, fes = new mfem::FiniteElementSpace(mesh, fec); volFrac = new mfem::GridFunction(fes); volFrac->MakeOwner(fec); + volFrac->HostReadWrite(); dc->RegisterField(volFracName, volFrac); } @@ -401,6 +403,7 @@ void computeVolumeFractionsIdentity(mfem::DataCollection* dc, mfem::FiniteElementSpace* fes = new mfem::FiniteElementSpace(mesh, fec); mfem::GridFunction* volFrac = new mfem::GridFunction(fes); volFrac->MakeOwner(fec); + volFrac->HostReadWrite(); dc->RegisterField(name, volFrac); (*volFrac) = (*inout); diff --git a/src/axom/quest/detail/shaping/shaping_helpers.hpp b/src/axom/quest/detail/shaping/shaping_helpers.hpp index 34392546f2..4e223e3ab4 100644 --- a/src/axom/quest/detail/shaping/shaping_helpers.hpp +++ b/src/axom/quest/detail/shaping/shaping_helpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/docs/sphinx/all_nearest_neighbors.rst b/src/axom/quest/docs/sphinx/all_nearest_neighbors.rst index fb5b26488f..bb9d7f7e45 100644 --- a/src/axom/quest/docs/sphinx/all_nearest_neighbors.rst +++ b/src/axom/quest/docs/sphinx/all_nearest_neighbors.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/docs/sphinx/check_and_repair.rst b/src/axom/quest/docs/sphinx/check_and_repair.rst index af331ab133..f4d138baac 100644 --- a/src/axom/quest/docs/sphinx/check_and_repair.rst +++ b/src/axom/quest/docs/sphinx/check_and_repair.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/docs/sphinx/index.rst b/src/axom/quest/docs/sphinx/index.rst index fd9a8d91c8..5509de1893 100644 --- a/src/axom/quest/docs/sphinx/index.rst +++ b/src/axom/quest/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/docs/sphinx/isosurface_detection.rst b/src/axom/quest/docs/sphinx/isosurface_detection.rst index 33bcbeaa92..77e494f16b 100644 --- a/src/axom/quest/docs/sphinx/isosurface_detection.rst +++ b/src/axom/quest/docs/sphinx/isosurface_detection.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -78,7 +78,7 @@ size constraints. Any number of domains is allowed, including zero. Blueprint convention allows for named coordinate sets and scalar fields. Here, we tell the ``MarchingCubes`` constructor that the -coordinate set name is "coordset", and the name of the nodal scalar +topology is "mesh", and the name of the nodal scalar field is "scalarFieldName". The constructor's ``quest::MarchingCubesRuntimePolicy::seq`` argument @@ -91,7 +91,7 @@ and HIP. conduit::Node blueprintMesh = blueprint_mesh_from_user(); quest::MarchingCubes mc(quest::MarchingCubesRuntimePolicy::seq, blueprintMesh, - "coordset", + "mesh", "scalarFieldName"); Run the algorithm: diff --git a/src/axom/quest/docs/sphinx/point_in_cell.rst b/src/axom/quest/docs/sphinx/point_in_cell.rst index 1be3919a5b..5f24f70dba 100644 --- a/src/axom/quest/docs/sphinx/point_in_cell.rst +++ b/src/axom/quest/docs/sphinx/point_in_cell.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/docs/sphinx/point_mesh_query.rst b/src/axom/quest/docs/sphinx/point_mesh_query.rst index 29b6887a44..042c10906a 100644 --- a/src/axom/quest/docs/sphinx/point_mesh_query.rst +++ b/src/axom/quest/docs/sphinx/point_mesh_query.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/docs/sphinx/point_mesh_query_cpp.rst b/src/axom/quest/docs/sphinx/point_mesh_query_cpp.rst index dbbedf83d8..e5096a2488 100644 --- a/src/axom/quest/docs/sphinx/point_mesh_query_cpp.rst +++ b/src/axom/quest/docs/sphinx/point_mesh_query_cpp.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/docs/sphinx/read_mesh.rst b/src/axom/quest/docs/sphinx/read_mesh.rst index ef04217035..58a6abea3a 100644 --- a/src/axom/quest/docs/sphinx/read_mesh.rst +++ b/src/axom/quest/docs/sphinx/read_mesh.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -13,10 +13,17 @@ Applications commonly need to read a mesh file from disk. Quest provides the ``STLReader`` class, which can read binary or ASCII `STL`_ files, as well as the ``PSTLReader`` class for use in parallel codes. STL (stereolithography) is a common file format for triangle surface meshes. The STL reader classes -will read the file from disk and build a ``mint::Mesh`` object. +will read the file from disk and build a ``mint::Mesh`` object. Quest also +provides the ``ProEReader`` class, for ASCII Pro/E files containing tetrahedra, +and the ``PProEReader`` class for use in parallel codes. PTC Creo is a modeling +application formerly known as Pro/ENGINEER, and its file format is in use among +Axom's users. .. _STL: https://en.wikipedia.org/wiki/STL_(file_format) +Reading an STL file +------------------- + The code examples are excerpts from the file ``/src/tools/mesh_tester.cpp``. We include the STL reader header @@ -50,3 +57,58 @@ The following example shows usage of the STLReader class: After reading the STL file, the ``STLReader::getMesh`` method gives access to the underlying mesh data. The reader may then be deleted. +Reading a Pro/E file +-------------------- + +As read by Axom, an ASCII Pro/E tet file contains: + +- Zero or more comment lines starting with a ``#`` character +- One line with two integers: the number of nodes ``n`` and the number of + tetrahedra ``t`` +- ``n`` lines, one for each node; each line contains a contiguous integer ID + starting at 1 and three floating-point numbers specifying the node location +- ``t`` lines, one for each tetrahedron; each line contains a contiguous + integer ID starting at 1 and four integers specifying the tet's nodes + +Reading an ASCII Pro/E tet file is similar to reading an STL file. The code +examples are excerpts from the file ``/src/axom/quest/examples/quest_proe_bbox.cpp``. +The Pro/E reader has the ability to read a subset of the mesh in the file, +defined by a user-supplied predicate function. The example code shows how +to use a convenience function to specify a predicate that keeps only tets +fully included in a user-supplied bounding box. + +We include the ProEReader header + +.. literalinclude:: ../../examples/quest_proe_bbox.cpp + :start-after: _read_proe_include1_start + :end-before: _read_proe_include1_end + :language: C++ + +and also the mint Mesh and UnstructuredMesh headers. + +.. literalinclude:: ../../examples/quest_proe_bbox.cpp + :start-after: _read_proe_include2_start + :end-before: _read_proe_include2_end + :language: C++ + +For convenience, we specify some type aliases. + +.. literalinclude:: ../../examples/quest_proe_bbox.cpp + :start-after: _read_proe_typealiases_start + :end-before: _read_proe_typealiases_end + :language: C++ + +The following example shows how to use the ProEReader class. +Calling ``reader.setTetPredFromBoundingBox(bbox, false)``, as shown in the +code, makes a tetrahedron predicate that accepts tets with all four nodes +falling in ``bbox`` and rejects others. Alternately, the user can specify +an arbitrary predicate function with ``setTetPred()``. If the user specifies +no tetrahedron predicate, the reader reads all tets in the file. + +.. literalinclude:: ../../examples/quest_proe_bbox.cpp + :start-after: _read_proe_file_start + :end-before: _read_proe_file_end + :language: C++ + +After reading the Pro/E file, the ``ProEReader::getMesh`` method gives access +to the underlying mesh data. The reader may then be deleted. diff --git a/src/axom/quest/examples/CMakeLists.txt b/src/axom/quest/examples/CMakeLists.txt index 89ccb01662..550f8d5cc1 100644 --- a/src/axom/quest/examples/CMakeLists.txt +++ b/src/axom/quest/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -22,6 +22,76 @@ axom_add_executable( FOLDER axom/quest/examples ) +# BVH two pass example -------------------------------------------------------- +if (RAJA_FOUND AND UMPIRE_FOUND) + axom_add_executable( + NAME quest_bvh_two_pass_ex + SOURCES quest_bvh_two_pass.cpp + OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY} + DEPENDS_ON ${quest_example_depends} + FOLDER axom/quest/examples + ) +endif() + +# Read ProE example ----------------------------------------------------------- +axom_add_executable( + NAME quest_proe_bbox_ex + SOURCES quest_proe_bbox.cpp + OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY} + DEPENDS_ON ${quest_example_depends} + FOLDER axom/quest/examples + ) + +# BVH silo example ------------------------------------------------------------ +if (CONDUIT_FOUND AND RAJA_FOUND AND UMPIRE_FOUND) + axom_add_executable( + NAME quest_candidates_example_ex + SOURCES quest_candidates_example.cpp + OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY} + DEPENDS_ON ${quest_example_depends} conduit::conduit + FOLDER axom/quest/examples + ) + + # Add unit tests + if(AXOM_ENABLE_TESTS AND AXOM_DATA_DIR) + + # Run the candidates example with the different spatial indices + # and raja policies + + # Use same file for input and query + set(input_file "${AXOM_DATA_DIR}/quest/ucart10.cycle_000000.root") + set(query_file "${AXOM_DATA_DIR}/quest/ucart10_shifted.cycle_000000.root") + + set(_methods "bvh" "implicit") + + set (_policies "seq") + blt_list_append(TO _policies ELEMENTS "omp" IF AXOM_ENABLE_OPENMP) + blt_list_append(TO _policies ELEMENTS "cuda" IF AXOM_ENABLE_CUDA) + blt_list_append(TO _policies ELEMENTS "hip" IF AXOM_ENABLE_HIP) + + + foreach(_method ${_methods}) + foreach(_policy ${_policies}) + + set(_testname "quest_candidates_example_${_method}_${_policy}") + axom_add_test( + NAME ${_testname} + COMMAND quest_candidates_example_ex + --infile ${input_file} + --queryfile ${query_file} + --method ${_method} + --policy ${_policy} + ) + + # Match either one comma or none for portability + set_tests_properties(${_testname} PROPERTIES + PASS_REGULAR_EXPRESSION "Mesh had 6[,]?859 candidates pairs") + endforeach() + endforeach() + endif() + +endif() + # Shaping example ------------------------------------------------------------- if(AXOM_ENABLE_MPI AND MFEM_FOUND AND MFEM_USE_MPI AND AXOM_ENABLE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION @@ -171,21 +241,34 @@ if(AXOM_ENABLE_MPI AND AXOM_ENABLE_SIDRE AND HDF5_FOUND) endif() # Non-zero empty-rank probability tests domain underloading case - set(_meshes "mdmesh.2x1" "mdmesh.2x3") + set(_meshes "mdmesh.2x1" "mdmesh.2x3" "mdmesh.2x2x1" "mdmeshg.2x2x1") # The mdmesh.* files were generated by these commands: # src/tools/gen-multidom-structured-mesh.py -ml=0,0 -mu=2,2 -ms=100,100 -dc=2,1 -o mdmesh.2x1 # src/tools/gen-multidom-structured-mesh.py -ml=0,0 -mu=2,2 -ms=100,100 -dc=2,3 -o mdmesh.2x3 + # src/tools/gen-multidom-structured-mesh.py -ml=0,0,0 -mu=2,2,2 -ms=20,20,15 -dc=2,2,1 -o mdmeshg.2x2x1 --strided foreach(_pol ${_policies}) foreach(_mesh ${_meshes}) - # Add test with data on all ranks - set(_test "quest_distributed_closest_point_run_2D_${_pol}_${_mesh}") + # Determine problem dimension by mesh filename. + # and set dimension-dependent arguments. + string(REGEX MATCH "\\.[0-9]+(x[0-9]+)+$" _sizes "${_mesh}") + string(REGEX MATCHALL "[0-9]+" _sizes ${_sizes}) + list(LENGTH _sizes _ndim) + + if(_ndim EQUAL 2) + set(_center 0.7 0.9) + elseif(_ndim EQUAL 3) + set(_center 0.7 0.9 0.5) + endif() + + set(_test "quest_distributed_closest_point_run_${_ndim}D_${_pol}_${_mesh}") axom_add_test( NAME ${_test} COMMAND quest_distributed_distance_query_ex --mesh-file ${quest_data_dir}/${_mesh}.root - --num-samples 500 - --center 1.2 1.5 - --radius 0.75 + --long-point-count 60 + --center ${_center} + --radius 0.9 + --lat-point-count 30 --obj-domain-count-range 0 2 --dist-threshold .3 --no-random-spacing @@ -207,6 +290,11 @@ if(AXOM_ENABLE_MPI AND AXOM_ENABLE_SIDRE AND HDF5_FOUND) endif() # Marching cubes example ------------------------------------------- +if(CONDUIT_FOUND AND AXOM_ENABLE_MPI) + list(APPEND quest_depends_on conduit::conduit + conduit::conduit_mpi) +endif() + if(CONDUIT_FOUND) axom_add_executable( NAME quest_marching_cubes_ex @@ -231,10 +319,12 @@ if(CONDUIT_FOUND) endif() # Non-zero empty-rank probability tests domain underloading case - set(_meshes "mdmesh.2x1" "mdmesh.2x3" "mdmesh.2x2x1") + set(_meshes "mdmesh.2x1" "mdmesh.2x3" "mdmesh.2x2x1" "mdmeshg.2x2x1") # The amc.* files were generated by these commands: - # src/tools/gen-multidom-structured-mesh.py -ml=0,0 -mu=2,2 -ms=20,20 -dc=2,2 -o amc_mesh.2x2 + # src/tools/gen-multidom-structured-mesh.py -ml=0,0 -mu=2,2 -ms=100,100 -dc=2,1 -o mdmesh.2x1 + # src/tools/gen-multidom-structured-mesh.py -ml=0,0 -mu=2,2 -ms=100,100 -dc=2,3 -o mdmesh.2x3 # src/tools/gen-multidom-structured-mesh.py -ml=0,0,0 -mu=2,2,2 -ms=20,20,15 -dc=2,2,1 -o mdmesh.2x2x1 + # src/tools/gen-multidom-structured-mesh.py -ml=0,0,0 -mu=2,2,2 -ms=20,20,15 -dc=2,2,1 -o mdmeshg.2x2x1 --strided foreach(_pol ${_policies}) foreach(_mesh ${_meshes}) # Determine problem dimension by mesh filename. @@ -246,9 +336,11 @@ if(CONDUIT_FOUND) if(_ndim EQUAL 2) set(_dir 1.0 0.4) set(_center 1.0 0.4) + set(_scale 3 3) elseif(_ndim EQUAL 3) set(_dir 1.0 0.4 1.2) set(_center 1.0 0.4 1.2) + set(_scale 3 3 1.5) endif() set(_test "quest_marching_cubes_run_${_ndim}D_${_pol}_${_mesh}") @@ -260,6 +352,7 @@ if(CONDUIT_FOUND) --fields-file ${_test}.field --dir ${_dir} --center ${_center} + --scale ${_scale} --contourVal 1.25 --check-results --verbose @@ -375,8 +468,12 @@ if (ENABLE_FORTRAN) set(quest_fortran_examples quest_signed_distance_interface) - # The inout Fortran example fails to compile with hipcc/amdflang in debug configurations - if("${CMAKE_Fortran_COMPILER}" MATCHES "amdflang$" AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + if("${AXOM_CONFIG_NAME}" STREQUAL "GNU-Debug-shared-mpi-openmp") + # The gcc-11 docker image does not work, turning off for now + set(_has_inout_fortran_example FALSE) + elseif("${CMAKE_Fortran_COMPILER}" MATCHES "amdflang$" AND + CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)") + # The inout Fortran example fails to compile with hipcc/amdflang in debug configurations set(_has_inout_fortran_example FALSE) else() set(_has_inout_fortran_example TRUE) diff --git a/src/axom/quest/examples/containment_driver.cpp b/src/axom/quest/examples/containment_driver.cpp index 6924cae0b3..a53dac5657 100644 --- a/src/axom/quest/examples/containment_driver.cpp +++ b/src/axom/quest/examples/containment_driver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/examples/delaunay_triangulation.cpp b/src/axom/quest/examples/delaunay_triangulation.cpp index 46e36b6010..d1327258ef 100644 --- a/src/axom/quest/examples/delaunay_triangulation.cpp +++ b/src/axom/quest/examples/delaunay_triangulation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/examples/point_in_cell_benchmark.cpp b/src/axom/quest/examples/point_in_cell_benchmark.cpp index e667e8983d..4384a9f6cb 100644 --- a/src/axom/quest/examples/point_in_cell_benchmark.cpp +++ b/src/axom/quest/examples/point_in_cell_benchmark.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/examples/spin_bvh_two_pass.cpp b/src/axom/quest/examples/quest_bvh_two_pass.cpp similarity index 98% rename from src/axom/spin/examples/spin_bvh_two_pass.cpp rename to src/axom/quest/examples/quest_bvh_two_pass.cpp index e16db47c2e..2efae9d5f1 100644 --- a/src/axom/spin/examples/spin_bvh_two_pass.cpp +++ b/src/axom/quest/examples/quest_bvh_two_pass.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -107,7 +107,12 @@ void find_collisions_broadphase(const mint::Mesh* mesh, { using PointType = axom::primal::Point; using BoxType = axom::primal::BoundingBox; +// Intel oneAPI compiler segfaults with OpenMP RAJA scan +#ifdef __INTEL_LLVM_COMPILER + using exec_pol = typename axom::execution_space::loop_policy; +#else using exec_pol = typename axom::execution_space::loop_policy; +#endif using reduce_pol = typename axom::execution_space::reduce_policy; int allocatorId = axom::execution_space::allocatorID(); diff --git a/src/axom/quest/examples/quest_candidates_example.cpp b/src/axom/quest/examples/quest_candidates_example.cpp new file mode 100644 index 0000000000..932fe5a494 --- /dev/null +++ b/src/axom/quest/examples/quest_candidates_example.cpp @@ -0,0 +1,867 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +//----------------------------------------------------------------------------- +/// +/// file: quest_candidates_examples.cpp +/// +/// This example takes as input two Blueprint unstructured hex meshes, and +/// finds the candidates of intersection between the meshes using a +/// spatial index, either a Bounding Volume Hierarchy or an Implicit Grid. +/// The example supports HIP and CUDA execution through RAJA. +//----------------------------------------------------------------------------- + +#include "axom/config.hpp" +#include "axom/core.hpp" +#include "axom/slic.hpp" + +#ifdef AXOM_USE_RAJA + #include "RAJA/RAJA.hpp" +#else + #error This example requires axom to be configured with RAJA support +#endif + +#ifdef AXOM_USE_UMPIRE + #include "umpire/Umpire.hpp" +#else + #error This example requires axom to be configured with Umpire support +#endif + +#ifdef AXOM_USE_CONDUIT + #include "conduit_relay.hpp" + #include "conduit_blueprint.hpp" +#else + #error This example requires axom to be configured with Conduit support +#endif + +#include "axom/mint.hpp" +#include "axom/primal.hpp" +#include "axom/spin.hpp" +#include "axom/quest.hpp" + +#include "axom/fmt.hpp" +#include "axom/CLI11.hpp" + +#include +#include + +using seq_exec = axom::SEQ_EXEC; + +using UMesh = axom::mint::UnstructuredMesh; +using IndexPair = std::pair; +using RuntimePolicy = axom::runtime_policy::Policy; + +// clang-format off +#if defined(AXOM_RUNTIME_POLICY_USE_OPENMP) + using omp_exec = axom::OMP_EXEC; +#else + using omp_exec = seq_exec; +#endif + +#if defined(AXOM_RUNTIME_POLICY_USE_CUDA) + constexpr int CUDA_BLK_SZ = 256; + using cuda_exec = axom::CUDA_EXEC; +#else + using cuda_exec = seq_exec; +#endif + +// Hip exec included from IntersectionShaper header + +// clang-format on + +//----------------------------------------------------------------------------- +/// Basic RAII utility class for initializing and finalizing slic logger +//----------------------------------------------------------------------------- +struct BasicLogger +{ + BasicLogger() + { + namespace slic = axom::slic; + + // Initialize the SLIC logger + slic::initialize(); + slic::setLoggingMsgLevel(slic::message::Debug); + + // Customize logging levels and formatting + const std::string slicFormatStr = "[] \n"; + + slic::addStreamToMsgLevel(new slic::GenericOutputStream(&std::cerr), + slic::message::Error); + slic::addStreamToMsgLevel( + new slic::GenericOutputStream(&std::cerr, slicFormatStr), + slic::message::Warning); + + auto* compactStream = + new slic::GenericOutputStream(&std::cout, slicFormatStr); + slic::addStreamToMsgLevel(compactStream, slic::message::Info); + slic::addStreamToMsgLevel(compactStream, slic::message::Debug); + } + + ~BasicLogger() { axom::slic::finalize(); } +}; + +//----------------------------------------------------------------------------- +/// Struct to help with parsing and storing command line args +//----------------------------------------------------------------------------- + +struct Input +{ + static const std::set s_validMethods; + + std::string mesh_file_first {""}; + std::string mesh_file_second {""}; + std::string method {"bvh"}; + int resolution {0}; + bool verboseOutput {false}; + RuntimePolicy policy {RuntimePolicy::seq}; + + void parse(int argc, char** argv, axom::CLI::App& app); + bool isVerbose() const { return verboseOutput; } +}; + +void Input::parse(int argc, char** argv, axom::CLI::App& app) +{ + app.add_option("-i, --infile", mesh_file_first) + ->description( + "The first input Blueprint mesh file to insert into spatial index") + ->required() + ->check(axom::CLI::ExistingFile); + + app.add_option("-q, --queryfile", mesh_file_second) + ->description("The second input Blueprint mesh file to query spatial index") + ->required() + ->check(axom::CLI::ExistingFile); + + app + .add_option("-r,--resolution", + resolution, + "With '-m implicit', set resolution of implicit grid. \n" + "Set to less than 1 to use the implicit grid spatial index\n" + "with a resolution of the cube root of the number of\n" + "hexes.") + ->capture_default_str(); + + app.add_flag("-v,--verbose", verboseOutput) + ->description("Increase logging verbosity") + ->capture_default_str(); + + app.add_option("-p, --policy", policy) + ->description( + "Execution policy." + "\nSet to 'seq' or 0 to use the RAJA sequential policy." +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + "\nSet to 'omp' or 1 to use the RAJA openmp policy." +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + "\nSet to 'cuda' or 2 to use the RAJA cuda policy." +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + "\nSet to 'hip' or 3 to use the RAJA hip policy." +#endif + ) + ->capture_default_str() + ->transform( + axom::CLI::CheckedTransformer(axom::runtime_policy::s_nameToPolicy)); + + app + .add_option( + "-m, --method", + method, + "Method to use. \n" + "Set to 'bvh' to use the bounding volume hierarchy spatial index.\n" + "Set to 'implicit' to use the implicit grid spatial index.") + ->capture_default_str() + ->check(axom::CLI::IsMember {Input::s_validMethods}); + + app.get_formatter()->column_width(40); + + app.parse(argc, argv); // Could throw an exception + + // Output parsed information + SLIC_INFO(axom::fmt::format( + R"( + Parsed parameters: + * First Blueprint mesh to insert: '{}' + * Second Blueprint mesh to query: '{}' + * Verbose logging: {} + * Spatial method: '{}' + * Resolution: '{}' + * Runtime execution policy: '{}' + )", + mesh_file_first, + mesh_file_second, + verboseOutput, + method == "bvh" ? "Bounding Volume Hierarchy (BVH)" : "Implicit Grid", + method == "bvh" ? "Not Applicable" : std::to_string(resolution), + policy == +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + RuntimePolicy::omp + ? "omp" + : policy == +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + RuntimePolicy::cuda + ? "cuda" + : policy == +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + RuntimePolicy::hip + ? "hip" + : policy == +#endif + RuntimePolicy::seq + ? "seq" + : "policy not valid")); +} + +const std::set Input::s_validMethods({ + "bvh", + "implicit", +}); + +//----------------------------------------------------------------------------- +/// Basic hexahedron mesh to be used in our application +//----------------------------------------------------------------------------- +struct HexMesh +{ + using Point = axom::primal::Point; + using Hexahedron = axom::primal::Hexahedron; + using BoundingBox = axom::primal::BoundingBox; + + axom::IndexType numHexes() const { return m_hexes.size(); } + axom::Array& hexes() { return m_hexes; } + const axom::Array& hexes() const { return m_hexes; } + + BoundingBox& meshBoundingBox() { return m_meshBoundingBox; } + const BoundingBox& meshBoundingBox() const { return m_meshBoundingBox; } + + axom::Array& hexBoundingBoxes() { return m_hexBoundingBoxes; } + const axom::Array& hexBoundingBoxes() const + { + return m_hexBoundingBoxes; + } + + axom::Array m_hexes; + axom::Array m_hexBoundingBoxes; + BoundingBox m_meshBoundingBox; +}; + +HexMesh loadBlueprintHexMesh(const std::string& mesh_path, + bool verboseOutput = false) +{ + HexMesh hexMesh; + + // Load Blueprint mesh into Conduit node + conduit::Node n_load; + conduit::relay::io::blueprint::read_mesh(mesh_path, n_load); + + // Check if Blueprint mesh conforms + conduit::Node n_info; + if(conduit::blueprint::verify("mesh", n_load, n_info) == false) + { + n_info.print(); + SLIC_ERROR("Mesh verification has failed!"); + } + + // Verify this is a hexahedral mesh + std::string shape = n_load[0]["topologies/topo/elements/shape"].as_string(); + if(shape != "hex") + { + SLIC_ERROR("A hex mesh was expected!"); + } + + const int HEX_OFFSET = 8; + + int num_nodes = + (n_load[0]["coordsets/coords/values/x"]).dtype().number_of_elements(); + + int connectivity_size = + (n_load[0]["topologies/topo/elements/connectivity"]).dtype().number_of_elements(); + + // Sanity check for number of cells + int cell_calc_from_nodes = + std::round(std::pow(std::pow(num_nodes, 1.0 / 3.0) - 1, 3)); + int cell_calc_from_connectivity = connectivity_size / HEX_OFFSET; + if(cell_calc_from_nodes != cell_calc_from_connectivity) + { + SLIC_ERROR("Number of cells is not expected!\n" + << "First calculation is " << cell_calc_from_nodes + << " and second calculation is " << cell_calc_from_connectivity); + } + + // extract hexes into an axom::Array + int* connectivity = n_load[0]["topologies/topo/elements/connectivity"].value(); + + double* x_vals = n_load[0]["coordsets/coords/values/x"].value(); + double* y_vals = n_load[0]["coordsets/coords/values/y"].value(); + double* z_vals = n_load[0]["coordsets/coords/values/z"].value(); + + const int numCells = connectivity_size / HEX_OFFSET; + hexMesh.m_hexes.reserve(numCells); + HexMesh::Hexahedron hex; + axom::Array hexPoints(HEX_OFFSET); + + for(int i = 0; i < numCells; ++i) + { + for(int j = 0; j < HEX_OFFSET; j++) + { + int offset = i * HEX_OFFSET; + hexPoints[j] = HexMesh::Point({x_vals[connectivity[offset + j]], + y_vals[connectivity[offset + j]], + z_vals[connectivity[offset + j]]}); + } + hex = HexMesh::Hexahedron(hexPoints); + hexMesh.m_hexes.emplace_back(hex); + } + + // compute and store hex bounding boxes and mesh bounding box + hexMesh.m_hexBoundingBoxes.reserve(numCells); + for(const auto& hex : hexMesh.hexes()) + { + hexMesh.m_hexBoundingBoxes.emplace_back( + axom::primal::compute_bounding_box(hex)); + hexMesh.m_meshBoundingBox.addBox(hexMesh.m_hexBoundingBoxes.back()); + } + + SLIC_INFO( + axom::fmt::format("Mesh bounding box is {}.\n", hexMesh.meshBoundingBox())); + + // Optional verbose output that writes Blueprint mesh to vtk + if(verboseOutput) + { + UMesh* mesh = new UMesh(3, axom::mint::HEX); + + // Append mesh nodes + for(int i = 0; i < num_nodes; i++) + { + mesh->appendNode(x_vals[i], y_vals[i], z_vals[i]); + } + + // Append mesh cells + for(int i = 0; i < numCells; i++) + { + const axom::IndexType cell[] = { + connectivity[i * HEX_OFFSET], + connectivity[(i * HEX_OFFSET) + 1], + connectivity[(i * HEX_OFFSET) + 2], + connectivity[(i * HEX_OFFSET) + 3], + connectivity[(i * HEX_OFFSET) + 4], + connectivity[(i * HEX_OFFSET) + 5], + connectivity[(i * HEX_OFFSET) + 6], + connectivity[(i * HEX_OFFSET) + 7], + }; + + mesh->appendCell(cell); + } + + // Write out to vtk for test viewing + SLIC_INFO("Writing out Blueprint mesh to test.vtk for debugging..."); + axom::utilities::Timer timer(true); + axom::mint::write_vtk(mesh, "test.vtk"); + timer.stop(); + SLIC_INFO(axom::fmt::format( + "Writing out Blueprint mesh to test.vtk took {:4.3} seconds.", + timer.elapsedTimeInSec())); + + delete mesh; + mesh = nullptr; + } // end of verbose output + + return hexMesh; +} // end of loadBlueprintHexMesh + +template +axom::Array findCandidatesBVH(const HexMesh& insertMesh, + const HexMesh& queryMesh) +{ + axom::utilities::Timer timer; + timer.start(); + + SLIC_INFO("Running BVH candidates algorithm in execution Space: " + << axom::execution_space::name()); + + using HexArray = axom::Array; + using BBoxArray = axom::Array; + using IndexArray = axom::Array; + constexpr bool on_device = axom::execution_space::onDevice(); + + axom::Array candidatePairs; + + // Get ids of necessary allocators + const int host_allocator = + axom::getUmpireResourceAllocatorID(umpire::resource::Host); + const int kernel_allocator = on_device + ? axom::getUmpireResourceAllocatorID(umpire::resource::Device) + : axom::execution_space::allocatorID(); + + // Copy the insert-BVH hexes to the device, if necessary + // Either way, insert_hexes_v will be a view w/ data in the correct space + auto& insert_hexes_h = insertMesh.hexes(); + HexArray insert_hexes_d = + on_device ? HexArray(insert_hexes_h, kernel_allocator) : HexArray(); + + // Copy the insert-BVH bboxes to the device, if necessary + // Either way, insert_bbox_v will be a view w/ data in the correct space + auto& insert_bbox_h = insertMesh.hexBoundingBoxes(); + BBoxArray insert_bbox_d = + on_device ? BBoxArray(insert_bbox_h, kernel_allocator) : BBoxArray(); + auto insert_bbox_v = on_device ? insert_bbox_d.view() : insert_bbox_h.view(); + + // Copy the query-BVH hexes to the device, if necessary + // Either way, query_hexes_v will be a view w/ data in the correct space + auto& query_hexes_h = queryMesh.hexes(); + HexArray query_hexes_d = + on_device ? HexArray(query_hexes_h, kernel_allocator) : HexArray(); + + // Copy the query-BVH bboxes to the device, if necessary + // Either way, bbox_v will be a view w/ data in the correct space + auto& query_bbox_h = queryMesh.hexBoundingBoxes(); + BBoxArray query_bbox_d = + on_device ? BBoxArray(query_bbox_h, kernel_allocator) : BBoxArray(); + auto query_bbox_v = on_device ? query_bbox_d.view() : query_bbox_h.view(); + + // Initialize a BVH tree over the insert mesh bounding boxes + axom::spin::BVH<3, ExecSpace, double> bvh; + bvh.setAllocatorID(kernel_allocator); + bvh.initialize(insert_bbox_v, insert_bbox_v.size()); + timer.stop(); + SLIC_INFO(axom::fmt::format("0: Initializing BVH took {:4.3} seconds.", + timer.elapsedTimeInSec())); + + // Search for candidate bounding boxes of hexes to query; + timer.start(); + IndexArray offsets_d(query_bbox_v.size(), query_bbox_v.size(), kernel_allocator); + IndexArray counts_d(query_bbox_v.size(), query_bbox_v.size(), kernel_allocator); + IndexArray candidates_d(0, 0, kernel_allocator); + + auto offsets_v = offsets_d.view(); + auto counts_v = counts_d.view(); + bvh.findBoundingBoxes(offsets_v, + counts_v, + candidates_d, + query_bbox_v.size(), + query_bbox_v); + + timer.stop(); + SLIC_INFO(axom::fmt::format( + "1: Querying candidate bounding boxes took {:4.3} seconds.", + timer.elapsedTimeInSec())); + timer.start(); + + // Initialize candidate pairs on device. + auto candidates_v = candidates_d.view(); + IndexArray firstPair_d(candidates_v.size(), + candidates_v.size(), + kernel_allocator); + IndexArray secondPair_d(candidates_v.size(), + candidates_v.size(), + kernel_allocator); + auto first_pair_v = firstPair_d.view(); + auto second_pair_v = secondPair_d.view(); + + axom::for_all( + query_bbox_v.size(), + AXOM_LAMBDA(axom::IndexType icell) { + axom::IndexType offset = offsets_v[icell]; + + for(int j = 0; j < counts_v[icell]; j++) + { + int pair_index = offset + j; + first_pair_v[pair_index] = icell; + second_pair_v[pair_index] = candidates_v[pair_index]; + } + }); + + timer.stop(); + SLIC_INFO(axom::fmt::format( + "2: Initializing candidate pairs (on device) took {:4.3} seconds.", + timer.elapsedTimeInSec())); + timer.start(); + + // copy pairs back to host and into return array + IndexArray candidates_h[2] = { + on_device ? IndexArray(firstPair_d, host_allocator) : IndexArray(), + on_device ? IndexArray(secondPair_d, host_allocator) : IndexArray()}; + + auto candidate1_h_v = on_device ? candidates_h[0].view() : firstPair_d.view(); + auto candidate2_h_v = on_device ? candidates_h[1].view() : secondPair_d.view(); + + for(int idx = 0; idx < candidates_v.size(); ++idx) + { + candidatePairs.emplace_back( + std::make_pair(candidate1_h_v[idx], candidate2_h_v[idx])); + } + + timer.stop(); + SLIC_INFO( + axom::fmt::format("3: Moving candidate pairs to host took {:4.3} seconds.", + timer.elapsedTimeInSec())); + + SLIC_INFO(axom::fmt::format(axom::utilities::locale(), + R"(Stats for query + -- Number of insert-BVH mesh hexes {:L} + -- Number of query mesh hexes {:L} + -- Total possible candidates {:L} + -- Candidates from BVH query {:L} + )", + insertMesh.numHexes(), + queryMesh.numHexes(), + 1.0 * insertMesh.numHexes() * queryMesh.numHexes(), + candidatePairs.size())); + + return candidatePairs; +} // end of findCandidatesBVH for Blueprint Meshes + +template +axom::Array findCandidatesImplicit(const HexMesh& insertMesh, + const HexMesh& queryMesh, + int resolution) +{ + axom::utilities::Timer timer; + timer.start(); + + axom::Array candidatePairs; + + SLIC_INFO("Running Implicit Grid candidates algorithm in execution Space: " + << axom::execution_space::name()); + + using HexArray = axom::Array; + using BBoxArray = axom::Array; + using IndexArray = axom::Array; + constexpr bool on_device = axom::execution_space::onDevice(); + + // Get ids of necessary allocators + const int host_allocator = + axom::getUmpireResourceAllocatorID(umpire::resource::Host); + const int kernel_allocator = on_device + ? axom::getUmpireResourceAllocatorID(umpire::resource::Device) + : axom::execution_space::allocatorID(); + + // Copy the insert hexes to the device, if necessary + // Either way, insert_hexes_v will be a view w/ data in the correct space + auto& insert_hexes_h = insertMesh.hexes(); + HexArray insert_hexes_d = + on_device ? HexArray(insert_hexes_h, kernel_allocator) : HexArray(); + + // Copy the insert bboxes to the device, if necessary + // Either way, insert_bbox_v will be a view w/ data in the correct space + auto& insert_bbox_h = insertMesh.hexBoundingBoxes(); + BBoxArray insert_bbox_d = + on_device ? BBoxArray(insert_bbox_h, kernel_allocator) : BBoxArray(); + auto insert_bbox_v = on_device ? insert_bbox_d.view() : insert_bbox_h.view(); + + // Bounding box of entire insert mesh + HexMesh::BoundingBox insert_mesh_bbox_h = insertMesh.meshBoundingBox(); + + // Copy the query hexes to the device, if necessary + // Either way, query_hexes_v will be a view w/ data in the correct space + auto& query_hexes_h = queryMesh.hexes(); + HexArray query_hexes_d = + on_device ? HexArray(query_hexes_h, kernel_allocator) : HexArray(); + + // Copy the query bboxes to the device, if necessary + // Either way, bbox_v will be a view w/ data in the correct space + auto& query_bbox_h = queryMesh.hexBoundingBoxes(); + BBoxArray query_bbox_d = + on_device ? BBoxArray(query_bbox_h, kernel_allocator) : BBoxArray(); + auto query_bbox_v = on_device ? query_bbox_d.view() : query_bbox_h.view(); + + // If given resolution is less than one, use the cube root of the + // number of hexes + if(resolution < 1) + { + resolution = (int)(1 + std::pow(insertMesh.numHexes(), 1 / 3.)); + } + + const axom::primal::Point resolutions(resolution); + + axom::spin::ImplicitGrid<3, ExecSpace, int> gridIndex(insert_mesh_bbox_h, + &resolutions, + insertMesh.numHexes(), + kernel_allocator); + gridIndex.insert(insertMesh.numHexes(), insert_bbox_v.data()); + timer.stop(); + SLIC_INFO( + axom::fmt::format("0: Initializing Implicit Grid took {:4.3} seconds.", + timer.elapsedTimeInSec())); + + timer.start(); + IndexArray offsets_d(query_bbox_v.size(), query_bbox_v.size(), kernel_allocator); + IndexArray counts_d(query_bbox_v.size(), query_bbox_v.size(), kernel_allocator); + + auto offsets_v = offsets_d.view(); + auto counts_v = counts_d.view(); + + // Object to query the candidates + const auto grid_device = gridIndex.getQueryObject(); + + using reduce_pol = typename axom::execution_space::reduce_policy; + RAJA::ReduceSum totalCandidatePairs(0); + + // First pass: get number of bounding box candidates for each query bounding + // box. Logic here mirrors the quest_bvh_two_pass.cpp example. See also + // the "Device Traversal API" for BVH. + axom::for_all( + queryMesh.numHexes(), + AXOM_LAMBDA(int icell) { + int count = 0; + + // Define a function that is called on every candidate reached during + // traversal. The function below simply counts the number of candidates + // that intersect with the given query bounding box. + auto isBBIntersect = [&](int candidateIdx) { + if(axom::primal::intersect(insert_bbox_v[candidateIdx], + query_bbox_v[icell])) + { + count++; + } + }; + + // Call visitCandidates to iterate through the candidates + grid_device.visitCandidates(query_bbox_v[icell], isBBIntersect); + + // Store the number of intersections for each query bounding box + counts_v[icell] = count; + totalCandidatePairs += count; + }); + + timer.stop(); + SLIC_INFO(axom::fmt::format( + "1: Querying candidate bounding boxes took {:4.3} seconds.", + timer.elapsedTimeInSec())); + timer.start(); + +// Generate offsets from the counts +// (Note: exclusive scan for offsets in candidate array +// Intel oneAPI compiler segfaults with OpenMP RAJA scan) +#ifdef __INTEL_LLVM_COMPILER + using exec_pol = typename axom::execution_space::loop_policy; +#else + using exec_pol = typename axom::execution_space::loop_policy; +#endif + RAJA::exclusive_scan( + RAJA::make_span(counts_v.data(), queryMesh.numHexes()), + RAJA::make_span(offsets_v.data(), queryMesh.numHexes()), + RAJA::operators::plus {}); + + // Initialize candidatePairs to return. + // Allocate arrays for candidate pairs + IndexArray firstPair_d(totalCandidatePairs.get(), + totalCandidatePairs.get(), + kernel_allocator); + IndexArray secondPair_d(totalCandidatePairs.get(), + totalCandidatePairs.get(), + kernel_allocator); + auto first_pair_v = firstPair_d.view(); + auto second_pair_v = secondPair_d.view(); + + // Second pass: fill candidates array pairs on device + axom::for_all( + queryMesh.numHexes(), + AXOM_LAMBDA(axom::IndexType icell) { + axom::IndexType offset = offsets_v[icell]; + + // Store the intersection candidate + auto fillCandidates = [&](int candidateIdx) { + if(axom::primal::intersect(insert_bbox_v[candidateIdx], + query_bbox_v[icell])) + { + first_pair_v[offset] = icell; + second_pair_v[offset] = candidateIdx; + offset++; + } + }; + + grid_device.visitCandidates(query_bbox_v[icell], fillCandidates); + }); + + timer.stop(); + + SLIC_INFO(axom::fmt::format( + "2: Initializing candidate pairs (on device) took {:4.3} seconds.", + timer.elapsedTimeInSec())); + + // copy results back to host and into return vector + timer.start(); + + IndexArray candidates_h[2] = { + on_device ? IndexArray(firstPair_d, host_allocator) : IndexArray(), + on_device ? IndexArray(secondPair_d, host_allocator) : IndexArray()}; + + auto candidate1_h_v = on_device ? candidates_h[0].view() : firstPair_d.view(); + auto candidate2_h_v = on_device ? candidates_h[1].view() : secondPair_d.view(); + + for(int idx = 0; idx < totalCandidatePairs; ++idx) + { + candidatePairs.emplace_back( + std::make_pair(candidate1_h_v[idx], candidate2_h_v[idx])); + } + + timer.stop(); + + SLIC_INFO( + axom::fmt::format("3: Moving candidate pairs to host took {:4.3} seconds.", + timer.elapsedTimeInSec())); + + SLIC_INFO(axom::fmt::format(axom::utilities::locale(), + R"(Stats for query + -- Number of insert mesh hexes {:L} + -- Number of query mesh hexes {:L} + -- Total possible candidates {:L} + -- Candidates from Implicit Grid query {:L} + )", + insertMesh.numHexes(), + queryMesh.numHexes(), + 1.0 * insertMesh.numHexes() * queryMesh.numHexes(), + candidatePairs.size())); + + return candidatePairs; +} + +int main(int argc, char** argv) +{ + // Initialize logger; use RAII so it will finalize at the end of the application + BasicLogger logger; + + // Parse the command line arguments + Input params; + { + axom::CLI::App app {"Blueprint Hex BVH mesh candidate tester"}; + try + { + params.parse(argc, argv, app); + } + catch(const axom::CLI::ParseError& e) + { + return app.exit(e); + } + } + + axom::utilities::Timer timer(true); + + // Update the logging level based on verbosity flag + axom::slic::setLoggingMsgLevel(params.isVerbose() ? axom::slic::message::Debug + : axom::slic::message::Info); + + // Load Blueprint mesh to insert into spatial index + SLIC_INFO(axom::fmt::format("Reading Blueprint file to insert: '{}'...\n", + params.mesh_file_first)); + + HexMesh insert_mesh = + loadBlueprintHexMesh(params.mesh_file_first, params.isVerbose()); + + // Load Blueprint mesh for querying spatial index + SLIC_INFO(axom::fmt::format("Reading Blueprint file to query: '{}'...\n", + params.mesh_file_second)); + + HexMesh query_mesh = + loadBlueprintHexMesh(params.mesh_file_second, params.isVerbose()); + + timer.stop(); + + SLIC_INFO(axom::fmt::format("Reading in Blueprint files took {:4.3} seconds.", + timer.elapsedTimeInSec())); + + // Check for candidates; results are returned as an array of index pairs + axom::Array candidatePairs; + timer.start(); + + if(params.method == "bvh") + { + switch(params.policy) + { +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + case RuntimePolicy::omp: + candidatePairs = findCandidatesBVH(insert_mesh, query_mesh); + break; +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + case RuntimePolicy::cuda: + candidatePairs = findCandidatesBVH(insert_mesh, query_mesh); + break; +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + case RuntimePolicy::hip: + candidatePairs = findCandidatesBVH(insert_mesh, query_mesh); + break; +#endif + default: // RuntimePolicy::seq + candidatePairs = findCandidatesBVH(insert_mesh, query_mesh); + break; + } + } + // Implicit Grid + else + { + switch(params.policy) + { +#ifdef AXOM_RUNTIME_POLICY_USE_OPENMP + case RuntimePolicy::omp: + candidatePairs = findCandidatesImplicit(insert_mesh, + query_mesh, + params.resolution); + break; +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_CUDA + case RuntimePolicy::cuda: + candidatePairs = findCandidatesImplicit(insert_mesh, + query_mesh, + params.resolution); + break; +#endif +#ifdef AXOM_RUNTIME_POLICY_USE_HIP + case RuntimePolicy::hip: + candidatePairs = findCandidatesImplicit(insert_mesh, + query_mesh, + params.resolution); + break; +#endif + default: // RuntimePolicy::seq + candidatePairs = findCandidatesImplicit(insert_mesh, + query_mesh, + params.resolution); + break; + } + } + timer.stop(); + + SLIC_INFO(axom::fmt::format("Computing candidates took {:4.3} seconds.", + timer.elapsedTimeInSec())); + SLIC_INFO(axom::fmt::format(axom::utilities::locale(), + "Mesh had {:L} candidates pairs", + candidatePairs.size())); + + // print first few pairs + const int numCandidates = candidatePairs.size(); + if(numCandidates > 0 && params.isVerbose()) + { + constexpr int MAX_PRINT = 20; + if(numCandidates > MAX_PRINT) + { + candidatePairs.resize(MAX_PRINT); + SLIC_INFO(axom::fmt::format("First {} candidate pairs: {} ...\n", + MAX_PRINT, + axom::fmt::join(candidatePairs, ", "))); + } + else + { + SLIC_INFO(axom::fmt::format("Candidate pairs: {}\n", + axom::fmt::join(candidatePairs, ", "))); + } + + // Write out candidate pairs + SLIC_INFO("Writing out candidate pairs..."); + std::ofstream outf("candidates.txt"); + + outf << candidatePairs.size() << " candidate pairs:" << std::endl; + for(int i = 0; i < candidatePairs.size(); ++i) + { + outf << candidatePairs[i].first << " " << candidatePairs[i].second + << std::endl; + } + } + + return 0; +} diff --git a/src/axom/quest/examples/quest_distributed_distance_query_example.cpp b/src/axom/quest/examples/quest_distributed_distance_query_example.cpp index 35f09e762e..6a02cb258a 100644 --- a/src/axom/quest/examples/quest_distributed_distance_query_example.cpp +++ b/src/axom/quest/examples/quest_distributed_distance_query_example.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -49,7 +49,10 @@ namespace primal = axom::primal; namespace mint = axom::mint; namespace numerics = axom::numerics; -using RuntimePolicy = axom::quest::DistributedClosestPoint::RuntimePolicy; +using RuntimePolicy = axom::runtime_policy::Policy; + +// MPI stuff, initialized in main() +int my_rank = -1, num_ranks = -1; // converts the input string into an 80 character string // padded on both sides with '=' symbols @@ -68,8 +71,12 @@ struct Input double circleRadius {1.0}; std::vector circleCenter {0.0, 0.0}; - // TODO: Ensure that circleCenter size matches dimensionality. - int circlePoints {100}; + int longPointCount {100}; + + // Latitudinal direction of object mesh + std::vector latRange {-90.0, 90.0}; + int latPointCount {20}; + RuntimePolicy policy {RuntimePolicy::seq}; double distThreshold {std::numeric_limits::max()}; @@ -82,29 +89,9 @@ struct Input private: bool m_verboseOutput {false}; - double m_emptyRankProbability {0.}; - - // clang-format off - const std::map s_validPolicies - { - {"seq", RuntimePolicy::seq} -#if defined(AXOM_USE_RAJA) - #ifdef AXOM_USE_OPENMP - , {"omp", RuntimePolicy::omp} - #endif - #if defined(AXOM_USE_CUDA) && defined(AXOM_USE_UMPIRE) - , {"cuda", RuntimePolicy::cuda} - #endif - #if defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) - , {"hip", RuntimePolicy::hip} - #endif -#endif - }; - // clang-format on public: bool isVerbose() const { return m_verboseOutput; } - double percentEmptyRanks() const { return m_emptyRankProbability; } std::string getDCMeshName() const { @@ -148,30 +135,36 @@ struct Input ->description("Enable/disable verbose output") ->capture_default_str(); - app.add_option("--empty-rank-probability", m_emptyRankProbability) - ->description( - "Probability that a rank's data is empty " - "(tests code's ability to handle empty ranks)") - ->check(axom::CLI::Range(0., 1.)) - ->capture_default_str(); - app.add_option("-r,--radius", circleRadius) - ->description("Radius for circle") + ->description("Radius for sphere") ->capture_default_str(); - auto* circle_options = - app.add_option_group("circle", - "Options for setting up the circle of points"); - circle_options->add_option("--center", circleCenter) + auto* object_options = app.add_option_group( + "sphere", + "Options for setting up object points on the sphere"); + object_options->add_option("--center", circleCenter) ->description("Center for object (x,y[,z])") ->expected(2, 3); - circle_options->add_option("--obj-domain-count-range", objDomainCountRange) - ->description("Range of object domain counts/rank (min, max)") + object_options->add_option("--obj-domain-count-range", objDomainCountRange) + ->description("Range of object domain counts per rank (min, max)") + ->expected(2); + + object_options + ->add_flag("--random-spacing,!--no-random-spacing", randomSpacing) + ->description("Enable/disable random spacing of object points") + ->capture_default_str(); + + object_options->add_option("-n,--long-point-count", longPointCount) + ->description("Number of points around the longitudinal direction") + ->capture_default_str(); + + object_options->add_option("--lat-range", latRange) + ->description("Latitude range in degrees from the equator (3D only)") ->expected(2); - app.add_flag("--random-spacing,!--no-random-spacing", randomSpacing) - ->description("Enable/disable random spacing of circle points") + object_options->add_option("--lat-point-count", latPointCount) + ->description("Number of points in the latitudinal direction (3D only)") ->capture_default_str(); app.add_option("-d,--dist-threshold", distThreshold) @@ -179,14 +172,11 @@ struct Input ->description("Distance threshold to search") ->capture_default_str(); - app.add_option("-n,--num-samples", circlePoints) - ->description("Number of points for circle") - ->capture_default_str(); - app.add_option("-p, --policy", policy) ->description("Set runtime policy for point query method") ->capture_default_str() - ->transform(axom::CLI::CheckedTransformer(s_validPolicies)); + ->transform( + axom::CLI::CheckedTransformer(axom::runtime_policy::s_nameToPolicy)); app.add_flag("-c,--check-results,!--no-check-results", checkResults) ->description( @@ -203,26 +193,34 @@ struct Input } }; +// Input params set in main() +Input params; + /** * \brief Simple wrapper to a blueprint particle mesh * * Given a sidre Group, creates the stubs for a mesh blueptint particle mesh + * + * BlueprintParticleMesh is used by both the object mesh and the query mesh. */ struct BlueprintParticleMesh { public: - using Point2D = primal::Point; - using Point3D = primal::Point; - using PointArray2D = axom::Array; - using PointArray3D = axom::Array; - - explicit BlueprintParticleMesh(sidre::Group* group = nullptr, - const std::string& coordset = "coords", - const std::string& topology = "mesh") - : m_coordsetName(coordset) - , m_topologyName(topology) + explicit BlueprintParticleMesh(sidre::Group* group, + const std::string& topology, + const std::string& coordset) + : m_topologyName(topology) + , m_coordsetName(coordset) + , m_group(group) + { + MPI_Comm_rank(MPI_COMM_WORLD, &m_rank); + MPI_Comm_size(MPI_COMM_WORLD, &m_nranks); + } + + explicit BlueprintParticleMesh(sidre::Group* group) + : m_topologyName() + , m_coordsetName() , m_group(group) - , m_domainGroups() { MPI_Comm_rank(MPI_COMM_WORLD, &m_rank); MPI_Comm_size(MPI_COMM_WORLD, &m_nranks); @@ -237,26 +235,26 @@ struct BlueprintParticleMesh /// Gets a domain group. sidre::Group* domain_group(axom::IndexType groupIdx) const { - SLIC_ASSERT(size_t(groupIdx) < m_domainGroups.size()); - return m_domainGroups[groupIdx]; + SLIC_ASSERT(groupIdx < m_group->getNumGroups()); + return m_group->getGroup(groupIdx); } /// Gets the parent group for the blueprint coordinate set sidre::Group* coords_group(axom::IndexType groupIdx) const { - return m_coordsGroups[groupIdx]; + return domain_group(groupIdx)->getGroup("coordsets")->getGroup(m_coordsetName); } /// Gets the parent group for the blueprint mesh topology sidre::Group* topo_group(axom::IndexType groupIdx) const { - return m_topoGroups[groupIdx]; + return domain_group(groupIdx)->getGroup("topologies")->getGroup(m_topologyName); } /// Gets the parent group for the blueprint fields sidre::Group* fields_group(axom::IndexType groupIdx) const { - return m_fieldsGroups[groupIdx]; + return domain_group(groupIdx)->getGroup("fields"); } - const std::string& get_topology_name() const { return m_topologyName; } + const std::string& getTopologyName() const { return m_topologyName; } const std::string& getCoordsetName() const { return m_coordsetName; } /// Gets the MPI rank for this mesh @@ -264,30 +262,16 @@ struct BlueprintParticleMesh /// Gets the number of ranks in the problem int getNumRanks() const { return m_nranks; } - /// Returns true if points have been added to the particle mesh - bool hasPoints() const - { - // return m_coordsGroup != nullptr && m_coordsGroup->hasView("values/x"); - for(auto* cg : m_coordsGroups) - { - if(cg != nullptr && cg->hasView("values/x")) - { - return true; - } - } - return false; - } - - /// Returns the number of points in a particle mesh domain + /*! + @brief Returns the number of points in a particle mesh domain + including ghost points. + */ int numPoints(axom::IndexType dIdx) const { int rval = 0; - auto* cg = m_coordsGroups[dIdx]; - //BTNG: The following if-check is probably not a use-case - if(cg != nullptr && cg->hasView("values/x")) - { - rval = cg->getView("values/x")->getNumElements(); - } + auto* cg = coords_group(dIdx); + SLIC_ASSERT(cg != nullptr && cg->hasView("values/x")); + rval = cg->getView("values/x")->getNumElements(); return rval; } /// Returns the number of points in the particle mesh @@ -305,17 +289,16 @@ struct BlueprintParticleMesh int dimension() const { return m_dimension; } /*! - @brief Read a blueprint mesh. + @brief Read a blueprint mesh and store it internally in m_group. + + If the topology wasn't specified in the constructor, the first + topology from the file is used. The coordset name will be + replaced with the one corresponding to the topology. */ void read_blueprint_mesh(const std::string& meshFilename) { SLIC_ASSERT(!meshFilename.empty()); - m_domainGroups.clear(); - m_coordsGroups.clear(); - m_topoGroups.clear(); - m_fieldsGroups.clear(); - conduit::Node mdMesh; conduit::relay::mpi::io::blueprint::load_mesh(meshFilename, mdMesh, @@ -326,10 +309,33 @@ struct BlueprintParticleMesh if(domCount > 0) { + m_coordsAreStrided = mdMesh[0] + .fetch_existing("topologies/mesh/elements/dims") + .has_child("strides"); + if(m_coordsAreStrided) + { + SLIC_WARNING(axom::fmt::format( + "Mesh '{}' is strided. Stride support is under development.", + meshFilename)); + } + } + + if(domCount > 0) + { + if(m_topologyName.empty()) + { + // No topology given. Pick the first one. + m_topologyName = mdMesh[0].fetch_existing("topologies")[0].name(); + } + auto topologyPath = axom::fmt::format("topologies/{}", m_topologyName); + + m_coordsetName = + mdMesh[0].fetch_existing(topologyPath + "/coordset").as_string(); const conduit::Node coordsetNode = mdMesh[0].fetch_existing("coordsets").fetch_existing(m_coordsetName); m_dimension = conduit::blueprint::mesh::coordset::dims(coordsetNode); } + MPI_Allreduce(MPI_IN_PLACE, &m_dimension, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); SLIC_ASSERT(m_dimension > 0); @@ -345,26 +351,6 @@ struct BlueprintParticleMesh bool valid = isValid(); SLIC_ASSERT(valid); AXOM_UNUSED_VAR(valid); - - reset_group_pointers(); - } - - void reset_group_pointers() - { - axom::IndexType domCount = m_group->getNumGroups(); - m_domainGroups.resize(domCount, nullptr); - m_coordsGroups.resize(domCount, nullptr); - m_topoGroups.resize(domCount, nullptr); - m_fieldsGroups.resize(domCount, nullptr); - for(conduit::index_t di = 0; di < domCount; ++di) - { - m_domainGroups[di] = m_group->getGroup(di); - m_coordsGroups[di] = - m_domainGroups[di]->getGroup("coordsets")->getGroup(m_coordsetName); - m_topoGroups[di] = - m_domainGroups[di]->getGroup("topologies")->getGroup(m_topologyName); - m_fieldsGroups[di] = m_domainGroups[di]->getGroup("fields"); - } } /*! @brief Set the coordinate data from an array of primal Points @@ -374,21 +360,22 @@ struct BlueprintParticleMesh This method is for manually creating the mesh. Don't use it if the mesh is read in. */ - template - void setPoints(const axom::Array>& pts) + void setPoints(axom::IndexType domainId, const axom::Array& pts) { - axom::IndexType domainIdx = createBlueprintStubs(); - SLIC_ASSERT(m_domainGroups[domainIdx] != nullptr); + axom::IndexType localIdx = createBlueprintStubs(); + SLIC_ASSERT(domain_group(localIdx) != nullptr); + domain_group(localIdx)->createViewScalar("state/domain_id", + domainId); - const int SZ = pts.size(); + const int SZ = pts.shape()[0]; if(m_dimension == -1) { - m_dimension = NDIMS; + m_dimension = pts.shape()[1]; } else { - SLIC_ASSERT(NDIMS == m_dimension); + SLIC_ASSERT(pts.shape()[1] == m_dimension); } // lambda to create a strided view into the buffer @@ -400,7 +387,7 @@ struct BlueprintParticleMesh int sz) { if(sz > 0) { - grp->createView(path)->attachBuffer(buf)->apply(sz, dim, NDIMS); + grp->createView(path)->attachBuffer(buf)->apply(sz, dim, m_dimension); } else { @@ -408,32 +395,32 @@ struct BlueprintParticleMesh } }; - // create views into a shared buffer for the coordinates, with stride NDIMS + // create views into a shared buffer for the coordinates, with stride m_dimension { - auto* buf = m_domainGroups[domainIdx] + auto* buf = domain_group(localIdx) ->getDataStore() - ->createBuffer(sidre::DOUBLE_ID, NDIMS * SZ) + ->createBuffer(sidre::DOUBLE_ID, m_dimension * SZ) ->allocate(); - createAndApplyView(m_coordsGroups[domainIdx], "values/x", buf, 0, SZ); - if(NDIMS > 1) + createAndApplyView(coords_group(localIdx), "values/x", buf, 0, SZ); + if(m_dimension > 1) { - createAndApplyView(m_coordsGroups[domainIdx], "values/y", buf, 1, SZ); + createAndApplyView(coords_group(localIdx), "values/y", buf, 1, SZ); } - if(NDIMS > 2) + if(m_dimension > 2) { - createAndApplyView(m_coordsGroups[domainIdx], "values/z", buf, 2, SZ); + createAndApplyView(coords_group(localIdx), "values/z", buf, 2, SZ); } // copy coordinate data into the buffer - const std::size_t nbytes = sizeof(double) * SZ * NDIMS; + const std::size_t nbytes = sizeof(double) * SZ * m_dimension; axom::copy(buf->getVoidPtr(), pts.data(), nbytes); } // set the default connectivity - // Maybe be required by an old version of visit. May not be needed by newer versions of visit. + // May be required by an old version of visit. May not be needed by newer versions of visit. sidre::Array arr( - m_topoGroups[domainIdx]->createView("elements/connectivity"), + topo_group(localIdx)->createView("elements/connectivity"), SZ, SZ); for(int i = 0; i < SZ; ++i) @@ -442,13 +429,13 @@ struct BlueprintParticleMesh } } - template - axom::Array> getPoints(int domainIdx) + template + axom::Array> getPoints(int domainIdx) { - auto* cGroup = m_coordsGroups[domainIdx]; + auto* cGroup = coords_group(domainIdx); auto* xView = cGroup->getView("values/x"); auto* yView = cGroup->getView("values/y"); - auto* zView = NDIMS >= 3 ? cGroup->getView("values/z") : nullptr; + auto* zView = DIM >= 3 ? cGroup->getView("values/z") : nullptr; const auto ptCount = xView->getNumElements(); assert(xView->getStride() == 1); assert(yView->getStride() == 1); @@ -457,7 +444,7 @@ struct BlueprintParticleMesh double* ys = yView->getArray(); double* zs = zView ? (double*)(zView->getArray()) : nullptr; - using PointType = primal::Point; + using PointType = primal::Point; axom::Array pts; pts.resize(ptCount); for(int i = 0; i < ptCount; ++i) @@ -468,24 +455,69 @@ struct BlueprintParticleMesh { pts[i][1] = ys[i]; } - if(NDIMS == 3) + if(DIM == 3) { for(int i = 0; i < ptCount; ++i) { - pts[i][0] = zs[i]; + pts[i][2] = zs[i]; } } return pts; } + void printMeshSizeStats(const std::string& meshLabel) const + { + SLIC_INFO(axom::fmt::format("{} has {} points in {} domains locally", + meshLabel, + numPoints(), + domain_count())); + + auto getIntMinMax = [](int inVal, int& minVal, int& maxVal, int& sumVal) { + MPI_Allreduce(&inVal, &minVal, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&inVal, &maxVal, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&inVal, &sumVal, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + }; + + // Output some global mesh size stats + { + int mn, mx, sum; + getIntMinMax(numPoints(), mn, mx, sum); + SLIC_INFO( + axom::fmt::format("{} has {{min:{}, max:{}, sum:{}, avg:{}}} points", + meshLabel, + mn, + mx, + sum, + (double)sum / num_ranks)); + } + { + int mn, mx, sum; + getIntMinMax(domain_count(), mn, mx, sum); + SLIC_INFO( + axom::fmt::format("{} has {{min:{}, max:{}, sum:{}, avg:{}}} domains", + meshLabel, + mn, + mx, + sum, + (double)sum / num_ranks)); + } + } + template void registerNodalScalarField(const std::string& fieldName) { for(axom::IndexType dIdx = 0; dIdx < domain_count(); ++dIdx) { - auto* fld = m_fieldsGroups[dIdx]->createGroup(fieldName); + auto* fld = fields_group(dIdx)->createGroup(fieldName); fld->createViewString("association", "vertex"); - fld->createViewString("topology", m_topoGroups[dIdx]->getName()); + fld->createViewString("topology", topo_group(dIdx)->getName()); + if(m_coordsAreStrided) + { + auto* offsets = topo_group(dIdx)->getView("elements/dims/offsets"); + auto* strides = topo_group(dIdx)->getView("elements/dims/strides"); + fld->copyView(offsets); + fld->copyView(strides); + } fld->createViewAndAllocate("values", sidre::detail::SidreTT::id, numPoints(dIdx)); @@ -500,12 +532,19 @@ struct BlueprintParticleMesh { const int SZ = numPoints(dIdx); - auto* fld = m_fieldsGroups[dIdx]->createGroup(fieldName); + auto* fld = fields_group(dIdx)->createGroup(fieldName); fld->createViewString("association", "vertex"); - fld->createViewString("topology", m_topoGroups[dIdx]->getName()); + fld->createViewString("topology", topo_group(dIdx)->getName()); + if(m_coordsAreStrided) + { + auto* offsets = topo_group(dIdx)->getView("elements/dims/offsets"); + auto* strides = topo_group(dIdx)->getView("elements/dims/strides"); + fld->copyView(offsets); + fld->copyView(strides); + } // create views into a shared buffer for the coordinates, with stride DIM - auto* buf = m_domainGroups[dIdx] + auto* buf = domain_group(dIdx) ->getDataStore() ->createBuffer(sidre::detail::SidreTT::id, DIM * SZ) ->allocate(); @@ -527,9 +566,17 @@ struct BlueprintParticleMesh } } - bool hasField(const std::string& fieldName, int domainIdx = 0) const + bool hasScalarField(const std::string& fieldName, int domainIdx = 0) const { - return m_fieldsGroups[domainIdx]->hasGroup(fieldName); + auto* domain = m_group->getGroup(domainIdx); + auto* fields = domain->getGroup("fields"); + auto has = fields->hasGroup(fieldName); + return has; + } + + bool hasVectorField(const std::string& fieldName, int domainIdx = 0) const + { + return m_group->getGroup(domainIdx)->getGroup("fields")->hasGroup(fieldName); } template @@ -537,19 +584,20 @@ struct BlueprintParticleMesh int domainIdx) { SLIC_ASSERT_MSG( - domainIdx >= 0 && size_t(domainIdx) < m_domainGroups.size(), + domainIdx >= 0 && axom::IndexType(domainIdx) < domain_count(), axom::fmt::format("Rank {} has no domain {}, only {} domains", m_rank, domainIdx, - m_domainGroups.size())); + domain_count())); - T* data = hasField(fieldName) - ? static_cast(m_fieldsGroups[domainIdx] - ->getView(axom::fmt::format("{}/values", fieldName)) - ->getVoidPtr()) - : nullptr; + auto* domain = m_group->getGroup(domainIdx); + auto* fields = domain->getGroup("fields"); + auto* field = fields->getGroup(fieldName); + T* data = + field ? static_cast(field->getView("values")->getVoidPtr()) : nullptr; - return axom::ArrayView(data, numPoints(domainIdx)); + return field ? axom::ArrayView(data, numPoints(domainIdx)) + : axom::ArrayView(); } template @@ -557,23 +605,64 @@ struct BlueprintParticleMesh int domainIdx) { SLIC_ASSERT_MSG( - domainIdx >= 0 && size_t(domainIdx) < m_domainGroups.size(), + domainIdx >= 0 && axom::IndexType(domainIdx) < domain_count(), axom::fmt::format("Rank {} has only {} domains, no domain index {}", m_rank, - m_domainGroups.size(), + domain_count(), domainIdx)); // Note: the implementation currently assumes that the field data is // interleaved, so it is safe to get a pointer to the beginning of the // x-coordinate's data. This will be relaxed in the future, and we will // need to modify this implementation accordingly. - T* data = hasField(fieldName) - ? static_cast(m_fieldsGroups[domainIdx] - ->getView(axom::fmt::format("{}/values/x", fieldName)) - ->getVoidPtr()) - : nullptr; + T* data = nullptr; + axom::IndexType npts = 0; + bool has = + m_group->getGroup(domainIdx)->getGroup("fields")->hasGroup(fieldName); + if(has) + { + auto xView = + m_group->getGroup(domainIdx)->getGroup("fields")->getGroup(fieldName)->getView( + "values/x"); + data = static_cast(xView->getVoidPtr()); + npts = xView->getNumElements(); + } + return axom::ArrayView(data, npts); + } + + /// Returns an array containing the positions of the mesh vertices + axom::Array getVertexPositions(axom::IndexType domainIdx) + { + sidre::Group* cvg = getDomain(domainIdx)->getGroup( + axom::fmt::format("coordsets/{}/values", getCoordsetName())); + int ndim = cvg->getNumViews(); + sidre::View* xv = cvg->getView("x"); + sidre::View* yv = cvg->getView("y"); + sidre::View* zv = ndim == 3 ? cvg->getView("z") : nullptr; + axom::IndexType npts = xv->getNumElements(); + double* xp = xv->getData(); + double* yp = yv->getData(); + double* zp = zv ? (double*)(zv->getData()) : nullptr; + double* xyzs[3] {xp, yp, zp}; + axom::Array rval(npts, ndim); + for(int i = 0; i < npts; ++i) + { + for(int d = 0; d < ndim; ++d) + { + rval[i][d] = xyzs[d][i]; + } + } + return rval; + } - return axom::ArrayView(data, numPoints(domainIdx)); + sidre::Group* getDomain(axom::IndexType domain) + { + return m_group->getGroup(domain); + } + sidre::Group* getFields(axom::IndexType domainIdx) + { + auto* fields = m_group->getGroup(domainIdx)->getGroup("fields"); + return fields; } /// Checks whether the blueprint is valid and prints diagnostics @@ -589,7 +678,6 @@ struct BlueprintParticleMesh slic::flushStreams(); return false; } - // info.print(); } return true; } @@ -634,29 +722,19 @@ struct BlueprintParticleMesh topoGroup->createViewString("type", "unstructured"); topoGroup->createViewString("elements/shape", "point"); - auto* fieldsGroup = domainGroup->createGroup("fields"); - - domainGroup->createViewScalar("state/domain_id", m_rank); - - m_domainGroups.push_back(domainGroup); - m_coordsGroups.push_back(coordsGroup); - m_topoGroups.push_back(topoGroup); - m_fieldsGroups.push_back(fieldsGroup); + domainGroup->createGroup("fields"); + domainGroup->createGroup("state"); - return axom::IndexType(m_domainGroups.size() - 1); + return m_group->getNumGroups() - 1; } private: - const std::string m_coordsetName; - const std::string m_topologyName; + //!@brief Whether stride/offsets are given for blueprint mesh coordinates data. + bool m_coordsAreStrided = false; + std::string m_topologyName; + std::string m_coordsetName; /// Parent group for the entire mesh sidre::Group* m_group; - /// Group for each domain in multidomain mesh - std::vector m_domainGroups; - - std::vector m_coordsGroups; - std::vector m_topoGroups; - std::vector m_fieldsGroups; int m_rank; int m_nranks; @@ -670,9 +748,7 @@ struct BlueprintParticleMesh class ObjectMeshWrapper { public: - using Circle = primal::Sphere; - - ObjectMeshWrapper(sidre::Group* group) : m_objectMesh(group) + ObjectMeshWrapper(sidre::Group* group) : m_objectMesh(group, "mesh", "coords") { SLIC_ASSERT(group != nullptr); } @@ -682,148 +758,11 @@ class ObjectMeshWrapper /// Get a pointer to the root group for this mesh sidre::Group* getBlueprintGroup() const { return m_objectMesh.root_group(); } + std::string getTopologyName() const { return m_objectMesh.getTopologyName(); } std::string getCoordsetName() const { return m_objectMesh.getCoordsetName(); } void setVerbosity(bool verbose) { m_verbose = verbose; } - /** - * Generates a collection of \a numPoints points along a circle. - * Point spacing can be random (default) or uniform. - */ - void generateCircleMesh(const Circle& circle, - int totalNumPoints, - int localDomainCount, - bool randomSpacing = true) - { - using axom::utilities::random_real; - - constexpr int DIM = 2; - using PointType = primal::Point; - using PointArray = axom::Array; - - int rank = m_objectMesh.getRank(); - int nranks = m_objectMesh.getNumRanks(); - - // perform scan on ranks to compute totalNumPoints, thetaStart and thetaEnd - axom::Array sums(nranks, nranks); - { - axom::Array indivDomainCounts(nranks, nranks); - indivDomainCounts.fill(-1); - MPI_Allgather(&localDomainCount, - 1, - MPI_INT, - indivDomainCounts.data(), - 1, - MPI_INT, - MPI_COMM_WORLD); - - SLIC_DEBUG_IF(m_verbose, - axom::fmt::format("After all gather: [{}]", - axom::fmt::join(indivDomainCounts, ","))); - - sums[0] = indivDomainCounts[0]; - for(int i = 1; i < nranks; ++i) - { - sums[i] = sums[i - 1] + indivDomainCounts[i]; - } - // If no rank has any domains, force last one to 1 domain. - if(sums[nranks - 1] == 0) - { - sums[nranks - 1] = 1; - if(rank == nranks - 1) - { - localDomainCount = 1; - } - } - } - - SLIC_DEBUG_IF( - m_verbose, - axom::fmt::format("After scan: [{}]", axom::fmt::join(sums, ","))); - - int globalDomainCount = sums[nranks - 1]; - totalNumPoints = std::max(totalNumPoints, globalDomainCount); - int ptsPerDomain = totalNumPoints / globalDomainCount; - int domainsWithExtraPt = totalNumPoints % globalDomainCount; - - int myDomainBegin = rank == 0 ? 0 : sums[rank - 1]; - int myDomainEnd = sums[rank]; - assert(myDomainEnd - myDomainBegin == localDomainCount); - - double radius = circle.getRadius(); - const auto& center = circle.getCenter(); - const double avgAng = 2. * M_PI / totalNumPoints; - - for(int di = myDomainBegin; di < myDomainEnd; ++di) - { - int pBegin = di * ptsPerDomain + std::min(di, domainsWithExtraPt); - int pEnd = (di + 1) * ptsPerDomain + std::min((di + 1), domainsWithExtraPt); - int domainPointCount = pEnd - pBegin; - PointArray pts(0, domainPointCount); - - for(int pi = pBegin; pi < pEnd; ++pi) - { - const double ang = randomSpacing - ? random_real(avgAng * pBegin, avgAng * pEnd) - : pi * avgAng; - const double rsinT = center[1] + radius * std::sin(ang); - const double rcosT = center[0] + radius * std::cos(ang); - pts.push_back(PointType {rcosT, rsinT}); - } - m_objectMesh.setPoints(pts); - } - - axom::slic::flushStreams(); - SLIC_ASSERT(m_objectMesh.isValid()); - } - - /** - * Change cp_domain data from a local index to a global domain index - * by adding rank offsets. - * This is an optional step to transform domain ids verification. - */ - void add_rank_offset_to_cp_domain_ids(conduit::Node& queryMesh) - { - int nranks = m_objectMesh.getNumRanks(); - - int localDomainCount = m_objectMesh.domain_count(); - - // perform scan on ranks to compute totalNumPoints, thetaStart and thetaEnd - axom::Array starts(nranks, nranks); - { - axom::Array indivDomainCounts(nranks, nranks); - indivDomainCounts.fill(-1); - MPI_Allgather(&localDomainCount, - 1, - MPI_INT, - indivDomainCounts.data(), - 1, - MPI_INT, - MPI_COMM_WORLD); - starts[0] = 0; - for(int i = 1; i < nranks; ++i) - { - starts[i] = starts[i - 1] + indivDomainCounts[i]; - } - } - - for(conduit::Node& dom : queryMesh.children()) - { - auto& fields = dom.fetch_existing("fields"); - auto cpDomainIdxs = - fields.fetch_existing("cp_domain_index/values").as_int_array(); - auto cpRanks = fields.fetch_existing("cp_rank/values").as_int_array(); - for(int i = 0; i < cpDomainIdxs.number_of_elements(); ++i) - { - const auto& r = cpRanks[i]; - if(r >= 0) - { - cpDomainIdxs[i] += starts[cpRanks[i]]; - } - } - } - } - /// Outputs the object mesh to disk void saveMesh(const std::string& filename = "object_mesh") { @@ -841,53 +780,22 @@ class ObjectMeshWrapper class QueryMeshWrapper { public: - using Circle = primal::Sphere; - //!@brief Construct with blueprint mesh. QueryMeshWrapper(sidre::Group* group, const std::string& meshFilename) : m_queryMesh(group) { // Test reading in multidomain mesh. m_queryMesh.read_blueprint_mesh(meshFilename); - setupParticleMesh(); + // setupParticleMesh(); } BlueprintParticleMesh& getParticleMesh() { return m_queryMesh; } sidre::Group* getBlueprintGroup() const { return m_queryMesh.root_group(); } + std::string getTopologyName() const { return m_queryMesh.getTopologyName(); } std::string getCoordsetName() const { return m_queryMesh.getCoordsetName(); } - /// Returns an array containing the positions of the mesh vertices - template - PointArray getVertexPositions(int domainIdx) - { - // SLIC_ERROR("TODO: get a PointArray from a sidre coordset/values group."); - sidre::Group* cvg = m_queryMesh.domain_group(domainIdx)->getGroup( - axom::fmt::format("coordsets/{}/values", m_queryMesh.getCoordsetName())); - int ndim = cvg->getNumViews(); - sidre::View* xv = cvg->getView("x"); - sidre::View* yv = cvg->getView("y"); - sidre::View* zv = ndim == 3 ? cvg->getView("z") : nullptr; - axom::IndexType npts = xv->getNumElements(); - double* xp = xv->getData(); - double* yp = yv->getData(); - double* zp = zv ? (double*)(zv->getData()) : nullptr; - double* xyzs[3] {xp, yp, zp}; - PointArray rval(npts, npts); - for(int d = 0; d < ndim; ++d) - { - double* vs = xyzs[d]; - for(int i = 0; i < npts; ++i) - { - rval[i][d] = vs[i]; - } - } - typename PointArray::value_type pt; - axom::primal::Point pt1; - return rval; - } - /// Saves the mesh to disk void saveMesh(const std::string& filename) { @@ -934,30 +842,45 @@ class QueryMeshWrapper sidre::Group& dstFieldsGroup = *domGroup.getGroup("fields"); const conduit::Node& srcFieldsNode = domNode.fetch_existing("fields"); { + if(!m_queryMesh.hasScalarField("cp_rank")) + { + m_queryMesh.registerNodalScalarField("cp_rank"); + } auto dst = dstFieldsGroup.getGroup("cp_rank"); auto src = srcFieldsNode.fetch_existing("cp_rank"); bool goodImport = dst->importConduitTree(src); - ; SLIC_ASSERT(goodImport); AXOM_UNUSED_VAR(goodImport); } { + if(!m_queryMesh.hasScalarField("cp_index")) + { + m_queryMesh.registerNodalScalarField("cp_index"); + } auto dst = dstFieldsGroup.getGroup("cp_index"); auto src = srcFieldsNode.fetch_existing("cp_index"); bool goodImport = dst->importConduitTree(src); - ; SLIC_ASSERT(goodImport); AXOM_UNUSED_VAR(goodImport); } + if(srcFieldsNode.has_child("cp_domain_index")) { - auto dst = dstFieldsGroup.getGroup("cp_domain_index"); + if(!m_queryMesh.hasScalarField("cp_domain_index")) + { + m_queryMesh.registerNodalScalarField( + "cp_domain_index"); + } auto src = srcFieldsNode.fetch_existing("cp_domain_index"); + auto dst = dstFieldsGroup.getGroup("cp_domain_index"); bool goodImport = dst->importConduitTree(src); - ; SLIC_ASSERT(goodImport); AXOM_UNUSED_VAR(goodImport); } { + if(!m_queryMesh.hasVectorField("cp_coords")) + { + m_queryMesh.registerNodalVectorField("cp_coords"); + } auto dstGroup = dstFieldsGroup.getGroup("cp_coords"); auto srcNode = srcFieldsNode.fetch_existing("cp_coords"); int dim = srcNode.fetch_existing("values").number_of_children(); @@ -976,23 +899,6 @@ class QueryMeshWrapper } } } - - m_queryMesh.reset_group_pointers(); - for(axom::IndexType di = 0; di < m_queryMesh.domain_count(); ++di) - { - assert(m_queryMesh.domain_group(di) == - m_queryMesh.root_group()->getGroup(di)); - assert(m_queryMesh.coords_group(di) == - m_queryMesh.domain_group(di) - ->getGroup("coordsets") - ->getGroup(m_queryMesh.getCoordsetName())); - assert(m_queryMesh.topo_group(di) == - m_queryMesh.domain_group(di) - ->getGroup("topologies") - ->getGroup(m_queryMesh.get_topology_name())); - assert(m_queryMesh.fields_group(di) == - m_queryMesh.domain_group(di)->getGroup("fields")); - } } /** @@ -1000,21 +906,21 @@ class QueryMeshWrapper * - check that points within threshold have a closest point * on the object. * - check that found closest-point is near its corresponding - * closest point on the circle (within tolerance) + * closest point on the sphere (within tolerance) * * Return number of errors found on the local mesh partition. * Populate "error_flag" field with the number of errors, for * visualization. * - * Randomized circle points (--random-spacing switch) can cause - * false positives, so when it's on, distance inaccuracy is a warning - * (not an error) for the purpose of checking. + * Randomizing points (--random-spacing switch) can cause false + * positives, so when it's on, distance inaccuracy is a warning (not + * an error) for the purpose of checking. */ - template - int checkClosestPoints(const Circle& circle, const Input& params) + template + int checkClosestPoints(const axom::primal::Sphere& sphere, + const Input& params) { - using PointType = Circle::PointType; - using PointArray = axom::Array; + using PointType = axom::primal::Point; m_queryMesh.registerNodalScalarField("error_flag"); @@ -1022,14 +928,14 @@ class QueryMeshWrapper int sumWarningCount = 0; for(axom::IndexType dIdx = 0; dIdx < m_queryMesh.domain_count(); ++dIdx) { - PointArray queryPts = m_queryMesh.getPoints(dIdx); + auto queryPts = m_queryMesh.getPoints(dIdx); axom::ArrayView cpCoords = m_queryMesh.getNodalVectorField("cp_coords", dIdx); + SLIC_INFO(axom::fmt::format("Closest points ({}):", cpCoords.size())); axom::ArrayView cpIndices = m_queryMesh.getNodalScalarField("cp_index", dIdx); - SLIC_INFO(axom::fmt::format("Closest points ({}):", cpCoords.size())); axom::ArrayView errorFlag = m_queryMesh.getNodalScalarField("error_flag", dIdx); @@ -1043,15 +949,20 @@ class QueryMeshWrapper } /* - Allowable slack is half the arclength between 2 adjacent circle - points. A query point on the circle can correctly have that + Allowable slack is half the arclength between 2 adjacent object + points. A query point on the object can correctly have that closest-distance, even though the analytical distance is zero. If spacing is random, distance between adjacent points is not predictable, leading to false positives. We don't claim errors for this in when using random. */ - const double avgObjectRes = - 2 * M_PI * params.circleRadius / params.circlePoints; + const double longSpacing = + 2 * M_PI * params.circleRadius / params.longPointCount; + const double latSpacing = params.circleRadius * M_PI / 180 * + (params.latRange[1] - params.latRange[0]) / params.latPointCount; + const double avgObjectRes = DIM == 2 + ? longSpacing + : std::sqrt(longSpacing * longSpacing + latSpacing * latSpacing); const double allowableSlack = avgObjectRes / 2; using IndexSet = slam::PositionSet<>; @@ -1061,7 +972,7 @@ class QueryMeshWrapper const auto& qPt = queryPts[i]; const auto& cpCoord = cpCoords[i]; - double analyticalDist = std::fabs(circle.computeSignedDistance(qPt)); + double analyticalDist = std::fabs(sphere.computeSignedDistance(qPt)); const bool closestPointFound = (cpIndices[i] == -1); if(closestPointFound) { @@ -1090,14 +1001,16 @@ class QueryMeshWrapper cpCoord)); } - if(!axom::utilities::isNearlyEqual(circle.computeSignedDistance(cpCoord), + if(!axom::utilities::isNearlyEqual(sphere.computeSignedDistance(cpCoord), 0.0)) { errf = true; - SLIC_INFO(axom::fmt::format( - "***Error: Closest point ({}) for index {} is not on the circle.", - cpCoords[i], - i)); + SLIC_INFO( + axom::fmt::format("***Error: Closest point ({}) for index {} " + "({}) is not on the sphere.", + cpCoords[i], + i, + qPt)); } double dist = sqrt(primal::squared_distance(qPt, cpCoord)); @@ -1106,19 +1019,24 @@ class QueryMeshWrapper if(params.randomSpacing) { ++sumWarningCount; - SLIC_INFO(axom::fmt::format( - "***Warning: Closest distance for index {} is {}, off by {}.", - i, - dist, - dist - analyticalDist)); + SLIC_INFO( + axom::fmt::format("***Warning: Closest distance for {} (index " + "{}, cp {}) is {}, off by {}.", + qPt, + i, + cpCoords[i], + dist, + dist - analyticalDist)); } else { errf = true; SLIC_INFO( - axom::fmt::format("***Error: Closest distance for index {} is " - "{}, off by {}.", + axom::fmt::format("***Warning: Closest distance for {} (index " + "{}, cp {}) is {}, off by {}.", + qPt, i, + cpCoords[i], dist, dist - analyticalDist)); } @@ -1141,6 +1059,172 @@ class QueryMeshWrapper BlueprintParticleMesh m_queryMesh; }; +/** + * Generates points on a sphere, partitioned into multiple domains. + * Point spacing in the longitudinal direction can be random (default) or uniform. + * 3D points cover the given latitude range. + */ +void generateObjectPoints(BlueprintParticleMesh& particleMesh, + int spatialDimension, + const std::vector& center, + double radius, + int longPointCount, + int localDomainCount, + bool randomSpacing = true, + double minLatitude = 0.0, + double maxLatitude = 0.0, + int latPointCount = 1) +{ + using axom::utilities::random_real; + + int rank = particleMesh.getRank(); + int nranks = particleMesh.getNumRanks(); + + // rank scan to sum longPointCount and determine local range of longitudinal angles. + axom::Array sums(nranks, nranks); + { + axom::Array indivDomainCounts(nranks, nranks); + indivDomainCounts.fill(-1); + MPI_Allgather(&localDomainCount, + 1, + MPI_INT, + indivDomainCounts.data(), + 1, + MPI_INT, + MPI_COMM_WORLD); + + SLIC_DEBUG_IF(params.isVerbose(), + axom::fmt::format("After all gather: [{}]", + axom::fmt::join(indivDomainCounts, ","))); + + sums[0] = indivDomainCounts[0]; + for(int i = 1; i < nranks; ++i) + { + sums[i] = sums[i - 1] + indivDomainCounts[i]; + } + // If no rank has any domains, force last one to have 1 domain. + if(sums[nranks - 1] == 0) + { + sums[nranks - 1] = 1; + if(rank == nranks - 1) + { + localDomainCount = 1; + } + } + } + + SLIC_DEBUG_IF( + params.isVerbose(), + axom::fmt::format("After scan: [{}]", axom::fmt::join(sums, ","))); + + int globalDomainCount = sums[nranks - 1]; + longPointCount = std::max(longPointCount, globalDomainCount); + int longPtsPerDomain = longPointCount / globalDomainCount; + int domainsWithExtraPt = longPointCount % globalDomainCount; + + int myDomainBegin = rank == 0 ? 0 : sums[rank - 1]; + int myDomainEnd = sums[rank]; + SLIC_ASSERT(myDomainEnd - myDomainBegin == localDomainCount); + + if(spatialDimension == 2) + { + minLatitude = 0.0; + maxLatitude = 0.0; + latPointCount = 1; + } + minLatitude *= M_PI / 180; + maxLatitude *= M_PI / 180; + const double longSpacing = 2. * M_PI / longPointCount; + const double latSpacing = latPointCount < 2 || latPointCount == 1 + ? 0 + : (maxLatitude - minLatitude) / (latPointCount - 1); + + for(int di = myDomainBegin; di < myDomainEnd; ++di) + { + int pBegin = di * longPtsPerDomain + std::min(di, domainsWithExtraPt); + int pEnd = + (di + 1) * longPtsPerDomain + std::min((di + 1), domainsWithExtraPt); + int domainPointCount = pEnd - pBegin; + domainPointCount *= latPointCount; + axom::Array pts(domainPointCount, spatialDimension); + axom::IndexType iPts = 0; + + for(int li = 0; li < latPointCount; ++li) + { + double latAngle = minLatitude + li * latSpacing; + double xyRadius = + radius * std::cos(latAngle); // Project radius onto x-y plane. + double z = + spatialDimension == 2 ? 0 : center[2] + radius * std::sin(latAngle); + for(int pi = pBegin; pi < pEnd; ++pi) + { + const double ang = randomSpacing + ? random_real(longSpacing * pBegin, longSpacing * pEnd) + : pi * longSpacing; + const double rsinT = center[1] + xyRadius * std::sin(ang); + const double rcosT = center[0] + xyRadius * std::cos(ang); + pts[iPts][0] = rcosT; + pts[iPts][1] = rsinT; + if(spatialDimension > 2) + { + pts[iPts][2] = z; + } + ++iPts; + } + } + particleMesh.setPoints(di, pts); + } + + axom::slic::flushStreams(); + SLIC_ASSERT(particleMesh.isValid()); +} + +//--------------------------------------------------------------------------- +// Transform closest points to distances and directions +//--------------------------------------------------------------------------- +template +void computeDistancesAndDirections(BlueprintParticleMesh& queryMesh, + const std::string& cpCoordsField, + const std::string& cpIndexField, + const std::string& distanceField, + const std::string& directionField) +{ + SLIC_ASSERT(queryMesh.dimension() == DIM); + + using primal::squared_distance; + using PointType = primal::Point; + using IndexSet = slam::PositionSet<>; + + PointType nowhere(std::numeric_limits::signaling_NaN()); + const double nodist = std::numeric_limits::signaling_NaN(); + + queryMesh.registerNodalScalarField(distanceField); + queryMesh.registerNodalVectorField(directionField); + for(axom::IndexType di = 0; di < queryMesh.domain_count(); ++di) + { + auto cpCoords = queryMesh.getNodalVectorField(cpCoordsField, di); + + auto cpIndices = + queryMesh.getNodalScalarField(cpIndexField, di); + + axom::Array qPts = queryMesh.getVertexPositions(di); + axom::ArrayView distances = + queryMesh.getNodalScalarField("distance", di); + axom::ArrayView directions = + queryMesh.getNodalVectorField("direction", di); + axom::IndexType ptCount = queryMesh.numPoints(di); + for(auto ptIdx : IndexSet(ptCount)) + { + const bool has_cp = cpIndices[ptIdx] >= 0; + const PointType& cp = has_cp ? cpCoords[ptIdx] : nowhere; + const PointType& qPt = has_cp ? PointType(&qPts[ptIdx][0]) : nowhere; + distances[ptIdx] = has_cp ? sqrt(squared_distance(qPt, cp)) : nodist; + directions[ptIdx] = + PointType(has_cp ? (cp - qPt).array() : nowhere.array()); + } + } +} + void make_coords_contiguous(conduit::Node& coordValues) { bool isInterleaved = conduit::blueprint::mcarray::is_interleaved(coordValues); @@ -1200,17 +1284,14 @@ void finalizeLogger() int main(int argc, char** argv) { MPI_Init(&argc, &argv); - int my_rank, num_ranks; MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); MPI_Comm_size(MPI_COMM_WORLD, &num_ranks); initializeLogger(); - //slic::setAbortOnWarning(true); //--------------------------------------------------------------------------- // Set up and parse command line arguments //--------------------------------------------------------------------------- - Input params; axom::CLI::App app {"Driver for distributed distance query"}; try @@ -1236,27 +1317,22 @@ int main(int argc, char** argv) { SLIC_INFO(axom::fmt::format( "***Warning: Result-checking may yield false positive (warnings) when " - "circle points have random spacing. High resolution helps limit this." + "sphere points have random spacing. High resolution helps limit this." "We recommend at least 500 points for each radius length unit.")); } - constexpr int DIM = 2; - - using PointType = primal::Point; - using PointArray = axom::Array; - using IndexSet = slam::PositionSet<>; - using Circle = primal::Sphere; - #if defined(AXOM_USE_UMPIRE) //--------------------------------------------------------------------------- // Memory resource. For testing, choose device memory if appropriate. //--------------------------------------------------------------------------- - const std::string umpireResourceName = - params.policy == RuntimePolicy::seq || params.policy == RuntimePolicy::omp + const std::string umpireResourceName = params.policy == RuntimePolicy::seq ? "HOST" : + #if defined(AXOM_RUNTIME_POLICY_USE_OPENMP) + params.policy == RuntimePolicy::omp ? "HOST" : + #endif #if defined(UMPIRE_ENABLE_DEVICE) - "DEVICE" + "DEVICE" #elif defined(UMPIRE_ENABLE_UM) "UM" #elif defined(UMPIRE_ENABLE_PINNED) @@ -1269,113 +1345,69 @@ int main(int argc, char** argv) umpire::Allocator umpireAllocator = rm.getAllocator(umpireResourceName); #endif + // Storage for meshes. + sidre::DataStore dataStore; + //--------------------------------------------------------------------------- - // Load/generate object mesh + // Load query mesh and generate a particle mesh over its nodes + // These will be used to query the closest points on the object mesh(es) //--------------------------------------------------------------------------- - const Circle circle( - PointType(params.circleCenter.data(), params.circleCenter.size()), - params.circleRadius); - sidre::DataStore objectDS; - ObjectMeshWrapper objectMeshWrapper( - objectDS.getRoot()->createGroup("object_mesh", true)); - objectMeshWrapper.setVerbosity(params.isVerbose()); + QueryMeshWrapper queryMeshWrapper( + dataStore.getRoot()->createGroup("queryMesh", true), + params.meshFile); + if(params.isVerbose()) { - SLIC_ASSERT(params.objDomainCountRange[1] >= params.objDomainCountRange[0]); - const unsigned int omin = params.objDomainCountRange[0]; - const unsigned int omax = params.objDomainCountRange[1]; - const double prob = axom::utilities::random_real(0., 1.); - int localDomainCount = omin + int(0.5 + prob * (omax - omin)); - objectMeshWrapper.generateCircleMesh(circle, - params.circlePoints, - localDomainCount, - params.randomSpacing); + queryMeshWrapper.getParticleMesh().printMeshSizeStats("Query mesh"); } - - SLIC_INFO_IF( - params.isVerbose(), - axom::fmt::format("Object mesh has {} points in {} domains locally", - objectMeshWrapper.getParticleMesh().numPoints(), - objectMeshWrapper.getParticleMesh().domain_count())); - - objectMeshWrapper.saveMesh(params.objectFile); slic::flushStreams(); + const size_t spatialDim = queryMeshWrapper.getParticleMesh().dimension(); + SLIC_ASSERT(params.circleCenter.size() == spatialDim); + //--------------------------------------------------------------------------- - // Load computational mesh and generate a particle mesh over its nodes - // These will be used to query the closest points on the object mesh(es) + // Generate object mesh //--------------------------------------------------------------------------- - sidre::DataStore queryDS; // TODO: Need separate stores for object and query? - QueryMeshWrapper queryMeshWrapper( - queryDS.getRoot()->createGroup("queryMesh", true), - params.meshFile); - // queryMeshWrapper.print_mesh_info(); - - SLIC_INFO_IF( - params.isVerbose(), - axom::fmt::format("Query mesh has {} points in {} domains locally", - queryMeshWrapper.getParticleMesh().numPoints(), - queryMeshWrapper.getParticleMesh().domain_count())); - slic::flushStreams(); - auto getIntMinMax = [](int inVal, int& minVal, int& maxVal, int& sumVal) { - MPI_Allreduce(&inVal, &minVal, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD); - MPI_Allreduce(&inVal, &maxVal, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(&inVal, &sumVal, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - }; + ObjectMeshWrapper objectMeshWrapper( + dataStore.getRoot()->createGroup("object_mesh", true)); + objectMeshWrapper.setVerbosity(params.isVerbose()); - // Output some global mesh size stats - { - int mn, mx, sum; - getIntMinMax(objectMeshWrapper.getParticleMesh().numPoints(), mn, mx, sum); - SLIC_INFO(axom::fmt::format( - "Object mesh has {{min:{}, max:{}, sum:{}, avg:{}}} points", - mn, - mx, - sum, - (double)sum / num_ranks)); - } { - int mn, mx, sum; - getIntMinMax(objectMeshWrapper.getParticleMesh().domain_count(), mn, mx, sum); - SLIC_INFO(axom::fmt::format( - "Object mesh has {{min:{}, max:{}, sum:{}, avg:{}}} domains", - mn, - mx, - sum, - (double)sum / num_ranks)); - } - { - int mn, mx, sum; - getIntMinMax(queryMeshWrapper.getParticleMesh().numPoints(), mn, mx, sum); - SLIC_INFO(axom::fmt::format( - "Query mesh has {{min:{}, max:{}, sum:{}, avg:{}}} points", - mn, - mx, - sum, - (double)sum / num_ranks)); + SLIC_ASSERT(params.objDomainCountRange[1] >= params.objDomainCountRange[0]); + const unsigned int omin = params.objDomainCountRange[0]; + const unsigned int omax = params.objDomainCountRange[1]; + const double prob = axom::utilities::random_real(0., 1.); + int localDomainCount = omin + int(0.5 + prob * (omax - omin)); + generateObjectPoints(objectMeshWrapper.getParticleMesh(), + spatialDim, + params.circleCenter, + params.circleRadius, + params.longPointCount, + localDomainCount, + params.randomSpacing, + params.latRange.size() > 0 ? params.latRange[0] : 0.0, + params.latRange.size() > 1 ? params.latRange[1] : 0.0, + params.latPointCount); } + + if(params.isVerbose()) { - int mn, mx, sum; - getIntMinMax(queryMeshWrapper.getParticleMesh().domain_count(), mn, mx, sum); - SLIC_INFO(axom::fmt::format( - "Query mesh has {{min:{}, max:{}, sum:{}, avg:{}}} domains", - mn, - mx, - sum, - (double)sum / num_ranks)); + objectMeshWrapper.getParticleMesh().printMeshSizeStats("Object mesh"); } + slic::flushStreams(); + objectMeshWrapper.saveMesh(params.objectFile); slic::flushStreams(); //--------------------------------------------------------------------------- - // Initialize spatial index for querying points, and run query + // Initialize spatial index for object points, and run query //--------------------------------------------------------------------------- auto init_str = banner(axom::fmt::format("Initializing BVH tree over {} points", - params.circlePoints)); + params.longPointCount)); axom::utilities::Timer initTimer(false); axom::utilities::Timer queryTimer(false); @@ -1417,13 +1449,12 @@ int main(int argc, char** argv) query.setAllocatorID(umpireAllocator.getId()); #endif query.setMpiCommunicator(MPI_COMM_WORLD, true); - query.setDimension(DIM); query.setVerbosity(params.isVerbose()); query.setDistanceThreshold(params.distThreshold); // To test support for single-domain format, use single-domain when possible. query.setObjectMesh( objectMeshNode.number_of_children() == 1 ? objectMeshNode[0] : objectMeshNode, - objectMeshWrapper.getCoordsetName()); + objectMeshWrapper.getTopologyName()); // Build the spatial index over the object on each rank SLIC_INFO(init_str); @@ -1438,7 +1469,7 @@ int main(int argc, char** argv) queryTimer.start(); query.computeClosestPoints( queryMeshNode.number_of_children() == 1 ? queryMeshNode[0] : queryMeshNode, - queryMeshWrapper.getCoordsetName()); + queryMeshWrapper.getTopologyName()); queryTimer.stop(); auto getDoubleMinMax = @@ -1470,50 +1501,42 @@ int main(int argc, char** argv) maxQuery)); } slic::flushStreams(); - - objectMeshWrapper.add_rank_offset_to_cp_domain_ids(queryMeshNode); queryMeshWrapper.update_closest_points(queryMeshNode); int errCount = 0; int localErrCount = 0; if(params.checkResults) { - localErrCount = queryMeshWrapper.checkClosestPoints(circle, params); + if(spatialDim == 2) + { + primal::Point center(params.circleCenter.data()); + primal::Sphere sphere(center, params.circleRadius); + localErrCount = queryMeshWrapper.checkClosestPoints(sphere, params); + } + else if(spatialDim == 3) + { + primal::Point center(params.circleCenter.data()); + primal::Sphere sphere(center, params.circleRadius); + localErrCount = queryMeshWrapper.checkClosestPoints(sphere, params); + } } MPI_Allreduce(&localErrCount, &errCount, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - //--------------------------------------------------------------------------- - // Transform closest points to distances and directions - //--------------------------------------------------------------------------- - using primal::squared_distance; - - auto& queryMesh = queryMeshWrapper.getParticleMesh(); - PointType nowhere(std::numeric_limits::signaling_NaN()); - const double nodist = std::numeric_limits::signaling_NaN(); - queryMesh.registerNodalScalarField("distance"); - queryMesh.registerNodalVectorField("direction"); - for(axom::IndexType di = 0; di < queryMesh.domain_count(); ++di) + if(spatialDim == 2) { - auto cpCoords = queryMesh.getNodalVectorField("cp_coords", di); - - auto cpIndices = - queryMesh.getNodalScalarField("cp_index", di); - - PointArray qPts = queryMeshWrapper.getVertexPositions(di); - axom::ArrayView distances = - queryMesh.getNodalScalarField("distance", di); - axom::ArrayView directions = - queryMesh.getNodalVectorField("direction", di); - axom::IndexType ptCount = queryMeshWrapper.getParticleMesh().numPoints(di); - for(auto ptIdx : IndexSet(ptCount)) - { - const bool has_cp = cpIndices[ptIdx] >= 0; - const PointType& cp = has_cp ? cpCoords[ptIdx] : nowhere; - distances[ptIdx] = - has_cp ? sqrt(squared_distance(qPts[ptIdx], cp)) : nodist; - directions[ptIdx] = - PointType(has_cp ? (cp - qPts[ptIdx]).array() : nowhere.array()); - } + computeDistancesAndDirections<2>(queryMeshWrapper.getParticleMesh(), + "cp_coords", + "cp_index", + "distance", + "direction"); + } + else if(spatialDim == 3) + { + computeDistancesAndDirections<3>(queryMeshWrapper.getParticleMesh(), + "cp_coords", + "cp_index", + "distance", + "direction"); } // queryMeshNode.print(); diff --git a/src/axom/quest/examples/quest_inout_interface.F b/src/axom/quest/examples/quest_inout_interface.F index 18d4c30ab0..244d7b8f44 100644 --- a/src/axom/quest/examples/quest_inout_interface.F +++ b/src/axom/quest/examples/quest_inout_interface.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) @@ -76,7 +76,7 @@ subroutine run_inout_queries() real(C_DOUBLE) :: x, y, z real(C_DOUBLE) :: EPS = 1E-7 real(C_DOUBLE) :: mesh_bb_min(3), mesh_bb_max(3), mesh_center_of_mass(3) - character(LEN=40) :: Format = "(I4, F8.2, F8.2, F8.2, L3)" + character(LEN=60) :: Format = "(I4, I4, F8.2, F8.2, F8.2, L3)" !...set parameters for the inout query rc = quest_inout_set_verbose(is_verbose) @@ -109,7 +109,7 @@ subroutine run_inout_queries() if (rank == 0) then write(*,*) "** Running containment queries using quest fortran interface" - write(*,*) "[rank, ( x, y, z), inside?]" + write(*,*) "[rank, id, ( x, y, z), inside?]" end if !...run the inout query at some fixed and random points @@ -126,7 +126,7 @@ subroutine run_inout_queries() ins = quest_inout_evaluate(x,y,z) - write(*,Format) rank, x, y, z, ins + write(*,Format) rank, i-1, x, y, z, ins end do !...finalize quest_inout query diff --git a/src/axom/quest/examples/quest_inout_interface.cpp b/src/axom/quest/examples/quest_inout_interface.cpp index aac2ab49a5..5aaf1d9594 100644 --- a/src/axom/quest/examples/quest_inout_interface.cpp +++ b/src/axom/quest/examples/quest_inout_interface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/examples/quest_marching_cubes_example.cpp b/src/axom/quest/examples/quest_marching_cubes_example.cpp index f1a1556537..fb847068c9 100644 --- a/src/axom/quest/examples/quest_marching_cubes_example.cpp +++ b/src/axom/quest/examples/quest_marching_cubes_example.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,15 +14,25 @@ for the function not varying linearly along mesh lines. */ -// Axom includes #include "axom/config.hpp" + +// Implementation requires Conduit. +#ifndef AXOM_USE_CONDUIT + #error "MarchingCubesFullParallel.hpp requires conduit" +#endif + +// Axom includes #include "axom/core.hpp" #include "axom/slic.hpp" #include "axom/primal.hpp" #include "axom/mint/mesh/UnstructuredMesh.hpp" +#include "axom/mint/execution/internal/structured_exec.hpp" +#include "axom/quest/ArrayIndexer.hpp" #include "axom/quest/MarchingCubes.hpp" +#include "axom/quest/MeshViewUtil.hpp" #include "axom/sidre.hpp" #include "axom/core/Types.hpp" +#include "axom/core/numerics/floating_point_limits.hpp" #include "conduit_blueprint.hpp" #include "conduit_relay_io_blueprint.hpp" @@ -47,12 +57,13 @@ namespace quest = axom::quest; namespace slic = axom::slic; -namespace mint = axom::mint; namespace sidre = axom::sidre; namespace primal = axom::primal; namespace mint = axom::mint; namespace numerics = axom::numerics; +using RuntimePolicy = axom::runtime_policy::Policy; + /////////////////////////////////////////////////////////////// // converts the input string into an 80 character string // padded on both sides with '=' symbols @@ -70,43 +81,40 @@ struct Input std::string fieldsFile {"fields"}; // Center of round contour function - bool usingRound {false}; std::vector fcnCenter; + // Scaling factor for gyroid function + std::vector gyroidScale; + // Parameters for planar contour function - bool usingPlanar {false}; std::vector inPlane; std::vector perpDir; std::size_t ndim {0}; - // TODO: Ensure that fcnCenter, inPlane and perpDir sizes match dimensionality. - double contourVal {1.0}; bool checkResults {false}; - quest::MarchingCubesRuntimePolicy policy { - quest::MarchingCubesRuntimePolicy::seq}; + RuntimePolicy policy {RuntimePolicy::seq}; + + quest::MarchingCubesDataParallelism dataParallelism = + quest::MarchingCubesDataParallelism::byPolicy; + + // Distinct MarchingCubes objects count. + int objectRepCount = 1; + // Contour generation count for each MarchingCubes objects. + int contourGenCount = 1; private: bool _verboseOutput {false}; // clang-format off - const std::map s_validPolicies + const std::map s_validImplChoices { - {"seq", quest::MarchingCubesRuntimePolicy::seq} -#if defined(AXOM_USE_RAJA) - #ifdef AXOM_USE_OPENMP - , {"omp", quest::MarchingCubesRuntimePolicy::omp} - #endif - #if defined(AXOM_USE_CUDA) && defined(AXOM_USE_UMPIRE) - , {"cuda", quest::MarchingCubesRuntimePolicy::cuda} - #endif - #if defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) - , {"hip", quest::MarchingCubesRuntimePolicy::hip} - #endif -#endif + {"byPolicy", quest::MarchingCubesDataParallelism::byPolicy} + , {"hybridParallel", quest::MarchingCubesDataParallelism::hybridParallel} + , {"fullParallel", quest::MarchingCubesDataParallelism::fullParallel} }; // clang-format on @@ -118,7 +126,13 @@ struct Input app.add_option("-p, --policy", policy) ->description("Set runtime policy for point query method") ->capture_default_str() - ->transform(axom::CLI::CheckedTransformer(s_validPolicies)); + ->transform( + axom::CLI::CheckedTransformer(axom::runtime_policy::s_nameToPolicy)); + + app.add_option("--dataParallelism", dataParallelism) + ->description("Set full or partial data-parallelism, or by-policy") + ->capture_default_str() + ->transform(axom::CLI::CheckedTransformer(s_validImplChoices)); app.add_option("-m,--mesh-file", meshFile) ->description( @@ -134,23 +148,39 @@ struct Input ->description("Enable/disable verbose output") ->capture_default_str(); - auto* distFromPtOption = app.add_option_group( + auto* distanceFunctionOption = + app.add_option_group("distanceFunctionOption", + "Options for specifying a distance function."); + + auto* distFromPtOption = distanceFunctionOption->add_option_group( "distFromPtOption", "Options for setting up distance-from-point function"); distFromPtOption->add_option("--center", fcnCenter) ->description("Center for distance-from-point function (x,y[,z])") ->expected(2, 3); - auto* distFromPlaneOption = app.add_option_group( + auto* gyroidOption = distanceFunctionOption->add_option_group( + "gyroidOption", + "Options for setting up gyroid function"); + gyroidOption->add_option("--scale", gyroidScale) + ->description("Scaling factor for gyroid function (x,y[,z])") + ->expected(2, 3); + + auto* distFromPlaneOption = distanceFunctionOption->add_option_group( "distFromPlaneOption", "Options for setting up distance-from-plane function"); + auto* perpDirOption = + distFromPlaneOption->add_option("--dir", perpDir) + ->description( + "Positive direction for distance-from-plane function (x,y[,z])") + ->expected(2, 3); distFromPlaneOption->add_option("--inPlane", inPlane) ->description("In-plane point for distance-from-plane function (x,y[,z])") - ->expected(2, 3); - distFromPlaneOption->add_option("--dir", perpDir) - ->description( - "Positive direction for distance-from-plane function (x,y[,z])") - ->expected(2, 3); + ->expected(2, 3) + ->needs(perpDirOption); + + // Require at least one distance function, and allow all three. + distanceFunctionOption->require_option(1, 3); app.add_option("--contourVal", contourVal) ->description("Contour value") @@ -161,6 +191,19 @@ struct Input "Enable/disable checking results against analytical solution") ->capture_default_str(); + // + // Number of repetitions to run + // + + app.add_option("--objectReps", objectRepCount) + ->description("Number of MarchingCube object repetitions to run") + ->capture_default_str(); + + app.add_option("--contourGenReps", contourGenCount) + ->description( + "Number of contour repetitions to run for each MarchingCubes object") + ->capture_default_str(); + app.get_formatter()->column_width(60); // could throw an exception @@ -169,29 +212,26 @@ struct Input slic::setLoggingMsgLevel(_verboseOutput ? slic::message::Debug : slic::message::Info); - ndim = std::max(ndim, fcnCenter.size()); - ndim = std::max(ndim, inPlane.size()); - ndim = std::max(ndim, perpDir.size()); + ndim = std::max( + {ndim, fcnCenter.size(), inPlane.size(), perpDir.size(), gyroidScale.size()}); SLIC_ASSERT_MSG((fcnCenter.empty() || fcnCenter.size() == ndim) && (inPlane.empty() || inPlane.size() == ndim) && - (perpDir.empty() || perpDir.size() == ndim), + (perpDir.empty() || perpDir.size() == ndim) && + (gyroidScale.empty() || gyroidScale.size() == ndim), "fcnCenter, inPlane and perpDir must have consistent sizes " "if specified."); - usingPlanar = !perpDir.empty(); - usingRound = !fcnCenter.empty(); - SLIC_ASSERT_MSG( - usingPlanar || usingRound, - "You must specify a planar scalar function or a round scalar" - " function or both."); - // inPlane defaults to origin if omitted. - if(usingPlanar && inPlane.empty()) + if(usingPlanar() && inPlane.empty()) { inPlane.insert(inPlane.begin(), ndim, 0.0); } } + bool usingPlanar() { return !perpDir.empty(); } + bool usingRound() { return !fcnCenter.empty(); } + bool usingGyroid() { return !gyroidScale.empty(); } + template axom::primal::Point roundContourCenter() const { @@ -199,6 +239,13 @@ struct Input return axom::primal::Point(fcnCenter.data()); } + template + axom::primal::Point gyroidScaleFactor() const + { + SLIC_ASSERT(gyroidScale.size() == DIM); + return axom::primal::Point(gyroidScale.data()); + } + template axom::primal::Point inplanePoint() const { @@ -214,66 +261,42 @@ struct Input } }; -//!@brief Our allocatorId, based on execution policy. -static int allocatorId = axom::INVALID_ALLOCATOR_ID; // Set in main. -static int allocatorIdForPolicy(quest::MarchingCubesRuntimePolicy policy) -{ - //--------------------------------------------------------------------------- - // Set default allocator for possibly testing on devices - //--------------------------------------------------------------------------- - int aid = axom::INVALID_ALLOCATOR_ID; - - // clang-format off - if(policy == axom::quest::MarchingCubesRuntimePolicy::seq) - { - aid = axom::execution_space::allocatorID(); - } -#if defined(AXOM_USE_RAJA) -#ifdef _AXOM_MC_USE_OPENMP - else if(policy == axom::quest::MarchingCubesRuntimePolicy::omp) - { - aid = axom::execution_space::allocatorID(); - } -#endif -#ifdef _AXOM_MC_USE_CUDA - else if(policy == axom::quest::MarchingCubesRuntimePolicy::cuda) - { - aid = axom::execution_space>::allocatorID(); - } -#endif -#ifdef _AXOM_MC_USE_HIP - else if(policy == axom::quest::MarchingCubesRuntimePolicy::hip) - { - aid = axom::execution_space>::allocatorID(); - } -#endif -#endif - // clang-format on - - SLIC_ERROR_IF( - aid == axom::INVALID_ALLOCATOR_ID, - axom::fmt::format("Cannot find allocator id for policy '{}'", policy)); - return aid; -} +//!@brief Our allocator id, based on execution policy. +static int s_allocatorId = axom::INVALID_ALLOCATOR_ID; // Set in main. //!@brief Put a conduit::Node array data into the specified memory space. template -void putConduitDataInNewMemorySpace(conduit::Node& node, - const std::string& path, - int allocId) +void moveConduitDataToNewMemorySpace(conduit::Node& node, + const std::string& path, + int allocId) { - SLIC_ASSERT(node.has_path(path)); - conduit::Node& dataNode = node[path]; + conduit::Node& dataNode = node.fetch_existing(path); SLIC_ASSERT(!dataNode.dtype().is_empty() && !dataNode.dtype().is_object() && !dataNode.dtype().is_list()); std::size_t count = dataNode.dtype().number_of_elements(); - // dataNode.print(); T* oldPtr = static_cast(dataNode.data_ptr()); + bool deleteOld = dataNode.is_data_external(); T* newPtr = axom::allocate(count, allocId); axom::copy(newPtr, oldPtr, count * sizeof(T)); dataNode.set_external(newPtr, count); - dataNode.print(); + if(deleteOld) + { + axom::deallocate(oldPtr); + } +} + +void getIntMinMax(int inVal, int& minVal, int& maxVal, int& sumVal) +{ +#ifdef AXOM_USE_MPI + MPI_Allreduce(&inVal, &minVal, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&inVal, &maxVal, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&inVal, &sumVal, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); +#else + minVal = inVal; + maxVal = inVal; + sumVal = inVal; +#endif } Input params; @@ -287,35 +310,18 @@ struct BlueprintStructuredMesh { public: explicit BlueprintStructuredMesh(const std::string& meshFile, - const std::string& coordset = "coords", - const std::string& topology = "mesh") - : _coordsetPath("coordsets/" + coordset) - , _topologyPath("topologies/" + topology) + const std::string& topologyName) + : _topologyName(topologyName) + , _topologyPath("topologies/" + topologyName) { readBlueprintMesh(meshFile); for(int d = 0; d < _mdMesh.number_of_children(); ++d) { auto dl = domainLengths(d); - SLIC_INFO(axom::fmt::format("dom[{}] size={}", d, dl)); + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("dom[{}] size={}", d, dl)); } - if(_ndims == 2) - { - checkMeshStorage<2>(); - } - if(_ndims == 3) - { - checkMeshStorage<3>(); - } - _maxSpacing = maxSpacing(); - - putMeshDataInNewMemorySpace(_coordsetPath + "/values/x", allocatorId); - putMeshDataInNewMemorySpace(_coordsetPath + "/values/y", allocatorId); - if(_ndims == 3) - { - putMeshDataInNewMemorySpace(_coordsetPath + "/values/z", - allocatorId); - } } /// Return the blueprint mesh in a conduit::Node @@ -324,6 +330,9 @@ struct BlueprintStructuredMesh /// Get number of domains in the multidomain mesh axom::IndexType domainCount() const { return _domCount; } + //// Whether mesh is empty locally. + bool empty() const { return _domCount == 0; } + /// Get domain group. conduit::Node& domain(axom::IndexType domainIdx) { @@ -337,6 +346,18 @@ struct BlueprintStructuredMesh return _mdMesh.child(domainIdx); } + template + axom::quest::MeshViewUtil getDomainView(axom::IndexType domainId) + { + return axom::quest::MeshViewUtil(domain(domainId), _topologyName); + } + + template + axom::quest::MeshViewUtil getDomainView(axom::IndexType domainId) const + { + return axom::quest::MeshViewUtil(domain(domainId), _topologyName); + } + /*! @brief Get the number of cells in each direction of a blueprint single domain. @@ -464,7 +485,7 @@ struct BlueprintStructuredMesh double rval = 0.0; - const conduit::Node& cVals = dom.fetch_existing("coordsets/coords/values"); + const conduit::Node& cVals = dom.fetch_existing(_coordsetPath + "/values"); if(_ndims == 2) { axom::ArrayView xs(cVals["x"].as_double_ptr(), @@ -516,104 +537,6 @@ struct BlueprintStructuredMesh void printMeshInfo() const { _mdMesh.print(); } - template - axom::StackArray getCellsShape(int domainNum) - { - auto domLengths = domainLengths(domainNum); - axom::StackArray shape; - for(int i = 0; i < DIM; ++i) - { - shape[i] = domLengths[i]; - } - return shape; - } - - template - axom::StackArray getNodesShape(int domainNum) - { - auto domLengths = domainLengths(domainNum); - axom::StackArray shape; - for(int i = 0; i < DIM; ++i) - { - shape[i] = 1 + domLengths[i]; - } - return shape; - } - - template - axom::Array> get_coords_view(int domainNum) - { - axom::StackArray shape = getNodesShape(domainNum); - for(int d = 0; d < DIM / 2; ++d) - { - std::swap(shape[d], shape[DIM - 1 - d]); - } - - conduit::Node& dom = _mdMesh[domainNum]; - conduit::Node& coordsValues = dom.fetch_existing("coordsets/coords/values"); - axom::Array> coordsViews(DIM); - for(int d = 0; d < DIM; ++d) - { - double* ptr = coordsValues[d].as_double_ptr(); - coordsViews[d] = axom::ArrayView(ptr, shape); - } - return coordsViews; - } - - template - typename std::enable_if::type checkMeshStorage() - { - SLIC_ASSERT(dimension() == DIM); - for(int d = 0; d < _mdMesh.number_of_children(); ++d) - { - axom::Array> coordsViews = - get_coords_view(d); - const axom::StackArray& shape = - coordsViews[0].shape(); - - // Verify that i is slowest in m_coordsViews. - // It appears conduit stores column major and ArrayView computes offsets - // assuming row major. - int n = 0, errCount = 0; - for(int j = 0; j < shape[0]; ++j) - { - for(int i = 0; i < shape[1]; ++i) - { - errCount += (&coordsViews[0].data()[n++] != &coordsViews[0](j, i)); - } - } - assert(errCount == 0); - } - } - template - typename std::enable_if::type checkMeshStorage() - { - SLIC_ASSERT(dimension() == DIM); - for(int d = 0; d < _mdMesh.number_of_children(); ++d) - { - axom::Array> coordsViews = - get_coords_view(d); - const axom::StackArray& shape = - coordsViews[0].shape(); - - // Verify that i is slowest in m_coordsViews. - // It appears conduit stores column major and ArrayView computes offsets - // assuming row major. - int n = 0, errCount = 0; - for(int k = 0; k < shape[0]; ++k) - { - for(int j = 0; j < shape[1]; ++j) - { - for(int i = 0; i < shape[2]; ++i) - { - errCount += (&coordsViews[0].data()[n++] != &coordsViews[0](k, j, i)); - } - } - } - assert(errCount == 0); - } - } - /*! @param[in] path Path to existing data in the blueprint mesh, relative to each domain in the mesh. @@ -622,11 +545,12 @@ struct BlueprintStructuredMesh supports, i.e., not custom user data. */ template - void putMeshDataInNewMemorySpace(const std::string& path, int allocId) + void moveMeshDataToNewMemorySpace(const std::string& path, int allocId) { + AXOM_PERF_MARK_FUNCTION("moveMeshDataToNewMemorySpace"); // For reference for(auto& dom : _mdMesh.children()) { - putConduitDataInNewMemorySpace(dom, path, allocId); + moveConduitDataToNewMemorySpace(dom, path, allocId); } } @@ -634,12 +558,14 @@ struct BlueprintStructuredMesh int _ndims {-1}; conduit::Node _mdMesh; axom::IndexType _domCount; - const std::string _coordsetPath; + bool _coordsAreStrided = false; + const std::string _topologyName; const std::string _topologyPath; + std::string _coordsetPath; double _maxSpacing = -1.0; /*! - @brief Read a blueprint mesh. + @brief Read a blueprint mesh into conduit::Node _mdMesh. */ void readBlueprintMesh(const std::string& meshFilename) { @@ -653,11 +579,20 @@ struct BlueprintStructuredMesh #else conduit::relay::io::blueprint::load_mesh(meshFilename, _mdMesh); #endif - assert(conduit::blueprint::mesh::is_multi_domain(_mdMesh)); + SLIC_ASSERT(conduit::blueprint::mesh::is_multi_domain(_mdMesh)); _domCount = conduit::blueprint::mesh::number_of_domains(_mdMesh); if(_domCount > 0) { + SLIC_ASSERT(_mdMesh[0].has_path(_topologyPath)); + auto coordsetName = + _mdMesh[0].fetch_existing(_topologyPath + "/coordset").as_string(); + _coordsetPath = axom::fmt::format("coordsets/{}", coordsetName); + SLIC_ASSERT(_mdMesh[0].has_path(_coordsetPath)); + + _coordsAreStrided = _mdMesh[0] + .fetch_existing(_topologyPath + "/elements/dims") + .has_child("strides"); const conduit::Node coordsetNode = _mdMesh[0].fetch_existing(_coordsetPath); _ndims = conduit::blueprint::mesh::coordset::dims(coordsetNode); } @@ -730,25 +665,7 @@ void saveMesh(const sidre::Group& mesh, const std::string& filename) } // info.print(); } -#ifdef AXOM_USE_MPI - conduit::relay::mpi::io::blueprint::save_mesh(tmpMesh, - filename, - "hdf5", - MPI_COMM_WORLD); -#else - conduit::relay::io::blueprint::save_mesh(tmpMesh, filename, "hdf5"); -#endif -} - -//!@brief Reverse the order of a StackArray. -template -void reverse(axom::StackArray& a) -{ - for(int d = 0; d < DIM / 2; ++d) - { - std::swap(a[d], a[DIM - 1 - d]); - } - return; + saveMesh(tmpMesh, filename); } template @@ -772,96 +689,211 @@ static void addToStackArray(axom::StackArray& a, U b) } /*! - @brief Compute multidmensional index corresponding to flat index - in rectangular index space. + @brief Strategy pattern for supporting a variety of contour types. - The flatId corresponds to the multidimensional index through - an order that advances the first index fastest. + The strategy encapsulates the scalar functions and things related to + it. */ template -axom::StackArray flatToMultidimIndex( - axom::IndexType flatId, - const axom::StackArray& sizes) +struct ContourTestStrategy { - axom::IndexType strides[DIM] = {1}; - for(int d = 1; d < DIM; ++d) - { - strides[d] = strides[d - 1] * sizes[d - 1]; - } - if(flatId >= strides[DIM - 1] * sizes[DIM - 1]) - { - SLIC_ERROR("flatId is too big."); - } + using PointType = axom::primal::Point; - axom::StackArray rval; - for(int d = DIM - 1; d >= 0; --d) - { - rval[d] = flatId / strides[d]; - flatId -= rval[d] * strides[d]; - } - return rval; -} + //!@brief Return test name. + virtual std::string testName() const = 0; + + //!@brief Return field name for storing nodal function. + virtual std::string functionName() const = 0; + + //!@brief Return error tolerance for contour mesh accuracy check. + virtual double errorTolerance() const = 0; + + //!@brief Return the analytical value of the scalar field. + virtual double valueAt(const PointType& pt) const = 0; + + virtual ~ContourTestStrategy() { } +}; template struct ContourTestBase { + static constexpr auto MemorySpace = + axom::execution_space::memory_space; + using PointType = axom::primal::Point; + // ContourTestBase(const std::shared_ptr>& testStrategy) ContourTestBase() - : m_parentCellIdField("parentCellIds") + : m_testStrategies() + , m_parentCellIdField("parentCellIds") , m_domainIdField("domainIdField") { } virtual ~ContourTestBase() { } - //!@brief Return field name for storing nodal function. - virtual std::string name() const = 0; - - //!@brief Return field name for storing nodal function. - virtual std::string functionName() const = 0; - - //!@brief Return function value at a point. - virtual AXOM_HOST_DEVICE double value( - const axom::primal::Point& pt) const = 0; - - //!@brief Return error tolerance for contour mesh accuracy check. - virtual double errorTolerance() const = 0; + void addTestStrategy(const std::shared_ptr>& testStrategy) + { + m_testStrategies.push_back(testStrategy); + SLIC_INFO(axom::fmt::format("Add test {}.", testStrategy->testName())); + } - //!@brief Set nodal distances given nodal coordinates. - virtual void fillNodalValuesFromCoords( - axom::ArrayView coordsViews[DIM], - axom::ArrayView& fieldView) const = 0; + axom::Array>> m_testStrategies; + //!@brief Prefix sum of facet counts from test strategies. + axom::Array m_strategyFacetPrefixSum; const std::string m_parentCellIdField; const std::string m_domainIdField; - int runTest(BlueprintStructuredMesh& computationalMesh, quest::MarchingCubes& mc) + int runTest(BlueprintStructuredMesh& computationalMesh) { - SLIC_INFO(banner(axom::fmt::format("Testing {} contour.", name()))); + // Conduit data is in host memory, move to devices for testing. + if(s_allocatorId != axom::execution_space::allocatorID()) + { + const std::string axes[3] = {"x", "y", "z"}; + for(int d = 0; d < DIM; ++d) + { + computationalMesh.moveMeshDataToNewMemorySpace( + computationalMesh.coordsetPath() + "/values/" + axes[d], + s_allocatorId); + } + for(const auto& strategy : m_testStrategies) + { + computationalMesh.moveMeshDataToNewMemorySpace( + axom::fmt::format("fields/{}/values", strategy->functionName()), + s_allocatorId); + } + } - mc.setFunctionField(functionName()); +#if defined(AXOM_USE_UMPIRE) + /* + Make sure data is correctly on host or device. + We don't test with Unified memory because it's too forgiving. + */ + if(!computationalMesh.empty()) + { + std::string resourceName = "HOST"; + umpire::ResourceManager& rm = umpire::ResourceManager::getInstance(); + for(const auto& strategy : m_testStrategies) + { + const std::string dataPath = + axom::fmt::format("fields/{}/values", strategy->functionName()); + void* dataPtr = + computationalMesh.domain(0).fetch_existing(dataPath).data_ptr(); + bool dataFromUmpire = rm.hasAllocator(dataPtr); + if(dataFromUmpire) + { + umpire::Allocator allocator = rm.getAllocator(dataPtr); + resourceName = allocator.getName(); + } + SLIC_INFO( + axom::fmt::format("Testing with policy {} and function data on {}", + params.policy, + resourceName)); + if(params.policy == axom::runtime_policy::Policy::seq) + { + SLIC_ASSERT(resourceName == "HOST"); + } + #if defined(AXOM_RUNTIME_POLICY_USE_OPENMP) + else if(params.policy == axom::runtime_policy::Policy::omp) + { + SLIC_ASSERT(resourceName == "HOST"); + } + #endif + else + { + SLIC_ASSERT(resourceName == "DEVICE"); + } + } + } +#endif + + std::unique_ptr mcPtr; + axom::utilities::Timer repsTimer(false); + repsTimer.start(); + for(int j = 0; j < params.objectRepCount; ++j) + { + if(!mcPtr) + { + mcPtr = std::make_unique(params.policy, + s_allocatorId, + params.dataParallelism); + } + auto& mc = *mcPtr; + + // Clear and set MarchingCubes object for a "new" mesh. + mc.setMesh(computationalMesh.asConduitNode(), "mesh"); - axom::utilities::Timer computeTimer(false); #ifdef AXOM_USE_MPI - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(MPI_COMM_WORLD); #endif - computeTimer.start(); - mc.computeIsocontour(params.contourVal); - computeTimer.stop(); - printTimingStats(computeTimer, name() + " contour"); + for(int i = 0; i < params.contourGenCount; ++i) + { + SLIC_DEBUG(axom::fmt::format( + "MarchingCubes object rep {} of {}, contour run {} of {}:", + j, + params.objectRepCount, + i, + params.contourGenCount)); + mc.clearOutput(); + m_strategyFacetPrefixSum.clear(); + m_strategyFacetPrefixSum.push_back(0); + for(const auto& strategy : m_testStrategies) + { + mc.setFunctionField(strategy->functionName()); + mc.computeIsocontour(params.contourVal); + m_strategyFacetPrefixSum.push_back(mc.getContourFacetCount()); + } + } + } + repsTimer.stop(); + SLIC_INFO(axom::fmt::format("Finished {} object reps x {} contour reps", + params.objectRepCount, + params.contourGenCount)); + printTimingStats(repsTimer, "contour"); + + auto& mc = *mcPtr; + printRunStats(mc); - SLIC_INFO(axom::fmt::format("Surface mesh has locally {} cells, {} nodes.", - mc.getContourCellCount(), - mc.getContourNodeCount())); + // Return conduit data to host memory. + if(s_allocatorId != axom::execution_space::allocatorID()) + { + const std::string axes[3] = {"x", "y", "z"}; + for(int d = 0; d < DIM; ++d) + { + computationalMesh.moveMeshDataToNewMemorySpace( + computationalMesh.coordsetPath() + "/values/" + axes[d], + axom::execution_space::allocatorID()); + } + for(const auto& strategy : m_testStrategies) + { + computationalMesh.moveMeshDataToNewMemorySpace( + axom::fmt::format("fields/{}/values", strategy->functionName()), + axom::execution_space::allocatorID()); + } + } - // Put mesh mesh in a mint object for error checking and output. - std::string sidreGroupName = name() + "_mesh"; + // Put contour mesh in a mint object for error checking and output. + std::string sidreGroupName = "contour_mesh"; sidre::DataStore objectDS; + // While awaiting fix for PR #1271, don't use Sidre storage in contourMesh. sidre::Group* meshGroup = objectDS.getRoot()->createGroup(sidreGroupName); axom::mint::UnstructuredMesh contourMesh( DIM, - DIM == 2 ? mint::CellType::SEGMENT : mint::CellType::TRIANGLE, - meshGroup, - mc.getContourNodeCount(), - mc.getContourCellCount()); + DIM == 2 ? mint::CellType::SEGMENT : mint::CellType::TRIANGLE); + axom::utilities::Timer extractTimer(false); + extractTimer.start(); mc.populateContourMesh(contourMesh, m_parentCellIdField, m_domainIdField); + extractTimer.stop(); + printTimingStats(extractTimer, "extract"); + + { + axom::Array facetNodeIds; + axom::Array facetNodeCoords; + axom::Array facetParentIds; + axom::Array facetDomainIds; + mc.relinquishContourData(facetNodeIds, + facetNodeCoords, + facetParentIds, + facetDomainIds); + SLIC_ASSERT(mc.getContourFacetCount() == 0); + } int localErrCount = 0; if(params.checkResults) @@ -875,62 +907,131 @@ struct ContourTestBase checkCellsContainingContour(computationalMesh, contourMesh); } - // Write contour mesh to file. - addRankOffsetToContourMeshDomainIds(computationalMesh.domainCount(), - contourMesh); - std::string outputName = name() + "_contour_mesh"; - saveMesh(*meshGroup, outputName); - SLIC_INFO(axom::fmt::format("Wrote {} contour in {}", name(), outputName)); + if(contourMesh.hasSidreGroup()) + { + assert(contourMesh.getSidreGroup() == meshGroup); + // Write contour mesh to file. + std::string outputName = "contour_mesh"; + saveMesh(*contourMesh.getSidreGroup(), outputName); + SLIC_INFO(axom::fmt::format("Wrote contour mesh to {}", outputName)); + } objectDS.getRoot()->destroyGroupAndData(sidreGroupName); return localErrCount; } - void computeNodalDistance(BlueprintStructuredMesh& bpMesh) + void printRunStats(const quest::MarchingCubes& mc) + { + { + int mn, mx, sum; + getIntMinMax(mc.getContourCellCount(), mn, mx, sum); + SLIC_INFO(axom::fmt::format( + "Contour mesh has {{min:{}, max:{}, sum:{}, avg:{}}} cells", + mn, + mx, + sum, + (double)sum / numRanks)); + } + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Contour mesh has locally {} cells, {} nodes.", + mc.getContourCellCount(), + mc.getContourNodeCount())); + } + + void computeNodalDistance(BlueprintStructuredMesh& bpMesh, + ContourTestStrategy& strat) { SLIC_ASSERT(bpMesh.dimension() == DIM); for(int domId = 0; domId < bpMesh.domainCount(); ++domId) { - conduit::Node& dom = bpMesh.domain(domId); - // Access the coordinates - auto cellCounts = bpMesh.domainLengths(domId); - axom::StackArray shape; - for(int i = 0; i < DIM; ++i) + auto domainView = bpMesh.getDomainView(domId); + + // Create nodal function data with ghosts like node coords. + domainView.createField( + strat.functionName(), + "vertex", + conduit::DataType::float64(domainView.getCoordsCountWithGhosts()), + domainView.getCoordsStrides(), + domainView.getCoordsOffsets()); + } + + for(int domId = 0; domId < bpMesh.domainCount(); ++domId) + { + auto domainView = bpMesh.getDomainView(domId); + const auto coordsViews = domainView.getConstCoordsViews(false); + axom::ArrayView fieldView = + domainView.template getFieldView(strat.functionName(), false); + for(int d = 0; d < DIM; ++d) { - shape[i] = 1 + cellCounts[i]; + SLIC_ASSERT(coordsViews[d].shape() == fieldView.shape()); } - conduit::index_t pointCount = bpMesh.nodeCount(domId); - conduit::Node& coordsValues = - dom.fetch_existing("coordsets/coords/values"); - double* coordsPtrs[DIM]; - axom::ArrayView coordsViews[DIM]; - for(int d = 0; d < DIM; ++d) + populateNodalDistance(coordsViews, fieldView, strat); + } + } + template + typename std::enable_if::type populateNodalDistance( + const axom::StackArray, DIM>& coordsViews, + axom::ArrayView& fieldView, + ContourTestStrategy& strat) + { + const auto& fieldShape = fieldView.shape(); + for(int d = 0; d < DIM; ++d) + { + SLIC_ASSERT(coordsViews[d].shape() == fieldShape); + } + + for(axom::IndexType j = 0; j < fieldShape[1]; ++j) + { + for(axom::IndexType i = 0; i < fieldShape[0]; ++i) { - coordsPtrs[d] = coordsValues[d].as_double_ptr(); - coordsViews[d] = axom::ArrayView(coordsPtrs[d], shape); + PointType pt; + for(int d = 0; d < DIM; ++d) + { + pt[d] = coordsViews[d](i, j); + } + fieldView(i, j) = strat.valueAt(pt); } + } + } - // Create the nodal function data. - conduit::Node& fieldNode = dom["fields"][functionName()]; - fieldNode["association"] = "vertex"; - fieldNode["topology"] = "mesh"; - fieldNode["volume_dependent"] = "false"; - fieldNode["values"].set(conduit::DataType::float64(pointCount)); - putConduitDataInNewMemorySpace(fieldNode, "values", allocatorId); - double* d = fieldNode["values"].value(); - axom::ArrayView fieldView(d, shape); - - fillNodalValuesFromCoords(coordsViews, fieldView); + template + typename std::enable_if::type populateNodalDistance( + const axom::StackArray, DIM>& coordsViews, + axom::ArrayView& fieldView, + ContourTestStrategy& strat) + { + const auto& fieldShape = fieldView.shape(); + for(int d = 0; d < DIM; ++d) + { + SLIC_ASSERT(coordsViews[d].shape() == fieldShape); + } + + for(axom::IndexType k = 0; k < fieldShape[2]; ++k) + { + for(axom::IndexType j = 0; j < fieldShape[1]; ++j) + { + for(axom::IndexType i = 0; i < fieldShape[0]; ++i) + { + PointType pt; + for(int d = 0; d < DIM; ++d) + { + pt[d] = coordsViews[d](i, j, k); + } + fieldView(i, j, k) = strat.valueAt(pt); + } + } + } + } + void computeNodalDistance(BlueprintStructuredMesh& bpMesh) + { + for(auto& strategy : m_testStrategies) + { + computeNodalDistance(bpMesh, *strategy); } } - /* - TODO: Additional tests: - - surface points should lie on computational mesh edges. - - computational cells stradling contourVal should be - parents to at least 1 contour mesh cell. - */ /** Check for errors in the surface contour mesh. - analytical scalar value at surface points should be @@ -948,50 +1049,60 @@ struct ContourTestBase contourMesh.createField(diffField, axom::mint::NODE_CENTERED); } - double tol = errorTolerance(); int errCount = 0; - const axom::IndexType nodeCount = contourMesh.getNumberOfNodes(); - axom::primal::Point pt; - for(axom::IndexType i = 0; i < nodeCount; ++i) + for(axom::IndexType iStrat = 0; iStrat < m_testStrategies.size(); ++iStrat) { - contourMesh.getNode(i, pt.data()); - double analyticalVal = value(pt); - double diff = std::abs(analyticalVal - contourVal); - if(diffPtr) - { - diffPtr[i] = diff; - } - if(diff > tol) + auto contourNodeBegin = DIM * m_strategyFacetPrefixSum[iStrat]; + auto contourNodeEnd = DIM * m_strategyFacetPrefixSum[iStrat + 1]; + + auto& strategy = *m_testStrategies[iStrat]; + double tol = strategy.errorTolerance(); + + PointType pt; + for(axom::IndexType iNode = contourNodeBegin; iNode < contourNodeEnd; + ++iNode) { - ++errCount; - SLIC_INFO_IF( - params.isVerbose(), - axom::fmt::format( - "checkContourSurface: node {} at {} has dist {}, off by {}", - i, - pt, - analyticalVal, - diff)); + contourMesh.getNode(iNode, pt.data()); + double analyticalVal = strategy.valueAt(pt); + double diff = std::abs(analyticalVal - contourVal); + if(diffPtr) + { + diffPtr[iNode] = diff; + } + if(diff > tol) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format( + "checkContourSurface: node {} at {} has dist {}, off by {}", + iNode, + pt, + analyticalVal, + diff)); + } } + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format( + "checkContourSurface: found {} errors outside tolerance of {}", + errCount, + tol)); } - SLIC_INFO_IF( - params.isVerbose(), - axom::fmt::format( - "checkContourSurface: found {} errors outside tolerance of {}", - errCount, - tol)); return errCount; } //!@brief Get view of output domain id data. - axom::ArrayView getDomainIdView( + axom::ArrayView getDomainIdView( axom::mint::UnstructuredMesh& contourMesh) const { const auto* ptr = - contourMesh.getFieldPtr(m_domainIdField, - axom::mint::CELL_CENTERED); - axom::ArrayView view(ptr, - contourMesh.getNumberOfCells()); + contourMesh.getFieldPtr( + m_domainIdField, + axom::mint::CELL_CENTERED); + axom::ArrayView view( + ptr, + contourMesh.getNumberOfCells()); return view; } @@ -1013,6 +1124,22 @@ struct ContourTestBase return view; } + axom::ArrayView get_parent_cell_id_view( + const axom::mint::UnstructuredMesh& contourMesh) const + { + axom::IndexType numIdxComponents = -1; + const axom::IndexType* ptr = + contourMesh.getFieldPtr(m_parentCellIdField, + axom::mint::CELL_CENTERED, + numIdxComponents); + + SLIC_ASSERT(numIdxComponents == 1); + + axom::ArrayView view((const axom::IndexType*)ptr, + contourMesh.getNumberOfCells()); + return view; + } + /** Check that generated cells fall within their parents. */ @@ -1021,83 +1148,132 @@ struct ContourTestBase axom::mint::UnstructuredMesh& contourMesh) { int errCount = 0; - const axom::IndexType cellCount = contourMesh.getNumberOfCells(); - auto parentCellIdxView = get_parent_cell_idx_view(contourMesh); + auto parentCellIdView = get_parent_cell_id_view(contourMesh); auto domainIdView = getDomainIdView(contourMesh); const axom::IndexType domainCount = computationalMesh.domainCount(); - axom::Array> coordsViews(domainCount * DIM); - - // Get info about the computational domains available for look-up. - axom::Array> domainLengths(domainCount); - for(axom::IndexType n = 0; n < domainCount; ++n) + axom::Array::ConstCoordsViewsType> + allCoordsViews(domainCount); + for(int iDomain = 0; iDomain < domainCount; ++iDomain) { - auto& domain = computationalMesh.domain(n); - axom::ArrayView* domainCoordsView = - &coordsViews[DIM * n]; - getCoordsViews(domain, computationalMesh.coordsetPath(), domainCoordsView); + auto domainView = computationalMesh.getDomainView(iDomain); + allCoordsViews[iDomain] = domainView.getConstCoordsViews(false); + } - axom::Array domLengths = - computationalMesh.domainLengths(n); - for(int d = 0; d < DIM; ++d) + std::map + domainIdToContiguousId; + for(int iDomain = 0; iDomain < domainCount; ++iDomain) + { + const auto& dom = computationalMesh.domain(iDomain); + axom::quest::MarchingCubes::DomainIdType domainId = iDomain; + if(dom.has_path("state/domain_id")) { - domainLengths[n][d] = domLengths[d]; + domainId = dom.fetch_existing("state/domain_id").to_value(); } + domainIdToContiguousId[domainId] = iDomain; } - for(axom::IndexType cn = 0; cn < cellCount; ++cn) + // Indexers to translate between flat and multidim indices. + axom::Array> indexers(domainCount); + for(int d = 0; d < domainCount; ++d) { - axom::IndexType domainId = domainIdView[cn]; - - axom::StackArray parentCellIdx = - parentCellIdxView[cn]; - reverse(parentCellIdx); // ArrayView expects indices in reverse order. - // This should work but breaks gcc11 on 64-bit linux: - // axom::StackArray upperIdx = parentCellIdx + 1; - axom::StackArray upperIdx = parentCellIdx; - addToStackArray(upperIdx, 1); - - axom::ArrayView* domainCoordsView = - &coordsViews[DIM * domainId]; - axom::primal::Point lower, upper; + axom::StackArray domShape; + computationalMesh.domainLengths(d, domShape); + indexers[d].initializeShape( + domShape, + axom::ArrayIndexer(allCoordsViews[d][0].strides()) + .slowestDirs()); + } + + auto elementGreaterThan = [](const axom::primal::Vector& a, + double b) { + bool result(true); for(int d = 0; d < DIM; ++d) { - lower[d] = domainCoordsView[d][parentCellIdx]; - upper[d] = domainCoordsView[d][upperIdx]; + result &= a[d] < b; } - axom::primal::BoundingBox parentCellBox(lower, upper); - double tol = errorTolerance(); - axom::primal::BoundingBox big(parentCellBox); - axom::primal::BoundingBox small(parentCellBox); - big.expand(tol); - small.expand(-tol); - - // WRONG: the node ids should increased by the number of nodes in all previous domains. - axom::IndexType* cellNodeIds = contourMesh.getCellNodeIDs(cn); - const axom::IndexType cellNodeCount = contourMesh.getNumberOfCellNodes(cn); - - for(axom::IndexType nn = 0; nn < cellNodeCount; ++nn) + return result; + }; + + for(axom::IndexType iStrat = 0; iStrat < m_testStrategies.size(); ++iStrat) + { + auto contourCellBegin = m_strategyFacetPrefixSum[iStrat]; + auto contourCellEnd = m_strategyFacetPrefixSum[iStrat + 1]; + for(axom::IndexType iContourCell = contourCellBegin; + iContourCell < contourCellEnd; + ++iContourCell) { - axom::primal::Point nodeCoords; - contourMesh.getNode(cellNodeIds[nn], nodeCoords.data()); + axom::quest::MarchingCubes::DomainIdType domainId = + domainIdView[iContourCell]; + axom::quest::MarchingCubes::DomainIdType contiguousIndex = + domainIdToContiguousId[domainId]; + typename axom::quest::MeshViewUtil::ConstCoordsViewsType& coordsViews = + allCoordsViews[contiguousIndex]; + + axom::IndexType parentCellId = parentCellIdView[iContourCell]; + + axom::StackArray parentCellIdx = + indexers[contiguousIndex].toMultiIndex(parentCellId); + axom::StackArray upperIdx = parentCellIdx; + addToStackArray(upperIdx, 1); + + PointType lower, upper; + for(int d = 0; d < DIM; ++d) + { + lower[d] = coordsViews[d][parentCellIdx]; + upper[d] = coordsViews[d][upperIdx]; + } + axom::primal::BoundingBox parentCellBox(lower, upper); + auto tol = axom::numerics::floating_point_limits::epsilon(); + axom::primal::BoundingBox big(parentCellBox); + big.expand(tol); + axom::primal::BoundingBox small(parentCellBox); + auto range = parentCellBox.range(); + bool checkSmall = elementGreaterThan(range, tol); + if(checkSmall) + { + small.expand(-tol); + } - if(!big.contains(nodeCoords) || small.contains(nodeCoords)) + axom::IndexType* cellNodeIds = contourMesh.getCellNodeIDs(iContourCell); + const axom::IndexType cellNodeCount = + contourMesh.getNumberOfCellNodes(iContourCell); + + for(axom::IndexType nn = 0; nn < cellNodeCount; ++nn) { - ++errCount; - SLIC_INFO_IF( - params.isVerbose(), - axom::fmt::format("checkContourCellLimits: node {} at {} is not " - "on parent cell boundary.", - cellNodeIds[nn], - nodeCoords)); + PointType nodeCoords; + contourMesh.getNode(cellNodeIds[nn], nodeCoords.data()); + + if(!big.contains(nodeCoords)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("checkContourCellLimits: node {} at {} " + "too far outside parent cell boundary.", + cellNodeIds[nn], + nodeCoords)); + } + + if(checkSmall && small.contains(nodeCoords)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("checkContourCellLimits: node {} at {} " + "too far inside parent cell boundary.", + cellNodeIds[nn], + nodeCoords)); + } } } } SLIC_INFO_IF(params.isVerbose(), - axom::fmt::format("checkContourCellLimits: found {} nodes " - "not on parent cell boundary.", + axom::fmt::format("checkContourCellLimits: found {} " + "nodes not on parent cell boundary.", errCount)); return errCount; } @@ -1111,318 +1287,290 @@ struct ContourTestBase axom::mint::UnstructuredMesh& contourMesh) { int errCount = 0; - const axom::IndexType cellCount = contourMesh.getNumberOfCells(); - auto parentCellIdxView = get_parent_cell_idx_view(contourMesh); + auto parentCellIdView = get_parent_cell_id_view(contourMesh); auto domainIdView = getDomainIdView(contourMesh); const axom::IndexType domainCount = computationalMesh.domainCount(); - // Nodal values of functions for each domain. - axom::Array> fcnViews(domainCount); - // Whether computational cells have parts of the contour mesh. - axom::Array> hasContours(domainCount); + // + // Compute mapping to look up domains from the domain id. + // + std::map domainIdToContiguousId; + for(axom::quest::MarchingCubes::DomainIdType iDomain = 0; + iDomain < domainCount; + ++iDomain) + { + const auto& dom = computationalMesh.domain(iDomain); + axom::quest::MarchingCubes::DomainIdType domainId = iDomain; + if(dom.has_path("state/domain_id")) + { + domainId = dom.fetch_existing("state/domain_id").to_value(); + } + domainIdToContiguousId[domainId] = iDomain; + } + /* + If strategy iStrat creates a contour through cell cellId of + domain contiguousDomainId, then set bit iStrat in hasContours: + hasContours[contiguousDomainId][cellId] & (1 < iStrat). + */ + axom::Array> fcnViews( + domainCount); + axom::Array> cellIndexers( + domainCount); + axom::Array> hasContours(domainCount); for(axom::IndexType domId = 0; domId < domainCount; ++domId) { - axom::StackArray domLengths; - computationalMesh.domainLengths(domId, domLengths); + axom::quest::MeshViewUtil domainView = + computationalMesh.getDomainView(domId); - axom::Array& hasContour = hasContours[domId]; - hasContour.resize(domLengths, false); + const axom::IndexType cellCount = domainView.getCellCount(); - // Add 1 to count nodes. Reverse to match Conduit data. - reverse(domLengths); - // This should work but breaks gcc11 on 64-bit linux: - // domLengths = domLengths + 1; - addToStackArray(domLengths, 1); - - conduit::Node& dom = computationalMesh.domain(domId); - double* fcnPtr = - dom.fetch_existing("fields/" + functionName() + "/values").as_double_ptr(); - fcnViews[domId] = axom::ArrayView(fcnPtr, domLengths); + axom::Array& hasContour = hasContours[domId]; + hasContour.resize(cellCount, 0); } - for(axom::IndexType cn = 0; cn < cellCount; ++cn) + + for(int iStrat = 0; iStrat < m_testStrategies.size(); ++iStrat) { - axom::IndexType domainId = domainIdView[cn]; - const axom::StackArray& parentCellIdx = - parentCellIdxView[cn]; - hasContours[domainId][parentCellIdx] = true; + auto contourCellBegin = m_strategyFacetPrefixSum[iStrat]; + auto contourCellEnd = m_strategyFacetPrefixSum[iStrat + 1]; + axom::IndexType bitFlag = (1 << iStrat); + for(axom::IndexType iContourCell = contourCellBegin; + iContourCell < contourCellEnd; + ++iContourCell) + { + axom::quest::MarchingCubes::DomainIdType domainId = + domainIdView[iContourCell]; + axom::quest::MarchingCubes::DomainIdType contiguousId = + domainIdToContiguousId[domainId]; + const axom::IndexType parentCellId = parentCellIdView[iContourCell]; + hasContours[contiguousId][parentCellId] |= bitFlag; + } } - // Verify that marked cells contain the contour value - // unmarked ones don't. + // Verify that cells marked by hasContours touches the contour + // and other cells don't. for(axom::IndexType domId = 0; domId < domainCount; ++domId) { + auto domainView = computationalMesh.getDomainView(domId); + axom::StackArray domLengths; computationalMesh.domainLengths(domId, domLengths); + assert(domLengths == domainView.getRealShape("element")); - axom::ArrayView& fcnView = fcnViews[domId]; + const axom::IndexType parentCellCount = domainView.getCellCount(); + // axom::Array hasContour(parentCellCount, parentCellCount); - const axom::IndexType cellCount = product(domLengths); - for(axom::IndexType cellId = 0; cellId < cellCount; ++cellId) + for(axom::IndexType parentCellId = 0; parentCellId < parentCellCount; + ++parentCellId) { - axom::StackArray cellIdx = - flatToMultidimIndex(cellId, domLengths); - - // Compute min and max function value in the cell. - double minFcnValue = std::numeric_limits::max(); - double maxFcnValue = std::numeric_limits::min(); - constexpr short int cornerCount = - (1 << DIM); // Number of nodes in a cell. - for(short int cornerId = 0; cornerId < cornerCount; ++cornerId) + const axom::IndexType hasContourBits = hasContours[domId][parentCellId]; + + for(axom::IndexType iStrat = 0; iStrat < m_testStrategies.size(); ++iStrat) { - axom::StackArray cornerIdx = cellIdx; - for(int d = 0; d < DIM; ++d) + auto& strategy = *m_testStrategies[iStrat]; + const axom::IndexType iStratBit = (1 << iStrat); + + const auto& fcnView = domainView.template getConstFieldView( + strategy.functionName(), + false); + + axom::ArrayIndexer cellIndexer( + domLengths, + axom::ArrayIndexer(fcnView.strides())); + + axom::StackArray parentCellIdx = + cellIndexer.toMultiIndex(parentCellId); + + // Compute min and max function values in the cell. + double minFcnValue = std::numeric_limits::max(); + double maxFcnValue = std::numeric_limits::min(); + constexpr short int cornerCount = + (1 << DIM); // Number of nodes in a cell. + for(short int cornerId = 0; cornerId < cornerCount; ++cornerId) { - if(cornerId & (1 << d)) + // Compute multidim index of current corner of parent cell. + axom::StackArray cornerIdx = parentCellIdx; + for(int d = 0; d < DIM; ++d) { - ++cornerIdx[d]; + if(cornerId & (1 << d)) + { + ++cornerIdx[d]; + } } + + double fcnValue = fcnView[cornerIdx]; + minFcnValue = std::min(minFcnValue, fcnValue); + maxFcnValue = std::max(maxFcnValue, fcnValue); } - reverse(cornerIdx); - double fcnValue = fcnView[cornerIdx]; - minFcnValue = std::min(minFcnValue, fcnValue); - maxFcnValue = std::max(maxFcnValue, fcnValue); - } + const bool hasContour = hasContourBits & iStratBit; - const bool touchesContour = - (minFcnValue <= params.contourVal && maxFcnValue >= params.contourVal); - const bool hasCont = hasContours[domId][cellIdx]; - if(touchesContour != hasCont) - { - ++errCount; - SLIC_INFO_IF(params.isVerbose(), - axom::fmt::format( - "checkCellsContainingContour: cell {}: hasContour " - "({}) and touchesContour ({}) don't agree.", - cellIdx, - hasCont, - touchesContour)); + bool touchesContour = (minFcnValue <= params.contourVal && + maxFcnValue >= params.contourVal); + // If the min or max values in the cell is close to params.contourVal + // touchesContour and hasCont can go either way. So give it a pass. + if(minFcnValue == params.contourVal || maxFcnValue == params.contourVal) + { + touchesContour = hasContour; + } + + if(touchesContour != hasContour) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format( + "checkCellsContainingContour: cell {}: hasContour " + "({}) and touchesContour ({}) don't agree for strategy {}.", + parentCellIdx, + hasContour, + touchesContour, + strategy.testName())); + } } } } - SLIC_INFO_IF(params.isVerbose(), axom::fmt::format("checkCellsContainingContour: found {} " "misrepresented computational cells.", errCount)); return errCount; } +}; - void getCoordsViews(conduit::Node& domain, - const std::string& coordsetPath, - axom::ArrayView coordsViews[DIM]) +template +struct PlanarTestStrategy : public ContourTestStrategy +{ + using PointType = axom::primal::Point; + PlanarTestStrategy(const axom::primal::Vector& perpDir, + const PointType& inPlane) + : ContourTestStrategy() + , _plane(perpDir.unitVector(), inPlane) + , _errTol(axom::numerics::floating_point_limits::epsilon()) + { } + virtual std::string testName() const override { - const conduit::Node& dimsNode = - domain.fetch_existing("topologies/mesh/elements/dims"); - axom::StackArray coordsViewShape; - for(int d = 0; d < DIM; ++d) - { - coordsViewShape[d] = 1 + dimsNode[DIM - 1 - d].as_int(); - } - - const conduit::Node& coordValues = - domain.fetch_existing(coordsetPath + "/values"); - bool isInterleaved = conduit::blueprint::mcarray::is_interleaved(coordValues); - const int coordSp = isInterleaved ? DIM : 1; - - for(int d = 0; d < DIM; ++d) - { - auto* coordsPtr = coordValues[d].as_double_ptr(); - coordsViews[d] = - axom::ArrayView(coordsPtr, coordsViewShape, coordSp); - } + return std::string("planar"); } - - /** - * Change cp_domain data from a local index to a global domain index - * by adding rank offsets. - * This is an optional step to make domain ids globally unique. - */ - void addRankOffsetToContourMeshDomainIds( - int localDomainCount, - axom::mint::UnstructuredMesh& contourMesh) + virtual std::string functionName() const override { -#ifdef AXOM_USE_MPI - axom::Array starts(numRanks, numRanks); - { - axom::Array indivDomainCounts(numRanks, numRanks); - indivDomainCounts.fill(-1); - MPI_Allgather(&localDomainCount, - 1, - MPI_INT, - indivDomainCounts.data(), - 1, - MPI_INT, - MPI_COMM_WORLD); - starts[0] = 0; - for(int i = 1; i < numRanks; ++i) - { - starts[i] = starts[i - 1] + indivDomainCounts[i - 1]; - } - } - - const std::string domainIdField = m_domainIdField; - auto* domainIdPtr = - contourMesh.getFieldPtr(domainIdField, - axom::mint::CELL_CENTERED); - int cellCount = contourMesh.getNumberOfCells(); - - for(int i = 0; i < cellCount; ++i) - { - domainIdPtr[i] += starts[myRank]; - } -#endif + return std::string("dist_to_plane"); } + double errorTolerance() const override { return _errTol; } + virtual double valueAt(const PointType& pt) const override + { + return _plane.signedDistance(pt); + } + const axom::primal::Plane _plane; + double _errTol; }; -/*! - @brief Function providing distance from a point. -*/ -template -struct RoundContourTest : public ContourTestBase +template +struct RoundTestStrategy : public ContourTestStrategy { - RoundContourTest(const axom::primal::Point& pt) - : ContourTestBase() - , _sphere(pt, 0.0) + using PointType = axom::primal::Point; + RoundTestStrategy(const PointType& center) + : ContourTestStrategy() + , _sphere(center, 0.0) , _errTol(1e-3) { } - virtual ~RoundContourTest() { } - const axom::primal::Sphere _sphere; - double _errTol; - - virtual std::string name() const override { return std::string("round"); } - + virtual std::string testName() const override { return std::string("round"); } virtual std::string functionName() const override { return std::string("dist_to_center"); } - - AXOM_HOST_DEVICE double value(const axom::primal::Point& pt) const override + double errorTolerance() const override { return _errTol; } + virtual double valueAt(const PointType& pt) const override { return _sphere.computeSignedDistance(pt); } - - double errorTolerance() const override { return _errTol; } - void setToleranceByLongestEdge(const BlueprintStructuredMesh& bsm) { + // Heuristic of appropriate error tolerance. double maxSpacing = bsm.maxSpacing(); _errTol = 0.1 * maxSpacing; } - - void fillNodalValuesFromCoords(axom::ArrayView coordsViews_[DIM], - axom::ArrayView& fieldView) const override - { - const axom::IndexType pointCount = fieldView.size(); - - axom::ArrayView coordsViews[DIM]; - for(int d = 0; d < DIM; ++d) - { - coordsViews[d] = coordsViews_[d]; - } - - // Duplicate member data so devices don't have to use the this pointer. - const auto sphere = _sphere; - - auto loopBody = AXOM_LAMBDA(int n) - { - axom::primal::Point pt; - for(int d = 0; d < DIM; ++d) - { - pt[d] = coordsViews[d].flatIndex(n); - } - fieldView.flatIndex(n) = sphere.computeSignedDistance(pt); - }; - - axom::for_all(0, pointCount, loopBody); - } + const axom::primal::Sphere _sphere; + double _errTol; }; -/*! - @brief Function providing signed distance from a plane. -*/ -template -struct PlanarContourTest : public ContourTestBase +template +struct GyroidTestStrategy : public ContourTestStrategy { - /*! - @brief Constructor. - - @param inPlane [in] A point in the plane. - @param perpDir [in] Perpendicular direction on positive side. - */ - PlanarContourTest(const axom::primal::Point& inPlane, - const axom::primal::Vector& perpDir) - : ContourTestBase() - , _plane(perpDir.unitVector(), inPlane) + using PointType = axom::primal::Point; + GyroidTestStrategy(const PointType& scale, double offset) + : ContourTestStrategy() + , _scale(scale) + , _offset(offset) { } - virtual ~PlanarContourTest() { } - const axom::primal::Plane _plane; - - virtual std::string name() const override { return std::string("planar"); } - - virtual std::string functionName() const override + virtual std::string testName() const override { - return std::string("dist_to_plane"); + return std::string("gyroid"); } - - AXOM_HOST_DEVICE double value(const axom::primal::Point& pt) const override + virtual std::string functionName() const override { - return _plane.signedDistance(pt); + return std::string("gyroid_fcn"); } - - double errorTolerance() const override { return 1e-15; } - - void fillNodalValuesFromCoords(axom::ArrayView coordsViews_[DIM], - axom::ArrayView& fieldView) const override + double errorTolerance() const override { return _errTol; } + virtual double valueAt(const PointType& pt) const override { - const axom::IndexType pointCount = fieldView.size(); - - axom::ArrayView coordsViews[DIM]; - for(int d = 0; d < DIM; ++d) + if(DIM == 3) { - coordsViews[d] = coordsViews_[d]; + return sin(pt[0] * _scale[0]) * cos(pt[1] * _scale[1]) + + sin(pt[1] * _scale[1]) * cos(pt[2] * _scale[2]) + + sin(pt[2] * _scale[2]) * cos(pt[0] * _scale[0]) + _offset; } - - // Duplicate member data so devices don't have to use the this pointer. - const auto plane = _plane; - - auto loopBody = AXOM_LAMBDA(int n) + else { - axom::primal::Point pt; - for(int d = 0; d < DIM; ++d) - { - pt[d] = coordsViews[d].flatIndex(n); - } - fieldView.flatIndex(n) = plane.signedDistance(pt); - }; - - axom::for_all(0, pointCount, loopBody); + // Use the 3D function, with z=0. + return sin(pt[0] * _scale[0]) * cos(pt[1] * _scale[1]) + + sin(pt[1] * _scale[1]) + _offset; + } } -}; - -/// Utility function to transform blueprint node storage. -void makeCoordsContiguous(conduit::Node& coordValues) -{ - bool isInterleaved = conduit::blueprint::mcarray::is_interleaved(coordValues); - if(isInterleaved) + void setToleranceByLongestEdge(const BlueprintStructuredMesh& bsm) { - conduit::Node oldValues = coordValues; - conduit::blueprint::mcarray::to_contiguous(oldValues, coordValues); + // Heuristic of appropriate error tolerance. + double maxSpacing = bsm.maxSpacing(); + axom::primal::Vector v(_scale); + _errTol = 0.1 * v.norm() * maxSpacing; } -} + const PointType _scale; + const double _offset; + double _errTol; +}; -/// Utility function to transform blueprint node storage. -void makeCoordsInterleaved(conduit::Node& coordValues) +/// +int allocatorIdToTest(axom::runtime_policy::Policy policy) { - bool isInterleaved = conduit::blueprint::mcarray::is_interleaved(coordValues); - if(!isInterleaved) - { - conduit::Node oldValues = coordValues; - conduit::blueprint::mcarray::to_interleaved(oldValues, coordValues); - } +#if defined(AXOM_USE_UMPIRE) + //--------------------------------------------------------------------------- + // Memory resource. For testing, choose device memory if appropriate. + //--------------------------------------------------------------------------- + int allocatorID = policy == RuntimePolicy::seq + ? axom::detail::getAllocatorID() + : + #if defined(AXOM_RUNTIME_POLICY_USE_OPENMP) + policy == RuntimePolicy::omp + ? axom::detail::getAllocatorID() + : + #endif + #if defined(AXOM_RUNTIME_POLICY_USE_CUDA) + policy == RuntimePolicy::cuda + ? axom::detail::getAllocatorID() + : + #endif + #if defined(AXOM_RUNTIME_POLICY_USE_HIP) + policy == RuntimePolicy::hip + ? axom::detail::getAllocatorID() + : + #endif + axom::INVALID_ALLOCATOR_ID; +#else + int allocatorID = axom::getDefaultAllocatorID(); +#endif + return allocatorID; } /// Utility function to initialize the logger @@ -1476,50 +1624,53 @@ void finalizeLogger() template int testNdimInstance(BlueprintStructuredMesh& computationalMesh) { - // Create marching cubes algorithm object and set some parameters - quest::MarchingCubes mc(params.policy, - computationalMesh.asConduitNode(), - "coords"); - //--------------------------------------------------------------------------- // params specify which tests to run. //--------------------------------------------------------------------------- - std::shared_ptr> roundTest; - std::shared_ptr> planarTest; + std::shared_ptr> planarStrat; + std::shared_ptr> roundStrat; + std::shared_ptr> gyroidStrat; + + ContourTestBase contourTest; - if(params.usingRound) + if(params.usingPlanar()) { - roundTest = std::make_shared>( - params.roundContourCenter()); - roundTest->setToleranceByLongestEdge(computationalMesh); - roundTest->computeNodalDistance(computationalMesh); + planarStrat = + std::make_shared>(params.planeNormal(), + params.inplanePoint()); + contourTest.addTestStrategy(planarStrat); } - if(params.usingPlanar) + + if(params.usingRound()) { - planarTest = std::make_shared>( - params.inplanePoint(), - params.planeNormal()); - planarTest->computeNodalDistance(computationalMesh); + roundStrat = + std::make_shared>(params.roundContourCenter()); + roundStrat->setToleranceByLongestEdge(computationalMesh); + contourTest.addTestStrategy(roundStrat); } - computationalMesh.printMeshInfo(); - // Write computational mesh with contour functions. - saveMesh(computationalMesh.asConduitNode(), params.fieldsFile); - - int localErrCount = 0; - - if(planarTest) + if(params.usingGyroid()) { - localErrCount += planarTest->runTest(computationalMesh, mc); + gyroidStrat = + std::make_shared>(params.gyroidScaleFactor(), + params.contourVal); + gyroidStrat->setToleranceByLongestEdge(computationalMesh); + contourTest.addTestStrategy(gyroidStrat); } - slic::flushStreams(); - if(roundTest) + contourTest.computeNodalDistance(computationalMesh); + + if(params.isVerbose()) { - localErrCount += roundTest->runTest(computationalMesh, mc); + computationalMesh.printMeshInfo(); } - slic::flushStreams(); + + // Write computational mesh with contour functions. + saveMesh(computationalMesh.asConduitNode(), params.fieldsFile); + + int localErrCount = 0; + localErrCount += contourTest.runTest(computationalMesh); // Check results @@ -1589,12 +1740,12 @@ int main(int argc, char** argv) exit(retval); } - allocatorId = allocatorIdForPolicy(params.policy); + s_allocatorId = allocatorIdToTest(params.policy); //--------------------------------------------------------------------------- // Load computational mesh. //--------------------------------------------------------------------------- - BlueprintStructuredMesh computationalMesh(params.meshFile); + BlueprintStructuredMesh computationalMesh(params.meshFile, "mesh"); SLIC_INFO_IF( params.isVerbose(), @@ -1603,18 +1754,6 @@ int main(int argc, char** argv) computationalMesh.domainCount())); slic::flushStreams(); - auto getIntMinMax = [](int inVal, int& minVal, int& maxVal, int& sumVal) { -#ifdef AXOM_USE_MPI - MPI_Allreduce(&inVal, &minVal, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD); - MPI_Allreduce(&inVal, &maxVal, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(&inVal, &sumVal, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); -#else - minVal = inVal; - maxVal = inVal; - sumVal = inVal; -#endif - }; - // Output some global mesh size stats { int mn, mx, sum; @@ -1643,7 +1782,7 @@ int main(int argc, char** argv) // Run test in the execution space set by command line. //--------------------------------------------------------------------------- int errCount = 0; - if(params.policy == quest::MarchingCubesRuntimePolicy::seq) + if(params.policy == axom::runtime_policy::Policy::seq) { if(params.ndim == 2) { @@ -1656,7 +1795,7 @@ int main(int argc, char** argv) } #if defined(AXOM_USE_RAJA) #ifdef AXOM_USE_OPENMP - else if(params.policy == quest::MarchingCubesRuntimePolicy::omp) + else if(params.policy == axom::runtime_policy::Policy::omp) { if(params.ndim == 2) { @@ -1669,7 +1808,7 @@ int main(int argc, char** argv) } #endif #if defined(AXOM_USE_CUDA) && defined(AXOM_USE_UMPIRE) - else if(params.policy == quest::MarchingCubesRuntimePolicy::cuda) + else if(params.policy == axom::runtime_policy::Policy::cuda) { if(params.ndim == 2) { @@ -1682,7 +1821,7 @@ int main(int argc, char** argv) } #endif #if defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) - else if(params.policy == quest::MarchingCubesRuntimePolicy::hip) + else if(params.policy == axom::runtime_policy::Policy::hip) { if(params.ndim == 2) { diff --git a/src/axom/quest/examples/quest_proe_bbox.cpp b/src/axom/quest/examples/quest_proe_bbox.cpp new file mode 100644 index 0000000000..169820b638 --- /dev/null +++ b/src/axom/quest/examples/quest_proe_bbox.cpp @@ -0,0 +1,167 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +/*! \file quest_proe_bbox.cpp + * \brief This example code demonstrates how to read a subset of a ProE (Creo) + * text-format tetrahedron mesh using a bounding box. It reads a file + * specified with the -f argument and writes the mesh contained therein + * into a file specified with the -o argument. + */ + +// Axom includes +#include "axom/config.hpp" +#include "axom/core.hpp" +#include "axom/slic.hpp" + +#include "axom/CLI11.hpp" +#include "axom/fmt.hpp" + +// _read_proe_include2_start +#include "axom/mint/mesh/Mesh.hpp" +#include "axom/mint/mesh/UnstructuredMesh.hpp" +#include "axom/mint/utils/vtk_utils.hpp" // for write_vtk +// _read_proe_include2_end + +// _read_proe_include1_start +#include "axom/quest/readers/ProEReader.hpp" +// _read_proe_include1_end + +// _read_proe_typealiases_start +namespace mint = axom::mint; +namespace primal = axom::primal; +namespace slic = axom::slic; + +using IndexType = axom::IndexType; +using UMesh = mint::UnstructuredMesh; +// _read_proe_typealiases_end + +//------------------------------------------------------------------------------ +void initialize_logger() +{ + // initialize logger + slic::initialize(); + slic::setLoggingMsgLevel(slic::message::Info); + + // setup the logstreams + std::string fmt = ""; + slic::LogStream* logStream = nullptr; + + fmt = "[]: \n"; + logStream = new slic::GenericOutputStream(&std::cout, fmt); + + // register stream objects with the logger + slic::addStreamToAllMsgLevels(logStream); +} + +//------------------------------------------------------------------------------ +void finalize_logger() +{ + slic::flushStreams(); + slic::finalize(); +} + +struct Arguments +{ + std::string file_name; + std::string outfile_name; + std::vector bbox_min; + std::vector bbox_max; + + Arguments() + { + bbox_min.resize(3); + bbox_max.resize(3); + } + + void parse(int argc, char** argv, axom::CLI::App& app) + { + app + .add_option("-i,--input", this->file_name, "specifies the input mesh file") + ->check(axom::CLI::ExistingFile) + ->required(); + + app + .add_option("-o,--outfile", + this->outfile_name, + "specifies the output mesh file") + ->required(); + + app + .add_option("--min", + this->bbox_min, + "specifies the minimum of the bounding box") + ->expected(3) + ->required(); + + app + .add_option("--max", + this->bbox_max, + "specifies the maximum of the bounding box") + ->expected(3) + ->required(); + + app.get_formatter()->column_width(40); + + // could throw an exception + app.parse(argc, argv); + + slic::flushStreams(); + } +}; + +int main(int argc, char** argv) +{ + initialize_logger(); + Arguments args; + axom::CLI::App app {"Example showing how to read a Pro/E mesh"}; + + try + { + args.parse(argc, argv, app); + } + catch(const axom::CLI::ParseError& e) + { + int retval = -1; + retval = app.exit(e); + finalize_logger(); + return retval; + } + + // The constructor of args resizes bbox_min and bbox_max to three elements. + double* bbox_min = args.bbox_min.data(); + double* bbox_max = args.bbox_max.data(); + + SLIC_INFO("Reading file: '" << args.file_name << "'...\n"); + // _read_proe_file_start + // Read file + axom::quest::ProEReader reader; + reader.setFileName(args.file_name); + + // Set up a bounding box to keep only certain tets. + // bbox_min and bbox_max are pointers to double. + axom::quest::ProEReader::BBox3D bbox; + bbox.addPoint(axom::quest::ProEReader::Point3D {bbox_min, 3}); + bbox.addPoint(axom::quest::ProEReader::Point3D {bbox_max, 3}); + // Keep only tets with all four nodes inside the bounding box. + reader.setTetPredFromBoundingBox(bbox, false); + // Pass true as the second argument of setTetPredFromBoundingBox() to + // keep tets with at least one node inside the bounding box. + // To keep all tets, do not set a TetPred. + + // Read in the file. + reader.read(); + + // Get surface mesh + UMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + // _read_proe_file_end + + SLIC_INFO("Mesh has " << mesh.getNumberOfNodes() << " vertices and " + << mesh.getNumberOfCells() << " triangles."); + + axom::mint::write_vtk(&mesh, args.outfile_name); + + finalize_logger(); +} diff --git a/src/axom/quest/examples/quest_signed_distance_interface.F b/src/axom/quest/examples/quest_signed_distance_interface.F index efaf226f4e..6d17397dad 100644 --- a/src/axom/quest/examples/quest_signed_distance_interface.F +++ b/src/axom/quest/examples/quest_signed_distance_interface.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/examples/quest_signed_distance_interface.cpp b/src/axom/quest/examples/quest_signed_distance_interface.cpp index 28354b6420..ffd99a7535 100644 --- a/src/axom/quest/examples/quest_signed_distance_interface.cpp +++ b/src/axom/quest/examples/quest_signed_distance_interface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/examples/scattered_interpolation.cpp b/src/axom/quest/examples/scattered_interpolation.cpp index 42616e915f..3029456fd4 100644 --- a/src/axom/quest/examples/scattered_interpolation.cpp +++ b/src/axom/quest/examples/scattered_interpolation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/examples/shaping_driver.cpp b/src/axom/quest/examples/shaping_driver.cpp index 874cabd859..396dcecaaa 100644 --- a/src/axom/quest/examples/shaping_driver.cpp +++ b/src/axom/quest/examples/shaping_driver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -59,14 +59,7 @@ enum class ShapingMethod : int Intersection }; -/// Choose runtime policy for RAJA -enum RuntimePolicy -{ - seq = 0, - omp = 1, - cuda = 2, - hip = 3 -}; +using RuntimePolicy = axom::runtime_policy::Policy; /// Struct to parse and store the input parameters struct Input @@ -84,7 +77,7 @@ struct Input klee::ShapeSet shapeSet; ShapingMethod shapingMethod {ShapingMethod::Sampling}; - RuntimePolicy policy {seq}; + RuntimePolicy policy {RuntimePolicy::seq}; int quadratureOrder {5}; int outputOrder {2}; int samplesPerKnotSpan {25}; @@ -99,23 +92,6 @@ struct Input private: bool m_verboseOutput {false}; - // clang-format off - const std::map s_validPolicies{ - #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) - {"seq", seq} - #ifdef AXOM_USE_OPENMP - , {"omp", omp} - #endif - #ifdef AXOM_USE_CUDA - , {"cuda", cuda} - #endif - #ifdef AXOM_USE_HIP - , {"hip", hip} - #endif - #endif - }; - // clang-format on - public: bool isVerbose() const { return m_verboseOutput; } @@ -348,7 +324,8 @@ struct Input intersection_options->add_option("-p, --policy", policy, pol_sstr.str()) ->capture_default_str() - ->transform(axom::CLI::CheckedTransformer(s_validPolicies)); + ->transform( + axom::CLI::CheckedTransformer(axom::runtime_policy::s_nameToPolicy)); } app.get_formatter()->column_width(50); diff --git a/src/axom/quest/interface/CMakeLists.txt b/src/axom/quest/interface/CMakeLists.txt index b32e050b4b..7d609c0e56 100644 --- a/src/axom/quest/interface/CMakeLists.txt +++ b/src/axom/quest/interface/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/c_fortran/typesQUEST.h b/src/axom/quest/interface/c_fortran/typesQUEST.h index aaf2baddc6..d4e830a695 100644 --- a/src/axom/quest/interface/c_fortran/typesQUEST.h +++ b/src/axom/quest/interface/c_fortran/typesQUEST.h @@ -1,7 +1,7 @@ // typesQUEST.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -10,10 +10,16 @@ #ifndef TYPESQUEST_H #define TYPESQUEST_H +// splicer begin types.CXX_declarations +// splicer end types.CXX_declarations + #ifdef __cplusplus extern "C" { #endif +// splicer begin types.C_declarations +// splicer end types.C_declarations + // helper capsule_data_helper struct s_QUEST_SHROUD_capsule_data { diff --git a/src/axom/quest/interface/c_fortran/wrapQUEST.cpp b/src/axom/quest/interface/c_fortran/wrapQUEST.cpp index 023b8329bd..6a742d41bb 100644 --- a/src/axom/quest/interface/c_fortran/wrapQUEST.cpp +++ b/src/axom/quest/interface/c_fortran/wrapQUEST.cpp @@ -1,22 +1,39 @@ // wrapQUEST.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapQUEST.h" -#include -#include + #include "axom/quest/interface/inout.hpp" #include "axom/quest/interface/signed_distance.hpp" -#include "typesQUEST.h" +#include +#include "wrapQUEST.h" // splicer begin CXX_definitions // splicer end CXX_definitions extern "C" { +// helper ShroudLenTrim +// Returns the length of character string src with length nsrc, +// ignoring any trailing blanks. +static int ShroudLenTrim(const char *src, int nsrc) +{ + int i; + + for(i = nsrc - 1; i >= 0; i--) + { + if(src[i] != ' ') + { + break; + } + } + + return i + 1; +} + // splicer begin C_definitions // splicer end C_definitions @@ -33,12 +50,13 @@ int QUEST_inout_init_mpi(const char *fileName, MPI_Fint comm) #endif // ifdef AXOM_USE_MPI #ifdef AXOM_USE_MPI -int QUEST_inout_init_mpi_bufferify(const char *fileName, - int LfileName, +int QUEST_inout_init_mpi_bufferify(char *fileName, + int SHT_fileName_len, MPI_Fint comm) { // splicer begin function.inout_init_mpi_bufferify - const std::string SHCXX_fileName(fileName, LfileName); + const std::string SHCXX_fileName(fileName, + ShroudLenTrim(fileName, SHT_fileName_len)); MPI_Comm SHCXX_comm = MPI_Comm_f2c(comm); int SHC_rv = axom::quest::inout_init(SHCXX_fileName, SHCXX_comm); return SHC_rv; @@ -58,10 +76,11 @@ int QUEST_inout_init_serial(const char *fileName) #endif // ifndef AXOM_USE_MPI #ifndef AXOM_USE_MPI -int QUEST_inout_init_serial_bufferify(const char *fileName, int LfileName) +int QUEST_inout_init_serial_bufferify(char *fileName, int SHT_fileName_len) { // splicer begin function.inout_init_serial_bufferify - const std::string SHCXX_fileName(fileName, LfileName); + const std::string SHCXX_fileName(fileName, + ShroudLenTrim(fileName, SHT_fileName_len)); int SHC_rv = axom::quest::inout_init(SHCXX_fileName); return SHC_rv; // splicer end function.inout_init_serial_bufferify @@ -177,12 +196,12 @@ int QUEST_signed_distance_init_mpi(const char *file, MPI_Fint comm) #endif // ifdef AXOM_USE_MPI #ifdef AXOM_USE_MPI -int QUEST_signed_distance_init_mpi_bufferify(const char *file, - int Lfile, +int QUEST_signed_distance_init_mpi_bufferify(char *file, + int SHT_file_len, MPI_Fint comm) { // splicer begin function.signed_distance_init_mpi_bufferify - const std::string SHCXX_file(file, Lfile); + const std::string SHCXX_file(file, ShroudLenTrim(file, SHT_file_len)); MPI_Comm SHCXX_comm = MPI_Comm_f2c(comm); int SHC_rv = axom::quest::signed_distance_init(SHCXX_file, SHCXX_comm); return SHC_rv; @@ -202,10 +221,10 @@ int QUEST_signed_distance_init_serial(const char *file) #endif // ifndef AXOM_USE_MPI #ifndef AXOM_USE_MPI -int QUEST_signed_distance_init_serial_bufferify(const char *file, int Lfile) +int QUEST_signed_distance_init_serial_bufferify(char *file, int SHT_file_len) { // splicer begin function.signed_distance_init_serial_bufferify - const std::string SHCXX_file(file, Lfile); + const std::string SHCXX_file(file, ShroudLenTrim(file, SHT_file_len)); int SHC_rv = axom::quest::signed_distance_init(SHCXX_file); return SHC_rv; // splicer end function.signed_distance_init_serial_bufferify @@ -317,11 +336,4 @@ void QUEST_signed_distance_finalize(void) // splicer end function.signed_distance_finalize } -// Release library allocated memory. -void QUEST_SHROUD_memory_destructor(QUEST_SHROUD_capsule_data *cap) -{ - cap->addr = nullptr; - cap->idtor = 0; // avoid deleting again -} - } // extern "C" diff --git a/src/axom/quest/interface/c_fortran/wrapQUEST.h b/src/axom/quest/interface/c_fortran/wrapQUEST.h index 54491c36d5..734dbf7355 100644 --- a/src/axom/quest/interface/c_fortran/wrapQUEST.h +++ b/src/axom/quest/interface/c_fortran/wrapQUEST.h @@ -1,7 +1,7 @@ // wrapQUEST.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -17,10 +17,10 @@ #ifdef AXOM_USE_MPI #include "mpi.h" #endif -#include "typesQUEST.h" #ifndef __cplusplus #include #endif +#include "typesQUEST.h" // splicer begin CXX_declarations // splicer end CXX_declarations @@ -41,21 +41,21 @@ enum QUEST_SignedDistExec // splicer end C_declarations #ifdef AXOM_USE_MPI -int QUEST_inout_init_mpi(const char* fileName, MPI_Fint comm); +int QUEST_inout_init_mpi(const char *fileName, MPI_Fint comm); #endif #ifdef AXOM_USE_MPI -int QUEST_inout_init_mpi_bufferify(const char* fileName, - int LfileName, +int QUEST_inout_init_mpi_bufferify(char *fileName, + int SHT_fileName_len, MPI_Fint comm); #endif #ifndef AXOM_USE_MPI -int QUEST_inout_init_serial(const char* fileName); +int QUEST_inout_init_serial(const char *fileName); #endif #ifndef AXOM_USE_MPI -int QUEST_inout_init_serial_bufferify(const char* fileName, int LfileName); +int QUEST_inout_init_serial_bufferify(char *fileName, int SHT_fileName_len); #endif bool QUEST_inout_initialized(void); @@ -72,37 +72,37 @@ bool QUEST_inout_evaluate_0(double x, double y); bool QUEST_inout_evaluate_1(double x, double y, double z); -int QUEST_inout_mesh_min_bounds(double* coords); +int QUEST_inout_mesh_min_bounds(double *coords); -int QUEST_inout_mesh_max_bounds(double* coords); +int QUEST_inout_mesh_max_bounds(double *coords); -int QUEST_inout_mesh_center_of_mass(double* coords); +int QUEST_inout_mesh_center_of_mass(double *coords); int QUEST_inout_get_dimension(void); int QUEST_inout_finalize(void); #ifdef AXOM_USE_MPI -int QUEST_signed_distance_init_mpi(const char* file, MPI_Fint comm); +int QUEST_signed_distance_init_mpi(const char *file, MPI_Fint comm); #endif #ifdef AXOM_USE_MPI -int QUEST_signed_distance_init_mpi_bufferify(const char* file, - int Lfile, +int QUEST_signed_distance_init_mpi_bufferify(char *file, + int SHT_file_len, MPI_Fint comm); #endif #ifndef AXOM_USE_MPI -int QUEST_signed_distance_init_serial(const char* file); +int QUEST_signed_distance_init_serial(const char *file); #endif #ifndef AXOM_USE_MPI -int QUEST_signed_distance_init_serial_bufferify(const char* file, int Lfile); +int QUEST_signed_distance_init_serial_bufferify(char *file, int SHT_file_len); #endif bool QUEST_signed_distance_initialized(void); -void QUEST_signed_distance_get_mesh_bounds(double* lo, double* hi); +void QUEST_signed_distance_get_mesh_bounds(double *lo, double *hi); void QUEST_signed_distance_set_dimension(int dim); @@ -123,12 +123,12 @@ double QUEST_signed_distance_evaluate_0(double x, double y, double z); double QUEST_signed_distance_evaluate_1(double x, double y, double z, - double* cp_x, - double* cp_y, - double* cp_z, - double* n_x, - double* n_y, - double* n_z); + double *cp_x, + double *cp_y, + double *cp_z, + double *n_x, + double *n_y, + double *n_z); void QUEST_signed_distance_finalize(void); diff --git a/src/axom/quest/interface/c_fortran/wrapfquest.F b/src/axom/quest/interface/c_fortran/wrapfquest.F index 1b1174f1c8..e93bd21b24 100644 --- a/src/axom/quest/interface/c_fortran/wrapfquest.F +++ b/src/axom/quest/interface/c_fortran/wrapfquest.F @@ -1,7 +1,7 @@ ! wrapfquest.F -! This file is generated by Shroud 0.12.2. Do not edit. +! This file is generated by Shroud 0.13.0. Do not edit. ! -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) @@ -41,13 +41,14 @@ end function c_inout_init_mpi #endif #ifdef AXOM_USE_MPI - function c_inout_init_mpi_bufferify(fileName, LfileName, comm) & + function c_inout_init_mpi_bufferify(fileName, SHT_fileName_len, & + comm) & result(SHT_rv) & bind(C, name="QUEST_inout_init_mpi_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: fileName(*) - integer(C_INT), value, intent(IN) :: LfileName + integer(C_INT), value, intent(IN) :: SHT_fileName_len integer(C_INT), value, intent(IN) :: comm integer(C_INT) :: SHT_rv end function c_inout_init_mpi_bufferify @@ -65,13 +66,14 @@ end function c_inout_init_serial #endif #ifndef AXOM_USE_MPI - function c_inout_init_serial_bufferify(fileName, LfileName) & + function c_inout_init_serial_bufferify(fileName, & + SHT_fileName_len) & result(SHT_rv) & bind(C, name="QUEST_inout_init_serial_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: fileName(*) - integer(C_INT), value, intent(IN) :: LfileName + integer(C_INT), value, intent(IN) :: SHT_fileName_len integer(C_INT) :: SHT_rv end function c_inout_init_serial_bufferify #endif @@ -198,13 +200,14 @@ end function c_signed_distance_init_mpi #endif #ifdef AXOM_USE_MPI - function c_signed_distance_init_mpi_bufferify(file, Lfile, comm) & + function c_signed_distance_init_mpi_bufferify(file, & + SHT_file_len, comm) & result(SHT_rv) & bind(C, name="QUEST_signed_distance_init_mpi_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: file(*) - integer(C_INT), value, intent(IN) :: Lfile + integer(C_INT), value, intent(IN) :: SHT_file_len integer(C_INT), value, intent(IN) :: comm integer(C_INT) :: SHT_rv end function c_signed_distance_init_mpi_bufferify @@ -222,13 +225,14 @@ end function c_signed_distance_init_serial #endif #ifndef AXOM_USE_MPI - function c_signed_distance_init_serial_bufferify(file, Lfile) & + function c_signed_distance_init_serial_bufferify(file, & + SHT_file_len) & result(SHT_rv) & bind(C, name="QUEST_signed_distance_init_serial_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: file(*) - integer(C_INT), value, intent(IN) :: Lfile + integer(C_INT), value, intent(IN) :: SHT_file_len integer(C_INT) :: SHT_rv end function c_signed_distance_init_serial_bufferify #endif @@ -331,9 +335,6 @@ subroutine quest_signed_distance_finalize() & bind(C, name="QUEST_signed_distance_finalize") implicit none end subroutine quest_signed_distance_finalize - - ! splicer begin additional_interfaces - ! splicer end additional_interfaces end interface interface quest_inout_evaluate @@ -364,6 +365,9 @@ end subroutine quest_signed_distance_finalize #endif end interface quest_signed_distance_init + ! splicer begin additional_declarations + ! splicer end additional_declarations + contains #ifdef AXOM_USE_MPI @@ -374,8 +378,10 @@ function quest_inout_init_mpi(fileName, comm) & integer, value, intent(IN) :: comm integer(C_INT) :: SHT_rv ! splicer begin function.inout_init_mpi - SHT_rv = c_inout_init_mpi_bufferify(fileName, & - len_trim(fileName, kind=C_INT), comm) + integer(C_INT) SHT_fileName_len + SHT_fileName_len = len(fileName, kind=C_INT) + SHT_rv = c_inout_init_mpi_bufferify(fileName, SHT_fileName_len, & + comm) ! splicer end function.inout_init_mpi end function quest_inout_init_mpi #endif @@ -387,8 +393,10 @@ function quest_inout_init_serial(fileName) & character(len=*), intent(IN) :: fileName integer(C_INT) :: SHT_rv ! splicer begin function.inout_init_serial + integer(C_INT) SHT_fileName_len + SHT_fileName_len = len(fileName, kind=C_INT) SHT_rv = c_inout_init_serial_bufferify(fileName, & - len_trim(fileName, kind=C_INT)) + SHT_fileName_len) ! splicer end function.inout_init_serial end function quest_inout_init_serial #endif @@ -445,8 +453,10 @@ function quest_signed_distance_init_mpi(file, comm) & integer, value, intent(IN) :: comm integer(C_INT) :: SHT_rv ! splicer begin function.signed_distance_init_mpi + integer(C_INT) SHT_file_len + SHT_file_len = len(file, kind=C_INT) SHT_rv = c_signed_distance_init_mpi_bufferify(file, & - len_trim(file, kind=C_INT), comm) + SHT_file_len, comm) ! splicer end function.signed_distance_init_mpi end function quest_signed_distance_init_mpi #endif @@ -458,8 +468,10 @@ function quest_signed_distance_init_serial(file) & character(len=*), intent(IN) :: file integer(C_INT) :: SHT_rv ! splicer begin function.signed_distance_init_serial + integer(C_INT) SHT_file_len + SHT_file_len = len(file, kind=C_INT) SHT_rv = c_signed_distance_init_serial_bufferify(file, & - len_trim(file, kind=C_INT)) + SHT_file_len) ! splicer end function.signed_distance_init_serial end function quest_signed_distance_init_serial #endif diff --git a/src/axom/quest/interface/inout.cpp b/src/axom/quest/interface/inout.cpp index df743ae69b..af2521b840 100644 --- a/src/axom/quest/interface/inout.cpp +++ b/src/axom/quest/interface/inout.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -58,7 +58,7 @@ struct InOutHelper void setDefault() { *this = State {}; } }; - InOutHelper() : m_surfaceMesh(nullptr), m_inoutTree(nullptr) + InOutHelper() { m_params.setDefault(); m_state.setDefault(); @@ -214,14 +214,14 @@ struct InOutHelper // deal with spatial index if(m_inoutTree != nullptr) { - delete(m_inoutTree); + delete m_inoutTree; m_inoutTree = nullptr; } // deal with mesh if(m_state.m_should_delete_mesh) { - delete(m_surfaceMesh); + delete m_surfaceMesh; } m_surfaceMesh = nullptr; @@ -294,8 +294,8 @@ struct InOutHelper } private: - mint::Mesh* m_surfaceMesh; - InOutOctree* m_inoutTree; + mint::Mesh* m_surfaceMesh {nullptr}; + InOutOctree* m_inoutTree {nullptr}; GeometricBoundingBox m_meshBoundingBox; SpacePt m_meshCenterOfMass; @@ -401,13 +401,21 @@ int inout_init(mint::Mesh*& mesh, MPI_Comm comm) int inout_finalize() { const int dim = inout_get_dimension(); + SLIC_ASSERT(dim == 2 || dim == 3); - // Finalize the 2D and 3D structures and reset the params - int rc2 = s_inoutHelper2D.finalize(); - int rc3 = s_inoutHelper3D.finalize(); + // Finalize the inout structures and reset the params + int rc = QUEST_INOUT_FAILED; + if(dim == 2) + { + rc = s_inoutHelper2D.finalize(); + } + else // dim == 3 + { + rc = s_inoutHelper3D.finalize(); + } s_inoutParams.setDefault(); - return (dim == 2) ? rc2 : rc3; + return rc; } //------------------------------------------------------------------------------ diff --git a/src/axom/quest/interface/inout.hpp b/src/axom/quest/interface/inout.hpp index 6246853208..e2d8284a3b 100644 --- a/src/axom/quest/interface/inout.hpp +++ b/src/axom/quest/interface/inout.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -7,13 +7,13 @@ #define QUEST_INOUT_INTERFACE_HPP_ // Axom includes -#include "axom/config.hpp" // for compile-time configuration options +#include "axom/config.hpp" // Quest includes -#include "axom/quest/interface/internal/mpicomm_wrapper.hpp" // MPI_COMM_SELF +#include "axom/quest/interface/internal/mpicomm_wrapper.hpp" // C/C++ includes -#include // for std::string +#include /*! * \file inout.hpp diff --git a/src/axom/quest/interface/internal/QuestHelpers.cpp b/src/axom/quest/interface/internal/QuestHelpers.cpp index 6d5efbfc67..33b8317bd3 100644 --- a/src/axom/quest/interface/internal/QuestHelpers.cpp +++ b/src/axom/quest/interface/internal/QuestHelpers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/internal/QuestHelpers.hpp b/src/axom/quest/interface/internal/QuestHelpers.hpp index 67262afa9b..12e6411abe 100644 --- a/src/axom/quest/interface/internal/QuestHelpers.hpp +++ b/src/axom/quest/interface/internal/QuestHelpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -57,7 +57,7 @@ class ScopedLogLevelChanger } private: - slic::message::Level m_previousLevel; + slic::message::Level m_previousLevel {slic::message::Level::Debug}; }; /// \name MPI Helper/Wrapper Methods diff --git a/src/axom/quest/interface/internal/mpicomm_wrapper.hpp b/src/axom/quest/interface/internal/mpicomm_wrapper.hpp index 90a5310e67..e54573b664 100644 --- a/src/axom/quest/interface/internal/mpicomm_wrapper.hpp +++ b/src/axom/quest/interface/internal/mpicomm_wrapper.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/python/README.md b/src/axom/quest/interface/python/README.md index 2011848631..11dec93ef3 100644 --- a/src/axom/quest/interface/python/README.md +++ b/src/axom/quest/interface/python/README.md @@ -25,10 +25,15 @@ Both `mpi4py` and Axom should be build with the same version of MPI. These flags may be different than the ones used to compile Axom. Some functions in `quest_shroud.yaml` are not wrapped pending fixes to shroud. -(version 0.10.1 is currently used) +(version 0.13.0 is currently used) A sample host-config file is provided in `host-configs/other/no-tpl-toss_3_x86_64_ib-intel@19.0.4.cmake`. This host-config requires no third-party libraries but does not enable Sidre. The Python interface requires you build Axom with shared libraries which can be enabled via the CMake command line with `-DBUILD_SHARED_LIBS=ON` and defining MPI_HOME, which is already enabled in the sample host-config. + +To build only quest, and its dependencies: + + ./config-build.py -hc host-configs/other/no-tpl-toss_3_x86_64_ib-intel@19.0.4.cmake -DBUILD_SHARED_LIBS=ON -DAXOM_ENABLE_ALL_COMPONENTS=BOOL:OFF -DAXOM_ENABLE_QUEST=BOOL:ON -DAXOM_ENABLE_MINT=BOOL:ON -DAXOM_ENABLE_SLIC=BOOL:ON -DAXOM_ENABLE_SLAM=BOOL:ON -DAXOM_ENABLE_PRIMAL=BOOL:ON -DAXOM_ENABLE_SPIN=BOOL:ON + diff --git a/src/axom/quest/interface/python/pyQUESThelper.cpp b/src/axom/quest/interface/python/pyQUESThelper.cpp index ce8738dd7d..064e6673e6 100644 --- a/src/axom/quest/interface/python/pyQUESThelper.cpp +++ b/src/axom/quest/interface/python/pyQUESThelper.cpp @@ -1,7 +1,7 @@ // pyQUESThelper.cpp // This is generated code, do not edit // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/python/pyQUESTmodule.cpp b/src/axom/quest/interface/python/pyQUESTmodule.cpp index 04abc13e45..981b88f5bb 100644 --- a/src/axom/quest/interface/python/pyQUESTmodule.cpp +++ b/src/axom/quest/interface/python/pyQUESTmodule.cpp @@ -1,7 +1,7 @@ // pyQUESTmodule.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/python/pyQUESTmodule.hpp b/src/axom/quest/interface/python/pyQUESTmodule.hpp index c3344b42a9..c162fadba6 100644 --- a/src/axom/quest/interface/python/pyQUESTmodule.hpp +++ b/src/axom/quest/interface/python/pyQUESTmodule.hpp @@ -1,15 +1,18 @@ // pyQUESTmodule.hpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) #ifndef PYQUESTMODULE_HPP #define PYQUESTMODULE_HPP + #include + #include "axom/quest/interface/inout.hpp" #include "axom/quest/interface/signed_distance.hpp" + // splicer begin header.include // splicer end header.include diff --git a/src/axom/quest/interface/python/pyQUESTutil.cpp b/src/axom/quest/interface/python/pyQUESTutil.cpp index 62bec38448..8b72087c64 100644 --- a/src/axom/quest/interface/python/pyQUESTutil.cpp +++ b/src/axom/quest/interface/python/pyQUESTutil.cpp @@ -1,7 +1,7 @@ // pyQUESTutil.cpp // This is generated code, do not edit // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/python/quest_test.py.in b/src/axom/quest/interface/python/quest_test.py.in index 98968fcb97..f37d8291f5 100644 --- a/src/axom/quest/interface/python/quest_test.py.in +++ b/src/axom/quest/interface/python/quest_test.py.in @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/python/setup.py.in b/src/axom/quest/interface/python/setup.py.in index d8505c6004..a79ecace2e 100644 --- a/src/axom/quest/interface/python/setup.py.in +++ b/src/axom/quest/interface/python/setup.py.in @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/quest_shroud.yaml b/src/axom/quest/interface/quest_shroud.yaml index d20091a48b..9550bc0bbf 100644 --- a/src/axom/quest/interface/quest_shroud.yaml +++ b/src/axom/quest/interface/quest_shroud.yaml @@ -4,7 +4,7 @@ # copyright: - - - Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and + - Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and - other Axom Project Developers. See the top-level LICENSE file for details. - - "SPDX-License-Identifier: (BSD-3-Clause)" @@ -19,8 +19,8 @@ options: F_module_name_library_template: axom_{library_lower} # F_module_per_class: False # Change the default template for Fortran functions to include the library name. - F_name_impl_template: "{library_lower}_{C_name_scope}{underscore_name}{function_suffix}" - F_name_generic_template: "{library_lower}_{underscore_name}" + F_name_impl_template: "{library_lower}_{C_name_scope}{F_name_api}{function_suffix}" + F_name_generic_template: "{library_lower}_{F_name_api}" wrap_python: True format: diff --git a/src/axom/quest/interface/signed_distance.cpp b/src/axom/quest/interface/signed_distance.cpp index 7a455233fe..4101c52eb0 100644 --- a/src/axom/quest/interface/signed_distance.cpp +++ b/src/axom/quest/interface/signed_distance.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/signed_distance.hpp b/src/axom/quest/interface/signed_distance.hpp index b0fd5cb99f..03916f2121 100644 --- a/src/axom/quest/interface/signed_distance.hpp +++ b/src/axom/quest/interface/signed_distance.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/interface/yaml/quest_types.yaml b/src/axom/quest/interface/yaml/quest_types.yaml index a3ee3065e6..525c4fed8b 100644 --- a/src/axom/quest/interface/yaml/quest_types.yaml +++ b/src/axom/quest/interface/yaml/quest_types.yaml @@ -1,7 +1,7 @@ # quest_types.yaml -# This file is generated by Shroud 0.12.2. Do not edit. +# This file is generated by Shroud 0.13.0. Do not edit. # -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/C2CReader.cpp b/src/axom/quest/readers/C2CReader.cpp index 18646fd1aa..f4a898016e 100644 --- a/src/axom/quest/readers/C2CReader.cpp +++ b/src/axom/quest/readers/C2CReader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/C2CReader.hpp b/src/axom/quest/readers/C2CReader.hpp index fcb2401a58..9f934b21e0 100644 --- a/src/axom/quest/readers/C2CReader.hpp +++ b/src/axom/quest/readers/C2CReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/PC2CReader.cpp b/src/axom/quest/readers/PC2CReader.cpp index 1ffa6d584a..5035f4fe78 100644 --- a/src/axom/quest/readers/PC2CReader.cpp +++ b/src/axom/quest/readers/PC2CReader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/PC2CReader.hpp b/src/axom/quest/readers/PC2CReader.hpp index d45b91fca0..4168ca49a6 100644 --- a/src/axom/quest/readers/PC2CReader.hpp +++ b/src/axom/quest/readers/PC2CReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/PProEReader.cpp b/src/axom/quest/readers/PProEReader.cpp index 1133a306ab..05fcd9ea5d 100644 --- a/src/axom/quest/readers/PProEReader.cpp +++ b/src/axom/quest/readers/PProEReader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/PProEReader.hpp b/src/axom/quest/readers/PProEReader.hpp index 60c51ad317..5d3560d3d8 100644 --- a/src/axom/quest/readers/PProEReader.hpp +++ b/src/axom/quest/readers/PProEReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/PSTLReader.cpp b/src/axom/quest/readers/PSTLReader.cpp index 45c610d1b7..4e222c59e9 100644 --- a/src/axom/quest/readers/PSTLReader.cpp +++ b/src/axom/quest/readers/PSTLReader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/PSTLReader.hpp b/src/axom/quest/readers/PSTLReader.hpp index f851c9b8e2..73d803144c 100644 --- a/src/axom/quest/readers/PSTLReader.hpp +++ b/src/axom/quest/readers/PSTLReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/readers/ProEReader.cpp b/src/axom/quest/readers/ProEReader.cpp index f4a76cfc5d..644381f777 100644 --- a/src/axom/quest/readers/ProEReader.cpp +++ b/src/axom/quest/readers/ProEReader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -9,6 +9,7 @@ #include "axom/core/utilities/Utilities.hpp" #include "axom/mint/mesh/CellTypes.hpp" #include "axom/slic/interface/slic.hpp" +#include "axom/primal/geometry/Point.hpp" // C/C++ includes #include @@ -38,9 +39,6 @@ void ProEReader::clear() //------------------------------------------------------------------------------ int ProEReader::read() { - constexpr int NUM_NODES_PER_TET = 4; - constexpr int NUM_COMPS_PER_NODE = 3; - std::string junk; int id; int tet_nodes[NUM_NODES_PER_TET]; @@ -69,7 +67,6 @@ int ProEReader::read() ifs >> m_num_nodes >> m_num_tets; m_nodes.reserve(m_num_nodes * NUM_COMPS_PER_NODE); - m_tets.reserve(m_num_tets * NUM_NODES_PER_TET); // Initialize nodes for(int i = 0; i < m_num_nodes; i++) @@ -83,21 +80,72 @@ int ProEReader::read() } // Initialize tets + int tet_count = 0; for(int i = 0; i < m_num_tets; i++) { ifs >> id >> tet_nodes[0] >> tet_nodes[1] >> tet_nodes[2] >> tet_nodes[3]; - for(int j = 0; j < NUM_NODES_PER_TET; j++) + if(!m_tetPredicate || m_tetPredicate(tet_nodes, i, m_nodes)) { - // Node IDs start at 1 instead of 0, adjust to 0 for indexing - m_tets.push_back(tet_nodes[j] - 1); + tet_count += 1; + for(int j = 0; j < NUM_NODES_PER_TET; j++) + { + // Node IDs start at 1 instead of 0, adjust to 0 for indexing + m_tets.push_back(tet_nodes[j] - 1); + } } } ifs.close(); + + compact_arrays(tet_count); + return (0); } +//------------------------------------------------------------------------------ +void ProEReader::setTetPredFromBoundingBox(BBox3D& box, bool inclusive) +{ + if(box.isValid()) + { + if(!inclusive) + { + auto pred = [box](int tet_nodes[4], int, std::vector& nodes) { + bool retval = true; + for(int i = 0; i < ProEReader::NUM_NODES_PER_TET; ++i) + { + // Node IDs start at 1 instead of 0, adjust to 0 for indexing + Point3D p(&nodes[3 * (tet_nodes[i] - 1)], 3); + retval = retval && box.contains(p); + } + return retval; + }; + setTetPred(pred); + } + else + { + auto pred = [box](int tet_nodes[4], int, std::vector& nodes) { + bool retval = false; + for(int i = 0; i < ProEReader::NUM_NODES_PER_TET; ++i) + { + // Node IDs start at 1 instead of 0, adjust to 0 for indexing + Point3D p(&nodes[3 * (tet_nodes[i] - 1)], 3); + retval = retval || box.contains(p); + } + return retval; + }; + setTetPred(pred); + } + } +} + +//------------------------------------------------------------------------------ +void ProEReader::compact_arrays(int elt_count) +{ + m_tets.resize(elt_count * NUM_NODES_PER_TET); + m_num_tets = elt_count; +} + //------------------------------------------------------------------------------ void ProEReader::getMesh(axom::mint::UnstructuredMesh* mesh) { diff --git a/src/axom/quest/readers/ProEReader.hpp b/src/axom/quest/readers/ProEReader.hpp index 2eb97fabc2..27b00a1c2a 100644 --- a/src/axom/quest/readers/ProEReader.hpp +++ b/src/axom/quest/readers/ProEReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -10,6 +10,7 @@ #include "axom/config.hpp" #include "axom/core/Macros.hpp" #include "axom/mint/mesh/UnstructuredMesh.hpp" +#include "axom/primal/geometry/BoundingBox.hpp" // C/C++ includes #include // for std::string @@ -27,11 +28,44 @@ namespace quest * * Pro/Engineer (also known as Creo) is a modeling application. * + * To read an ASCII Pro/E tet file, + * - instantiate a ProEReader, + * - set the file name, + * - optionally set a tetrahedron predicate to specify a subset of the mesh, + * - call \a read(), + * - optionally, query the number of nodes or tets, + * - retrieve the mesh with \a getMesh(). + * + * The tetrahedron predicate is optional. If none is specified using + * either \a setTetPredFromBoundingBox or \a setTetPred, the reader + * retains all tets. In any case, the reader retains all nodes in the + * Pro/E file, even those not referenced by any tets. + * + * The tetrahedron predicate is intended to save memory by retaining tets + * for which the predicate returns true and discarding all others. A code + * can use the convenience function \a setTetPredFromBoundingBox() to + * discard all tets outside a bounding box, or specify an arbitrary + * function (\a TetPred) for more complicated decisions. + * * \note Pro/E node IDs start at 1. ProEReader adjusts and stores * node IDs to start at 0 for indexing. */ class ProEReader { +public: + constexpr static int NUM_NODES_PER_TET = 4; + constexpr static int NUM_COMPS_PER_NODE = 3; + using Point3D = primal::Point; + using BBox3D = primal::BoundingBox; + /*! \brief Specify tets to keep. + * + * - First argument: Pro/E node IDs for the current tet (1-based) + * - Second argument: Pro/E tet ID for the current tet (1-based) + * - Third argument: The node locations, stored interleaved + * (x1, y1, z1, x2, y2, z2, ... ) + */ + using TetPred = std::function&)>; + public: /*! * \brief Constructor. @@ -73,6 +107,28 @@ class ProEReader */ virtual int read(); + /// \name Set tetrahedron predicate to read mesh subset + /// @{ + /*! + * The reader calls the \a TetPred \a p after reading each tet, + * retaining tets where p returns true and discarding the rest. + * If a TetPred is not set, the reader retains all tets. + */ + virtual void setTetPred(const TetPred& p) { m_tetPredicate = p; } + + /*! + * Convenience function to set a \a TetPred from a bounding box. + * + * \param box The TetPred will be defined in terms of the provided + * bounding box. If the box is invalid, no TetPred is constructed + * and all tets are retained. + * \param inclusive If true (the default), the TetPred will keep all tets + * with at least one node in the box. If false, the TetPred will + * discard any tet with at least one node outside the box. + */ + virtual void setTetPredFromBoundingBox(BBox3D& box, bool inclusive = true); + /// @} + /*! * \brief Stores the Pro/E data in the supplied unstructured mesh object. * \param [in,out] mesh pointer to the unstructured mesh. @@ -89,6 +145,17 @@ class ProEReader std::vector m_nodes; std::vector m_tets; + TetPred m_tetPredicate; + + /*! + * \brief Compact internal mesh storage arrays + * \param [in] elt_count Number of elements stored in array + * + * This method compacts the vertex array and resizes the vertex and the + * element arrays to their minimum sizes. + */ + void compact_arrays(int elt_count); + private: DISABLE_COPY_AND_ASSIGNMENT(ProEReader); DISABLE_MOVE_AND_ASSIGNMENT(ProEReader); diff --git a/src/axom/quest/readers/STLReader.cpp b/src/axom/quest/readers/STLReader.cpp index 1ff1efa835..a76de874a1 100644 --- a/src/axom/quest/readers/STLReader.cpp +++ b/src/axom/quest/readers/STLReader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -74,7 +74,7 @@ bool STLReader::isAsciiFormat() const if(!utilities::isLittleEndian()) { - numTris = utilities::swapEndian(numTris); + numTris = utilities::byteswap(numTris); } // Check if the size matches our expectation @@ -166,7 +166,7 @@ int STLReader::readBinarySTL() if(!isLittleEndian) { - m_num_faces = utilities::swapEndian(m_num_faces); + m_num_faces = utilities::byteswap(m_num_faces); } m_num_nodes = m_num_faces * 3; @@ -180,7 +180,7 @@ int STLReader::readBinarySTL() for(int j = 0; j < 9; ++j) { float coord = isLittleEndian ? tri.data.vert[j] - : utilities::swapEndian(tri.data.vert[j]); + : utilities::byteswap(tri.data.vert[j]); m_nodes.push_back(static_cast(coord)); } diff --git a/src/axom/quest/readers/STLReader.hpp b/src/axom/quest/readers/STLReader.hpp index 189d3a4d8f..3727d1fa19 100644 --- a/src/axom/quest/readers/STLReader.hpp +++ b/src/axom/quest/readers/STLReader.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/CMakeLists.txt b/src/axom/quest/tests/CMakeLists.txt index 55b1ac266e..95042c29d5 100644 --- a/src/axom/quest/tests/CMakeLists.txt +++ b/src/axom/quest/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -15,6 +15,7 @@ set(quest_tests quest_pro_e_reader.cpp quest_stl_reader.cpp quest_vertex_weld.cpp + quest_array_indexer.cpp ) blt_list_append(TO quest_tests @@ -55,6 +56,32 @@ if(TARGET quest_discretize_test) ) endif() +#------------------------------------------------------------------------------ +# Tests that use Conduit when available +#------------------------------------------------------------------------------ + +if(CONDUIT_FOUND AND AXOM_DATA_DIR) + axom_add_executable( + NAME quest_mesh_view_util_test + SOURCES quest_mesh_view_util.cpp + OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} + DEPENDS_ON ${quest_tests_depends} conduit + FOLDER axom/quest/tests + ) + set(quest_data_dir ${AXOM_DATA_DIR}/quest) + + # These examples currently segfault on windows without MPI when loading the test data into conduit + if(AXOM_ENABLE_TESTS AND AXOM_DATA_DIR AND NOT WIN32) + axom_add_test( + NAME quest_mesh_view_util + COMMAND quest_mesh_view_util_test + --verbose) + unset(_nranks) + unset(_test) + endif() + +endif() + #------------------------------------------------------------------------------ # Tests that use MFEM when available #------------------------------------------------------------------------------ diff --git a/src/axom/quest/tests/quest_all_nearest_neighbors.cpp b/src/axom/quest/tests/quest_all_nearest_neighbors.cpp index e32548e0f4..42bdb9d324 100644 --- a/src/axom/quest/tests/quest_all_nearest_neighbors.cpp +++ b/src/axom/quest/tests/quest_all_nearest_neighbors.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_array_indexer.cpp b/src/axom/quest/tests/quest_array_indexer.cpp new file mode 100644 index 0000000000..a84430b68d --- /dev/null +++ b/src/axom/quest/tests/quest_array_indexer.cpp @@ -0,0 +1,443 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +// Axom includes +#include "axom/core/Array.hpp" +#include "axom/quest/ArrayIndexer.hpp" +#include "axom/fmt.hpp" + +// Google test include +#include "gtest/gtest.h" + +// Test strides and permutations. +TEST(quest_array_indexer, quest_strides_and_permutations) +{ + { + // 1D + constexpr int DIM = 1; + axom::StackArray lengths {2}; + + axom::ArrayIndexer colIndexer( + lengths, + axom::ArrayStrideOrder::COLUMN); + EXPECT_EQ(colIndexer.getStrideOrder(), axom::ArrayStrideOrder::BOTH); + axom::StackArray colSlowestDirs {0}; + axom::StackArray colStrides {1}; + for(int d = 0; d < DIM; ++d) + { + EXPECT_EQ(colIndexer.slowestDirs()[d], colSlowestDirs[d]); + EXPECT_EQ(colIndexer.strides()[d], colStrides[d]); + } + EXPECT_TRUE( + colIndexer == + (axom::ArrayIndexer(lengths, colSlowestDirs))); + + axom::ArrayIndexer rowIndexer( + lengths, + axom::ArrayStrideOrder::ROW); + EXPECT_EQ(rowIndexer.getStrideOrder(), axom::ArrayStrideOrder::BOTH); + axom::StackArray rowSlowestDirs {0}; + axom::StackArray rowStrides {1}; + for(int d = 0; d < DIM; ++d) + { + EXPECT_EQ(rowIndexer.slowestDirs()[d], rowSlowestDirs[d]); + EXPECT_EQ(rowIndexer.strides()[d], rowStrides[d]); + } + EXPECT_TRUE( + rowIndexer == + (axom::ArrayIndexer(lengths, rowSlowestDirs))); + } + { + // 2D + constexpr int DIM = 2; + axom::StackArray lengths {3, 2}; + + axom::ArrayIndexer colIndexer( + lengths, + axom::ArrayStrideOrder::COLUMN); + EXPECT_EQ(colIndexer.getStrideOrder(), axom::ArrayStrideOrder::COLUMN); + axom::StackArray colSlowestDirs {1, 0}; + axom::StackArray colStrides {1, 3}; + for(int d = 0; d < DIM; ++d) + { + EXPECT_EQ(colIndexer.slowestDirs()[d], colSlowestDirs[d]); + EXPECT_EQ(colIndexer.strides()[d], colStrides[d]); + } + + axom::ArrayIndexer rowIndexer( + lengths, + axom::ArrayStrideOrder::ROW); + EXPECT_EQ(rowIndexer.getStrideOrder(), axom::ArrayStrideOrder::ROW); + axom::StackArray rowSlowestDirs {0, 1}; + axom::StackArray rowStrides {2, 1}; + for(int d = 0; d < DIM; ++d) + { + EXPECT_EQ(rowIndexer.slowestDirs()[d], rowSlowestDirs[d]); + EXPECT_EQ(rowIndexer.strides()[d], rowStrides[d]); + } + } + { + // 3D + constexpr int DIM = 3; + axom::StackArray lengths {5, 3, 2}; + + axom::ArrayIndexer colIndexer( + lengths, + axom::ArrayStrideOrder::COLUMN); + EXPECT_EQ(colIndexer.getStrideOrder(), axom::ArrayStrideOrder::COLUMN); + axom::StackArray colSlowestDirs {2, 1, 0}; + axom::StackArray colStrides {1, 5, 15}; + for(int d = 0; d < DIM; ++d) + { + EXPECT_EQ(colIndexer.slowestDirs()[d], colSlowestDirs[d]); + EXPECT_EQ(colIndexer.strides()[d], colStrides[d]); + } + + axom::ArrayIndexer rowIndexer( + lengths, + axom::ArrayStrideOrder::ROW); + EXPECT_EQ(rowIndexer.getStrideOrder(), axom::ArrayStrideOrder::ROW); + axom::StackArray rowSlowestDirs {0, 1, 2}; + axom::StackArray rowStrides {6, 2, 1}; + for(int d = 0; d < DIM; ++d) + { + EXPECT_EQ(rowIndexer.slowestDirs()[d], rowSlowestDirs[d]); + EXPECT_EQ(rowIndexer.strides()[d], rowStrides[d]); + } + } +} + +// Test row-major offsets. +TEST(quest_array_indexer, quest_row_major_offset) +{ + { + // 1D + constexpr int DIM = 1; + axom::StackArray lengths {3}; + axom::ArrayIndexer ai(lengths, + axom::ArrayStrideOrder::ROW); + EXPECT_EQ(ai.getStrideOrder(), axom::ArrayStrideOrder::BOTH); + axom::IndexType offset = 0; + for(int i = 0; i < lengths[0]; ++i) + { + axom::StackArray indices {i}; + EXPECT_EQ(ai.toFlatIndex(indices), offset); + EXPECT_EQ(ai.toMultiIndex(offset), indices); + ++offset; + } + } + { + // 2D + constexpr int DIM = 2; + axom::StackArray lengths {3, 2}; + axom::ArrayIndexer ai(lengths, + axom::ArrayStrideOrder::ROW); + EXPECT_EQ(ai.getStrideOrder(), axom::ArrayStrideOrder::ROW); + axom::IndexType offset = 0; + for(int i = 0; i < lengths[0]; ++i) + { + for(int j = 0; j < lengths[1]; ++j) + { + axom::StackArray indices {i, j}; + EXPECT_EQ(ai.toFlatIndex(indices), offset); + EXPECT_EQ(ai.toMultiIndex(offset), indices); + ++offset; + } + } + } + { + // 3D + axom::StackArray lengths {5, 3, 2}; + axom::ArrayIndexer ai(lengths, + axom::ArrayStrideOrder::ROW); + EXPECT_EQ(ai.getStrideOrder(), axom::ArrayStrideOrder::ROW); + axom::IndexType offset = 0; + for(int i = 0; i < lengths[0]; ++i) + { + for(int j = 0; j < lengths[1]; ++j) + { + for(int k = 0; k < lengths[2]; ++k) + { + axom::StackArray indices {i, j, k}; + EXPECT_EQ(ai.toFlatIndex(indices), offset); + EXPECT_EQ(ai.toMultiIndex(offset), indices); + ++offset; + } + } + } + } +} + +// Test column-major offsets. +TEST(quest_array_indexer, quest_col_major_offset) +{ + { + // 1D + constexpr int DIM = 1; + axom::StackArray lengths {3}; + axom::ArrayIndexer ai(lengths, + axom::ArrayStrideOrder::COLUMN); + EXPECT_EQ(ai.getStrideOrder(), axom::ArrayStrideOrder::BOTH); + axom::IndexType offset = 0; + for(int i = 0; i < lengths[0]; ++i) + { + axom::StackArray indices {i}; + EXPECT_EQ(ai.toFlatIndex(indices), offset); + EXPECT_EQ(ai.toMultiIndex(offset), indices); + ++offset; + } + } + { + // 2D + constexpr int DIM = 2; + axom::StackArray lengths {3, 2}; + axom::ArrayIndexer ai(lengths, + axom::ArrayStrideOrder::COLUMN); + EXPECT_EQ(ai.getStrideOrder(), axom::ArrayStrideOrder::COLUMN); + axom::IndexType offset = 0; + for(int j = 0; j < lengths[1]; ++j) + { + for(int i = 0; i < lengths[0]; ++i) + { + axom::StackArray indices {i, j}; + EXPECT_EQ(ai.toFlatIndex(indices), offset); + EXPECT_EQ(ai.toMultiIndex(offset), indices); + ++offset; + } + } + } + { + // 3D + constexpr int DIM = 3; + axom::StackArray lengths {5, 3, 2}; + axom::ArrayIndexer ai(lengths, + axom::ArrayStrideOrder::COLUMN); + EXPECT_EQ(ai.getStrideOrder(), axom::ArrayStrideOrder::COLUMN); + axom::IndexType offset = 0; + for(int k = 0; k < lengths[2]; ++k) + { + for(int j = 0; j < lengths[1]; ++j) + { + for(int i = 0; i < lengths[0]; ++i) + { + axom::StackArray indices {i, j, k}; + EXPECT_EQ(ai.toFlatIndex(indices), offset); + EXPECT_EQ(ai.toMultiIndex(offset), indices); + ++offset; + } + } + } + } +} + +template +typename std::enable_if::type check_arbitrary_strides_nested_loops( + const axom::StackArray& lengths, + const axom::StackArray& fastestDirs, + const axom::ArrayIndexer& ai) +{ + /* + We address the array with natural indices, but arange the + nested loops to increase the offset by 1 each time around. + */ + axom::StackArray i; + auto& n = i[fastestDirs[0]]; + axom::IndexType offset = 0; + for(n = 0; n < lengths[fastestDirs[0]]; ++n) + { + SLIC_INFO(axom::fmt::format("offset {} i {}", offset, i)); + EXPECT_EQ(ai.toMultiIndex(offset), i); + EXPECT_EQ(ai.toFlatIndex(i), offset); + ++offset; + } +} + +template +typename std::enable_if::type check_arbitrary_strides_nested_loops( + const axom::StackArray& lengths, + const axom::StackArray& fastestDirs, + const axom::ArrayIndexer& ai) +{ + /* + We address the array with natural indices, but arange the + nested loops to increase the offset by 1 each time around. + */ + axom::StackArray ij; + auto& m = ij[fastestDirs[1]]; + auto& n = ij[fastestDirs[0]]; + axom::IndexType offset = 0; + for(m = 0; m < lengths[fastestDirs[1]]; ++m) + { + for(n = 0; n < lengths[fastestDirs[0]]; ++n) + { + SLIC_INFO(axom::fmt::format("offset {} ij {}", offset, ij)); + EXPECT_EQ(ai.toMultiIndex(offset), ij); + EXPECT_EQ(ai.toFlatIndex(ij), offset); + ++offset; + } + } +} + +template +typename std::enable_if::type check_arbitrary_strides_nested_loops( + const axom::StackArray& lengths, + const axom::StackArray& fastestDirs, + const axom::ArrayIndexer& ai) +{ + /* + We address the array with natural indices, but arange the + nested loops to increase the offset by 1 each time around. + */ + axom::StackArray ijk; + auto& l = ijk[fastestDirs[2]]; // Slowest dir + auto& m = ijk[fastestDirs[1]]; + auto& n = ijk[fastestDirs[0]]; // Fastest dir + axom::IndexType offset = 0; + for(l = 0; l < lengths[fastestDirs[2]]; ++l) + { + for(m = 0; m < lengths[fastestDirs[1]]; ++m) + { + for(n = 0; n < lengths[fastestDirs[0]]; ++n) + { + SLIC_INFO(axom::fmt::format("offset {} ijk {}", offset, ijk)); + EXPECT_EQ(ai.toMultiIndex(offset), ijk); + EXPECT_EQ(ai.toFlatIndex(ijk), offset); + ++offset; + } + } + } +} + +template +void check_arbitrary_strides( + const axom::StackArray& lengths, + const axom::StackArray& fastestDirs) +{ + // fastestDirs should be a permutation. + SLIC_INFO(axom::fmt::format("Testing lengths {} with fastestDirs {}", + lengths, + fastestDirs)); + + axom::StackArray strides; + axom::IndexType currentStride = 1; + for(int d = 0; d < DIM; ++d) + { + axom::IndexType currentDir = fastestDirs[d]; + strides[currentDir] = currentStride; + currentStride *= lengths[currentDir]; + } + + axom::ArrayIndexer ai(strides); + + const auto slowestDirs = ai.slowestDirs(); + for(int d = 0; d < DIM; ++d) + { + EXPECT_EQ(slowestDirs[d], fastestDirs[DIM - d - 1]); + } + + check_arbitrary_strides_nested_loops(lengths, fastestDirs, ai); +} + +// Test arbitrary strides. +TEST(quest_array_indexer, quest_arbitrary_strides) +{ + { + constexpr int DIM = 1; + // ArrayIndexer is overkill for 1D, but think of it as a smoke test. + axom::StackArray lengths {3}; + + axom::StackArray fastestDirs {0}; + check_arbitrary_strides(lengths, fastestDirs); + } + { + constexpr int DIM = 2; + axom::StackArray lengths {3, 2}; + + // Row-major ordering. + axom::StackArray rowFastestDirs {0, 1}; + check_arbitrary_strides(lengths, rowFastestDirs); + + // Col-major ordering. + axom::StackArray colFastestDirs {1, 0}; + check_arbitrary_strides(lengths, colFastestDirs); + + // A few random orderings. + axom::StackArray rand1FastestDirs {0, 1}; + check_arbitrary_strides(lengths, rand1FastestDirs); + axom::StackArray rand2FastestDirs {1, 0}; + check_arbitrary_strides(lengths, rand2FastestDirs); + } + { + constexpr int DIM = 3; + axom::StackArray lengths {5, 3, 2}; + + // Row-major ordering. + axom::StackArray rowFastestDirs {0, 1, 2}; + check_arbitrary_strides(lengths, rowFastestDirs); + + // Col-major ordering. + axom::StackArray colFastestDirs {2, 1, 0}; + check_arbitrary_strides(lengths, colFastestDirs); + + // A few random orderings. + axom::StackArray rand1FastestDirs {0, 2, 1}; + check_arbitrary_strides(lengths, rand1FastestDirs); + axom::StackArray rand2FastestDirs {2, 0, 1}; + check_arbitrary_strides(lengths, rand2FastestDirs); + axom::StackArray rand3FastestDirs {1, 0, 2}; + check_arbitrary_strides(lengths, rand3FastestDirs); + axom::StackArray rand4FastestDirs {1, 2, 0}; + check_arbitrary_strides(lengths, rand4FastestDirs); + } +} + +// Test column-major element offsets with Array's. +TEST(quest_array_indexer, quest_array_match) +{ + // No test for 1D. Array provides no non-trivial interface to test. + + { + constexpr int DIM = 2; + axom::StackArray lengths {3, 2}; + axom::Array a(lengths); + axom::ArrayIndexer ai(lengths, + axom::ArrayStrideOrder::ROW); + for(axom::IndexType i = 0; i < lengths[0]; ++i) + { + for(axom::IndexType j = 0; j < lengths[1]; ++j) + { + axom::StackArray indices {i, j}; + EXPECT_EQ(&a(i, j), &a.flatIndex(ai.toFlatIndex(indices))); + } + } + } + { + constexpr int DIM = 3; + axom::StackArray lengths {5, 3, 2}; + axom::Array a(lengths); + axom::ArrayIndexer ai(lengths, + axom::ArrayStrideOrder::ROW); + for(axom::IndexType i = 0; i < lengths[0]; ++i) + { + for(axom::IndexType j = 0; j < lengths[1]; ++j) + { + for(axom::IndexType k = 0; k < lengths[2]; ++k) + { + axom::StackArray indices {i, j, k}; + EXPECT_EQ(&a(i, j, k), &a.flatIndex(ai.toFlatIndex(indices))); + } + } + } + } +} + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc, argv); + + int result = RUN_ALL_TESTS(); + + return result; +} diff --git a/src/axom/quest/tests/quest_c2c_reader.cpp b/src/axom/quest/tests/quest_c2c_reader.cpp index 41c0a1e252..9ef156f504 100644 --- a/src/axom/quest/tests/quest_c2c_reader.cpp +++ b/src/axom/quest/tests/quest_c2c_reader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -32,10 +32,10 @@ namespace quest = axom::quest; namespace { -static const std::string C2C_LINE_FILENAME = "test_line.contour"; -static const std::string C2C_CIRCLE_FILENAME = "test_circle.contour"; -static const std::string C2C_SQUARE_FILENAME = "test_square.contour"; -static const std::string C2C_SPLINE_FILENAME = "test_spline.contour"; +const std::string C2C_LINE_FILENAME = "test_line.contour"; +const std::string C2C_CIRCLE_FILENAME = "test_circle.contour"; +const std::string C2C_SQUARE_FILENAME = "test_square.contour"; +const std::string C2C_SPLINE_FILENAME = "test_spline.contour"; } // end anonymous namespace /// Writes out a c2c file for a circle @@ -101,7 +101,7 @@ void writeSpline(const std::string& filename) TEST(quest_c2c_reader, basic_read) { - std::string fileName = C2C_CIRCLE_FILENAME; + const std::string fileName = C2C_CIRCLE_FILENAME; writeSimpleCircle(fileName); quest::C2CReader reader; @@ -113,7 +113,7 @@ TEST(quest_c2c_reader, basic_read) TEST(quest_c2c_reader, interpolate_circle) { - std::string fileName = C2C_CIRCLE_FILENAME; + const std::string fileName = C2C_CIRCLE_FILENAME; writeSimpleCircle(fileName); quest::C2CReader reader; @@ -122,7 +122,7 @@ TEST(quest_c2c_reader, interpolate_circle) reader.read(); reader.log(); - const int DIM = 2; + constexpr int DIM = 2; using MeshType = mint::UnstructuredMesh; MeshType* mesh = new MeshType(DIM, mint::SEGMENT); @@ -158,7 +158,7 @@ TEST(quest_c2c_reader, interpolate_circle) TEST(quest_c2c_reader, interpolate_square) { - std::string fileName = C2C_SQUARE_FILENAME; + const std::string fileName = C2C_SQUARE_FILENAME; writeSquare(fileName); quest::C2CReader reader; @@ -167,11 +167,11 @@ TEST(quest_c2c_reader, interpolate_square) reader.read(); reader.log(); - const int DIM = 2; + constexpr int DIM = 2; using MeshType = mint::UnstructuredMesh; MeshType* mesh = new MeshType(DIM, mint::SEGMENT); - int segmentsPerKnotSpan = 10; + const int segmentsPerKnotSpan = 10; reader.getLinearMeshUniform(mesh, segmentsPerKnotSpan); SLIC_INFO(axom::fmt::format("Mesh has {} nodes and {} cells", @@ -188,11 +188,13 @@ TEST(quest_c2c_reader, interpolate_square) EXPECT_EQ(expSegs, mesh->getNumberOfCells()); mint::write_vtk(mesh, "test_square.vtk"); + + delete mesh; } TEST(quest_c2c_reader, interpolate_spline) { - std::string fileName = C2C_SPLINE_FILENAME; + const std::string fileName = C2C_SPLINE_FILENAME; writeSpline(fileName); quest::C2CReader reader; @@ -201,11 +203,11 @@ TEST(quest_c2c_reader, interpolate_spline) reader.read(); reader.log(); - const int DIM = 2; + constexpr int DIM = 2; using MeshType = mint::UnstructuredMesh; MeshType* mesh = new MeshType(DIM, mint::SEGMENT); - int segmentsPerKnotSpan = 20; + const int segmentsPerKnotSpan = 20; reader.getLinearMeshUniform(mesh, segmentsPerKnotSpan); SLIC_INFO(axom::fmt::format("Mesh has {} nodes and {} cells", @@ -220,6 +222,8 @@ TEST(quest_c2c_reader, interpolate_spline) EXPECT_EQ(expSegs, mesh->getNumberOfCells()); mint::write_vtk(mesh, "test_spline.vtk"); + + delete mesh; } //------------------------------------------------------------------------------ diff --git a/src/axom/quest/tests/quest_discretize.cpp b/src/axom/quest/tests/quest_discretize.cpp index 02c0bbeb82..c4b6b10120 100644 --- a/src/axom/quest/tests/quest_discretize.cpp +++ b/src/axom/quest/tests/quest_discretize.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_initialize.cpp b/src/axom/quest/tests/quest_initialize.cpp index 9444d81e14..f8f2f6c67f 100644 --- a/src/axom/quest/tests/quest_initialize.cpp +++ b/src/axom/quest/tests/quest_initialize.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_inout_interface.cpp b/src/axom/quest/tests/quest_inout_interface.cpp index c98b4266d1..25d3e337d8 100644 --- a/src/axom/quest/tests/quest_inout_interface.cpp +++ b/src/axom/quest/tests/quest_inout_interface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -137,7 +137,7 @@ TYPED_TEST(InOutInterfaceTest, initialize_from_mesh) EXPECT_TRUE(axom::utilities::filesystem::pathExists(this->meshfile)); - axom::mint::Mesh* mesh = nullptr; + axom::mint::Mesh* mesh {nullptr}; int rc = failCode; @@ -179,6 +179,8 @@ TYPED_TEST(InOutInterfaceTest, initialize_from_mesh) // InOut should no longer be initialized EXPECT_FALSE(axom::quest::inout_initialized()); + + delete mesh; } TYPED_TEST(InOutInterfaceTest, query_properties) diff --git a/src/axom/quest/tests/quest_inout_octree.cpp b/src/axom/quest/tests/quest_inout_octree.cpp index 5f31653caf..61a9f45a53 100644 --- a/src/axom/quest/tests/quest_inout_octree.cpp +++ b/src/axom/quest/tests/quest_inout_octree.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_inout_quadtree.cpp b/src/axom/quest/tests/quest_inout_quadtree.cpp index 63c3734045..d25b0338cc 100644 --- a/src/axom/quest/tests/quest_inout_quadtree.cpp +++ b/src/axom/quest/tests/quest_inout_quadtree.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_intersection_shaper.cpp b/src/axom/quest/tests/quest_intersection_shaper.cpp index 9ba44ce092..10d7373331 100644 --- a/src/axom/quest/tests/quest_intersection_shaper.cpp +++ b/src/axom/quest/tests/quest_intersection_shaper.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -20,6 +20,7 @@ #include "axom/slic.hpp" #include "axom/quest/IntersectionShaper.hpp" #include "axom/quest/util/mesh_helpers.hpp" +#include "conduit_relay_io.hpp" #ifndef AXOM_USE_MFEM #error "Quest's IntersectionShaper tests on mfem meshes require mfem library." @@ -73,6 +74,8 @@ namespace quest = axom::quest; namespace sidre = axom::sidre; namespace slic = axom::slic; +using RuntimePolicy = axom::runtime_policy::Policy; + std::string pjoin(const std::string &path, const std::string &filename) { return axom::utilities::filesystem::joinPath(path, filename); @@ -283,7 +286,7 @@ bool loadBaseline(const std::string &filename, conduit::Node &n) void replacementRuleTest(const std::string &shapeFile, const std::string &policyName, - int policy, + RuntimePolicy policy, double tolerance, bool initialMats = false) { @@ -401,7 +404,7 @@ void replacementRuleTest(const std::string &shapeFile, void replacementRuleTestSet(const std::vector &cases, const std::string &policyName, - int policy, + RuntimePolicy policy, double tolerance, bool initialMats = false) { @@ -418,7 +421,7 @@ void IntersectionWithErrorTolerances(const std::string &filebase, int refinementLevel, double targetPercentError, const std::string &policyName, - int policy, + RuntimePolicy policy, double revolvedVolumeEPS = 1.e-4) { SLIC_INFO(axom::fmt::format("Testing {} with {}", filebase, policyName)); @@ -504,7 +507,8 @@ void IntersectionWithErrorTolerances(const std::string &filebase, } //--------------------------------------------------------------------------- -void dynamicRefinementTest_Line(const std::string &policyName, int policy) +void dynamicRefinementTest_Line(const std::string &policyName, + RuntimePolicy policy) { const std::string contour = R"(piece = line(start=(2cm,0cm), end=(2cm,2cm)) )"; @@ -538,7 +542,8 @@ dimensions: 3 } //--------------------------------------------------------------------------- -void dynamicRefinementTest_Cone(const std::string &policyName, int policy) +void dynamicRefinementTest_Cone(const std::string &policyName, + RuntimePolicy policy) { const std::string contour = R"(piece = line(start=(2cm,0cm), end=(3cm,2cm)) )"; @@ -572,7 +577,8 @@ dimensions: 3 } //--------------------------------------------------------------------------- -void dynamicRefinementTest_Spline(const std::string &policyName, int policy) +void dynamicRefinementTest_Spline(const std::string &policyName, + RuntimePolicy policy) { const std::string contour = R"(piece = rz(units=cm, rz=2 0 @@ -611,7 +617,8 @@ dimensions: 3 } //--------------------------------------------------------------------------- -void dynamicRefinementTest_Circle(const std::string &policyName, int policy) +void dynamicRefinementTest_Circle(const std::string &policyName, + RuntimePolicy policy) { const std::string contour = R"(piece = circle(origin=(0cm,0cm), radius=8cm, start=0deg, end=180deg) @@ -647,7 +654,8 @@ dimensions: 3 } //--------------------------------------------------------------------------- -void dynamicRefinementTest_LineTranslate(const std::string &policyName, int policy) +void dynamicRefinementTest_LineTranslate(const std::string &policyName, + RuntimePolicy policy) { const std::string contour = R"(piece = line(start=(2cm,0cm), end=(2cm,2cm)) )"; @@ -685,7 +693,8 @@ dimensions: 3 } //--------------------------------------------------------------------------- -void dynamicRefinementTest_LineScale(const std::string &policyName, int policy) +void dynamicRefinementTest_LineScale(const std::string &policyName, + RuntimePolicy policy) { const std::string contour = R"(piece = line(start=(2cm,0cm), end=(2cm,2cm)) )"; @@ -723,7 +732,8 @@ dimensions: 3 } //--------------------------------------------------------------------------- -void dynamicRefinementTest_LineRotate(const std::string &policyName, int policy) +void dynamicRefinementTest_LineRotate(const std::string &policyName, + RuntimePolicy policy) { const std::string contour = R"(piece = line(start=(2cm,0cm), end=(2cm,2cm)) )"; @@ -769,35 +779,31 @@ dimensions: 3 TEST(IntersectionShaperTest, case1_seq) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case1, "seq", quest::IntersectionShaper::seq, tolerance); + replacementRuleTestSet(case1, "seq", RuntimePolicy::seq, tolerance); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, case1_omp) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case1, "omp", quest::IntersectionShaper::omp, tolerance); + replacementRuleTestSet(case1, "omp", RuntimePolicy::omp, tolerance); // Include a version that has some initial materials. - replacementRuleTestSet(case1, - "omp", - quest::IntersectionShaper::omp, - tolerance, - true); + replacementRuleTestSet(case1, "omp", RuntimePolicy::omp, tolerance, true); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, case1_cuda) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case1, "cuda", quest::IntersectionShaper::cuda, tolerance); + replacementRuleTestSet(case1, "cuda", RuntimePolicy::cuda, tolerance); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, case1_hip) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case1, "hip", quest::IntersectionShaper::hip, tolerance); + replacementRuleTestSet(case1, "hip", RuntimePolicy::hip, tolerance); } #endif #endif @@ -808,28 +814,28 @@ TEST(IntersectionShaperTest, case1_hip) TEST(IntersectionShaperTest, case2_seq) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case2, "seq", quest::IntersectionShaper::seq, tolerance); + replacementRuleTestSet(case2, "seq", RuntimePolicy::seq, tolerance); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, case2_omp) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case2, "omp", quest::IntersectionShaper::omp, tolerance); + replacementRuleTestSet(case2, "omp", RuntimePolicy::omp, tolerance); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, case2_cuda) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case2, "cuda", quest::IntersectionShaper::cuda, tolerance); + replacementRuleTestSet(case2, "cuda", RuntimePolicy::cuda, tolerance); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, case2_hip) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case2, "hip", quest::IntersectionShaper::hip, tolerance); + replacementRuleTestSet(case2, "hip", RuntimePolicy::hip, tolerance); } #endif #endif @@ -840,28 +846,28 @@ TEST(IntersectionShaperTest, case2_hip) TEST(IntersectionShaperTest, case3_seq) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case3, "seq", quest::IntersectionShaper::seq, tolerance); + replacementRuleTestSet(case3, "seq", RuntimePolicy::seq, tolerance); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, case3_omp) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case3, "omp", quest::IntersectionShaper::omp, tolerance); + replacementRuleTestSet(case3, "omp", RuntimePolicy::omp, tolerance); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, case3_cuda) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case3, "cuda", quest::IntersectionShaper::cuda, tolerance); + replacementRuleTestSet(case3, "cuda", RuntimePolicy::cuda, tolerance); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, case3_hip) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case3, "hip", quest::IntersectionShaper::hip, tolerance); + replacementRuleTestSet(case3, "hip", RuntimePolicy::hip, tolerance); } #endif #endif @@ -872,28 +878,28 @@ TEST(IntersectionShaperTest, case3_hip) TEST(IntersectionShaperTest, case4_seq) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case4, "seq", quest::IntersectionShaper::seq, tolerance); + replacementRuleTestSet(case4, "seq", RuntimePolicy::seq, tolerance); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, case4_omp) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case4, "omp", quest::IntersectionShaper::omp, tolerance); + replacementRuleTestSet(case4, "omp", RuntimePolicy::omp, tolerance); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, case4_cuda) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case4, "cuda", quest::IntersectionShaper::cuda, tolerance); + replacementRuleTestSet(case4, "cuda", RuntimePolicy::cuda, tolerance); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, case4_hip) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(case4, "hip", quest::IntersectionShaper::hip, tolerance); + replacementRuleTestSet(case4, "hip", RuntimePolicy::hip, tolerance); } #endif #endif @@ -904,31 +910,28 @@ TEST(IntersectionShaperTest, case4_hip) TEST(IntersectionShaperTest, proeCase_seq) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(proeCase, "seq", quest::IntersectionShaper::seq, tolerance); + replacementRuleTestSet(proeCase, "seq", RuntimePolicy::seq, tolerance); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, proeCase_omp) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(proeCase, "omp", quest::IntersectionShaper::omp, tolerance); + replacementRuleTestSet(proeCase, "omp", RuntimePolicy::omp, tolerance); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, proeCase_cuda) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(proeCase, - "cuda", - quest::IntersectionShaper::cuda, - tolerance); + replacementRuleTestSet(proeCase, "cuda", RuntimePolicy::cuda, tolerance); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, proeCase_hip) { constexpr double tolerance = 1.e-10; - replacementRuleTestSet(proeCase, "hip", quest::IntersectionShaper::hip, tolerance); + replacementRuleTestSet(proeCase, "hip", RuntimePolicy::hip, tolerance); } #endif #endif @@ -939,25 +942,25 @@ TEST(IntersectionShaperTest, proeCase_hip) #if defined(RUN_AXOM_SEQ_TESTS) TEST(IntersectionShaperTest, line_seq) { - dynamicRefinementTest_Line("seq", quest::IntersectionShaper::seq); + dynamicRefinementTest_Line("seq", RuntimePolicy::seq); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, line_omp) { - dynamicRefinementTest_Line("omp", quest::IntersectionShaper::omp); + dynamicRefinementTest_Line("omp", RuntimePolicy::omp); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, line_cuda) { - dynamicRefinementTest_Line("cuda", quest::IntersectionShaper::cuda); + dynamicRefinementTest_Line("cuda", RuntimePolicy::cuda); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, line_hip) { - dynamicRefinementTest_Line("hip", quest::IntersectionShaper::hip); + dynamicRefinementTest_Line("hip", RuntimePolicy::hip); } #endif #endif @@ -968,25 +971,25 @@ TEST(IntersectionShaperTest, line_hip) #if defined(RUN_AXOM_SEQ_TESTS) TEST(IntersectionShaperTest, cone_seq) { - dynamicRefinementTest_Cone("seq", quest::IntersectionShaper::seq); + dynamicRefinementTest_Cone("seq", RuntimePolicy::seq); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, cone_omp) { - dynamicRefinementTest_Cone("omp", quest::IntersectionShaper::omp); + dynamicRefinementTest_Cone("omp", RuntimePolicy::omp); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, cone_cuda) { - dynamicRefinementTest_Cone("cuda", quest::IntersectionShaper::cuda); + dynamicRefinementTest_Cone("cuda", RuntimePolicy::cuda); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, cone_hip) { - dynamicRefinementTest_Cone("hip", quest::IntersectionShaper::hip); + dynamicRefinementTest_Cone("hip", RuntimePolicy::hip); } #endif #endif @@ -997,25 +1000,25 @@ TEST(IntersectionShaperTest, cone_hip) #if defined(RUN_AXOM_SEQ_TESTS) TEST(IntersectionShaperTest, spline_seq) { - dynamicRefinementTest_Spline("seq", quest::IntersectionShaper::seq); + dynamicRefinementTest_Spline("seq", RuntimePolicy::seq); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, spline_omp) { - dynamicRefinementTest_Spline("omp", quest::IntersectionShaper::omp); + dynamicRefinementTest_Spline("omp", RuntimePolicy::omp); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, spline_cuda) { - dynamicRefinementTest_Spline("cuda", quest::IntersectionShaper::cuda); + dynamicRefinementTest_Spline("cuda", RuntimePolicy::cuda); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, spline_hip) { - dynamicRefinementTest_Spline("hip", quest::IntersectionShaper::hip); + dynamicRefinementTest_Spline("hip", RuntimePolicy::hip); } #endif #endif @@ -1026,25 +1029,25 @@ TEST(IntersectionShaperTest, spline_hip) #if defined(RUN_AXOM_SEQ_TESTS) TEST(IntersectionShaperTest, circle_seq) { - dynamicRefinementTest_Circle("seq", quest::IntersectionShaper::seq); + dynamicRefinementTest_Circle("seq", RuntimePolicy::seq); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, circle_omp) { - dynamicRefinementTest_Circle("omp", quest::IntersectionShaper::omp); + dynamicRefinementTest_Circle("omp", RuntimePolicy::omp); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, circle_cuda) { - dynamicRefinementTest_Circle("cuda", quest::IntersectionShaper::cuda); + dynamicRefinementTest_Circle("cuda", RuntimePolicy::cuda); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, circle_hip) { - dynamicRefinementTest_Circle("hip", quest::IntersectionShaper::hip); + dynamicRefinementTest_Circle("hip", RuntimePolicy::hip); } #endif #endif @@ -1055,25 +1058,25 @@ TEST(IntersectionShaperTest, circle_hip) #if defined(RUN_AXOM_SEQ_TESTS) TEST(IntersectionShaperTest, line_translate_seq) { - dynamicRefinementTest_LineTranslate("seq", quest::IntersectionShaper::seq); + dynamicRefinementTest_LineTranslate("seq", RuntimePolicy::seq); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, line_translate_omp) { - dynamicRefinementTest_LineTranslate("omp", quest::IntersectionShaper::omp); + dynamicRefinementTest_LineTranslate("omp", RuntimePolicy::omp); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, line_translate_cuda) { - dynamicRefinementTest_LineTranslate("cuda", quest::IntersectionShaper::cuda); + dynamicRefinementTest_LineTranslate("cuda", RuntimePolicy::cuda); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, line_translate_hip) { - dynamicRefinementTest_LineTranslate("hip", quest::IntersectionShaper::hip); + dynamicRefinementTest_LineTranslate("hip", RuntimePolicy::hip); } #endif #endif @@ -1084,25 +1087,25 @@ TEST(IntersectionShaperTest, line_translate_hip) #if defined(RUN_AXOM_SEQ_TESTS) TEST(IntersectionShaperTest, line_scale_seq) { - dynamicRefinementTest_LineScale("seq", quest::IntersectionShaper::seq); + dynamicRefinementTest_LineScale("seq", RuntimePolicy::seq); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, line_scale_omp) { - dynamicRefinementTest_LineScale("omp", quest::IntersectionShaper::omp); + dynamicRefinementTest_LineScale("omp", RuntimePolicy::omp); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, line_scale_cuda) { - dynamicRefinementTest_LineScale("cuda", quest::IntersectionShaper::cuda); + dynamicRefinementTest_LineScale("cuda", RuntimePolicy::cuda); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, line_scale_hip) { - dynamicRefinementTest_LineScale("hip", quest::IntersectionShaper::hip); + dynamicRefinementTest_LineScale("hip", RuntimePolicy::hip); } #endif #endif @@ -1113,25 +1116,25 @@ TEST(IntersectionShaperTest, line_scale_hip) #if defined(RUN_AXOM_SEQ_TESTS) TEST(IntersectionShaperTest, line_rotate_seq) { - dynamicRefinementTest_LineRotate("seq", quest::IntersectionShaper::seq); + dynamicRefinementTest_LineRotate("seq", RuntimePolicy::seq); } #endif #if defined(AXOM_USE_OPENMP) TEST(IntersectionShaperTest, line_rotate_omp) { - dynamicRefinementTest_LineRotate("omp", quest::IntersectionShaper::omp); + dynamicRefinementTest_LineRotate("omp", RuntimePolicy::omp); } #endif #if defined(AXOM_USE_CUDA) TEST(IntersectionShaperTest, line_rotate_cuda) { - dynamicRefinementTest_LineRotate("cuda", quest::IntersectionShaper::cuda); + dynamicRefinementTest_LineRotate("cuda", RuntimePolicy::cuda); } #endif #if defined(AXOM_USE_HIP) TEST(IntersectionShaperTest, line_rotate_hip) { - dynamicRefinementTest_LineRotate("hip", quest::IntersectionShaper::hip); + dynamicRefinementTest_LineRotate("hip", RuntimePolicy::hip); } #endif #endif diff --git a/src/axom/quest/tests/quest_mesh_view_util.cpp b/src/axom/quest/tests/quest_mesh_view_util.cpp new file mode 100644 index 0000000000..9769e0e5fe --- /dev/null +++ b/src/axom/quest/tests/quest_mesh_view_util.cpp @@ -0,0 +1,785 @@ +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and +// other Axom Project Developers. See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +/*! + \file quest_mesh_view_util.cpp + \brief Test for MeshViewUtil class. +*/ + +#include "axom/config.hpp" + +// Implementation requires Conduit. +#ifdef AXOM_USE_CONDUIT + + // Axom includes + #include "axom/core.hpp" + #include "axom/slic.hpp" + #include "axom/primal.hpp" + #include "axom/quest/ArrayIndexer.hpp" + #include "axom/quest/MeshViewUtil.hpp" + #include "axom/core/Types.hpp" + + #include "conduit_blueprint.hpp" + #include "conduit_relay_io_blueprint.hpp" + + #include "axom/fmt.hpp" + #include "axom/CLI11.hpp" + + // C/C++ includes + #include + +namespace quest = axom::quest; +namespace slic = axom::slic; +namespace primal = axom::primal; +namespace numerics = axom::numerics; + +/////////////////////////////////////////////////////////////// +// converts the input string into an 80 character string +// padded on both sides with '=' symbols +std::string banner(const std::string& str) +{ + return axom::fmt::format("{:=^80}", str); +} + +/////////////////////////////////////////////////////////////// +/// Struct to parse and store the input parameters +struct Input +{ +private: + bool _verboseOutput {false}; + +public: + bool isVerbose() const { return _verboseOutput; } + + void parse(int argc, char** argv, axom::CLI::App& app) + { + app.add_flag("-v,--verbose,!--no-verbose", _verboseOutput) + ->description("Enable/disable verbose output") + ->capture_default_str(); + + app.get_formatter()->column_width(60); + + // could throw an exception + app.parse(argc, argv); + + slic::setLoggingMsgLevel(_verboseOutput ? slic::message::Debug + : slic::message::Info); + } +}; + +Input params; + +/// Utility function to initialize the logger +void initializeLogger() +{ + // Initialize Logger + slic::initialize(); + slic::setLoggingMsgLevel(slic::message::Info); + + slic::LogStream* logStream; + + std::string fmt = "[]: \n"; + logStream = new slic::GenericOutputStream(&std::cout, fmt); + + slic::addStreamToAllMsgLevels(logStream); + + conduit::utils::set_error_handler([](auto& msg, auto& file, int line) { + slic::logErrorMessage(msg, file, line); + }); + conduit::utils::set_warning_handler([](auto& msg, auto& file, int line) { + slic::logWarningMessage(msg, file, line); + }); + conduit::utils::set_info_handler([](auto& msg, auto& file, int line) { + slic::logMessage(slic::message::Info, msg, file, line); + }); +} + +/// Utility function to finalize the logger +void finalizeLogger() +{ + if(slic::isInitialized()) + { + slic::flushStreams(); + slic::finalize(); + } +} + +//! @brief Add a scalar to all elements of a StackArray. +template +axom::StackArray operator+(const axom::StackArray& rhs, U lhs) +{ + axom::StackArray ret = rhs; + for(int d = 0; d < DIM; ++d) + { + ret[d] += lhs; + } + return ret; +} + +//! @brief Add two StackArrays of the same dimension. +template +axom::StackArray operator+(const axom::StackArray& rhs, + const axom::StackArray& lhs) +{ + axom::StackArray ret = rhs; + for(int d = 0; d < DIM; ++d) + { + ret[d] += lhs[d]; + } + return ret; +} + +template +T product(const axom::StackArray& a) +{ + T ret = 1; + for(int d = 0; d < DIM; ++d) + { + ret *= a[d]; + } + return ret; +} + +template +bool isEqual(const axom::StackArray& a, const axom::StackArray& b) +{ + for(int d = 0; d < DIM; ++d) + { + if(a[d] != b[d]) + { + return false; + } + } + return true; +} + +using MVU2Type = axom::quest::MeshViewUtil<2, axom::MemorySpace::Dynamic>; +using MVU3Type = axom::quest::MeshViewUtil<3, axom::MemorySpace::Dynamic>; +using IndexCoords = axom::StackArray; + +//--------------------------------------------------------------------------- +// Create a mesh using a Conduit example. +// --------------------------------------------------------------------------- +void createConduitBlueprintDomain( + const axom::StackArray& domainShape, + const axom::StackArray& loPads, + const axom::StackArray& hiPads, + conduit::Node& domain) +{ + // Conduit's example requires int64_t inputs. + using Int64Coords = axom::StackArray; + Int64Coords elemOrigin = loPads; + Int64Coords elemPaddedShape = domainShape + loPads + hiPads; + Int64Coords vertOrigin = loPads; + Int64Coords vertPaddedShape = elemPaddedShape + 1; + Int64Coords vertShape = domainShape + 1; + conduit::Node desc; + desc["element_data/shape"].set(conduit::DataType::int64(3), elemPaddedShape); + desc["element_data/origin"].set(conduit::DataType::int64(3), elemOrigin); + desc["vertex_data/shape"].set(conduit::DataType::int64(3), vertPaddedShape); + desc["vertex_data/origin"].set(conduit::DataType::int64(3), vertOrigin); + + conduit::blueprint::mesh::examples::strided_structured(desc, + vertShape[0], + vertShape[1], + vertShape[2], + domain); + + return; +} + +template +struct ModifyNumber +{ + void operator()(T& t) const { t = 1000000 + 2 * t; } +}; + +// Check that all elements of an ArrayView can be accessed +// and found at the expected distance from the first element. +template +int testDataAccess(axom::ArrayView& da, + const std::string& daName, + const IndexCoords& strideOrder, + const FUNCTOR& functor) +{ + const auto& shape = da.shape(); + + const IndexCoords zero {0, 0, 0}; + IndexCoords ijk; + axom::IndexType& l = ijk[strideOrder[2]]; + axom::IndexType& m = ijk[strideOrder[1]]; + axom::IndexType& n = ijk[strideOrder[0]]; + + const axom::IndexType lMax = shape[strideOrder[2]]; + const axom::IndexType mMax = shape[strideOrder[1]]; + const axom::IndexType nMax = shape[strideOrder[0]]; + + int errCount = 0; + + // Check ArrayView access. + for(l = 0; l < lMax; ++l) + { + for(m = 0; m < mMax; ++m) + { + for(n = 0; n < nMax; ++n) + { + functor(da[ijk]); + } + } + } + + // Check expected monotonicy. + bool monotone = true; + axom::IndexType prevDist = -1; + for(l = 0; l < lMax; ++l) + { + for(m = 0; m < mMax; ++m) + { + for(n = 0; n < nMax; ++n) + { + auto dist = &da[ijk] - &da[zero]; + // We loop in striding order, so dist should always increase. + // Can't require strict sequential order because we skip ghosts. + monotone &= (prevDist < dist); + prevDist = dist; + } + } + } + if(!monotone) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Failed monotone ordering for ArrayView '{}'", daName)); + } + + return errCount; +} + +//--------------------------------------------------------------------------- +// Test methods that convert between shapes and strides-and-offsets. +//--------------------------------------------------------------------------- +int testConversionMethods(const MVU3Type::MdIndices& realShape, + const MVU3Type::MdIndices& loPads, + const MVU3Type::MdIndices& hiPads, + const MVU3Type::MdIndices& strideOrder, + axom::IndexType minStride = 1) +{ + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Conversion test for realShape={}, loPads={}, " + "hiPads={}, strideOrder={}, minStride={}", + realShape, + loPads, + hiPads, + strideOrder, + minStride)); + int errCount = 0; + + MVU3Type::MdIndices paddedShape = realShape + loPads + hiPads; + + MVU3Type::MdIndices offsets; + MVU3Type::MdIndices strides; + axom::IndexType valuesCount = 0; + axom::quest::internal::shapesToStridesAndOffsets(realShape, + loPads, + hiPads, + strideOrder, + minStride, + offsets, + strides, + valuesCount); + + MVU3Type::MdIndices loPads1; + MVU3Type::MdIndices hiPads1; + MVU3Type::MdIndices paddedShape1; + MVU3Type::MdIndices strideOrder1; + axom::quest::internal::stridesAndOffsetsToShapes(realShape, + offsets, + strides, + valuesCount, + paddedShape1, + loPads1, + hiPads1, + strideOrder1); + + // Conversions should return original values. + if(!isEqual(loPads, loPads1)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched loPads: {} vs {}.", loPads1, loPads)); + } + if(!isEqual(hiPads, hiPads1)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched hiPads: {} vs {}.", hiPads1, hiPads)); + } + if(paddedShape1 != paddedShape) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched valuesCount: {} vs {}.", + paddedShape1, + paddedShape)); + } + if(!isEqual(strideOrder, strideOrder1)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched strideOrder: {} vs {}.", + strideOrder1, + strideOrder)); + } + + return errCount; +} + +//--------------------------------------------------------------------------- +// Create a mesh using a Conduit example, take its view and verify +// expectations. +// --------------------------------------------------------------------------- +int testByConduitExample(const IndexCoords& domainShape, + const IndexCoords& loPads, + const IndexCoords& hiPads, + const IndexCoords& strideOrder, + axom::IndexType minStride = 1) +{ + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Check conduit mesh with domainShape={}, loPads={}, " + "hiPads={}, strideOrder={}, minStride={}", + domainShape, + loPads, + hiPads, + strideOrder, + minStride)); + int errCount = 0; + + conduit::Node domain; + createConduitBlueprintDomain({domainShape[0], domainShape[1], domainShape[2]}, + {loPads[0], loPads[1], loPads[2]}, + {hiPads[0], hiPads[1], hiPads[2]}, + domain); + if(params.isVerbose()) + { + SLIC_INFO("Testing with this domain:"); + domain.print(); + } + + axom::quest::MeshViewUtil<3, axom::MemorySpace::Dynamic> mview(domain); + + // Data parameters not dependent on striding order. + + IndexCoords elemShape = mview.getCellShape(); + IndexCoords vertShape = mview.getNodeShape(); + + IndexCoords elemPaddedShape = domainShape + loPads + hiPads; + IndexCoords vertPaddedShape = elemPaddedShape + 1; + + IndexCoords vertOrigin = loPads; + + // Access calls shouldn't abort. + mview.getTopology(); + mview.getCoordSet(); + + { + // Verify data created by the Conduit example, + // by comparing to results from separate calls to converter. + // This data always uses column-major order, + // regardless of the specified strideOrder. + IndexCoords conduitStrideOrder = {0, 1, 2}; + + IndexCoords elemOffsets; + IndexCoords elemStrides; + axom::IndexType elemValuesCount; + axom::quest::internal::shapesToStridesAndOffsets(elemShape, + loPads, + hiPads, + conduitStrideOrder, + minStride, + elemOffsets, + elemStrides, + elemValuesCount); + + IndexCoords vertOffsets; + IndexCoords vertStrides; + axom::IndexType vertValuesCount; + axom::quest::internal::shapesToStridesAndOffsets(vertShape, + loPads, + hiPads, + conduitStrideOrder, + minStride, + vertOffsets, + vertStrides, + vertValuesCount); + + if(!isEqual(mview.getCellShape(), elemShape)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched domain shape: {} vs {}", + mview.getCellShape(), + elemShape)); + } + + if(!isEqual(mview.getRealShape("element"), elemShape)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched real element shape: {} vs {}", + mview.getRealShape("element"), + elemShape)); + } + + if(!isEqual(mview.getRealShape("vertex"), vertShape)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched real vertex shape: {} vs {}", + mview.getRealShape("vertex"), + vertShape)); + } + + if(!isEqual(mview.getCoordsOffsets(), vertOrigin)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched coords offsets: {} vs {}", + mview.getCoordsOffsets(), + vertOrigin)); + } + + if(!isEqual(mview.getCoordsStrides(), vertStrides)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched coords strides: {} vs {}", + mview.getCoordsStrides(), + vertStrides)); + } + + if(mview.getCoordsCountWithGhosts() != vertValuesCount) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched coords count with ghosts: {} vs {}", + mview.getCoordsCountWithGhosts(), + vertValuesCount)); + } + + // Check field views sizes and strides. + // These may change if Conduit example changes. + auto vertField = mview.getFieldView("vert_vals", false); + auto elemField = mview.getFieldView("ele_vals", false); + auto vertFieldWithGhosts = mview.getFieldView("vert_vals", true); + auto elemFieldWithGhosts = mview.getFieldView("ele_vals", true); + + if(!isEqual(elemField.shape(), elemShape)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched elemField shape: {} vs {}", + elemField.shape(), + elemShape)); + } + + if(!isEqual(vertField.shape(), vertShape)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched vertField shape: {} vs {}", + vertField.shape(), + vertShape)); + } + + if(!isEqual(elemFieldWithGhosts.shape(), elemPaddedShape)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched elemField padded shape: {} vs {}", + elemField.shape(), + elemPaddedShape)); + } + + if(!isEqual(elemFieldWithGhosts.strides(), elemStrides)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched elemField padded stride: {} vs {}", + elemFieldWithGhosts.strides(), + elemStrides)); + } + + if(!isEqual(vertFieldWithGhosts.shape(), vertPaddedShape)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched vertField padded shape: {} vs {}", + vertField.shape(), + vertPaddedShape)); + } + + if(!isEqual(vertFieldWithGhosts.strides(), vertStrides)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched vertField padded stride: {} vs {}", + vertField.strides(), + vertStrides)); + } + + errCount += testDataAccess(elemField, + "elemField", + conduitStrideOrder, + ModifyNumber()); + errCount += testDataAccess(vertField, + "vertField", + conduitStrideOrder, + ModifyNumber()); + errCount += testDataAccess(elemFieldWithGhosts, + "elemFieldWithGhosts", + conduitStrideOrder, + ModifyNumber()); + errCount += testDataAccess(vertFieldWithGhosts, + "vertFieldWithGhosts", + conduitStrideOrder, + ModifyNumber()); + + auto coordsViews = mview.getCoordsViews(); + for(int d = 0; d < 3; ++d) + { + errCount += testDataAccess(coordsViews[d], + axom::fmt::format("coordsViews[{}]", d), + conduitStrideOrder, + ModifyNumber()); + } + } + + { + // Verify data created by by us, + // by comparing to results from separate calls to converter. + // Unlike the data created by the conduit example, this + // data always uses the specified striding order strideOrder. + + IndexCoords elemOffsets; + IndexCoords elemStrides; + axom::IndexType elemValuesCount; + axom::quest::internal::shapesToStridesAndOffsets(elemShape, + loPads, + hiPads, + strideOrder, + minStride, + elemOffsets, + elemStrides, + elemValuesCount); + + IndexCoords vertOffsets; + IndexCoords vertStrides; + axom::IndexType vertValuesCount; + axom::quest::internal::shapesToStridesAndOffsets(vertShape, + loPads, + hiPads, + strideOrder, + minStride, + vertOffsets, + vertStrides, + vertValuesCount); + + //--------------------------------------------------------------------------- + // Create a cell-centered field and verify shape and strides. + //--------------------------------------------------------------------------- + mview.createField("inCells", + "element", + conduit::DataType::int32(elemValuesCount), + elemStrides, + elemOffsets); + auto inCellsView = mview.getFieldView("inCells", false); + auto inCellsPaddedView = mview.getFieldView("inCells", true); + + if(!isEqual(inCellsView.shape(), elemShape)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched vertField shape: {} vs {}", + inCellsView.shape(), + elemShape)); + } + + if(!isEqual(inCellsView.strides(), elemStrides)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched vertField strides: {} vs {}", + inCellsView.strides(), + elemStrides)); + } + + if(!isEqual(inCellsPaddedView.shape(), elemPaddedShape)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched vertField padded shape: {} vs {}", + inCellsPaddedView.shape(), + elemPaddedShape)); + } + + if(!isEqual(inCellsPaddedView.strides(), elemStrides)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched vertField padded strides: {} vs {}", + inCellsPaddedView.strides(), + elemStrides)); + } + + //--------------------------------------------------------------------------- + // Create a node-centered field and verify shape and strides. + //--------------------------------------------------------------------------- + mview.createField("onNodes", + "vertex", + conduit::DataType::int32(vertValuesCount), + vertStrides, + vertOffsets); + auto onNodesView = mview.getFieldView("onNodes", false); + auto onNodesPaddedView = mview.getFieldView("onNodes", true); + + if(!isEqual(onNodesView.shape(), vertShape)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched vertField shape: {} vs {}", + onNodesView.shape(), + vertShape)); + } + + if(!isEqual(onNodesView.strides(), vertStrides)) + { + ++errCount; + SLIC_INFO_IF(params.isVerbose(), + axom::fmt::format("Mismatched vertField strides: {} vs {}", + onNodesView.strides(), + vertStrides)); + } + + if(!isEqual(onNodesPaddedView.shape(), vertPaddedShape)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched vertField padded shape: {} vs {}", + onNodesPaddedView.shape(), + vertPaddedShape)); + } + + if(!isEqual(onNodesPaddedView.strides(), vertStrides)) + { + ++errCount; + SLIC_INFO_IF( + params.isVerbose(), + axom::fmt::format("Mismatched vertField padded strides: {} vs {}", + onNodesPaddedView.strides(), + vertStrides)); + } + + errCount += testDataAccess(inCellsPaddedView, + "inCellsPaddedView", + strideOrder, + ModifyNumber()); + errCount += testDataAccess(inCellsView, + "inCellsView", + strideOrder, + ModifyNumber()); + errCount += testDataAccess(onNodesPaddedView, + "onNodesPaddedView", + strideOrder, + ModifyNumber()); + errCount += testDataAccess(onNodesView, + "onNodesView", + strideOrder, + ModifyNumber()); + } + + return errCount; +} + +//------------------------------------------------------------------------------ +int main(int argc, char** argv) +{ + int errCount = 0; + + initializeLogger(); + + //--------------------------------------------------------------------------- + // Set up and parse command line arguments + //--------------------------------------------------------------------------- + axom::CLI::App app {"Test code for MeshViewUtil class"}; + + try + { + params.parse(argc, argv, app); + } + catch(const axom::CLI::ParseError& e) + { + int retval = app.exit(e); + exit(retval); + } + + { + // Test conversion methods. + errCount += testConversionMethods({2, 3, 5}, {0, 0, 0}, {0, 0, 0}, {0, 1, 2}); + errCount += testConversionMethods({2, 3, 5}, {0, 0, 0}, {0, 0, 0}, {2, 1, 0}); + errCount += testConversionMethods({2, 3, 5}, {1, 1, 1}, {1, 1, 1}, {0, 1, 2}); + errCount += testConversionMethods({2, 3, 5}, {1, 1, 1}, {1, 1, 1}, {2, 1, 0}); + errCount += testConversionMethods({2, 3, 5}, {2, 2, 2}, {1, 1, 1}, {0, 1, 2}); + errCount += testConversionMethods({2, 3, 5}, {2, 2, 2}, {1, 1, 1}, {2, 1, 0}); + errCount += testConversionMethods({2, 3, 5}, {1, 1, 1}, {2, 2, 2}, {0, 1, 2}); + errCount += testConversionMethods({2, 3, 5}, {1, 1, 1}, {2, 2, 2}, {2, 1, 0}); + errCount += testConversionMethods({2, 3, 5}, {2, 2, 2}, {1, 1, 1}, {2, 0, 1}); + errCount += testConversionMethods({2, 3, 5}, {2, 2, 2}, {1, 1, 1}, {1, 0, 2}); + errCount += testConversionMethods({2, 3, 5}, {2, 2, 2}, {1, 1, 1}, {1, 2, 0}); + } + + { + IndexCoords domainShape {5, 3, 2}; + IndexCoords loPads {2, 2, 2}; + IndexCoords hiPads {1, 1, 1}; + IndexCoords strideOrder {0, 1, 2}; + errCount += testByConduitExample(domainShape, loPads, hiPads, strideOrder); + } + + { + IndexCoords domainShape {5, 3, 2}; + IndexCoords loPads {2, 2, 2}; + IndexCoords hiPads {1, 1, 1}; + IndexCoords strideOrder {2, 1, 0}; + errCount += testByConduitExample(domainShape, loPads, hiPads, strideOrder); + } + + { + IndexCoords domainShape {5, 3, 2}; + IndexCoords loPads {2, 1, 0}; + IndexCoords hiPads {1, 0, 2}; + IndexCoords strideOrder {2, 0, 1}; + errCount += testByConduitExample(domainShape, loPads, hiPads, strideOrder); + } + + SLIC_INFO(axom::fmt::format("Test found {} errors.", errCount)); + + finalizeLogger(); + + return (errCount != 0); +} + +#endif // AXOM_USE_CONDUIT diff --git a/src/axom/quest/tests/quest_meshtester.cpp b/src/axom/quest/tests/quest_meshtester.cpp index e9d00e8f01..d6ea3f7c2c 100644 --- a/src/axom/quest/tests/quest_meshtester.cpp +++ b/src/axom/quest/tests/quest_meshtester.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_point_in_cell_mfem.cpp b/src/axom/quest/tests/quest_point_in_cell_mfem.cpp index 1c796e1a99..fff5f72c5a 100644 --- a/src/axom/quest/tests/quest_point_in_cell_mfem.cpp +++ b/src/axom/quest/tests/quest_point_in_cell_mfem.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -1093,11 +1093,11 @@ TYPED_TEST(PointInCell2DTest, pic_flat_single_quad) // Add a bilinear gridfunction mfem::Mesh& mesh = *this->getMesh(); - mfem::FiniteElementCollection* fec = - mfem::FiniteElementCollection::New("Linear"); - mfem::FiniteElementSpace* fes = new mfem::FiniteElementSpace(&mesh, fec, 1); + auto* fec = mfem::FiniteElementCollection::New("Linear"); + auto* fes = new mfem::FiniteElementSpace(&mesh, fec, 1); mfem::GridFunction gf(fes); + gf.MakeOwner(fec); gf(0) = gf(2) = 1.; gf(1) = gf(3) = 0.; @@ -1676,6 +1676,22 @@ TYPED_TEST(PointInCell3DTest, pic_curved_refined_hex_jittered) this->testIsoGridPointsOnMesh(meshTypeStr); } +void printSummary() +{ +#ifdef AXOM_DEBUG + const std::string buildtype {"DEBUG"}; +#else + const std::string buildtype {"RELEASE"}; +#endif + SLIC_INFO( + axom::fmt::format("{} build; running {} test points with {} refinements; " + "grid resolution factor {}", + buildtype, + NUM_TEST_PTS, + NREFINE, + TEST_GRID_RES)); +} + int main(int argc, char* argv[]) { int result = 0; @@ -1685,6 +1701,9 @@ int main(int argc, char* argv[]) std::srand(SRAND_SEED); + printSummary(); result = RUN_ALL_TESTS(); + printSummary(); + return result; } diff --git a/src/axom/quest/tests/quest_pro_e_reader.cpp b/src/axom/quest/tests/quest_pro_e_reader.cpp index 18f0b93b74..52f21f00d9 100644 --- a/src/axom/quest/tests/quest_pro_e_reader.cpp +++ b/src/axom/quest/tests/quest_pro_e_reader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -141,7 +141,231 @@ TEST(quest_pro_e_reader, read_pro_e) std::numeric_limits::epsilon()); } // END for all nodes - // STEP 4: remove temporary Pro?E file + // STEP 4: remove temporary Pro/E file + axom::utilities::filesystem::removeFile(filename); +} + +//------------------------------------------------------------------------------ +TEST(quest_pro_e_reader, read_pro_e_invbbox) +{ + const double x_expected[] = {-1.0, 1.0, 0.0, 0.0}; + const double y_expected[] = {0.0, 0.0, 1.0, 0.0}; + const double z_expected[] = {0.0, 0.0, 0.0, 1.0}; + + const std::string filename = "tet.proe"; + + // STEP 0: generate a temporary Pro/E file for testing + generate_pro_e_file(filename); + + // STEP 1: create an Pro/E reader and read-in the mesh data + axom::quest::ProEReader reader; + // invalid bounding box is the same as no bounding box: keep everything + axom::quest::ProEReader::BBox3D invbbox; + reader.setTetPredFromBoundingBox(invbbox, false); + reader.setFileName(filename); + int status = reader.read(); + EXPECT_EQ(status, 0); + + // STEP 2: reading the Pro/E mesh data into a axom::mint::Mesh + axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + + // STEP 3: ensure the mesh is what is expected + EXPECT_EQ(mesh.getNumberOfCells(), 1); + EXPECT_EQ(mesh.getNumberOfNodes(), 4); + + const double* x = mesh.getCoordinateArray(axom::mint::X_COORDINATE); + const double* y = mesh.getCoordinateArray(axom::mint::Y_COORDINATE); + const double* z = mesh.getCoordinateArray(axom::mint::Z_COORDINATE); + EXPECT_TRUE(x != nullptr); + EXPECT_TRUE(y != nullptr); + EXPECT_TRUE(z != nullptr); + + axom::IndexType numNodes = mesh.getNumberOfNodes(); + for(axom::IndexType inode = 0; inode < numNodes; ++inode) + { + EXPECT_NEAR(x[inode], + x_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(y[inode], + y_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(z[inode], + z_expected[inode], + std::numeric_limits::epsilon()); + } // END for all nodes + + // STEP 4: remove temporary Pro/E file + axom::utilities::filesystem::removeFile(filename); +} + +//------------------------------------------------------------------------------ +TEST(quest_pro_e_reader, read_pro_e_bbox_all) +{ + const double x_expected[] = {-1.0, 1.0, 0.0, 0.0}; + const double y_expected[] = {0.0, 0.0, 1.0, 0.0}; + const double z_expected[] = {0.0, 0.0, 0.0, 1.0}; + + const std::string filename = "tet.proe"; + + // STEP 0: generate a temporary Pro/E file for testing + generate_pro_e_file(filename); + + // STEP 1: create an Pro/E reader and read-in the mesh data + axom::quest::ProEReader reader; + // A bounding box that catches all the points + axom::quest::ProEReader::BBox3D bbox; + bbox.addPoint(axom::quest::ProEReader::Point3D {-1.5, -0.5, -0.5}); + bbox.addPoint(axom::quest::ProEReader::Point3D {1.5, 1.5, 1.5}); + reader.setTetPredFromBoundingBox(bbox, false); + reader.setFileName(filename); + int status = reader.read(); + EXPECT_EQ(status, 0); + + // STEP 2: reading the Pro/E mesh data into a axom::mint::Mesh + axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + + // STEP 3: ensure the mesh is what is expected + EXPECT_EQ(mesh.getNumberOfCells(), 1); + EXPECT_EQ(mesh.getNumberOfNodes(), 4); + + const double* x = mesh.getCoordinateArray(axom::mint::X_COORDINATE); + const double* y = mesh.getCoordinateArray(axom::mint::Y_COORDINATE); + const double* z = mesh.getCoordinateArray(axom::mint::Z_COORDINATE); + EXPECT_TRUE(x != nullptr); + EXPECT_TRUE(y != nullptr); + EXPECT_TRUE(z != nullptr); + + axom::IndexType numNodes = mesh.getNumberOfNodes(); + for(axom::IndexType inode = 0; inode < numNodes; ++inode) + { + EXPECT_NEAR(x[inode], + x_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(y[inode], + y_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(z[inode], + z_expected[inode], + std::numeric_limits::epsilon()); + } // END for all nodes + + // STEP 4: remove temporary Pro/E file + axom::utilities::filesystem::removeFile(filename); +} + +//------------------------------------------------------------------------------ +TEST(quest_pro_e_reader, read_pro_e_bbox_some) +{ + const double x_expected[] = {-1.0, 1.0, 0.0, 0.0}; + const double y_expected[] = {0.0, 0.0, 1.0, 0.0}; + const double z_expected[] = {0.0, 0.0, 0.0, 1.0}; + + const std::string filename = "tet.proe"; + + // STEP 0: generate a temporary Pro/E file for testing + generate_pro_e_file(filename); + + // STEP 1: create an Pro/E reader and read-in the mesh data + axom::quest::ProEReader reader; + // A bounding box that catches some of the points, so the single + // tet does not get added. + axom::quest::ProEReader::BBox3D bbox; + bbox.addPoint(axom::quest::ProEReader::Point3D {-1.5, -0.5, -0.5}); + bbox.addPoint(axom::quest::ProEReader::Point3D {0, 1.5, 1.5}); + reader.setTetPredFromBoundingBox(bbox, false); + reader.setFileName(filename); + int status = reader.read(); + EXPECT_EQ(status, 0); + + // STEP 2: reading the Pro/E mesh data into a axom::mint::Mesh + axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + + // STEP 3: ensure the mesh is what is expected + EXPECT_EQ(mesh.getNumberOfCells(), 0); + EXPECT_EQ(mesh.getNumberOfNodes(), 4); + + const double* x = mesh.getCoordinateArray(axom::mint::X_COORDINATE); + const double* y = mesh.getCoordinateArray(axom::mint::Y_COORDINATE); + const double* z = mesh.getCoordinateArray(axom::mint::Z_COORDINATE); + EXPECT_TRUE(x != nullptr); + EXPECT_TRUE(y != nullptr); + EXPECT_TRUE(z != nullptr); + + axom::IndexType numNodes = mesh.getNumberOfNodes(); + for(axom::IndexType inode = 0; inode < numNodes; ++inode) + { + EXPECT_NEAR(x[inode], + x_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(y[inode], + y_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(z[inode], + z_expected[inode], + std::numeric_limits::epsilon()); + } // END for all nodes + + // STEP 4: remove temporary Pro/E file + axom::utilities::filesystem::removeFile(filename); +} + +//------------------------------------------------------------------------------ +TEST(quest_pro_e_reader, read_pro_e_bbox_some_incl) +{ + const double x_expected[] = {-1.0, 1.0, 0.0, 0.0}; + const double y_expected[] = {0.0, 0.0, 1.0, 0.0}; + const double z_expected[] = {0.0, 0.0, 0.0, 1.0}; + + const std::string filename = "tet.proe"; + + // STEP 0: generate a temporary Pro/E file for testing + generate_pro_e_file(filename); + + // STEP 1: create an Pro/E reader and read-in the mesh data + axom::quest::ProEReader reader; + // A bounding box that catches some of the points. We'll catch + // all tets that have at least one corner in the bbox. + axom::quest::ProEReader::BBox3D bbox; + bbox.addPoint(axom::quest::ProEReader::Point3D {-1.5, -0.5, -0.5}); + bbox.addPoint(axom::quest::ProEReader::Point3D {0, 1.5, 1.5}); + reader.setTetPredFromBoundingBox(bbox); + reader.setFileName(filename); + int status = reader.read(); + EXPECT_EQ(status, 0); + + // STEP 2: reading the Pro/E mesh data into a axom::mint::Mesh + axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + + // STEP 3: ensure the mesh is what is expected + EXPECT_EQ(mesh.getNumberOfCells(), 1); + EXPECT_EQ(mesh.getNumberOfNodes(), 4); + + const double* x = mesh.getCoordinateArray(axom::mint::X_COORDINATE); + const double* y = mesh.getCoordinateArray(axom::mint::Y_COORDINATE); + const double* z = mesh.getCoordinateArray(axom::mint::Z_COORDINATE); + EXPECT_TRUE(x != nullptr); + EXPECT_TRUE(y != nullptr); + EXPECT_TRUE(z != nullptr); + + axom::IndexType numNodes = mesh.getNumberOfNodes(); + for(axom::IndexType inode = 0; inode < numNodes; ++inode) + { + EXPECT_NEAR(x[inode], + x_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(y[inode], + y_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(z[inode], + z_expected[inode], + std::numeric_limits::epsilon()); + } // END for all nodes + + // STEP 4: remove temporary Pro/E file axom::utilities::filesystem::removeFile(filename); } @@ -204,8 +428,8 @@ TEST(quest_pro_e_reader, read_pro_e_external) axom::utilities::filesystem::removeFile(filename); } -//------------------------------------------------------------------------------ #ifdef AXOM_DATA_DIR +//------------------------------------------------------------------------------ TEST(quest_pro_e_reader, cup_pro_e) { constexpr int NUM_NODES = 171; @@ -315,6 +539,76 @@ TEST(quest_pro_e_reader, cup_pro_e) // Step 5: Dump mesh file axom::mint::write_vtk(&mesh, "cup.vtk"); } + +//------------------------------------------------------------------------------ +TEST(quest_pro_e_reader, cup_pro_e_some) +{ + constexpr int NUM_NODES = 171; + constexpr int NUM_BBOX_TETS = 52; + + // STEP 0: Get Pro/E cup example file for testing + namespace fs = axom::utilities::filesystem; + std::string cup = fs::joinPath(AXOM_DATA_DIR, "quest/cup.proe"); + + // STEP 1: create a Pro/E reader and read-in the mesh data + axom::quest::ProEReader reader; + reader.setFileName(cup); + // STEP 1a: specify a bounding box to include + // A bounding box that catches some of the points: only tets that + // fall completely within the bbox are retained. + axom::quest::ProEReader::BBox3D bbox; + bbox.addPoint(axom::quest::ProEReader::Point3D {-30, -160, -200}); + bbox.addPoint(axom::quest::ProEReader::Point3D {90, 160, -35}); + reader.setTetPredFromBoundingBox(bbox, false); + int status = reader.read(); + EXPECT_EQ(status, 0); + + // STEP 2: reading the Pro/E mesh data into a axom::mint::Mesh + axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + + // STEP 3: ensure the mesh is what is expected + EXPECT_EQ(mesh.getNumberOfCells(), NUM_BBOX_TETS); + EXPECT_EQ(mesh.getNumberOfNodes(), NUM_NODES); + + // Step 5: Dump mesh file + axom::mint::write_vtk(&mesh, "exclusivebboxcup.vtk"); +} + +//------------------------------------------------------------------------------ +TEST(quest_pro_e_reader, cup_pro_e_some_incl) +{ + constexpr int NUM_NODES = 171; + constexpr int NUM_BBOX_INCL_TETS = 298; + + // STEP 0: Get Pro/E cup example file for testing + namespace fs = axom::utilities::filesystem; + std::string cup = fs::joinPath(AXOM_DATA_DIR, "quest/cup.proe"); + + // STEP 1: create a Pro/E reader and read-in the mesh data + axom::quest::ProEReader reader; + reader.setFileName(cup); + // STEP 1a: specify a bounding box to include + // A bounding box that catches some of the points: tets having at + // least one corner falling within the bbox are retained. + axom::quest::ProEReader::BBox3D bbox; + bbox.addPoint(axom::quest::ProEReader::Point3D {-30, -160, -200}); + bbox.addPoint(axom::quest::ProEReader::Point3D {90, 160, -35}); + reader.setTetPredFromBoundingBox(bbox); + int status = reader.read(); + EXPECT_EQ(status, 0); + + // STEP 2: reading the Pro/E mesh data into a axom::mint::Mesh + axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + + // STEP 3: ensure the mesh is what is expected + EXPECT_EQ(mesh.getNumberOfCells(), NUM_BBOX_INCL_TETS); + EXPECT_EQ(mesh.getNumberOfNodes(), NUM_NODES); + + // Step 5: Dump mesh file + axom::mint::write_vtk(&mesh, "inclusivebboxcup.vtk"); +} #endif //------------------------------------------------------------------------------ diff --git a/src/axom/quest/tests/quest_pro_e_reader_parallel.cpp b/src/axom/quest/tests/quest_pro_e_reader_parallel.cpp index f3ad766275..fcc9f1912b 100644 --- a/src/axom/quest/tests/quest_pro_e_reader_parallel.cpp +++ b/src/axom/quest/tests/quest_pro_e_reader_parallel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -34,16 +34,18 @@ void generate_pro_e_file(const std::string& file) ofs << "# Another comment" << std::endl; // Number of nodes followed by number of tetrahedra - ofs << "4 1" << std::endl; + ofs << "5 2" << std::endl; // Node ID followed by xyz coordinates ofs << "1 -1.0 0.0 0.0" << std::endl; ofs << "2 1.0 0.0 0.0" << std::endl; ofs << "3 0.0 1.0 0.0" << std::endl; ofs << "4 0.0 0.0 1.0" << std::endl; + ofs << "5 3.0 3.0 3.0" << std::endl; // Tetrahedron ID followed by corresponding Node IDs ofs << "1 1 2 3 4" << std::endl; + ofs << "2 2 3 4 5" << std::endl; ofs.close(); } @@ -66,9 +68,9 @@ TEST(quest_pro_e_reader_parallel, read_file) int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); - const double x_expected[] = {-1.0, 1.0, 0.0, 0.0}; - const double y_expected[] = {0.0, 0.0, 1.0, 0.0}; - const double z_expected[] = {0.0, 0.0, 0.0, 1.0}; + const double x_expected[] = {-1.0, 1.0, 0.0, 0.0, 3.0}; + const double y_expected[] = {0.0, 0.0, 1.0, 0.0, 3.0}; + const double z_expected[] = {0.0, 0.0, 0.0, 1.0, 3.0}; const std::string filename = "tet.proe"; @@ -88,9 +90,143 @@ TEST(quest_pro_e_reader_parallel, read_file) axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); reader.getMesh(&mesh); + // STEP 3: ensure the mesh is what is expected + EXPECT_EQ(mesh.getNumberOfCells(), 2); + EXPECT_EQ(mesh.getNumberOfNodes(), 5); + + const double* x = mesh.getCoordinateArray(axom::mint::X_COORDINATE); + const double* y = mesh.getCoordinateArray(axom::mint::Y_COORDINATE); + const double* z = mesh.getCoordinateArray(axom::mint::Z_COORDINATE); + EXPECT_TRUE(x != nullptr); + EXPECT_TRUE(y != nullptr); + EXPECT_TRUE(z != nullptr); + + axom::IndexType numNodes = mesh.getNumberOfNodes(); + for(axom::IndexType inode = 0; inode < numNodes; ++inode) + { + EXPECT_NEAR(x[inode], + x_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(y[inode], + y_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(z[inode], + z_expected[inode], + std::numeric_limits::epsilon()); + } // END for all nodes + + // // STEP 4: remove temporary Pro/E file + if(rank == 0) + { + std::remove(filename.c_str()); + } +} + +//------------------------------------------------------------------------------ +TEST(quest_pro_e_reader_parallel, read_file_bbox) +{ + int rank; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + const double x_expected[] = {-1.0, 1.0, 0.0, 0.0, 3.0}; + const double y_expected[] = {0.0, 0.0, 1.0, 0.0, 3.0}; + const double z_expected[] = {0.0, 0.0, 0.0, 1.0, 3.0}; + + const std::string filename = "tet.proe"; + + // STEP 0: generate a temporary Pro/E file for testing + if(rank == 0) + { + generate_pro_e_file(filename); + } + + // STEP 1: create an Pro/E reader and read-in the mesh data + axom::quest::PProEReader reader(MPI_COMM_WORLD); + reader.setFileName(filename); + + // STEP 1a: create a bounding box. Only tets where all four nodes + // fall in the bbox will be retained. + axom::quest::ProEReader::BBox3D bbox; + bbox.addPoint(axom::quest::ProEReader::Point3D {-1.1, -0.1, -0.1}); + bbox.addPoint(axom::quest::ProEReader::Point3D {1.1, 1.1, 1.1}); + reader.setTetPredFromBoundingBox(bbox, false); + int status = reader.read(); + EXPECT_EQ(status, 0); + + // STEP 2: reading the Pro/E mesh data into a axom::mint::Mesh + axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + // STEP 3: ensure the mesh is what is expected EXPECT_EQ(mesh.getNumberOfCells(), 1); - EXPECT_EQ(mesh.getNumberOfNodes(), 4); + EXPECT_EQ(mesh.getNumberOfNodes(), 5); + + const double* x = mesh.getCoordinateArray(axom::mint::X_COORDINATE); + const double* y = mesh.getCoordinateArray(axom::mint::Y_COORDINATE); + const double* z = mesh.getCoordinateArray(axom::mint::Z_COORDINATE); + EXPECT_TRUE(x != nullptr); + EXPECT_TRUE(y != nullptr); + EXPECT_TRUE(z != nullptr); + + axom::IndexType numNodes = mesh.getNumberOfNodes(); + for(axom::IndexType inode = 0; inode < numNodes; ++inode) + { + EXPECT_NEAR(x[inode], + x_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(y[inode], + y_expected[inode], + std::numeric_limits::epsilon()); + EXPECT_NEAR(z[inode], + z_expected[inode], + std::numeric_limits::epsilon()); + } // END for all nodes + + // // STEP 4: remove temporary Pro/E file + if(rank == 0) + { + std::remove(filename.c_str()); + } +} + +//------------------------------------------------------------------------------ +TEST(quest_pro_e_reader_parallel, read_file_bbox_incl) +{ + int rank; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + const double x_expected[] = {-1.0, 1.0, 0.0, 0.0, 3.0}; + const double y_expected[] = {0.0, 0.0, 1.0, 0.0, 3.0}; + const double z_expected[] = {0.0, 0.0, 0.0, 1.0, 3.0}; + + const std::string filename = "tet.proe"; + + // STEP 0: generate a temporary Pro/E file for testing + if(rank == 0) + { + generate_pro_e_file(filename); + } + + // STEP 1: create an Pro/E reader and read-in the mesh data + axom::quest::PProEReader reader(MPI_COMM_WORLD); + reader.setFileName(filename); + + // STEP 1a: create a bounding box. Only tets where all four nodes + // fall in the bbox will be retained. + axom::quest::ProEReader::BBox3D bbox; + bbox.addPoint(axom::quest::ProEReader::Point3D {-1.1, -0.1, -0.1}); + bbox.addPoint(axom::quest::ProEReader::Point3D {1.1, 1.1, 1.1}); + reader.setTetPredFromBoundingBox(bbox); + int status = reader.read(); + EXPECT_EQ(status, 0); + + // STEP 2: reading the Pro/E mesh data into a axom::mint::Mesh + axom::mint::UnstructuredMesh mesh(3, axom::mint::TET); + reader.getMesh(&mesh); + + // STEP 3: ensure the mesh is what is expected + EXPECT_EQ(mesh.getNumberOfCells(), 2); + EXPECT_EQ(mesh.getNumberOfNodes(), 5); const double* x = mesh.getCoordinateArray(axom::mint::X_COORDINATE); const double* y = mesh.getCoordinateArray(axom::mint::Y_COORDINATE); diff --git a/src/axom/quest/tests/quest_regression.cpp b/src/axom/quest/tests/quest_regression.cpp index 209f480d26..692025604b 100644 --- a/src/axom/quest/tests/quest_regression.cpp +++ b/src/axom/quest/tests/quest_regression.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -52,13 +52,14 @@ #endif // C/C++ includes -#include // for std::signbit() +#include #include -const int DIM = 3; -const int MAX_RESULTS = 10; // Max number of disagreeing entries to show - // when comparing results -const int DEFAULT_RESOLUTION = 32; // Default resolution of query grid +constexpr int DIM = 3; +// Default resolution of query grid +constexpr int DEFAULT_RESOLUTION = 32; +// Max number of disagreeing entries to show when comparing results +constexpr int MAX_RESULTS = 10; namespace mint = axom::mint; namespace primal = axom::primal; @@ -71,7 +72,7 @@ using SpacePt = primal::Point; using SpaceVec = primal::Vector; using GridPt = primal::Point; -/** Simple structure to hold the command line arguments */ +/// Simple structure to hold the command line arguments struct Input { Input() = default; @@ -104,9 +105,7 @@ struct Input bool hasBoundingBox() const { return meshBoundingBox != SpaceBoundingBox(); } bool hasQueryMesh() const { return queryMesh != nullptr; } - /** - * \brief Parses the command line options - */ + /// Parses the command line options void parse(int argc, char** argv, axom::CLI::App& app) { app @@ -138,8 +137,7 @@ struct Input ->check(axom::CLI::ExistingFile); #endif - // user can supply 1 or 3 values for resolution - // the following is not quite right + // user can supply 1 or 3 values for resolution the following is not quite right auto* res = app .add_option("-r,--resolution", m_resolution, @@ -211,7 +209,7 @@ struct Input } }; -/** Loads the baseline dataset into the given sidre group */ +/// Loads the baseline dataset into the given sidre group void loadBaselineData(sidre::Group* grp, Input& args) { sidre::IOManager reader(MPI_COMM_WORLD); @@ -587,11 +585,12 @@ bool compareDistanceAndContainment(Input& clargs) if(diffCount != 0) { passed = false; - SLIC_INFO("** Disagreement between SignedDistance " - << " and InOutOctree containment queries. " - << "\n There were " << diffCount << " differences." - << "\n Showing first " << std::min(diffCount, MAX_RESULTS) - << " results:" << out.data()); + SLIC_INFO(axom::fmt::format( + "** Disagreement between SignedDistance and InOutOctree queries.\n" + "There were {} differences.\n Showing first {} results -- {}", + diffCount, + std::min(diffCount, MAX_RESULTS), + std::string(out.begin(), out.end()))); } } @@ -599,8 +598,7 @@ bool compareDistanceAndContainment(Input& clargs) } /** - * \brief Function to compare the results from the InOutOctree and - * SignedDistance queries + * \brief Function to compare the results from the InOutOctree and SignedDistance queries * \return True if all results agree, False otherwise. * \note When there are differences, the first few are logged */ @@ -614,19 +612,41 @@ bool compareToBaselineResults(axom::sidre::Group* grp, Input& clargs) mint::UniformMesh* umesh = clargs.queryMesh; const int nnodes = umesh->getNumberOfNodes(); + int* base_inout_containment = nullptr; + int* exp_inout_containment = nullptr; + int* base_sd_containment = nullptr; + int* exp_sd_containment = nullptr; + double* base_sd_distance = nullptr; + double* exp_sd_distance = nullptr; + + // grab pointers to data arrays when appropriate + if(clargs.testContainment) + { + base_inout_containment = grp->getView("octree_containment")->getArray(); + exp_inout_containment = + umesh->getFieldPtr("octree_containment", mint::NODE_CENTERED); + } + + if(clargs.testDistance) + { + base_sd_containment = grp->getView("bvh_containment")->getArray(); + exp_sd_containment = + umesh->getFieldPtr("bvh_containment", mint::NODE_CENTERED); + + base_sd_distance = grp->getView("bvh_distance")->getArray(); + exp_sd_distance = + umesh->getFieldPtr("bvh_distance", mint::NODE_CENTERED); + } + if(clargs.testContainment) { int diffCount = 0; axom::fmt::memory_buffer out; - int* exp_containment = - umesh->getFieldPtr("octree_containment", mint::NODE_CENTERED); - int* base_containment = grp->getView("octree_containment")->getArray(); - for(int inode = 0; inode < nnodes; ++inode) { - const int expected = base_containment[inode]; - const int actual = exp_containment[inode]; + const int expected = base_inout_containment[inode]; + const int actual = exp_inout_containment[inode]; if(expected != actual) { if(diffCount < MAX_RESULTS) @@ -639,8 +659,16 @@ bool compareToBaselineResults(axom::sidre::Group* grp, Input& clargs) "\n Disagreement on sample {} @ {}. Expected {}, got {}", inode, pt, - expected, - actual); + expected ? "inside" : "outside", + actual ? "inside" : "outside"); + + if(clargs.testDistance) + { + axom::fmt::format_to( + std::back_inserter(out), + " -- distance from query point to surface is {} ", + base_sd_distance[inode]); + } } ++diffCount; } @@ -649,9 +677,12 @@ bool compareToBaselineResults(axom::sidre::Group* grp, Input& clargs) if(diffCount != 0) { passed = false; - SLIC_INFO("** Containment test failed. There were " - << diffCount << " differences. Showing first " - << std::min(diffCount, MAX_RESULTS) << out.data()); + SLIC_INFO(axom::fmt::format( + "** Containment test failed. There were {} differences. " + "Showing first {} -- {}", + diffCount, + std::min(diffCount, MAX_RESULTS), + std::string(out.begin(), out.end()))); } } @@ -660,20 +691,12 @@ bool compareToBaselineResults(axom::sidre::Group* grp, Input& clargs) int diffCount = 0; axom::fmt::memory_buffer out; - int* base_containment = grp->getView("bvh_containment")->getArray(); - int* exp_containment = - umesh->getFieldPtr("bvh_containment", mint::NODE_CENTERED); - - double* base_distance = grp->getView("bvh_distance")->getArray(); - double* exp_distance = - umesh->getFieldPtr("bvh_distance", mint::NODE_CENTERED); - for(int inode = 0; inode < nnodes; ++inode) { - const int expected_c = base_containment[inode]; - const int actual_c = exp_containment[inode]; - const double expected_d = base_distance[inode]; - const double actual_d = exp_distance[inode]; + const int expected_c = base_sd_containment[inode]; + const int actual_c = exp_sd_containment[inode]; + const double expected_d = base_sd_distance[inode]; + const double actual_d = exp_sd_distance[inode]; if(expected_c != actual_c || !utilities::isNearlyEqual(expected_d, actual_d)) { @@ -699,9 +722,12 @@ bool compareToBaselineResults(axom::sidre::Group* grp, Input& clargs) if(diffCount != 0) { passed = false; - SLIC_INFO("** Distance test failed. There were " - << diffCount << " differences. Showing first " - << std::min(diffCount, MAX_RESULTS) << out.data()); + SLIC_INFO(axom::fmt::format( + "** Distance test failed. There were {} differences. " + "Showing first {} -- {}", + diffCount, + std::min(diffCount, MAX_RESULTS), + std::string(out.begin(), out.end()))); } } @@ -784,9 +810,7 @@ void saveBaseline(axom::sidre::Group* grp, Input& clargs) protocol)); } -/** - * \brief Runs regression test for quest containment and signed distance queries - */ +/// Runs regression test for quest containment and signed distance queries int main(int argc, char** argv) { bool allTestsPassed = true; diff --git a/src/axom/quest/tests/quest_sampling_shaper.cpp b/src/axom/quest/tests/quest_sampling_shaper.cpp index 6b0ae28283..641b7144be 100644 --- a/src/axom/quest/tests/quest_sampling_shaper.cpp +++ b/src/axom/quest/tests/quest_sampling_shaper.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -166,7 +166,19 @@ class SamplingShaperTest : public ::testing::Test EXPECT_NE(nullptr, m_shaper) << "Shaper needs to be initialized via initializeShaping()"; - const auto shapeDim = m_shapeSet->getDimensions(); + // Define lambda to override default dimensions, when necessary + auto getShapeDim = [defaultDim = + m_shapeSet->getDimensions()](const auto& shape) { + static std::map format_dim = { + {"c2c", klee::Dimensions::Two}, + {"stl", klee::Dimensions::Three}}; + + const auto& format_str = shape.getGeometry().getFormat(); + return format_dim.find(format_str) != format_dim.end() + ? format_dim[format_str] + : defaultDim; + }; + for(const auto& shape : m_shapeSet->getShapes()) { SLIC_INFO_IF(very_verbose_output, @@ -174,6 +186,8 @@ class SamplingShaperTest : public ::testing::Test shape.getName(), shape.getMaterial())); + const auto shapeDim = getShapeDim(shape); + m_shaper->loadShape(shape); m_shaper->prepareShapeQuery(shapeDim, shape); m_shaper->runShapeQuery(shape); @@ -1038,6 +1052,204 @@ units: cm } } +TEST_F(SamplingShaperTest2D, check_underscores) +{ + const auto& testname = + ::testing::UnitTest::GetInstance()->current_test_info()->name(); + + constexpr double radius = 1.5; + + const std::string shape_template = R"( +dimensions: 2 + +shapes: +- name: {2} + material: {3} + geometry: + format: c2c + path: {0} + units: cm + operators: + - scale: {1} +- name: {4} + material: {5} + geometry: + format: c2c + path: {0} + units: cm + operators: + - scale: {1} +- name: {6} + material: {7} + geometry: + format: c2c + path: {0} + units: cm + operators: + - scale: {1} +)"; + + const std::string shape_name {"shape"}; + const std::string mat_name {"mat"}; + + const std::string underscored_shape_name {"underscored_shape"}; + const std::string underscored_mat_name {"underscored_mat"}; + + const std::string double_underscored_shape_name {"double_underscored_shape"}; + const std::string double_underscored_mat_name {"double_underscored_mat"}; + + ScopedTemporaryFile contour_file(axom::fmt::format("{}.contour", testname), + unit_semicircle_contour); + + ScopedTemporaryFile shape_file(axom::fmt::format("{}.yaml", testname), + axom::fmt::format(shape_template, + contour_file.getFileName(), + radius, + shape_name, + mat_name, + underscored_shape_name, + underscored_mat_name, + double_underscored_shape_name, + double_underscored_mat_name)); + + if(very_verbose_output) + { + SLIC_INFO("Contour file: \n" << contour_file.getFileContents()); + SLIC_INFO("Shape file: \n" << shape_file.getFileContents()); + } + + this->validateShapeFile(shape_file.getFileName()); + this->initializeShaping(shape_file.getFileName()); + + this->runShaping(); + + // Collect and print registered fields + std::vector regFields; + for(const auto& pr : this->getDC().GetFieldMap()) + { + regFields.push_back(pr.first); + } + SLIC_INFO(axom::fmt::format("Registered fields: {}", + axom::fmt::join(regFields, ", "))); + + // check that output materials are present + EXPECT_TRUE(this->getDC().HasField(axom::fmt::format("vol_frac_{}", mat_name))); + EXPECT_TRUE(this->getDC().HasField( + axom::fmt::format("vol_frac_{}", underscored_mat_name))); + EXPECT_TRUE(this->getDC().HasField( + axom::fmt::format("vol_frac_{}", double_underscored_mat_name))); + + // Save meshes and fields + if(very_verbose_output) + { + this->getDC().Save(testname, axom::sidre::Group::getDefaultIOProtocol()); + } +} + +TEST_F(SamplingShaperTest2D, contour_and_stl_2D) +{ + using Point2D = primal::Point; + using Point3D = primal::Point; + + const auto& testname = + ::testing::UnitTest::GetInstance()->current_test_info()->name(); + + constexpr double radius = 1.5; + + const std::string shape_template = R"( +dimensions: 2 + +shapes: +# preshape a background material; dimension should be default +- name: background + material: {3} + geometry: + format: none +# shape in a revolved sphere given as a c2c contour +- name: circle_shape + material: {4} + geometry: + format: c2c + path: {0} + units: cm + operators: + - scale: {2} +# shape in a sphere given as an stl surface mesh +- name: sphere_shape + material: {5} + geometry: + format: stl + path: {1} + units: cm +)"; + + const std::string background_material = "luminiferous_ether"; + const std::string circle_material = "steel"; + const std::string sphere_material = "vaccum"; + const std::string sphere_path = + axom::fmt::format("{}/quest/unit_sphere.stl", AXOM_DATA_DIR); + + ScopedTemporaryFile contour_file(axom::fmt::format("{}.contour", testname), + unit_circle_contour); + + ScopedTemporaryFile shape_file(axom::fmt::format("{}.yaml", testname), + axom::fmt::format(shape_template, + contour_file.getFileName(), + sphere_path, + radius, + background_material, + circle_material, + sphere_material)); + + if(very_verbose_output) + { + SLIC_INFO("Contour file: \n" << contour_file.getFileContents()); + SLIC_INFO("Shape file: \n" << shape_file.getFileContents()); + } + + // Create an initial background material set to 1 everywhere + std::map initialGridFunctions; + { + auto* vf = this->registerVolFracGridFunction("init_vf_bg"); + this->initializeVolFracGridFunction<2>( + vf, + [](int, const Point2D&, int) -> double { return 1.; }); + initialGridFunctions[background_material] = vf; + } + + this->validateShapeFile(shape_file.getFileName()); + this->initializeShaping(shape_file.getFileName(), initialGridFunctions); + + // set projector from 2D mesh points to 3D query points within STL + this->m_shaper->setPointProjector([](Point2D pt) { + return Point3D {pt[0], pt[1], 0.}; + }); + + this->m_shaper->setQuadratureOrder(8); + + this->runShaping(); + + // Check that the result has a volume fraction field associated with circle and sphere materials + constexpr double exp_volume_contour = M_PI * radius * radius; + constexpr double exp_volume_sphere = M_PI * 1. * 1.; + this->checkExpectedVolumeFractions(circle_material, + exp_volume_contour - exp_volume_sphere, + 3e-2); + this->checkExpectedVolumeFractions(sphere_material, exp_volume_sphere, 3e-2); + + for(const auto& vf_name : + {background_material, circle_material, sphere_material}) + { + EXPECT_TRUE(this->getDC().HasField(axom::fmt::format("vol_frac_{}", vf_name))); + } + + // Save meshes and fields + if(very_verbose_output) + { + this->getDC().Save(testname, axom::sidre::Group::getDefaultIOProtocol()); + } +} + //----------------------------------------------------------------------------- TEST_F(SamplingShaperTest3D, basic_tet) @@ -1497,8 +1709,7 @@ dimensions: 2 this->runShaping(); - // Check that the result has a volume fraction field associated with the tetrahedron material - // Scaling by a factor of 1/2 in each dimension should multiply the total volume by a factor of 8 + // Check that the result has a volume fraction field associated with the circle material constexpr double exp_volume = 4. / 3. * M_PI * radius * radius * radius; this->checkExpectedVolumeFractions(circle_material, exp_volume, 3e-2); @@ -1509,6 +1720,91 @@ dimensions: 2 } } +TEST_F(SamplingShaperTest3D, contour_and_stl_3D) +{ + using Point2D = primal::Point; + using Point3D = primal::Point; + + const auto& testname = + ::testing::UnitTest::GetInstance()->current_test_info()->name(); + + constexpr double radius = 1.5; + + const std::string shape_template = R"( +dimensions: 2 + +shapes: +# shape in a revolved sphere given as a c2c contour +- name: circle_shape + material: {3} + geometry: + format: c2c + path: {0} + units: cm + operators: + - scale: {2} +# shape in a sphere given as an stl surface mesh +- name: sphere_shape + material: {4} + geometry: + format: stl + path: {1} + units: cm +)"; + + const std::string circle_material = "steel"; + const std::string sphere_material = "void"; + const std::string sphere_path = + axom::fmt::format("{}/quest/unit_sphere.stl", AXOM_DATA_DIR); + + ScopedTemporaryFile contour_file(axom::fmt::format("{}.contour", testname), + unit_semicircle_contour); + + ScopedTemporaryFile shape_file(axom::fmt::format("{}.yaml", testname), + axom::fmt::format(shape_template, + contour_file.getFileName(), + sphere_path, + radius, + circle_material, + sphere_material)); + + if(very_verbose_output) + { + SLIC_INFO("Contour file: \n" << contour_file.getFileContents()); + SLIC_INFO("Shape file: \n" << shape_file.getFileContents()); + } + + this->validateShapeFile(shape_file.getFileName()); + this->initializeShaping(shape_file.getFileName()); + + // set projector from 3D points to axisymmetric plane + this->m_shaper->setPointProjector([](Point3D pt) { + const double& x = pt[0]; + const double& y = pt[1]; + const double& z = pt[2]; + return Point2D {z, sqrt(x * x + y * y)}; + }); + + // we need a higher quadrature order to resolve this shape at the (low) testing resolution + this->m_shaper->setQuadratureOrder(8); + + this->runShaping(); + + // Check that the result has a volume fraction field associated with sphere and circle materials + constexpr double exp_volume_contour = 4. / 3. * M_PI * radius * radius * radius; + constexpr double exp_volume_sphere = 4. / 3. * M_PI * 1. * 1. * 1.; + this->checkExpectedVolumeFractions(circle_material, + exp_volume_contour - exp_volume_sphere, + 3e-2); + this->checkExpectedVolumeFractions(sphere_material, exp_volume_sphere, 3e-2); + + // Save meshes and fields + if(very_verbose_output) + { + this->getDC().Save(testname, axom::sidre::Group::getDefaultIOProtocol()); + } +} + //----------------------------------------------------------------------------- int main(int argc, char* argv[]) { diff --git a/src/axom/quest/tests/quest_signed_distance.cpp b/src/axom/quest/tests/quest_signed_distance.cpp index b3ee4d0da8..ec6d2b7e8a 100644 --- a/src/axom/quest/tests/quest_signed_distance.cpp +++ b/src/axom/quest/tests/quest_signed_distance.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_signed_distance_interface.cpp b/src/axom/quest/tests/quest_signed_distance_interface.cpp index dad7bbff1d..b94851a0c9 100644 --- a/src/axom/quest/tests/quest_signed_distance_interface.cpp +++ b/src/axom/quest/tests/quest_signed_distance_interface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_stl_reader.cpp b/src/axom/quest/tests/quest_stl_reader.cpp index b362136c8d..071ad2805c 100644 --- a/src/axom/quest/tests/quest_stl_reader.cpp +++ b/src/axom/quest/tests/quest_stl_reader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_test_utilities.hpp b/src/axom/quest/tests/quest_test_utilities.hpp index 164e2ea76f..2b248cc673 100644 --- a/src/axom/quest/tests/quest_test_utilities.hpp +++ b/src/axom/quest/tests/quest_test_utilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/tests/quest_vertex_weld.cpp b/src/axom/quest/tests/quest_vertex_weld.cpp index 7e70391140..2907d56b78 100644 --- a/src/axom/quest/tests/quest_vertex_weld.cpp +++ b/src/axom/quest/tests/quest_vertex_weld.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -13,11 +13,11 @@ namespace { -static const int DIM = 3; -static const double EPS = 1e-6; +constexpr int DIM = 3; +constexpr double EPS = 1e-6; -typedef axom::mint::UnstructuredMesh UMesh; -typedef axom::primal::Point Point3; +using UMesh = axom::mint::UnstructuredMesh; +using Point3 = axom::primal::Point; /*! Insert a vertex with coordinates (x,y,z) into \a mesh */ void insertVertex(UMesh* mesh, double x, double y, double z) diff --git a/src/axom/quest/util/mesh_helpers.cpp b/src/axom/quest/util/mesh_helpers.cpp index 760ace7b66..0bdac364b8 100644 --- a/src/axom/quest/util/mesh_helpers.cpp +++ b/src/axom/quest/util/mesh_helpers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/quest/util/mesh_helpers.hpp b/src/axom/quest/util/mesh_helpers.hpp index 2c1ab579bf..9bafb4375b 100644 --- a/src/axom/quest/util/mesh_helpers.hpp +++ b/src/axom/quest/util/mesh_helpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/CMakeLists.txt b/src/axom/sidre/CMakeLists.txt index 2e4b945072..bddbaff2f4 100644 --- a/src/axom/sidre/CMakeLists.txt +++ b/src/axom/sidre/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/Array.hpp b/src/axom/sidre/core/Array.hpp index cc5ddf76cc..7a1877cdc3 100644 --- a/src/axom/sidre/core/Array.hpp +++ b/src/axom/sidre/core/Array.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/AttrValues.cpp b/src/axom/sidre/core/AttrValues.cpp index 6901b1a69f..8ddbef140b 100644 --- a/src/axom/sidre/core/AttrValues.cpp +++ b/src/axom/sidre/core/AttrValues.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -35,33 +35,21 @@ namespace sidre */ bool AttrValues::hasValue(const Attribute* attr) const { - if(attr == nullptr) + // check for empty values + if(attr == nullptr || m_values == nullptr) { return false; } - if(m_values == nullptr) - { - // No attributes have been set in this View. - return false; - } - - IndexType iattr = attr->getIndex(); - - if((size_t)iattr >= m_values->size()) + const auto iattr = static_cast(attr->getIndex()); + if(iattr >= m_values->size()) { // This attribute has not been set for this View. return false; } Node& value = (*m_values)[iattr]; - - if(isEmpty(value)) - { - return false; - } - - return true; + return !isEmpty(value); } /* @@ -87,9 +75,8 @@ bool AttrValues::setToDefault(const Attribute* attr) return true; } - IndexType iattr = attr->getIndex(); - - if((size_t)iattr >= m_values->size()) + const auto iattr = static_cast(attr->getIndex()); + if(iattr >= m_values->size()) { // This attribute has not been set for this View, already default. return true; @@ -117,13 +104,13 @@ bool AttrValues::createNode(IndexType iattr) m_values = new(std::nothrow) Values(); } - if((size_t)iattr >= m_values->size()) + if(static_cast(iattr) >= m_values->size()) { // Create all attributes up to iattr, push back empty Nodes m_values->reserve(iattr + 1); for(int n = m_values->size(); n < iattr + 1; ++n) { - m_values->push_back(Node()); + m_values->emplace_back(Node()); } } @@ -192,9 +179,8 @@ const Node& AttrValues::getValueNodeRef(const Attribute* attr) const return attr->getDefaultNodeRef(); } - IndexType iattr = attr->getIndex(); - - if((size_t)iattr >= m_values->size()) + const auto iattr = static_cast(attr->getIndex()); + if(iattr >= m_values->size()) { // This attribute has not been set for this View return attr->getDefaultNodeRef(); diff --git a/src/axom/sidre/core/AttrValues.hpp b/src/axom/sidre/core/AttrValues.hpp index f5ff8b5880..02963a8b9c 100644 --- a/src/axom/sidre/core/AttrValues.hpp +++ b/src/axom/sidre/core/AttrValues.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -58,16 +58,12 @@ class View; * avoid multiple messages for the same error. For example, if the * index cannot be converted to an Attribute pointer in the View * class, an error message will be printing and then a NULL pointer - * passed to the AttrValues class which will not print another - * message. + * passed to the AttrValues class which will not print another message. */ class AttrValues { public: - /*! - * Friend declarations to constrain usage via controlled access to - * private members. - */ + /// Friend declarations to constrain usage via controlled access to private members. friend class View; private: @@ -106,7 +102,7 @@ class AttrValues template bool setScalar(const Attribute* attr, ScalarType value) { - DataTypeId arg_id = detail::SidreTT::id; + const DataTypeId arg_id = detail::SidreTT::id; if(arg_id != attr->getTypeID()) { SLIC_CHECK_MSG(arg_id == attr->getTypeID(), @@ -117,8 +113,8 @@ class AttrValues return false; } - IndexType iattr = attr->getIndex(); - bool ok = createNode(iattr); + const IndexType iattr = attr->getIndex(); + const bool ok = createNode(iattr); if(ok) { (*m_values)[iattr] = value; @@ -131,7 +127,7 @@ class AttrValues */ bool setString(const Attribute* attr, const std::string& value) { - DataTypeId arg_id = CHAR8_STR_ID; + const DataTypeId arg_id = CHAR8_STR_ID; if(arg_id != attr->getTypeID()) { SLIC_CHECK_MSG(arg_id == attr->getTypeID(), @@ -142,8 +138,8 @@ class AttrValues return false; } - IndexType iattr = attr->getIndex(); - bool ok = createNode(iattr); + const IndexType iattr = attr->getIndex(); + const bool ok = createNode(iattr); if(ok) { (*m_values)[iattr] = value; @@ -159,8 +155,8 @@ class AttrValues */ bool setNode(const Attribute* attr, const Node& node) { - IndexType iattr = attr->getIndex(); - bool ok = createNode(iattr); + const IndexType iattr = attr->getIndex(); + const bool ok = createNode(iattr); if(ok) { (*m_values)[iattr] = node; diff --git a/src/axom/sidre/core/Attribute.cpp b/src/axom/sidre/core/Attribute.cpp index 7e9481f1b5..c91bbe4fc8 100644 --- a/src/axom/sidre/core/Attribute.cpp +++ b/src/axom/sidre/core/Attribute.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/Attribute.hpp b/src/axom/sidre/core/Attribute.hpp index 7a785ba71d..c3e1fe2c25 100644 --- a/src/axom/sidre/core/Attribute.hpp +++ b/src/axom/sidre/core/Attribute.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/Buffer.cpp b/src/axom/sidre/core/Buffer.cpp index b7a7ec3fac..c051d9e9e6 100644 --- a/src/axom/sidre/core/Buffer.cpp +++ b/src/axom/sidre/core/Buffer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/Buffer.hpp b/src/axom/sidre/core/Buffer.hpp index 26bf1667c8..c02c4226fc 100644 --- a/src/axom/sidre/core/Buffer.hpp +++ b/src/axom/sidre/core/Buffer.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/DataStore.cpp b/src/axom/sidre/core/DataStore.cpp index 4c3c77b7d7..e772cd8b4e 100644 --- a/src/axom/sidre/core/DataStore.cpp +++ b/src/axom/sidre/core/DataStore.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -86,6 +86,7 @@ DataStore::DataStore() , m_buffer_coll(new BufferCollection()) , m_attribute_coll(new AttributeCollection()) , m_need_to_finalize_slic(false) + , m_conduit_errors() { if(!axom::slic::isInitialized()) { @@ -636,14 +637,9 @@ bool DataStore::saveAttributeLayout(Node& node) const bool hasAttributes = false; - IndexType aidx = getFirstValidAttributeIndex(); - while(indexIsValid(aidx)) + for(const auto& attr : attributes()) { - const Attribute* attr = getAttribute(aidx); - - node[attr->getName()] = attr->getDefaultNodeRef(); - - aidx = getNextValidAttributeIndex(aidx); + node[attr.getName()] = attr.getDefaultNodeRef(); hasAttributes = true; } @@ -669,7 +665,9 @@ void DataStore::loadAttributeLayout(Node& node) Node& n_attr = attrs_itr.next(); std::string attr_name = attrs_itr.name(); - Attribute* attr = createAttributeEmpty(attr_name); + auto* attr = !hasAttribute(attr_name) ? createAttributeEmpty(attr_name) + : getAttribute(attr_name); + attr->setDefaultNodeRef(n_attr); } } diff --git a/src/axom/sidre/core/DataStore.hpp b/src/axom/sidre/core/DataStore.hpp index 7ee0b9f261..2baf4179ad 100644 --- a/src/axom/sidre/core/DataStore.hpp +++ b/src/axom/sidre/core/DataStore.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -88,6 +88,32 @@ class DataStore */ const Group* getRoot() const { return m_RootGroup; }; + //@{ + /*! @name Methods to query and clear Conduit I/O flags and exception messages. + * + * If an error occurs, the load(), save(), and loadExternalData() methods of + * any Group owned by this DataStore will return false (for I/O failure) and + * subsequent calls will continue to return false until the user clears the + * Conduit errors. + */ + + /// Return whether a Conduit error occurred. + bool getConduitErrorOccurred() const { return !m_conduit_errors.empty(); }; + + /// Return information on any Conduit errors. + std::string getConduitErrors() const { return m_conduit_errors; }; + + /// Clear any Conduit errors. + void clearConduitErrors() const { m_conduit_errors.clear(); }; + + /// Append a string to the accumulated Conduit errors. + void appendToConduitErrors(const std::string& mesg) const + { + m_conduit_errors = m_conduit_errors + "\n" + mesg; + }; + + //@} + public: //@{ //! @name Methods to query, access, create, and destroy Buffers. @@ -253,7 +279,7 @@ class DataStore IndexType getNumAttributes() const; /*! - * \brief Create a Attribute object with a default scalar value. + * \brief Create an Attribute object with a default scalar value. * * The Attribute object is assigned a unique index when created and the * Attribute object is owned by the DataStore object. @@ -271,7 +297,7 @@ class DataStore } /*! - * \brief Create a Attribute object with a default string value. + * \brief Create an Attribute object with a default string value. * * The Attribute object is assigned a unique index when created and the * Attribute object is owned by the DataStore object. @@ -287,20 +313,14 @@ class DataStore return new_attribute; } - /*! - * \brief Return true if DataStore has created attribute name; else false. - */ + /// \brief Return true if DataStore has created attribute name, else false bool hasAttribute(const std::string& name) const; - /*! - * \brief Return true if DataStore has created attribute with index; else - * false. - */ + /// \brief Return true if DataStore has created attribute with index, else false bool hasAttribute(IndexType idx) const; /*! - * \brief Remove Attribute from the DataStore and destroy it and - * its data. + * \brief Remove Attribute from the DataStore and destroy it and its data. * * \note Destruction of an Attribute detaches it from all Views to * which it is attached. @@ -317,8 +337,7 @@ class DataStore void destroyAttribute(IndexType idx); /*! - * \brief Remove Attribute from the DataStore and destroy it and - * its data. + * \brief Remove Attribute from the DataStore and destroy it and its data. * * \note Destruction of an Attribute detaches it from all Views to * which it is attached. @@ -326,8 +345,7 @@ class DataStore void destroyAttribute(Attribute* attr); /*! - * \brief Remove all Attributes from the DataStore and destroy them - * and their data. + * \brief Remove all Attributes from the DataStore and destroy them and their data. * * \note Destruction of an Attribute detaches it from all Views to * which it is attached. @@ -373,9 +391,7 @@ class DataStore */ bool saveAttributeLayout(Node& node) const; - /*! - * \brief Create attributes from name/value pairs in node["attribute"]. - */ + /// \brief Create attributes from name/value pairs in node["attribute"]. void loadAttributeLayout(Node& node); //@} @@ -408,8 +424,7 @@ class DataStore /*! * \brief Return next valid Attribute index in DataStore object after given - * index (i.e., smallest index over all Attribute indices larger than given - * one). + * index (i.e., smallest index over all Attribute indices larger than given one). * * sidre::InvalidIndex is returned if there is no valid index greater * than given one. @@ -540,6 +555,9 @@ class DataStore /// Flag indicating whether SLIC logging environment was initialized in ctor. bool m_need_to_finalize_slic; + + /// Details of the most recent Conduit error. Length > 0 indicates an error occurred. + mutable std::string m_conduit_errors; }; } /* end namespace sidre */ diff --git a/src/axom/sidre/core/Group.cpp b/src/axom/sidre/core/Group.cpp index 562ae37925..ed5901c319 100644 --- a/src/axom/sidre/core/Group.cpp +++ b/src/axom/sidre/core/Group.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -966,6 +966,41 @@ View* Group::copyView(View* view) return copy; } +/* + ************************************************************************* + * + * Create a deep copy of given View and attach to this Group. + * + * The deep copy performs a copy of all described data. + * + ************************************************************************* + */ +View* Group::deepCopyView(View* view, int allocID) +{ + allocID = getValidAllocatorID(allocID); + + if(view == nullptr || hasChildView(view->getName())) + { + SLIC_CHECK_MSG( + view != nullptr, + SIDRE_GROUP_LOG_PREPEND << "Null pointer provided, no View to copy."); + + if(view != nullptr) + { + SLIC_CHECK_MSG(!hasChildView(view->getName()), + SIDRE_GROUP_LOG_PREPEND + << "Group already has a View named '" << view->getName() + << "' so View copy operation cannot happen"); + } + + return nullptr; + } + + View* copy = createView(view->getName()); + view->deepCopyView(copy, allocID); + return copy; +} + //////////////////////////////////////////////////////////////////////// // // Child Group query methods. @@ -1355,19 +1390,63 @@ Group* Group::copyGroup(Group* group) Group* res = createGroup(group->getName()); // copy child Groups to new Group - IndexType gidx = group->getFirstValidGroupIndex(); - while(indexIsValid(gidx)) + for(auto& grp : group->groups()) { - res->copyGroup(group->getGroup(gidx)); - gidx = group->getNextValidGroupIndex(gidx); + res->copyGroup(&grp); } // copy Views to new Group - IndexType vidx = group->getFirstValidViewIndex(); - while(indexIsValid(vidx)) + for(auto& view : group->views()) { - res->copyView(group->getView(vidx)); - vidx = group->getNextValidViewIndex(vidx); + res->copyView(&view); + } + + return res; +} + +/* + ************************************************************************* + * + * Create a deep copy of given Group and make it a child of this Group. + * + * The deep copy of a Group will copy the group hierarchy and deep copy + * all Views within the hierarchy. + * + ************************************************************************* + */ +Group* Group::deepCopyGroup(Group* group, int allocID) +{ + allocID = getValidAllocatorID(allocID); + + if(group == nullptr || hasChildGroup(group->getName())) + { + SLIC_CHECK_MSG( + group != nullptr, + SIDRE_GROUP_LOG_PREPEND << "Null pointer provided, no Group to copy."); + + if(group != nullptr) + { + SLIC_CHECK_MSG(!hasChildGroup(group->getName()), + SIDRE_GROUP_LOG_PREPEND + << "Invalid copy operation. Group already has " + << "a child named '" << group->getName() << "'."); + } + + return nullptr; + } + + Group* res = createGroup(group->getName()); + + // copy child Groups to new Group + for(auto& grp : group->groups()) + { + res->deepCopyGroup(&grp, allocID); + } + + // copy Views to new Group + for(auto& view : group->views()) + { + res->deepCopyView(&view, allocID); } return res; @@ -1711,6 +1790,105 @@ bool Group::isEquivalentTo(const Group* other, bool checkName) const return is_equiv; } +/* + ************************************************************************* + * + * Private class used to set Conduit error handler to default (throw exception) + * + * Creating an instance of this class will disable the current Conduit error + * callbacks. The default Conduit callbacks throw exceptions when they + * encounter I/O errors. When the instance is destroyed, the previous + * callbacks are restored. + * + * This class is also a functor. The operator() method takes a closure, + * catches any Conduit error, and saves that in the DataStore. + * + ************************************************************************* + */ + +class ConduitErrorSuppressor +{ +public: + using conduit_error_handler = void (*)(const std::string&, + const std::string&, + int); + + ConduitErrorSuppressor(const DataStore* ds, bool suppress_in_call = true); + ~ConduitErrorSuppressor(); + + void operator()(const std::function& conduitOp) + { + if(m_suppress_in_call) + { + disable_conduit_error_handlers(); + } + + try + { + conduitOp(); + } + catch(conduit::Error& e) + { + m_ds->appendToConduitErrors(e.what()); + } + + if(m_suppress_in_call) + { + restore_conduit_error_handlers(); + } + } + +private: + // saves current error func; set to default + void disable_conduit_error_handlers() + { + m_info_handler = conduit::utils::info_handler(); + m_warning_handler = conduit::utils::warning_handler(); + m_error_handler = conduit::utils::error_handler(); + + DataStore::setConduitDefaultMessageHandlers(); + } + + // restores saved error func + void restore_conduit_error_handlers() + { + conduit::utils::set_error_handler(m_error_handler); + conduit::utils::set_warning_handler(m_warning_handler); + conduit::utils::set_info_handler(m_info_handler); + } + + /// The DataStore we report to + const DataStore* m_ds; + + /// callbacks used for Conduit error interface + conduit_error_handler m_error_handler, m_warning_handler, m_info_handler; + + /// Suppress error handling in the call operator? + bool m_suppress_in_call; +}; + +ConduitErrorSuppressor::ConduitErrorSuppressor(const DataStore* ds, + bool suppress_in_call) + : m_ds(ds) + , m_error_handler(nullptr) + , m_warning_handler(nullptr) + , m_info_handler(nullptr) + , m_suppress_in_call(suppress_in_call) +{ + if(!m_suppress_in_call) + { + disable_conduit_error_handlers(); + } +} + +ConduitErrorSuppressor::~ConduitErrorSuppressor() +{ + if(!m_suppress_in_call) + { + restore_conduit_error_handlers(); + } +} + /* ************************************************************************* * @@ -1719,11 +1897,13 @@ bool Group::isEquivalentTo(const Group* other, bool checkName) const ************************************************************************* */ -void Group::save(const std::string& path, +bool Group::save(const std::string& path, const std::string& protocol, const Attribute* attr) const { const DataStore* ds = getDataStore(); + ConduitErrorSuppressor checkConduitCall(ds); + bool retval = false; if(protocol == "sidre_hdf5") { @@ -1732,7 +1912,8 @@ void Group::save(const std::string& path, ds->saveAttributeLayout(n["sidre/attribute"]); createExternalLayout(n["sidre/external"], attr); n["sidre_group_name"] = m_name; - conduit::relay::io::save(n, path, "hdf5"); + checkConduitCall([&] { conduit::relay::io::save(n, path, "hdf5"); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else if(protocol == "sidre_conduit_json") { @@ -1741,7 +1922,8 @@ void Group::save(const std::string& path, ds->saveAttributeLayout(n["sidre/attribute"]); createExternalLayout(n["sidre/external"], attr); n["sidre_group_name"] = m_name; - conduit::relay::io::save(n, path, "conduit_json"); + checkConduitCall([&] { conduit::relay::io::save(n, path, "conduit_json"); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else if(protocol == "sidre_json") { @@ -1750,7 +1932,8 @@ void Group::save(const std::string& path, ds->saveAttributeLayout(n["sidre/attribute"]); createExternalLayout(n["sidre/external"], attr); n["sidre_group_name"] = m_name; - conduit::relay::io::save(n, path, "json"); + checkConduitCall([&] { conduit::relay::io::save(n, path, "json"); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else if(protocol == "sidre_layout_json") { @@ -1758,14 +1941,16 @@ void Group::save(const std::string& path, exportWithoutBufferData(n["sidre"], attr); ds->saveAttributeLayout(n["sidre/attribute"]); n["sidre_group_name"] = m_name; - conduit::relay::io::save(n, path, "conduit_json"); + checkConduitCall([&] { conduit::relay::io::save(n, path, "conduit_json"); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else if(protocol == "conduit_hdf5") { Node n; createNativeLayout(n, attr); n["sidre_group_name"] = m_name; - conduit::relay::io::save(n, path, "hdf5"); + checkConduitCall([&] { conduit::relay::io::save(n, path, "hdf5"); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else if(protocol == "conduit_bin" || protocol == "conduit_json" || protocol == "json") @@ -1773,20 +1958,25 @@ void Group::save(const std::string& path, Node n; createNativeLayout(n, attr); n["sidre_group_name"] = m_name; - conduit::relay::io::save(n, path, protocol); + checkConduitCall([&] { conduit::relay::io::save(n, path, protocol); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else if(protocol == "conduit_layout_json") { Node n; createNoDataLayout(n, attr); n["sidre_group_name"] = m_name; - conduit::relay::io::save(n, path, "conduit_json"); + checkConduitCall([&] { conduit::relay::io::save(n, path, "conduit_json"); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else { SLIC_ERROR(SIDRE_GROUP_LOG_PREPEND << "Invalid protocol '" << protocol << "' for file save."); + retval = false; } + + return retval; } /*************************************************************************/ @@ -1798,87 +1988,112 @@ void Group::save(const std::string& path, * ************************************************************************* */ -void Group::load(const std::string& path, +bool Group::load(const std::string& path, const std::string& protocol, bool preserve_contents) { std::string new_name; - load(path, protocol, preserve_contents, new_name); + return load(path, protocol, preserve_contents, new_name); } -void Group::load(const std::string& path, +bool Group::load(const std::string& path, const std::string& protocol, bool preserve_contents, std::string& name_from_file) { + ConduitErrorSuppressor checkConduitCall(getDataStore()); + bool retval = false; if(protocol == "sidre_hdf5") { Node n; - conduit::relay::io::load(path, "hdf5", n); - SLIC_ASSERT_MSG(n.has_path("sidre"), - SIDRE_GROUP_LOG_PREPEND - << "Conduit Node " << n.path() << " does not have sidre " - << "data for this Group " << getPathName() << "."); - importFrom(n["sidre"], preserve_contents); - if(n.has_path("sidre_group_name")) + checkConduitCall([&] { conduit::relay::io::load(path, "hdf5", n); }); + if(!getDataStore()->getConduitErrorOccurred()) { - name_from_file = n["sidre_group_name"].as_string(); + SLIC_ASSERT_MSG(n.has_path("sidre"), + SIDRE_GROUP_LOG_PREPEND + << "Conduit Node " << n.path() << " does not have sidre " + << "data for this Group " << getPathName() << "."); + importFrom(n["sidre"], preserve_contents); + if(n.has_path("sidre_group_name")) + { + name_from_file = n["sidre_group_name"].as_string(); + } + retval = true; } } else if(protocol == "sidre_conduit_json") { Node n; - conduit::relay::io::load(path, "conduit_json", n); - SLIC_ASSERT_MSG(n.has_path("sidre"), - SIDRE_GROUP_LOG_PREPEND - << "Conduit Node " << n.path() << " does not have sidre " - << "data for Group " << getPathName() << "."); - importFrom(n["sidre"], preserve_contents); - if(n.has_path("sidre_group_name")) + checkConduitCall([&] { conduit::relay::io::load(path, "conduit_json", n); }); + if(!getDataStore()->getConduitErrorOccurred()) { - name_from_file = n["sidre_group_name"].as_string(); + SLIC_ASSERT_MSG(n.has_path("sidre"), + SIDRE_GROUP_LOG_PREPEND + << "Conduit Node " << n.path() << " does not have sidre " + << "data for Group " << getPathName() << "."); + importFrom(n["sidre"], preserve_contents); + if(n.has_path("sidre_group_name")) + { + name_from_file = n["sidre_group_name"].as_string(); + } + retval = true; } } else if(protocol == "sidre_json") { Node n; - conduit::relay::io::load(path, "json", n); - SLIC_ASSERT_MSG(n.has_path("sidre"), - SIDRE_GROUP_LOG_PREPEND - << "Conduit Node " << n.path() << " does not have sidre " - << "data for Group " << getPathName() << "."); - importFrom(n["sidre"], preserve_contents); - if(n.has_path("sidre_group_name")) + checkConduitCall([&] { conduit::relay::io::load(path, "json", n); }); + if(!getDataStore()->getConduitErrorOccurred()) { - name_from_file = n["sidre_group_name"].as_string(); + SLIC_ASSERT_MSG(n.has_path("sidre"), + SIDRE_GROUP_LOG_PREPEND + << "Conduit Node " << n.path() << " does not have sidre " + << "data for Group " << getPathName() << "."); + importFrom(n["sidre"], preserve_contents); + if(n.has_path("sidre_group_name")) + { + name_from_file = n["sidre_group_name"].as_string(); + } + retval = true; } } else if(protocol == "conduit_hdf5") { Node n; - conduit::relay::io::load(path, "hdf5", n); - importConduitTree(n, preserve_contents); - if(n.has_path("sidre_group_name")) + checkConduitCall([&] { conduit::relay::io::load(path, "hdf5", n); }); + if(!getDataStore()->getConduitErrorOccurred()) { - name_from_file = n["sidre_group_name"].as_string(); + importConduitTree(n, preserve_contents); + if(n.has_path("sidre_group_name")) + { + name_from_file = n["sidre_group_name"].as_string(); + } + retval = true; } } else if(protocol == "conduit_bin" || protocol == "conduit_json" || protocol == "json") { Node n; - conduit::relay::io::load(path, protocol, n); - importConduitTree(n, preserve_contents); - if(n.has_path("sidre_group_name")) + checkConduitCall([&] { conduit::relay::io::load(path, protocol, n); }); + if(!getDataStore()->getConduitErrorOccurred()) { - name_from_file = n["sidre_group_name"].as_string(); + importConduitTree(n, preserve_contents); + if(n.has_path("sidre_group_name")) + { + name_from_file = n["sidre_group_name"].as_string(); + } + retval = true; } } else { SLIC_ERROR(SIDRE_GROUP_LOG_PREPEND << "Invalid protocol '" << protocol << "' for file load."); + retval = false; } + + return retval; } /* @@ -1897,9 +2112,12 @@ Group* Group::createGroupAndLoad(std::string& group_name, Group* child = createGroup(group_name); if(child != nullptr) { - // In a forthcoming PR, load() will return a bool for success/failure - load_success = true; - child->load(path, protocol, false, group_name); + load_success = child->load(path, protocol, false, group_name); + if(!load_success) + { + destroyGroupAndData(group_name); + child = nullptr; + } } return child; @@ -1912,22 +2130,31 @@ Group* Group::createGroupAndLoad(std::string& group_name, * ************************************************************************* */ -void Group::loadExternalData(const std::string& path) +bool Group::loadExternalData(const std::string& path) { Node n; createExternalLayout(n); + ConduitErrorSuppressor checkConduitCall(getDataStore()); + bool success; #ifdef AXOM_USE_HDF5 // CYRUS'-NOTE, not sure ":" will work with multiple trees per // output file - conduit::relay::io::hdf5_read(path + ":sidre/external", n); + checkConduitCall( + [&] { conduit::relay::io::hdf5_read(path + ":sidre/external", n); }); + + success = !(getDataStore()->getConduitErrorOccurred()); #else AXOM_UNUSED_VAR(path); SLIC_WARNING(SIDRE_GROUP_LOG_PREPEND << "External data not loaded. " << "This function requires hdf5 support. " << " Please reconfigure with hdf5."); + + success = false; #endif + + return success; } // Functions that directly use the hdf5 API in their signature @@ -1940,10 +2167,13 @@ void Group::loadExternalData(const std::string& path) * ************************************************************************* */ -void Group::save(const hid_t& h5_id, +bool Group::save(const hid_t& h5_id, const std::string& protocol, const Attribute* attr) const { + ConduitErrorSuppressor checkConduitCall(getDataStore()); + bool retval = false; + // supported here: // "sidre_hdf5" // "conduit_hdf5" @@ -1953,20 +2183,25 @@ void Group::save(const hid_t& h5_id, exportTo(n["sidre"], attr); createExternalLayout(n["sidre/external"], attr); n["sidre_group_name"] = m_name; - conduit::relay::io::hdf5_write(n, h5_id); + checkConduitCall([&] { conduit::relay::io::hdf5_write(n, h5_id); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else if(protocol == "conduit_hdf5") { Node n; createNativeLayout(n, attr); n["sidre_group_name"] = m_name; - conduit::relay::io::hdf5_write(n, h5_id); + checkConduitCall([&] { conduit::relay::io::hdf5_write(n, h5_id); }); + retval = !(getDataStore()->getConduitErrorOccurred()); } else { SLIC_ERROR(SIDRE_GROUP_LOG_PREPEND << "Invalid protocol '" << protocol << "' for save with hdf5 handle."); + retval = false; } + + return retval; } /* @@ -1976,52 +2211,66 @@ void Group::save(const hid_t& h5_id, * ************************************************************************* */ -void Group::load(const hid_t& h5_id, +bool Group::load(const hid_t& h5_id, const std::string& protocol, bool preserve_contents) { std::string name_from_file; - load(h5_id, protocol, preserve_contents, name_from_file); + return load(h5_id, protocol, preserve_contents, name_from_file); } -void Group::load(const hid_t& h5_id, +bool Group::load(const hid_t& h5_id, const std::string& protocol, bool preserve_contents, std::string& name_from_file) { + ConduitErrorSuppressor checkConduitCall(getDataStore()); + bool retval = false; + // supported here: // "sidre_hdf5" // "conduit_hdf5" if(protocol == "sidre_hdf5") { Node n; - conduit::relay::io::hdf5_read(h5_id, n); - SLIC_ASSERT_MSG(n.has_path("sidre"), - SIDRE_GROUP_LOG_PREPEND - << "Conduit Node " << n.path() << " does not have sidre " - << "data for Group " << getPathName() << "."); - importFrom(n["sidre"], preserve_contents); - if(n.has_path("sidre_group_name")) + checkConduitCall([&] { conduit::relay::io::hdf5_read(h5_id, n); }); + if(!getDataStore()->getConduitErrorOccurred()) { - name_from_file = n["sidre_group_name"].as_string(); + SLIC_ASSERT_MSG(n.has_path("sidre"), + SIDRE_GROUP_LOG_PREPEND + << "Conduit Node " << n.path() << " does not have sidre " + << "data for Group " << getPathName() << "."); + importFrom(n["sidre"], preserve_contents); + if(n.has_path("sidre_group_name")) + { + name_from_file = n["sidre_group_name"].as_string(); + } + retval = true; } } else if(protocol == "conduit_hdf5") { SLIC_ERROR("Protocol " << protocol << " not yet supported for file load."); Node n; - conduit::relay::io::hdf5_read(h5_id, n); - importConduitTree(n, preserve_contents); - if(n.has_path("sidre_group_name")) + checkConduitCall([&] { conduit::relay::io::hdf5_read(h5_id, n); }); + if(!getDataStore()->getConduitErrorOccurred()) { - name_from_file = n["sidre_group_name"].as_string(); + importConduitTree(n, preserve_contents); + if(n.has_path("sidre_group_name")) + { + name_from_file = n["sidre_group_name"].as_string(); + } + retval = true; } } else { SLIC_ERROR(SIDRE_GROUP_LOG_PREPEND << "Invalid protocol '" << protocol << "' for file load."); + retval = false; } + + return retval; } /* @@ -2032,11 +2281,16 @@ void Group::load(const hid_t& h5_id, * Note: this ASSUMES uses the "sidre_hdf5" protocol ************************************************************************* */ -void Group::loadExternalData(const hid_t& h5_id) +bool Group::loadExternalData(const hid_t& h5_id) { Node n; createExternalLayout(n); - conduit::relay::io::hdf5_read(h5_id, "sidre/external", n); + ConduitErrorSuppressor checkConduitCall(getDataStore()); + + checkConduitCall( + [&] { conduit::relay::io::hdf5_read(h5_id, "sidre/external", n); }); + + return !(getDataStore()->getConduitErrorOccurred()); } #endif /* AXOM_USE_HDF5 */ diff --git a/src/axom/sidre/core/Group.hpp b/src/axom/sidre/core/Group.hpp index 782dd833c7..1743675741 100644 --- a/src/axom/sidre/core/Group.hpp +++ b/src/axom/sidre/core/Group.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -30,6 +30,7 @@ #include #include #include +#include // third party lib headers #ifdef AXOM_USE_HDF5 @@ -890,20 +891,43 @@ class Group View* moveView(View* view); /*! - * \brief Create a copy of given View object and add it to this Group. + * \brief Create a (shallow) copy of given View object and add it to this + * Group. * * Note that View copying is a "shallow" copy; the data associated with * the View is not copied. The new View object is associated with * the same data as the original. * - * If given Group pointer is null or Group already has a child Group with - * same name as given Group, method is a no-op. + * If given View pointer is null or Group already has a View with + * same name as given View, method is a no-op. * - * \return pointer to given argument Group object or nullptr if Group - * is not moved into this Group. + * \sa deepCopyView + * + * \return pointer to the new copied View object or nullptr if a View + * is not successfully copied into this Group. */ View* copyView(View* view); + /*! + * \brief Create a deep copy of given View object and add it to this Group. + * + * Note that for Views that use sidre Buffers or external data, the + * deep copy performs a copy of the data described by the View + * into a new Buffer attached to the destination View. If the source View + * describes only part of a Buffer or part of an external array, due to + * strides and or offsets into the data, only the values seen by the + * description will be copied into the new View. The new View will have + * a Buffer that is the exact size of the number of values that are copied, + * with an offset of zero and a stride of one. + * + * If given View pointer is null or Group already has a View with + * same name as given View, method is a no-op. + * + * \return pointer to the new copied View object or nullptr if a View + * is not copied into this Group. + */ + View* deepCopyView(View* view, int allocID = INVALID_ALLOCATOR_ID); + //@} //@{ @@ -1228,8 +1252,8 @@ class Group Group* moveGroup(Group* group); /*! - * \brief Create a copy of Group hierarchy rooted at given Group and make it - * a child of this Group. + * \brief Create a (shallow) copy of Group hierarchy rooted at given + * Group and make it a child of this Group. * * Note that all Views in the Group hierarchy are copied as well. * @@ -1241,11 +1265,38 @@ class Group * If given Group pointer is null or Group already has a child Group with * same name as given Group, method is a no-op. * - * \return pointer to given argument Group object or nullptr if Group - * is not moved into this Group. + * \sa deepCopyGroup + * + * \return pointer to the new copied Group object or nullptr if a Group + * is not copied into this Group. */ Group* copyGroup(Group* group); + /*! + * \brief Create a deep copy of Group hierarchy rooted at given Group and + * make it a child of this Group. + * + * Note that all Views in the Group hierarchy are deep copied as well. + * + * The deep copy of the Group creates a duplicate of the entire Group + * hierarchy and performs a deep copy of the data described by the Views + * in the hierarchy. + * + * The Views in the new Group hierarchy will each allocate and use + * new Buffers to hold their copied data. Each Buffer will be sized to + * receive only the data values seen by the description of the original + * View and will have zero offset and a strid of one. + * + * If given Group pointer is null or Group already has a child Group with + * same name as given Group, method is a no-op. + * + * \sa deepCopyGroup + * + * \return pointer to the new copied Group object or nullptr if a Group + * is not copied into this Group. + */ + Group* deepCopyGroup(Group* group, int allocID = INVALID_ALLOCATOR_ID); + //@} //@{ @@ -1390,7 +1441,9 @@ class Group * \brief Save the Group to a file. * * Saves the tree starting at this Group and the Buffers used by the Views - * in this tree. + * in this tree. Returns true (success) if no Conduit I/O error occurred + * since this Group's DataStore was created or had its error flag cleared; + * false, if an error occurred at some point. * * If attr is a null pointer, dump all Views. Otherwise, only dump Views * which have the Attribute set. @@ -1398,8 +1451,9 @@ class Group * \param path file path * \param protocol I/O protocol * \param attr Save Views that have Attribute set. + * \return True if no error occurred, otherwise false. */ - void save(const std::string& path, + bool save(const std::string& path, const std::string& protocol = Group::getDefaultIOProtocol(), const Attribute* attr = nullptr) const; @@ -1412,7 +1466,10 @@ class Group * * If preserve_contents is true, then the names of the children held by the * Node cannot be the same as the names of the children already held by this - * Group. If there is a naming conflict, an error will occur. + * Group. If there is a naming conflict, an error will occur. Returns true + * (success) if no Conduit I/O error occurred since this Group's DataStore + * was created or had its error flag cleared; false, if an error occurred at + * some point. * * \param path file path * \param protocol I/O protocol @@ -1420,8 +1477,9 @@ class Group * this Group remain in place. If false, all * child Groups and Views are destroyed before * loading data from the file. + * \return True if no error occurred, otherwise false. */ - void load(const std::string& path, + bool load(const std::string& path, const std::string& protocol = Group::getDefaultIOProtocol(), bool preserve_contents = false); @@ -1437,7 +1495,10 @@ class Group * * If preserve_contents is true, then the names of the children held by the * Node cannot be the same as the names of the children already held by this - * Group. If there is a naming conflict, an error will occur. + * Group. If there is a naming conflict, an error will occur. Returns true + * (success) if no Conduit I/O error occurred since this Group's DataStore + * was created or had its error flag cleared; false, if an error occurred at + * some point. * * \param [in] path file path to load * \param [in] protocol I/O protocol to use @@ -1446,8 +1507,9 @@ class Group * If false, all child Groups and Views are * destroyed before loading data from the file. * \param [out] name_from_file Group name stored in the file + * \return True if no error occurred, otherwise false. */ - void load(const std::string& path, + bool load(const std::string& path, const std::string& protocol, bool preserve_contents, std::string& name_from_file); @@ -1493,8 +1555,10 @@ class Group * protocol. * * \param path file path + * \return True if Axom was compiled with HDF5 and no error + * occurred in this method; otherwise false. */ - void loadExternalData(const std::string& path); + bool loadExternalData(const std::string& path); #ifdef AXOM_USE_HDF5 @@ -1502,13 +1566,16 @@ class Group * \brief Save the Group to an hdf5 handle. * * If attr is nullptr, dump all Views. Otherwise, only dump Views - * which have the Attribute set. + * which have the Attribute set. Returns true (success) if no Conduit + * I/O error occurred since this Group's DataStore was created or had + * its error flag cleared; false, if an error occurred at some point. * * \param h5_id hdf5 handle * \param protocol I/O protocol sidre_hdf5 or conduit_hdf5 * \param attr Save Views that have Attribute set. + * \return True if no error occurred, otherwise false. */ - void save(const hid_t& h5_id, + bool save(const hid_t& h5_id, const std::string& protocol = Group::getDefaultIOProtocol(), const Attribute* attr = nullptr) const; @@ -1517,7 +1584,10 @@ class Group * * If preserve_contents is true, then the names of the children held by the * Node cannot be the same as the names of the children already held by this - * Group. If there is a naming conflict, an error will occur. + * Group. If there is a naming conflict, an error will occur. Returns true + * (success) if no Conduit I/O error occurred since this Group's DataStore + * was created or had its error flag cleared; false, if an error occurred at + * some point. * * \param h5_id hdf5 handle * \param protocol I/O protocol sidre_hdf5 or conduit_hdf5 @@ -1525,8 +1595,9 @@ class Group * this Group remain in place. If false, all * child Groups and Views are destroyed before * loading data from the file. + * \return True if no error occurred, otherwise false. */ - void load(const hid_t& h5_id, + bool load(const hid_t& h5_id, const std::string& protocol = Group::getDefaultIOProtocol(), bool preserve_contents = false); @@ -1535,7 +1606,10 @@ class Group * * If preserve_contents is true, then the names of the children held by the * Node cannot be the same as the names of the children already held by this - * Group. If there is a naming conflict, an error will occur. + * Group. If there is a naming conflict, an error will occur. Returns true + * (success) if no Conduit I/O error occurred since this Group's DataStore + * was created or had its error flag cleared; false, if an error occurred at + * some point. * * \param [in] h5_id hdf5 handle * \param [in] protocol I/O protocol sidre_hdf5 or conduit_hdf5 @@ -1544,8 +1618,9 @@ class Group * child Groups and Views are destroyed before * loading data from the file. * \param [out] name_from_file Group name stored in the file + * \return True if no error occurred, otherwise false. */ - void load(const hid_t& h5_id, + bool load(const hid_t& h5_id, const std::string& protocol, bool preserve_contents, std::string& name_from_file); @@ -1554,11 +1629,14 @@ class Group * \brief Load data into the Group's external views from a hdf5 handle. * * No protocol argument is needed, as this only is used with the sidre_hdf5 - * protocol. + * protocol. Returns true (success) if no Conduit I/O error occurred since + * this Group's DataStore was created or had its error flag cleared; false, + * if an error occurred at some point. * * \param h5_id hdf5 handle + * \return True if no error occurred, otherwise false. */ - void loadExternalData(const hid_t& h5_id); + bool loadExternalData(const hid_t& h5_id); #endif /* AXOM_USE_HDF5 */ diff --git a/src/axom/sidre/core/IndexedCollection.hpp b/src/axom/sidre/core/IndexedCollection.hpp index c499f7e282..c15cd1c66b 100644 --- a/src/axom/sidre/core/IndexedCollection.hpp +++ b/src/axom/sidre/core/IndexedCollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/ItemCollection.hpp b/src/axom/sidre/core/ItemCollection.hpp index b848931d07..be3eb3aa0a 100644 --- a/src/axom/sidre/core/ItemCollection.hpp +++ b/src/axom/sidre/core/ItemCollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/ListCollection.hpp b/src/axom/sidre/core/ListCollection.hpp index 55bd4d0f7f..c4e5ca0825 100644 --- a/src/axom/sidre/core/ListCollection.hpp +++ b/src/axom/sidre/core/ListCollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/MFEMSidreDataCollection.cpp b/src/axom/sidre/core/MFEMSidreDataCollection.cpp index 8b3616fca0..3b5806bebe 100644 --- a/src/axom/sidre/core/MFEMSidreDataCollection.cpp +++ b/src/axom/sidre/core/MFEMSidreDataCollection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -89,8 +89,6 @@ MFEMSidreDataCollection::MFEMSidreDataCollection(const std::string& collection_n : mfem::DataCollection(collection_name, the_mesh) , m_owns_datastore(true) , m_owns_mesh_data(own_mesh_data) - , m_meshNodesGFName("mesh_nodes") - , m_num_files(-1) { m_datastore_ptr = new sidre::DataStore(); @@ -105,6 +103,8 @@ MFEMSidreDataCollection::MFEMSidreDataCollection(const std::string& collection_n m_named_bufs_grp = domain_grp->createGroup("named_buffers"); + this->own_data = own_mesh_data; + if(the_mesh) { MFEMSidreDataCollection::SetMesh(the_mesh); @@ -130,9 +130,6 @@ MFEMSidreDataCollection::MFEMSidreDataCollection(const std::string& collection_n : mfem::DataCollection(collection_name) , m_owns_datastore(false) , m_owns_mesh_data(own_mesh_data) - , m_meshNodesGFName("mesh_nodes") - , m_num_files(-1) - , m_datastore_ptr(nullptr) , m_bp_index_grp(bp_index_grp) { m_bp_grp = domain_grp->createGroup("blueprint"); @@ -142,6 +139,8 @@ MFEMSidreDataCollection::MFEMSidreDataCollection(const std::string& collection_n #if defined(AXOM_USE_MPI) && defined(MFEM_USE_MPI) m_comm = MPI_COMM_NULL; #endif + + this->own_data = false; } MFEMSidreDataCollection::~MFEMSidreDataCollection() @@ -843,8 +842,8 @@ void MFEMSidreDataCollection::SetMesh(Mesh* new_mesh) void MFEMSidreDataCollection::SetMesh(MPI_Comm comm, Mesh* new_mesh) { // use MFEMSidreDataCollection's custom SetMesh, then set MPI info - SetMesh(new_mesh); - SetComm(comm); + this->SetMesh(new_mesh); + this->SetComm(comm); } #endif @@ -979,7 +978,7 @@ void MFEMSidreDataCollection::UpdateStateFromDS() void MFEMSidreDataCollection::UpdateStateToDS() { SLIC_ASSERT_MSG( - mesh != NULL, + mesh != nullptr, "Need to set mesh before updating state in MFEMSidreDataCollection."); m_bp_grp->getView("state/cycle")->setScalar(GetCycle()); @@ -2648,7 +2647,7 @@ void MFEMSidreDataCollection::reconstructField(Group* field_grp) { // FiniteElementSpace - mesh ptr and FEColl ptr #if defined(AXOM_USE_MPI) && defined(MFEM_USE_MPI) - auto parmesh = dynamic_cast(mesh); + auto* parmesh = dynamic_cast(mesh); if(parmesh) { m_fespaces[fespace_id] = std::unique_ptr( diff --git a/src/axom/sidre/core/MFEMSidreDataCollection.hpp b/src/axom/sidre/core/MFEMSidreDataCollection.hpp index 8fd9707358..d90d8ca0e4 100644 --- a/src/axom/sidre/core/MFEMSidreDataCollection.hpp +++ b/src/axom/sidre/core/MFEMSidreDataCollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -193,9 +193,11 @@ class MFEMSidreDataCollection : public mfem::DataCollection collection (can be nullptr) @param[in] owns_mesh_data Does the SidreDC own the mesh vertices? - With this constructor, the MFEMSidreDataCollection owns the allocated - Sidre - DataStore. + With this constructor, the MFEMSidreDataCollection owns the allocated Sidre DataStore. + + @note This constructor also sets \a own_data in the base \a mfem::DataCollection + class to the value of \a owns_mesh_data. If this is not desired, the former + can be reset by calling \a this->SetOwnData() */ explicit MFEMSidreDataCollection(const std::string& collection_name, mfem::Mesh* the_mesh = nullptr, @@ -212,10 +214,13 @@ class MFEMSidreDataCollection : public mfem::DataCollection see the above schematic @param[in] owns_mesh_data Does the SidreDC own the mesh vertices? - With this constructor, the MFEMSidreDataCollection does not own the Sidre - DataStore. + With this constructor, the MFEMSidreDataCollection does not own the Sidre DataStore. + @note No mesh or fields are read from the given Groups. The mesh has to be set with SetMesh() and fields registered with RegisterField(). + + @note This constructor also sets \a own_data in the base \a mfem::DataCollection class + to false. If this is not desired, the former can be reset by calling \a this->SetOwnData(true) */ MFEMSidreDataCollection(const std::string& collection_name, Group* bp_index_grp, @@ -528,29 +533,25 @@ class MFEMSidreDataCollection : public mfem::DataCollection private: // Used if the Sidre data collection is providing the datastore itself. - const bool m_owns_datastore; + const bool m_owns_datastore {false}; - // TODO - Need to evaluate if this bool member can be combined with own_data - // in parent data collection class. m_owns_mesh_data indicates whether the - // Sidre dc owns the mesh element data and node positions gf. The DC base - // class own_data indicates if the dc owns the mesh object pointer itself and - // GF objects. Can we use one flag and just have DC own all objects vs none? - const bool m_owns_mesh_data; + // Note: m_owns_mesh_data indicates whether the Sidre dc owns + // the mesh element data and node positions gf. The DC base class \a own_data + // indicates if the dc owns the mesh object pointer itself and GF objects. + const bool m_owns_mesh_data {false}; - // Name to be used for registering the mesh nodes in the - // MFEMSidreDataCollection. + // Name to be used for registering the mesh nodes in the MFEMSidreDataCollection. // This name is used by SetMesh() and can be overwritten by the method - // SetMeshNodesName(). - // Default value: "mesh_nodes". - std::string m_meshNodesGFName; + // SetMeshNodesName(). Default value: "mesh_nodes". + std::string m_meshNodesGFName {"mesh_nodes"}; // For Parallel IO, the user can specify a number of files less than or equal to the // number of processors. - int m_num_files; + int m_num_files {-1}; // If the data collection owns the datastore, it will store a pointer to it. // Otherwise, this pointer is nullptr. - DataStore* m_datastore_ptr; + DataStore* m_datastore_ptr {nullptr}; protected: Group* named_buffers_grp() const; @@ -567,11 +568,11 @@ class MFEMSidreDataCollection : public mfem::DataCollection private: // If the data collection does not own the datastore, it will need pointers // to the blueprint and blueprint index group to use. - Group* m_bp_grp; - Group* m_bp_index_grp; + Group* m_bp_grp {nullptr}; + Group* m_bp_index_grp {nullptr}; // This is stored for convenience. - Group* m_named_bufs_grp; + Group* m_named_bufs_grp {nullptr}; // Used to retain ownership of components of reconstructed Meshes and GridFuncs // Instead of using flags to keep track of ownership between this class @@ -719,9 +720,6 @@ class MFEMSidreDataCollection : public mfem::DataCollection /// blueprint index. void addMaterialSetToIndex(); - // /// Verifies that the contents of the mesh blueprint data is valid. - // void verifyMeshBlueprint(); - // The names for the mesh and boundary topologies in the blueprint group, // and the suffix used to store their attributes (as fields) static const std::string s_mesh_topology_name; diff --git a/src/axom/sidre/core/MapCollection.hpp b/src/axom/sidre/core/MapCollection.hpp index fe2c9c8b49..99c0545ffa 100644 --- a/src/axom/sidre/core/MapCollection.hpp +++ b/src/axom/sidre/core/MapCollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/SidreDataTypeIds.h b/src/axom/sidre/core/SidreDataTypeIds.h index dc574e0bb8..ef1f2902af 100644 --- a/src/axom/sidre/core/SidreDataTypeIds.h +++ b/src/axom/sidre/core/SidreDataTypeIds.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/SidreTypes.hpp b/src/axom/sidre/core/SidreTypes.hpp index 2ee7c4a8f1..2bfa3c3c60 100644 --- a/src/axom/sidre/core/SidreTypes.hpp +++ b/src/axom/sidre/core/SidreTypes.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/core/View.cpp b/src/axom/sidre/core/View.cpp index 6e1ea37ddf..18a8a05fed 100644 --- a/src/axom/sidre/core/View.cpp +++ b/src/axom/sidre/core/View.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -1037,6 +1037,102 @@ void View::copyView(View* copy) const } } +/* + ************************************************************************* + * + * PRIVATE method copy the contents of this into a undescribed EMPTY view. + * + ************************************************************************* + */ +void View::deepCopyView(View* copy, int allocID) const +{ + SLIC_ASSERT_MSG(copy->m_state == EMPTY && !copy->isDescribed(), + SIDRE_VIEW_LOG_PREPEND + << "deepCopyView can only copy into undescribed view " + << "with empty state."); + + if(isDescribed()) + { + copy->describe(m_schema.dtype()); + if(hasBuffer() || m_state == EXTERNAL) + { + copy->allocate(getTypeID(), getNumElements(), allocID); + } + } + + switch(m_state) + { + case EMPTY: + // Nothing more to do + break; + case STRING: + case SCALAR: + copy->m_node = m_node; + copy->m_state = m_state; + copy->m_is_applied = true; + break; + case EXTERNAL: + if(!copy->isAllocated()) + { + copy->allocate(allocID); + } + if(isApplied()) + { + copy->apply(); + } + { + IndexType stride = getStride(); + IndexType src_offset = getOffset(); + IndexType dst_offset = copy->getOffset(); + IndexType num_bytes = getBytesPerElement(); + IndexType j = 0; + for(IndexType i = 0; i < getNumElements(); ++i) + { + char* copy_dst = + static_cast(copy->getVoidPtr()) + (dst_offset + i) * num_bytes; + const char* copy_src = + static_cast(getVoidPtr()) + (src_offset + j) * num_bytes; + axom::copy(copy_dst, copy_src, num_bytes); + + j += stride; + } + } + break; + case BUFFER: + if(isAllocated() && !copy->isAllocated()) + { + copy->allocate(allocID); + } + if(isApplied()) + { + copy->apply(); + } + if(hasBuffer()) + { + IndexType stride = getStride(); + IndexType src_offset = getOffset(); + IndexType dst_offset = copy->getOffset(); + IndexType num_bytes = getBytesPerElement(); + IndexType j = 0; + for(IndexType i = 0; i < getNumElements(); ++i) + { + char* copy_dst = + static_cast(copy->getVoidPtr()) + (dst_offset + i) * num_bytes; + const char* copy_src = + static_cast(getVoidPtr()) + (src_offset + j) * num_bytes; + axom::copy(copy_dst, copy_src, num_bytes); + + j += stride; + } + } + break; + default: + SLIC_ASSERT_MSG(false, + SIDRE_VIEW_LOG_PREPEND << "View is in unexpected state: " + << getStateStringName(m_state)); + } +} + /* ************************************************************************* * @@ -1143,7 +1239,7 @@ bool View::isApplyValid() const */ char const* View::getStateStringName(State state) { - char const* ret_string = NULL; + char const* ret_string = nullptr; switch(state) { diff --git a/src/axom/sidre/core/View.hpp b/src/axom/sidre/core/View.hpp index 3d153e46a6..7d9572b022 100644 --- a/src/axom/sidre/core/View.hpp +++ b/src/axom/sidre/core/View.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -1363,13 +1363,26 @@ class View } /*! - * \brief Copy view contents into an undescribed EMPTY view. + * \brief Copy contents of this View contents into an undescribed EMPTY View. * * For SCALAR and STRING the data is copied; EXTERNAL, * data pointer is copied; BUFFER attaches the buffer. */ void copyView(View* copy) const; + /*! + * \brief Deep copy contents of this View contents into an undescribed + * EMPTY View. + * + * For SCALAR and STRING the data is copied and the state is preserved. + * For BUFFER and EXTERNAL, the data described by this View is copied into a + * new Buffer that is of the size needed to hold the copied data. Any + * parts of the source Buffer or external array that are not seen due + * to offsets and strides in the description will not be copied. The copied + * View will have BUFFER state with zero offset and a stride of one. + */ + void deepCopyView(View* copy, int allocID = INVALID_ALLOCATOR_ID) const; + /*! * \brief Add view description and references to it's data to a conduit tree. */ diff --git a/src/axom/sidre/docs/sphinx/attribute.rst b/src/axom/sidre/docs/sphinx/attribute.rst index 580af90e0e..0a0ef68c61 100644 --- a/src/axom/sidre/docs/sphinx/attribute.rst +++ b/src/axom/sidre/docs/sphinx/attribute.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/buffer.rst b/src/axom/sidre/docs/sphinx/buffer.rst index 8ab2fbd66f..a5ad3f3d14 100644 --- a/src/axom/sidre/docs/sphinx/buffer.rst +++ b/src/axom/sidre/docs/sphinx/buffer.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/core_concepts.rst b/src/axom/sidre/docs/sphinx/core_concepts.rst index a204ff29a7..cb823dd83a 100644 --- a/src/axom/sidre/docs/sphinx/core_concepts.rst +++ b/src/axom/sidre/docs/sphinx/core_concepts.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/data_vs_metadata.rst b/src/axom/sidre/docs/sphinx/data_vs_metadata.rst index 2c155dba21..1fd655f5e6 100644 --- a/src/axom/sidre/docs/sphinx/data_vs_metadata.rst +++ b/src/axom/sidre/docs/sphinx/data_vs_metadata.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/datastore.rst b/src/axom/sidre/docs/sphinx/datastore.rst index 17d32eb0a5..6cf5f8c06c 100644 --- a/src/axom/sidre/docs/sphinx/datastore.rst +++ b/src/axom/sidre/docs/sphinx/datastore.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -17,6 +17,12 @@ does is create the datastore object; this operation also creates the root group. Apart from providing access to the root group, a datastore provides methods to retrieve and interact with buffers and attributes. +The ``DataStore`` class provides methods to retrieve error state and messages +arising from I/O errors reading or writing ``Group`` data: + + * Query or set Conduit error flag + * Query, append, or clear exception messages from a Conduit I/O error + .. note:: ``Buffer`` and ``Attribute`` objects can only be created and destroyed using ``DataStore`` methods noted below. The ``Buffer`` and ``Attribute`` class constructors and destructors are private. diff --git a/src/axom/sidre/docs/sphinx/file_io.rst b/src/axom/sidre/docs/sphinx/file_io.rst index 9ea691c2c5..30e81d6c66 100644 --- a/src/axom/sidre/docs/sphinx/file_io.rst +++ b/src/axom/sidre/docs/sphinx/file_io.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -39,7 +39,8 @@ can be suppressed by passing a Boolean value of true as the ``preserve_contents`` argument to the ``load()`` method, resulting in the current group subtree being merged with the file contents. -Usage of the ``save()`` and ``load()`` methods is shown in the following example. +Usage of the ``save()`` and ``load()`` methods is shown in the following example, +which omits error-checking and recovery for brevity and clarity. .. literalinclude:: ../../examples/sidre_createdatastore.cpp :start-after: _serial_io_save_start @@ -55,6 +56,14 @@ Overloads of the ``save()`` and ``load()`` methods that take HDF5 handles and the ``loadExternalData()`` method are used to implement parallel I/O through the Sidre ``IOManager`` class. +The ``save()``, ``load()``, and ``loadExternalData()`` methods return +a bool value indicating success or failure. If no Conduit error +occurred, the return value is true. If an error occurred, the method +returns false. The error state and accumulated messages are stored in +the ``DataStore`` object that owns the ``Group``. In the course of +recovering from the error, the user can clear the error flag and +messages from the ``DataStore``. + Please see `Sidre API Documentation <../../../../doxygen/html/sidretop.html>`_ for more detailed description of these ``Group`` class methods and the Sidre I/O protocols that can be used with them. diff --git a/src/axom/sidre/docs/sphinx/first_example.rst b/src/axom/sidre/docs/sphinx/first_example.rst index 5e4db6e948..612925c3da 100644 --- a/src/axom/sidre/docs/sphinx/first_example.rst +++ b/src/axom/sidre/docs/sphinx/first_example.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/group.rst b/src/axom/sidre/docs/sphinx/group.rst index c3a0531ac7..fceef14ea7 100644 --- a/src/axom/sidre/docs/sphinx/group.rst +++ b/src/axom/sidre/docs/sphinx/group.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/index.rst b/src/axom/sidre/docs/sphinx/index.rst index 1a2fb588b6..fa133c317b 100644 --- a/src/axom/sidre/docs/sphinx/index.rst +++ b/src/axom/sidre/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/mfem_sidre_datacollection.rst b/src/axom/sidre/docs/sphinx/mfem_sidre_datacollection.rst index c1bae2c974..c0ef94cb72 100644 --- a/src/axom/sidre/docs/sphinx/mfem_sidre_datacollection.rst +++ b/src/axom/sidre/docs/sphinx/mfem_sidre_datacollection.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/parallel_io_concepts.rst b/src/axom/sidre/docs/sphinx/parallel_io_concepts.rst index ac6083b681..7a03d6bc4d 100644 --- a/src/axom/sidre/docs/sphinx/parallel_io_concepts.rst +++ b/src/axom/sidre/docs/sphinx/parallel_io_concepts.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/query_data.rst b/src/axom/sidre/docs/sphinx/query_data.rst index b0543cf662..cd4e173b13 100644 --- a/src/axom/sidre/docs/sphinx/query_data.rst +++ b/src/axom/sidre/docs/sphinx/query_data.rst @@ -1,9 +1,9 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) -.. _dataconcepts-label: +.. _datastore-queries-label: =========================== Datastore Queries diff --git a/src/axom/sidre/docs/sphinx/sidre_conduit.rst b/src/axom/sidre/docs/sphinx/sidre_conduit.rst index d1e0cd4eb0..f8cbd14fae 100644 --- a/src/axom/sidre/docs/sphinx/sidre_conduit.rst +++ b/src/axom/sidre/docs/sphinx/sidre_conduit.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/docs/sphinx/view.rst b/src/axom/sidre/docs/sphinx/view.rst index cb2fb660be..41d2ab7c1c 100644 --- a/src/axom/sidre/docs/sphinx/view.rst +++ b/src/axom/sidre/docs/sphinx/view.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/CMakeLists.txt b/src/axom/sidre/examples/CMakeLists.txt index 2e51d518e1..86f81d9145 100644 --- a/src/axom/sidre/examples/CMakeLists.txt +++ b/src/axom/sidre/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/lulesh2/CMakeLists.txt b/src/axom/sidre/examples/lulesh2/CMakeLists.txt index 9e7b87b8bc..ea93d531a7 100644 --- a/src/axom/sidre/examples/lulesh2/CMakeLists.txt +++ b/src/axom/sidre/examples/lulesh2/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/lulesh2/lulesh-comm.cc b/src/axom/sidre/examples/lulesh2/lulesh-comm.cc index ddb6fe41f3..22771af438 100644 --- a/src/axom/sidre/examples/lulesh2/lulesh-comm.cc +++ b/src/axom/sidre/examples/lulesh2/lulesh-comm.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/lulesh2/lulesh-init.cc b/src/axom/sidre/examples/lulesh2/lulesh-init.cc index 94963fc6bc..80828a3617 100644 --- a/src/axom/sidre/examples/lulesh2/lulesh-init.cc +++ b/src/axom/sidre/examples/lulesh2/lulesh-init.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -192,6 +192,23 @@ Domain::Domain(Int_t numRanks, Index_t colLoc, } // End constructor +Domain::~Domain() +{ +#ifdef AXOM_USE_MPI + delete [] commDataSend; + delete [] commDataRecv; +#endif + + delete [] m_regElemSize; + delete [] m_regNumList; + + for (Index_t i=0 ; i= regBinEnd[i]) - i++; + i++; //rotate the regions based on MPI rank. Rotation is Rank % NumRegions this makes each domain have a different region with //the highest representation - regionNum = ((i + myRank) % numReg()) + 1; - // make sure we don't pick the same region twice in a row + regionNum = ((i + myRank) % numReg()) + 1; + // make sure we don't pick the same region twice in a row while(regionNum == lastReg) { - regionVar = rand() % costDenominator; - i = 0; + regionVar = rand() % costDenominator; + i = 0; while(regionVar >= regBinEnd[i]) - i++; - regionNum = ((i + myRank) % numReg()) + 1; + i++; + regionNum = ((i + myRank) % numReg()) + 1; } - //Pick the bin size of the region and determine the number of elements. + + //Pick the bin size of the region and determine the number of elements. binSize = rand() % 1000; - if(binSize < 773) { - elements = rand() % 15 + 1; - } - else if(binSize < 937) { - elements = rand() % 16 + 16; - } - else if(binSize < 970) { - elements = rand() % 32 + 32; - } - else if(binSize < 974) { - elements = rand() % 64 + 64; - } - else if(binSize < 978) { - elements = rand() % 128 + 128; - } - else if(binSize < 981) { - elements = rand() % 256 + 256; - } - else - elements = rand() % 1537 + 512; - runto = elements + nextIndex; - //Store the elements. If we hit the end before we run out of elements then just stop. + if(binSize < 773) { elements = rand() % 15 + 1; } + else if(binSize < 937) { elements = rand() % 16 + 16; } + else if(binSize < 970) { elements = rand() % 32 + 32; } + else if(binSize < 974) { elements = rand() % 64 + 64; } + else if(binSize < 978) { elements = rand() % 128 + 128; } + else if(binSize < 981) { elements = rand() % 256 + 256; } + else { elements = rand() % 1537 + 512;} + + runto = elements + nextIndex; + //Store the elements. If we hit the end before we run out of elements then just stop. while (nextIndex < runto && nextIndex < numElem()) { - this->regNumList(nextIndex) = regionNum; - nextIndex++; - } - lastReg = regionNum; + this->regNumList(nextIndex) = regionNum; + nextIndex++; + } + lastReg = regionNum; } + + delete [] regBinEnd; } // Convert regNumList to region index sets // First, count size of each region @@ -507,6 +515,8 @@ Domain::CreateRegionIndexSets(Int_t nr, Int_t balance) Index_t regndx = regElemSize(r)++; // Note increment regElemlist(r,regndx) = i; } + + } diff --git a/src/axom/sidre/examples/lulesh2/lulesh-util.cc b/src/axom/sidre/examples/lulesh2/lulesh-util.cc index 14e2c585ae..0e69586da0 100644 --- a/src/axom/sidre/examples/lulesh2/lulesh-util.cc +++ b/src/axom/sidre/examples/lulesh2/lulesh-util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/lulesh2/lulesh-viz.cc b/src/axom/sidre/examples/lulesh2/lulesh-viz.cc index 941ce7e768..bb56ddabc9 100644 --- a/src/axom/sidre/examples/lulesh2/lulesh-viz.cc +++ b/src/axom/sidre/examples/lulesh2/lulesh-viz.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/lulesh2/lulesh.cc b/src/axom/sidre/examples/lulesh2/lulesh.cc index a01fe440d0..8a7b8f43e3 100644 --- a/src/axom/sidre/examples/lulesh2/lulesh.cc +++ b/src/axom/sidre/examples/lulesh2/lulesh.cc @@ -2776,7 +2776,7 @@ void LagrangeLeapFrog(Domain& domain) int main(int argc, char *argv[]) { - Domain *locDom ; + Domain *locDom ; Int_t numRanks ; Int_t myRank ; struct cmdLineOpts opts; @@ -2895,6 +2895,8 @@ int main(int argc, char *argv[]) VerifyAndWriteFinalOutput(elapsed_timeG, *locDom, opts.nx, numRanks); } + delete locDom; + #ifdef AXOM_USE_MPI MPI_Finalize() ; #endif diff --git a/src/axom/sidre/examples/lulesh2/lulesh.h b/src/axom/sidre/examples/lulesh2/lulesh.h index 06d931f3b8..8b4134c466 100644 --- a/src/axom/sidre/examples/lulesh2/lulesh.h +++ b/src/axom/sidre/examples/lulesh2/lulesh.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -166,6 +166,9 @@ class Domain Index_t rowLoc, Index_t planeLoc, Index_t nx, Int_t tp, Int_t nr, Int_t balance, Int_t cost); + // Destructor + ~Domain(); + // // ALLOCATION // @@ -584,8 +587,8 @@ class Domain #ifdef AXOM_USE_MPI // Communication Work space - Real_t * commDataSend; - Real_t * commDataRecv; + Real_t * commDataSend {nullptr}; + Real_t * commDataRecv {nullptr}; // Maximum number of block neighbors MPI_Request recvRequest[26]; // 6 faces + 12 edges + 8 corners @@ -639,9 +642,9 @@ class Domain // Region information Int_t m_numReg; Int_t m_cost; //imbalance cost - Index_t * m_regElemSize; // Size of region sets - Index_t * m_regNumList; // Region number per domain element - Index_t * * m_regElemlist; // region indexset + Index_t * m_regElemSize {nullptr}; // Size of region sets + Index_t * m_regNumList {nullptr}; // Region number per domain element + Index_t * * m_regElemlist {nullptr}; // region indexset luleshIndexData m_nodelist; /* elemToNode connectivity */ diff --git a/src/axom/sidre/examples/lulesh2/lulesh_tuple.h b/src/axom/sidre/examples/lulesh2/lulesh_tuple.h index 5797ba52eb..5863996421 100644 --- a/src/axom/sidre/examples/lulesh2/lulesh_tuple.h +++ b/src/axom/sidre/examples/lulesh2/lulesh_tuple.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/sidre_array.cpp b/src/axom/sidre/examples/sidre_array.cpp index 5cdeeef3c6..85734e737b 100644 --- a/src/axom/sidre/examples/sidre_array.cpp +++ b/src/axom/sidre/examples/sidre_array.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/sidre_createdatastore.cpp b/src/axom/sidre/examples/sidre_createdatastore.cpp index f3e001d8db..06be92f44e 100644 --- a/src/axom/sidre/examples/sidre_createdatastore.cpp +++ b/src/axom/sidre/examples/sidre_createdatastore.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -8,8 +8,7 @@ * Sidre classes to construct a hierarchical data store and save it to * a file. (This example does not use the parallel I/O facility.) * This also shows how to use Sidre with Conduit to generate and save a - * data store using the Mesh Blueprint, for easy data exchange and - * visualization. + * data store using the Mesh Blueprint, for easy data exchange and visualization. */ /* @@ -87,24 +86,23 @@ #include // "using" directives to simplify code -using namespace axom; -using namespace sidre; +namespace sidre = axom::sidre; -DataStore* create_datastore(int* region) +std::unique_ptr create_datastore(int* region) { // _first_example_creategroups_start // Create Sidre datastore object and get root group - DataStore* ds = new DataStore(); - Group* root = ds->getRoot(); + auto ds = std::unique_ptr {new sidre::DataStore()}; + sidre::Group* root = ds->getRoot(); // Create two attributes ds->createAttributeScalar("vis", 0); ds->createAttributeScalar("restart", 1); // Create group children of root group - Group* state = root->createGroup("state"); - Group* nodes = root->createGroup("nodes"); - Group* fields = root->createGroup("fields"); + sidre::Group* state = root->createGroup("state"); + sidre::Group* nodes = root->createGroup("nodes"); + sidre::Group* fields = root->createGroup("fields"); // _first_example_creategroups_end // _first_example_state_start @@ -125,7 +123,8 @@ DataStore* create_datastore(int* region) // holds 3 * nodecount doubles. These views might describe the location of // each node in a 16 x 16 x 16 hexahedron mesh. Each view is described by // number of elements, offset, and stride into that data. - Buffer* buff = ds->createBuffer(sidre::DOUBLE_ID, 3 * nodecount)->allocate(); + sidre::Buffer* buff = + ds->createBuffer(sidre::DOUBLE_ID, 3 * nodecount)->allocate(); nodes->createView("x", buff)->apply(sidre::DOUBLE_ID, nodecount, 0, 3); nodes->createView("y", buff)->apply(sidre::DOUBLE_ID, nodecount, 1, 3); nodes->createView("z", buff)->apply(sidre::DOUBLE_ID, nodecount, 2, 3); @@ -139,8 +138,10 @@ DataStore* create_datastore(int* region) // object. Likewise with "rho." Both Views have the default offset (0) // and stride (1). These Views could point to data associated with // each of the 15 x 15 x 15 hexahedron elements defined by the nodes above. - View* temp = fields->createViewAndAllocate("temp", sidre::DOUBLE_ID, eltcount); - View* rho = fields->createViewAndAllocate("rho", sidre::DOUBLE_ID, eltcount); + sidre::View* temp = + fields->createViewAndAllocate("temp", sidre::DOUBLE_ID, eltcount); + sidre::View* rho = + fields->createViewAndAllocate("rho", sidre::DOUBLE_ID, eltcount); // Explicitly set values for the "vis" Attribute on the "temp" and "rho" // buffers. @@ -150,7 +151,7 @@ DataStore* create_datastore(int* region) // The "fields" Group also contains a child Group "ext" which holds a pointer // to an externally owned integer array. Although Sidre does not own the // data, the data can still be described to Sidre. - Group* ext = fields->createGroup("ext"); + sidre::Group* ext = fields->createGroup("ext"); // int * region has been passed in as a function argument. As with "temp" // and "rho", view "region" has default offset and stride. ext->createView("region", region)->apply(sidre::INT_ID, eltcount); @@ -159,18 +160,18 @@ DataStore* create_datastore(int* region) return ds; } -void access_datastore(DataStore* ds) +void access_datastore(sidre::DataStore* ds) { // _first_example_access_start // Retrieve Group pointers - Group* root = ds->getRoot(); - Group* state = root->getGroup("state"); - Group* nodes = root->getGroup("nodes"); - Group* fields = root->getGroup("fields"); + sidre::Group* root = ds->getRoot(); + sidre::Group* state = root->getGroup("state"); + sidre::Group* nodes = root->getGroup("nodes"); + sidre::Group* fields = root->getGroup("fields"); // Accessing a Group that is not there gives a null pointer // Requesting a nonexistent View also gives a null pointer - Group* goofy = root->getGroup("goofy"); + sidre::Group* goofy = root->getGroup("goofy"); if(goofy == nullptr) { std::cout << "no such group: goofy" << std::endl; @@ -206,9 +207,9 @@ void access_datastore(DataStore* ds) AXOM_UNUSED_VAR(region); } -void iterate_datastore(DataStore* ds) +void iterate_datastore(sidre::DataStore* ds) { - const std::string fill_line = fmt::format("{:=^80}", ""); + const std::string fill_line = axom::fmt::format("{:=^80}", ""); std::cout << fill_line << std::endl; @@ -216,11 +217,12 @@ void iterate_datastore(DataStore* ds) std::cout << "The datastore has the following attributes:\n"; for(auto& attr : ds->attributes()) { - std::cout << fmt::format(" * [{}] '{}' of type {} and default value: {}\n", - attr.getIndex(), - attr.getName(), - conduit::DataType::id_to_name(attr.getTypeID()), - attr.getDefaultNodeRef().to_yaml()); + std::cout << axom::fmt::format( + " * [{}] '{}' of type {} and default value: {}\n", + attr.getIndex(), + attr.getName(), + conduit::DataType::id_to_name(attr.getTypeID()), + attr.getDefaultNodeRef().to_yaml()); } std::cout << fill_line << std::endl; @@ -229,7 +231,7 @@ void iterate_datastore(DataStore* ds) std::cout << "The datastore has the following buffers:\n"; for(auto& buff : ds->buffers()) { - std::cout << fmt::format( + std::cout << axom::fmt::format( " * [{}] {} buffer with {} elements of type {} with {} views\n", buff.getIndex(), buff.isAllocated() ? "Allocated" : "Unallocated", @@ -244,11 +246,12 @@ void iterate_datastore(DataStore* ds) std::cout << "The root group has the following groups:\n"; for(auto& grp : ds->getRoot()->groups()) { - std::cout << fmt::format(" * [{}] '{}' with {} groups and {} views\n", - grp.getIndex(), - grp.getName(), - grp.getNumGroups(), - grp.getNumViews()); + std::cout << axom::fmt::format( + " * [{}] '{}' with {} groups and {} views\n", + grp.getIndex(), + grp.getName(), + grp.getNumGroups(), + grp.getNumViews()); } std::cout << fill_line << std::endl; @@ -257,7 +260,7 @@ void iterate_datastore(DataStore* ds) std::cout << "The 'state' group has the following views:\n"; for(auto& view : ds->getRoot()->getGroup("state")->views()) { - std::cout << fmt::format( + std::cout << axom::fmt::format( " * [{}] '{}' -- {} view of type {} and {} elements\n", view.getIndex(), view.getName(), @@ -269,24 +272,27 @@ void iterate_datastore(DataStore* ds) std::cout << fill_line << std::endl; } -DataStore* create_tiny_datastore() +std::unique_ptr create_tiny_datastore() { // _tiny_create_start - DataStore* ds = new DataStore(); + auto ds = std::unique_ptr {new sidre::DataStore()}; int nodecount = 12; int elementcount = 2; // Create views and buffers to hold node positions and field values - Group* nodes = ds->getRoot()->createGroup("nodes"); - View* xs = nodes->createViewAndAllocate("xs", sidre::DOUBLE_ID, nodecount); - View* ys = nodes->createViewAndAllocate("ys", sidre::DOUBLE_ID, nodecount); - View* zs = nodes->createViewAndAllocate("zs", sidre::DOUBLE_ID, nodecount); - - Group* fields = ds->getRoot()->createGroup("fields"); - View* nodefield = + sidre::Group* nodes = ds->getRoot()->createGroup("nodes"); + sidre::View* xs = + nodes->createViewAndAllocate("xs", sidre::DOUBLE_ID, nodecount); + sidre::View* ys = + nodes->createViewAndAllocate("ys", sidre::DOUBLE_ID, nodecount); + sidre::View* zs = + nodes->createViewAndAllocate("zs", sidre::DOUBLE_ID, nodecount); + + sidre::Group* fields = ds->getRoot()->createGroup("fields"); + sidre::View* nodefield = fields->createViewAndAllocate("nodefield", sidre::INT_ID, nodecount); - View* eltfield = + sidre::View* eltfield = fields->createViewAndAllocate("eltfield", sidre::DOUBLE_ID, elementcount); // Set node position for two adjacent hexahedrons @@ -316,14 +322,14 @@ DataStore* create_tiny_datastore() // _tiny_create_end } -void setup_blueprint_coords(DataStore* ds, Group* coords) +void setup_blueprint_coords(sidre::DataStore* ds, sidre::Group* coords) { // _blueprint_restructure_coords_start // Set up the coordinates as Mesh Blueprint requires coords->createViewString("type", "explicit"); // We use prior knowledge of the layout of the original datastore - View* origv = ds->getRoot()->getView("nodes/xs"); - Group* conduitval = coords->createGroup("values"); + sidre::View* origv = ds->getRoot()->getView("nodes/xs"); + sidre::Group* conduitval = coords->createGroup("values"); conduitval->createView("x", sidre::DOUBLE_ID, origv->getNumElements(), @@ -341,14 +347,14 @@ void setup_blueprint_coords(DataStore* ds, Group* coords) // _blueprint_restructure_coords_end } -void setup_blueprint_external_coords(DataStore* ds, Group* coords) +void setup_blueprint_external_coords(sidre::DataStore* ds, sidre::Group* coords) { // _blueprint_external_coords_start // Set up the coordinates as Mesh Blueprint requires coords->createViewString("type", "explicit"); // We use prior knowledge of the layout of the original datastore - View* origv = ds->getRoot()->getView("nodes/xs"); - Group* conduitval = coords->createGroup("values"); + sidre::View* origv = ds->getRoot()->getView("nodes/xs"); + sidre::Group* conduitval = coords->createGroup("values"); conduitval->createView("x", sidre::DOUBLE_ID, origv->getNumElements(), @@ -366,18 +372,18 @@ void setup_blueprint_external_coords(DataStore* ds, Group* coords) // _blueprint_external_coords_end } -void setup_blueprint_topos(DataStore* ds, Group* topos) +void setup_blueprint_topos(sidre::DataStore* ds, sidre::Group* topos) { // _blueprint_restructure_topo_start // Sew the nodes together into the two hexahedra, using prior knowledge. - Group* connmesh = topos->createGroup("mesh"); + sidre::Group* connmesh = topos->createGroup("mesh"); connmesh->createViewString("type", "unstructured"); connmesh->createViewString("coordset", "coords"); - Group* elts = connmesh->createGroup("elements"); + sidre::Group* elts = connmesh->createGroup("elements"); elts->createViewString("shape", "hex"); // We have two eight-node hex elements, so we need 2 * 8 = 16 ints. - View* connectivity = + sidre::View* connectivity = elts->createViewAndAllocate("connectivity", sidre::INT_ID, 16); // The Mesh Blueprint connectivity array for a hexahedron lists four nodes on @@ -415,13 +421,13 @@ void setup_blueprint_topos(DataStore* ds, Group* topos) AXOM_UNUSED_VAR(ds); } -void setup_blueprint_fields(DataStore* ds, Group* fields) +void setup_blueprint_fields(sidre::DataStore* ds, sidre::Group* fields) { // _blueprint_restructure_field_start // Set up the node-centered field // Get the original data - View* origv = ds->getRoot()->getView("fields/nodefield"); - Group* nodefield = fields->createGroup("nodefield"); + sidre::View* origv = ds->getRoot()->getView("fields/nodefield"); + sidre::Group* nodefield = fields->createGroup("nodefield"); nodefield->createViewString("association", "vertex"); nodefield->createViewString("type", "scalar"); nodefield->createViewString("topology", "mesh"); @@ -433,7 +439,7 @@ void setup_blueprint_fields(DataStore* ds, Group* fields) // Set up the element-centered field // Get the original data origv = ds->getRoot()->getView("fields/eltfield"); - Group* eltfield = fields->createGroup("eltfield"); + sidre::Group* eltfield = fields->createGroup("eltfield"); eltfield->createViewString("association", "element"); eltfield->createViewString("type", "scalar"); eltfield->createViewString("topology", "mesh"); @@ -444,13 +450,13 @@ void setup_blueprint_fields(DataStore* ds, Group* fields) // _blueprint_restructure_field_end } -void setup_blueprint_external_fields(DataStore* ds, Group* fields) +void setup_blueprint_external_fields(sidre::DataStore* ds, sidre::Group* fields) { // _blueprint_external_field_start // Set up the node-centered field // Get the original data - View* origv = ds->getRoot()->getView("fields/nodefield"); - Group* nodefield = fields->createGroup("nodefield"); + sidre::View* origv = ds->getRoot()->getView("fields/nodefield"); + sidre::Group* nodefield = fields->createGroup("nodefield"); nodefield->createViewString("association", "vertex"); nodefield->createViewString("type", "scalar"); nodefield->createViewString("topology", "mesh"); @@ -462,7 +468,7 @@ void setup_blueprint_external_fields(DataStore* ds, Group* fields) // Set up the element-centered field // Get the original data origv = ds->getRoot()->getView("fields/eltfield"); - Group* eltfield = fields->createGroup("eltfield"); + sidre::Group* eltfield = fields->createGroup("eltfield"); eltfield->createViewString("association", "element"); eltfield->createViewString("type", "scalar"); eltfield->createViewString("topology", "mesh"); @@ -473,7 +479,7 @@ void setup_blueprint_external_fields(DataStore* ds, Group* fields) // _blueprint_external_field_end } -void save_as_blueprint(DataStore* ds) +void save_as_blueprint(sidre::DataStore* ds) { // _blueprint_restructure_toplevel_start // Conduit needs a specific hierarchy. @@ -482,11 +488,11 @@ void save_as_blueprint(DataStore* ds) std::string mesh_name = "tinymesh"; // The Conduit specifies top-level groups: - Group* mroot = ds->getRoot()->createGroup(mesh_name); - Group* coords = mroot->createGroup("coordsets/coords"); - Group* topos = mroot->createGroup("topologies"); + sidre::Group* mroot = ds->getRoot()->createGroup(mesh_name); + sidre::Group* coords = mroot->createGroup("coordsets/coords"); + sidre::Group* topos = mroot->createGroup("topologies"); // no material sets in this example - Group* fields = mroot->createGroup("fields"); + sidre::Group* fields = mroot->createGroup("fields"); // no adjacency sets in this (single-domain) example // _blueprint_restructure_toplevel_end @@ -532,7 +538,7 @@ void save_as_blueprint(DataStore* ds) // _blueprint_restructure_save_end } -void generate_blueprint(DataStore* ds) +void generate_blueprint(sidre::DataStore* ds) { // _blueprint_generate_toplevel_start // Conduit needs a specific hierarchy. @@ -543,11 +549,11 @@ void generate_blueprint(DataStore* ds) std::string mesh_name = "mesh"; std::string domain_mesh = domain_location + "/" + mesh_name; - Group* mroot = ds->getRoot()->createGroup(domain_location); - Group* coords = mroot->createGroup(mesh_name + "/coordsets/coords"); - Group* topos = mroot->createGroup(mesh_name + "/topologies"); + sidre::Group* mroot = ds->getRoot()->createGroup(domain_location); + sidre::Group* coords = mroot->createGroup(mesh_name + "/coordsets/coords"); + sidre::Group* topos = mroot->createGroup(mesh_name + "/topologies"); // no material sets in this example - Group* fields = mroot->createGroup(mesh_name + "/fields"); + sidre::Group* fields = mroot->createGroup(mesh_name + "/fields"); // no adjacency sets in this (single-domain) example // _blueprint_generate_toplevel_end @@ -567,7 +573,7 @@ void generate_blueprint(DataStore* ds) ds->generateBlueprintIndex(domain_mesh, mesh_name, bp, 1); - Group* rootfile_grp = ds->getRoot()->getGroup("rootfile_data"); + sidre::Group* rootfile_grp = ds->getRoot()->getGroup("rootfile_data"); rootfile_grp->createViewString("protocol/name", "json"); rootfile_grp->createViewString("protocol/version", "0.1"); rootfile_grp->createViewScalar("number_of_files", 1); @@ -587,7 +593,7 @@ void generate_blueprint(DataStore* ds) // _blueprint_generate_save_end } -void generate_blueprint_to_path(DataStore* ds) +void generate_blueprint_to_path(sidre::DataStore* ds) { // _blueprint_generate_path_start // Conduit needs a specific hierarchy. @@ -598,11 +604,11 @@ void generate_blueprint_to_path(DataStore* ds) std::string mesh_name = "pathmesh"; std::string domain_mesh = domain_location + "/" + mesh_name; - Group* mroot = ds->getRoot()->createGroup(domain_location); - Group* coords = mroot->createGroup(mesh_name + "/coordsets/coords"); - Group* topos = mroot->createGroup(mesh_name + "/topologies"); + sidre::Group* mroot = ds->getRoot()->createGroup(domain_location); + sidre::Group* coords = mroot->createGroup(mesh_name + "/coordsets/coords"); + sidre::Group* topos = mroot->createGroup(mesh_name + "/topologies"); // no material sets in this example - Group* fields = mroot->createGroup(mesh_name + "/fields"); + sidre::Group* fields = mroot->createGroup(mesh_name + "/fields"); // no adjacency sets in this (single-domain) example // _blueprint_generate_path_end @@ -622,7 +628,7 @@ void generate_blueprint_to_path(DataStore* ds) ds->generateBlueprintIndex(domain_mesh, mesh_name, bp, 1); - Group* rootfile_grp = ds->getRoot()->getGroup("rootfile_data"); + sidre::Group* rootfile_grp = ds->getRoot()->getGroup("rootfile_data"); rootfile_grp->createViewString("protocol/name", "json"); rootfile_grp->createViewString("protocol/version", "0.1"); rootfile_grp->createViewScalar("number_of_files", 1); @@ -643,7 +649,7 @@ void generate_blueprint_to_path(DataStore* ds) } #ifdef AXOM_USE_MPI -void generate_spio_blueprint(DataStore* ds) +void generate_spio_blueprint(sidre::DataStore* ds) { int comm_size; MPI_Comm_size(MPI_COMM_WORLD, &comm_size); @@ -654,11 +660,11 @@ void generate_spio_blueprint(DataStore* ds) std::string mesh_name = "mesh"; std::string domain_mesh = domain_location + "/" + mesh_name; - Group* mroot = ds->getRoot()->createGroup(domain_location); - Group* coords = mroot->createGroup(mesh_name + "/coordsets/coords"); - Group* topos = mroot->createGroup(mesh_name + "/topologies"); + sidre::Group* mroot = ds->getRoot()->createGroup(domain_location); + sidre::Group* coords = mroot->createGroup(mesh_name + "/coordsets/coords"); + sidre::Group* topos = mroot->createGroup(mesh_name + "/topologies"); // no material sets in this example - Group* fields = mroot->createGroup(mesh_name + "/fields"); + sidre::Group* fields = mroot->createGroup(mesh_name + "/fields"); // no adjacency sets in this (single-domain) example // _blueprint_spio_toplevel_end @@ -669,7 +675,7 @@ void generate_spio_blueprint(DataStore* ds) setup_blueprint_fields(ds, fields); // _blueprint_generate_spio_start - IOManager writer(MPI_COMM_WORLD); + sidre::IOManager writer(MPI_COMM_WORLD); conduit::Node info, mesh_node, root_node; ds->getRoot()->createNativeLayout(mesh_node); @@ -699,7 +705,7 @@ void generate_spio_blueprint(DataStore* ds) // _blueprint_generate_spio_end } -void generate_spio_blueprint_to_path(DataStore* ds) +void generate_spio_blueprint_to_path(sidre::DataStore* ds) { int comm_size; MPI_Comm_size(MPI_COMM_WORLD, &comm_size); @@ -710,11 +716,11 @@ void generate_spio_blueprint_to_path(DataStore* ds) std::string mesh_name = "spiopathmesh"; std::string domain_mesh = domain_location + "/" + mesh_name; - Group* mroot = ds->getRoot()->createGroup(domain_location); - Group* coords = mroot->createGroup(mesh_name + "/coordsets/coords"); - Group* topos = mroot->createGroup(mesh_name + "/topologies"); + sidre::Group* mroot = ds->getRoot()->createGroup(domain_location); + sidre::Group* coords = mroot->createGroup(mesh_name + "/coordsets/coords"); + sidre::Group* topos = mroot->createGroup(mesh_name + "/topologies"); // no material sets in this example - Group* fields = mroot->createGroup(mesh_name + "/fields"); + sidre::Group* fields = mroot->createGroup(mesh_name + "/fields"); // no adjacency sets in this (single-domain) example // _blueprint_spio_path_end @@ -725,7 +731,7 @@ void generate_spio_blueprint_to_path(DataStore* ds) setup_blueprint_external_fields(ds, fields); // _blueprint_generate_spio_path_start - IOManager writer(MPI_COMM_WORLD); + sidre::IOManager writer(MPI_COMM_WORLD); conduit::Node info, mesh_node, root_node; ds->getRoot()->createNativeLayout(mesh_node); @@ -759,7 +765,7 @@ void generate_spio_blueprint_to_path(DataStore* ds) } #endif -void serial_save_datastore_and_load_copy_lower(DataStore* ds) +void serial_save_datastore_and_load_copy_lower(sidre::DataStore* ds) { #if defined(AXOM_USE_HDF5) std::string protocol = "sidre_hdf5"; @@ -775,7 +781,7 @@ void serial_save_datastore_and_load_copy_lower(DataStore* ds) ds->getRoot()->save(filename, protocol); // Delete the data hierarchy under the root, then load it from the file ds->getRoot()->load(filename, protocol); - Group* additional = ds->getRoot()->createGroup("additional"); + sidre::Group* additional = ds->getRoot()->createGroup("additional"); additional->createGroup("yetanother"); // Load another copy of the data store into the "additional" group // without first clearing all its contents @@ -796,24 +802,24 @@ int main(int argc, char** argv) MPI_Init(&argc, &argv); #endif - DataStore* ds = create_datastore(region); - access_datastore(ds); - iterate_datastore(ds); + auto ds = create_datastore(region); + access_datastore(ds.get()); + iterate_datastore(ds.get()); - DataStore* tds = create_tiny_datastore(); - save_as_blueprint(tds); + auto tds = create_tiny_datastore(); + save_as_blueprint(tds.get()); - DataStore* bds = create_tiny_datastore(); - generate_blueprint(bds); + auto bds = create_tiny_datastore(); + generate_blueprint(bds.get()); - DataStore* pds = create_tiny_datastore(); - generate_blueprint_to_path(pds); + auto pds = create_tiny_datastore(); + generate_blueprint_to_path(pds.get()); #ifdef AXOM_USE_MPI - DataStore* sds = create_tiny_datastore(); - DataStore* spds = create_tiny_datastore(); - generate_spio_blueprint(sds); - generate_spio_blueprint_to_path(spds); + auto sds = create_tiny_datastore(); + auto spds = create_tiny_datastore(); + generate_spio_blueprint(sds.get()); + generate_spio_blueprint_to_path(spds.get()); MPI_Finalize(); #endif diff --git a/src/axom/sidre/examples/sidre_data_vs_metadata.cpp b/src/axom/sidre/examples/sidre_data_vs_metadata.cpp index 23f9a2ec48..8697f5f04a 100644 --- a/src/axom/sidre/examples/sidre_data_vs_metadata.cpp +++ b/src/axom/sidre/examples/sidre_data_vs_metadata.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/sidre_external_array.cpp b/src/axom/sidre/examples/sidre_external_array.cpp index e96ed149c3..68c570678b 100644 --- a/src/axom/sidre/examples/sidre_external_array.cpp +++ b/src/axom/sidre/examples/sidre_external_array.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/sidre_generateindex.cpp b/src/axom/sidre/examples/sidre_generateindex.cpp index ca2440d39b..ceb77868ab 100644 --- a/src/axom/sidre/examples/sidre_generateindex.cpp +++ b/src/axom/sidre/examples/sidre_generateindex.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -46,9 +46,9 @@ namespace sidre = axom::sidre; static int cart_nx = 5; // nodal domain x size for cartesian mesh example static int cart_ny = 5; // nodal domain y size for cartesian mesh example -sidre::DataStore* create_tiny_datastore() +std::unique_ptr create_tiny_datastore() { - sidre::DataStore* ds = new sidre::DataStore(); + auto ds = std::unique_ptr {new sidre::DataStore()}; int nodecount = 12; int elementcount = 2; @@ -518,50 +518,60 @@ int main(int argc, char** argv) MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &num_ranks); - sidre::DataStore* sds = create_tiny_datastore(); - sidre::DataStore* spds = create_tiny_datastore(); - generate_spio_blueprint(sds, true); //dense - generate_spio_blueprint(spds, false); //sparse + auto sds = create_tiny_datastore(); + generate_spio_blueprint(sds.get(), true); //dense + + auto spds = create_tiny_datastore(); + generate_spio_blueprint(spds.get(), false); //sparse spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); + spds = create_tiny_datastore(); - generate_multidomain_blueprint(spds, "multi1", 1, false); + generate_multidomain_blueprint(spds.get(), "multi1", 1, false); spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); + spds = create_tiny_datastore(); - generate_multidomain_blueprint(spds, "multi1_list", 1, true); + generate_multidomain_blueprint(spds.get(), "multi1_list", 1, true); if(num_ranks > 1) { spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); + spds = create_tiny_datastore(); - generate_multidomain_blueprint(spds, "multi2", 2, false); + generate_multidomain_blueprint(spds.get(), "multi2", 2, false); spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); + spds = create_tiny_datastore(); - generate_multidomain_blueprint(spds, "multi2_list", 2, true); + generate_multidomain_blueprint(spds.get(), "multi2_list", 2, true); spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); + spds = create_tiny_datastore(); - generate_multidomain_blueprint(spds, "multi_all", num_ranks, false); + generate_multidomain_blueprint(spds.get(), "multi_all", num_ranks, false); spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); + spds = create_tiny_datastore(); - generate_multidomain_blueprint(spds, "multi_all_list", num_ranks, true); + generate_multidomain_blueprint(spds.get(), "multi_all_list", num_ranks, true); } spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); - generate_cartesian_blueprint(spds, "cart1", 1); + + generate_cartesian_blueprint(spds.get(), "cart1", 1); if(num_ranks > 1) { spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); + spds = create_tiny_datastore(); - generate_cartesian_blueprint(spds, "cart2", 2); + generate_cartesian_blueprint(spds.get(), "cart2", 2); spds->getRoot()->destroyGroups(); spds->getRoot()->destroyViews(); + spds = create_tiny_datastore(); - generate_cartesian_blueprint(spds, "cart_all", num_ranks); + generate_cartesian_blueprint(spds.get(), "cart_all", num_ranks); } MPI_Finalize(); diff --git a/src/axom/sidre/examples/sidre_mfem_datacollection_materials.cpp b/src/axom/sidre/examples/sidre_mfem_datacollection_materials.cpp index 2d121fc04c..1d99e7560a 100644 --- a/src/axom/sidre/examples/sidre_mfem_datacollection_materials.cpp +++ b/src/axom/sidre/examples/sidre_mfem_datacollection_materials.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/sidre_mfem_datacollection_restart.cpp b/src/axom/sidre/examples/sidre_mfem_datacollection_restart.cpp index b43fa76669..73e96d33a9 100644 --- a/src/axom/sidre/examples/sidre_mfem_datacollection_restart.cpp +++ b/src/axom/sidre/examples/sidre_mfem_datacollection_restart.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -198,8 +198,7 @@ int main(int argc, char* argv[]) #endif // Initialize the datacollection - // Needs to be configured to own the mesh data so all mesh data is saved to datastore/output file - const bool owns_mesh_data = true; + const bool owns_mesh_data = false; axom::sidre::MFEMSidreDataCollection dc("sidre_mfem_datacoll_restart_ex", nullptr, owns_mesh_data); diff --git a/src/axom/sidre/examples/sidre_mfem_datacollection_vis.cpp b/src/axom/sidre/examples/sidre_mfem_datacollection_vis.cpp index cc063e7fc2..8302a697ea 100644 --- a/src/axom/sidre/examples/sidre_mfem_datacollection_vis.cpp +++ b/src/axom/sidre/examples/sidre_mfem_datacollection_vis.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/sidre_shocktube.cpp b/src/axom/sidre/examples/sidre_shocktube.cpp index 606fa52e5e..5b22a96761 100644 --- a/src/axom/sidre/examples/sidre_shocktube.cpp +++ b/src/axom/sidre/examples/sidre_shocktube.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -503,7 +503,7 @@ void DumpUltra(Group* const prob) sprintf(tail, "_%04d.ult", prob->getView("cycle")->getData()); - if((fp = fopen(fname, "w")) == NULL) + if((fp = fopen(fname, "w")) == nullptr) { printf("Could not open file %s. Aborting.\n", fname); exit(-1); diff --git a/src/axom/sidre/examples/sidre_shocktube_F.f b/src/axom/sidre/examples/sidre_shocktube_F.f index aa32949a7a..96e026eac6 100644 --- a/src/axom/sidre/examples/sidre_shocktube_F.f +++ b/src/axom/sidre/examples/sidre_shocktube_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/sidre_stressgroups.cpp b/src/axom/sidre/examples/sidre_stressgroups.cpp index 8a9b71449d..b56b791f47 100644 --- a/src/axom/sidre/examples/sidre_stressgroups.cpp +++ b/src/axom/sidre/examples/sidre_stressgroups.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/spio/CMakeLists.txt b/src/axom/sidre/examples/spio/CMakeLists.txt index 7283455107..d11dc5cc83 100644 --- a/src/axom/sidre/examples/spio/CMakeLists.txt +++ b/src/axom/sidre/examples/spio/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/spio/IORead.cpp b/src/axom/sidre/examples/spio/IORead.cpp index e104a15768..1653421034 100644 --- a/src/axom/sidre/examples/spio/IORead.cpp +++ b/src/axom/sidre/examples/spio/IORead.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/spio/IOWrite.cpp b/src/axom/sidre/examples/spio/IOWrite.cpp index eef2df00e4..0f0a9ea379 100644 --- a/src/axom/sidre/examples/spio/IOWrite.cpp +++ b/src/axom/sidre/examples/spio/IOWrite.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/spio/IO_SCR_Checkpoint.cpp b/src/axom/sidre/examples/spio/IO_SCR_Checkpoint.cpp index 0ef7698a55..ecf941b59b 100644 --- a/src/axom/sidre/examples/spio/IO_SCR_Checkpoint.cpp +++ b/src/axom/sidre/examples/spio/IO_SCR_Checkpoint.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/examples/spio/spio_scr.hpp b/src/axom/sidre/examples/spio/spio_scr.hpp index c4f3947946..3b487369dd 100644 --- a/src/axom/sidre/examples/spio/spio_scr.hpp +++ b/src/axom/sidre/examples/spio/spio_scr.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/interface/CMakeLists.txt b/src/axom/sidre/interface/CMakeLists.txt index 3a0cd57f06..d8045007ed 100644 --- a/src/axom/sidre/interface/CMakeLists.txt +++ b/src/axom/sidre/interface/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/interface/SidreTypes.h b/src/axom/sidre/interface/SidreTypes.h index 6ff058bf50..4cfac80909 100644 --- a/src/axom/sidre/interface/SidreTypes.h +++ b/src/axom/sidre/interface/SidreTypes.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/interface/c_fortran/csidresplicer.c b/src/axom/sidre/interface/c_fortran/csidresplicer.c index 267ceb560d..e3fe98db35 100644 --- a/src/axom/sidre/interface/c_fortran/csidresplicer.c +++ b/src/axom/sidre/interface/c_fortran/csidresplicer.c @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -13,6 +13,23 @@ ****************************************************************************** */ +// Into typesSidre.h +// splicer begin types.C_declarations +#include +// splicer end types.C_declarations + +// splicer begin C_declarations +#if 0 + #ifndef __cplusplus + #if defined(USE_64BIT_INDEXTYPE) +typedef int64_t IndexType; + #else +typedef int32_t IndexType; + #endif + #endif +#endif +// splicer end C_declarations + // splicer begin C_definitions // equivalent to C_LOC // called from Fortran diff --git a/src/axom/sidre/interface/c_fortran/fsidresplicer.f b/src/axom/sidre/interface/c_fortran/fsidresplicer.f index bba997c978..dbc8109c59 100644 --- a/src/axom/sidre/interface/c_fortran/fsidresplicer.f +++ b/src/axom/sidre/interface/c_fortran/fsidresplicer.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) @@ -35,12 +35,6 @@ ! splicer begin module_top integer, parameter :: MAXNAMESIZE = 128 -#if defined(AXOM_USE_64BIT_INDEXTYPE) && !defined(AXOM_NO_INT64_T) -integer, parameter :: SIDRE_IndexType = C_INT64_T -#else -integer, parameter :: SIDRE_IndexType = C_INT32_T -#endif - integer, parameter :: TypeID = C_SHORT integer, parameter :: TypeIDint = C_INT @@ -63,26 +57,26 @@ SIDRE_ULONG_ID = CONDUIT_ULONG_ID, & SIDRE_FLOAT_ID = CONDUIT_FLOAT_ID, & SIDRE_DOUBLE_ID = CONDUIT_DOUBLE_ID - -integer, parameter :: invalid_index = -1_SIDRE_IndexType ! splicer end module_top # SIDRE_create_fortran_allocatable_view is not in api.yaml since it is not in src/core and # only required for the fortran interface. -! splicer begin additional_interfaces -function SIDRE_create_array_view(group, name, lname, addr, type, rank, extents) & - result(rv) bind(C,name="SIDRE_create_array_view") - use iso_c_binding - import SIDRE_IndexType - type(C_PTR), value, intent(IN) :: group - character(kind=C_CHAR), intent(IN) :: name(*) - integer(C_INT), value, intent(IN) :: lname - type(C_PTR), value, intent(IN) :: addr - integer(C_INT), value, intent(IN) :: type - integer(C_INT), value, intent(IN) :: rank - integer(SIDRE_IndexType), intent(IN) :: extents(*) - type(C_PTR) rv -end function SIDRE_create_array_view -! splicer end additional_interfaces +! splicer begin additional_declarations +interface + function SIDRE_create_array_view(group, name, lname, addr, type, rank, extents) & + result(rv) bind(C,name="SIDRE_create_array_view") + use iso_c_binding + import SIDRE_IndexType + type(C_PTR), value, intent(IN) :: group + character(kind=C_CHAR), intent(IN) :: name(*) + integer(C_INT), value, intent(IN) :: lname + type(C_PTR), value, intent(IN) :: addr + integer(C_INT), value, intent(IN) :: type + integer(C_INT), value, intent(IN) :: rank + integer(SIDRE_IndexType), intent(IN) :: extents(*) + type(C_PTR) rv + end function SIDRE_create_array_view +end interface +! splicer end additional_declarations diff --git a/src/axom/sidre/interface/c_fortran/genfsidresplicer.py b/src/axom/sidre/interface/c_fortran/genfsidresplicer.py index 918988eec4..40f0c66c55 100644 --- a/src/axom/sidre/interface/c_fortran/genfsidresplicer.py +++ b/src/axom/sidre/interface/c_fortran/genfsidresplicer.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -37,7 +37,7 @@ def group_get_scalar(d): character(*), intent(IN) :: name {f_type}, intent(OUT) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -56,7 +56,7 @@ def group_set_scalar(d): character(*), intent(IN) :: name {f_type}, intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -133,7 +133,7 @@ def group_set_array_data_ptr(d): character(len=*), intent(IN) :: name {f_type}, target, intent(IN) :: value{shape} integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: {extents_decl} ! integer(C_INT), parameter :: type = {sidre_type} type(C_PTR) addr, viewptr @@ -368,7 +368,7 @@ def group_string(): character(*), intent(IN) :: name character(*), intent(OUT) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -382,7 +382,7 @@ def group_string(): character(*), intent(IN) :: name character(*), intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) diff --git a/src/axom/sidre/interface/c_fortran/typesSidre.h b/src/axom/sidre/interface/c_fortran/typesSidre.h index 3c59b7a458..20e56a9fbd 100644 --- a/src/axom/sidre/interface/c_fortran/typesSidre.h +++ b/src/axom/sidre/interface/c_fortran/typesSidre.h @@ -1,7 +1,7 @@ // typesSidre.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -10,10 +10,17 @@ #ifndef TYPESSIDRE_H #define TYPESSIDRE_H +// splicer begin types.CXX_declarations +// splicer end types.CXX_declarations + #ifdef __cplusplus extern "C" { #endif +// splicer begin types.C_declarations +#include +// splicer end types.C_declarations + // helper capsule_SIDRE_Buffer struct s_SIDRE_Buffer { diff --git a/src/axom/sidre/interface/c_fortran/wrapBuffer.cpp b/src/axom/sidre/interface/c_fortran/wrapBuffer.cpp index 516b17d8ae..07dc93a9f1 100644 --- a/src/axom/sidre/interface/c_fortran/wrapBuffer.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapBuffer.cpp @@ -1,12 +1,13 @@ // wrapBuffer.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapBuffer.h" + #include "axom/sidre/core/Buffer.hpp" +#include "wrapBuffer.h" // splicer begin class.Buffer.CXX_definitions // splicer end class.Buffer.CXX_definitions @@ -20,70 +21,70 @@ SIDRE_IndexType SIDRE_Buffer_get_index(const SIDRE_Buffer *self) { const axom::sidre::Buffer *SH_this = static_cast(self->addr); - // splicer begin class.Buffer.method.get_index + // splicer begin class.Buffer.method.getIndex axom::sidre::IndexType SHC_rv = SH_this->getIndex(); return SHC_rv; - // splicer end class.Buffer.method.get_index + // splicer end class.Buffer.method.getIndex } size_t SIDRE_Buffer_get_num_views(const SIDRE_Buffer *self) { const axom::sidre::Buffer *SH_this = static_cast(self->addr); - // splicer begin class.Buffer.method.get_num_views + // splicer begin class.Buffer.method.getNumViews size_t SHC_rv = SH_this->getNumViews(); return SHC_rv; - // splicer end class.Buffer.method.get_num_views + // splicer end class.Buffer.method.getNumViews } void *SIDRE_Buffer_get_void_ptr(SIDRE_Buffer *self) { axom::sidre::Buffer *SH_this = static_cast(self->addr); - // splicer begin class.Buffer.method.get_void_ptr + // splicer begin class.Buffer.method.getVoidPtr void *SHC_rv = SH_this->getVoidPtr(); return SHC_rv; - // splicer end class.Buffer.method.get_void_ptr + // splicer end class.Buffer.method.getVoidPtr } SIDRE_TypeIDint SIDRE_Buffer_get_type_id(const SIDRE_Buffer *self) { const axom::sidre::Buffer *SH_this = static_cast(self->addr); - // splicer begin class.Buffer.method.get_type_id + // splicer begin class.Buffer.method.getTypeID axom::sidre::TypeID SHCXX_rv = SH_this->getTypeID(); SIDRE_TypeIDint SHC_rv = static_cast(SHCXX_rv); return SHC_rv; - // splicer end class.Buffer.method.get_type_id + // splicer end class.Buffer.method.getTypeID } size_t SIDRE_Buffer_get_num_elements(const SIDRE_Buffer *self) { const axom::sidre::Buffer *SH_this = static_cast(self->addr); - // splicer begin class.Buffer.method.get_num_elements + // splicer begin class.Buffer.method.getNumElements size_t SHC_rv = SH_this->getNumElements(); return SHC_rv; - // splicer end class.Buffer.method.get_num_elements + // splicer end class.Buffer.method.getNumElements } size_t SIDRE_Buffer_get_total_bytes(const SIDRE_Buffer *self) { const axom::sidre::Buffer *SH_this = static_cast(self->addr); - // splicer begin class.Buffer.method.get_total_bytes + // splicer begin class.Buffer.method.getTotalBytes size_t SHC_rv = SH_this->getTotalBytes(); return SHC_rv; - // splicer end class.Buffer.method.get_total_bytes + // splicer end class.Buffer.method.getTotalBytes } size_t SIDRE_Buffer_get_bytes_per_element(const SIDRE_Buffer *self) { const axom::sidre::Buffer *SH_this = static_cast(self->addr); - // splicer begin class.Buffer.method.get_bytes_per_element + // splicer begin class.Buffer.method.getBytesPerElement size_t SHC_rv = SH_this->getBytesPerElement(); return SHC_rv; - // splicer end class.Buffer.method.get_bytes_per_element + // splicer end class.Buffer.method.getBytesPerElement } void SIDRE_Buffer_describe(SIDRE_Buffer *self, diff --git a/src/axom/sidre/interface/c_fortran/wrapBuffer.h b/src/axom/sidre/interface/c_fortran/wrapBuffer.h index 796d2e32a5..83c841881d 100644 --- a/src/axom/sidre/interface/c_fortran/wrapBuffer.h +++ b/src/axom/sidre/interface/c_fortran/wrapBuffer.h @@ -1,7 +1,7 @@ // wrapBuffer.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,14 +14,15 @@ #ifndef WRAPBUFFER_H #define WRAPBUFFER_H +#include "wrapSidre.h" #include "axom/sidre/interface/SidreTypes.h" -#include "typesSidre.h" #ifdef __cplusplus #include #include "axom/sidre/core/SidreTypes.hpp" #else #include #endif +#include "typesSidre.h" // splicer begin class.Buffer.CXX_declarations // splicer end class.Buffer.CXX_declarations diff --git a/src/axom/sidre/interface/c_fortran/wrapDataStore.cpp b/src/axom/sidre/interface/c_fortran/wrapDataStore.cpp index 72790604e8..ba5ffd88de 100644 --- a/src/axom/sidre/interface/c_fortran/wrapDataStore.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapDataStore.cpp @@ -1,22 +1,41 @@ // wrapDataStore.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapDataStore.h" -#include -#include -#include "axom/sidre/core/Buffer.hpp" + #include "axom/sidre/core/DataStore.hpp" #include "axom/sidre/core/Group.hpp" +#include "axom/sidre/core/Buffer.hpp" +#include +#include +#include "wrapDataStore.h" // splicer begin class.DataStore.CXX_definitions // splicer end class.DataStore.CXX_definitions extern "C" { +// helper ShroudLenTrim +// Returns the length of character string src with length nsrc, +// ignoring any trailing blanks. +static int ShroudLenTrim(const char *src, int nsrc) +{ + int i; + + for(i = nsrc - 1; i >= 0; i--) + { + if(src[i] != ' ') + { + break; + } + } + + return i + 1; +} + // splicer begin class.DataStore.C_definitions // splicer end class.DataStore.C_definitions @@ -44,22 +63,22 @@ SIDRE_Group *SIDRE_DataStore_get_root(SIDRE_DataStore *self, SIDRE_Group *SHC_rv { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.get_root + // splicer begin class.DataStore.method.getRoot axom::sidre::Group *SHCXX_rv = SH_this->getRoot(); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.DataStore.method.get_root + // splicer end class.DataStore.method.getRoot } size_t SIDRE_DataStore_get_num_buffers(const SIDRE_DataStore *self) { const axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.get_num_buffers + // splicer begin class.DataStore.method.getNumBuffers size_t SHC_rv = SH_this->getNumBuffers(); return SHC_rv; - // splicer end class.DataStore.method.get_num_buffers + // splicer end class.DataStore.method.getNumBuffers } SIDRE_Buffer *SIDRE_DataStore_get_buffer(SIDRE_DataStore *self, @@ -68,7 +87,51 @@ SIDRE_Buffer *SIDRE_DataStore_get_buffer(SIDRE_DataStore *self, { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.get_buffer + // splicer begin class.DataStore.method.getBuffer + axom::sidre::Buffer *SHCXX_rv = SH_this->getBuffer(idx); + // C_error_pattern + if(SHCXX_rv == nullptr) + { + SHC_rv->addr = NULL; + SHC_rv->idtor = 0; + return NULL; + } + + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.DataStore.method.getBuffer +} + +SIDRE_Buffer *SIDRE_DataStore_get_buffer_int32_t(SIDRE_DataStore *self, + int32_t idx, + SIDRE_Buffer *SHC_rv) +{ + axom::sidre::DataStore *SH_this = + static_cast(self->addr); + // splicer begin class.DataStore.method.getBuffer_int32_t + axom::sidre::Buffer *SHCXX_rv = SH_this->getBuffer(idx); + // C_error_pattern + if(SHCXX_rv == nullptr) + { + SHC_rv->addr = NULL; + SHC_rv->idtor = 0; + return NULL; + } + + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.DataStore.method.getBuffer_int32_t +} + +SIDRE_Buffer *SIDRE_DataStore_get_buffer_int64_t(SIDRE_DataStore *self, + int64_t idx, + SIDRE_Buffer *SHC_rv) +{ + axom::sidre::DataStore *SH_this = + static_cast(self->addr); + // splicer begin class.DataStore.method.getBuffer_int64_t axom::sidre::Buffer *SHCXX_rv = SH_this->getBuffer(idx); // C_error_pattern if(SHCXX_rv == nullptr) @@ -81,7 +144,7 @@ SIDRE_Buffer *SIDRE_DataStore_get_buffer(SIDRE_DataStore *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.DataStore.method.get_buffer + // splicer end class.DataStore.method.getBuffer_int64_t } SIDRE_Buffer *SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore *self, @@ -89,12 +152,12 @@ SIDRE_Buffer *SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore *self, { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.create_buffer_empty + // splicer begin class.DataStore.method.createBuffer_empty axom::sidre::Buffer *SHCXX_rv = SH_this->createBuffer(); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.DataStore.method.create_buffer_empty + // splicer end class.DataStore.method.createBuffer_empty } SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore *self, @@ -104,7 +167,55 @@ SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore *self, { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.create_buffer_from_type + // splicer begin class.DataStore.method.createBuffer_from_type + axom::sidre::TypeID SHCXX_type = static_cast(type); + axom::sidre::Buffer *SHCXX_rv = SH_this->createBuffer(SHCXX_type, num_elems); + // C_error_pattern + if(SHCXX_rv == nullptr) + { + SHC_rv->addr = NULL; + SHC_rv->idtor = 0; + return NULL; + } + + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.DataStore.method.createBuffer_from_type +} + +SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type_int32_t(SIDRE_DataStore *self, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_Buffer *SHC_rv) +{ + axom::sidre::DataStore *SH_this = + static_cast(self->addr); + // splicer begin class.DataStore.method.createBuffer_from_type_int32_t + axom::sidre::TypeID SHCXX_type = static_cast(type); + axom::sidre::Buffer *SHCXX_rv = SH_this->createBuffer(SHCXX_type, num_elems); + // C_error_pattern + if(SHCXX_rv == nullptr) + { + SHC_rv->addr = NULL; + SHC_rv->idtor = 0; + return NULL; + } + + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.DataStore.method.createBuffer_from_type_int32_t +} + +SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type_int64_t(SIDRE_DataStore *self, + SIDRE_TypeID type, + int64_t num_elems, + SIDRE_Buffer *SHC_rv) +{ + axom::sidre::DataStore *SH_this = + static_cast(self->addr); + // splicer begin class.DataStore.method.createBuffer_from_type_int64_t axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::Buffer *SHCXX_rv = SH_this->createBuffer(SHCXX_type, num_elems); // C_error_pattern @@ -118,16 +229,16 @@ SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.DataStore.method.create_buffer_from_type + // splicer end class.DataStore.method.createBuffer_from_type_int64_t } void SIDRE_DataStore_destroy_buffer(SIDRE_DataStore *self, SIDRE_IndexType id) { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.destroy_buffer + // splicer begin class.DataStore.method.destroyBuffer SH_this->destroyBuffer(id); - // splicer end class.DataStore.method.destroy_buffer + // splicer end class.DataStore.method.destroyBuffer } bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore *self, @@ -138,7 +249,7 @@ bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore *self, { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.generate_blueprint_index_0 + // splicer begin class.DataStore.method.generateBlueprintIndex_0 const std::string SHCXX_domain_path(domain_path); const std::string SHCXX_mesh_name(mesh_name); const std::string SHCXX_index_path(index_path); @@ -147,30 +258,35 @@ bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore *self, SHCXX_index_path, num_domains); return SHC_rv; - // splicer end class.DataStore.method.generate_blueprint_index_0 + // splicer end class.DataStore.method.generateBlueprintIndex_0 } bool SIDRE_DataStore_generate_blueprint_index_0_bufferify(SIDRE_DataStore *self, - const char *domain_path, - int Ldomain_path, - const char *mesh_name, - int Lmesh_name, - const char *index_path, - int Lindex_path, + char *domain_path, + int SHT_domain_path_len, + char *mesh_name, + int SHT_mesh_name_len, + char *index_path, + int SHT_index_path_len, int num_domains) { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.generate_blueprint_index_0_bufferify - const std::string SHCXX_domain_path(domain_path, Ldomain_path); - const std::string SHCXX_mesh_name(mesh_name, Lmesh_name); - const std::string SHCXX_index_path(index_path, Lindex_path); + // splicer begin class.DataStore.method.generateBlueprintIndex_0_bufferify + const std::string SHCXX_domain_path( + domain_path, + ShroudLenTrim(domain_path, SHT_domain_path_len)); + const std::string SHCXX_mesh_name(mesh_name, + ShroudLenTrim(mesh_name, SHT_mesh_name_len)); + const std::string SHCXX_index_path( + index_path, + ShroudLenTrim(index_path, SHT_index_path_len)); bool SHC_rv = SH_this->generateBlueprintIndex(SHCXX_domain_path, SHCXX_mesh_name, SHCXX_index_path, num_domains); return SHC_rv; - // splicer end class.DataStore.method.generate_blueprint_index_0_bufferify + // splicer end class.DataStore.method.generateBlueprintIndex_0_bufferify } #ifdef AXOM_USE_MPI @@ -182,7 +298,7 @@ bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore *self, { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.generate_blueprint_index_1 + // splicer begin class.DataStore.method.generateBlueprintIndex_1 MPI_Comm SHCXX_comm = MPI_Comm_f2c(comm); const std::string SHCXX_domain_path(domain_path); const std::string SHCXX_mesh_name(mesh_name); @@ -192,33 +308,38 @@ bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore *self, SHCXX_mesh_name, SHCXX_index_path); return SHC_rv; - // splicer end class.DataStore.method.generate_blueprint_index_1 + // splicer end class.DataStore.method.generateBlueprintIndex_1 } #endif // ifdef AXOM_USE_MPI #ifdef AXOM_USE_MPI bool SIDRE_DataStore_generate_blueprint_index_1_bufferify(SIDRE_DataStore *self, MPI_Fint comm, - const char *domain_path, - int Ldomain_path, - const char *mesh_name, - int Lmesh_name, - const char *index_path, - int Lindex_path) + char *domain_path, + int SHT_domain_path_len, + char *mesh_name, + int SHT_mesh_name_len, + char *index_path, + int SHT_index_path_len) { axom::sidre::DataStore *SH_this = static_cast(self->addr); - // splicer begin class.DataStore.method.generate_blueprint_index_1_bufferify + // splicer begin class.DataStore.method.generateBlueprintIndex_1_bufferify MPI_Comm SHCXX_comm = MPI_Comm_f2c(comm); - const std::string SHCXX_domain_path(domain_path, Ldomain_path); - const std::string SHCXX_mesh_name(mesh_name, Lmesh_name); - const std::string SHCXX_index_path(index_path, Lindex_path); + const std::string SHCXX_domain_path( + domain_path, + ShroudLenTrim(domain_path, SHT_domain_path_len)); + const std::string SHCXX_mesh_name(mesh_name, + ShroudLenTrim(mesh_name, SHT_mesh_name_len)); + const std::string SHCXX_index_path( + index_path, + ShroudLenTrim(index_path, SHT_index_path_len)); bool SHC_rv = SH_this->generateBlueprintIndex(SHCXX_comm, SHCXX_domain_path, SHCXX_mesh_name, SHCXX_index_path); return SHC_rv; - // splicer end class.DataStore.method.generate_blueprint_index_1_bufferify + // splicer end class.DataStore.method.generateBlueprintIndex_1_bufferify } #endif // ifdef AXOM_USE_MPI diff --git a/src/axom/sidre/interface/c_fortran/wrapDataStore.h b/src/axom/sidre/interface/c_fortran/wrapDataStore.h index 80249a1c14..0334e4acfd 100644 --- a/src/axom/sidre/interface/c_fortran/wrapDataStore.h +++ b/src/axom/sidre/interface/c_fortran/wrapDataStore.h @@ -1,7 +1,7 @@ // wrapDataStore.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,18 +14,21 @@ #ifndef WRAPDATASTORE_H #define WRAPDATASTORE_H +#include "wrapSidre.h" #include "axom/sidre/interface/SidreTypes.h" #ifdef AXOM_USE_MPI #include "mpi.h" #endif -#include "typesSidre.h" #ifdef __cplusplus #include + #include #include "axom/sidre/core/SidreTypes.hpp" #else - #include #include + #include + #include #endif +#include "typesSidre.h" // splicer begin class.DataStore.CXX_declarations // splicer end class.DataStore.CXX_declarations @@ -37,63 +40,83 @@ extern "C" { // splicer begin class.DataStore.C_declarations // splicer end class.DataStore.C_declarations -SIDRE_DataStore* SIDRE_DataStore_new(SIDRE_DataStore* SHC_rv); +SIDRE_DataStore *SIDRE_DataStore_new(SIDRE_DataStore *SHC_rv); -void SIDRE_DataStore_delete(SIDRE_DataStore* self); +void SIDRE_DataStore_delete(SIDRE_DataStore *self); -SIDRE_Group* SIDRE_DataStore_get_root(SIDRE_DataStore* self, SIDRE_Group* SHC_rv); +SIDRE_Group *SIDRE_DataStore_get_root(SIDRE_DataStore *self, SIDRE_Group *SHC_rv); -size_t SIDRE_DataStore_get_num_buffers(const SIDRE_DataStore* self); +size_t SIDRE_DataStore_get_num_buffers(const SIDRE_DataStore *self); -SIDRE_Buffer* SIDRE_DataStore_get_buffer(SIDRE_DataStore* self, +SIDRE_Buffer *SIDRE_DataStore_get_buffer(SIDRE_DataStore *self, SIDRE_IndexType idx, - SIDRE_Buffer* SHC_rv); + SIDRE_Buffer *SHC_rv); -SIDRE_Buffer* SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore* self, - SIDRE_Buffer* SHC_rv); +SIDRE_Buffer *SIDRE_DataStore_get_buffer_int32_t(SIDRE_DataStore *self, + int32_t idx, + SIDRE_Buffer *SHC_rv); -SIDRE_Buffer* SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore* self, - SIDRE_TypeID type, - SIDRE_IndexType num_elems, - SIDRE_Buffer* SHC_rv); +SIDRE_Buffer *SIDRE_DataStore_get_buffer_int64_t(SIDRE_DataStore *self, + int64_t idx, + SIDRE_Buffer *SHC_rv); -void SIDRE_DataStore_destroy_buffer(SIDRE_DataStore* self, SIDRE_IndexType id); +SIDRE_Buffer *SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore *self, + SIDRE_Buffer *SHC_rv); -bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore* self, - const char* domain_path, - const char* mesh_name, - const char* index_path, +SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore *self, + SIDRE_TypeID type, + SIDRE_IndexType num_elems, + SIDRE_Buffer *SHC_rv); + +SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type_int32_t( + SIDRE_DataStore *self, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_Buffer *SHC_rv); + +SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type_int64_t( + SIDRE_DataStore *self, + SIDRE_TypeID type, + int64_t num_elems, + SIDRE_Buffer *SHC_rv); + +void SIDRE_DataStore_destroy_buffer(SIDRE_DataStore *self, SIDRE_IndexType id); + +bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore *self, + const char *domain_path, + const char *mesh_name, + const char *index_path, int num_domains); -bool SIDRE_DataStore_generate_blueprint_index_0_bufferify(SIDRE_DataStore* self, - const char* domain_path, - int Ldomain_path, - const char* mesh_name, - int Lmesh_name, - const char* index_path, - int Lindex_path, +bool SIDRE_DataStore_generate_blueprint_index_0_bufferify(SIDRE_DataStore *self, + char *domain_path, + int SHT_domain_path_len, + char *mesh_name, + int SHT_mesh_name_len, + char *index_path, + int SHT_index_path_len, int num_domains); #ifdef AXOM_USE_MPI -bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore* self, +bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore *self, MPI_Fint comm, - const char* domain_path, - const char* mesh_name, - const char* index_path); + const char *domain_path, + const char *mesh_name, + const char *index_path); #endif #ifdef AXOM_USE_MPI -bool SIDRE_DataStore_generate_blueprint_index_1_bufferify(SIDRE_DataStore* self, +bool SIDRE_DataStore_generate_blueprint_index_1_bufferify(SIDRE_DataStore *self, MPI_Fint comm, - const char* domain_path, - int Ldomain_path, - const char* mesh_name, - int Lmesh_name, - const char* index_path, - int Lindex_path); + char *domain_path, + int SHT_domain_path_len, + char *mesh_name, + int SHT_mesh_name_len, + char *index_path, + int SHT_index_path_len); #endif -void SIDRE_DataStore_print(const SIDRE_DataStore* self); +void SIDRE_DataStore_print(const SIDRE_DataStore *self); #ifdef __cplusplus } diff --git a/src/axom/sidre/interface/c_fortran/wrapGroup.cpp b/src/axom/sidre/interface/c_fortran/wrapGroup.cpp index 9ff22adbe2..fdaca43484 100644 --- a/src/axom/sidre/interface/c_fortran/wrapGroup.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapGroup.cpp @@ -1,23 +1,42 @@ // wrapGroup.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapGroup.h" -#include + +#include "axom/sidre/core/Group.hpp" #include -#include "axom/sidre/core/Buffer.hpp" #include "axom/sidre/core/DataStore.hpp" -#include "axom/sidre/core/Group.hpp" #include "axom/sidre/core/View.hpp" +#include "axom/sidre/core/Buffer.hpp" +#include +#include "wrapGroup.h" // splicer begin class.Group.CXX_definitions // splicer end class.Group.CXX_definitions extern "C" { +// helper ShroudLenTrim +// Returns the length of character string src with length nsrc, +// ignoring any trailing blanks. +static int ShroudLenTrim(const char *src, int nsrc) +{ + int i; + + for(i = nsrc - 1; i >= 0; i--) + { + if(src[i] != ' ') + { + break; + } + } + + return i + 1; +} + // helper ShroudStrCopy // Copy src into dest, blank fill to ndest characters // Truncate if dest is too short. @@ -30,16 +49,10 @@ static void ShroudStrCopy(char *dest, int ndest, const char *src, int nsrc) } else { - if(nsrc < 0) - { - nsrc = std::strlen(src); - } + if(nsrc < 0) nsrc = std::strlen(src); int nm = nsrc < ndest ? nsrc : ndest; std::memcpy(dest, src, nm); - if(ndest > nm) - { - std::memset(dest + nm, ' ', ndest - nm); // blank fill - } + if(ndest > nm) std::memset(dest + nm, ' ', ndest - nm); // blank fill } } // splicer begin class.Group.C_definitions @@ -48,110 +61,110 @@ static void ShroudStrCopy(char *dest, int ndest, const char *src, int nsrc) SIDRE_IndexType SIDRE_Group_get_index(SIDRE_Group *self) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_index + // splicer begin class.Group.method.getIndex axom::sidre::IndexType SHC_rv = SH_this->getIndex(); return SHC_rv; - // splicer end class.Group.method.get_index + // splicer end class.Group.method.getIndex } const char *SIDRE_Group_get_name(const SIDRE_Group *self) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_name + // splicer begin class.Group.method.getName const std::string &SHCXX_rv = SH_this->getName(); const char *SHC_rv = SHCXX_rv.c_str(); return SHC_rv; - // splicer end class.Group.method.get_name + // splicer end class.Group.method.getName } void SIDRE_Group_get_name_bufferify(const SIDRE_Group *self, - char *SHF_rv, - int NSHF_rv) + char *SHC_rv, + int SHT_rv_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_name_bufferify + // splicer begin class.Group.method.getName_bufferify const std::string &SHCXX_rv = SH_this->getName(); if(SHCXX_rv.empty()) { - ShroudStrCopy(SHF_rv, NSHF_rv, nullptr, 0); + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); } else { - ShroudStrCopy(SHF_rv, NSHF_rv, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end class.Group.method.get_name_bufferify + // splicer end class.Group.method.getName_bufferify } void SIDRE_Group_get_path_bufferify(const SIDRE_Group *self, - char *SHF_rv, - int NSHF_rv) + char *SHC_rv, + int SHT_rv_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_path_bufferify + // splicer begin class.Group.method.getPath_bufferify std::string SHCXX_rv = SH_this->getPath(); if(SHCXX_rv.empty()) { - ShroudStrCopy(SHF_rv, NSHF_rv, nullptr, 0); + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); } else { - ShroudStrCopy(SHF_rv, NSHF_rv, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end class.Group.method.get_path_bufferify + // splicer end class.Group.method.getPath_bufferify } void SIDRE_Group_get_path_name_bufferify(const SIDRE_Group *self, - char *SHF_rv, - int NSHF_rv) + char *SHC_rv, + int SHT_rv_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_path_name_bufferify + // splicer begin class.Group.method.getPathName_bufferify std::string SHCXX_rv = SH_this->getPathName(); if(SHCXX_rv.empty()) { - ShroudStrCopy(SHF_rv, NSHF_rv, nullptr, 0); + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); } else { - ShroudStrCopy(SHF_rv, NSHF_rv, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end class.Group.method.get_path_name_bufferify + // splicer end class.Group.method.getPathName_bufferify } SIDRE_Group *SIDRE_Group_get_parent(const SIDRE_Group *self, SIDRE_Group *SHC_rv) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_parent + // splicer begin class.Group.method.getParent const axom::sidre::Group *SHCXX_rv = SH_this->getParent(); SHC_rv->addr = const_cast(SHCXX_rv); SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.get_parent + // splicer end class.Group.method.getParent } size_t SIDRE_Group_get_num_groups(const SIDRE_Group *self) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_num_groups + // splicer begin class.Group.method.getNumGroups size_t SHC_rv = SH_this->getNumGroups(); return SHC_rv; - // splicer end class.Group.method.get_num_groups + // splicer end class.Group.method.getNumGroups } size_t SIDRE_Group_get_num_views(const SIDRE_Group *self) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_num_views + // splicer begin class.Group.method.getNumViews size_t SHC_rv = SH_this->getNumViews(); return SHC_rv; - // splicer end class.Group.method.get_num_views + // splicer end class.Group.method.getNumViews } SIDRE_DataStore *SIDRE_Group_get_data_store(const SIDRE_Group *self, @@ -159,60 +172,60 @@ SIDRE_DataStore *SIDRE_Group_get_data_store(const SIDRE_Group *self, { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_data_store + // splicer begin class.Group.method.getDataStore const axom::sidre::DataStore *SHCXX_rv = SH_this->getDataStore(); SHC_rv->addr = const_cast(SHCXX_rv); SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.get_data_store + // splicer end class.Group.method.getDataStore } bool SIDRE_Group_has_view(const SIDRE_Group *self, const char *path) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.has_view + // splicer begin class.Group.method.hasView const std::string SHCXX_path(path); bool SHC_rv = SH_this->hasView(SHCXX_path); return SHC_rv; - // splicer end class.Group.method.has_view + // splicer end class.Group.method.hasView } bool SIDRE_Group_has_view_bufferify(const SIDRE_Group *self, - const char *path, - int Lpath) + char *path, + int SHT_path_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.has_view_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.hasView_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); bool SHC_rv = SH_this->hasView(SHCXX_path); return SHC_rv; - // splicer end class.Group.method.has_view_bufferify + // splicer end class.Group.method.hasView_bufferify } bool SIDRE_Group_has_child_view(const SIDRE_Group *self, const char *name) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.has_child_view + // splicer begin class.Group.method.hasChildView const std::string SHCXX_name(name); bool SHC_rv = SH_this->hasChildView(SHCXX_name); return SHC_rv; - // splicer end class.Group.method.has_child_view + // splicer end class.Group.method.hasChildView } bool SIDRE_Group_has_child_view_bufferify(const SIDRE_Group *self, - const char *name, - int Lname) + char *name, + int SHT_name_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.has_child_view_bufferify - const std::string SHCXX_name(name, Lname); + // splicer begin class.Group.method.hasChildView_bufferify + const std::string SHCXX_name(name, ShroudLenTrim(name, SHT_name_len)); bool SHC_rv = SH_this->hasChildView(SHCXX_name); return SHC_rv; - // splicer end class.Group.method.has_child_view_bufferify + // splicer end class.Group.method.hasChildView_bufferify } SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group *self, @@ -220,31 +233,31 @@ SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group *self, { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_view_index + // splicer begin class.Group.method.getViewIndex const std::string SHCXX_name(name); axom::sidre::IndexType SHC_rv = SH_this->getViewIndex(SHCXX_name); return SHC_rv; - // splicer end class.Group.method.get_view_index + // splicer end class.Group.method.getViewIndex } SIDRE_IndexType SIDRE_Group_get_view_index_bufferify(const SIDRE_Group *self, - const char *name, - int Lname) + char *name, + int SHT_name_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_view_index_bufferify - const std::string SHCXX_name(name, Lname); + // splicer begin class.Group.method.getViewIndex_bufferify + const std::string SHCXX_name(name, ShroudLenTrim(name, SHT_name_len)); axom::sidre::IndexType SHC_rv = SH_this->getViewIndex(SHCXX_name); return SHC_rv; - // splicer end class.Group.method.get_view_index_bufferify + // splicer end class.Group.method.getViewIndex_bufferify } const char *SIDRE_Group_get_view_name(const SIDRE_Group *self, SIDRE_IndexType idx) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_view_name + // splicer begin class.Group.method.getViewName const std::string &SHCXX_rv = SH_this->getViewName(idx); // C_error_pattern if(!axom::sidre::nameIsValid(SHCXX_rv)) @@ -254,34 +267,61 @@ const char *SIDRE_Group_get_view_name(const SIDRE_Group *self, SIDRE_IndexType i const char *SHC_rv = SHCXX_rv.c_str(); return SHC_rv; - // splicer end class.Group.method.get_view_name + // splicer end class.Group.method.getViewName } -void SIDRE_Group_get_view_name_bufferify(const SIDRE_Group *self, - SIDRE_IndexType idx, - char *SHF_rv, - int NSHF_rv) +void SIDRE_Group_get_view_name_int32_t_bufferify(const SIDRE_Group *self, + int32_t idx, + char *SHC_rv, + int SHT_rv_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_view_name_bufferify + // splicer begin class.Group.method.getViewName_int32_t_bufferify const std::string &SHCXX_rv = SH_this->getViewName(idx); // C_error_pattern if(!axom::sidre::nameIsValid(SHCXX_rv)) { - std::memset(SHF_rv, ' ', NSHF_rv); + std::memset(SHC_rv, ' ', SHT_rv_len); return; } if(SHCXX_rv.empty()) { - ShroudStrCopy(SHF_rv, NSHF_rv, nullptr, 0); + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); } else { - ShroudStrCopy(SHF_rv, NSHF_rv, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end class.Group.method.get_view_name_bufferify + // splicer end class.Group.method.getViewName_int32_t_bufferify +} + +void SIDRE_Group_get_view_name_int64_t_bufferify(const SIDRE_Group *self, + int64_t idx, + char *SHC_rv, + int SHT_rv_len) +{ + const axom::sidre::Group *SH_this = + static_cast(self->addr); + // splicer begin class.Group.method.getViewName_int64_t_bufferify + const std::string &SHCXX_rv = SH_this->getViewName(idx); + // C_error_pattern + if(!axom::sidre::nameIsValid(SHCXX_rv)) + { + std::memset(SHC_rv, ' ', SHT_rv_len); + return; + } + + if(SHCXX_rv.empty()) + { + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); + } + else + { + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); + } + // splicer end class.Group.method.getViewName_int64_t_bufferify } SIDRE_View *SIDRE_Group_get_view_from_name(SIDRE_Group *self, @@ -289,7 +329,7 @@ SIDRE_View *SIDRE_Group_get_view_from_name(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_view_from_name + // splicer begin class.Group.method.getView_from_name const std::string SHCXX_path(path); axom::sidre::View *SHCXX_rv = SH_this->getView(SHCXX_path); // C_error_pattern @@ -303,22 +343,22 @@ SIDRE_View *SIDRE_Group_get_view_from_name(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.get_view_from_name + // splicer end class.Group.method.getView_from_name } SIDRE_View *SIDRE_Group_get_view_from_name_bufferify(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_view_from_name_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.getView_from_name_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::View *SHCXX_rv = SH_this->getView(SHCXX_path); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.get_view_from_name_bufferify + // splicer end class.Group.method.getView_from_name_bufferify } SIDRE_View *SIDRE_Group_get_view_from_index(SIDRE_Group *self, @@ -326,7 +366,49 @@ SIDRE_View *SIDRE_Group_get_view_from_index(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_view_from_index + // splicer begin class.Group.method.getView_from_index + axom::sidre::View *SHCXX_rv = SH_this->getView(idx); + // C_error_pattern + if(SHCXX_rv == nullptr) + { + SHC_rv->addr = NULL; + SHC_rv->idtor = 0; + return NULL; + } + + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.Group.method.getView_from_index +} + +SIDRE_View *SIDRE_Group_get_view_from_index_int32_t(SIDRE_Group *self, + int32_t idx, + SIDRE_View *SHC_rv) +{ + axom::sidre::Group *SH_this = static_cast(self->addr); + // splicer begin class.Group.method.getView_from_index_int32_t + axom::sidre::View *SHCXX_rv = SH_this->getView(idx); + // C_error_pattern + if(SHCXX_rv == nullptr) + { + SHC_rv->addr = NULL; + SHC_rv->idtor = 0; + return NULL; + } + + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.Group.method.getView_from_index_int32_t +} + +SIDRE_View *SIDRE_Group_get_view_from_index_int64_t(SIDRE_Group *self, + int64_t idx, + SIDRE_View *SHC_rv) +{ + axom::sidre::Group *SH_this = static_cast(self->addr); + // splicer begin class.Group.method.getView_from_index_int64_t axom::sidre::View *SHCXX_rv = SH_this->getView(idx); // C_error_pattern if(SHCXX_rv == nullptr) @@ -339,17 +421,17 @@ SIDRE_View *SIDRE_Group_get_view_from_index(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.get_view_from_index + // splicer end class.Group.method.getView_from_index_int64_t } SIDRE_IndexType SIDRE_Group_get_first_valid_view_index(const SIDRE_Group *self) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_first_valid_view_index + // splicer begin class.Group.method.getFirstValidViewIndex axom::sidre::IndexType SHC_rv = SH_this->getFirstValidViewIndex(); return SHC_rv; - // splicer end class.Group.method.get_first_valid_view_index + // splicer end class.Group.method.getFirstValidViewIndex } SIDRE_IndexType SIDRE_Group_get_next_valid_view_index(const SIDRE_Group *self, @@ -357,10 +439,10 @@ SIDRE_IndexType SIDRE_Group_get_next_valid_view_index(const SIDRE_Group *self, { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_next_valid_view_index + // splicer begin class.Group.method.getNextValidViewIndex axom::sidre::IndexType SHC_rv = SH_this->getNextValidViewIndex(idx); return SHC_rv; - // splicer end class.Group.method.get_next_valid_view_index + // splicer end class.Group.method.getNextValidViewIndex } SIDRE_View *SIDRE_Group_create_view_empty(SIDRE_Group *self, @@ -368,7 +450,7 @@ SIDRE_View *SIDRE_Group_create_view_empty(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_empty + // splicer begin class.Group.method.createView_empty const std::string SHCXX_path(path); axom::sidre::View *SHCXX_rv = SH_this->createView(SHCXX_path); // C_error_pattern @@ -382,22 +464,22 @@ SIDRE_View *SIDRE_Group_create_view_empty(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_empty + // splicer end class.Group.method.createView_empty } SIDRE_View *SIDRE_Group_create_view_empty_bufferify(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_empty_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createView_empty_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::View *SHCXX_rv = SH_this->createView(SHCXX_path); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_empty_bufferify + // splicer end class.Group.method.createView_empty_bufferify } SIDRE_View *SIDRE_Group_create_view_from_type(SIDRE_Group *self, @@ -407,7 +489,7 @@ SIDRE_View *SIDRE_Group_create_view_from_type(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_from_type + // splicer begin class.Group.method.createView_from_type const std::string SHCXX_path(path); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = @@ -423,26 +505,45 @@ SIDRE_View *SIDRE_Group_create_view_from_type(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_from_type + // splicer end class.Group.method.createView_from_type } -SIDRE_View *SIDRE_Group_create_view_from_type_bufferify(SIDRE_Group *self, - const char *path, - int Lpath, - SIDRE_TypeID type, - SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv) +SIDRE_View *SIDRE_Group_create_view_from_type_int32_t_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_View *SHC_rv) +{ + axom::sidre::Group *SH_this = static_cast(self->addr); + // splicer begin class.Group.method.createView_from_type_int32_t_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); + axom::sidre::TypeID SHCXX_type = static_cast(type); + axom::sidre::View *SHCXX_rv = + SH_this->createView(SHCXX_path, SHCXX_type, num_elems); + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.Group.method.createView_from_type_int32_t_bufferify +} + +SIDRE_View *SIDRE_Group_create_view_from_type_int64_t_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int64_t num_elems, + SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_from_type_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createView_from_type_int64_t_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = SH_this->createView(SHCXX_path, SHCXX_type, num_elems); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_from_type_bufferify + // splicer end class.Group.method.createView_from_type_int64_t_bufferify } SIDRE_View *SIDRE_Group_create_view_with_shape_base(SIDRE_Group *self, @@ -453,7 +554,7 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_base(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_with_shape_base + // splicer begin class.Group.method.createViewWithShape_base const std::string SHCXX_path(path); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = @@ -469,28 +570,28 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_base(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_with_shape_base + // splicer end class.Group.method.createViewWithShape_base } SIDRE_View *SIDRE_Group_create_view_with_shape_base_bufferify( SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_TypeID type, int ndims, const SIDRE_IndexType *shape, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_with_shape_base_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewWithShape_base_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = SH_this->createViewWithShape(SHCXX_path, SHCXX_type, ndims, shape); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_with_shape_base_bufferify + // splicer end class.Group.method.createViewWithShape_base_bufferify } SIDRE_View *SIDRE_Group_create_view_into_buffer(SIDRE_Group *self, @@ -499,7 +600,7 @@ SIDRE_View *SIDRE_Group_create_view_into_buffer(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_into_buffer + // splicer begin class.Group.method.createView_into_buffer const std::string SHCXX_path(path); axom::sidre::Buffer *SHCXX_buff = static_cast(buff->addr); @@ -515,25 +616,25 @@ SIDRE_View *SIDRE_Group_create_view_into_buffer(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_into_buffer + // splicer end class.Group.method.createView_into_buffer } SIDRE_View *SIDRE_Group_create_view_into_buffer_bufferify(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_Buffer *buff, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_into_buffer_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createView_into_buffer_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::Buffer *SHCXX_buff = static_cast(buff->addr); axom::sidre::View *SHCXX_rv = SH_this->createView(SHCXX_path, SHCXX_buff); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_into_buffer_bufferify + // splicer end class.Group.method.createView_into_buffer_bufferify } SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group *self, @@ -544,7 +645,7 @@ SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_from_type_and_buffer + // splicer begin class.Group.method.createView_from_type_and_buffer const std::string SHCXX_path(path); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::Buffer *SHCXX_buff = @@ -562,21 +663,44 @@ SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_from_type_and_buffer + // splicer end class.Group.method.createView_from_type_and_buffer } -SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer_bufferify( +SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer_int32_t_bufferify( SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_Buffer *buff, + SIDRE_View *SHC_rv) +{ + axom::sidre::Group *SH_this = static_cast(self->addr); + // splicer begin class.Group.method.createView_from_type_and_buffer_int32_t_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); + axom::sidre::TypeID SHCXX_type = static_cast(type); + axom::sidre::Buffer *SHCXX_buff = + static_cast(buff->addr); + axom::sidre::View *SHCXX_rv = + SH_this->createView(SHCXX_path, SHCXX_type, num_elems, SHCXX_buff); + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.Group.method.createView_from_type_and_buffer_int32_t_bufferify +} + +SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer_int64_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, - SIDRE_IndexType num_elems, + int64_t num_elems, SIDRE_Buffer *buff, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_from_type_and_buffer_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createView_from_type_and_buffer_int64_t_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::Buffer *SHCXX_buff = static_cast(buff->addr); @@ -585,7 +709,7 @@ SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer_bufferify( SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_from_type_and_buffer_bufferify + // splicer end class.Group.method.createView_from_type_and_buffer_int64_t_bufferify } SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group *self, @@ -597,7 +721,7 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_with_shape_and_buffer + // splicer begin class.Group.method.createViewWithShape_and_buffer const std::string SHCXX_path(path); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::Buffer *SHCXX_buff = @@ -615,13 +739,13 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_with_shape_and_buffer + // splicer end class.Group.method.createViewWithShape_and_buffer } SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer_bufferify( SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_TypeID type, int ndims, const SIDRE_IndexType *shape, @@ -629,8 +753,8 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer_bufferify( SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_with_shape_and_buffer_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewWithShape_and_buffer_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::Buffer *SHCXX_buff = static_cast(buff->addr); @@ -639,7 +763,7 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer_bufferify( SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_with_shape_and_buffer_bufferify + // splicer end class.Group.method.createViewWithShape_and_buffer_bufferify } SIDRE_View *SIDRE_Group_create_view_external(SIDRE_Group *self, @@ -648,7 +772,7 @@ SIDRE_View *SIDRE_Group_create_view_external(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_external + // splicer begin class.Group.method.createView_external const std::string SHCXX_path(path); axom::sidre::View *SHCXX_rv = SH_this->createView(SHCXX_path, external_ptr); // C_error_pattern @@ -662,23 +786,23 @@ SIDRE_View *SIDRE_Group_create_view_external(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_external + // splicer end class.Group.method.createView_external } SIDRE_View *SIDRE_Group_create_view_external_bufferify(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, void *external_ptr, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_external_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createView_external_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::View *SHCXX_rv = SH_this->createView(SHCXX_path, external_ptr); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_external_bufferify + // splicer end class.Group.method.createView_external_bufferify } SIDRE_View *SIDRE_Group_create_view_from_type_external(SIDRE_Group *self, @@ -689,7 +813,7 @@ SIDRE_View *SIDRE_Group_create_view_from_type_external(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_from_type_external + // splicer begin class.Group.method.createView_from_type_external const std::string SHCXX_path(path); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = @@ -705,28 +829,49 @@ SIDRE_View *SIDRE_Group_create_view_from_type_external(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_from_type_external + // splicer end class.Group.method.createView_from_type_external } -SIDRE_View *SIDRE_Group_create_view_from_type_external_bufferify( +SIDRE_View *SIDRE_Group_create_view_from_type_external_int32_t_bufferify( SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_TypeID type, - SIDRE_IndexType num_elems, + int32_t num_elems, void *external_ptr, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_from_type_external_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createView_from_type_external_int32_t_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = SH_this->createView(SHCXX_path, SHCXX_type, num_elems, external_ptr); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_from_type_external_bufferify + // splicer end class.Group.method.createView_from_type_external_int32_t_bufferify +} + +SIDRE_View *SIDRE_Group_create_view_from_type_external_int64_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int64_t num_elems, + void *external_ptr, + SIDRE_View *SHC_rv) +{ + axom::sidre::Group *SH_this = static_cast(self->addr); + // splicer begin class.Group.method.createView_from_type_external_int64_t_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); + axom::sidre::TypeID SHCXX_type = static_cast(type); + axom::sidre::View *SHCXX_rv = + SH_this->createView(SHCXX_path, SHCXX_type, num_elems, external_ptr); + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.Group.method.createView_from_type_external_int64_t_bufferify } SIDRE_View *SIDRE_Group_create_view_with_shape_external(SIDRE_Group *self, @@ -738,7 +883,7 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_external(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_with_shape_external + // splicer begin class.Group.method.createViewWithShape_external const std::string SHCXX_path(path); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = @@ -754,13 +899,13 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_external(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_with_shape_external + // splicer end class.Group.method.createViewWithShape_external } SIDRE_View *SIDRE_Group_create_view_with_shape_external_bufferify( SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_TypeID type, int ndims, const SIDRE_IndexType *shape, @@ -768,15 +913,15 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_external_bufferify( SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_with_shape_external_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewWithShape_external_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = SH_this->createViewWithShape(SHCXX_path, SHCXX_type, ndims, shape, external_ptr); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_with_shape_external_bufferify + // splicer end class.Group.method.createViewWithShape_external_bufferify } SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group *self, @@ -786,7 +931,7 @@ SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_and_allocate_nelems + // splicer begin class.Group.method.createViewAndAllocate_nelems const std::string SHCXX_path(path); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = @@ -802,27 +947,47 @@ SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_and_allocate_nelems + // splicer end class.Group.method.createViewAndAllocate_nelems } -SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems_bufferify( +SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems_int32_t_bufferify( SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_View *SHC_rv) +{ + axom::sidre::Group *SH_this = static_cast(self->addr); + // splicer begin class.Group.method.createViewAndAllocate_nelems_int32_t_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); + axom::sidre::TypeID SHCXX_type = static_cast(type); + axom::sidre::View *SHCXX_rv = + SH_this->createViewAndAllocate(SHCXX_path, SHCXX_type, num_elems); + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.Group.method.createViewAndAllocate_nelems_int32_t_bufferify +} + +SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems_int64_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, - SIDRE_IndexType num_elems, + int64_t num_elems, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_and_allocate_nelems_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewAndAllocate_nelems_int64_t_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = SH_this->createViewAndAllocate(SHCXX_path, SHCXX_type, num_elems); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_and_allocate_nelems_bufferify + // splicer end class.Group.method.createViewAndAllocate_nelems_int64_t_bufferify } SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate( @@ -834,7 +999,7 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate( SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_with_shape_and_allocate + // splicer begin class.Group.method.createViewWithShapeAndAllocate const std::string SHCXX_path(path); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = @@ -850,28 +1015,28 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate( SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_with_shape_and_allocate + // splicer end class.Group.method.createViewWithShapeAndAllocate } SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate_bufferify( SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_TypeID type, int ndims, const SIDRE_IndexType *shape, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_with_shape_and_allocate_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewWithShapeAndAllocate_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::View *SHCXX_rv = SH_this->createViewWithShapeAndAllocate(SHCXX_path, SHCXX_type, ndims, shape); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_with_shape_and_allocate_bufferify + // splicer end class.Group.method.createViewWithShapeAndAllocate_bufferify } SIDRE_View *SIDRE_Group_create_view_scalar_int(SIDRE_Group *self, @@ -880,7 +1045,7 @@ SIDRE_View *SIDRE_Group_create_view_scalar_int(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_scalar_int + // splicer begin class.Group.method.createViewScalar_int const std::string SHCXX_path(path); axom::sidre::View *SHCXX_rv = SH_this->createViewScalar(SHCXX_path, value); // C_error_pattern @@ -894,23 +1059,23 @@ SIDRE_View *SIDRE_Group_create_view_scalar_int(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_scalar_int + // splicer end class.Group.method.createViewScalar_int } SIDRE_View *SIDRE_Group_create_view_scalar_bufferify_int(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, int value, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_scalar_bufferify_int - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewScalar_bufferify_int + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::View *SHCXX_rv = SH_this->createViewScalar(SHCXX_path, value); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_scalar_bufferify_int + // splicer end class.Group.method.createViewScalar_bufferify_int } SIDRE_View *SIDRE_Group_create_view_scalar_long(SIDRE_Group *self, @@ -919,7 +1084,7 @@ SIDRE_View *SIDRE_Group_create_view_scalar_long(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_scalar_long + // splicer begin class.Group.method.createViewScalar_long const std::string SHCXX_path(path); axom::sidre::View *SHCXX_rv = SH_this->createViewScalar(SHCXX_path, value); @@ -934,24 +1099,24 @@ SIDRE_View *SIDRE_Group_create_view_scalar_long(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_scalar_long + // splicer end class.Group.method.createViewScalar_long } SIDRE_View *SIDRE_Group_create_view_scalar_bufferify_long(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, long value, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_scalar_bufferify_long - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewScalar_bufferify_long + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::View *SHCXX_rv = SH_this->createViewScalar(SHCXX_path, value); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_scalar_bufferify_long + // splicer end class.Group.method.createViewScalar_bufferify_long } SIDRE_View *SIDRE_Group_create_view_scalar_float(SIDRE_Group *self, @@ -960,7 +1125,7 @@ SIDRE_View *SIDRE_Group_create_view_scalar_float(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_scalar_float + // splicer begin class.Group.method.createViewScalar_float const std::string SHCXX_path(path); axom::sidre::View *SHCXX_rv = SH_this->createViewScalar(SHCXX_path, value); @@ -975,24 +1140,24 @@ SIDRE_View *SIDRE_Group_create_view_scalar_float(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_scalar_float + // splicer end class.Group.method.createViewScalar_float } SIDRE_View *SIDRE_Group_create_view_scalar_bufferify_float(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, float value, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_scalar_bufferify_float - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewScalar_bufferify_float + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::View *SHCXX_rv = SH_this->createViewScalar(SHCXX_path, value); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_scalar_bufferify_float + // splicer end class.Group.method.createViewScalar_bufferify_float } SIDRE_View *SIDRE_Group_create_view_scalar_double(SIDRE_Group *self, @@ -1001,7 +1166,7 @@ SIDRE_View *SIDRE_Group_create_view_scalar_double(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_scalar_double + // splicer begin class.Group.method.createViewScalar_double const std::string SHCXX_path(path); axom::sidre::View *SHCXX_rv = SH_this->createViewScalar(SHCXX_path, value); @@ -1016,24 +1181,24 @@ SIDRE_View *SIDRE_Group_create_view_scalar_double(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_scalar_double + // splicer end class.Group.method.createViewScalar_double } SIDRE_View *SIDRE_Group_create_view_scalar_bufferify_double(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, double value, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_scalar_bufferify_double - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createViewScalar_bufferify_double + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::View *SHCXX_rv = SH_this->createViewScalar(SHCXX_path, value); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_scalar_bufferify_double + // splicer end class.Group.method.createViewScalar_bufferify_double } SIDRE_View *SIDRE_Group_create_view_string(SIDRE_Group *self, @@ -1042,7 +1207,7 @@ SIDRE_View *SIDRE_Group_create_view_string(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_string + // splicer begin class.Group.method.createViewString const std::string SHCXX_path(path); const std::string SHCXX_value(value); axom::sidre::View *SHCXX_rv = @@ -1058,75 +1223,75 @@ SIDRE_View *SIDRE_Group_create_view_string(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_string + // splicer end class.Group.method.createViewString } SIDRE_View *SIDRE_Group_create_view_string_bufferify(SIDRE_Group *self, - const char *path, - int Lpath, - const char *value, - int Lvalue, + char *path, + int SHT_path_len, + char *value, + int SHT_value_len, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_view_string_bufferify - const std::string SHCXX_path(path, Lpath); - const std::string SHCXX_value(value, Lvalue); + // splicer begin class.Group.method.createViewString_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); + const std::string SHCXX_value(value, ShroudLenTrim(value, SHT_value_len)); axom::sidre::View *SHCXX_rv = SH_this->createViewString(SHCXX_path, SHCXX_value); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_view_string_bufferify + // splicer end class.Group.method.createViewString_bufferify } void SIDRE_Group_destroy_view(SIDRE_Group *self, const char *path) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.destroy_view + // splicer begin class.Group.method.destroyView const std::string SHCXX_path(path); SH_this->destroyView(SHCXX_path); - // splicer end class.Group.method.destroy_view + // splicer end class.Group.method.destroyView } void SIDRE_Group_destroy_view_bufferify(SIDRE_Group *self, - const char *path, - int Lpath) + char *path, + int SHT_path_len) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.destroy_view_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.destroyView_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); SH_this->destroyView(SHCXX_path); - // splicer end class.Group.method.destroy_view_bufferify + // splicer end class.Group.method.destroyView_bufferify } void SIDRE_Group_destroy_view_and_data_name(SIDRE_Group *self, const char *path) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.destroy_view_and_data_name + // splicer begin class.Group.method.destroyViewAndData_name const std::string SHCXX_path(path); SH_this->destroyViewAndData(SHCXX_path); - // splicer end class.Group.method.destroy_view_and_data_name + // splicer end class.Group.method.destroyViewAndData_name } void SIDRE_Group_destroy_view_and_data_name_bufferify(SIDRE_Group *self, - const char *path, - int Lpath) + char *path, + int SHT_path_len) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.destroy_view_and_data_name_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.destroyViewAndData_name_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); SH_this->destroyViewAndData(SHCXX_path); - // splicer end class.Group.method.destroy_view_and_data_name_bufferify + // splicer end class.Group.method.destroyViewAndData_name_bufferify } void SIDRE_Group_destroy_view_and_data_index(SIDRE_Group *self, SIDRE_IndexType idx) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.destroy_view_and_data_index + // splicer begin class.Group.method.destroyViewAndData_index SH_this->destroyViewAndData(idx); - // splicer end class.Group.method.destroy_view_and_data_index + // splicer end class.Group.method.destroyViewAndData_index } SIDRE_View *SIDRE_Group_move_view(SIDRE_Group *self, @@ -1134,13 +1299,13 @@ SIDRE_View *SIDRE_Group_move_view(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.move_view + // splicer begin class.Group.method.moveView axom::sidre::View *SHCXX_view = static_cast(view->addr); axom::sidre::View *SHCXX_rv = SH_this->moveView(SHCXX_view); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.move_view + // splicer end class.Group.method.moveView } SIDRE_View *SIDRE_Group_copy_view(SIDRE_Group *self, @@ -1148,55 +1313,55 @@ SIDRE_View *SIDRE_Group_copy_view(SIDRE_Group *self, SIDRE_View *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.copy_view + // splicer begin class.Group.method.copyView axom::sidre::View *SHCXX_view = static_cast(view->addr); axom::sidre::View *SHCXX_rv = SH_this->copyView(SHCXX_view); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.copy_view + // splicer end class.Group.method.copyView } bool SIDRE_Group_has_group(SIDRE_Group *self, const char *path) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.has_group + // splicer begin class.Group.method.hasGroup const std::string SHCXX_path(path); bool SHC_rv = SH_this->hasGroup(SHCXX_path); return SHC_rv; - // splicer end class.Group.method.has_group + // splicer end class.Group.method.hasGroup } -bool SIDRE_Group_has_group_bufferify(SIDRE_Group *self, const char *path, int Lpath) +bool SIDRE_Group_has_group_bufferify(SIDRE_Group *self, char *path, int SHT_path_len) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.has_group_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.hasGroup_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); bool SHC_rv = SH_this->hasGroup(SHCXX_path); return SHC_rv; - // splicer end class.Group.method.has_group_bufferify + // splicer end class.Group.method.hasGroup_bufferify } bool SIDRE_Group_has_child_group(SIDRE_Group *self, const char *name) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.has_child_group + // splicer begin class.Group.method.hasChildGroup const std::string SHCXX_name(name); bool SHC_rv = SH_this->hasChildGroup(SHCXX_name); return SHC_rv; - // splicer end class.Group.method.has_child_group + // splicer end class.Group.method.hasChildGroup } bool SIDRE_Group_has_child_group_bufferify(SIDRE_Group *self, - const char *name, - int Lname) + char *name, + int SHT_name_len) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.has_child_group_bufferify - const std::string SHCXX_name(name, Lname); + // splicer begin class.Group.method.hasChildGroup_bufferify + const std::string SHCXX_name(name, ShroudLenTrim(name, SHT_name_len)); bool SHC_rv = SH_this->hasChildGroup(SHCXX_name); return SHC_rv; - // splicer end class.Group.method.has_child_group_bufferify + // splicer end class.Group.method.hasChildGroup_bufferify } SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group *self, @@ -1204,24 +1369,24 @@ SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group *self, { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_group_index + // splicer begin class.Group.method.getGroupIndex const std::string SHCXX_name(name); axom::sidre::IndexType SHC_rv = SH_this->getGroupIndex(SHCXX_name); return SHC_rv; - // splicer end class.Group.method.get_group_index + // splicer end class.Group.method.getGroupIndex } SIDRE_IndexType SIDRE_Group_get_group_index_bufferify(const SIDRE_Group *self, - const char *name, - int Lname) + char *name, + int SHT_name_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_group_index_bufferify - const std::string SHCXX_name(name, Lname); + // splicer begin class.Group.method.getGroupIndex_bufferify + const std::string SHCXX_name(name, ShroudLenTrim(name, SHT_name_len)); axom::sidre::IndexType SHC_rv = SH_this->getGroupIndex(SHCXX_name); return SHC_rv; - // splicer end class.Group.method.get_group_index_bufferify + // splicer end class.Group.method.getGroupIndex_bufferify } const char *SIDRE_Group_get_group_name(const SIDRE_Group *self, @@ -1229,7 +1394,7 @@ const char *SIDRE_Group_get_group_name(const SIDRE_Group *self, { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_group_name + // splicer begin class.Group.method.getGroupName const std::string &SHCXX_rv = SH_this->getGroupName(idx); // C_error_pattern if(!axom::sidre::nameIsValid(SHCXX_rv)) @@ -1239,34 +1404,61 @@ const char *SIDRE_Group_get_group_name(const SIDRE_Group *self, const char *SHC_rv = SHCXX_rv.c_str(); return SHC_rv; - // splicer end class.Group.method.get_group_name + // splicer end class.Group.method.getGroupName +} + +void SIDRE_Group_get_group_name_int32_t_bufferify(const SIDRE_Group *self, + int32_t idx, + char *SHC_rv, + int SHT_rv_len) +{ + const axom::sidre::Group *SH_this = + static_cast(self->addr); + // splicer begin class.Group.method.getGroupName_int32_t_bufferify + const std::string &SHCXX_rv = SH_this->getGroupName(idx); + // C_error_pattern + if(!axom::sidre::nameIsValid(SHCXX_rv)) + { + std::memset(SHC_rv, ' ', SHT_rv_len); + return; + } + + if(SHCXX_rv.empty()) + { + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); + } + else + { + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); + } + // splicer end class.Group.method.getGroupName_int32_t_bufferify } -void SIDRE_Group_get_group_name_bufferify(const SIDRE_Group *self, - SIDRE_IndexType idx, - char *SHF_rv, - int NSHF_rv) +void SIDRE_Group_get_group_name_int64_t_bufferify(const SIDRE_Group *self, + int64_t idx, + char *SHC_rv, + int SHT_rv_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_group_name_bufferify + // splicer begin class.Group.method.getGroupName_int64_t_bufferify const std::string &SHCXX_rv = SH_this->getGroupName(idx); // C_error_pattern if(!axom::sidre::nameIsValid(SHCXX_rv)) { - std::memset(SHF_rv, ' ', NSHF_rv); + std::memset(SHC_rv, ' ', SHT_rv_len); return; } if(SHCXX_rv.empty()) { - ShroudStrCopy(SHF_rv, NSHF_rv, nullptr, 0); + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); } else { - ShroudStrCopy(SHF_rv, NSHF_rv, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end class.Group.method.get_group_name_bufferify + // splicer end class.Group.method.getGroupName_int64_t_bufferify } SIDRE_Group *SIDRE_Group_get_group_from_name(SIDRE_Group *self, @@ -1274,7 +1466,7 @@ SIDRE_Group *SIDRE_Group_get_group_from_name(SIDRE_Group *self, SIDRE_Group *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_group_from_name + // splicer begin class.Group.method.getGroup_from_name const std::string SHCXX_path(path); axom::sidre::Group *SHCXX_rv = SH_this->getGroup(SHCXX_path); // C_error_pattern @@ -1288,22 +1480,22 @@ SIDRE_Group *SIDRE_Group_get_group_from_name(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.get_group_from_name + // splicer end class.Group.method.getGroup_from_name } SIDRE_Group *SIDRE_Group_get_group_from_name_bufferify(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_Group *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_group_from_name_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.getGroup_from_name_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::Group *SHCXX_rv = SH_this->getGroup(SHCXX_path); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.get_group_from_name_bufferify + // splicer end class.Group.method.getGroup_from_name_bufferify } SIDRE_Group *SIDRE_Group_get_group_from_index(SIDRE_Group *self, @@ -1311,7 +1503,7 @@ SIDRE_Group *SIDRE_Group_get_group_from_index(SIDRE_Group *self, SIDRE_Group *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_group_from_index + // splicer begin class.Group.method.getGroup_from_index axom::sidre::Group *SHCXX_rv = SH_this->getGroup(idx); // C_error_pattern if(SHCXX_rv == nullptr) @@ -1324,17 +1516,59 @@ SIDRE_Group *SIDRE_Group_get_group_from_index(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.get_group_from_index + // splicer end class.Group.method.getGroup_from_index +} + +SIDRE_Group *SIDRE_Group_get_group_from_index_int32_t(SIDRE_Group *self, + int32_t idx, + SIDRE_Group *SHC_rv) +{ + axom::sidre::Group *SH_this = static_cast(self->addr); + // splicer begin class.Group.method.getGroup_from_index_int32_t + axom::sidre::Group *SHCXX_rv = SH_this->getGroup(idx); + // C_error_pattern + if(SHCXX_rv == nullptr) + { + SHC_rv->addr = NULL; + SHC_rv->idtor = 0; + return NULL; + } + + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.Group.method.getGroup_from_index_int32_t +} + +SIDRE_Group *SIDRE_Group_get_group_from_index_int64_t(SIDRE_Group *self, + int64_t idx, + SIDRE_Group *SHC_rv) +{ + axom::sidre::Group *SH_this = static_cast(self->addr); + // splicer begin class.Group.method.getGroup_from_index_int64_t + axom::sidre::Group *SHCXX_rv = SH_this->getGroup(idx); + // C_error_pattern + if(SHCXX_rv == nullptr) + { + SHC_rv->addr = NULL; + SHC_rv->idtor = 0; + return NULL; + } + + SHC_rv->addr = SHCXX_rv; + SHC_rv->idtor = 0; + return SHC_rv; + // splicer end class.Group.method.getGroup_from_index_int64_t } SIDRE_IndexType SIDRE_Group_get_first_valid_group_index(const SIDRE_Group *self) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_first_valid_group_index + // splicer begin class.Group.method.getFirstValidGroupIndex axom::sidre::IndexType SHC_rv = SH_this->getFirstValidGroupIndex(); return SHC_rv; - // splicer end class.Group.method.get_first_valid_group_index + // splicer end class.Group.method.getFirstValidGroupIndex } SIDRE_IndexType SIDRE_Group_get_next_valid_group_index(const SIDRE_Group *self, @@ -1342,10 +1576,10 @@ SIDRE_IndexType SIDRE_Group_get_next_valid_group_index(const SIDRE_Group *self, { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.get_next_valid_group_index + // splicer begin class.Group.method.getNextValidGroupIndex axom::sidre::IndexType SHC_rv = SH_this->getNextValidGroupIndex(idx); return SHC_rv; - // splicer end class.Group.method.get_next_valid_group_index + // splicer end class.Group.method.getNextValidGroupIndex } SIDRE_Group *SIDRE_Group_create_group(SIDRE_Group *self, @@ -1353,7 +1587,7 @@ SIDRE_Group *SIDRE_Group_create_group(SIDRE_Group *self, SIDRE_Group *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_group + // splicer begin class.Group.method.createGroup const std::string SHCXX_path(path); axom::sidre::Group *SHCXX_rv = SH_this->createGroup(SHCXX_path); // C_error_pattern @@ -1367,50 +1601,50 @@ SIDRE_Group *SIDRE_Group_create_group(SIDRE_Group *self, SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_group + // splicer end class.Group.method.createGroup } SIDRE_Group *SIDRE_Group_create_group_bufferify(SIDRE_Group *self, - const char *path, - int Lpath, + char *path, + int SHT_path_len, SIDRE_Group *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.create_group_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.createGroup_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); axom::sidre::Group *SHCXX_rv = SH_this->createGroup(SHCXX_path); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.create_group_bufferify + // splicer end class.Group.method.createGroup_bufferify } void SIDRE_Group_destroy_group_name(SIDRE_Group *self, const char *path) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.destroy_group_name + // splicer begin class.Group.method.destroyGroup_name const std::string SHCXX_path(path); SH_this->destroyGroup(SHCXX_path); - // splicer end class.Group.method.destroy_group_name + // splicer end class.Group.method.destroyGroup_name } void SIDRE_Group_destroy_group_name_bufferify(SIDRE_Group *self, - const char *path, - int Lpath) + char *path, + int SHT_path_len) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.destroy_group_name_bufferify - const std::string SHCXX_path(path, Lpath); + // splicer begin class.Group.method.destroyGroup_name_bufferify + const std::string SHCXX_path(path, ShroudLenTrim(path, SHT_path_len)); SH_this->destroyGroup(SHCXX_path); - // splicer end class.Group.method.destroy_group_name_bufferify + // splicer end class.Group.method.destroyGroup_name_bufferify } void SIDRE_Group_destroy_group_index(SIDRE_Group *self, SIDRE_IndexType idx) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.destroy_group_index + // splicer begin class.Group.method.destroyGroup_index SH_this->destroyGroup(idx); - // splicer end class.Group.method.destroy_group_index + // splicer end class.Group.method.destroyGroup_index } SIDRE_Group *SIDRE_Group_move_group(SIDRE_Group *self, @@ -1418,13 +1652,13 @@ SIDRE_Group *SIDRE_Group_move_group(SIDRE_Group *self, SIDRE_Group *SHC_rv) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.move_group + // splicer begin class.Group.method.moveGroup axom::sidre::Group *SHCXX_grp = static_cast(grp->addr); axom::sidre::Group *SHCXX_rv = SH_this->moveGroup(SHCXX_grp); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.Group.method.move_group + // splicer end class.Group.method.moveGroup } void SIDRE_Group_print(const SIDRE_Group *self) @@ -1440,12 +1674,12 @@ bool SIDRE_Group_is_equivalent_to(const SIDRE_Group *self, SIDRE_Group *other) { const axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.is_equivalent_to + // splicer begin class.Group.method.isEquivalentTo const axom::sidre::Group *SHCXX_other = static_cast(other->addr); bool SHC_rv = SH_this->isEquivalentTo(SHCXX_other); return SHC_rv; - // splicer end class.Group.method.is_equivalent_to + // splicer end class.Group.method.isEquivalentTo } void SIDRE_Group_save(const SIDRE_Group *self, @@ -1462,16 +1696,18 @@ void SIDRE_Group_save(const SIDRE_Group *self, } void SIDRE_Group_save_bufferify(const SIDRE_Group *self, - const char *file_path, - int Lfile_path, - const char *protocol, - int Lprotocol) + char *file_path, + int SHT_file_path_len, + char *protocol, + int SHT_protocol_len) { const axom::sidre::Group *SH_this = static_cast(self->addr); // splicer begin class.Group.method.save_bufferify - const std::string SHCXX_file_path(file_path, Lfile_path); - const std::string SHCXX_protocol(protocol, Lprotocol); + const std::string SHCXX_file_path(file_path, + ShroudLenTrim(file_path, SHT_file_path_len)); + const std::string SHCXX_protocol(protocol, + ShroudLenTrim(protocol, SHT_protocol_len)); SH_this->save(SHCXX_file_path, SHCXX_protocol); // splicer end class.Group.method.save_bufferify } @@ -1489,15 +1725,17 @@ void SIDRE_Group_load_0(SIDRE_Group *self, } void SIDRE_Group_load_0_bufferify(SIDRE_Group *self, - const char *file_path, - int Lfile_path, - const char *protocol, - int Lprotocol) + char *file_path, + int SHT_file_path_len, + char *protocol, + int SHT_protocol_len) { axom::sidre::Group *SH_this = static_cast(self->addr); // splicer begin class.Group.method.load_0_bufferify - const std::string SHCXX_file_path(file_path, Lfile_path); - const std::string SHCXX_protocol(protocol, Lprotocol); + const std::string SHCXX_file_path(file_path, + ShroudLenTrim(file_path, SHT_file_path_len)); + const std::string SHCXX_protocol(protocol, + ShroudLenTrim(protocol, SHT_protocol_len)); SH_this->load(SHCXX_file_path, SHCXX_protocol); // splicer end class.Group.method.load_0_bufferify } @@ -1516,16 +1754,18 @@ void SIDRE_Group_load_1(SIDRE_Group *self, } void SIDRE_Group_load_1_bufferify(SIDRE_Group *self, - const char *file_path, - int Lfile_path, - const char *protocol, - int Lprotocol, + char *file_path, + int SHT_file_path_len, + char *protocol, + int SHT_protocol_len, bool preserve_contents) { axom::sidre::Group *SH_this = static_cast(self->addr); // splicer begin class.Group.method.load_1_bufferify - const std::string SHCXX_file_path(file_path, Lfile_path); - const std::string SHCXX_protocol(protocol, Lprotocol); + const std::string SHCXX_file_path(file_path, + ShroudLenTrim(file_path, SHT_file_path_len)); + const std::string SHCXX_protocol(protocol, + ShroudLenTrim(protocol, SHT_protocol_len)); SH_this->load(SHCXX_file_path, SHCXX_protocol, preserve_contents); // splicer end class.Group.method.load_1_bufferify } @@ -1533,21 +1773,22 @@ void SIDRE_Group_load_1_bufferify(SIDRE_Group *self, void SIDRE_Group_load_external_data(SIDRE_Group *self, const char *file_path) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.load_external_data + // splicer begin class.Group.method.loadExternalData const std::string SHCXX_file_path(file_path); SH_this->loadExternalData(SHCXX_file_path); - // splicer end class.Group.method.load_external_data + // splicer end class.Group.method.loadExternalData } void SIDRE_Group_load_external_data_bufferify(SIDRE_Group *self, - const char *file_path, - int Lfile_path) + char *file_path, + int SHT_file_path_len) { axom::sidre::Group *SH_this = static_cast(self->addr); - // splicer begin class.Group.method.load_external_data_bufferify - const std::string SHCXX_file_path(file_path, Lfile_path); + // splicer begin class.Group.method.loadExternalData_bufferify + const std::string SHCXX_file_path(file_path, + ShroudLenTrim(file_path, SHT_file_path_len)); SH_this->loadExternalData(SHCXX_file_path); - // splicer end class.Group.method.load_external_data_bufferify + // splicer end class.Group.method.loadExternalData_bufferify } bool SIDRE_Group_rename(SIDRE_Group *self, const char *new_name) @@ -1561,12 +1802,13 @@ bool SIDRE_Group_rename(SIDRE_Group *self, const char *new_name) } bool SIDRE_Group_rename_bufferify(SIDRE_Group *self, - const char *new_name, - int Lnew_name) + char *new_name, + int SHT_new_name_len) { axom::sidre::Group *SH_this = static_cast(self->addr); // splicer begin class.Group.method.rename_bufferify - const std::string SHCXX_new_name(new_name, Lnew_name); + const std::string SHCXX_new_name(new_name, + ShroudLenTrim(new_name, SHT_new_name_len)); bool SHC_rv = SH_this->rename(SHCXX_new_name); return SHC_rv; // splicer end class.Group.method.rename_bufferify diff --git a/src/axom/sidre/interface/c_fortran/wrapGroup.h b/src/axom/sidre/interface/c_fortran/wrapGroup.h index ed7d3e2f9a..63e5024e2c 100644 --- a/src/axom/sidre/interface/c_fortran/wrapGroup.h +++ b/src/axom/sidre/interface/c_fortran/wrapGroup.h @@ -1,7 +1,7 @@ // wrapGroup.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,15 +14,18 @@ #ifndef WRAPGROUP_H #define WRAPGROUP_H +#include "wrapSidre.h" #include "axom/sidre/interface/SidreTypes.h" -#include "typesSidre.h" #ifdef __cplusplus #include + #include #include "axom/sidre/core/SidreTypes.hpp" #else - #include #include + #include + #include #endif +#include "typesSidre.h" // splicer begin class.Group.CXX_declarations // splicer end class.Group.CXX_declarations @@ -34,427 +37,488 @@ extern "C" { // splicer begin class.Group.C_declarations // splicer end class.Group.C_declarations -SIDRE_IndexType SIDRE_Group_get_index(SIDRE_Group* self); +SIDRE_IndexType SIDRE_Group_get_index(SIDRE_Group *self); -const char* SIDRE_Group_get_name(const SIDRE_Group* self); +const char *SIDRE_Group_get_name(const SIDRE_Group *self); -void SIDRE_Group_get_name_bufferify(const SIDRE_Group* self, - char* SHF_rv, - int NSHF_rv); +void SIDRE_Group_get_name_bufferify(const SIDRE_Group *self, + char *SHC_rv, + int SHT_rv_len); -void SIDRE_Group_get_path_bufferify(const SIDRE_Group* self, - char* SHF_rv, - int NSHF_rv); +void SIDRE_Group_get_path_bufferify(const SIDRE_Group *self, + char *SHC_rv, + int SHT_rv_len); -void SIDRE_Group_get_path_name_bufferify(const SIDRE_Group* self, - char* SHF_rv, - int NSHF_rv); +void SIDRE_Group_get_path_name_bufferify(const SIDRE_Group *self, + char *SHC_rv, + int SHT_rv_len); -SIDRE_Group* SIDRE_Group_get_parent(const SIDRE_Group* self, SIDRE_Group* SHC_rv); +SIDRE_Group *SIDRE_Group_get_parent(const SIDRE_Group *self, SIDRE_Group *SHC_rv); -size_t SIDRE_Group_get_num_groups(const SIDRE_Group* self); +size_t SIDRE_Group_get_num_groups(const SIDRE_Group *self); -size_t SIDRE_Group_get_num_views(const SIDRE_Group* self); +size_t SIDRE_Group_get_num_views(const SIDRE_Group *self); -SIDRE_DataStore* SIDRE_Group_get_data_store(const SIDRE_Group* self, - SIDRE_DataStore* SHC_rv); +SIDRE_DataStore *SIDRE_Group_get_data_store(const SIDRE_Group *self, + SIDRE_DataStore *SHC_rv); -bool SIDRE_Group_has_view(const SIDRE_Group* self, const char* path); +bool SIDRE_Group_has_view(const SIDRE_Group *self, const char *path); -bool SIDRE_Group_has_view_bufferify(const SIDRE_Group* self, - const char* path, - int Lpath); +bool SIDRE_Group_has_view_bufferify(const SIDRE_Group *self, + char *path, + int SHT_path_len); -bool SIDRE_Group_has_child_view(const SIDRE_Group* self, const char* name); +bool SIDRE_Group_has_child_view(const SIDRE_Group *self, const char *name); -bool SIDRE_Group_has_child_view_bufferify(const SIDRE_Group* self, - const char* name, - int Lname); +bool SIDRE_Group_has_child_view_bufferify(const SIDRE_Group *self, + char *name, + int SHT_name_len); -SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group* self, - const char* name); +SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group *self, + const char *name); -SIDRE_IndexType SIDRE_Group_get_view_index_bufferify(const SIDRE_Group* self, - const char* name, - int Lname); +SIDRE_IndexType SIDRE_Group_get_view_index_bufferify(const SIDRE_Group *self, + char *name, + int SHT_name_len); -const char* SIDRE_Group_get_view_name(const SIDRE_Group* self, +const char *SIDRE_Group_get_view_name(const SIDRE_Group *self, SIDRE_IndexType idx); -void SIDRE_Group_get_view_name_bufferify(const SIDRE_Group* self, - SIDRE_IndexType idx, - char* SHF_rv, - int NSHF_rv); +void SIDRE_Group_get_view_name_int32_t_bufferify(const SIDRE_Group *self, + int32_t idx, + char *SHC_rv, + int SHT_rv_len); + +void SIDRE_Group_get_view_name_int64_t_bufferify(const SIDRE_Group *self, + int64_t idx, + char *SHC_rv, + int SHT_rv_len); -SIDRE_View* SIDRE_Group_get_view_from_name(SIDRE_Group* self, - const char* path, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_get_view_from_name(SIDRE_Group *self, + const char *path, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_get_view_from_name_bufferify(SIDRE_Group* self, - const char* path, - int Lpath, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_get_view_from_name_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_get_view_from_index(SIDRE_Group* self, +SIDRE_View *SIDRE_Group_get_view_from_index(SIDRE_Group *self, const SIDRE_IndexType idx, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_IndexType SIDRE_Group_get_first_valid_view_index(const SIDRE_Group* self); +SIDRE_View *SIDRE_Group_get_view_from_index_int32_t(SIDRE_Group *self, + int32_t idx, + SIDRE_View *SHC_rv); -SIDRE_IndexType SIDRE_Group_get_next_valid_view_index(const SIDRE_Group* self, +SIDRE_View *SIDRE_Group_get_view_from_index_int64_t(SIDRE_Group *self, + int64_t idx, + SIDRE_View *SHC_rv); + +SIDRE_IndexType SIDRE_Group_get_first_valid_view_index(const SIDRE_Group *self); + +SIDRE_IndexType SIDRE_Group_get_next_valid_view_index(const SIDRE_Group *self, SIDRE_IndexType idx); -SIDRE_View* SIDRE_Group_create_view_empty(SIDRE_Group* self, - const char* path, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_create_view_empty(SIDRE_Group *self, + const char *path, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_empty_bufferify(SIDRE_Group* self, - const char* path, - int Lpath, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_create_view_empty_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_from_type(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_from_type(SIDRE_Group *self, + const char *path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_from_type_bufferify(SIDRE_Group* self, - const char* path, - int Lpath, - SIDRE_TypeID type, - SIDRE_IndexType num_elems, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_create_view_from_type_int32_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_with_shape_base(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_from_type_int64_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int64_t num_elems, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_with_shape_base(SIDRE_Group *self, + const char *path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - SIDRE_View* SHC_rv); + const SIDRE_IndexType *shape, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_with_shape_base_bufferify( - SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_with_shape_base_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - SIDRE_View* SHC_rv); - -SIDRE_View* SIDRE_Group_create_view_into_buffer(SIDRE_Group* self, - const char* path, - SIDRE_Buffer* buff, - SIDRE_View* SHC_rv); - -SIDRE_View* SIDRE_Group_create_view_into_buffer_bufferify(SIDRE_Group* self, - const char* path, - int Lpath, - SIDRE_Buffer* buff, - SIDRE_View* SHC_rv); - -SIDRE_View* SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group* self, - const char* path, + const SIDRE_IndexType *shape, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_into_buffer(SIDRE_Group *self, + const char *path, + SIDRE_Buffer *buff, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_into_buffer_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_Buffer *buff, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group *self, + const char *path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer* buff, - SIDRE_View* SHC_rv); + SIDRE_Buffer *buff, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_from_type_and_buffer_bufferify( - SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer_int32_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_Buffer *buff, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer_int64_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, - SIDRE_IndexType num_elems, - SIDRE_Buffer* buff, - SIDRE_View* SHC_rv); + int64_t num_elems, + SIDRE_Buffer *buff, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group *self, + const char *path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - SIDRE_Buffer* buff, - SIDRE_View* SHC_rv); - -SIDRE_View* SIDRE_Group_create_view_with_shape_and_buffer_bufferify( - SIDRE_Group* self, - const char* path, - int Lpath, + const SIDRE_IndexType *shape, + SIDRE_Buffer *buff, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - SIDRE_Buffer* buff, - SIDRE_View* SHC_rv); - -SIDRE_View* SIDRE_Group_create_view_external(SIDRE_Group* self, - const char* path, - void* external_ptr, - SIDRE_View* SHC_rv); - -SIDRE_View* SIDRE_Group_create_view_external_bufferify(SIDRE_Group* self, - const char* path, - int Lpath, - void* external_ptr, - SIDRE_View* SHC_rv); - -SIDRE_View* SIDRE_Group_create_view_from_type_external(SIDRE_Group* self, - const char* path, + const SIDRE_IndexType *shape, + SIDRE_Buffer *buff, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_external(SIDRE_Group *self, + const char *path, + void *external_ptr, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_external_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + void *external_ptr, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_from_type_external(SIDRE_Group *self, + const char *path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - void* external_ptr, - SIDRE_View* SHC_rv); + void *external_ptr, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_from_type_external_bufferify( - SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_from_type_external_int32_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, - SIDRE_IndexType num_elems, - void* external_ptr, - SIDRE_View* SHC_rv); + int32_t num_elems, + void *external_ptr, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_from_type_external_int64_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int64_t num_elems, + void *external_ptr, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_with_shape_external(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_with_shape_external(SIDRE_Group *self, + const char *path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - void* external_ptr, - SIDRE_View* SHC_rv); - -SIDRE_View* SIDRE_Group_create_view_with_shape_external_bufferify( - SIDRE_Group* self, - const char* path, - int Lpath, + const SIDRE_IndexType *shape, + void *external_ptr, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_with_shape_external_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - void* external_ptr, - SIDRE_View* SHC_rv); + const SIDRE_IndexType *shape, + void *external_ptr, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group *self, + const char *path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_and_allocate_nelems_bufferify( - SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems_int32_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, - SIDRE_IndexType num_elems, - SIDRE_View* SHC_rv); + int32_t num_elems, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_with_shape_and_allocate( - SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems_int64_t_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_TypeID type, + int64_t num_elems, + SIDRE_View *SHC_rv); + +SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate( + SIDRE_Group *self, + const char *path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - SIDRE_View* SHC_rv); + const SIDRE_IndexType *shape, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_with_shape_and_allocate_bufferify( - SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate_bufferify( + SIDRE_Group *self, + char *path, + int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - SIDRE_View* SHC_rv); + const SIDRE_IndexType *shape, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_scalar_int(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_scalar_int(SIDRE_Group *self, + const char *path, int value, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_scalar_bufferify_int(SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_scalar_bufferify_int(SIDRE_Group *self, + char *path, + int SHT_path_len, int value, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_scalar_long(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_scalar_long(SIDRE_Group *self, + const char *path, long value, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_scalar_bufferify_long(SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_scalar_bufferify_long(SIDRE_Group *self, + char *path, + int SHT_path_len, long value, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_scalar_float(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_scalar_float(SIDRE_Group *self, + const char *path, float value, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_scalar_bufferify_float(SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_scalar_bufferify_float(SIDRE_Group *self, + char *path, + int SHT_path_len, float value, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_scalar_double(SIDRE_Group* self, - const char* path, +SIDRE_View *SIDRE_Group_create_view_scalar_double(SIDRE_Group *self, + const char *path, double value, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_scalar_bufferify_double(SIDRE_Group* self, - const char* path, - int Lpath, +SIDRE_View *SIDRE_Group_create_view_scalar_bufferify_double(SIDRE_Group *self, + char *path, + int SHT_path_len, double value, - SIDRE_View* SHC_rv); + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_string(SIDRE_Group* self, - const char* path, - const char* value, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_create_view_string(SIDRE_Group *self, + const char *path, + const char *value, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_create_view_string_bufferify(SIDRE_Group* self, - const char* path, - int Lpath, - const char* value, - int Lvalue, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_create_view_string_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + char *value, + int SHT_value_len, + SIDRE_View *SHC_rv); -void SIDRE_Group_destroy_view(SIDRE_Group* self, const char* path); +void SIDRE_Group_destroy_view(SIDRE_Group *self, const char *path); -void SIDRE_Group_destroy_view_bufferify(SIDRE_Group* self, - const char* path, - int Lpath); +void SIDRE_Group_destroy_view_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len); -void SIDRE_Group_destroy_view_and_data_name(SIDRE_Group* self, const char* path); +void SIDRE_Group_destroy_view_and_data_name(SIDRE_Group *self, const char *path); -void SIDRE_Group_destroy_view_and_data_name_bufferify(SIDRE_Group* self, - const char* path, - int Lpath); +void SIDRE_Group_destroy_view_and_data_name_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len); -void SIDRE_Group_destroy_view_and_data_index(SIDRE_Group* self, +void SIDRE_Group_destroy_view_and_data_index(SIDRE_Group *self, SIDRE_IndexType idx); -SIDRE_View* SIDRE_Group_move_view(SIDRE_Group* self, - SIDRE_View* view, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_move_view(SIDRE_Group *self, + SIDRE_View *view, + SIDRE_View *SHC_rv); -SIDRE_View* SIDRE_Group_copy_view(SIDRE_Group* self, - SIDRE_View* view, - SIDRE_View* SHC_rv); +SIDRE_View *SIDRE_Group_copy_view(SIDRE_Group *self, + SIDRE_View *view, + SIDRE_View *SHC_rv); -bool SIDRE_Group_has_group(SIDRE_Group* self, const char* path); +bool SIDRE_Group_has_group(SIDRE_Group *self, const char *path); -bool SIDRE_Group_has_group_bufferify(SIDRE_Group* self, - const char* path, - int Lpath); +bool SIDRE_Group_has_group_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len); -bool SIDRE_Group_has_child_group(SIDRE_Group* self, const char* name); +bool SIDRE_Group_has_child_group(SIDRE_Group *self, const char *name); -bool SIDRE_Group_has_child_group_bufferify(SIDRE_Group* self, - const char* name, - int Lname); +bool SIDRE_Group_has_child_group_bufferify(SIDRE_Group *self, + char *name, + int SHT_name_len); -SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group* self, - const char* name); +SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group *self, + const char *name); -SIDRE_IndexType SIDRE_Group_get_group_index_bufferify(const SIDRE_Group* self, - const char* name, - int Lname); +SIDRE_IndexType SIDRE_Group_get_group_index_bufferify(const SIDRE_Group *self, + char *name, + int SHT_name_len); -const char* SIDRE_Group_get_group_name(const SIDRE_Group* self, +const char *SIDRE_Group_get_group_name(const SIDRE_Group *self, SIDRE_IndexType idx); -void SIDRE_Group_get_group_name_bufferify(const SIDRE_Group* self, - SIDRE_IndexType idx, - char* SHF_rv, - int NSHF_rv); +void SIDRE_Group_get_group_name_int32_t_bufferify(const SIDRE_Group *self, + int32_t idx, + char *SHC_rv, + int SHT_rv_len); + +void SIDRE_Group_get_group_name_int64_t_bufferify(const SIDRE_Group *self, + int64_t idx, + char *SHC_rv, + int SHT_rv_len); -SIDRE_Group* SIDRE_Group_get_group_from_name(SIDRE_Group* self, - const char* path, - SIDRE_Group* SHC_rv); +SIDRE_Group *SIDRE_Group_get_group_from_name(SIDRE_Group *self, + const char *path, + SIDRE_Group *SHC_rv); -SIDRE_Group* SIDRE_Group_get_group_from_name_bufferify(SIDRE_Group* self, - const char* path, - int Lpath, - SIDRE_Group* SHC_rv); +SIDRE_Group *SIDRE_Group_get_group_from_name_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_Group *SHC_rv); -SIDRE_Group* SIDRE_Group_get_group_from_index(SIDRE_Group* self, +SIDRE_Group *SIDRE_Group_get_group_from_index(SIDRE_Group *self, SIDRE_IndexType idx, - SIDRE_Group* SHC_rv); + SIDRE_Group *SHC_rv); + +SIDRE_Group *SIDRE_Group_get_group_from_index_int32_t(SIDRE_Group *self, + int32_t idx, + SIDRE_Group *SHC_rv); + +SIDRE_Group *SIDRE_Group_get_group_from_index_int64_t(SIDRE_Group *self, + int64_t idx, + SIDRE_Group *SHC_rv); -SIDRE_IndexType SIDRE_Group_get_first_valid_group_index(const SIDRE_Group* self); +SIDRE_IndexType SIDRE_Group_get_first_valid_group_index(const SIDRE_Group *self); -SIDRE_IndexType SIDRE_Group_get_next_valid_group_index(const SIDRE_Group* self, +SIDRE_IndexType SIDRE_Group_get_next_valid_group_index(const SIDRE_Group *self, SIDRE_IndexType idx); -SIDRE_Group* SIDRE_Group_create_group(SIDRE_Group* self, - const char* path, - SIDRE_Group* SHC_rv); +SIDRE_Group *SIDRE_Group_create_group(SIDRE_Group *self, + const char *path, + SIDRE_Group *SHC_rv); -SIDRE_Group* SIDRE_Group_create_group_bufferify(SIDRE_Group* self, - const char* path, - int Lpath, - SIDRE_Group* SHC_rv); +SIDRE_Group *SIDRE_Group_create_group_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len, + SIDRE_Group *SHC_rv); -void SIDRE_Group_destroy_group_name(SIDRE_Group* self, const char* path); +void SIDRE_Group_destroy_group_name(SIDRE_Group *self, const char *path); -void SIDRE_Group_destroy_group_name_bufferify(SIDRE_Group* self, - const char* path, - int Lpath); +void SIDRE_Group_destroy_group_name_bufferify(SIDRE_Group *self, + char *path, + int SHT_path_len); -void SIDRE_Group_destroy_group_index(SIDRE_Group* self, SIDRE_IndexType idx); +void SIDRE_Group_destroy_group_index(SIDRE_Group *self, SIDRE_IndexType idx); -SIDRE_Group* SIDRE_Group_move_group(SIDRE_Group* self, - SIDRE_Group* grp, - SIDRE_Group* SHC_rv); +SIDRE_Group *SIDRE_Group_move_group(SIDRE_Group *self, + SIDRE_Group *grp, + SIDRE_Group *SHC_rv); -void SIDRE_Group_print(const SIDRE_Group* self); +void SIDRE_Group_print(const SIDRE_Group *self); -bool SIDRE_Group_is_equivalent_to(const SIDRE_Group* self, SIDRE_Group* other); +bool SIDRE_Group_is_equivalent_to(const SIDRE_Group *self, SIDRE_Group *other); -void SIDRE_Group_save(const SIDRE_Group* self, - const char* file_path, - const char* protocol); +void SIDRE_Group_save(const SIDRE_Group *self, + const char *file_path, + const char *protocol); -void SIDRE_Group_save_bufferify(const SIDRE_Group* self, - const char* file_path, - int Lfile_path, - const char* protocol, - int Lprotocol); +void SIDRE_Group_save_bufferify(const SIDRE_Group *self, + char *file_path, + int SHT_file_path_len, + char *protocol, + int SHT_protocol_len); -void SIDRE_Group_load_0(SIDRE_Group* self, - const char* file_path, - const char* protocol); +void SIDRE_Group_load_0(SIDRE_Group *self, + const char *file_path, + const char *protocol); -void SIDRE_Group_load_0_bufferify(SIDRE_Group* self, - const char* file_path, - int Lfile_path, - const char* protocol, - int Lprotocol); +void SIDRE_Group_load_0_bufferify(SIDRE_Group *self, + char *file_path, + int SHT_file_path_len, + char *protocol, + int SHT_protocol_len); -void SIDRE_Group_load_1(SIDRE_Group* self, - const char* file_path, - const char* protocol, +void SIDRE_Group_load_1(SIDRE_Group *self, + const char *file_path, + const char *protocol, bool preserve_contents); -void SIDRE_Group_load_1_bufferify(SIDRE_Group* self, - const char* file_path, - int Lfile_path, - const char* protocol, - int Lprotocol, +void SIDRE_Group_load_1_bufferify(SIDRE_Group *self, + char *file_path, + int SHT_file_path_len, + char *protocol, + int SHT_protocol_len, bool preserve_contents); -void SIDRE_Group_load_external_data(SIDRE_Group* self, const char* file_path); +void SIDRE_Group_load_external_data(SIDRE_Group *self, const char *file_path); -void SIDRE_Group_load_external_data_bufferify(SIDRE_Group* self, - const char* file_path, - int Lfile_path); +void SIDRE_Group_load_external_data_bufferify(SIDRE_Group *self, + char *file_path, + int SHT_file_path_len); -bool SIDRE_Group_rename(SIDRE_Group* self, const char* new_name); +bool SIDRE_Group_rename(SIDRE_Group *self, const char *new_name); -bool SIDRE_Group_rename_bufferify(SIDRE_Group* self, - const char* new_name, - int Lnew_name); +bool SIDRE_Group_rename_bufferify(SIDRE_Group *self, + char *new_name, + int SHT_new_name_len); #ifdef __cplusplus } diff --git a/src/axom/sidre/interface/c_fortran/wrapSidre.cpp b/src/axom/sidre/interface/c_fortran/wrapSidre.cpp index 2d75a833eb..a1d1ba5910 100644 --- a/src/axom/sidre/interface/c_fortran/wrapSidre.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapSidre.cpp @@ -1,16 +1,13 @@ // wrapSidre.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapSidre.h" -#include -#include -#include "typesSidre.h" -#include "axom/sidre/core/DataStore.hpp" +#include +#include "wrapSidre.h" // splicer begin CXX_definitions // splicer end CXX_definitions @@ -38,37 +35,9 @@ void sidre_c_loc_(void* addr, void** out) { *out = addr; } bool SIDRE_name_is_valid(const char* name) { - // splicer begin function.name_is_valid + // splicer begin function.nameIsValid return name != NULL; - // splicer end function.name_is_valid -} - -// Release library allocated memory. -void SIDRE_SHROUD_memory_destructor(SIDRE_SHROUD_capsule_data* cap) -{ - void* ptr = cap->addr; - switch(cap->idtor) - { - case 0: // --none-- - { - // Nothing to delete - break; - } - case 1: // axom::sidre::DataStore - { - axom::sidre::DataStore* cxx_ptr = - reinterpret_cast(ptr); - delete cxx_ptr; - break; - } - default: - { - // Unexpected case in destructor - break; - } - } - cap->addr = nullptr; - cap->idtor = 0; // avoid deleting again + // splicer end function.nameIsValid } } // extern "C" diff --git a/src/axom/sidre/interface/c_fortran/wrapSidre.h b/src/axom/sidre/interface/c_fortran/wrapSidre.h index dae2af763a..005c67323b 100644 --- a/src/axom/sidre/interface/c_fortran/wrapSidre.h +++ b/src/axom/sidre/interface/c_fortran/wrapSidre.h @@ -1,7 +1,7 @@ // wrapSidre.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,10 +14,10 @@ #ifndef WRAPSIDRE_H #define WRAPSIDRE_H -#include "typesSidre.h" #ifndef __cplusplus #include #endif +#include "typesSidre.h" // splicer begin CXX_declarations // splicer end CXX_declarations @@ -26,7 +26,31 @@ extern "C" { #endif +// typedef axom::sidre::IndexType +// splicer begin typedef.IndexType +// See SidreTypes.h +// splicer end typedef.IndexType + +// typedef axom::sidre::TypeID +// splicer begin typedef.TypeID +typedef short SIDRE_TypeID; +// splicer end typedef.TypeID + +// typedef axom::sidre::TypeIDint +// splicer begin typedef.TypeIDint +typedef int SIDRE_TypeIDint; +// splicer end typedef.TypeIDint + // splicer begin C_declarations +#if 0 + #ifndef __cplusplus + #if defined(USE_64BIT_INDEXTYPE) +typedef int64_t IndexType; + #else +typedef int32_t IndexType; + #endif + #endif +#endif // splicer end C_declarations bool SIDRE_name_is_valid(const char* name); diff --git a/src/axom/sidre/interface/c_fortran/wrapView.cpp b/src/axom/sidre/interface/c_fortran/wrapView.cpp index 96893b811e..fe8e62dee9 100644 --- a/src/axom/sidre/interface/c_fortran/wrapView.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapView.cpp @@ -1,22 +1,41 @@ // wrapView.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapView.h" -#include + +#include "axom/sidre/core/View.hpp" #include -#include "axom/sidre/core/Buffer.hpp" #include "axom/sidre/core/Group.hpp" -#include "axom/sidre/core/View.hpp" +#include "axom/sidre/core/Buffer.hpp" +#include +#include "wrapView.h" // splicer begin class.View.CXX_definitions // splicer end class.View.CXX_definitions extern "C" { +// helper ShroudLenTrim +// Returns the length of character string src with length nsrc, +// ignoring any trailing blanks. +static int ShroudLenTrim(const char *src, int nsrc) +{ + int i; + + for(i = nsrc - 1; i >= 0; i--) + { + if(src[i] != ' ') + { + break; + } + } + + return i + 1; +} + // helper ShroudStrCopy // Copy src into dest, blank fill to ndest characters // Truncate if dest is too short. @@ -29,16 +48,10 @@ static void ShroudStrCopy(char *dest, int ndest, const char *src, int nsrc) } else { - if(nsrc < 0) - { - nsrc = std::strlen(src); - } + if(nsrc < 0) nsrc = std::strlen(src); int nm = nsrc < ndest ? nsrc : ndest; std::memcpy(dest, src, nm); - if(ndest > nm) - { - std::memset(dest + nm, ' ', ndest - nm); // blank fill - } + if(ndest > nm) std::memset(dest + nm, ' ', ndest - nm); // blank fill } } // splicer begin class.View.C_definitions @@ -47,266 +60,270 @@ static void ShroudStrCopy(char *dest, int ndest, const char *src, int nsrc) SIDRE_IndexType SIDRE_View_get_index(SIDRE_View *self) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_index + // splicer begin class.View.method.getIndex axom::sidre::IndexType SHC_rv = SH_this->getIndex(); return SHC_rv; - // splicer end class.View.method.get_index + // splicer end class.View.method.getIndex } const char *SIDRE_View_get_name(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_name + // splicer begin class.View.method.getName const std::string &SHCXX_rv = SH_this->getName(); const char *SHC_rv = SHCXX_rv.c_str(); return SHC_rv; - // splicer end class.View.method.get_name + // splicer end class.View.method.getName } -void SIDRE_View_get_name_bufferify(const SIDRE_View *self, char *SHF_rv, int NSHF_rv) +void SIDRE_View_get_name_bufferify(const SIDRE_View *self, + char *SHC_rv, + int SHT_rv_len) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_name_bufferify + // splicer begin class.View.method.getName_bufferify const std::string &SHCXX_rv = SH_this->getName(); if(SHCXX_rv.empty()) { - ShroudStrCopy(SHF_rv, NSHF_rv, nullptr, 0); + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); } else { - ShroudStrCopy(SHF_rv, NSHF_rv, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end class.View.method.get_name_bufferify + // splicer end class.View.method.getName_bufferify } -void SIDRE_View_get_path_bufferify(const SIDRE_View *self, char *SHF_rv, int NSHF_rv) +void SIDRE_View_get_path_bufferify(const SIDRE_View *self, + char *SHC_rv, + int SHT_rv_len) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_path_bufferify + // splicer begin class.View.method.getPath_bufferify std::string SHCXX_rv = SH_this->getPath(); if(SHCXX_rv.empty()) { - ShroudStrCopy(SHF_rv, NSHF_rv, nullptr, 0); + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); } else { - ShroudStrCopy(SHF_rv, NSHF_rv, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end class.View.method.get_path_bufferify + // splicer end class.View.method.getPath_bufferify } void SIDRE_View_get_path_name_bufferify(const SIDRE_View *self, - char *SHF_rv, - int NSHF_rv) + char *SHC_rv, + int SHT_rv_len) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_path_name_bufferify + // splicer begin class.View.method.getPathName_bufferify std::string SHCXX_rv = SH_this->getPathName(); if(SHCXX_rv.empty()) { - ShroudStrCopy(SHF_rv, NSHF_rv, nullptr, 0); + ShroudStrCopy(SHC_rv, SHT_rv_len, nullptr, 0); } else { - ShroudStrCopy(SHF_rv, NSHF_rv, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(SHC_rv, SHT_rv_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end class.View.method.get_path_name_bufferify + // splicer end class.View.method.getPathName_bufferify } SIDRE_Group *SIDRE_View_get_owning_group(SIDRE_View *self, SIDRE_Group *SHC_rv) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_owning_group + // splicer begin class.View.method.getOwningGroup axom::sidre::Group *SHCXX_rv = SH_this->getOwningGroup(); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.View.method.get_owning_group + // splicer end class.View.method.getOwningGroup } bool SIDRE_View_has_buffer(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.has_buffer + // splicer begin class.View.method.hasBuffer bool SHC_rv = SH_this->hasBuffer(); return SHC_rv; - // splicer end class.View.method.has_buffer + // splicer end class.View.method.hasBuffer } SIDRE_Buffer *SIDRE_View_get_buffer(SIDRE_View *self, SIDRE_Buffer *SHC_rv) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_buffer + // splicer begin class.View.method.getBuffer axom::sidre::Buffer *SHCXX_rv = SH_this->getBuffer(); SHC_rv->addr = SHCXX_rv; SHC_rv->idtor = 0; return SHC_rv; - // splicer end class.View.method.get_buffer + // splicer end class.View.method.getBuffer } bool SIDRE_View_is_external(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.is_external + // splicer begin class.View.method.isExternal bool SHC_rv = SH_this->isExternal(); return SHC_rv; - // splicer end class.View.method.is_external + // splicer end class.View.method.isExternal } bool SIDRE_View_is_allocated(SIDRE_View *self) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.is_allocated + // splicer begin class.View.method.isAllocated bool SHC_rv = SH_this->isAllocated(); return SHC_rv; - // splicer end class.View.method.is_allocated + // splicer end class.View.method.isAllocated } bool SIDRE_View_is_applied(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.is_applied + // splicer begin class.View.method.isApplied bool SHC_rv = SH_this->isApplied(); return SHC_rv; - // splicer end class.View.method.is_applied + // splicer end class.View.method.isApplied } bool SIDRE_View_is_described(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.is_described + // splicer begin class.View.method.isDescribed bool SHC_rv = SH_this->isDescribed(); return SHC_rv; - // splicer end class.View.method.is_described + // splicer end class.View.method.isDescribed } bool SIDRE_View_is_empty(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.is_empty + // splicer begin class.View.method.isEmpty bool SHC_rv = SH_this->isEmpty(); return SHC_rv; - // splicer end class.View.method.is_empty + // splicer end class.View.method.isEmpty } bool SIDRE_View_is_opaque(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.is_opaque + // splicer begin class.View.method.isOpaque bool SHC_rv = SH_this->isOpaque(); return SHC_rv; - // splicer end class.View.method.is_opaque + // splicer end class.View.method.isOpaque } bool SIDRE_View_is_scalar(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.is_scalar + // splicer begin class.View.method.isScalar bool SHC_rv = SH_this->isScalar(); return SHC_rv; - // splicer end class.View.method.is_scalar + // splicer end class.View.method.isScalar } bool SIDRE_View_is_string(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.is_string + // splicer begin class.View.method.isString bool SHC_rv = SH_this->isString(); return SHC_rv; - // splicer end class.View.method.is_string + // splicer end class.View.method.isString } SIDRE_TypeIDint SIDRE_View_get_type_id(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_type_id + // splicer begin class.View.method.getTypeID axom::sidre::TypeID SHCXX_rv = SH_this->getTypeID(); SIDRE_TypeIDint SHC_rv = static_cast(SHCXX_rv); return SHC_rv; - // splicer end class.View.method.get_type_id + // splicer end class.View.method.getTypeID } size_t SIDRE_View_get_total_bytes(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_total_bytes + // splicer begin class.View.method.getTotalBytes size_t SHC_rv = SH_this->getTotalBytes(); return SHC_rv; - // splicer end class.View.method.get_total_bytes + // splicer end class.View.method.getTotalBytes } size_t SIDRE_View_get_num_elements(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_num_elements + // splicer begin class.View.method.getNumElements size_t SHC_rv = SH_this->getNumElements(); return SHC_rv; - // splicer end class.View.method.get_num_elements + // splicer end class.View.method.getNumElements } size_t SIDRE_View_get_bytes_per_element(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_bytes_per_element + // splicer begin class.View.method.getBytesPerElement size_t SHC_rv = SH_this->getBytesPerElement(); return SHC_rv; - // splicer end class.View.method.get_bytes_per_element + // splicer end class.View.method.getBytesPerElement } size_t SIDRE_View_get_offset(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_offset + // splicer begin class.View.method.getOffset size_t SHC_rv = SH_this->getOffset(); return SHC_rv; - // splicer end class.View.method.get_offset + // splicer end class.View.method.getOffset } size_t SIDRE_View_get_stride(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_stride + // splicer begin class.View.method.getStride size_t SHC_rv = SH_this->getStride(); return SHC_rv; - // splicer end class.View.method.get_stride + // splicer end class.View.method.getStride } int SIDRE_View_get_num_dimensions(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_num_dimensions + // splicer begin class.View.method.getNumDimensions int SHC_rv = SH_this->getNumDimensions(); return SHC_rv; - // splicer end class.View.method.get_num_dimensions + // splicer end class.View.method.getNumDimensions } int SIDRE_View_get_shape(const SIDRE_View *self, int ndims, SIDRE_IndexType *shape) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_shape + // splicer begin class.View.method.getShape int SHC_rv = SH_this->getShape(ndims, shape); return SHC_rv; - // splicer end class.View.method.get_shape + // splicer end class.View.method.getShape } void SIDRE_View_allocate_simple(SIDRE_View *self) @@ -339,11 +356,11 @@ void SIDRE_View_reallocate(SIDRE_View *self, SIDRE_IndexType num_elems) void SIDRE_View_attach_buffer_only(SIDRE_View *self, SIDRE_Buffer *buff) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.attach_buffer_only + // splicer begin class.View.method.attachBuffer_only axom::sidre::Buffer *SHCXX_buff = static_cast(buff->addr); SH_this->attachBuffer(SHCXX_buff); - // splicer end class.View.method.attach_buffer_only + // splicer end class.View.method.attachBuffer_only } void SIDRE_View_attach_buffer_type(SIDRE_View *self, @@ -352,12 +369,40 @@ void SIDRE_View_attach_buffer_type(SIDRE_View *self, SIDRE_Buffer *buff) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.attach_buffer_type + // splicer begin class.View.method.attachBuffer_type + axom::sidre::TypeID SHCXX_type = static_cast(type); + axom::sidre::Buffer *SHCXX_buff = + static_cast(buff->addr); + SH_this->attachBuffer(SHCXX_type, num_elems, SHCXX_buff); + // splicer end class.View.method.attachBuffer_type +} + +void SIDRE_View_attach_buffer_type_int32_t(SIDRE_View *self, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_Buffer *buff) +{ + axom::sidre::View *SH_this = static_cast(self->addr); + // splicer begin class.View.method.attachBuffer_type_int32_t + axom::sidre::TypeID SHCXX_type = static_cast(type); + axom::sidre::Buffer *SHCXX_buff = + static_cast(buff->addr); + SH_this->attachBuffer(SHCXX_type, num_elems, SHCXX_buff); + // splicer end class.View.method.attachBuffer_type_int32_t +} + +void SIDRE_View_attach_buffer_type_int64_t(SIDRE_View *self, + SIDRE_TypeID type, + int64_t num_elems, + SIDRE_Buffer *buff) +{ + axom::sidre::View *SH_this = static_cast(self->addr); + // splicer begin class.View.method.attachBuffer_type_int64_t axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::Buffer *SHCXX_buff = static_cast(buff->addr); SH_this->attachBuffer(SHCXX_type, num_elems, SHCXX_buff); - // splicer end class.View.method.attach_buffer_type + // splicer end class.View.method.attachBuffer_type_int64_t } void SIDRE_View_attach_buffer_shape(SIDRE_View *self, @@ -367,12 +412,12 @@ void SIDRE_View_attach_buffer_shape(SIDRE_View *self, SIDRE_Buffer *buff) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.attach_buffer_shape + // splicer begin class.View.method.attachBuffer_shape axom::sidre::TypeID SHCXX_type = static_cast(type); axom::sidre::Buffer *SHCXX_buff = static_cast(buff->addr); SH_this->attachBuffer(SHCXX_type, ndims, shape, SHCXX_buff); - // splicer end class.View.method.attach_buffer_shape + // splicer end class.View.method.attachBuffer_shape } void SIDRE_View_clear(SIDRE_View *self) @@ -471,59 +516,61 @@ void SIDRE_View_apply_type_shape(SIDRE_View *self, void SIDRE_View_set_scalar_int(SIDRE_View *self, int value) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_scalar_int + // splicer begin class.View.method.setScalar_int SH_this->setScalar(value); - // splicer end class.View.method.set_scalar_int + // splicer end class.View.method.setScalar_int } void SIDRE_View_set_scalar_long(SIDRE_View *self, long value) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_scalar_long + // splicer begin class.View.method.setScalar_long SH_this->setScalar(value); - // splicer end class.View.method.set_scalar_long + // splicer end class.View.method.setScalar_long } void SIDRE_View_set_scalar_float(SIDRE_View *self, float value) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_scalar_float + // splicer begin class.View.method.setScalar_float SH_this->setScalar(value); - // splicer end class.View.method.set_scalar_float + // splicer end class.View.method.setScalar_float } void SIDRE_View_set_scalar_double(SIDRE_View *self, double value) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_scalar_double + // splicer begin class.View.method.setScalar_double SH_this->setScalar(value); - // splicer end class.View.method.set_scalar_double + // splicer end class.View.method.setScalar_double } void SIDRE_View_set_string(SIDRE_View *self, const char *value) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_string + // splicer begin class.View.method.setString const std::string SHCXX_value(value); SH_this->setString(SHCXX_value); - // splicer end class.View.method.set_string + // splicer end class.View.method.setString } -void SIDRE_View_set_string_bufferify(SIDRE_View *self, const char *value, int Lvalue) +void SIDRE_View_set_string_bufferify(SIDRE_View *self, + char *value, + int SHT_value_len) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_string_bufferify - const std::string SHCXX_value(value, Lvalue); + // splicer begin class.View.method.setString_bufferify + const std::string SHCXX_value(value, ShroudLenTrim(value, SHT_value_len)); SH_this->setString(SHCXX_value); - // splicer end class.View.method.set_string_bufferify + // splicer end class.View.method.setString_bufferify } void SIDRE_View_set_external_data_ptr_only(SIDRE_View *self, void *external_ptr) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_external_data_ptr_only + // splicer begin class.View.method.setExternalDataPtr_only SH_this->setExternalDataPtr(external_ptr); - // splicer end class.View.method.set_external_data_ptr_only + // splicer end class.View.method.setExternalDataPtr_only } void SIDRE_View_set_external_data_ptr_type(SIDRE_View *self, @@ -532,10 +579,34 @@ void SIDRE_View_set_external_data_ptr_type(SIDRE_View *self, void *external_ptr) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_external_data_ptr_type + // splicer begin class.View.method.setExternalDataPtr_type + axom::sidre::TypeID SHCXX_type = static_cast(type); + SH_this->setExternalDataPtr(SHCXX_type, num_elems, external_ptr); + // splicer end class.View.method.setExternalDataPtr_type +} + +void SIDRE_View_set_external_data_ptr_type_int32_t(SIDRE_View *self, + SIDRE_TypeID type, + int32_t num_elems, + void *external_ptr) +{ + axom::sidre::View *SH_this = static_cast(self->addr); + // splicer begin class.View.method.setExternalDataPtr_type_int32_t + axom::sidre::TypeID SHCXX_type = static_cast(type); + SH_this->setExternalDataPtr(SHCXX_type, num_elems, external_ptr); + // splicer end class.View.method.setExternalDataPtr_type_int32_t +} + +void SIDRE_View_set_external_data_ptr_type_int64_t(SIDRE_View *self, + SIDRE_TypeID type, + int64_t num_elems, + void *external_ptr) +{ + axom::sidre::View *SH_this = static_cast(self->addr); + // splicer begin class.View.method.setExternalDataPtr_type_int64_t axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->setExternalDataPtr(SHCXX_type, num_elems, external_ptr); - // splicer end class.View.method.set_external_data_ptr_type + // splicer end class.View.method.setExternalDataPtr_type_int64_t } void SIDRE_View_set_external_data_ptr_shape(SIDRE_View *self, @@ -545,74 +616,74 @@ void SIDRE_View_set_external_data_ptr_shape(SIDRE_View *self, void *external_ptr) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.set_external_data_ptr_shape + // splicer begin class.View.method.setExternalDataPtr_shape axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->setExternalDataPtr(SHCXX_type, ndims, shape, external_ptr); - // splicer end class.View.method.set_external_data_ptr_shape + // splicer end class.View.method.setExternalDataPtr_shape } const char *SIDRE_View_get_string(SIDRE_View *self) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_string + // splicer begin class.View.method.getString const char *SHC_rv = SH_this->getString(); return SHC_rv; - // splicer end class.View.method.get_string + // splicer end class.View.method.getString } -void SIDRE_View_get_string_bufferify(SIDRE_View *self, char *name, int Nname) +void SIDRE_View_get_string_bufferify(SIDRE_View *self, char *name, int SHT_name_len) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_string_bufferify + // splicer begin class.View.method.getString_bufferify const char *SHC_rv = SH_this->getString(); - ShroudStrCopy(name, Nname, SHC_rv, -1); - // splicer end class.View.method.get_string_bufferify + ShroudStrCopy(name, SHT_name_len, SHC_rv, -1); + // splicer end class.View.method.getString_bufferify } int SIDRE_View_get_data_int(SIDRE_View *self) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_data_int + // splicer begin class.View.method.getData_int int SHC_rv = SH_this->getData(); return SHC_rv; - // splicer end class.View.method.get_data_int + // splicer end class.View.method.getData_int } long SIDRE_View_get_data_long(SIDRE_View *self) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_data_long + // splicer begin class.View.method.getData_long long SHC_rv = SH_this->getData(); return SHC_rv; - // splicer end class.View.method.get_data_long + // splicer end class.View.method.getData_long } float SIDRE_View_get_data_float(SIDRE_View *self) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_data_float + // splicer begin class.View.method.getData_float float SHC_rv = SH_this->getData(); return SHC_rv; - // splicer end class.View.method.get_data_float + // splicer end class.View.method.getData_float } double SIDRE_View_get_data_double(SIDRE_View *self) { axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_data_double + // splicer begin class.View.method.getData_double double SHC_rv = SH_this->getData(); return SHC_rv; - // splicer end class.View.method.get_data_double + // splicer end class.View.method.getData_double } void *SIDRE_View_get_void_ptr(const SIDRE_View *self) { const axom::sidre::View *SH_this = static_cast(self->addr); - // splicer begin class.View.method.get_void_ptr + // splicer begin class.View.method.getVoidPtr void *SHC_rv = SH_this->getVoidPtr(); return SHC_rv; - // splicer end class.View.method.get_void_ptr + // splicer end class.View.method.getVoidPtr } void SIDRE_View_print(const SIDRE_View *self) @@ -635,12 +706,13 @@ bool SIDRE_View_rename(SIDRE_View *self, const char *new_name) } bool SIDRE_View_rename_bufferify(SIDRE_View *self, - const char *new_name, - int Lnew_name) + char *new_name, + int SHT_new_name_len) { axom::sidre::View *SH_this = static_cast(self->addr); // splicer begin class.View.method.rename_bufferify - const std::string SHCXX_new_name(new_name, Lnew_name); + const std::string SHCXX_new_name(new_name, + ShroudLenTrim(new_name, SHT_new_name_len)); bool SHC_rv = SH_this->rename(SHCXX_new_name); return SHC_rv; // splicer end class.View.method.rename_bufferify diff --git a/src/axom/sidre/interface/c_fortran/wrapView.h b/src/axom/sidre/interface/c_fortran/wrapView.h index 877bc75ea8..8e8227a1ec 100644 --- a/src/axom/sidre/interface/c_fortran/wrapView.h +++ b/src/axom/sidre/interface/c_fortran/wrapView.h @@ -1,7 +1,7 @@ // wrapView.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,15 +14,18 @@ #ifndef WRAPVIEW_H #define WRAPVIEW_H +#include "wrapSidre.h" #include "axom/sidre/interface/SidreTypes.h" -#include "typesSidre.h" #ifdef __cplusplus - #include #include "axom/sidre/core/SidreTypes.hpp" + #include + #include #else #include #include + #include #endif +#include "typesSidre.h" // splicer begin class.View.CXX_declarations // splicer end class.View.CXX_declarations @@ -34,164 +37,186 @@ extern "C" { // splicer begin class.View.C_declarations // splicer end class.View.C_declarations -SIDRE_IndexType SIDRE_View_get_index(SIDRE_View* self); +SIDRE_IndexType SIDRE_View_get_index(SIDRE_View *self); -const char* SIDRE_View_get_name(const SIDRE_View* self); +const char *SIDRE_View_get_name(const SIDRE_View *self); -void SIDRE_View_get_name_bufferify(const SIDRE_View* self, - char* SHF_rv, - int NSHF_rv); +void SIDRE_View_get_name_bufferify(const SIDRE_View *self, + char *SHC_rv, + int SHT_rv_len); -void SIDRE_View_get_path_bufferify(const SIDRE_View* self, - char* SHF_rv, - int NSHF_rv); +void SIDRE_View_get_path_bufferify(const SIDRE_View *self, + char *SHC_rv, + int SHT_rv_len); -void SIDRE_View_get_path_name_bufferify(const SIDRE_View* self, - char* SHF_rv, - int NSHF_rv); +void SIDRE_View_get_path_name_bufferify(const SIDRE_View *self, + char *SHC_rv, + int SHT_rv_len); -SIDRE_Group* SIDRE_View_get_owning_group(SIDRE_View* self, SIDRE_Group* SHC_rv); +SIDRE_Group *SIDRE_View_get_owning_group(SIDRE_View *self, SIDRE_Group *SHC_rv); -bool SIDRE_View_has_buffer(const SIDRE_View* self); +bool SIDRE_View_has_buffer(const SIDRE_View *self); -SIDRE_Buffer* SIDRE_View_get_buffer(SIDRE_View* self, SIDRE_Buffer* SHC_rv); +SIDRE_Buffer *SIDRE_View_get_buffer(SIDRE_View *self, SIDRE_Buffer *SHC_rv); -bool SIDRE_View_is_external(const SIDRE_View* self); +bool SIDRE_View_is_external(const SIDRE_View *self); -bool SIDRE_View_is_allocated(SIDRE_View* self); +bool SIDRE_View_is_allocated(SIDRE_View *self); -bool SIDRE_View_is_applied(const SIDRE_View* self); +bool SIDRE_View_is_applied(const SIDRE_View *self); -bool SIDRE_View_is_described(const SIDRE_View* self); +bool SIDRE_View_is_described(const SIDRE_View *self); -bool SIDRE_View_is_empty(const SIDRE_View* self); +bool SIDRE_View_is_empty(const SIDRE_View *self); -bool SIDRE_View_is_opaque(const SIDRE_View* self); +bool SIDRE_View_is_opaque(const SIDRE_View *self); -bool SIDRE_View_is_scalar(const SIDRE_View* self); +bool SIDRE_View_is_scalar(const SIDRE_View *self); -bool SIDRE_View_is_string(const SIDRE_View* self); +bool SIDRE_View_is_string(const SIDRE_View *self); -SIDRE_TypeIDint SIDRE_View_get_type_id(const SIDRE_View* self); +SIDRE_TypeIDint SIDRE_View_get_type_id(const SIDRE_View *self); -size_t SIDRE_View_get_total_bytes(const SIDRE_View* self); +size_t SIDRE_View_get_total_bytes(const SIDRE_View *self); -size_t SIDRE_View_get_num_elements(const SIDRE_View* self); +size_t SIDRE_View_get_num_elements(const SIDRE_View *self); -size_t SIDRE_View_get_bytes_per_element(const SIDRE_View* self); +size_t SIDRE_View_get_bytes_per_element(const SIDRE_View *self); -size_t SIDRE_View_get_offset(const SIDRE_View* self); +size_t SIDRE_View_get_offset(const SIDRE_View *self); -size_t SIDRE_View_get_stride(const SIDRE_View* self); +size_t SIDRE_View_get_stride(const SIDRE_View *self); -int SIDRE_View_get_num_dimensions(const SIDRE_View* self); +int SIDRE_View_get_num_dimensions(const SIDRE_View *self); -int SIDRE_View_get_shape(const SIDRE_View* self, int ndims, SIDRE_IndexType* shape); +int SIDRE_View_get_shape(const SIDRE_View *self, int ndims, SIDRE_IndexType *shape); -void SIDRE_View_allocate_simple(SIDRE_View* self); +void SIDRE_View_allocate_simple(SIDRE_View *self); -void SIDRE_View_allocate_from_type(SIDRE_View* self, +void SIDRE_View_allocate_from_type(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems); -void SIDRE_View_reallocate(SIDRE_View* self, SIDRE_IndexType num_elems); +void SIDRE_View_reallocate(SIDRE_View *self, SIDRE_IndexType num_elems); -void SIDRE_View_attach_buffer_only(SIDRE_View* self, SIDRE_Buffer* buff); +void SIDRE_View_attach_buffer_only(SIDRE_View *self, SIDRE_Buffer *buff); -void SIDRE_View_attach_buffer_type(SIDRE_View* self, +void SIDRE_View_attach_buffer_type(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer* buff); + SIDRE_Buffer *buff); + +void SIDRE_View_attach_buffer_type_int32_t(SIDRE_View *self, + SIDRE_TypeID type, + int32_t num_elems, + SIDRE_Buffer *buff); + +void SIDRE_View_attach_buffer_type_int64_t(SIDRE_View *self, + SIDRE_TypeID type, + int64_t num_elems, + SIDRE_Buffer *buff); -void SIDRE_View_attach_buffer_shape(SIDRE_View* self, +void SIDRE_View_attach_buffer_shape(SIDRE_View *self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - SIDRE_Buffer* buff); + const SIDRE_IndexType *shape, + SIDRE_Buffer *buff); -void SIDRE_View_clear(SIDRE_View* self); +void SIDRE_View_clear(SIDRE_View *self); -void SIDRE_View_apply_0(SIDRE_View* self); +void SIDRE_View_apply_0(SIDRE_View *self); -void SIDRE_View_apply_nelems(SIDRE_View* self, SIDRE_IndexType num_elems); +void SIDRE_View_apply_nelems(SIDRE_View *self, SIDRE_IndexType num_elems); -void SIDRE_View_apply_nelems_offset(SIDRE_View* self, +void SIDRE_View_apply_nelems_offset(SIDRE_View *self, SIDRE_IndexType num_elems, SIDRE_IndexType offset); -void SIDRE_View_apply_nelems_offset_stride(SIDRE_View* self, +void SIDRE_View_apply_nelems_offset_stride(SIDRE_View *self, SIDRE_IndexType num_elems, SIDRE_IndexType offset, SIDRE_IndexType stride); -void SIDRE_View_apply_type_nelems(SIDRE_View* self, +void SIDRE_View_apply_type_nelems(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems); -void SIDRE_View_apply_type_nelems_offset(SIDRE_View* self, +void SIDRE_View_apply_type_nelems_offset(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems, SIDRE_IndexType offset); -void SIDRE_View_apply_type_nelems_offset_stride(SIDRE_View* self, +void SIDRE_View_apply_type_nelems_offset_stride(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems, SIDRE_IndexType offset, SIDRE_IndexType stride); -void SIDRE_View_apply_type_shape(SIDRE_View* self, +void SIDRE_View_apply_type_shape(SIDRE_View *self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape); + const SIDRE_IndexType *shape); -void SIDRE_View_set_scalar_int(SIDRE_View* self, int value); +void SIDRE_View_set_scalar_int(SIDRE_View *self, int value); -void SIDRE_View_set_scalar_long(SIDRE_View* self, long value); +void SIDRE_View_set_scalar_long(SIDRE_View *self, long value); -void SIDRE_View_set_scalar_float(SIDRE_View* self, float value); +void SIDRE_View_set_scalar_float(SIDRE_View *self, float value); -void SIDRE_View_set_scalar_double(SIDRE_View* self, double value); +void SIDRE_View_set_scalar_double(SIDRE_View *self, double value); -void SIDRE_View_set_string(SIDRE_View* self, const char* value); +void SIDRE_View_set_string(SIDRE_View *self, const char *value); -void SIDRE_View_set_string_bufferify(SIDRE_View* self, - const char* value, - int Lvalue); +void SIDRE_View_set_string_bufferify(SIDRE_View *self, + char *value, + int SHT_value_len); -void SIDRE_View_set_external_data_ptr_only(SIDRE_View* self, void* external_ptr); +void SIDRE_View_set_external_data_ptr_only(SIDRE_View *self, void *external_ptr); -void SIDRE_View_set_external_data_ptr_type(SIDRE_View* self, +void SIDRE_View_set_external_data_ptr_type(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - void* external_ptr); + void *external_ptr); + +void SIDRE_View_set_external_data_ptr_type_int32_t(SIDRE_View *self, + SIDRE_TypeID type, + int32_t num_elems, + void *external_ptr); + +void SIDRE_View_set_external_data_ptr_type_int64_t(SIDRE_View *self, + SIDRE_TypeID type, + int64_t num_elems, + void *external_ptr); -void SIDRE_View_set_external_data_ptr_shape(SIDRE_View* self, +void SIDRE_View_set_external_data_ptr_shape(SIDRE_View *self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType* shape, - void* external_ptr); + const SIDRE_IndexType *shape, + void *external_ptr); -const char* SIDRE_View_get_string(SIDRE_View* self); +const char *SIDRE_View_get_string(SIDRE_View *self); -void SIDRE_View_get_string_bufferify(SIDRE_View* self, char* name, int Nname); +void SIDRE_View_get_string_bufferify(SIDRE_View *self, + char *name, + int SHT_name_len); -int SIDRE_View_get_data_int(SIDRE_View* self); +int SIDRE_View_get_data_int(SIDRE_View *self); -long SIDRE_View_get_data_long(SIDRE_View* self); +long SIDRE_View_get_data_long(SIDRE_View *self); -float SIDRE_View_get_data_float(SIDRE_View* self); +float SIDRE_View_get_data_float(SIDRE_View *self); -double SIDRE_View_get_data_double(SIDRE_View* self); +double SIDRE_View_get_data_double(SIDRE_View *self); -void* SIDRE_View_get_void_ptr(const SIDRE_View* self); +void *SIDRE_View_get_void_ptr(const SIDRE_View *self); -void SIDRE_View_print(const SIDRE_View* self); +void SIDRE_View_print(const SIDRE_View *self); -bool SIDRE_View_rename(SIDRE_View* self, const char* new_name); +bool SIDRE_View_rename(SIDRE_View *self, const char *new_name); -bool SIDRE_View_rename_bufferify(SIDRE_View* self, - const char* new_name, - int Lnew_name); +bool SIDRE_View_rename_bufferify(SIDRE_View *self, + char *new_name, + int SHT_new_name_len); #ifdef __cplusplus } diff --git a/src/axom/sidre/interface/c_fortran/wrapfsidre.F b/src/axom/sidre/interface/c_fortran/wrapfsidre.F index 92867d6357..e360720ea4 100644 --- a/src/axom/sidre/interface/c_fortran/wrapfsidre.F +++ b/src/axom/sidre/interface/c_fortran/wrapfsidre.F @@ -1,7 +1,7 @@ ! wrapfsidre.F -! This file is generated by Shroud 0.12.2. Do not edit. +! This file is generated by Shroud 0.13.0. Do not edit. ! -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) @@ -13,7 +13,7 @@ #include "axom/config.hpp" ! splicer end file_top module axom_sidre - use iso_c_binding, only : C_INT, C_NULL_PTR, C_PTR + use iso_c_binding, only : C_INT, C_INT64_T, C_NULL_PTR, C_PTR, C_SHORT ! splicer begin module_use use conduit, only : & CONDUIT_EMPTY_ID, & @@ -41,12 +41,6 @@ module axom_sidre ! splicer begin module_top integer, parameter :: MAXNAMESIZE = 128 -#if defined(AXOM_USE_64BIT_INDEXTYPE) && !defined(AXOM_NO_INT64_T) - integer, parameter :: SIDRE_IndexType = C_INT64_T -#else - integer, parameter :: SIDRE_IndexType = C_INT32_T -#endif - integer, parameter :: TypeID = C_SHORT integer, parameter :: TypeIDint = C_INT @@ -69,17 +63,36 @@ module axom_sidre SIDRE_ULONG_ID = CONDUIT_ULONG_ID, & SIDRE_FLOAT_ID = CONDUIT_FLOAT_ID, & SIDRE_DOUBLE_ID = CONDUIT_DOUBLE_ID - - integer, parameter :: invalid_index = -1_SIDRE_IndexType ! splicer end module_top - type, bind(C) :: SIDRE_SHROUD_buffer_capsule + ! helper capsule_data_helper + type, bind(C) :: SIDRE_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SIDRE_SHROUD_buffer_capsule + end type SIDRE_SHROUD_capsule_data + + ! typedef axom::sidre::IndexType + ! splicer begin typedef.IndexType +#if defined(AXOM_USE_64BIT_INDEXTYPE) && !defined(AXOM_NO_INT64_T) + integer, parameter :: SIDRE_IndexType = C_INT64_T +#else + integer, parameter :: SIDRE_IndexType = C_INT32_T +#endif + integer, parameter :: invalid_index = -1_SIDRE_IndexType + ! splicer end typedef.IndexType + + ! typedef axom::sidre::TypeID + ! splicer begin typedef.TypeID + integer, parameter :: type_id = C_SHORT + ! splicer end typedef.TypeID + + ! typedef axom::sidre::TypeIDint + ! splicer begin typedef.TypeIDint + integer, parameter :: type_i_dint = C_INT + ! splicer end typedef.TypeIDint type SidreBuffer - type(SIDRE_SHROUD_buffer_capsule) :: cxxmem + type(SIDRE_SHROUD_capsule_data) :: cxxmem ! splicer begin class.Buffer.component_part ! splicer end class.Buffer.component_part contains @@ -109,13 +122,8 @@ module axom_sidre ! splicer end class.Buffer.type_bound_procedure_part end type SidreBuffer - type, bind(C) :: SIDRE_SHROUD_group_capsule - type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory - integer(C_INT) :: idtor = 0 ! index of destructor - end type SIDRE_SHROUD_group_capsule - type SidreGroup - type(SIDRE_SHROUD_group_capsule) :: cxxmem + type(SIDRE_SHROUD_capsule_data) :: cxxmem ! splicer begin class.Group.component_part ! splicer end class.Group.component_part contains @@ -332,13 +340,8 @@ module axom_sidre ! splicer end class.Group.type_bound_procedure_part end type SidreGroup - type, bind(C) :: SIDRE_SHROUD_view_capsule - type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory - integer(C_INT) :: idtor = 0 ! index of destructor - end type SIDRE_SHROUD_view_capsule - type SidreView - type(SIDRE_SHROUD_view_capsule) :: cxxmem + type(SIDRE_SHROUD_capsule_data) :: cxxmem ! splicer begin class.View.component_part ! splicer end class.View.component_part contains @@ -505,13 +508,8 @@ module axom_sidre ! splicer end class.View.type_bound_procedure_part end type SidreView - type, bind(C) :: SIDRE_SHROUD_datastore_capsule - type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory - integer(C_INT) :: idtor = 0 ! index of destructor - end type SIDRE_SHROUD_datastore_capsule - type SidreDataStore - type(SIDRE_SHROUD_datastore_capsule) :: cxxmem + type(SIDRE_SHROUD_capsule_data) :: cxxmem ! splicer begin class.DataStore.component_part ! splicer end class.DataStore.component_part contains @@ -566,9 +564,9 @@ module axom_sidre pure function c_buffer_get_index(self) & result(SHT_rv) & bind(C, name="SIDRE_Buffer_get_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType) :: SHT_rv end function c_buffer_get_index @@ -576,9 +574,9 @@ pure function c_buffer_get_num_views(self) & result(SHT_rv) & bind(C, name="SIDRE_Buffer_get_num_views") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_buffer_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_buffer_get_num_views @@ -586,18 +584,18 @@ function c_buffer_get_void_ptr(self) & result(SHT_rv) & bind(C, name="SIDRE_Buffer_get_void_ptr") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_buffer_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self type(C_PTR) :: SHT_rv end function c_buffer_get_void_ptr pure function c_buffer_get_type_id(self) & result(SHT_rv) & bind(C, name="SIDRE_Buffer_get_type_id") - import :: SIDRE_SHROUD_buffer_capsule, TypeIDint + import :: SIDRE_SHROUD_capsule_data, TypeIDint implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeIDint) :: SHT_rv end function c_buffer_get_type_id @@ -605,9 +603,9 @@ pure function c_buffer_get_num_elements(self) & result(SHT_rv) & bind(C, name="SIDRE_Buffer_get_num_elements") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_buffer_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_buffer_get_num_elements @@ -615,9 +613,9 @@ pure function c_buffer_get_total_bytes(self) & result(SHT_rv) & bind(C, name="SIDRE_Buffer_get_total_bytes") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_buffer_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_buffer_get_total_bytes @@ -625,61 +623,58 @@ pure function c_buffer_get_bytes_per_element(self) & result(SHT_rv) & bind(C, name="SIDRE_Buffer_get_bytes_per_element") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_buffer_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_buffer_get_bytes_per_element subroutine c_buffer_describe(self, type, num_elems) & bind(C, name="SIDRE_Buffer_describe") - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems end subroutine c_buffer_describe subroutine c_buffer_allocate_existing(self) & bind(C, name="SIDRE_Buffer_allocate_existing") - import :: SIDRE_SHROUD_buffer_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self end subroutine c_buffer_allocate_existing subroutine c_buffer_allocate_from_type(self, type, num_elems) & bind(C, name="SIDRE_Buffer_allocate_from_type") - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems end subroutine c_buffer_allocate_from_type subroutine c_buffer_reallocate(self, num_elems) & bind(C, name="SIDRE_Buffer_reallocate") - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: num_elems end subroutine c_buffer_reallocate subroutine c_buffer_print(self) & bind(C, name="SIDRE_Buffer_print") - import :: SIDRE_SHROUD_buffer_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_buffer_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self end subroutine c_buffer_print - ! splicer begin class.Buffer.additional_interfaces - ! splicer end class.Buffer.additional_interfaces - function c_group_get_index(self) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_index @@ -687,61 +682,61 @@ pure function c_group_get_name(self) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_name") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self type(C_PTR) SHT_rv end function c_group_get_name - subroutine c_group_get_name_bufferify(self, SHF_rv, NSHF_rv) & + subroutine c_group_get_name_bufferify(self, SHT_rv, SHT_rv_len) & bind(C, name="SIDRE_Group_get_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) - integer(C_INT), value, intent(IN) :: NSHF_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len end subroutine c_group_get_name_bufferify - subroutine c_group_get_path_bufferify(self, SHF_rv, NSHF_rv) & + subroutine c_group_get_path_bufferify(self, SHT_rv, SHT_rv_len) & bind(C, name="SIDRE_Group_get_path_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) - integer(C_INT), value, intent(IN) :: NSHF_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len end subroutine c_group_get_path_bufferify - subroutine c_group_get_path_name_bufferify(self, SHF_rv, & - NSHF_rv) & + subroutine c_group_get_path_name_bufferify(self, SHT_rv, & + SHT_rv_len) & bind(C, name="SIDRE_Group_get_path_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) - integer(C_INT), value, intent(IN) :: NSHF_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len end subroutine c_group_get_path_name_bufferify - function c_group_get_parent(self, SHT_crv) & - result(SHT_rv) & + function c_group_get_parent(self, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_get_parent") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_get_parent pure function c_group_get_num_groups(self) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_num_groups") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_group_get_num_groups @@ -749,43 +744,44 @@ pure function c_group_get_num_views(self) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_num_views") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_group_get_num_views - function c_group_get_data_store(self, SHT_crv) & - result(SHT_rv) & + function c_group_get_data_store(self, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_get_data_store") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_datastore_capsule, SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - type(SIDRE_SHROUD_datastore_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_get_data_store pure function c_group_has_view(self, path) & result(SHT_rv) & bind(C, name="SIDRE_Group_has_view") use iso_c_binding, only : C_BOOL, C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) logical(C_BOOL) :: SHT_rv end function c_group_has_view - pure function c_group_has_view_bufferify(self, path, Lpath) & + pure function c_group_has_view_bufferify(self, path, & + SHT_path_len) & result(SHT_rv) & bind(C, name="SIDRE_Group_has_view_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len logical(C_BOOL) :: SHT_rv end function c_group_has_view_bufferify @@ -793,23 +789,23 @@ pure function c_group_has_child_view(self, name) & result(SHT_rv) & bind(C, name="SIDRE_Group_has_child_view") use iso_c_binding, only : C_BOOL, C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) logical(C_BOOL) :: SHT_rv end function c_group_has_child_view pure function c_group_has_child_view_bufferify(self, name, & - Lname) & + SHT_name_len) & result(SHT_rv) & bind(C, name="SIDRE_Group_has_child_view_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) - integer(C_INT), value, intent(IN) :: Lname + integer(C_INT), value, intent(IN) :: SHT_name_len logical(C_BOOL) :: SHT_rv end function c_group_has_child_view_bufferify @@ -817,23 +813,23 @@ pure function c_group_get_view_index(self, name) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_view_index") use iso_c_binding, only : C_CHAR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_view_index pure function c_group_get_view_index_bufferify(self, name, & - Lname) & + SHT_name_len) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_view_index_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) - integer(C_INT), value, intent(IN) :: Lname + integer(C_INT), value, intent(IN) :: SHT_name_len integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_view_index_bufferify @@ -841,666 +837,773 @@ pure function c_group_get_view_name(self, idx) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_view_name") use iso_c_binding, only : C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx type(C_PTR) SHT_rv end function c_group_get_view_name - subroutine c_group_get_view_name_bufferify(self, idx, SHF_rv, & - NSHF_rv) & - bind(C, name="SIDRE_Group_get_view_name_bufferify") - use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule - implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - integer(SIDRE_IndexType), value, intent(IN) :: idx - character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) - integer(C_INT), value, intent(IN) :: NSHF_rv - end subroutine c_group_get_view_name_bufferify - - function c_group_get_view_from_name(self, path, SHT_crv) & - result(SHT_rv) & + subroutine c_group_get_view_name_int32_t_bufferify(self, idx, & + SHT_rv, SHT_rv_len) & + bind(C, name="SIDRE_Group_get_view_name_int32_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT32_T + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT32_T), value, intent(IN) :: idx + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len + end subroutine c_group_get_view_name_int32_t_bufferify + + subroutine c_group_get_view_name_int64_t_bufferify(self, idx, & + SHT_rv, SHT_rv_len) & + bind(C, name="SIDRE_Group_get_view_name_int64_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT64_T + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT64_T), value, intent(IN) :: idx + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len + end subroutine c_group_get_view_name_int64_t_bufferify + + function c_group_get_view_from_name(self, path, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_get_view_from_name") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_get_view_from_name - function c_group_get_view_from_name_bufferify(self, path, Lpath, & - SHT_crv) & - result(SHT_rv) & + function c_group_get_view_from_name_bufferify(self, path, & + SHT_path_len, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_get_view_from_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + integer(C_INT), value, intent(IN) :: SHT_path_len + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_get_view_from_name_bufferify - function c_group_get_view_from_index(self, idx, SHT_crv) & - result(SHT_rv) & + function c_group_get_view_from_index(self, idx, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_get_view_from_index") use iso_c_binding, only : C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_get_view_from_index + function c_group_get_view_from_index_int32_t(self, idx, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_get_view_from_index_int32_t") + use iso_c_binding, only : C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT32_T), value, intent(IN) :: idx + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_get_view_from_index_int32_t + + function c_group_get_view_from_index_int64_t(self, idx, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_get_view_from_index_int64_t") + use iso_c_binding, only : C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT64_T), value, intent(IN) :: idx + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_get_view_from_index_int64_t + pure function c_group_get_first_valid_view_index(self) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_first_valid_view_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_first_valid_view_index pure function c_group_get_next_valid_view_index(self, idx) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_next_valid_view_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_next_valid_view_index - function c_group_create_view_empty(self, path, SHT_crv) & - result(SHT_rv) & + function c_group_create_view_empty(self, path, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_empty") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_empty - function c_group_create_view_empty_bufferify(self, path, Lpath, & - SHT_crv) & - result(SHT_rv) & + function c_group_create_view_empty_bufferify(self, path, & + SHT_path_len, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_empty_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + integer(C_INT), value, intent(IN) :: SHT_path_len + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_empty_bufferify function c_group_create_view_from_type(self, path, type, & - num_elems, SHT_crv) & - result(SHT_rv) & + num_elems, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_from_type") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_from_type - function c_group_create_view_from_type_bufferify(self, path, & - Lpath, type, num_elems, SHT_crv) & - result(SHT_rv) & - bind(C, name="SIDRE_Group_create_view_from_type_bufferify") - use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + function c_group_create_view_from_type_int32_t_bufferify(self, & + path, SHT_path_len, type, num_elems, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_create_view_from_type_int32_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(TypeID), value, intent(IN) :: type - integer(SIDRE_IndexType), value, intent(IN) :: num_elems - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_group_create_view_from_type_bufferify + integer(C_INT32_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_create_view_from_type_int32_t_bufferify + + function c_group_create_view_from_type_int64_t_bufferify(self, & + path, SHT_path_len, type, num_elems, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_create_view_from_type_int64_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(IN) :: path(*) + integer(C_INT), value, intent(IN) :: SHT_path_len + integer(TypeID), value, intent(IN) :: type + integer(C_INT64_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_create_view_from_type_int64_t_bufferify function c_group_create_view_with_shape_base(self, path, type, & - ndims, shape, SHT_crv) & - result(SHT_rv) & + ndims, shape, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_with_shape_base") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_with_shape_base function c_group_create_view_with_shape_base_bufferify(self, & - path, Lpath, type, ndims, shape, SHT_crv) & - result(SHT_rv) & + path, SHT_path_len, type, ndims, shape, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_with_shape_base_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_with_shape_base_bufferify function c_group_create_view_into_buffer(self, path, buff, & - SHT_crv) & - result(SHT_rv) & + SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_into_buffer") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_into_buffer function c_group_create_view_into_buffer_bufferify(self, path, & - Lpath, buff, SHT_crv) & - result(SHT_rv) & + SHT_path_len, buff, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_into_buffer_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + integer(C_INT), value, intent(IN) :: SHT_path_len + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_into_buffer_bufferify function c_group_create_view_from_type_and_buffer(self, path, & - type, num_elems, buff, SHT_crv) & - result(SHT_rv) & + type, num_elems, buff, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_from_type_and_buffer") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_from_type_and_buffer - function c_group_create_view_from_type_and_buffer_bufferify( & - self, path, Lpath, type, num_elems, buff, SHT_crv) & - result(SHT_rv) & - bind(C, name="SIDRE_Group_create_view_from_type_and_buffer_bufferify") - use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + function c_group_create_view_from_type_and_buffer_int32_t_bufferify( & + self, path, SHT_path_len, type, num_elems, buff, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_create_view_from_type_and_buffer_int32_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(TypeID), value, intent(IN) :: type - integer(SIDRE_IndexType), value, intent(IN) :: num_elems - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_group_create_view_from_type_and_buffer_bufferify + integer(C_INT32_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_create_view_from_type_and_buffer_int32_t_bufferify + + function c_group_create_view_from_type_and_buffer_int64_t_bufferify( & + self, path, SHT_path_len, type, num_elems, buff, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_create_view_from_type_and_buffer_int64_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(IN) :: path(*) + integer(C_INT), value, intent(IN) :: SHT_path_len + integer(TypeID), value, intent(IN) :: type + integer(C_INT64_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_create_view_from_type_and_buffer_int64_t_bufferify function c_group_create_view_with_shape_and_buffer(self, path, & - type, ndims, shape, buff, SHT_crv) & - result(SHT_rv) & + type, ndims, shape, buff, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_with_shape_and_buffer") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_with_shape_and_buffer function c_group_create_view_with_shape_and_buffer_bufferify( & - self, path, Lpath, type, ndims, shape, buff, SHT_crv) & - result(SHT_rv) & + self, path, SHT_path_len, type, ndims, shape, buff, & + SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_with_shape_and_buffer_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_with_shape_and_buffer_bufferify function c_group_create_view_external(self, path, external_ptr, & - SHT_crv) & - result(SHT_rv) & + SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_external") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) type(C_PTR), value, intent(IN) :: external_ptr - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_external function c_group_create_view_external_bufferify(self, path, & - Lpath, external_ptr, SHT_crv) & - result(SHT_rv) & + SHT_path_len, external_ptr, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_external_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len type(C_PTR), value, intent(IN) :: external_ptr - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_external_bufferify function c_group_create_view_from_type_external(self, path, & - type, num_elems, external_ptr, SHT_crv) & - result(SHT_rv) & + type, num_elems, external_ptr, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_from_type_external") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems type(C_PTR), value, intent(IN) :: external_ptr - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_from_type_external - function c_group_create_view_from_type_external_bufferify(self, & - path, Lpath, type, num_elems, external_ptr, SHT_crv) & - result(SHT_rv) & - bind(C, name="SIDRE_Group_create_view_from_type_external_bufferify") - use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + function c_group_create_view_from_type_external_int32_t_bufferify( & + self, path, SHT_path_len, type, num_elems, external_ptr, & + SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_create_view_from_type_external_int32_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(TypeID), value, intent(IN) :: type - integer(SIDRE_IndexType), value, intent(IN) :: num_elems + integer(C_INT32_T), value, intent(IN) :: num_elems type(C_PTR), value, intent(IN) :: external_ptr - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_group_create_view_from_type_external_bufferify + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_create_view_from_type_external_int32_t_bufferify + + function c_group_create_view_from_type_external_int64_t_bufferify( & + self, path, SHT_path_len, type, num_elems, external_ptr, & + SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_create_view_from_type_external_int64_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(IN) :: path(*) + integer(C_INT), value, intent(IN) :: SHT_path_len + integer(TypeID), value, intent(IN) :: type + integer(C_INT64_T), value, intent(IN) :: num_elems + type(C_PTR), value, intent(IN) :: external_ptr + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_create_view_from_type_external_int64_t_bufferify function c_group_create_view_with_shape_external(self, path, & - type, ndims, shape, external_ptr, SHT_crv) & - result(SHT_rv) & + type, ndims, shape, external_ptr, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_with_shape_external") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) type(C_PTR), value, intent(IN) :: external_ptr - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_with_shape_external function c_group_create_view_with_shape_external_bufferify(self, & - path, Lpath, type, ndims, shape, external_ptr, SHT_crv) & - result(SHT_rv) & + path, SHT_path_len, type, ndims, shape, external_ptr, & + SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_with_shape_external_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) type(C_PTR), value, intent(IN) :: external_ptr - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_with_shape_external_bufferify function c_group_create_view_and_allocate_nelems(self, path, & - type, num_elems, SHT_crv) & - result(SHT_rv) & + type, num_elems, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_and_allocate_nelems") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_and_allocate_nelems - function c_group_create_view_and_allocate_nelems_bufferify(self, & - path, Lpath, type, num_elems, SHT_crv) & - result(SHT_rv) & - bind(C, name="SIDRE_Group_create_view_and_allocate_nelems_bufferify") - use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + function c_group_create_view_and_allocate_nelems_int32_t_bufferify( & + self, path, SHT_path_len, type, num_elems, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_create_view_and_allocate_nelems_int32_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(TypeID), value, intent(IN) :: type - integer(SIDRE_IndexType), value, intent(IN) :: num_elems - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_group_create_view_and_allocate_nelems_bufferify + integer(C_INT32_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_create_view_and_allocate_nelems_int32_t_bufferify + + function c_group_create_view_and_allocate_nelems_int64_t_bufferify( & + self, path, SHT_path_len, type, num_elems, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_create_view_and_allocate_nelems_int64_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(IN) :: path(*) + integer(C_INT), value, intent(IN) :: SHT_path_len + integer(TypeID), value, intent(IN) :: type + integer(C_INT64_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_create_view_and_allocate_nelems_int64_t_bufferify function c_group_create_view_with_shape_and_allocate(self, path, & - type, ndims, shape, SHT_crv) & - result(SHT_rv) & + type, ndims, shape, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_with_shape_and_allocate") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_with_shape_and_allocate function c_group_create_view_with_shape_and_allocate_bufferify( & - self, path, Lpath, type, ndims, shape, SHT_crv) & - result(SHT_rv) & + self, path, SHT_path_len, type, ndims, shape, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_with_shape_and_allocate_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_with_shape_and_allocate_bufferify function c_group_create_view_scalar_int(self, path, value, & - SHT_crv) & - result(SHT_rv) & + SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_scalar_int") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(C_INT), value, intent(IN) :: value - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_scalar_int function c_group_create_view_scalar_bufferify_int(self, path, & - Lpath, value, SHT_crv) & - result(SHT_rv) & + SHT_path_len, value, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_scalar_bufferify_int") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(C_INT), value, intent(IN) :: value - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_scalar_bufferify_int function c_group_create_view_scalar_long(self, path, value, & - SHT_crv) & - result(SHT_rv) & + SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_scalar_long") use iso_c_binding, only : C_CHAR, C_LONG, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) integer(C_LONG), value, intent(IN) :: value - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_scalar_long function c_group_create_view_scalar_bufferify_long(self, path, & - Lpath, value, SHT_crv) & - result(SHT_rv) & + SHT_path_len, value, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_scalar_bufferify_long") use iso_c_binding, only : C_CHAR, C_INT, C_LONG, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len integer(C_LONG), value, intent(IN) :: value - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_scalar_bufferify_long function c_group_create_view_scalar_float(self, path, value, & - SHT_crv) & - result(SHT_rv) & + SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_scalar_float") use iso_c_binding, only : C_CHAR, C_FLOAT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) real(C_FLOAT), value, intent(IN) :: value - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_scalar_float function c_group_create_view_scalar_bufferify_float(self, path, & - Lpath, value, SHT_crv) & - result(SHT_rv) & + SHT_path_len, value, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_scalar_bufferify_float") use iso_c_binding, only : C_CHAR, C_FLOAT, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len real(C_FLOAT), value, intent(IN) :: value - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_scalar_bufferify_float function c_group_create_view_scalar_double(self, path, value, & - SHT_crv) & - result(SHT_rv) & + SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_scalar_double") use iso_c_binding, only : C_CHAR, C_DOUBLE, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) real(C_DOUBLE), value, intent(IN) :: value - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_scalar_double function c_group_create_view_scalar_bufferify_double(self, path, & - Lpath, value, SHT_crv) & - result(SHT_rv) & + SHT_path_len, value, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_scalar_bufferify_double") use iso_c_binding, only : C_CHAR, C_DOUBLE, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len real(C_DOUBLE), value, intent(IN) :: value - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_scalar_bufferify_double - function c_group_create_view_string(self, path, value, SHT_crv) & - result(SHT_rv) & + function c_group_create_view_string(self, path, value, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_string") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) character(kind=C_CHAR), intent(IN) :: value(*) - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_string - function c_group_create_view_string_bufferify(self, path, Lpath, & - value, Lvalue, SHT_crv) & - result(SHT_rv) & + function c_group_create_view_string_bufferify(self, path, & + SHT_path_len, value, SHT_value_len, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_view_string_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len character(kind=C_CHAR), intent(IN) :: value(*) - integer(C_INT), value, intent(IN) :: Lvalue - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + integer(C_INT), value, intent(IN) :: SHT_value_len + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_view_string_bufferify subroutine c_group_destroy_view(self, path) & bind(C, name="SIDRE_Group_destroy_view") use iso_c_binding, only : C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) end subroutine c_group_destroy_view - subroutine c_group_destroy_view_bufferify(self, path, Lpath) & + subroutine c_group_destroy_view_bufferify(self, path, & + SHT_path_len) & bind(C, name="SIDRE_Group_destroy_view_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len end subroutine c_group_destroy_view_bufferify subroutine c_group_destroy_view_and_data_name(self, path) & bind(C, name="SIDRE_Group_destroy_view_and_data_name") use iso_c_binding, only : C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) end subroutine c_group_destroy_view_and_data_name subroutine c_group_destroy_view_and_data_name_bufferify(self, & - path, Lpath) & + path, SHT_path_len) & bind(C, name="SIDRE_Group_destroy_view_and_data_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len end subroutine c_group_destroy_view_and_data_name_bufferify subroutine c_group_destroy_view_and_data_index(self, idx) & bind(C, name="SIDRE_Group_destroy_view_and_data_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx end subroutine c_group_destroy_view_and_data_index - function c_group_move_view(self, view, SHT_crv) & - result(SHT_rv) & + function c_group_move_view(self, view, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_move_view") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - type(SIDRE_SHROUD_view_capsule), intent(INOUT) :: view - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: view + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_move_view - function c_group_copy_view(self, view, SHT_crv) & - result(SHT_rv) & + function c_group_copy_view(self, view, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_copy_view") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - type(SIDRE_SHROUD_view_capsule), intent(INOUT) :: view - type(SIDRE_SHROUD_view_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: view + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_copy_view function c_group_has_group(self, path) & result(SHT_rv) & bind(C, name="SIDRE_Group_has_group") use iso_c_binding, only : C_BOOL, C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) logical(C_BOOL) :: SHT_rv end function c_group_has_group - function c_group_has_group_bufferify(self, path, Lpath) & + function c_group_has_group_bufferify(self, path, SHT_path_len) & result(SHT_rv) & bind(C, name="SIDRE_Group_has_group_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len logical(C_BOOL) :: SHT_rv end function c_group_has_group_bufferify @@ -1508,22 +1611,23 @@ function c_group_has_child_group(self, name) & result(SHT_rv) & bind(C, name="SIDRE_Group_has_child_group") use iso_c_binding, only : C_BOOL, C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) logical(C_BOOL) :: SHT_rv end function c_group_has_child_group - function c_group_has_child_group_bufferify(self, name, Lname) & + function c_group_has_child_group_bufferify(self, name, & + SHT_name_len) & result(SHT_rv) & bind(C, name="SIDRE_Group_has_child_group_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) - integer(C_INT), value, intent(IN) :: Lname + integer(C_INT), value, intent(IN) :: SHT_name_len logical(C_BOOL) :: SHT_rv end function c_group_has_child_group_bufferify @@ -1531,23 +1635,23 @@ pure function c_group_get_group_index(self, name) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_group_index") use iso_c_binding, only : C_CHAR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_group_index pure function c_group_get_group_index_bufferify(self, name, & - Lname) & + SHT_name_len) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_group_index_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) - integer(C_INT), value, intent(IN) :: Lname + integer(C_INT), value, intent(IN) :: SHT_name_len integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_group_index_bufferify @@ -1555,290 +1659,325 @@ pure function c_group_get_group_name(self, idx) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_group_name") use iso_c_binding, only : C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx type(C_PTR) SHT_rv end function c_group_get_group_name - subroutine c_group_get_group_name_bufferify(self, idx, SHF_rv, & - NSHF_rv) & - bind(C, name="SIDRE_Group_get_group_name_bufferify") - use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule - implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - integer(SIDRE_IndexType), value, intent(IN) :: idx - character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) - integer(C_INT), value, intent(IN) :: NSHF_rv - end subroutine c_group_get_group_name_bufferify - - function c_group_get_group_from_name(self, path, SHT_crv) & - result(SHT_rv) & + subroutine c_group_get_group_name_int32_t_bufferify(self, idx, & + SHT_rv, SHT_rv_len) & + bind(C, name="SIDRE_Group_get_group_name_int32_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT32_T + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT32_T), value, intent(IN) :: idx + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len + end subroutine c_group_get_group_name_int32_t_bufferify + + subroutine c_group_get_group_name_int64_t_bufferify(self, idx, & + SHT_rv, SHT_rv_len) & + bind(C, name="SIDRE_Group_get_group_name_int64_t_bufferify") + use iso_c_binding, only : C_CHAR, C_INT, C_INT64_T + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT64_T), value, intent(IN) :: idx + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len + end subroutine c_group_get_group_name_int64_t_bufferify + + function c_group_get_group_from_name(self, path, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_get_group_from_name") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_get_group_from_name function c_group_get_group_from_name_bufferify(self, path, & - Lpath, SHT_crv) & - result(SHT_rv) & + SHT_path_len, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_get_group_from_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + integer(C_INT), value, intent(IN) :: SHT_path_len + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_get_group_from_name_bufferify - function c_group_get_group_from_index(self, idx, SHT_crv) & - result(SHT_rv) & + function c_group_get_group_from_index(self, idx, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_get_group_from_index") use iso_c_binding, only : C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_get_group_from_index + function c_group_get_group_from_index_int32_t(self, idx, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_get_group_from_index_int32_t") + use iso_c_binding, only : C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT32_T), value, intent(IN) :: idx + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_get_group_from_index_int32_t + + function c_group_get_group_from_index_int64_t(self, idx, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_Group_get_group_from_index_int64_t") + use iso_c_binding, only : C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT64_T), value, intent(IN) :: idx + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_group_get_group_from_index_int64_t + pure function c_group_get_first_valid_group_index(self) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_first_valid_group_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_first_valid_group_index pure function c_group_get_next_valid_group_index(self, idx) & result(SHT_rv) & bind(C, name="SIDRE_Group_get_next_valid_group_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx integer(SIDRE_IndexType) :: SHT_rv end function c_group_get_next_valid_group_index - function c_group_create_group(self, path, SHT_crv) & - result(SHT_rv) & + function c_group_create_group(self, path, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_group") use iso_c_binding, only : C_CHAR, C_PTR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_group - function c_group_create_group_bufferify(self, path, Lpath, & - SHT_crv) & - result(SHT_rv) & + function c_group_create_group_bufferify(self, path, & + SHT_path_len, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_create_group_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + integer(C_INT), value, intent(IN) :: SHT_path_len + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_create_group_bufferify subroutine c_group_destroy_group_name(self, path) & bind(C, name="SIDRE_Group_destroy_group_name") use iso_c_binding, only : C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) end subroutine c_group_destroy_group_name subroutine c_group_destroy_group_name_bufferify(self, path, & - Lpath) & + SHT_path_len) & bind(C, name="SIDRE_Group_destroy_group_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: path(*) - integer(C_INT), value, intent(IN) :: Lpath + integer(C_INT), value, intent(IN) :: SHT_path_len end subroutine c_group_destroy_group_name_bufferify subroutine c_group_destroy_group_index(self, idx) & bind(C, name="SIDRE_Group_destroy_group_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_group_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx end subroutine c_group_destroy_group_index - function c_group_move_group(self, grp, SHT_crv) & - result(SHT_rv) & + function c_group_move_group(self, grp, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_Group_move_group") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: grp - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: grp + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_group_move_group subroutine c_group_print(self) & bind(C, name="SIDRE_Group_print") - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self end subroutine c_group_print pure function c_group_is_equivalent_to(self, other) & result(SHT_rv) & bind(C, name="SIDRE_Group_is_equivalent_to") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(IN) :: other + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: other logical(C_BOOL) :: SHT_rv end function c_group_is_equivalent_to subroutine c_group_save(self, file_path, protocol) & bind(C, name="SIDRE_Group_save") use iso_c_binding, only : C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: file_path(*) character(kind=C_CHAR), intent(IN) :: protocol(*) end subroutine c_group_save - subroutine c_group_save_bufferify(self, file_path, Lfile_path, & - protocol, Lprotocol) & + subroutine c_group_save_bufferify(self, file_path, & + SHT_file_path_len, protocol, SHT_protocol_len) & bind(C, name="SIDRE_Group_save_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: file_path(*) - integer(C_INT), value, intent(IN) :: Lfile_path + integer(C_INT), value, intent(IN) :: SHT_file_path_len character(kind=C_CHAR), intent(IN) :: protocol(*) - integer(C_INT), value, intent(IN) :: Lprotocol + integer(C_INT), value, intent(IN) :: SHT_protocol_len end subroutine c_group_save_bufferify subroutine c_group_load_0(self, file_path, protocol) & bind(C, name="SIDRE_Group_load_0") use iso_c_binding, only : C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: file_path(*) character(kind=C_CHAR), intent(IN) :: protocol(*) end subroutine c_group_load_0 - subroutine c_group_load_0_bufferify(self, file_path, Lfile_path, & - protocol, Lprotocol) & + subroutine c_group_load_0_bufferify(self, file_path, & + SHT_file_path_len, protocol, SHT_protocol_len) & bind(C, name="SIDRE_Group_load_0_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: file_path(*) - integer(C_INT), value, intent(IN) :: Lfile_path + integer(C_INT), value, intent(IN) :: SHT_file_path_len character(kind=C_CHAR), intent(IN) :: protocol(*) - integer(C_INT), value, intent(IN) :: Lprotocol + integer(C_INT), value, intent(IN) :: SHT_protocol_len end subroutine c_group_load_0_bufferify subroutine c_group_load_1(self, file_path, protocol, & preserve_contents) & bind(C, name="SIDRE_Group_load_1") use iso_c_binding, only : C_BOOL, C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: file_path(*) character(kind=C_CHAR), intent(IN) :: protocol(*) logical(C_BOOL), value, intent(IN) :: preserve_contents end subroutine c_group_load_1 - subroutine c_group_load_1_bufferify(self, file_path, Lfile_path, & - protocol, Lprotocol, preserve_contents) & + subroutine c_group_load_1_bufferify(self, file_path, & + SHT_file_path_len, protocol, SHT_protocol_len, & + preserve_contents) & bind(C, name="SIDRE_Group_load_1_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: file_path(*) - integer(C_INT), value, intent(IN) :: Lfile_path + integer(C_INT), value, intent(IN) :: SHT_file_path_len character(kind=C_CHAR), intent(IN) :: protocol(*) - integer(C_INT), value, intent(IN) :: Lprotocol + integer(C_INT), value, intent(IN) :: SHT_protocol_len logical(C_BOOL), value, intent(IN) :: preserve_contents end subroutine c_group_load_1_bufferify subroutine c_group_load_external_data(self, file_path) & bind(C, name="SIDRE_Group_load_external_data") use iso_c_binding, only : C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: file_path(*) end subroutine c_group_load_external_data subroutine c_group_load_external_data_bufferify(self, file_path, & - Lfile_path) & + SHT_file_path_len) & bind(C, name="SIDRE_Group_load_external_data_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: file_path(*) - integer(C_INT), value, intent(IN) :: Lfile_path + integer(C_INT), value, intent(IN) :: SHT_file_path_len end subroutine c_group_load_external_data_bufferify function c_group_rename(self, new_name) & result(SHT_rv) & bind(C, name="SIDRE_Group_rename") use iso_c_binding, only : C_BOOL, C_CHAR - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: new_name(*) logical(C_BOOL) :: SHT_rv end function c_group_rename - function c_group_rename_bufferify(self, new_name, Lnew_name) & + function c_group_rename_bufferify(self, new_name, & + SHT_new_name_len) & result(SHT_rv) & bind(C, name="SIDRE_Group_rename_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_group_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: new_name(*) - integer(C_INT), value, intent(IN) :: Lnew_name + integer(C_INT), value, intent(IN) :: SHT_new_name_len logical(C_BOOL) :: SHT_rv end function c_group_rename_bufferify - ! splicer begin class.Group.additional_interfaces - ! splicer end class.Group.additional_interfaces - function c_view_get_index(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_index") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType) :: SHT_rv end function c_view_get_index @@ -1846,81 +1985,82 @@ pure function c_view_get_name(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_name") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self type(C_PTR) SHT_rv end function c_view_get_name - subroutine c_view_get_name_bufferify(self, SHF_rv, NSHF_rv) & + subroutine c_view_get_name_bufferify(self, SHT_rv, SHT_rv_len) & bind(C, name="SIDRE_View_get_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self - character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) - integer(C_INT), value, intent(IN) :: NSHF_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len end subroutine c_view_get_name_bufferify - subroutine c_view_get_path_bufferify(self, SHF_rv, NSHF_rv) & + subroutine c_view_get_path_bufferify(self, SHT_rv, SHT_rv_len) & bind(C, name="SIDRE_View_get_path_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self - character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) - integer(C_INT), value, intent(IN) :: NSHF_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len end subroutine c_view_get_path_bufferify - subroutine c_view_get_path_name_bufferify(self, SHF_rv, NSHF_rv) & + subroutine c_view_get_path_name_bufferify(self, SHT_rv, & + SHT_rv_len) & bind(C, name="SIDRE_View_get_path_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self - character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) - integer(C_INT), value, intent(IN) :: NSHF_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + character(kind=C_CHAR), intent(OUT) :: SHT_rv(*) + integer(C_INT), value, intent(IN) :: SHT_rv_len end subroutine c_view_get_path_name_bufferify - function c_view_get_owning_group(self, SHT_crv) & - result(SHT_rv) & + function c_view_get_owning_group(self, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_View_get_owning_group") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_group_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_view_get_owning_group pure function c_view_has_buffer(self) & result(SHT_rv) & bind(C, name="SIDRE_View_has_buffer") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_has_buffer - function c_view_get_buffer(self, SHT_crv) & - result(SHT_rv) & + function c_view_get_buffer(self, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_View_get_buffer") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self - type(SIDRE_SHROUD_buffer_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_view_get_buffer pure function c_view_is_external(self) & result(SHT_rv) & bind(C, name="SIDRE_View_is_external") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_is_external @@ -1928,9 +2068,9 @@ function c_view_is_allocated(self) & result(SHT_rv) & bind(C, name="SIDRE_View_is_allocated") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_is_allocated @@ -1938,9 +2078,9 @@ pure function c_view_is_applied(self) & result(SHT_rv) & bind(C, name="SIDRE_View_is_applied") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_is_applied @@ -1948,9 +2088,9 @@ pure function c_view_is_described(self) & result(SHT_rv) & bind(C, name="SIDRE_View_is_described") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_is_described @@ -1958,9 +2098,9 @@ pure function c_view_is_empty(self) & result(SHT_rv) & bind(C, name="SIDRE_View_is_empty") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_is_empty @@ -1968,9 +2108,9 @@ pure function c_view_is_opaque(self) & result(SHT_rv) & bind(C, name="SIDRE_View_is_opaque") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_is_opaque @@ -1978,9 +2118,9 @@ pure function c_view_is_scalar(self) & result(SHT_rv) & bind(C, name="SIDRE_View_is_scalar") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_is_scalar @@ -1988,18 +2128,18 @@ pure function c_view_is_string(self) & result(SHT_rv) & bind(C, name="SIDRE_View_is_string") use iso_c_binding, only : C_BOOL - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self logical(C_BOOL) :: SHT_rv end function c_view_is_string pure function c_view_get_type_id(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_type_id") - import :: SIDRE_SHROUD_view_capsule, TypeIDint + import :: SIDRE_SHROUD_capsule_data, TypeIDint implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeIDint) :: SHT_rv end function c_view_get_type_id @@ -2007,9 +2147,9 @@ pure function c_view_get_total_bytes(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_total_bytes") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_view_get_total_bytes @@ -2017,9 +2157,9 @@ pure function c_view_get_num_elements(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_num_elements") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_view_get_num_elements @@ -2027,9 +2167,9 @@ pure function c_view_get_bytes_per_element(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_bytes_per_element") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_view_get_bytes_per_element @@ -2037,9 +2177,9 @@ pure function c_view_get_offset(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_offset") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_view_get_offset @@ -2047,9 +2187,9 @@ pure function c_view_get_stride(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_stride") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_view_get_stride @@ -2057,9 +2197,9 @@ pure function c_view_get_num_dimensions(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_num_dimensions") use iso_c_binding, only : C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_view_get_num_dimensions @@ -2067,9 +2207,9 @@ function c_view_get_shape(self, ndims, shape) & result(SHT_rv) & bind(C, name="SIDRE_View_get_shape") use iso_c_binding, only : C_INT - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(OUT) :: shape(*) integer(C_INT) :: SHT_rv @@ -2077,87 +2217,111 @@ end function c_view_get_shape subroutine c_view_allocate_simple(self) & bind(C, name="SIDRE_View_allocate_simple") - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self end subroutine c_view_allocate_simple subroutine c_view_allocate_from_type(self, type, num_elems) & bind(C, name="SIDRE_View_allocate_from_type") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems end subroutine c_view_allocate_from_type subroutine c_view_reallocate(self, num_elems) & bind(C, name="SIDRE_View_reallocate") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: num_elems end subroutine c_view_reallocate subroutine c_view_attach_buffer_only(self, buff) & bind(C, name="SIDRE_View_attach_buffer_only") - import :: SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff end subroutine c_view_attach_buffer_only subroutine c_view_attach_buffer_type(self, type, num_elems, & buff) & bind(C, name="SIDRE_View_attach_buffer_type") - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff end subroutine c_view_attach_buffer_type + subroutine c_view_attach_buffer_type_int32_t(self, type, & + num_elems, buff) & + bind(C, name="SIDRE_View_attach_buffer_type_int32_t") + use iso_c_binding, only : C_INT32_T + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(TypeID), value, intent(IN) :: type + integer(C_INT32_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + end subroutine c_view_attach_buffer_type_int32_t + + subroutine c_view_attach_buffer_type_int64_t(self, type, & + num_elems, buff) & + bind(C, name="SIDRE_View_attach_buffer_type_int64_t") + use iso_c_binding, only : C_INT64_T + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(TypeID), value, intent(IN) :: type + integer(C_INT64_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff + end subroutine c_view_attach_buffer_type_int64_t + subroutine c_view_attach_buffer_shape(self, type, ndims, shape, & buff) & bind(C, name="SIDRE_View_attach_buffer_shape") use iso_c_binding, only : C_INT - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) - type(SIDRE_SHROUD_buffer_capsule), intent(INOUT) :: buff + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: buff end subroutine c_view_attach_buffer_shape subroutine c_view_clear(self) & bind(C, name="SIDRE_View_clear") - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self end subroutine c_view_clear subroutine c_view_apply_0(self) & bind(C, name="SIDRE_View_apply_0") - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self end subroutine c_view_apply_0 subroutine c_view_apply_nelems(self, num_elems) & bind(C, name="SIDRE_View_apply_nelems") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: num_elems end subroutine c_view_apply_nelems subroutine c_view_apply_nelems_offset(self, num_elems, offset) & bind(C, name="SIDRE_View_apply_nelems_offset") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: num_elems integer(SIDRE_IndexType), value, intent(IN) :: offset end subroutine c_view_apply_nelems_offset @@ -2165,9 +2329,9 @@ end subroutine c_view_apply_nelems_offset subroutine c_view_apply_nelems_offset_stride(self, num_elems, & offset, stride) & bind(C, name="SIDRE_View_apply_nelems_offset_stride") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: num_elems integer(SIDRE_IndexType), value, intent(IN) :: offset integer(SIDRE_IndexType), value, intent(IN) :: stride @@ -2175,9 +2339,9 @@ end subroutine c_view_apply_nelems_offset_stride subroutine c_view_apply_type_nelems(self, type, num_elems) & bind(C, name="SIDRE_View_apply_type_nelems") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems end subroutine c_view_apply_type_nelems @@ -2185,9 +2349,9 @@ end subroutine c_view_apply_type_nelems subroutine c_view_apply_type_nelems_offset(self, type, & num_elems, offset) & bind(C, name="SIDRE_View_apply_type_nelems_offset") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems integer(SIDRE_IndexType), value, intent(IN) :: offset @@ -2196,9 +2360,9 @@ end subroutine c_view_apply_type_nelems_offset subroutine c_view_apply_type_nelems_offset_stride(self, type, & num_elems, offset, stride) & bind(C, name="SIDRE_View_apply_type_nelems_offset_stride") - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems integer(SIDRE_IndexType), value, intent(IN) :: offset @@ -2208,9 +2372,9 @@ end subroutine c_view_apply_type_nelems_offset_stride subroutine c_view_apply_type_shape(self, type, ndims, shape) & bind(C, name="SIDRE_View_apply_type_shape") use iso_c_binding, only : C_INT - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) @@ -2219,64 +2383,65 @@ end subroutine c_view_apply_type_shape subroutine c_view_set_scalar_int(self, value) & bind(C, name="SIDRE_View_set_scalar_int") use iso_c_binding, only : C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_INT), value, intent(IN) :: value end subroutine c_view_set_scalar_int subroutine c_view_set_scalar_long(self, value) & bind(C, name="SIDRE_View_set_scalar_long") use iso_c_binding, only : C_LONG - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_LONG), value, intent(IN) :: value end subroutine c_view_set_scalar_long subroutine c_view_set_scalar_float(self, value) & bind(C, name="SIDRE_View_set_scalar_float") use iso_c_binding, only : C_FLOAT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self real(C_FLOAT), value, intent(IN) :: value end subroutine c_view_set_scalar_float subroutine c_view_set_scalar_double(self, value) & bind(C, name="SIDRE_View_set_scalar_double") use iso_c_binding, only : C_DOUBLE - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self real(C_DOUBLE), value, intent(IN) :: value end subroutine c_view_set_scalar_double subroutine c_view_set_string(self, value) & bind(C, name="SIDRE_View_set_string") use iso_c_binding, only : C_CHAR - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: value(*) end subroutine c_view_set_string - subroutine c_view_set_string_bufferify(self, value, Lvalue) & + subroutine c_view_set_string_bufferify(self, value, & + SHT_value_len) & bind(C, name="SIDRE_View_set_string_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: value(*) - integer(C_INT), value, intent(IN) :: Lvalue + integer(C_INT), value, intent(IN) :: SHT_value_len end subroutine c_view_set_string_bufferify subroutine c_view_set_external_data_ptr_only(self, external_ptr) & bind(C, name="SIDRE_View_set_external_data_ptr_only") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self type(C_PTR), value, intent(IN) :: external_ptr end subroutine c_view_set_external_data_ptr_only @@ -2284,21 +2449,45 @@ subroutine c_view_set_external_data_ptr_type(self, type, & num_elems, external_ptr) & bind(C, name="SIDRE_View_set_external_data_ptr_type") use iso_c_binding, only : C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems type(C_PTR), value, intent(IN) :: external_ptr end subroutine c_view_set_external_data_ptr_type + subroutine c_view_set_external_data_ptr_type_int32_t(self, type, & + num_elems, external_ptr) & + bind(C, name="SIDRE_View_set_external_data_ptr_type_int32_t") + use iso_c_binding, only : C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(TypeID), value, intent(IN) :: type + integer(C_INT32_T), value, intent(IN) :: num_elems + type(C_PTR), value, intent(IN) :: external_ptr + end subroutine c_view_set_external_data_ptr_type_int32_t + + subroutine c_view_set_external_data_ptr_type_int64_t(self, type, & + num_elems, external_ptr) & + bind(C, name="SIDRE_View_set_external_data_ptr_type_int64_t") + use iso_c_binding, only : C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(TypeID), value, intent(IN) :: type + integer(C_INT64_T), value, intent(IN) :: num_elems + type(C_PTR), value, intent(IN) :: external_ptr + end subroutine c_view_set_external_data_ptr_type_int64_t + subroutine c_view_set_external_data_ptr_shape(self, type, ndims, & shape, external_ptr) & bind(C, name="SIDRE_View_set_external_data_ptr_shape") use iso_c_binding, only : C_INT, C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_view_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(*) @@ -2309,29 +2498,29 @@ function c_view_get_string(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_string") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self type(C_PTR) SHT_rv end function c_view_get_string - subroutine c_view_get_string_bufferify(self, name, Nname) & + subroutine c_view_get_string_bufferify(self, name, SHT_name_len) & bind(C, name="SIDRE_View_get_string_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(OUT) :: name(*) - integer(C_INT), value, intent(IN) :: Nname + integer(C_INT), value, intent(IN) :: SHT_name_len end subroutine c_view_get_string_bufferify function c_view_get_data_int(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_data_int") use iso_c_binding, only : C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_view_get_data_int @@ -2339,9 +2528,9 @@ function c_view_get_data_long(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_data_long") use iso_c_binding, only : C_LONG - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_LONG) :: SHT_rv end function c_view_get_data_long @@ -2349,9 +2538,9 @@ function c_view_get_data_float(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_data_float") use iso_c_binding, only : C_FLOAT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self real(C_FLOAT) :: SHT_rv end function c_view_get_data_float @@ -2359,9 +2548,9 @@ function c_view_get_data_double(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_data_double") use iso_c_binding, only : C_DOUBLE - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self real(C_DOUBLE) :: SHT_rv end function c_view_get_data_double @@ -2369,125 +2558,175 @@ pure function c_view_get_void_ptr(self) & result(SHT_rv) & bind(C, name="SIDRE_View_get_void_ptr") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self type(C_PTR) :: SHT_rv end function c_view_get_void_ptr subroutine c_view_print(self) & bind(C, name="SIDRE_View_print") - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self end subroutine c_view_print function c_view_rename(self, new_name) & result(SHT_rv) & bind(C, name="SIDRE_View_rename") use iso_c_binding, only : C_BOOL, C_CHAR - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: new_name(*) logical(C_BOOL) :: SHT_rv end function c_view_rename - function c_view_rename_bufferify(self, new_name, Lnew_name) & + function c_view_rename_bufferify(self, new_name, & + SHT_new_name_len) & result(SHT_rv) & bind(C, name="SIDRE_View_rename_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_view_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_view_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: new_name(*) - integer(C_INT), value, intent(IN) :: Lnew_name + integer(C_INT), value, intent(IN) :: SHT_new_name_len logical(C_BOOL) :: SHT_rv end function c_view_rename_bufferify - ! splicer begin class.View.additional_interfaces - ! splicer end class.View.additional_interfaces - - function c_datastore_new(SHT_crv) & - result(SHT_rv) & + function c_datastore_new(SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_DataStore_new") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) SHT_prv end function c_datastore_new subroutine c_datastore_delete(self) & bind(C, name="SIDRE_DataStore_delete") - import :: SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: self end subroutine c_datastore_delete - function c_datastore_get_root(self, SHT_crv) & - result(SHT_rv) & + function c_datastore_get_root(self, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_DataStore_get_root") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_datastore_capsule, SIDRE_SHROUD_group_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_datastore_get_root pure function c_datastore_get_num_buffers(self) & result(SHT_rv) & bind(C, name="SIDRE_DataStore_get_num_buffers") use iso_c_binding, only : C_SIZE_T - import :: SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_SIZE_T) :: SHT_rv end function c_datastore_get_num_buffers - function c_datastore_get_buffer(self, idx, SHT_crv) & - result(SHT_rv) & + function c_datastore_get_buffer(self, idx, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_DataStore_get_buffer") use iso_c_binding, only : C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_datastore_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: idx - type(SIDRE_SHROUD_buffer_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_datastore_get_buffer - function c_datastore_create_buffer_empty(self, SHT_crv) & - result(SHT_rv) & + function c_datastore_get_buffer_int32_t(self, idx, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_DataStore_get_buffer_int32_t") + use iso_c_binding, only : C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT32_T), value, intent(IN) :: idx + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_datastore_get_buffer_int32_t + + function c_datastore_get_buffer_int64_t(self, idx, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_DataStore_get_buffer_int64_t") + use iso_c_binding, only : C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(C_INT64_T), value, intent(IN) :: idx + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_datastore_get_buffer_int64_t + + function c_datastore_create_buffer_empty(self, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_DataStore_create_buffer_empty") use iso_c_binding, only : C_PTR - import :: SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self - type(SIDRE_SHROUD_buffer_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_datastore_create_buffer_empty function c_datastore_create_buffer_from_type(self, type, & - num_elems, SHT_crv) & - result(SHT_rv) & + num_elems, SHT_rv) & + result(SHT_prv) & bind(C, name="SIDRE_DataStore_create_buffer_from_type") use iso_c_binding, only : C_PTR - import :: SIDRE_IndexType, SIDRE_SHROUD_buffer_capsule, SIDRE_SHROUD_datastore_capsule, TypeID + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data, TypeID implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems - type(SIDRE_SHROUD_buffer_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv end function c_datastore_create_buffer_from_type + function c_datastore_create_buffer_from_type_int32_t(self, type, & + num_elems, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_DataStore_create_buffer_from_type_int32_t") + use iso_c_binding, only : C_INT32_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(TypeID), value, intent(IN) :: type + integer(C_INT32_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_datastore_create_buffer_from_type_int32_t + + function c_datastore_create_buffer_from_type_int64_t(self, type, & + num_elems, SHT_rv) & + result(SHT_prv) & + bind(C, name="SIDRE_DataStore_create_buffer_from_type_int64_t") + use iso_c_binding, only : C_INT64_T, C_PTR + import :: SIDRE_SHROUD_capsule_data, TypeID + implicit none + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self + integer(TypeID), value, intent(IN) :: type + integer(C_INT64_T), value, intent(IN) :: num_elems + type(SIDRE_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) :: SHT_prv + end function c_datastore_create_buffer_from_type_int64_t + subroutine c_datastore_destroy_buffer(self, id) & bind(C, name="SIDRE_DataStore_destroy_buffer") - import :: SIDRE_IndexType, SIDRE_SHROUD_datastore_capsule + import :: SIDRE_IndexType, SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(SIDRE_IndexType), value, intent(IN) :: id end subroutine c_datastore_destroy_buffer @@ -2496,9 +2735,9 @@ function c_datastore_generate_blueprint_index_0(self, & result(SHT_rv) & bind(C, name="SIDRE_DataStore_generate_blueprint_index_0") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: domain_path(*) character(kind=C_CHAR), intent(IN) :: mesh_name(*) character(kind=C_CHAR), intent(IN) :: index_path(*) @@ -2507,20 +2746,21 @@ function c_datastore_generate_blueprint_index_0(self, & end function c_datastore_generate_blueprint_index_0 function c_datastore_generate_blueprint_index_0_bufferify(self, & - domain_path, Ldomain_path, mesh_name, Lmesh_name, & - index_path, Lindex_path, num_domains) & + domain_path, SHT_domain_path_len, mesh_name, & + SHT_mesh_name_len, index_path, SHT_index_path_len, & + num_domains) & result(SHT_rv) & bind(C, name="SIDRE_DataStore_generate_blueprint_index_0_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: domain_path(*) - integer(C_INT), value, intent(IN) :: Ldomain_path + integer(C_INT), value, intent(IN) :: SHT_domain_path_len character(kind=C_CHAR), intent(IN) :: mesh_name(*) - integer(C_INT), value, intent(IN) :: Lmesh_name + integer(C_INT), value, intent(IN) :: SHT_mesh_name_len character(kind=C_CHAR), intent(IN) :: index_path(*) - integer(C_INT), value, intent(IN) :: Lindex_path + integer(C_INT), value, intent(IN) :: SHT_index_path_len integer(C_INT), value, intent(IN) :: num_domains logical(C_BOOL) :: SHT_rv end function c_datastore_generate_blueprint_index_0_bufferify @@ -2531,9 +2771,9 @@ function c_datastore_generate_blueprint_index_1(self, comm, & result(SHT_rv) & bind(C, name="SIDRE_DataStore_generate_blueprint_index_1") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_INT), value, intent(IN) :: comm character(kind=C_CHAR), intent(IN) :: domain_path(*) character(kind=C_CHAR), intent(IN) :: mesh_name(*) @@ -2544,35 +2784,32 @@ end function c_datastore_generate_blueprint_index_1 #ifdef AXOM_USE_MPI function c_datastore_generate_blueprint_index_1_bufferify(self, & - comm, domain_path, Ldomain_path, mesh_name, Lmesh_name, & - index_path, Lindex_path) & + comm, domain_path, SHT_domain_path_len, mesh_name, & + SHT_mesh_name_len, index_path, SHT_index_path_len) & result(SHT_rv) & bind(C, name="SIDRE_DataStore_generate_blueprint_index_1_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self integer(C_INT), value, intent(IN) :: comm character(kind=C_CHAR), intent(IN) :: domain_path(*) - integer(C_INT), value, intent(IN) :: Ldomain_path + integer(C_INT), value, intent(IN) :: SHT_domain_path_len character(kind=C_CHAR), intent(IN) :: mesh_name(*) - integer(C_INT), value, intent(IN) :: Lmesh_name + integer(C_INT), value, intent(IN) :: SHT_mesh_name_len character(kind=C_CHAR), intent(IN) :: index_path(*) - integer(C_INT), value, intent(IN) :: Lindex_path + integer(C_INT), value, intent(IN) :: SHT_index_path_len logical(C_BOOL) :: SHT_rv end function c_datastore_generate_blueprint_index_1_bufferify #endif subroutine c_datastore_print(self) & bind(C, name="SIDRE_DataStore_print") - import :: SIDRE_SHROUD_datastore_capsule + import :: SIDRE_SHROUD_capsule_data implicit none - type(SIDRE_SHROUD_datastore_capsule), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(IN) :: self end subroutine c_datastore_print - ! splicer begin class.DataStore.additional_interfaces - ! splicer end class.DataStore.additional_interfaces - function c_name_is_valid(name) & result(SHT_rv) & bind(C, name="SIDRE_name_is_valid") @@ -2581,33 +2818,195 @@ function c_name_is_valid(name) & character(kind=C_CHAR), intent(IN) :: name(*) logical(C_BOOL) :: SHT_rv end function c_name_is_valid - - ! splicer begin additional_interfaces - function SIDRE_create_array_view(group, name, lname, addr, type, rank, extents) & - result(rv) bind(C,name="SIDRE_create_array_view") - use iso_c_binding - import SIDRE_IndexType - type(C_PTR), value, intent(IN) :: group - character(kind=C_CHAR), intent(IN) :: name(*) - integer(C_INT), value, intent(IN) :: lname - type(C_PTR), value, intent(IN) :: addr - integer(C_INT), value, intent(IN) :: type - integer(C_INT), value, intent(IN) :: rank - integer(SIDRE_IndexType), intent(IN) :: extents(*) - type(C_PTR) rv - end function SIDRE_create_array_view - ! splicer end additional_interfaces end interface interface SidreDataStore module procedure datastore_new end interface SidreDataStore + interface buffer_allocate + module procedure buffer_allocate_existing + module procedure buffer_allocate_from_type_int32_t + module procedure buffer_allocate_from_type_int64_t + end interface buffer_allocate + + interface buffer_describe + module procedure buffer_describe_int32_t + module procedure buffer_describe_int64_t + end interface buffer_describe + + interface buffer_reallocate + module procedure buffer_reallocate_int32_t + module procedure buffer_reallocate_int64_t + end interface buffer_reallocate + + interface datastore_create_buffer + module procedure datastore_create_buffer_empty + module procedure datastore_create_buffer_from_type_int32_t + module procedure datastore_create_buffer_from_type_int64_t + end interface datastore_create_buffer + + interface datastore_destroy_buffer + module procedure datastore_destroy_buffer_int32_t + module procedure datastore_destroy_buffer_int64_t + end interface datastore_destroy_buffer + + interface datastore_generate_blueprint_index + module procedure datastore_generate_blueprint_index_0 +#ifdef AXOM_USE_MPI + module procedure datastore_generate_blueprint_index_1 +#endif + end interface datastore_generate_blueprint_index + + interface datastore_get_buffer + module procedure datastore_get_buffer_int32_t + module procedure datastore_get_buffer_int64_t + end interface datastore_get_buffer + + interface group_create_view + module procedure group_create_view_empty + module procedure group_create_view_from_type_int32_t + module procedure group_create_view_from_type_int64_t + module procedure group_create_view_into_buffer + module procedure group_create_view_from_type_and_buffer_int32_t + module procedure group_create_view_from_type_and_buffer_int64_t + module procedure group_create_view_external + module procedure group_create_view_from_type_external_int32_t + module procedure group_create_view_from_type_external_int64_t + end interface group_create_view + + interface group_create_view_and_allocate + module procedure group_create_view_and_allocate_nelems_int32_t + module procedure group_create_view_and_allocate_nelems_int64_t + end interface group_create_view_and_allocate + + interface group_create_view_scalar + module procedure group_create_view_scalar_int + module procedure group_create_view_scalar_long + module procedure group_create_view_scalar_float + module procedure group_create_view_scalar_double + end interface group_create_view_scalar + + interface group_create_view_with_shape + module procedure group_create_view_with_shape_base + module procedure group_create_view_with_shape_and_buffer + module procedure group_create_view_with_shape_external + end interface group_create_view_with_shape + + interface group_destroy_group + module procedure group_destroy_group_name + module procedure group_destroy_group_index_int32_t + module procedure group_destroy_group_index_int64_t + end interface group_destroy_group + + interface group_destroy_view_and_data + module procedure group_destroy_view_and_data_name + module procedure group_destroy_view_and_data_index_int32_t + module procedure group_destroy_view_and_data_index_int64_t + end interface group_destroy_view_and_data + + interface group_get_group + module procedure group_get_group_from_name + module procedure group_get_group_from_index_int32_t + module procedure group_get_group_from_index_int64_t + end interface group_get_group + + interface group_get_group_name + module procedure group_get_group_name_int32_t + module procedure group_get_group_name_int64_t + end interface group_get_group_name + + interface group_get_next_valid_group_index + module procedure group_get_next_valid_group_index_int32_t + module procedure group_get_next_valid_group_index_int64_t + end interface group_get_next_valid_group_index + + interface group_get_next_valid_view_index + module procedure group_get_next_valid_view_index_int32_t + module procedure group_get_next_valid_view_index_int64_t + end interface group_get_next_valid_view_index + + interface group_get_view + module procedure group_get_view_from_name + module procedure group_get_view_from_index_int32_t + module procedure group_get_view_from_index_int64_t + end interface group_get_view + + interface group_get_view_name + module procedure group_get_view_name_int32_t + module procedure group_get_view_name_int64_t + end interface group_get_view_name + + interface group_load + module procedure group_load_0 + module procedure group_load_1 + end interface group_load + + interface view_allocate + module procedure view_allocate_simple + module procedure view_allocate_from_type_int32_t + module procedure view_allocate_from_type_int64_t + end interface view_allocate + + interface view_apply + module procedure view_apply_0 + module procedure view_apply_nelems + module procedure view_apply_nelems_offset + module procedure view_apply_nelems_offset_stride + module procedure view_apply_type_nelems + module procedure view_apply_type_nelems_offset + module procedure view_apply_type_nelems_offset_stride + module procedure view_apply_type_shape + end interface view_apply + + interface view_attach_buffer + module procedure view_attach_buffer_only + module procedure view_attach_buffer_type_int32_t + module procedure view_attach_buffer_type_int64_t + module procedure view_attach_buffer_shape + end interface view_attach_buffer + + interface view_reallocate + module procedure view_reallocate_int32_t + module procedure view_reallocate_int64_t + end interface view_reallocate + + interface view_set_external_data_ptr + module procedure view_set_external_data_ptr_only + module procedure view_set_external_data_ptr_type_int32_t + module procedure view_set_external_data_ptr_type_int64_t + module procedure view_set_external_data_ptr_shape + end interface view_set_external_data_ptr + + interface view_set_scalar + module procedure view_set_scalar_int + module procedure view_set_scalar_long + module procedure view_set_scalar_float + module procedure view_set_scalar_double + end interface view_set_scalar + + ! splicer begin additional_declarations + interface + function SIDRE_create_array_view(group, name, lname, addr, type, rank, extents) & + result(rv) bind(C,name="SIDRE_create_array_view") + use iso_c_binding + import SIDRE_IndexType + type(C_PTR), value, intent(IN) :: group + character(kind=C_CHAR), intent(IN) :: name(*) + integer(C_INT), value, intent(IN) :: lname + type(C_PTR), value, intent(IN) :: addr + integer(C_INT), value, intent(IN) :: type + integer(C_INT), value, intent(IN) :: rank + integer(SIDRE_IndexType), intent(IN) :: extents(*) + type(C_PTR) rv + end function SIDRE_create_array_view + end interface + ! splicer end additional_declarations + contains function buffer_get_index(obj) & result(SHT_rv) - use iso_c_binding, only : C_INT64_T class(SidreBuffer) :: obj integer(SIDRE_IndexType) :: SHT_rv ! splicer begin class.Buffer.method.get_index @@ -2637,7 +3036,6 @@ end function buffer_get_void_ptr function buffer_get_type_id(obj) & result(SHT_rv) - use iso_c_binding, only : C_INT class(SidreBuffer) :: obj integer(TypeIDint) :: SHT_rv ! splicer begin class.Buffer.method.get_type_id @@ -2676,7 +3074,7 @@ function buffer_get_bytes_per_element(obj) & end function buffer_get_bytes_per_element subroutine buffer_describe_int32_t(obj, type, num_elems) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT32_T class(SidreBuffer) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems @@ -2687,7 +3085,7 @@ subroutine buffer_describe_int32_t(obj, type, num_elems) end subroutine buffer_describe_int32_t subroutine buffer_describe_int64_t(obj, type, num_elems) - use iso_c_binding, only : C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT64_T class(SidreBuffer) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems @@ -2705,7 +3103,7 @@ subroutine buffer_allocate_existing(obj) end subroutine buffer_allocate_existing subroutine buffer_allocate_from_type_int32_t(obj, type, num_elems) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT32_T class(SidreBuffer) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems @@ -2716,7 +3114,7 @@ subroutine buffer_allocate_from_type_int32_t(obj, type, num_elems) end subroutine buffer_allocate_from_type_int32_t subroutine buffer_allocate_from_type_int64_t(obj, type, num_elems) - use iso_c_binding, only : C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT64_T class(SidreBuffer) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems @@ -2727,7 +3125,7 @@ subroutine buffer_allocate_from_type_int64_t(obj, type, num_elems) end subroutine buffer_allocate_from_type_int64_t subroutine buffer_reallocate_int32_t(obj, num_elems) - use iso_c_binding, only : C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT32_T class(SidreBuffer) :: obj integer(C_INT32_T), value, intent(IN) :: num_elems ! splicer begin class.Buffer.method.reallocate_int32_t @@ -2781,7 +3179,6 @@ end function buffer_associated function group_get_index(obj) & result(SHT_rv) - use iso_c_binding, only : C_INT64_T class(SidreGroup) :: obj integer(SIDRE_IndexType) :: SHT_rv ! splicer begin class.Group.method.get_index @@ -2795,8 +3192,9 @@ function group_get_name(obj) & class(SidreGroup) :: obj character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.Group.method.get_name - call c_group_get_name_bufferify(obj%cxxmem, SHT_rv, & - len(SHT_rv, kind=C_INT)) + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) + call c_group_get_name_bufferify(obj%cxxmem, SHT_rv, SHT_rv_len) ! splicer end class.Group.method.get_name end function group_get_name @@ -2806,8 +3204,9 @@ function group_get_path(obj) & class(SidreGroup) :: obj character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.Group.method.get_path - call c_group_get_path_bufferify(obj%cxxmem, SHT_rv, & - len(SHT_rv, kind=C_INT)) + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) + call c_group_get_path_bufferify(obj%cxxmem, SHT_rv, SHT_rv_len) ! splicer end class.Group.method.get_path end function group_get_path @@ -2817,8 +3216,10 @@ function group_get_path_name(obj) & class(SidreGroup) :: obj character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.Group.method.get_path_name + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) call c_group_get_path_name_bufferify(obj%cxxmem, SHT_rv, & - len(SHT_rv, kind=C_INT)) + SHT_rv_len) ! splicer end class.Group.method.get_path_name end function group_get_path_name @@ -2827,8 +3228,8 @@ function group_get_parent(obj) & use iso_c_binding, only : C_PTR class(SidreGroup) :: obj type(SidreGroup) :: SHT_rv - ! splicer begin class.Group.method.get_parent type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.get_parent SHT_prv = c_group_get_parent(obj%cxxmem, SHT_rv%cxxmem) ! splicer end class.Group.method.get_parent end function group_get_parent @@ -2858,8 +3259,8 @@ function group_get_data_store(obj) & use iso_c_binding, only : C_PTR class(SidreGroup) :: obj type(SidreDataStore) :: SHT_rv - ! splicer begin class.Group.method.get_data_store type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.get_data_store SHT_prv = c_group_get_data_store(obj%cxxmem, SHT_rv%cxxmem) ! splicer end class.Group.method.get_data_store end function group_get_data_store @@ -2871,8 +3272,10 @@ function group_has_view(obj, path) & character(len=*), intent(IN) :: path logical :: SHT_rv ! splicer begin class.Group.method.has_view + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_rv = c_group_has_view_bufferify(obj%cxxmem, path, & - len_trim(path, kind=C_INT)) + SHT_path_len) ! splicer end class.Group.method.has_view end function group_has_view @@ -2883,32 +3286,38 @@ function group_has_child_view(obj, name) & character(len=*), intent(IN) :: name logical :: SHT_rv ! splicer begin class.Group.method.has_child_view + integer(C_INT) SHT_name_len + SHT_name_len = len(name, kind=C_INT) SHT_rv = c_group_has_child_view_bufferify(obj%cxxmem, name, & - len_trim(name, kind=C_INT)) + SHT_name_len) ! splicer end class.Group.method.has_child_view end function group_has_child_view function group_get_view_index(obj, name) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T + use iso_c_binding, only : C_INT class(SidreGroup) :: obj character(len=*), intent(IN) :: name integer(SIDRE_IndexType) :: SHT_rv ! splicer begin class.Group.method.get_view_index + integer(C_INT) SHT_name_len + SHT_name_len = len(name, kind=C_INT) SHT_rv = c_group_get_view_index_bufferify(obj%cxxmem, name, & - len_trim(name, kind=C_INT)) + SHT_name_len) ! splicer end class.Group.method.get_view_index end function group_get_view_index function group_get_view_name_int32_t(obj, idx) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT, C_INT32_T class(SidreGroup) :: obj integer(C_INT32_T), value, intent(IN) :: idx character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.Group.method.get_view_name_int32_t - call c_group_get_view_name_bufferify(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv, len(SHT_rv, kind=C_INT)) + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) + call c_group_get_view_name_int32_t_bufferify(obj%cxxmem, idx, & + SHT_rv, SHT_rv_len) ! splicer end class.Group.method.get_view_name_int32_t end function group_get_view_name_int32_t @@ -2919,8 +3328,10 @@ function group_get_view_name_int64_t(obj, idx) & integer(C_INT64_T), value, intent(IN) :: idx character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.Group.method.get_view_name_int64_t - call c_group_get_view_name_bufferify(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv, len(SHT_rv, kind=C_INT)) + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) + call c_group_get_view_name_int64_t_bufferify(obj%cxxmem, idx, & + SHT_rv, SHT_rv_len) ! splicer end class.Group.method.get_view_name_int64_t end function group_get_view_name_int64_t @@ -2930,23 +3341,25 @@ function group_get_view_from_name(obj, path) & class(SidreGroup) :: obj character(len=*), intent(IN) :: path type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.get_view_from_name type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.get_view_from_name + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_get_view_from_name_bufferify(obj%cxxmem, path, & - len_trim(path, kind=C_INT), SHT_rv%cxxmem) + SHT_path_len, SHT_rv%cxxmem) ! splicer end class.Group.method.get_view_from_name end function group_get_view_from_name function group_get_view_from_index_int32_t(obj, idx) & result(SHT_rv) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_PTR + use iso_c_binding, only : C_INT32_T, C_PTR class(SidreGroup) :: obj integer(C_INT32_T), value, intent(IN) :: idx type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.get_view_from_index_int32_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_get_view_from_index(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.Group.method.get_view_from_index_int32_t + SHT_prv = c_group_get_view_from_index_int32_t(obj%cxxmem, idx, & + SHT_rv%cxxmem) ! splicer end class.Group.method.get_view_from_index_int32_t end function group_get_view_from_index_int32_t @@ -2956,16 +3369,15 @@ function group_get_view_from_index_int64_t(obj, idx) & class(SidreGroup) :: obj integer(C_INT64_T), value, intent(IN) :: idx type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.get_view_from_index_int64_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_get_view_from_index(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.Group.method.get_view_from_index_int64_t + SHT_prv = c_group_get_view_from_index_int64_t(obj%cxxmem, idx, & + SHT_rv%cxxmem) ! splicer end class.Group.method.get_view_from_index_int64_t end function group_get_view_from_index_int64_t function group_get_first_valid_view_index(obj) & result(SHT_rv) - use iso_c_binding, only : C_INT64_T class(SidreGroup) :: obj integer(SIDRE_IndexType) :: SHT_rv ! splicer begin class.Group.method.get_first_valid_view_index @@ -2975,7 +3387,7 @@ end function group_get_first_valid_view_index function group_get_next_valid_view_index_int32_t(obj, idx) & result(SHT_rv) - use iso_c_binding, only : C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT32_T class(SidreGroup) :: obj integer(C_INT32_T), value, intent(IN) :: idx integer(SIDRE_IndexType) :: SHT_rv @@ -3003,62 +3415,67 @@ function group_create_view_empty(obj, path) & class(SidreGroup) :: obj character(len=*), intent(IN) :: path type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_empty type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_empty + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_empty_bufferify(obj%cxxmem, path, & - len_trim(path, kind=C_INT), SHT_rv%cxxmem) + SHT_path_len, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_empty end function group_create_view_empty function group_create_view_from_type_int32_t(obj, path, type, & num_elems) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT32_T, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_INT32_T, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_from_type_int32_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_create_view_from_type_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, & - int(num_elems, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.Group.method.create_view_from_type_int32_t + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) + SHT_prv = c_group_create_view_from_type_int32_t_bufferify(obj%cxxmem, & + path, SHT_path_len, type, num_elems, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_from_type_int32_t end function group_create_view_from_type_int32_t function group_create_view_from_type_int64_t(obj, path, type, & num_elems) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_INT64_T, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_from_type_int64_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_create_view_from_type_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, & - int(num_elems, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.Group.method.create_view_from_type_int64_t + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) + SHT_prv = c_group_create_view_from_type_int64_t_bufferify(obj%cxxmem, & + path, SHT_path_len, type, num_elems, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_from_type_int64_t end function group_create_view_from_type_int64_t function group_create_view_with_shape_base(obj, path, type, ndims, & shape) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(:) type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_with_shape_base type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_with_shape_base + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_with_shape_base_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, ndims, shape, & - SHT_rv%cxxmem) + path, SHT_path_len, type, ndims, shape, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_with_shape_base end function group_create_view_with_shape_base @@ -3069,54 +3486,59 @@ function group_create_view_into_buffer(obj, path, buff) & character(len=*), intent(IN) :: path type(SidreBuffer), intent(INOUT) :: buff type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_into_buffer type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_into_buffer + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_into_buffer_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), buff%cxxmem, & - SHT_rv%cxxmem) + path, SHT_path_len, buff%cxxmem, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_into_buffer end function group_create_view_into_buffer function group_create_view_from_type_and_buffer_int32_t(obj, path, & type, num_elems, buff) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT32_T, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_INT32_T, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems type(SidreBuffer), intent(INOUT) :: buff type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_from_type_and_buffer_int32_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_create_view_from_type_and_buffer_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, & - int(num_elems, SIDRE_IndexType), buff%cxxmem, SHT_rv%cxxmem) + ! splicer begin class.Group.method.create_view_from_type_and_buffer_int32_t + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) + SHT_prv = c_group_create_view_from_type_and_buffer_int32_t_bufferify(obj%cxxmem, & + path, SHT_path_len, type, num_elems, buff%cxxmem, & + SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_from_type_and_buffer_int32_t end function group_create_view_from_type_and_buffer_int32_t function group_create_view_from_type_and_buffer_int64_t(obj, path, & type, num_elems, buff) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_INT64_T, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems type(SidreBuffer), intent(INOUT) :: buff type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_from_type_and_buffer_int64_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_create_view_from_type_and_buffer_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, & - int(num_elems, SIDRE_IndexType), buff%cxxmem, SHT_rv%cxxmem) + ! splicer begin class.Group.method.create_view_from_type_and_buffer_int64_t + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) + SHT_prv = c_group_create_view_from_type_and_buffer_int64_t_bufferify(obj%cxxmem, & + path, SHT_path_len, type, num_elems, buff%cxxmem, & + SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_from_type_and_buffer_int64_t end function group_create_view_from_type_and_buffer_int64_t function group_create_view_with_shape_and_buffer(obj, path, type, & ndims, shape, buff) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type @@ -3124,11 +3546,13 @@ function group_create_view_with_shape_and_buffer(obj, path, type, & integer(SIDRE_IndexType), intent(IN) :: shape(:) type(SidreBuffer), intent(INOUT) :: buff type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_with_shape_and_buffer type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_with_shape_and_buffer + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_with_shape_and_buffer_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, ndims, shape, & - buff%cxxmem, SHT_rv%cxxmem) + path, SHT_path_len, type, ndims, shape, buff%cxxmem, & + SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_with_shape_and_buffer end function group_create_view_with_shape_and_buffer @@ -3139,29 +3563,31 @@ function group_create_view_external(obj, path, external_ptr) & character(len=*), intent(IN) :: path type(C_PTR), intent(IN) :: external_ptr type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_external type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_external + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_external_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), external_ptr, & - SHT_rv%cxxmem) + path, SHT_path_len, external_ptr, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_external end function group_create_view_external function group_create_view_from_type_external_int32_t(obj, path, & type, num_elems, external_ptr) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT32_T, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_INT32_T, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems type(C_PTR), intent(IN) :: external_ptr type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_from_type_external_int32_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_create_view_from_type_external_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, & - int(num_elems, SIDRE_IndexType), external_ptr, & + ! splicer begin class.Group.method.create_view_from_type_external_int32_t + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) + SHT_prv = c_group_create_view_from_type_external_int32_t_bufferify(obj%cxxmem, & + path, SHT_path_len, type, num_elems, external_ptr, & SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_from_type_external_int32_t end function group_create_view_from_type_external_int32_t @@ -3169,18 +3595,19 @@ end function group_create_view_from_type_external_int32_t function group_create_view_from_type_external_int64_t(obj, path, & type, num_elems, external_ptr) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_INT64_T, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems type(C_PTR), intent(IN) :: external_ptr type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_from_type_external_int64_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_create_view_from_type_external_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, & - int(num_elems, SIDRE_IndexType), external_ptr, & + ! splicer begin class.Group.method.create_view_from_type_external_int64_t + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) + SHT_prv = c_group_create_view_from_type_external_int64_t_bufferify(obj%cxxmem, & + path, SHT_path_len, type, num_elems, external_ptr, & SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_from_type_external_int64_t end function group_create_view_from_type_external_int64_t @@ -3188,7 +3615,7 @@ end function group_create_view_from_type_external_int64_t function group_create_view_with_shape_external(obj, path, type, & ndims, shape, external_ptr) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type @@ -3196,63 +3623,68 @@ function group_create_view_with_shape_external(obj, path, type, & integer(SIDRE_IndexType), intent(IN) :: shape(:) type(C_PTR), intent(IN) :: external_ptr type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_with_shape_external type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_with_shape_external + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_with_shape_external_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, ndims, shape, & - external_ptr, SHT_rv%cxxmem) + path, SHT_path_len, type, ndims, shape, external_ptr, & + SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_with_shape_external end function group_create_view_with_shape_external function group_create_view_and_allocate_nelems_int32_t(obj, path, & type, num_elems) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT32_T, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_INT32_T, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_and_allocate_nelems_int32_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_create_view_and_allocate_nelems_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, & - int(num_elems, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.Group.method.create_view_and_allocate_nelems_int32_t + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) + SHT_prv = c_group_create_view_and_allocate_nelems_int32_t_bufferify(obj%cxxmem, & + path, SHT_path_len, type, num_elems, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_and_allocate_nelems_int32_t end function group_create_view_and_allocate_nelems_int32_t function group_create_view_and_allocate_nelems_int64_t(obj, path, & type, num_elems) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_INT64_T, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_and_allocate_nelems_int64_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_create_view_and_allocate_nelems_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, & - int(num_elems, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.Group.method.create_view_and_allocate_nelems_int64_t + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) + SHT_prv = c_group_create_view_and_allocate_nelems_int64_t_bufferify(obj%cxxmem, & + path, SHT_path_len, type, num_elems, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_and_allocate_nelems_int64_t end function group_create_view_and_allocate_nelems_int64_t function group_create_view_with_shape_and_allocate(obj, path, type, & ndims, shape) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_PTR class(SidreGroup) :: obj character(len=*), intent(IN) :: path integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(IN) :: shape(:) type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_with_shape_and_allocate type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_with_shape_and_allocate + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_with_shape_and_allocate_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), type, ndims, shape, & - SHT_rv%cxxmem) + path, SHT_path_len, type, ndims, shape, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_with_shape_and_allocate end function group_create_view_with_shape_and_allocate @@ -3263,10 +3695,12 @@ function group_create_view_scalar_int(obj, path, value) & character(len=*), intent(IN) :: path integer(C_INT), value, intent(IN) :: value type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_scalar_int type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_scalar_int + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_scalar_bufferify_int(obj%cxxmem, & - path, len_trim(path, kind=C_INT), value, SHT_rv%cxxmem) + path, SHT_path_len, value, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_scalar_int end function group_create_view_scalar_int @@ -3277,10 +3711,12 @@ function group_create_view_scalar_long(obj, path, value) & character(len=*), intent(IN) :: path integer(C_LONG), value, intent(IN) :: value type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_scalar_long type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_scalar_long + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_scalar_bufferify_long(obj%cxxmem, & - path, len_trim(path, kind=C_INT), value, SHT_rv%cxxmem) + path, SHT_path_len, value, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_scalar_long end function group_create_view_scalar_long @@ -3291,10 +3727,12 @@ function group_create_view_scalar_float(obj, path, value) & character(len=*), intent(IN) :: path real(C_FLOAT), value, intent(IN) :: value type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_scalar_float type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_scalar_float + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_scalar_bufferify_float(obj%cxxmem, & - path, len_trim(path, kind=C_INT), value, SHT_rv%cxxmem) + path, SHT_path_len, value, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_scalar_float end function group_create_view_scalar_float @@ -3305,10 +3743,12 @@ function group_create_view_scalar_double(obj, path, value) & character(len=*), intent(IN) :: path real(C_DOUBLE), value, intent(IN) :: value type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_scalar_double type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_scalar_double + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_view_scalar_bufferify_double(obj%cxxmem, & - path, len_trim(path, kind=C_INT), value, SHT_rv%cxxmem) + path, SHT_path_len, value, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_scalar_double end function group_create_view_scalar_double @@ -3319,11 +3759,14 @@ function group_create_view_string(obj, path, value) & character(len=*), intent(IN) :: path character(len=*), intent(IN) :: value type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.create_view_string type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_view_string + integer(C_INT) SHT_path_len + integer(C_INT) SHT_value_len + SHT_path_len = len(path, kind=C_INT) + SHT_value_len = len(value, kind=C_INT) SHT_prv = c_group_create_view_string_bufferify(obj%cxxmem, path, & - len_trim(path, kind=C_INT), value, & - len_trim(value, kind=C_INT), SHT_rv%cxxmem) + SHT_path_len, value, SHT_value_len, SHT_rv%cxxmem) ! splicer end class.Group.method.create_view_string end function group_create_view_string @@ -3332,8 +3775,10 @@ subroutine group_destroy_view(obj, path) class(SidreGroup) :: obj character(len=*), intent(IN) :: path ! splicer begin class.Group.method.destroy_view + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) call c_group_destroy_view_bufferify(obj%cxxmem, path, & - len_trim(path, kind=C_INT)) + SHT_path_len) ! splicer end class.Group.method.destroy_view end subroutine group_destroy_view @@ -3342,13 +3787,15 @@ subroutine group_destroy_view_and_data_name(obj, path) class(SidreGroup) :: obj character(len=*), intent(IN) :: path ! splicer begin class.Group.method.destroy_view_and_data_name + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) call c_group_destroy_view_and_data_name_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT)) + path, SHT_path_len) ! splicer end class.Group.method.destroy_view_and_data_name end subroutine group_destroy_view_and_data_name subroutine group_destroy_view_and_data_index_int32_t(obj, idx) - use iso_c_binding, only : C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT32_T class(SidreGroup) :: obj integer(C_INT32_T), value, intent(IN) :: idx ! splicer begin class.Group.method.destroy_view_and_data_index_int32_t @@ -3373,8 +3820,8 @@ function group_move_view(obj, view) & class(SidreGroup) :: obj type(SidreView), intent(INOUT) :: view type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.move_view type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.move_view SHT_prv = c_group_move_view(obj%cxxmem, view%cxxmem, & SHT_rv%cxxmem) ! splicer end class.Group.method.move_view @@ -3386,8 +3833,8 @@ function group_copy_view(obj, view) & class(SidreGroup) :: obj type(SidreView), intent(INOUT) :: view type(SidreView) :: SHT_rv - ! splicer begin class.Group.method.copy_view type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.copy_view SHT_prv = c_group_copy_view(obj%cxxmem, view%cxxmem, & SHT_rv%cxxmem) ! splicer end class.Group.method.copy_view @@ -3400,8 +3847,10 @@ function group_has_group(obj, path) & character(len=*), intent(IN) :: path logical :: SHT_rv ! splicer begin class.Group.method.has_group + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_rv = c_group_has_group_bufferify(obj%cxxmem, path, & - len_trim(path, kind=C_INT)) + SHT_path_len) ! splicer end class.Group.method.has_group end function group_has_group @@ -3412,32 +3861,38 @@ function group_has_child_group(obj, name) & character(len=*), intent(IN) :: name logical :: SHT_rv ! splicer begin class.Group.method.has_child_group + integer(C_INT) SHT_name_len + SHT_name_len = len(name, kind=C_INT) SHT_rv = c_group_has_child_group_bufferify(obj%cxxmem, name, & - len_trim(name, kind=C_INT)) + SHT_name_len) ! splicer end class.Group.method.has_child_group end function group_has_child_group function group_get_group_index(obj, name) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T + use iso_c_binding, only : C_INT class(SidreGroup) :: obj character(len=*), intent(IN) :: name integer(SIDRE_IndexType) :: SHT_rv ! splicer begin class.Group.method.get_group_index + integer(C_INT) SHT_name_len + SHT_name_len = len(name, kind=C_INT) SHT_rv = c_group_get_group_index_bufferify(obj%cxxmem, name, & - len_trim(name, kind=C_INT)) + SHT_name_len) ! splicer end class.Group.method.get_group_index end function group_get_group_index function group_get_group_name_int32_t(obj, idx) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT, C_INT32_T class(SidreGroup) :: obj integer(C_INT32_T), value, intent(IN) :: idx character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.Group.method.get_group_name_int32_t - call c_group_get_group_name_bufferify(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv, len(SHT_rv, kind=C_INT)) + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) + call c_group_get_group_name_int32_t_bufferify(obj%cxxmem, idx, & + SHT_rv, SHT_rv_len) ! splicer end class.Group.method.get_group_name_int32_t end function group_get_group_name_int32_t @@ -3448,8 +3903,10 @@ function group_get_group_name_int64_t(obj, idx) & integer(C_INT64_T), value, intent(IN) :: idx character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.Group.method.get_group_name_int64_t - call c_group_get_group_name_bufferify(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv, len(SHT_rv, kind=C_INT)) + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) + call c_group_get_group_name_int64_t_bufferify(obj%cxxmem, idx, & + SHT_rv, SHT_rv_len) ! splicer end class.Group.method.get_group_name_int64_t end function group_get_group_name_int64_t @@ -3459,23 +3916,25 @@ function group_get_group_from_name(obj, path) & class(SidreGroup) :: obj character(len=*), intent(IN) :: path type(SidreGroup) :: SHT_rv - ! splicer begin class.Group.method.get_group_from_name type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.get_group_from_name + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_get_group_from_name_bufferify(obj%cxxmem, & - path, len_trim(path, kind=C_INT), SHT_rv%cxxmem) + path, SHT_path_len, SHT_rv%cxxmem) ! splicer end class.Group.method.get_group_from_name end function group_get_group_from_name function group_get_group_from_index_int32_t(obj, idx) & result(SHT_rv) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_PTR + use iso_c_binding, only : C_INT32_T, C_PTR class(SidreGroup) :: obj integer(C_INT32_T), value, intent(IN) :: idx type(SidreGroup) :: SHT_rv - ! splicer begin class.Group.method.get_group_from_index_int32_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_get_group_from_index(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.Group.method.get_group_from_index_int32_t + SHT_prv = c_group_get_group_from_index_int32_t(obj%cxxmem, idx, & + SHT_rv%cxxmem) ! splicer end class.Group.method.get_group_from_index_int32_t end function group_get_group_from_index_int32_t @@ -3485,16 +3944,15 @@ function group_get_group_from_index_int64_t(obj, idx) & class(SidreGroup) :: obj integer(C_INT64_T), value, intent(IN) :: idx type(SidreGroup) :: SHT_rv - ! splicer begin class.Group.method.get_group_from_index_int64_t type(C_PTR) :: SHT_prv - SHT_prv = c_group_get_group_from_index(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.Group.method.get_group_from_index_int64_t + SHT_prv = c_group_get_group_from_index_int64_t(obj%cxxmem, idx, & + SHT_rv%cxxmem) ! splicer end class.Group.method.get_group_from_index_int64_t end function group_get_group_from_index_int64_t function group_get_first_valid_group_index(obj) & result(SHT_rv) - use iso_c_binding, only : C_INT64_T class(SidreGroup) :: obj integer(SIDRE_IndexType) :: SHT_rv ! splicer begin class.Group.method.get_first_valid_group_index @@ -3504,7 +3962,7 @@ end function group_get_first_valid_group_index function group_get_next_valid_group_index_int32_t(obj, idx) & result(SHT_rv) - use iso_c_binding, only : C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT32_T class(SidreGroup) :: obj integer(C_INT32_T), value, intent(IN) :: idx integer(SIDRE_IndexType) :: SHT_rv @@ -3532,10 +3990,12 @@ function group_create_group(obj, path) & class(SidreGroup) :: obj character(len=*), intent(IN) :: path type(SidreGroup) :: SHT_rv - ! splicer begin class.Group.method.create_group type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.create_group + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) SHT_prv = c_group_create_group_bufferify(obj%cxxmem, path, & - len_trim(path, kind=C_INT), SHT_rv%cxxmem) + SHT_path_len, SHT_rv%cxxmem) ! splicer end class.Group.method.create_group end function group_create_group @@ -3544,13 +4004,15 @@ subroutine group_destroy_group_name(obj, path) class(SidreGroup) :: obj character(len=*), intent(IN) :: path ! splicer begin class.Group.method.destroy_group_name + integer(C_INT) SHT_path_len + SHT_path_len = len(path, kind=C_INT) call c_group_destroy_group_name_bufferify(obj%cxxmem, path, & - len_trim(path, kind=C_INT)) + SHT_path_len) ! splicer end class.Group.method.destroy_group_name end subroutine group_destroy_group_name subroutine group_destroy_group_index_int32_t(obj, idx) - use iso_c_binding, only : C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT32_T class(SidreGroup) :: obj integer(C_INT32_T), value, intent(IN) :: idx ! splicer begin class.Group.method.destroy_group_index_int32_t @@ -3575,8 +4037,8 @@ function group_move_group(obj, grp) & class(SidreGroup) :: obj type(SidreGroup), intent(INOUT) :: grp type(SidreGroup) :: SHT_rv - ! splicer begin class.Group.method.move_group type(C_PTR) :: SHT_prv + ! splicer begin class.Group.method.move_group SHT_prv = c_group_move_group(obj%cxxmem, grp%cxxmem, & SHT_rv%cxxmem) ! splicer end class.Group.method.move_group @@ -3606,9 +4068,12 @@ subroutine group_save(obj, file_path, protocol) character(len=*), intent(IN) :: file_path character(len=*), intent(IN) :: protocol ! splicer begin class.Group.method.save + integer(C_INT) SHT_file_path_len + integer(C_INT) SHT_protocol_len + SHT_file_path_len = len(file_path, kind=C_INT) + SHT_protocol_len = len(protocol, kind=C_INT) call c_group_save_bufferify(obj%cxxmem, file_path, & - len_trim(file_path, kind=C_INT), protocol, & - len_trim(protocol, kind=C_INT)) + SHT_file_path_len, protocol, SHT_protocol_len) ! splicer end class.Group.method.save end subroutine group_save @@ -3618,9 +4083,12 @@ subroutine group_load_0(obj, file_path, protocol) character(len=*), intent(IN) :: file_path character(len=*), intent(IN) :: protocol ! splicer begin class.Group.method.load_0 + integer(C_INT) SHT_file_path_len + integer(C_INT) SHT_protocol_len + SHT_file_path_len = len(file_path, kind=C_INT) + SHT_protocol_len = len(protocol, kind=C_INT) call c_group_load_0_bufferify(obj%cxxmem, file_path, & - len_trim(file_path, kind=C_INT), protocol, & - len_trim(protocol, kind=C_INT)) + SHT_file_path_len, protocol, SHT_protocol_len) ! splicer end class.Group.method.load_0 end subroutine group_load_0 @@ -3631,11 +4099,15 @@ subroutine group_load_1(obj, file_path, protocol, preserve_contents) character(len=*), intent(IN) :: protocol logical, value, intent(IN) :: preserve_contents ! splicer begin class.Group.method.load_1 + integer(C_INT) SHT_file_path_len + integer(C_INT) SHT_protocol_len logical(C_BOOL) SH_preserve_contents + SHT_file_path_len = len(file_path, kind=C_INT) + SHT_protocol_len = len(protocol, kind=C_INT) SH_preserve_contents = preserve_contents ! coerce to C_BOOL call c_group_load_1_bufferify(obj%cxxmem, file_path, & - len_trim(file_path, kind=C_INT), protocol, & - len_trim(protocol, kind=C_INT), SH_preserve_contents) + SHT_file_path_len, protocol, SHT_protocol_len, & + SH_preserve_contents) ! splicer end class.Group.method.load_1 end subroutine group_load_1 @@ -3644,8 +4116,10 @@ subroutine group_load_external_data(obj, file_path) class(SidreGroup) :: obj character(len=*), intent(IN) :: file_path ! splicer begin class.Group.method.load_external_data + integer(C_INT) SHT_file_path_len + SHT_file_path_len = len(file_path, kind=C_INT) call c_group_load_external_data_bufferify(obj%cxxmem, file_path, & - len_trim(file_path, kind=C_INT)) + SHT_file_path_len) ! splicer end class.Group.method.load_external_data end subroutine group_load_external_data @@ -3656,8 +4130,10 @@ function group_rename(obj, new_name) & character(len=*), intent(IN) :: new_name logical :: SHT_rv ! splicer begin class.Group.method.rename + integer(C_INT) SHT_new_name_len + SHT_new_name_len = len(new_name, kind=C_INT) SHT_rv = c_group_rename_bufferify(obj%cxxmem, new_name, & - len_trim(new_name, kind=C_INT)) + SHT_new_name_len) ! splicer end class.Group.method.rename end function group_rename @@ -3693,7 +4169,7 @@ subroutine group_get_scalar_int(grp, name, value) character(*), intent(IN) :: name integer(C_INT), intent(OUT) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -3708,7 +4184,7 @@ subroutine group_get_scalar_long(grp, name, value) character(*), intent(IN) :: name integer(C_LONG), intent(OUT) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -3723,7 +4199,7 @@ subroutine group_get_scalar_float(grp, name, value) character(*), intent(IN) :: name real(C_FLOAT), intent(OUT) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -3738,7 +4214,7 @@ subroutine group_get_scalar_double(grp, name, value) character(*), intent(IN) :: name real(C_DOUBLE), intent(OUT) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -3753,7 +4229,7 @@ subroutine group_set_scalar_int(grp, name, value) character(*), intent(IN) :: name integer(C_INT), intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -3768,7 +4244,7 @@ subroutine group_set_scalar_long(grp, name, value) character(*), intent(IN) :: name integer(C_LONG), intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -3783,7 +4259,7 @@ subroutine group_set_scalar_float(grp, name, value) character(*), intent(IN) :: name real(C_FLOAT), intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -3798,7 +4274,7 @@ subroutine group_set_scalar_double(grp, name, value) character(*), intent(IN) :: name real(C_DOUBLE), intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -4336,7 +4812,7 @@ subroutine group_set_array_data_ptr_int_scalar(grp, name, value) character(len=*), intent(IN) :: name integer(C_INT), target, intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(1) ! integer(C_INT), parameter :: type = SIDRE_INT_ID type(C_PTR) addr, viewptr @@ -4365,7 +4841,7 @@ subroutine group_set_array_data_ptr_int_1d(grp, name, value) character(len=*), intent(IN) :: name integer(C_INT), target, intent(IN) :: value(:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(1) ! integer(C_INT), parameter :: type = SIDRE_INT_ID type(C_PTR) addr, viewptr @@ -4394,7 +4870,7 @@ subroutine group_set_array_data_ptr_int_2d(grp, name, value) character(len=*), intent(IN) :: name integer(C_INT), target, intent(IN) :: value(:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(2) ! integer(C_INT), parameter :: type = SIDRE_INT_ID type(C_PTR) addr, viewptr @@ -4423,7 +4899,7 @@ subroutine group_set_array_data_ptr_int_3d(grp, name, value) character(len=*), intent(IN) :: name integer(C_INT), target, intent(IN) :: value(:,:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(3) ! integer(C_INT), parameter :: type = SIDRE_INT_ID type(C_PTR) addr, viewptr @@ -4452,7 +4928,7 @@ subroutine group_set_array_data_ptr_int_4d(grp, name, value) character(len=*), intent(IN) :: name integer(C_INT), target, intent(IN) :: value(:,:,:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(4) ! integer(C_INT), parameter :: type = SIDRE_INT_ID type(C_PTR) addr, viewptr @@ -4481,7 +4957,7 @@ subroutine group_set_array_data_ptr_long_scalar(grp, name, value) character(len=*), intent(IN) :: name integer(C_LONG), target, intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(1) ! integer(C_INT), parameter :: type = SIDRE_LONG_ID type(C_PTR) addr, viewptr @@ -4510,7 +4986,7 @@ subroutine group_set_array_data_ptr_long_1d(grp, name, value) character(len=*), intent(IN) :: name integer(C_LONG), target, intent(IN) :: value(:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(1) ! integer(C_INT), parameter :: type = SIDRE_LONG_ID type(C_PTR) addr, viewptr @@ -4539,7 +5015,7 @@ subroutine group_set_array_data_ptr_long_2d(grp, name, value) character(len=*), intent(IN) :: name integer(C_LONG), target, intent(IN) :: value(:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(2) ! integer(C_INT), parameter :: type = SIDRE_LONG_ID type(C_PTR) addr, viewptr @@ -4568,7 +5044,7 @@ subroutine group_set_array_data_ptr_long_3d(grp, name, value) character(len=*), intent(IN) :: name integer(C_LONG), target, intent(IN) :: value(:,:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(3) ! integer(C_INT), parameter :: type = SIDRE_LONG_ID type(C_PTR) addr, viewptr @@ -4597,7 +5073,7 @@ subroutine group_set_array_data_ptr_long_4d(grp, name, value) character(len=*), intent(IN) :: name integer(C_LONG), target, intent(IN) :: value(:,:,:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(4) ! integer(C_INT), parameter :: type = SIDRE_LONG_ID type(C_PTR) addr, viewptr @@ -4626,7 +5102,7 @@ subroutine group_set_array_data_ptr_float_scalar(grp, name, value) character(len=*), intent(IN) :: name real(C_FLOAT), target, intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(1) ! integer(C_INT), parameter :: type = SIDRE_FLOAT_ID type(C_PTR) addr, viewptr @@ -4655,7 +5131,7 @@ subroutine group_set_array_data_ptr_float_1d(grp, name, value) character(len=*), intent(IN) :: name real(C_FLOAT), target, intent(IN) :: value(:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(1) ! integer(C_INT), parameter :: type = SIDRE_FLOAT_ID type(C_PTR) addr, viewptr @@ -4684,7 +5160,7 @@ subroutine group_set_array_data_ptr_float_2d(grp, name, value) character(len=*), intent(IN) :: name real(C_FLOAT), target, intent(IN) :: value(:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(2) ! integer(C_INT), parameter :: type = SIDRE_FLOAT_ID type(C_PTR) addr, viewptr @@ -4713,7 +5189,7 @@ subroutine group_set_array_data_ptr_float_3d(grp, name, value) character(len=*), intent(IN) :: name real(C_FLOAT), target, intent(IN) :: value(:,:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(3) ! integer(C_INT), parameter :: type = SIDRE_FLOAT_ID type(C_PTR) addr, viewptr @@ -4742,7 +5218,7 @@ subroutine group_set_array_data_ptr_float_4d(grp, name, value) character(len=*), intent(IN) :: name real(C_FLOAT), target, intent(IN) :: value(:,:,:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(4) ! integer(C_INT), parameter :: type = SIDRE_FLOAT_ID type(C_PTR) addr, viewptr @@ -4771,7 +5247,7 @@ subroutine group_set_array_data_ptr_double_scalar(grp, name, value) character(len=*), intent(IN) :: name real(C_DOUBLE), target, intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(1) ! integer(C_INT), parameter :: type = SIDRE_DOUBLE_ID type(C_PTR) addr, viewptr @@ -4800,7 +5276,7 @@ subroutine group_set_array_data_ptr_double_1d(grp, name, value) character(len=*), intent(IN) :: name real(C_DOUBLE), target, intent(IN) :: value(:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(1) ! integer(C_INT), parameter :: type = SIDRE_DOUBLE_ID type(C_PTR) addr, viewptr @@ -4829,7 +5305,7 @@ subroutine group_set_array_data_ptr_double_2d(grp, name, value) character(len=*), intent(IN) :: name real(C_DOUBLE), target, intent(IN) :: value(:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(2) ! integer(C_INT), parameter :: type = SIDRE_DOUBLE_ID type(C_PTR) addr, viewptr @@ -4858,7 +5334,7 @@ subroutine group_set_array_data_ptr_double_3d(grp, name, value) character(len=*), intent(IN) :: name real(C_DOUBLE), target, intent(IN) :: value(:,:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(3) ! integer(C_INT), parameter :: type = SIDRE_DOUBLE_ID type(C_PTR) addr, viewptr @@ -4887,7 +5363,7 @@ subroutine group_set_array_data_ptr_double_4d(grp, name, value) character(len=*), intent(IN) :: name real(C_DOUBLE), target, intent(IN) :: value(:,:,:,:) integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view ! integer(SIDRE_IndexType) :: extents(4) ! integer(C_INT), parameter :: type = SIDRE_DOUBLE_ID type(C_PTR) addr, viewptr @@ -4912,7 +5388,7 @@ subroutine group_get_string(grp, name, value) character(*), intent(IN) :: name character(*), intent(OUT) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -4926,7 +5402,7 @@ subroutine group_set_string(grp, name, value) character(*), intent(IN) :: name character(*), intent(IN) :: value integer(C_INT) :: lname - type(SIDRE_SHROUD_view_capsule) view + type(SIDRE_SHROUD_capsule_data) view type(C_PTR) viewptr lname = len_trim(name) @@ -4938,7 +5414,6 @@ end subroutine group_set_string function view_get_index(obj) & result(SHT_rv) - use iso_c_binding, only : C_INT64_T class(SidreView) :: obj integer(SIDRE_IndexType) :: SHT_rv ! splicer begin class.View.method.get_index @@ -4952,8 +5427,9 @@ function view_get_name(obj) & class(SidreView) :: obj character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.View.method.get_name - call c_view_get_name_bufferify(obj%cxxmem, SHT_rv, & - len(SHT_rv, kind=C_INT)) + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) + call c_view_get_name_bufferify(obj%cxxmem, SHT_rv, SHT_rv_len) ! splicer end class.View.method.get_name end function view_get_name @@ -4963,8 +5439,9 @@ function view_get_path(obj) & class(SidreView) :: obj character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.View.method.get_path - call c_view_get_path_bufferify(obj%cxxmem, SHT_rv, & - len(SHT_rv, kind=C_INT)) + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) + call c_view_get_path_bufferify(obj%cxxmem, SHT_rv, SHT_rv_len) ! splicer end class.View.method.get_path end function view_get_path @@ -4974,8 +5451,10 @@ function view_get_path_name(obj) & class(SidreView) :: obj character(len=MAXNAMESIZE) :: SHT_rv ! splicer begin class.View.method.get_path_name + integer(C_INT) SHT_rv_len + SHT_rv_len = len(SHT_rv, kind=C_INT) call c_view_get_path_name_bufferify(obj%cxxmem, SHT_rv, & - len(SHT_rv, kind=C_INT)) + SHT_rv_len) ! splicer end class.View.method.get_path_name end function view_get_path_name @@ -4984,8 +5463,8 @@ function view_get_owning_group(obj) & use iso_c_binding, only : C_PTR class(SidreView) :: obj type(SidreGroup) :: SHT_rv - ! splicer begin class.View.method.get_owning_group type(C_PTR) :: SHT_prv + ! splicer begin class.View.method.get_owning_group SHT_prv = c_view_get_owning_group(obj%cxxmem, SHT_rv%cxxmem) ! splicer end class.View.method.get_owning_group end function view_get_owning_group @@ -5005,8 +5484,8 @@ function view_get_buffer(obj) & use iso_c_binding, only : C_PTR class(SidreView) :: obj type(SidreBuffer) :: SHT_rv - ! splicer begin class.View.method.get_buffer type(C_PTR) :: SHT_prv + ! splicer begin class.View.method.get_buffer SHT_prv = c_view_get_buffer(obj%cxxmem, SHT_rv%cxxmem) ! splicer end class.View.method.get_buffer end function view_get_buffer @@ -5093,7 +5572,6 @@ end function view_is_string function view_get_type_id(obj) & result(SHT_rv) - use iso_c_binding, only : C_INT class(SidreView) :: obj integer(TypeIDint) :: SHT_rv ! splicer begin class.View.method.get_type_id @@ -5163,7 +5641,7 @@ end function view_get_num_dimensions function view_get_shape(obj, ndims, shape) & result(SHT_rv) - use iso_c_binding, only : C_INT, C_INT64_T + use iso_c_binding, only : C_INT class(SidreView) :: obj integer(C_INT), value, intent(IN) :: ndims integer(SIDRE_IndexType), intent(OUT) :: shape(:) @@ -5181,7 +5659,7 @@ subroutine view_allocate_simple(obj) end subroutine view_allocate_simple subroutine view_allocate_from_type_int32_t(obj, type, num_elems) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT32_T class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems @@ -5192,7 +5670,7 @@ subroutine view_allocate_from_type_int32_t(obj, type, num_elems) end subroutine view_allocate_from_type_int32_t subroutine view_allocate_from_type_int64_t(obj, type, num_elems) - use iso_c_binding, only : C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT64_T class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems @@ -5203,7 +5681,7 @@ subroutine view_allocate_from_type_int64_t(obj, type, num_elems) end subroutine view_allocate_from_type_int64_t subroutine view_reallocate_int32_t(obj, num_elems) - use iso_c_binding, only : C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT32_T class(SidreView) :: obj integer(C_INT32_T), value, intent(IN) :: num_elems ! splicer begin class.View.method.reallocate_int32_t @@ -5232,32 +5710,32 @@ end subroutine view_attach_buffer_only subroutine view_attach_buffer_type_int32_t(obj, type, num_elems, & buff) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT32_T class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems type(SidreBuffer), intent(INOUT) :: buff ! splicer begin class.View.method.attach_buffer_type_int32_t - call c_view_attach_buffer_type(obj%cxxmem, type, & - int(num_elems, SIDRE_IndexType), buff%cxxmem) + call c_view_attach_buffer_type_int32_t(obj%cxxmem, type, & + num_elems, buff%cxxmem) ! splicer end class.View.method.attach_buffer_type_int32_t end subroutine view_attach_buffer_type_int32_t subroutine view_attach_buffer_type_int64_t(obj, type, num_elems, & buff) - use iso_c_binding, only : C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT64_T class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems type(SidreBuffer), intent(INOUT) :: buff ! splicer begin class.View.method.attach_buffer_type_int64_t - call c_view_attach_buffer_type(obj%cxxmem, type, & - int(num_elems, SIDRE_IndexType), buff%cxxmem) + call c_view_attach_buffer_type_int64_t(obj%cxxmem, type, & + num_elems, buff%cxxmem) ! splicer end class.View.method.attach_buffer_type_int64_t end subroutine view_attach_buffer_type_int64_t subroutine view_attach_buffer_shape(obj, type, ndims, shape, buff) - use iso_c_binding, only : C_INT, C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims @@ -5284,7 +5762,6 @@ subroutine view_apply_0(obj) end subroutine view_apply_0 subroutine view_apply_nelems(obj, num_elems) - use iso_c_binding, only : C_INT64_T class(SidreView) :: obj integer(SIDRE_IndexType), value, intent(IN) :: num_elems ! splicer begin class.View.method.apply_nelems @@ -5293,7 +5770,6 @@ subroutine view_apply_nelems(obj, num_elems) end subroutine view_apply_nelems subroutine view_apply_nelems_offset(obj, num_elems, offset) - use iso_c_binding, only : C_INT64_T class(SidreView) :: obj integer(SIDRE_IndexType), value, intent(IN) :: num_elems integer(SIDRE_IndexType), value, intent(IN) :: offset @@ -5304,7 +5780,6 @@ end subroutine view_apply_nelems_offset subroutine view_apply_nelems_offset_stride(obj, num_elems, offset, & stride) - use iso_c_binding, only : C_INT64_T class(SidreView) :: obj integer(SIDRE_IndexType), value, intent(IN) :: num_elems integer(SIDRE_IndexType), value, intent(IN) :: offset @@ -5316,7 +5791,6 @@ subroutine view_apply_nelems_offset_stride(obj, num_elems, offset, & end subroutine view_apply_nelems_offset_stride subroutine view_apply_type_nelems(obj, type, num_elems) - use iso_c_binding, only : C_INT64_T, C_SHORT class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems @@ -5327,7 +5801,6 @@ end subroutine view_apply_type_nelems subroutine view_apply_type_nelems_offset(obj, type, num_elems, & offset) - use iso_c_binding, only : C_INT64_T, C_SHORT class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems @@ -5340,7 +5813,6 @@ end subroutine view_apply_type_nelems_offset subroutine view_apply_type_nelems_offset_stride(obj, type, & num_elems, offset, stride) - use iso_c_binding, only : C_INT64_T, C_SHORT class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(SIDRE_IndexType), value, intent(IN) :: num_elems @@ -5353,7 +5825,7 @@ subroutine view_apply_type_nelems_offset_stride(obj, type, & end subroutine view_apply_type_nelems_offset_stride subroutine view_apply_type_shape(obj, type, ndims, shape) - use iso_c_binding, only : C_INT, C_INT64_T, C_SHORT + use iso_c_binding, only : C_INT class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims @@ -5404,8 +5876,10 @@ subroutine view_set_string(obj, value) class(SidreView) :: obj character(len=*), intent(IN) :: value ! splicer begin class.View.method.set_string + integer(C_INT) SHT_value_len + SHT_value_len = len(value, kind=C_INT) call c_view_set_string_bufferify(obj%cxxmem, value, & - len_trim(value, kind=C_INT)) + SHT_value_len) ! splicer end class.View.method.set_string end subroutine view_set_string @@ -5420,33 +5894,33 @@ end subroutine view_set_external_data_ptr_only subroutine view_set_external_data_ptr_type_int32_t(obj, type, & num_elems, external_ptr) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT32_T, C_PTR class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems type(C_PTR), intent(IN) :: external_ptr ! splicer begin class.View.method.set_external_data_ptr_type_int32_t - call c_view_set_external_data_ptr_type(obj%cxxmem, type, & - int(num_elems, SIDRE_IndexType), external_ptr) + call c_view_set_external_data_ptr_type_int32_t(obj%cxxmem, type, & + num_elems, external_ptr) ! splicer end class.View.method.set_external_data_ptr_type_int32_t end subroutine view_set_external_data_ptr_type_int32_t subroutine view_set_external_data_ptr_type_int64_t(obj, type, & num_elems, external_ptr) - use iso_c_binding, only : C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT64_T, C_PTR class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems type(C_PTR), intent(IN) :: external_ptr ! splicer begin class.View.method.set_external_data_ptr_type_int64_t - call c_view_set_external_data_ptr_type(obj%cxxmem, type, & - int(num_elems, SIDRE_IndexType), external_ptr) + call c_view_set_external_data_ptr_type_int64_t(obj%cxxmem, type, & + num_elems, external_ptr) ! splicer end class.View.method.set_external_data_ptr_type_int64_t end subroutine view_set_external_data_ptr_type_int64_t subroutine view_set_external_data_ptr_shape(obj, type, ndims, shape, & external_ptr) - use iso_c_binding, only : C_INT, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT, C_PTR class(SidreView) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT), value, intent(IN) :: ndims @@ -5463,8 +5937,9 @@ subroutine view_get_string(obj, name) class(SidreView) :: obj character(len=*), intent(OUT) :: name ! splicer begin class.View.method.get_string - call c_view_get_string_bufferify(obj%cxxmem, name, & - len(name, kind=C_INT)) + integer(C_INT) SHT_name_len + SHT_name_len = len(name, kind=C_INT) + call c_view_get_string_bufferify(obj%cxxmem, name, SHT_name_len) ! splicer end class.View.method.get_string end subroutine view_get_string @@ -5532,8 +6007,10 @@ function view_rename(obj, new_name) & character(len=*), intent(IN) :: new_name logical :: SHT_rv ! splicer begin class.View.method.rename + integer(C_INT) SHT_new_name_len + SHT_new_name_len = len(new_name, kind=C_INT) SHT_rv = c_view_rename_bufferify(obj%cxxmem, new_name, & - len_trim(new_name, kind=C_INT)) + SHT_new_name_len) ! splicer end class.View.method.rename end function view_rename @@ -6535,8 +7012,8 @@ function datastore_new() & result(SHT_rv) use iso_c_binding, only : C_PTR type(SidreDataStore) :: SHT_rv - ! splicer begin class.DataStore.method.new type(C_PTR) :: SHT_prv + ! splicer begin class.DataStore.method.new SHT_prv = c_datastore_new(SHT_rv%cxxmem) ! splicer end class.DataStore.method.new end function datastore_new @@ -6553,8 +7030,8 @@ function datastore_get_root(obj) & use iso_c_binding, only : C_PTR class(SidreDataStore) :: obj type(SidreGroup) :: SHT_rv - ! splicer begin class.DataStore.method.get_root type(C_PTR) :: SHT_prv + ! splicer begin class.DataStore.method.get_root SHT_prv = c_datastore_get_root(obj%cxxmem, SHT_rv%cxxmem) ! splicer end class.DataStore.method.get_root end function datastore_get_root @@ -6571,14 +7048,14 @@ end function datastore_get_num_buffers function datastore_get_buffer_int32_t(obj, idx) & result(SHT_rv) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_PTR + use iso_c_binding, only : C_INT32_T, C_PTR class(SidreDataStore) :: obj integer(C_INT32_T), value, intent(IN) :: idx type(SidreBuffer) :: SHT_rv - ! splicer begin class.DataStore.method.get_buffer_int32_t type(C_PTR) :: SHT_prv - SHT_prv = c_datastore_get_buffer(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.DataStore.method.get_buffer_int32_t + SHT_prv = c_datastore_get_buffer_int32_t(obj%cxxmem, idx, & + SHT_rv%cxxmem) ! splicer end class.DataStore.method.get_buffer_int32_t end function datastore_get_buffer_int32_t @@ -6588,10 +7065,10 @@ function datastore_get_buffer_int64_t(obj, idx) & class(SidreDataStore) :: obj integer(C_INT64_T), value, intent(IN) :: idx type(SidreBuffer) :: SHT_rv - ! splicer begin class.DataStore.method.get_buffer_int64_t type(C_PTR) :: SHT_prv - SHT_prv = c_datastore_get_buffer(obj%cxxmem, & - int(idx, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.DataStore.method.get_buffer_int64_t + SHT_prv = c_datastore_get_buffer_int64_t(obj%cxxmem, idx, & + SHT_rv%cxxmem) ! splicer end class.DataStore.method.get_buffer_int64_t end function datastore_get_buffer_int64_t @@ -6600,8 +7077,8 @@ function datastore_create_buffer_empty(obj) & use iso_c_binding, only : C_PTR class(SidreDataStore) :: obj type(SidreBuffer) :: SHT_rv - ! splicer begin class.DataStore.method.create_buffer_empty type(C_PTR) :: SHT_prv + ! splicer begin class.DataStore.method.create_buffer_empty SHT_prv = c_datastore_create_buffer_empty(obj%cxxmem, & SHT_rv%cxxmem) ! splicer end class.DataStore.method.create_buffer_empty @@ -6610,35 +7087,35 @@ end function datastore_create_buffer_empty function datastore_create_buffer_from_type_int32_t(obj, type, & num_elems) & result(SHT_rv) - use iso_c_binding, only : C_INT32_T, C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT32_T, C_PTR class(SidreDataStore) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT32_T), value, intent(IN) :: num_elems type(SidreBuffer) :: SHT_rv - ! splicer begin class.DataStore.method.create_buffer_from_type_int32_t type(C_PTR) :: SHT_prv - SHT_prv = c_datastore_create_buffer_from_type(obj%cxxmem, type, & - int(num_elems, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.DataStore.method.create_buffer_from_type_int32_t + SHT_prv = c_datastore_create_buffer_from_type_int32_t(obj%cxxmem, & + type, num_elems, SHT_rv%cxxmem) ! splicer end class.DataStore.method.create_buffer_from_type_int32_t end function datastore_create_buffer_from_type_int32_t function datastore_create_buffer_from_type_int64_t(obj, type, & num_elems) & result(SHT_rv) - use iso_c_binding, only : C_INT64_T, C_PTR, C_SHORT + use iso_c_binding, only : C_INT64_T, C_PTR class(SidreDataStore) :: obj integer(TypeID), value, intent(IN) :: type integer(C_INT64_T), value, intent(IN) :: num_elems type(SidreBuffer) :: SHT_rv - ! splicer begin class.DataStore.method.create_buffer_from_type_int64_t type(C_PTR) :: SHT_prv - SHT_prv = c_datastore_create_buffer_from_type(obj%cxxmem, type, & - int(num_elems, SIDRE_IndexType), SHT_rv%cxxmem) + ! splicer begin class.DataStore.method.create_buffer_from_type_int64_t + SHT_prv = c_datastore_create_buffer_from_type_int64_t(obj%cxxmem, & + type, num_elems, SHT_rv%cxxmem) ! splicer end class.DataStore.method.create_buffer_from_type_int64_t end function datastore_create_buffer_from_type_int64_t subroutine datastore_destroy_buffer_int32_t(obj, id) - use iso_c_binding, only : C_INT32_T, C_INT64_T + use iso_c_binding, only : C_INT32_T class(SidreDataStore) :: obj integer(C_INT32_T), value, intent(IN) :: id ! splicer begin class.DataStore.method.destroy_buffer_int32_t @@ -6668,10 +7145,16 @@ function datastore_generate_blueprint_index_0(obj, domain_path, & integer(C_INT), value, intent(IN) :: num_domains logical :: SHT_rv ! splicer begin class.DataStore.method.generate_blueprint_index_0 + integer(C_INT) SHT_domain_path_len + integer(C_INT) SHT_mesh_name_len + integer(C_INT) SHT_index_path_len + SHT_domain_path_len = len(domain_path, kind=C_INT) + SHT_mesh_name_len = len(mesh_name, kind=C_INT) + SHT_index_path_len = len(index_path, kind=C_INT) SHT_rv = c_datastore_generate_blueprint_index_0_bufferify(obj%cxxmem, & - domain_path, len_trim(domain_path, kind=C_INT), mesh_name, & - len_trim(mesh_name, kind=C_INT), index_path, & - len_trim(index_path, kind=C_INT), num_domains) + domain_path, SHT_domain_path_len, mesh_name, & + SHT_mesh_name_len, index_path, SHT_index_path_len, & + num_domains) ! splicer end class.DataStore.method.generate_blueprint_index_0 end function datastore_generate_blueprint_index_0 @@ -6687,10 +7170,15 @@ function datastore_generate_blueprint_index_1(obj, comm, & character(len=*), intent(IN) :: index_path logical :: SHT_rv ! splicer begin class.DataStore.method.generate_blueprint_index_1 + integer(C_INT) SHT_domain_path_len + integer(C_INT) SHT_mesh_name_len + integer(C_INT) SHT_index_path_len + SHT_domain_path_len = len(domain_path, kind=C_INT) + SHT_mesh_name_len = len(mesh_name, kind=C_INT) + SHT_index_path_len = len(index_path, kind=C_INT) SHT_rv = c_datastore_generate_blueprint_index_1_bufferify(obj%cxxmem, & - comm, domain_path, len_trim(domain_path, kind=C_INT), & - mesh_name, len_trim(mesh_name, kind=C_INT), index_path, & - len_trim(index_path, kind=C_INT)) + comm, domain_path, SHT_domain_path_len, mesh_name, & + SHT_mesh_name_len, index_path, SHT_index_path_len) ! splicer end class.DataStore.method.generate_blueprint_index_1 end function datastore_generate_blueprint_index_1 #endif diff --git a/src/axom/sidre/interface/sidre.h b/src/axom/sidre/interface/sidre.h index 287285cbb6..a63ed079fa 100644 --- a/src/axom/sidre/interface/sidre.h +++ b/src/axom/sidre/interface/sidre.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/interface/sidre_shroud.yaml b/src/axom/sidre/interface/sidre_shroud.yaml index 7c0271a7e6..28f2af33c6 100644 --- a/src/axom/sidre/interface/sidre_shroud.yaml +++ b/src/axom/sidre/interface/sidre_shroud.yaml @@ -3,7 +3,7 @@ # copyright: - - - Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and + - Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and - other Axom Project Developers. See the top-level LICENSE file for details. - - "SPDX-License-Identifier: (BSD-3-Clause)" @@ -14,6 +14,7 @@ namespace: axom sidre options: # debug: True + C_API_case: underscore C_line_length: 1000 F_module_per_class: False F_module_name_library_template: axom_{library_lower} @@ -46,6 +47,16 @@ declarations: f_c_module: "--import--": - SIDRE_IndexType + splicer: + f: | + #if defined(AXOM_USE_64BIT_INDEXTYPE) && !defined(AXOM_NO_INT64_T) + integer, parameter :: SIDRE_IndexType = C_INT64_T + #else + integer, parameter :: SIDRE_IndexType = C_INT32_T + #endif + integer, parameter :: invalid_index = -1_SIDRE_IndexType + c: + - // See SidreTypes.h - decl: typedef short TypeID fields: @@ -91,22 +102,27 @@ declarations: cxx_header: axom/sidre/core/Buffer.hpp format: F_derived_name: SidreBuffer + C_name_api: Buffer - decl: class Group # SidreTypes.h is required for C_invalid_name pattern. cxx_header: axom/sidre/core/Group.hpp format: F_derived_name: SidreGroup + C_name_api: Group - decl: class View cxx_header: axom/sidre/core/View.hpp format: F_derived_name: SidreView + C_name_api: View #################################################################### - decl: class DataStore cxx_header: axom/sidre/core/DataStore.hpp format: + C_name_api: DataStore + F_name_api: datastore F_derived_name: SidreDataStore declarations: diff --git a/src/axom/sidre/interface/yaml/sidre_types.yaml b/src/axom/sidre/interface/yaml/sidre_types.yaml index 6bbcbf54fc..fe29d8e60a 100644 --- a/src/axom/sidre/interface/yaml/sidre_types.yaml +++ b/src/axom/sidre/interface/yaml/sidre_types.yaml @@ -1,7 +1,7 @@ # sidre_types.yaml -# This file is generated by Shroud 0.12.2. Do not edit. +# This file is generated by Shroud 0.13.0. Do not edit. # -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -19,7 +19,7 @@ typemap: c_type: SIDRE_Buffer f_module_name: axom_sidre f_derived_type: SidreBuffer - f_capsule_data_type: SIDRE_SHROUD_buffer_capsule + f_capsule_data_type: SIDRE_SHROUD_capsule_data f_to_c: "{f_var}%cxxmem" - type: DataStore fields: @@ -29,7 +29,7 @@ typemap: c_type: SIDRE_DataStore f_module_name: axom_sidre f_derived_type: SidreDataStore - f_capsule_data_type: SIDRE_SHROUD_datastore_capsule + f_capsule_data_type: SIDRE_SHROUD_capsule_data f_to_c: "{f_var}%cxxmem" - type: Group fields: @@ -39,7 +39,7 @@ typemap: c_type: SIDRE_Group f_module_name: axom_sidre f_derived_type: SidreGroup - f_capsule_data_type: SIDRE_SHROUD_group_capsule + f_capsule_data_type: SIDRE_SHROUD_capsule_data f_to_c: "{f_var}%cxxmem" - type: View fields: @@ -49,5 +49,5 @@ typemap: c_type: SIDRE_View f_module_name: axom_sidre f_derived_type: SidreView - f_capsule_data_type: SIDRE_SHROUD_view_capsule + f_capsule_data_type: SIDRE_SHROUD_capsule_data f_to_c: "{f_var}%cxxmem" diff --git a/src/axom/sidre/spio/IOBaton.cpp b/src/axom/sidre/spio/IOBaton.cpp index ab39fec1db..7a0c246849 100644 --- a/src/axom/sidre/spio/IOBaton.cpp +++ b/src/axom/sidre/spio/IOBaton.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/spio/IOBaton.hpp b/src/axom/sidre/spio/IOBaton.hpp index 059effcb83..52b31ba0aa 100644 --- a/src/axom/sidre/spio/IOBaton.hpp +++ b/src/axom/sidre/spio/IOBaton.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/spio/IOManager.cpp b/src/axom/sidre/spio/IOManager.cpp index fb1f94ef04..dddf70b092 100644 --- a/src/axom/sidre/spio/IOManager.cpp +++ b/src/axom/sidre/spio/IOManager.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/spio/IOManager.hpp b/src/axom/sidre/spio/IOManager.hpp index f39c7be9f6..68af7be0a8 100644 --- a/src/axom/sidre/spio/IOManager.hpp +++ b/src/axom/sidre/spio/IOManager.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/spio/interface/CMakeLists.txt b/src/axom/sidre/spio/interface/CMakeLists.txt index 5eeade9597..9cb51a54d0 100644 --- a/src/axom/sidre/spio/interface/CMakeLists.txt +++ b/src/axom/sidre/spio/interface/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/spio/interface/c_fortran/typesSPIO.h b/src/axom/sidre/spio/interface/c_fortran/typesSPIO.h index 053aeb694c..0ee164a32c 100644 --- a/src/axom/sidre/spio/interface/c_fortran/typesSPIO.h +++ b/src/axom/sidre/spio/interface/c_fortran/typesSPIO.h @@ -1,7 +1,7 @@ // typesSPIO.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -10,14 +10,20 @@ #ifndef TYPESSPIO_H #define TYPESSPIO_H +// splicer begin types.CXX_declarations +// splicer end types.CXX_declarations + #ifdef __cplusplus extern "C" { #endif +// splicer begin types.C_declarations +// splicer end types.C_declarations + // helper capsule_SPIO_IOManager struct s_SPIO_IOManager { - void* addr; /* address of C++ memory */ + void *addr; /* address of C++ memory */ int idtor; /* index of destructor */ }; typedef struct s_SPIO_IOManager SPIO_IOManager; @@ -25,12 +31,12 @@ typedef struct s_SPIO_IOManager SPIO_IOManager; // helper capsule_data_helper struct s_SPIO_SHROUD_capsule_data { - void* addr; /* address of C++ memory */ + void *addr; /* address of C++ memory */ int idtor; /* index of destructor */ }; typedef struct s_SPIO_SHROUD_capsule_data SPIO_SHROUD_capsule_data; -void SPIO_SHROUD_memory_destructor(SPIO_SHROUD_capsule_data* cap); +void SPIO_SHROUD_memory_destructor(SPIO_SHROUD_capsule_data *cap); #ifdef __cplusplus } diff --git a/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.cpp b/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.cpp index 3e1c849d39..a87101c6a9 100644 --- a/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.cpp +++ b/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.cpp @@ -1,20 +1,39 @@ // wrapIOManager.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapIOManager.h" -#include -#include + #include "axom/sidre/spio/IOManager.hpp" +#include +#include +#include "wrapIOManager.h" // splicer begin class.IOManager.CXX_definitions // splicer end class.IOManager.CXX_definitions extern "C" { +// helper ShroudLenTrim +// Returns the length of character string src with length nsrc, +// ignoring any trailing blanks. +static int ShroudLenTrim(const char *src, int nsrc) +{ + int i; + + for(i = nsrc - 1; i >= 0; i--) + { + if(src[i] != ' ') + { + break; + } + } + + return i + 1; +} + // splicer begin class.IOManager.C_definitions // splicer end class.IOManager.C_definitions @@ -73,18 +92,21 @@ void SPIO_IOManager_write_0(SPIO_IOManager *self, void SPIO_IOManager_write_0_bufferify(SPIO_IOManager *self, SIDRE_Group *group, int num_files, - const char *file_string, - int Lfile_string, - const char *protocol, - int Lprotocol) + char *file_string, + int SHT_file_string_len, + char *protocol, + int SHT_protocol_len) { axom::sidre::IOManager *SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.write_0_bufferify axom::sidre::Group *SHCXX_group = static_cast(group->addr); - const std::string SHCXX_file_string(file_string, Lfile_string); - const std::string SHCXX_protocol(protocol, Lprotocol); + const std::string SHCXX_file_string( + file_string, + ShroudLenTrim(file_string, SHT_file_string_len)); + const std::string SHCXX_protocol(protocol, + ShroudLenTrim(protocol, SHT_protocol_len)); SH_this->write(SHCXX_group, num_files, SHCXX_file_string, SHCXX_protocol); // splicer end class.IOManager.method.write_0_bufferify } @@ -115,21 +137,26 @@ void SPIO_IOManager_write_1(SPIO_IOManager *self, void SPIO_IOManager_write_1_bufferify(SPIO_IOManager *self, SIDRE_Group *group, int num_files, - const char *file_string, - int Lfile_string, - const char *protocol, - int Lprotocol, - const char *tree_pattern, - int Ltree_pattern) + char *file_string, + int SHT_file_string_len, + char *protocol, + int SHT_protocol_len, + char *tree_pattern, + int SHT_tree_pattern_len) { axom::sidre::IOManager *SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.write_1_bufferify axom::sidre::Group *SHCXX_group = static_cast(group->addr); - const std::string SHCXX_file_string(file_string, Lfile_string); - const std::string SHCXX_protocol(protocol, Lprotocol); - const std::string SHCXX_tree_pattern(tree_pattern, Ltree_pattern); + const std::string SHCXX_file_string( + file_string, + ShroudLenTrim(file_string, SHT_file_string_len)); + const std::string SHCXX_protocol(protocol, + ShroudLenTrim(protocol, SHT_protocol_len)); + const std::string SHCXX_tree_pattern( + tree_pattern, + ShroudLenTrim(tree_pattern, SHT_tree_pattern_len)); SH_this->write(SHCXX_group, num_files, SHCXX_file_string, @@ -138,44 +165,45 @@ void SPIO_IOManager_write_1_bufferify(SPIO_IOManager *self, // splicer end class.IOManager.method.write_1_bufferify } -void SPIO_IOManager_write_group_to_root_file(SPIO_IOManager *self, - SIDRE_Group *group, - const char *file_name) +void SPIO_IOManager_writeGroupToRootFile(SPIO_IOManager *self, + SIDRE_Group *group, + const char *file_name) { axom::sidre::IOManager *SH_this = static_cast(self->addr); - // splicer begin class.IOManager.method.write_group_to_root_file + // splicer begin class.IOManager.method.writeGroupToRootFile axom::sidre::Group *SHCXX_group = static_cast(group->addr); const std::string SHCXX_file_name(file_name); SH_this->writeGroupToRootFile(SHCXX_group, SHCXX_file_name); - // splicer end class.IOManager.method.write_group_to_root_file + // splicer end class.IOManager.method.writeGroupToRootFile } -void SPIO_IOManager_write_group_to_root_file_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - const char *file_name, - int Lfile_name) +void SPIO_IOManager_writeGroupToRootFile_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, + char *file_name, + int SHT_file_name_len) { axom::sidre::IOManager *SH_this = static_cast(self->addr); - // splicer begin class.IOManager.method.write_group_to_root_file_bufferify + // splicer begin class.IOManager.method.writeGroupToRootFile_bufferify axom::sidre::Group *SHCXX_group = static_cast(group->addr); - const std::string SHCXX_file_name(file_name, Lfile_name); + const std::string SHCXX_file_name(file_name, + ShroudLenTrim(file_name, SHT_file_name_len)); SH_this->writeGroupToRootFile(SHCXX_group, SHCXX_file_name); - // splicer end class.IOManager.method.write_group_to_root_file_bufferify + // splicer end class.IOManager.method.writeGroupToRootFile_bufferify } -void SPIO_IOManager_write_blueprint_index_to_root_file(SPIO_IOManager *self, - SIDRE_DataStore *datastore, - const char *domain_path, - const char *file_name, - const char *mesh_path) +void SPIO_IOManager_writeBlueprintIndexToRootFile(SPIO_IOManager *self, + SIDRE_DataStore *datastore, + const char *domain_path, + const char *file_name, + const char *mesh_path) { axom::sidre::IOManager *SH_this = static_cast(self->addr); - // splicer begin class.IOManager.method.write_blueprint_index_to_root_file + // splicer begin class.IOManager.method.writeBlueprintIndexToRootFile axom::sidre::DataStore *SHCXX_datastore = static_cast(datastore->addr); const std::string SHCXX_domain_path(domain_path); @@ -185,32 +213,36 @@ void SPIO_IOManager_write_blueprint_index_to_root_file(SPIO_IOManager *self, SHCXX_domain_path, SHCXX_file_name, SHCXX_mesh_path); - // splicer end class.IOManager.method.write_blueprint_index_to_root_file + // splicer end class.IOManager.method.writeBlueprintIndexToRootFile } -void SPIO_IOManager_write_blueprint_index_to_root_file_bufferify( +void SPIO_IOManager_writeBlueprintIndexToRootFile_bufferify( SPIO_IOManager *self, SIDRE_DataStore *datastore, - const char *domain_path, - int Ldomain_path, - const char *file_name, - int Lfile_name, - const char *mesh_path, - int Lmesh_path) + char *domain_path, + int SHT_domain_path_len, + char *file_name, + int SHT_file_name_len, + char *mesh_path, + int SHT_mesh_path_len) { axom::sidre::IOManager *SH_this = static_cast(self->addr); - // splicer begin class.IOManager.method.write_blueprint_index_to_root_file_bufferify + // splicer begin class.IOManager.method.writeBlueprintIndexToRootFile_bufferify axom::sidre::DataStore *SHCXX_datastore = static_cast(datastore->addr); - const std::string SHCXX_domain_path(domain_path, Ldomain_path); - const std::string SHCXX_file_name(file_name, Lfile_name); - const std::string SHCXX_mesh_path(mesh_path, Lmesh_path); + const std::string SHCXX_domain_path( + domain_path, + ShroudLenTrim(domain_path, SHT_domain_path_len)); + const std::string SHCXX_file_name(file_name, + ShroudLenTrim(file_name, SHT_file_name_len)); + const std::string SHCXX_mesh_path(mesh_path, + ShroudLenTrim(mesh_path, SHT_mesh_path_len)); SH_this->writeBlueprintIndexToRootFile(SHCXX_datastore, SHCXX_domain_path, SHCXX_file_name, SHCXX_mesh_path); - // splicer end class.IOManager.method.write_blueprint_index_to_root_file_bufferify + // splicer end class.IOManager.method.writeBlueprintIndexToRootFile_bufferify } void SPIO_IOManager_read_0(SPIO_IOManager *self, @@ -231,18 +263,21 @@ void SPIO_IOManager_read_0(SPIO_IOManager *self, void SPIO_IOManager_read_0_bufferify(SPIO_IOManager *self, SIDRE_Group *group, - const char *file_string, - int Lfile_string, - const char *protocol, - int Lprotocol) + char *file_string, + int SHT_file_string_len, + char *protocol, + int SHT_protocol_len) { axom::sidre::IOManager *SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_0_bufferify axom::sidre::Group *SHCXX_group = static_cast(group->addr); - const std::string SHCXX_file_string(file_string, Lfile_string); - const std::string SHCXX_protocol(protocol, Lprotocol); + const std::string SHCXX_file_string( + file_string, + ShroudLenTrim(file_string, SHT_file_string_len)); + const std::string SHCXX_protocol(protocol, + ShroudLenTrim(protocol, SHT_protocol_len)); SH_this->read(SHCXX_group, SHCXX_file_string, SHCXX_protocol); // splicer end class.IOManager.method.read_0_bufferify } @@ -266,10 +301,10 @@ void SPIO_IOManager_read_1(SPIO_IOManager *self, void SPIO_IOManager_read_1_bufferify(SPIO_IOManager *self, SIDRE_Group *group, - const char *file_string, - int Lfile_string, - const char *protocol, - int Lprotocol, + char *file_string, + int SHT_file_string_len, + char *protocol, + int SHT_protocol_len, bool preserve_contents) { axom::sidre::IOManager *SH_this = @@ -277,8 +312,11 @@ void SPIO_IOManager_read_1_bufferify(SPIO_IOManager *self, // splicer begin class.IOManager.method.read_1_bufferify axom::sidre::Group *SHCXX_group = static_cast(group->addr); - const std::string SHCXX_file_string(file_string, Lfile_string); - const std::string SHCXX_protocol(protocol, Lprotocol); + const std::string SHCXX_file_string( + file_string, + ShroudLenTrim(file_string, SHT_file_string_len)); + const std::string SHCXX_protocol(protocol, + ShroudLenTrim(protocol, SHT_protocol_len)); SH_this->read(SHCXX_group, SHCXX_file_string, SHCXX_protocol, preserve_contents); // splicer end class.IOManager.method.read_1_bufferify } @@ -299,15 +337,16 @@ void SPIO_IOManager_read_2(SPIO_IOManager *self, void SPIO_IOManager_read_2_bufferify(SPIO_IOManager *self, SIDRE_Group *group, - const char *root_file, - int Lroot_file) + char *root_file, + int SHT_root_file_len) { axom::sidre::IOManager *SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_2_bufferify axom::sidre::Group *SHCXX_group = static_cast(group->addr); - const std::string SHCXX_root_file(root_file, Lroot_file); + const std::string SHCXX_root_file(root_file, + ShroudLenTrim(root_file, SHT_root_file_len)); SH_this->read(SHCXX_group, SHCXX_root_file); // splicer end class.IOManager.method.read_2_bufferify } @@ -329,8 +368,8 @@ void SPIO_IOManager_read_3(SPIO_IOManager *self, void SPIO_IOManager_read_3_bufferify(SPIO_IOManager *self, SIDRE_Group *group, - const char *root_file, - int Lroot_file, + char *root_file, + int SHT_root_file_len, bool preserve_contents) { axom::sidre::IOManager *SH_this = @@ -338,38 +377,40 @@ void SPIO_IOManager_read_3_bufferify(SPIO_IOManager *self, // splicer begin class.IOManager.method.read_3_bufferify axom::sidre::Group *SHCXX_group = static_cast(group->addr); - const std::string SHCXX_root_file(root_file, Lroot_file); + const std::string SHCXX_root_file(root_file, + ShroudLenTrim(root_file, SHT_root_file_len)); SH_this->read(SHCXX_group, SHCXX_root_file, preserve_contents); // splicer end class.IOManager.method.read_3_bufferify } -void SPIO_IOManager_load_external_data(SPIO_IOManager *self, - SIDRE_Group *group, - const char *root_file) +void SPIO_IOManager_loadExternalData(SPIO_IOManager *self, + SIDRE_Group *group, + const char *root_file) { axom::sidre::IOManager *SH_this = static_cast(self->addr); - // splicer begin class.IOManager.method.load_external_data + // splicer begin class.IOManager.method.loadExternalData axom::sidre::Group *SHCXX_group = static_cast(group->addr); const std::string SHCXX_root_file(root_file); SH_this->loadExternalData(SHCXX_group, SHCXX_root_file); - // splicer end class.IOManager.method.load_external_data + // splicer end class.IOManager.method.loadExternalData } -void SPIO_IOManager_load_external_data_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - const char *root_file, - int Lroot_file) +void SPIO_IOManager_loadExternalData_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, + char *root_file, + int SHT_root_file_len) { axom::sidre::IOManager *SH_this = static_cast(self->addr); - // splicer begin class.IOManager.method.load_external_data_bufferify + // splicer begin class.IOManager.method.loadExternalData_bufferify axom::sidre::Group *SHCXX_group = static_cast(group->addr); - const std::string SHCXX_root_file(root_file, Lroot_file); + const std::string SHCXX_root_file(root_file, + ShroudLenTrim(root_file, SHT_root_file_len)); SH_this->loadExternalData(SHCXX_group, SHCXX_root_file); - // splicer end class.IOManager.method.load_external_data_bufferify + // splicer end class.IOManager.method.loadExternalData_bufferify } } // extern "C" diff --git a/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.h b/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.h index 1340f11438..ede7785883 100644 --- a/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.h +++ b/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.h @@ -1,7 +1,7 @@ // wrapIOManager.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,13 +14,13 @@ #ifndef WRAPIOMANAGER_H #define WRAPIOMANAGER_H -#include "axom/sidre/interface/c_fortran/wrapDataStore.h" #include "axom/sidre/interface/c_fortran/wrapGroup.h" +#include "axom/sidre/interface/c_fortran/wrapDataStore.h" #include "mpi.h" -#include "typesSPIO.h" #ifndef __cplusplus #include #endif +#include "typesSPIO.h" // splicer begin class.IOManager.CXX_declarations // splicer end class.IOManager.CXX_declarations @@ -32,124 +32,124 @@ extern "C" { // splicer begin class.IOManager.C_declarations // splicer end class.IOManager.C_declarations -SPIO_IOManager* SPIO_IOManager_ctor_default(MPI_Fint com, SPIO_IOManager* SHC_rv); +SPIO_IOManager *SPIO_IOManager_ctor_default(MPI_Fint com, SPIO_IOManager *SHC_rv); -SPIO_IOManager* SPIO_IOManager_ctor_usescr(MPI_Fint com, +SPIO_IOManager *SPIO_IOManager_ctor_usescr(MPI_Fint com, bool use_scr, - SPIO_IOManager* SHC_rv); + SPIO_IOManager *SHC_rv); -void SPIO_IOManager_delete(SPIO_IOManager* self); +void SPIO_IOManager_delete(SPIO_IOManager *self); -void SPIO_IOManager_write_0(SPIO_IOManager* self, - SIDRE_Group* group, +void SPIO_IOManager_write_0(SPIO_IOManager *self, + SIDRE_Group *group, int num_files, - const char* file_string, - const char* protocol); + const char *file_string, + const char *protocol); -void SPIO_IOManager_write_0_bufferify(SPIO_IOManager* self, - SIDRE_Group* group, +void SPIO_IOManager_write_0_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, int num_files, - const char* file_string, - int Lfile_string, - const char* protocol, - int Lprotocol); + char *file_string, + int SHT_file_string_len, + char *protocol, + int SHT_protocol_len); -void SPIO_IOManager_write_1(SPIO_IOManager* self, - SIDRE_Group* group, +void SPIO_IOManager_write_1(SPIO_IOManager *self, + SIDRE_Group *group, int num_files, - const char* file_string, - const char* protocol, - const char* tree_pattern); + const char *file_string, + const char *protocol, + const char *tree_pattern); -void SPIO_IOManager_write_1_bufferify(SPIO_IOManager* self, - SIDRE_Group* group, +void SPIO_IOManager_write_1_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, int num_files, - const char* file_string, - int Lfile_string, - const char* protocol, - int Lprotocol, - const char* tree_pattern, - int Ltree_pattern); - -void SPIO_IOManager_write_group_to_root_file(SPIO_IOManager* self, - SIDRE_Group* group, - const char* file_name); - -void SPIO_IOManager_write_group_to_root_file_bufferify(SPIO_IOManager* self, - SIDRE_Group* group, - const char* file_name, - int Lfile_name); - -void SPIO_IOManager_write_blueprint_index_to_root_file(SPIO_IOManager* self, - SIDRE_DataStore* datastore, - const char* domain_path, - const char* file_name, - const char* mesh_path); - -void SPIO_IOManager_write_blueprint_index_to_root_file_bufferify( - SPIO_IOManager* self, - SIDRE_DataStore* datastore, - const char* domain_path, - int Ldomain_path, - const char* file_name, - int Lfile_name, - const char* mesh_path, - int Lmesh_path); - -void SPIO_IOManager_read_0(SPIO_IOManager* self, - SIDRE_Group* group, - const char* file_string, - const char* protocol); - -void SPIO_IOManager_read_0_bufferify(SPIO_IOManager* self, - SIDRE_Group* group, - const char* file_string, - int Lfile_string, - const char* protocol, - int Lprotocol); - -void SPIO_IOManager_read_1(SPIO_IOManager* self, - SIDRE_Group* group, - const char* file_string, - const char* protocol, + char *file_string, + int SHT_file_string_len, + char *protocol, + int SHT_protocol_len, + char *tree_pattern, + int SHT_tree_pattern_len); + +void SPIO_IOManager_writeGroupToRootFile(SPIO_IOManager *self, + SIDRE_Group *group, + const char *file_name); + +void SPIO_IOManager_writeGroupToRootFile_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, + char *file_name, + int SHT_file_name_len); + +void SPIO_IOManager_writeBlueprintIndexToRootFile(SPIO_IOManager *self, + SIDRE_DataStore *datastore, + const char *domain_path, + const char *file_name, + const char *mesh_path); + +void SPIO_IOManager_writeBlueprintIndexToRootFile_bufferify( + SPIO_IOManager *self, + SIDRE_DataStore *datastore, + char *domain_path, + int SHT_domain_path_len, + char *file_name, + int SHT_file_name_len, + char *mesh_path, + int SHT_mesh_path_len); + +void SPIO_IOManager_read_0(SPIO_IOManager *self, + SIDRE_Group *group, + const char *file_string, + const char *protocol); + +void SPIO_IOManager_read_0_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, + char *file_string, + int SHT_file_string_len, + char *protocol, + int SHT_protocol_len); + +void SPIO_IOManager_read_1(SPIO_IOManager *self, + SIDRE_Group *group, + const char *file_string, + const char *protocol, bool preserve_contents); -void SPIO_IOManager_read_1_bufferify(SPIO_IOManager* self, - SIDRE_Group* group, - const char* file_string, - int Lfile_string, - const char* protocol, - int Lprotocol, +void SPIO_IOManager_read_1_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, + char *file_string, + int SHT_file_string_len, + char *protocol, + int SHT_protocol_len, bool preserve_contents); -void SPIO_IOManager_read_2(SPIO_IOManager* self, - SIDRE_Group* group, - const char* root_file); +void SPIO_IOManager_read_2(SPIO_IOManager *self, + SIDRE_Group *group, + const char *root_file); -void SPIO_IOManager_read_2_bufferify(SPIO_IOManager* self, - SIDRE_Group* group, - const char* root_file, - int Lroot_file); +void SPIO_IOManager_read_2_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, + char *root_file, + int SHT_root_file_len); -void SPIO_IOManager_read_3(SPIO_IOManager* self, - SIDRE_Group* group, - const char* root_file, +void SPIO_IOManager_read_3(SPIO_IOManager *self, + SIDRE_Group *group, + const char *root_file, bool preserve_contents); -void SPIO_IOManager_read_3_bufferify(SPIO_IOManager* self, - SIDRE_Group* group, - const char* root_file, - int Lroot_file, +void SPIO_IOManager_read_3_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, + char *root_file, + int SHT_root_file_len, bool preserve_contents); -void SPIO_IOManager_load_external_data(SPIO_IOManager* self, - SIDRE_Group* group, - const char* root_file); +void SPIO_IOManager_loadExternalData(SPIO_IOManager *self, + SIDRE_Group *group, + const char *root_file); -void SPIO_IOManager_load_external_data_bufferify(SPIO_IOManager* self, - SIDRE_Group* group, - const char* root_file, - int Lroot_file); +void SPIO_IOManager_loadExternalData_bufferify(SPIO_IOManager *self, + SIDRE_Group *group, + char *root_file, + int SHT_root_file_len); #ifdef __cplusplus } diff --git a/src/axom/sidre/spio/interface/c_fortran/wrapSPIO.cpp b/src/axom/sidre/spio/interface/c_fortran/wrapSPIO.cpp index 2cc0056143..53557a2000 100644 --- a/src/axom/sidre/spio/interface/c_fortran/wrapSPIO.cpp +++ b/src/axom/sidre/spio/interface/c_fortran/wrapSPIO.cpp @@ -1,7 +1,7 @@ // wrapSPIO.cpp // This file is generated by Shroud 0.12.2. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/spio/interface/c_fortran/wrapfspio.f b/src/axom/sidre/spio/interface/c_fortran/wrapfspio.f index c1730d08dc..8ce06a09a0 100644 --- a/src/axom/sidre/spio/interface/c_fortran/wrapfspio.f +++ b/src/axom/sidre/spio/interface/c_fortran/wrapfspio.f @@ -1,7 +1,7 @@ ! wrapfspio.f -! This file is generated by Shroud 0.12.2. Do not edit. +! This file is generated by Shroud 0.13.0. Do not edit. ! -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) @@ -20,29 +20,30 @@ module axom_spio ! splicer begin module_top ! splicer end module_top - type, bind(C) :: SPIO_SHROUD_iomanager_capsule + ! helper capsule_data_helper + type, bind(C) :: SPIO_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SPIO_SHROUD_iomanager_capsule + end type SPIO_SHROUD_capsule_data type iomanager - type(SPIO_SHROUD_iomanager_capsule) :: cxxmem + type(SPIO_SHROUD_capsule_data) :: cxxmem ! splicer begin class.IOManager.component_part ! splicer end class.IOManager.component_part contains - procedure :: delete => iomanager_delete - procedure :: write_0 => iomanager_write_0 - procedure :: write_1 => iomanager_write_1 - procedure :: write_group_to_root_file => iomanager_write_group_to_root_file - procedure :: write_blueprint_index_to_root_file => iomanager_write_blueprint_index_to_root_file - procedure :: read_0 => iomanager_read_0 - procedure :: read_1 => iomanager_read_1 - procedure :: read_2 => iomanager_read_2 - procedure :: read_3 => iomanager_read_3 - procedure :: load_external_data => iomanager_load_external_data - procedure :: get_instance => iomanager_get_instance - procedure :: set_instance => iomanager_set_instance - procedure :: associated => iomanager_associated + procedure :: delete => io_manager_delete + procedure :: write_0 => io_manager_write_0 + procedure :: write_1 => io_manager_write_1 + procedure :: write_group_to_root_file => io_manager_write_group_to_root_file + procedure :: write_blueprint_index_to_root_file => io_manager_write_blueprint_index_to_root_file + procedure :: read_0 => io_manager_read_0 + procedure :: read_1 => io_manager_read_1 + procedure :: read_2 => io_manager_read_2 + procedure :: read_3 => io_manager_read_3 + procedure :: load_external_data => io_manager_load_external_data + procedure :: get_instance => io_manager_get_instance + procedure :: set_instance => io_manager_set_instance + procedure :: associated => io_manager_associated generic :: read => read_0, read_1, read_2, read_3 generic :: write => write_0, write_1 ! splicer begin class.IOManager.type_bound_procedure_part @@ -50,349 +51,361 @@ module axom_spio end type iomanager interface operator (.eq.) - module procedure iomanager_eq + module procedure io_manager_eq end interface interface operator (.ne.) - module procedure iomanager_ne + module procedure io_manager_ne end interface interface - function c_iomanager_ctor_default(com, SHT_crv) & - result(SHT_rv) & + function c_io_manager_ctor_default(com, SHT_rv) & + result(SHT_prv) & bind(C, name="SPIO_IOManager_ctor_default") use iso_c_binding, only : C_INT, C_PTR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none integer(C_INT), value, intent(IN) :: com - type(SPIO_SHROUD_iomanager_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_iomanager_ctor_default + type(SPIO_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) SHT_prv + end function c_io_manager_ctor_default - function c_iomanager_ctor_usescr(com, use_scr, SHT_crv) & - result(SHT_rv) & + function c_io_manager_ctor_usescr(com, use_scr, SHT_rv) & + result(SHT_prv) & bind(C, name="SPIO_IOManager_ctor_usescr") use iso_c_binding, only : C_BOOL, C_INT, C_PTR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none integer(C_INT), value, intent(IN) :: com logical(C_BOOL), value, intent(IN) :: use_scr - type(SPIO_SHROUD_iomanager_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_iomanager_ctor_usescr + type(SPIO_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) SHT_prv + end function c_io_manager_ctor_usescr - subroutine c_iomanager_delete(self) & + subroutine c_io_manager_delete(self) & bind(C, name="SPIO_IOManager_delete") - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - end subroutine c_iomanager_delete + type(SPIO_SHROUD_capsule_data), intent(INOUT) :: self + end subroutine c_io_manager_delete - subroutine c_iomanager_write_0(self, group, num_files, & + subroutine c_io_manager_write_0(self, group, num_files, & file_string, protocol) & bind(C, name="SPIO_IOManager_write_0") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group integer(C_INT), value, intent(IN) :: num_files character(kind=C_CHAR), intent(IN) :: file_string(*) character(kind=C_CHAR), intent(IN) :: protocol(*) - end subroutine c_iomanager_write_0 + end subroutine c_io_manager_write_0 - subroutine c_iomanager_write_0_bufferify(self, group, num_files, & - file_string, Lfile_string, protocol, Lprotocol) & + subroutine c_io_manager_write_0_bufferify(self, group, & + num_files, file_string, SHT_file_string_len, protocol, & + SHT_protocol_len) & bind(C, name="SPIO_IOManager_write_0_bufferify") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group integer(C_INT), value, intent(IN) :: num_files character(kind=C_CHAR), intent(IN) :: file_string(*) - integer(C_INT), value, intent(IN) :: Lfile_string + integer(C_INT), value, intent(IN) :: SHT_file_string_len character(kind=C_CHAR), intent(IN) :: protocol(*) - integer(C_INT), value, intent(IN) :: Lprotocol - end subroutine c_iomanager_write_0_bufferify + integer(C_INT), value, intent(IN) :: SHT_protocol_len + end subroutine c_io_manager_write_0_bufferify - subroutine c_iomanager_write_1(self, group, num_files, & + subroutine c_io_manager_write_1(self, group, num_files, & file_string, protocol, tree_pattern) & bind(C, name="SPIO_IOManager_write_1") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group integer(C_INT), value, intent(IN) :: num_files character(kind=C_CHAR), intent(IN) :: file_string(*) character(kind=C_CHAR), intent(IN) :: protocol(*) character(kind=C_CHAR), intent(IN) :: tree_pattern(*) - end subroutine c_iomanager_write_1 + end subroutine c_io_manager_write_1 - subroutine c_iomanager_write_1_bufferify(self, group, num_files, & - file_string, Lfile_string, protocol, Lprotocol, & - tree_pattern, Ltree_pattern) & + subroutine c_io_manager_write_1_bufferify(self, group, & + num_files, file_string, SHT_file_string_len, protocol, & + SHT_protocol_len, tree_pattern, SHT_tree_pattern_len) & bind(C, name="SPIO_IOManager_write_1_bufferify") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group integer(C_INT), value, intent(IN) :: num_files character(kind=C_CHAR), intent(IN) :: file_string(*) - integer(C_INT), value, intent(IN) :: Lfile_string + integer(C_INT), value, intent(IN) :: SHT_file_string_len character(kind=C_CHAR), intent(IN) :: protocol(*) - integer(C_INT), value, intent(IN) :: Lprotocol + integer(C_INT), value, intent(IN) :: SHT_protocol_len character(kind=C_CHAR), intent(IN) :: tree_pattern(*) - integer(C_INT), value, intent(IN) :: Ltree_pattern - end subroutine c_iomanager_write_1_bufferify + integer(C_INT), value, intent(IN) :: SHT_tree_pattern_len + end subroutine c_io_manager_write_1_bufferify - subroutine c_iomanager_write_group_to_root_file(self, group, & + subroutine c_io_manager_write_group_to_root_file(self, group, & file_name) & - bind(C, name="SPIO_IOManager_write_group_to_root_file") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + bind(C, name="SPIO_IOManager_writeGroupToRootFile") + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: file_name(*) - end subroutine c_iomanager_write_group_to_root_file + end subroutine c_io_manager_write_group_to_root_file - subroutine c_iomanager_write_group_to_root_file_bufferify(self, & - group, file_name, Lfile_name) & - bind(C, name="SPIO_IOManager_write_group_to_root_file_bufferify") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + subroutine c_io_manager_write_group_to_root_file_bufferify(self, & + group, file_name, SHT_file_name_len) & + bind(C, name="SPIO_IOManager_writeGroupToRootFile_bufferify") + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: file_name(*) - integer(C_INT), value, intent(IN) :: Lfile_name - end subroutine c_iomanager_write_group_to_root_file_bufferify + integer(C_INT), value, intent(IN) :: SHT_file_name_len + end subroutine c_io_manager_write_group_to_root_file_bufferify - subroutine c_iomanager_write_blueprint_index_to_root_file(self, & + subroutine c_io_manager_write_blueprint_index_to_root_file(self, & datastore, domain_path, file_name, mesh_path) & - bind(C, name="SPIO_IOManager_write_blueprint_index_to_root_file") - use axom_sidre, only : SIDRE_SHROUD_datastore_capsule + bind(C, name="SPIO_IOManager_writeBlueprintIndexToRootFile") + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_datastore_capsule), intent(INOUT) :: datastore + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: datastore character(kind=C_CHAR), intent(IN) :: domain_path(*) character(kind=C_CHAR), intent(IN) :: file_name(*) character(kind=C_CHAR), intent(IN) :: mesh_path(*) - end subroutine c_iomanager_write_blueprint_index_to_root_file - - subroutine c_iomanager_write_blueprint_index_to_root_file_bufferify( & - self, datastore, domain_path, Ldomain_path, file_name, & - Lfile_name, mesh_path, Lmesh_path) & - bind(C, name="SPIO_IOManager_write_blueprint_index_to_root_file_bufferify") - use axom_sidre, only : SIDRE_SHROUD_datastore_capsule + end subroutine c_io_manager_write_blueprint_index_to_root_file + + subroutine c_io_manager_write_blueprint_index_to_root_file_bufferify( & + self, datastore, domain_path, SHT_domain_path_len, & + file_name, SHT_file_name_len, mesh_path, & + SHT_mesh_path_len) & + bind(C, name="SPIO_IOManager_writeBlueprintIndexToRootFile_bufferify") + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_datastore_capsule), intent(INOUT) :: datastore + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: datastore character(kind=C_CHAR), intent(IN) :: domain_path(*) - integer(C_INT), value, intent(IN) :: Ldomain_path + integer(C_INT), value, intent(IN) :: SHT_domain_path_len character(kind=C_CHAR), intent(IN) :: file_name(*) - integer(C_INT), value, intent(IN) :: Lfile_name + integer(C_INT), value, intent(IN) :: SHT_file_name_len character(kind=C_CHAR), intent(IN) :: mesh_path(*) - integer(C_INT), value, intent(IN) :: Lmesh_path - end subroutine c_iomanager_write_blueprint_index_to_root_file_bufferify + integer(C_INT), value, intent(IN) :: SHT_mesh_path_len + end subroutine c_io_manager_write_blueprint_index_to_root_file_bufferify - subroutine c_iomanager_read_0(self, group, file_string, & + subroutine c_io_manager_read_0(self, group, file_string, & protocol) & bind(C, name="SPIO_IOManager_read_0") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: file_string(*) character(kind=C_CHAR), intent(IN) :: protocol(*) - end subroutine c_iomanager_read_0 + end subroutine c_io_manager_read_0 - subroutine c_iomanager_read_0_bufferify(self, group, & - file_string, Lfile_string, protocol, Lprotocol) & + subroutine c_io_manager_read_0_bufferify(self, group, & + file_string, SHT_file_string_len, protocol, & + SHT_protocol_len) & bind(C, name="SPIO_IOManager_read_0_bufferify") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: file_string(*) - integer(C_INT), value, intent(IN) :: Lfile_string + integer(C_INT), value, intent(IN) :: SHT_file_string_len character(kind=C_CHAR), intent(IN) :: protocol(*) - integer(C_INT), value, intent(IN) :: Lprotocol - end subroutine c_iomanager_read_0_bufferify + integer(C_INT), value, intent(IN) :: SHT_protocol_len + end subroutine c_io_manager_read_0_bufferify - subroutine c_iomanager_read_1(self, group, file_string, & + subroutine c_io_manager_read_1(self, group, file_string, & protocol, preserve_contents) & bind(C, name="SPIO_IOManager_read_1") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_BOOL, C_CHAR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: file_string(*) character(kind=C_CHAR), intent(IN) :: protocol(*) logical(C_BOOL), value, intent(IN) :: preserve_contents - end subroutine c_iomanager_read_1 + end subroutine c_io_manager_read_1 - subroutine c_iomanager_read_1_bufferify(self, group, & - file_string, Lfile_string, protocol, Lprotocol, & - preserve_contents) & + subroutine c_io_manager_read_1_bufferify(self, group, & + file_string, SHT_file_string_len, protocol, & + SHT_protocol_len, preserve_contents) & bind(C, name="SPIO_IOManager_read_1_bufferify") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: file_string(*) - integer(C_INT), value, intent(IN) :: Lfile_string + integer(C_INT), value, intent(IN) :: SHT_file_string_len character(kind=C_CHAR), intent(IN) :: protocol(*) - integer(C_INT), value, intent(IN) :: Lprotocol + integer(C_INT), value, intent(IN) :: SHT_protocol_len logical(C_BOOL), value, intent(IN) :: preserve_contents - end subroutine c_iomanager_read_1_bufferify + end subroutine c_io_manager_read_1_bufferify - subroutine c_iomanager_read_2(self, group, root_file) & + subroutine c_io_manager_read_2(self, group, root_file) & bind(C, name="SPIO_IOManager_read_2") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: root_file(*) - end subroutine c_iomanager_read_2 + end subroutine c_io_manager_read_2 - subroutine c_iomanager_read_2_bufferify(self, group, root_file, & - Lroot_file) & + subroutine c_io_manager_read_2_bufferify(self, group, root_file, & + SHT_root_file_len) & bind(C, name="SPIO_IOManager_read_2_bufferify") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: root_file(*) - integer(C_INT), value, intent(IN) :: Lroot_file - end subroutine c_iomanager_read_2_bufferify + integer(C_INT), value, intent(IN) :: SHT_root_file_len + end subroutine c_io_manager_read_2_bufferify - subroutine c_iomanager_read_3(self, group, root_file, & + subroutine c_io_manager_read_3(self, group, root_file, & preserve_contents) & bind(C, name="SPIO_IOManager_read_3") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_BOOL, C_CHAR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: root_file(*) logical(C_BOOL), value, intent(IN) :: preserve_contents - end subroutine c_iomanager_read_3 + end subroutine c_io_manager_read_3 - subroutine c_iomanager_read_3_bufferify(self, group, root_file, & - Lroot_file, preserve_contents) & + subroutine c_io_manager_read_3_bufferify(self, group, root_file, & + SHT_root_file_len, preserve_contents) & bind(C, name="SPIO_IOManager_read_3_bufferify") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_BOOL, C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: root_file(*) - integer(C_INT), value, intent(IN) :: Lroot_file + integer(C_INT), value, intent(IN) :: SHT_root_file_len logical(C_BOOL), value, intent(IN) :: preserve_contents - end subroutine c_iomanager_read_3_bufferify + end subroutine c_io_manager_read_3_bufferify - subroutine c_iomanager_load_external_data(self, group, & + subroutine c_io_manager_load_external_data(self, group, & root_file) & - bind(C, name="SPIO_IOManager_load_external_data") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + bind(C, name="SPIO_IOManager_loadExternalData") + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: root_file(*) - end subroutine c_iomanager_load_external_data + end subroutine c_io_manager_load_external_data - subroutine c_iomanager_load_external_data_bufferify(self, group, & - root_file, Lroot_file) & - bind(C, name="SPIO_IOManager_load_external_data_bufferify") - use axom_sidre, only : SIDRE_SHROUD_group_capsule + subroutine c_io_manager_load_external_data_bufferify(self, & + group, root_file, SHT_root_file_len) & + bind(C, name="SPIO_IOManager_loadExternalData_bufferify") + use axom_sidre, only : SIDRE_SHROUD_capsule_data use iso_c_binding, only : C_CHAR, C_INT - import :: SPIO_SHROUD_iomanager_capsule + import :: SPIO_SHROUD_capsule_data implicit none - type(SPIO_SHROUD_iomanager_capsule), intent(IN) :: self - type(SIDRE_SHROUD_group_capsule), intent(INOUT) :: group + type(SPIO_SHROUD_capsule_data), intent(IN) :: self + type(SIDRE_SHROUD_capsule_data), intent(INOUT) :: group character(kind=C_CHAR), intent(IN) :: root_file(*) - integer(C_INT), value, intent(IN) :: Lroot_file - end subroutine c_iomanager_load_external_data_bufferify + integer(C_INT), value, intent(IN) :: SHT_root_file_len + end subroutine c_io_manager_load_external_data_bufferify + end interface - ! splicer begin class.IOManager.additional_interfaces - ! splicer end class.IOManager.additional_interfaces + interface io_manager_read + module procedure io_manager_read_0 + module procedure io_manager_read_1 + module procedure io_manager_read_2 + module procedure io_manager_read_3 + end interface io_manager_read - ! splicer begin additional_interfaces - ! splicer end additional_interfaces - end interface + interface io_manager_write + module procedure io_manager_write_0 + module procedure io_manager_write_1 + end interface io_manager_write interface iomanager - module procedure iomanager_ctor_default - module procedure iomanager_ctor_usescr + module procedure io_manager_ctor_default + module procedure io_manager_ctor_usescr end interface iomanager + ! splicer begin additional_declarations + ! splicer end additional_declarations + contains - function iomanager_ctor_default(com) & + function io_manager_ctor_default(com) & result(SHT_rv) use iso_c_binding, only : C_PTR integer, value, intent(IN) :: com type(iomanager) :: SHT_rv - ! splicer begin class.IOManager.method.ctor_default type(C_PTR) :: SHT_prv - SHT_prv = c_iomanager_ctor_default(com, SHT_rv%cxxmem) + ! splicer begin class.IOManager.method.ctor_default + SHT_prv = c_io_manager_ctor_default(com, SHT_rv%cxxmem) ! splicer end class.IOManager.method.ctor_default - end function iomanager_ctor_default + end function io_manager_ctor_default - function iomanager_ctor_usescr(com, use_scr) & + function io_manager_ctor_usescr(com, use_scr) & result(SHT_rv) use iso_c_binding, only : C_BOOL, C_PTR integer, value, intent(IN) :: com logical, value, intent(IN) :: use_scr type(iomanager) :: SHT_rv + type(C_PTR) :: SHT_prv ! splicer begin class.IOManager.method.ctor_usescr logical(C_BOOL) SH_use_scr - type(C_PTR) :: SHT_prv SH_use_scr = use_scr ! coerce to C_BOOL - SHT_prv = c_iomanager_ctor_usescr(com, SH_use_scr, & + SHT_prv = c_io_manager_ctor_usescr(com, SH_use_scr, & SHT_rv%cxxmem) ! splicer end class.IOManager.method.ctor_usescr - end function iomanager_ctor_usescr + end function io_manager_ctor_usescr - subroutine iomanager_delete(obj) + subroutine io_manager_delete(obj) class(iomanager) :: obj ! splicer begin class.IOManager.method.delete - call c_iomanager_delete(obj%cxxmem) + call c_io_manager_delete(obj%cxxmem) ! splicer end class.IOManager.method.delete - end subroutine iomanager_delete + end subroutine io_manager_delete - subroutine iomanager_write_0(obj, group, num_files, file_string, & + subroutine io_manager_write_0(obj, group, num_files, file_string, & protocol) use axom_sidre, only : SidreGroup use iso_c_binding, only : C_INT @@ -402,13 +415,17 @@ subroutine iomanager_write_0(obj, group, num_files, file_string, & character(len=*), intent(IN) :: file_string character(len=*), intent(IN) :: protocol ! splicer begin class.IOManager.method.write_0 - call c_iomanager_write_0_bufferify(obj%cxxmem, group%cxxmem, & - num_files, file_string, len_trim(file_string, kind=C_INT), & - protocol, len_trim(protocol, kind=C_INT)) + integer(C_INT) SHT_file_string_len + integer(C_INT) SHT_protocol_len + SHT_file_string_len = len(file_string, kind=C_INT) + SHT_protocol_len = len(protocol, kind=C_INT) + call c_io_manager_write_0_bufferify(obj%cxxmem, group%cxxmem, & + num_files, file_string, SHT_file_string_len, protocol, & + SHT_protocol_len) ! splicer end class.IOManager.method.write_0 - end subroutine iomanager_write_0 + end subroutine io_manager_write_0 - subroutine iomanager_write_1(obj, group, num_files, file_string, & + subroutine io_manager_write_1(obj, group, num_files, file_string, & protocol, tree_pattern) use axom_sidre, only : SidreGroup use iso_c_binding, only : C_INT @@ -419,26 +436,34 @@ subroutine iomanager_write_1(obj, group, num_files, file_string, & character(len=*), intent(IN) :: protocol character(len=*), intent(IN) :: tree_pattern ! splicer begin class.IOManager.method.write_1 - call c_iomanager_write_1_bufferify(obj%cxxmem, group%cxxmem, & - num_files, file_string, len_trim(file_string, kind=C_INT), & - protocol, len_trim(protocol, kind=C_INT), tree_pattern, & - len_trim(tree_pattern, kind=C_INT)) + integer(C_INT) SHT_file_string_len + integer(C_INT) SHT_protocol_len + integer(C_INT) SHT_tree_pattern_len + SHT_file_string_len = len(file_string, kind=C_INT) + SHT_protocol_len = len(protocol, kind=C_INT) + SHT_tree_pattern_len = len(tree_pattern, kind=C_INT) + call c_io_manager_write_1_bufferify(obj%cxxmem, group%cxxmem, & + num_files, file_string, SHT_file_string_len, protocol, & + SHT_protocol_len, tree_pattern, SHT_tree_pattern_len) ! splicer end class.IOManager.method.write_1 - end subroutine iomanager_write_1 + end subroutine io_manager_write_1 - subroutine iomanager_write_group_to_root_file(obj, group, file_name) + subroutine io_manager_write_group_to_root_file(obj, group, & + file_name) use axom_sidre, only : SidreGroup use iso_c_binding, only : C_INT class(iomanager) :: obj type(SidreGroup), intent(INOUT) :: group character(len=*), intent(IN) :: file_name ! splicer begin class.IOManager.method.write_group_to_root_file - call c_iomanager_write_group_to_root_file_bufferify(obj%cxxmem, & - group%cxxmem, file_name, len_trim(file_name, kind=C_INT)) + integer(C_INT) SHT_file_name_len + SHT_file_name_len = len(file_name, kind=C_INT) + call c_io_manager_write_group_to_root_file_bufferify(obj%cxxmem, & + group%cxxmem, file_name, SHT_file_name_len) ! splicer end class.IOManager.method.write_group_to_root_file - end subroutine iomanager_write_group_to_root_file + end subroutine io_manager_write_group_to_root_file - subroutine iomanager_write_blueprint_index_to_root_file(obj, & + subroutine io_manager_write_blueprint_index_to_root_file(obj, & datastore, domain_path, file_name, mesh_path) use axom_sidre, only : SidreDataStore use iso_c_binding, only : C_INT @@ -448,15 +473,19 @@ subroutine iomanager_write_blueprint_index_to_root_file(obj, & character(len=*), intent(IN) :: file_name character(len=*), intent(IN) :: mesh_path ! splicer begin class.IOManager.method.write_blueprint_index_to_root_file - call c_iomanager_write_blueprint_index_to_root_file_bufferify(obj%cxxmem, & - datastore%cxxmem, domain_path, & - len_trim(domain_path, kind=C_INT), file_name, & - len_trim(file_name, kind=C_INT), mesh_path, & - len_trim(mesh_path, kind=C_INT)) + integer(C_INT) SHT_domain_path_len + integer(C_INT) SHT_file_name_len + integer(C_INT) SHT_mesh_path_len + SHT_domain_path_len = len(domain_path, kind=C_INT) + SHT_file_name_len = len(file_name, kind=C_INT) + SHT_mesh_path_len = len(mesh_path, kind=C_INT) + call c_io_manager_write_blueprint_index_to_root_file_bufferify(obj%cxxmem, & + datastore%cxxmem, domain_path, SHT_domain_path_len, & + file_name, SHT_file_name_len, mesh_path, SHT_mesh_path_len) ! splicer end class.IOManager.method.write_blueprint_index_to_root_file - end subroutine iomanager_write_blueprint_index_to_root_file + end subroutine io_manager_write_blueprint_index_to_root_file - subroutine iomanager_read_0(obj, group, file_string, protocol) + subroutine io_manager_read_0(obj, group, file_string, protocol) use axom_sidre, only : SidreGroup use iso_c_binding, only : C_INT class(iomanager) :: obj @@ -464,13 +493,17 @@ subroutine iomanager_read_0(obj, group, file_string, protocol) character(len=*), intent(IN) :: file_string character(len=*), intent(IN) :: protocol ! splicer begin class.IOManager.method.read_0 - call c_iomanager_read_0_bufferify(obj%cxxmem, group%cxxmem, & - file_string, len_trim(file_string, kind=C_INT), protocol, & - len_trim(protocol, kind=C_INT)) + integer(C_INT) SHT_file_string_len + integer(C_INT) SHT_protocol_len + SHT_file_string_len = len(file_string, kind=C_INT) + SHT_protocol_len = len(protocol, kind=C_INT) + call c_io_manager_read_0_bufferify(obj%cxxmem, group%cxxmem, & + file_string, SHT_file_string_len, protocol, & + SHT_protocol_len) ! splicer end class.IOManager.method.read_0 - end subroutine iomanager_read_0 + end subroutine io_manager_read_0 - subroutine iomanager_read_1(obj, group, file_string, protocol, & + subroutine io_manager_read_1(obj, group, file_string, protocol, & preserve_contents) use axom_sidre, only : SidreGroup use iso_c_binding, only : C_BOOL, C_INT @@ -480,27 +513,33 @@ subroutine iomanager_read_1(obj, group, file_string, protocol, & character(len=*), intent(IN) :: protocol logical, value, intent(IN) :: preserve_contents ! splicer begin class.IOManager.method.read_1 + integer(C_INT) SHT_file_string_len + integer(C_INT) SHT_protocol_len logical(C_BOOL) SH_preserve_contents + SHT_file_string_len = len(file_string, kind=C_INT) + SHT_protocol_len = len(protocol, kind=C_INT) SH_preserve_contents = preserve_contents ! coerce to C_BOOL - call c_iomanager_read_1_bufferify(obj%cxxmem, group%cxxmem, & - file_string, len_trim(file_string, kind=C_INT), protocol, & - len_trim(protocol, kind=C_INT), SH_preserve_contents) + call c_io_manager_read_1_bufferify(obj%cxxmem, group%cxxmem, & + file_string, SHT_file_string_len, protocol, & + SHT_protocol_len, SH_preserve_contents) ! splicer end class.IOManager.method.read_1 - end subroutine iomanager_read_1 + end subroutine io_manager_read_1 - subroutine iomanager_read_2(obj, group, root_file) + subroutine io_manager_read_2(obj, group, root_file) use axom_sidre, only : SidreGroup use iso_c_binding, only : C_INT class(iomanager) :: obj type(SidreGroup), intent(INOUT) :: group character(len=*), intent(IN) :: root_file ! splicer begin class.IOManager.method.read_2 - call c_iomanager_read_2_bufferify(obj%cxxmem, group%cxxmem, & - root_file, len_trim(root_file, kind=C_INT)) + integer(C_INT) SHT_root_file_len + SHT_root_file_len = len(root_file, kind=C_INT) + call c_io_manager_read_2_bufferify(obj%cxxmem, group%cxxmem, & + root_file, SHT_root_file_len) ! splicer end class.IOManager.method.read_2 - end subroutine iomanager_read_2 + end subroutine io_manager_read_2 - subroutine iomanager_read_3(obj, group, root_file, & + subroutine io_manager_read_3(obj, group, root_file, & preserve_contents) use axom_sidre, only : SidreGroup use iso_c_binding, only : C_BOOL, C_INT @@ -509,48 +548,51 @@ subroutine iomanager_read_3(obj, group, root_file, & character(len=*), intent(IN) :: root_file logical, value, intent(IN) :: preserve_contents ! splicer begin class.IOManager.method.read_3 + integer(C_INT) SHT_root_file_len logical(C_BOOL) SH_preserve_contents + SHT_root_file_len = len(root_file, kind=C_INT) SH_preserve_contents = preserve_contents ! coerce to C_BOOL - call c_iomanager_read_3_bufferify(obj%cxxmem, group%cxxmem, & - root_file, len_trim(root_file, kind=C_INT), & - SH_preserve_contents) + call c_io_manager_read_3_bufferify(obj%cxxmem, group%cxxmem, & + root_file, SHT_root_file_len, SH_preserve_contents) ! splicer end class.IOManager.method.read_3 - end subroutine iomanager_read_3 + end subroutine io_manager_read_3 - subroutine iomanager_load_external_data(obj, group, root_file) + subroutine io_manager_load_external_data(obj, group, root_file) use axom_sidre, only : SidreGroup use iso_c_binding, only : C_INT class(iomanager) :: obj type(SidreGroup), intent(INOUT) :: group character(len=*), intent(IN) :: root_file ! splicer begin class.IOManager.method.load_external_data - call c_iomanager_load_external_data_bufferify(obj%cxxmem, & - group%cxxmem, root_file, len_trim(root_file, kind=C_INT)) + integer(C_INT) SHT_root_file_len + SHT_root_file_len = len(root_file, kind=C_INT) + call c_io_manager_load_external_data_bufferify(obj%cxxmem, & + group%cxxmem, root_file, SHT_root_file_len) ! splicer end class.IOManager.method.load_external_data - end subroutine iomanager_load_external_data + end subroutine io_manager_load_external_data ! Return pointer to C++ memory. - function iomanager_get_instance(obj) result (cxxptr) + function io_manager_get_instance(obj) result (cxxptr) use iso_c_binding, only: C_PTR class(iomanager), intent(IN) :: obj type(C_PTR) :: cxxptr cxxptr = obj%cxxmem%addr - end function iomanager_get_instance + end function io_manager_get_instance - subroutine iomanager_set_instance(obj, cxxmem) + subroutine io_manager_set_instance(obj, cxxmem) use iso_c_binding, only: C_PTR class(iomanager), intent(INOUT) :: obj type(C_PTR), intent(IN) :: cxxmem obj%cxxmem%addr = cxxmem obj%cxxmem%idtor = 0 - end subroutine iomanager_set_instance + end subroutine io_manager_set_instance - function iomanager_associated(obj) result (rv) + function io_manager_associated(obj) result (rv) use iso_c_binding, only: c_associated class(iomanager), intent(IN) :: obj logical rv rv = c_associated(obj%cxxmem%addr) - end function iomanager_associated + end function io_manager_associated ! splicer begin class.IOManager.additional_functions ! splicer end class.IOManager.additional_functions @@ -558,7 +600,7 @@ end function iomanager_associated ! splicer begin additional_functions ! splicer end additional_functions - function iomanager_eq(a,b) result (rv) + function io_manager_eq(a,b) result (rv) use iso_c_binding, only: c_associated type(iomanager), intent(IN) ::a,b logical :: rv @@ -567,9 +609,9 @@ function iomanager_eq(a,b) result (rv) else rv = .false. endif - end function iomanager_eq + end function io_manager_eq - function iomanager_ne(a,b) result (rv) + function io_manager_ne(a,b) result (rv) use iso_c_binding, only: c_associated type(iomanager), intent(IN) ::a,b logical :: rv @@ -578,6 +620,6 @@ function iomanager_ne(a,b) result (rv) else rv = .false. endif - end function iomanager_ne + end function io_manager_ne end module axom_spio diff --git a/src/axom/sidre/spio/interface/spio_shroud.yaml b/src/axom/sidre/spio/interface/spio_shroud.yaml index f351a0cf5d..b819621357 100644 --- a/src/axom/sidre/spio/interface/spio_shroud.yaml +++ b/src/axom/sidre/spio/interface/spio_shroud.yaml @@ -3,7 +3,7 @@ # copyright: - - - Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and + - Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and - other Axom Project Developers. See the top-level LICENSE file for details. - - "SPDX-License-Identifier: (BSD-3-Clause)" @@ -32,7 +32,7 @@ typemap: c_type: SIDRE_DataStore f_module_name: axom_sidre f_derived_type: SidreDataStore - f_capsule_data_type: SIDRE_SHROUD_datastore_capsule + f_capsule_data_type: SIDRE_SHROUD_capsule_data f_to_c: '{f_var}%cxxmem' - type: axom::sidre::Group @@ -42,12 +42,15 @@ typemap: c_type: SIDRE_Group f_module_name: axom_sidre f_derived_type: SidreGroup - f_capsule_data_type: SIDRE_SHROUD_group_capsule + f_capsule_data_type: SIDRE_SHROUD_capsule_data f_to_c: '{f_var}%cxxmem' declarations: - decl: class IOManager cxx_header: axom/sidre/spio/IOManager.hpp + format: + F_derived_name: iomanager + C_name_scope: IOManager_ declarations: - decl: IOManager(MPI_Comm com, bool use_scr = false) default_arg_suffix: diff --git a/src/axom/sidre/spio/interface/yaml/spio_types.yaml b/src/axom/sidre/spio/interface/yaml/spio_types.yaml index 9031de5f30..3fe8b866f1 100644 --- a/src/axom/sidre/spio/interface/yaml/spio_types.yaml +++ b/src/axom/sidre/spio/interface/yaml/spio_types.yaml @@ -1,7 +1,7 @@ # spio_types.yaml -# This file is generated by Shroud 0.12.2. Do not edit. +# This file is generated by Shroud 0.13.0. Do not edit. # -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -19,5 +19,5 @@ typemap: c_type: SPIO_IOManager f_module_name: axom_spio f_derived_type: iomanager - f_capsule_data_type: SPIO_SHROUD_iomanager_capsule + f_capsule_data_type: SPIO_SHROUD_capsule_data f_to_c: "{f_var}%cxxmem" diff --git a/src/axom/sidre/tests/CMakeLists.txt b/src/axom/sidre/tests/CMakeLists.txt index baca405424..e7735b9951 100644 --- a/src/axom/sidre/tests/CMakeLists.txt +++ b/src/axom/sidre/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/cpp2fortran b/src/axom/sidre/tests/cpp2fortran index 903c012348..4b571305bf 100755 --- a/src/axom/sidre/tests/cpp2fortran +++ b/src/axom/sidre/tests/cpp2fortran @@ -1,6 +1,6 @@ #!/bin/env python -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_allocatable_F.f b/src/axom/sidre/tests/sidre_allocatable_F.f index 26a5b16738..df5513f108 100644 --- a/src/axom/sidre/tests/sidre_allocatable_F.f +++ b/src/axom/sidre/tests/sidre_allocatable_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_attribute.cpp b/src/axom/sidre/tests/sidre_attribute.cpp index c0e276b7b7..ec8b260d0d 100644 --- a/src/axom/sidre/tests/sidre_attribute.cpp +++ b/src/axom/sidre/tests/sidre_attribute.cpp @@ -1,9 +1,10 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "axom/config.hpp" // for AXOM_USE_HDF5 +#include "axom/config.hpp" +#include "axom/core.hpp" #include "axom/sidre.hpp" #include "axom/fmt.hpp" @@ -16,6 +17,8 @@ using axom::sidre::DataStore; using axom::sidre::DOUBLE_ID; using axom::sidre::Group; using axom::sidre::IndexType; +using axom::sidre::INT32_ID; +using axom::sidre::INT64_ID; using axom::sidre::INT_ID; using axom::sidre::InvalidIndex; using axom::sidre::Node; @@ -56,11 +59,18 @@ const int g_nprotocols = 2; const std::string g_protocols[] = {"sidre_json", "json"}; #endif +const std::set g_protocol_saves_attributes {"sidre_hdf5", + "sidre_conduit_json", + "sidre_json", + "sidre_layout_json"}; + //------------------------------------------------------------------------------ // Create attribute in a Datastore // TEST(sidre_attribute, create_attr) { + SLIC_INFO("Some warnings are expected in the 'create_attr' test"); + bool ok; DataStore* ds = new DataStore(); @@ -162,6 +172,8 @@ TEST(sidre_attribute, create_attr) TEST(sidre_attribute, view_attr) { + SLIC_INFO("Some warnings are expected in the 'view_attr' test"); + // Note: This test relies on re-wiring conduit error handlers DataStore::setConduitSLICMessageHandlers(); @@ -302,6 +314,8 @@ TEST(sidre_attribute, view_attr) TEST(sidre_attribute, view_int_and_double) { + SLIC_INFO("Some warnings are expected in the 'view_int_and_double' test"); + // Note: This test relies on re-wiring conduit error handlers DataStore::setConduitSLICMessageHandlers(); @@ -377,6 +391,8 @@ TEST(sidre_attribute, view_int_and_double) TEST(sidre_attribute, set_default) { + SLIC_INFO("Some warnings are expected in the 'set_default' test"); + bool ok; DataStore* ds = new DataStore(); @@ -436,6 +452,8 @@ TEST(sidre_attribute, set_default) TEST(sidre_attribute, as_node) { + SLIC_INFO("Some warnings are expected in the 'as_node' test"); + bool ok; DataStore* ds = new DataStore(); @@ -475,6 +493,8 @@ TEST(sidre_attribute, as_node) TEST(sidre_attribute, overloads) { + SLIC_INFO("Some warnings are expected in the 'overloads' test"); + // Note: This test relies on re-wiring conduit error handlers DataStore::setConduitSLICMessageHandlers(); @@ -916,8 +936,7 @@ TEST(sidre_attribute, save_by_attribute) // Create a deep path with and without attribute root1->createViewScalar("grp1a/grp1b/view3", 3); - root1->createViewScalar("grp2a/view4", 4); // make sure empty "views" not - // saved + root1->createViewScalar("grp2a/view4", 4); // make sure empty "views" not saved root1->createViewScalar("grp2a/grp2b/view5", 5) ->setAttributeScalar(dump, g_dump_yes); @@ -971,3 +990,207 @@ TEST(sidre_attribute, save_by_attribute) delete ds2; } } + +TEST(sidre_attribute, save_load_group_with_attributes_new_ds) +{ + using axom::utilities::string::endsWith; + + for(const auto& protocol : g_protocols) + { + axom::sidre::DataStore ds1, ds2; + + const std::string ext = endsWith(protocol, "hdf5") ? "hdf5" : "json"; + const std::string filename = + axom::fmt::format("saveFile_{}.{}", protocol, ext); + + SLIC_INFO(axom::fmt::format( + "Checking attribute save/load w/ protocol '{}' using file '{}'", + protocol, + filename)); + + // set up first datastore and save to disk + { + // create the attributes + ds1.createAttributeScalar("attr", 10); + ds1.createAttributeString(g_name_color, g_color_none); + + // create groups/views and attach attributes + auto* gr = ds1.getRoot()->createGroup("gr"); + gr->createViewScalar("scalar1", 1); + gr->createViewScalar("scalar2", 2) + ->setAttributeString(g_name_color, g_color_red); + gr->createViewScalar("scalar3", 3) + ->setAttributeString(g_name_color, g_color_blue); + + EXPECT_EQ(2, ds1.getNumAttributes()); + EXPECT_TRUE(INT32_ID == ds1.getAttribute("attr")->getTypeID() || + INT64_ID == ds1.getAttribute("attr")->getTypeID()); + EXPECT_EQ(CHAR8_STR_ID, ds1.getAttribute(g_name_color)->getTypeID()); + + EXPECT_FALSE(gr->getView("scalar1")->hasAttributeValue(g_name_color)); + + EXPECT_TRUE(gr->getView("scalar2")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_red, + gr->getView("scalar2")->getAttributeString(g_name_color)); + + EXPECT_TRUE(gr->getView("scalar3")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_blue, + gr->getView("scalar3")->getAttributeString(g_name_color)); + + gr->save(filename, protocol); + } + + if(g_protocol_saves_attributes.find(protocol) == + g_protocol_saves_attributes.end()) + { + SLIC_INFO( + axom::fmt::format("Skipping attribute load tests for protocol '{}' -- " + "it doesn't support saving attributes", + protocol)); + continue; + } + + // load second datastore from saved data + { + auto* gr = ds2.getRoot()->createGroup("gr"); + gr->load(filename, protocol); + + EXPECT_EQ(2, ds2.getNumAttributes()); + EXPECT_TRUE(INT32_ID == ds2.getAttribute("attr")->getTypeID() || + INT64_ID == ds2.getAttribute("attr")->getTypeID()); + + EXPECT_EQ(CHAR8_STR_ID, ds2.getAttribute(g_name_color)->getTypeID()); + + EXPECT_TRUE(gr->hasView("scalar1")); + EXPECT_FALSE(gr->getView("scalar1")->hasAttributeValue(g_name_color)); + + EXPECT_TRUE(gr->hasView("scalar2")); + EXPECT_TRUE(gr->getView("scalar2")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_red, + gr->getView("scalar2")->getAttributeString(g_name_color)); + + EXPECT_TRUE(gr->hasView("scalar3")); + EXPECT_TRUE(gr->getView("scalar3")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_blue, + gr->getView("scalar3")->getAttributeString(g_name_color)); + } + + EXPECT_EQ(ds1.getNumAttributes(), ds2.getNumAttributes()); + EXPECT_EQ(ds1.getAttribute(g_name_color)->getName(), + ds2.getAttribute(g_name_color)->getName()); + EXPECT_EQ(ds1.getAttribute(g_name_color)->getTypeID(), + ds2.getAttribute(g_name_color)->getTypeID()); + EXPECT_EQ(ds1.getAttribute(g_name_color)->getDefaultNodeRef().to_string(), + ds2.getAttribute(g_name_color)->getDefaultNodeRef().to_string()); + } +} + +TEST(sidre_attribute, save_load_group_with_attributes_same_ds) +{ + using axom::utilities::string::endsWith; + + for(const auto& protocol : g_protocols) + { + axom::sidre::DataStore ds; + + const std::string ext = endsWith(protocol, "hdf5") ? "hdf5" : "json"; + const std::string filename = + axom::fmt::format("saveFile_{}.{}", protocol, ext); + + SLIC_INFO(axom::fmt::format( + "Checking attribute save/load w/ protocol '{}' using file '{}'", + protocol, + filename)); + + // create the attributes + ds.createAttributeScalar("attr", 10); + ds.createAttributeString(g_name_color, g_color_none); + + // attach some attributes to views + auto* gr = ds.getRoot()->createGroup("gr"); + gr->createViewScalar("scalar1", 1); + gr->createViewScalar("scalar2", 2)->setAttributeString(g_name_color, g_color_red); + gr->createViewScalar("scalar3", 3)->setAttributeString(g_name_color, g_color_blue); + + EXPECT_EQ(2, ds.getNumAttributes()); + + EXPECT_FALSE(gr->getView("scalar1")->hasAttributeValue(g_name_color)); + + EXPECT_TRUE(gr->getView("scalar2")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_red, + gr->getView("scalar2")->getAttributeString(g_name_color)); + + EXPECT_TRUE(gr->getView("scalar3")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_blue, + gr->getView("scalar3")->getAttributeString(g_name_color)); + + gr->save(filename, protocol); + + if(g_protocol_saves_attributes.find(protocol) == + g_protocol_saves_attributes.end()) + { + SLIC_INFO( + axom::fmt::format("Skipping attribute load tests for protocol '{}' -- " + "it doesn't support saving attributes", + protocol)); + continue; + } + + { + gr->load(filename, protocol); + + // Check that things are still as expected after loading + EXPECT_EQ(2, ds.getNumAttributes()); + + EXPECT_FALSE(gr->getView("scalar1")->hasAttributeValue(g_name_color)); + + EXPECT_TRUE(gr->getView("scalar2")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_red, + gr->getView("scalar2")->getAttributeString(g_name_color)); + + EXPECT_TRUE(gr->getView("scalar3")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_blue, + gr->getView("scalar3")->getAttributeString(g_name_color)); + } + + // check that changes to attributes get overwritten when loading + { + // modify/remove some attributes before loading + ds.destroyAttribute("attr"); + gr->getView("scalar1")->setAttributeString(g_name_color, g_color_red); + gr->getView("scalar2")->setAttributeToDefault(g_name_color); + gr->getView("scalar3")->setAttributeString(g_name_color, g_color_red); + + EXPECT_EQ(1, ds.getNumAttributes()); + + // reload group from file; this should revert changes + gr->load(filename, protocol); + + // Check that things are reverted after loading + EXPECT_EQ(2, ds.getNumAttributes()); + + EXPECT_FALSE(gr->getView("scalar1")->hasAttributeValue(g_name_color)); + + EXPECT_TRUE(gr->getView("scalar2")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_red, + gr->getView("scalar2")->getAttributeString(g_name_color)); + + EXPECT_TRUE(gr->getView("scalar3")->hasAttributeValue(g_name_color)); + EXPECT_EQ(g_color_blue, + gr->getView("scalar3")->getAttributeString(g_name_color)); + } + } +} + +//------------------------------------------------------------------------------ +int main(int argc, char* argv[]) +{ + int result = 0; + + ::testing::InitGoogleTest(&argc, argv); + axom::slic::SimpleLogger logger; + + result = RUN_ALL_TESTS(); + + return result; +} diff --git a/src/axom/sidre/tests/sidre_buffer.cpp b/src/axom/sidre/tests/sidre_buffer.cpp index 18d031b669..54640f5d59 100644 --- a/src/axom/sidre/tests/sidre_buffer.cpp +++ b/src/axom/sidre/tests/sidre_buffer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -298,18 +298,18 @@ TEST(sidre_buffer, with_multiple_views) EXPECT_EQ(dbuff->getNumViews(), 2); // Detach buffer from first view will not detach from datastore. - dv1->attachBuffer(NULL); + dv1->attachBuffer(nullptr); EXPECT_FALSE(dv1->hasBuffer()); EXPECT_EQ(ds->getNumBuffers(), 1u); EXPECT_EQ(dbuff->getNumViews(), 1); // Detach buffer from second view will detach from datastore. - dv2->attachBuffer(NULL); + dv2->attachBuffer(nullptr); EXPECT_FALSE(dv2->hasBuffer()); EXPECT_EQ(ds->getNumBuffers(), 0u); // Buffer has been destroyed since there are no more attached views - EXPECT_TRUE(ds->getBuffer(idx) == NULL); + EXPECT_TRUE(ds->getBuffer(idx) == nullptr); delete ds; } diff --git a/src/axom/sidre/tests/sidre_buffer_C.cpp b/src/axom/sidre/tests/sidre_buffer_C.cpp index 53b7d4d7ba..9ef6e063be 100644 --- a/src/axom/sidre/tests/sidre_buffer_C.cpp +++ b/src/axom/sidre/tests/sidre_buffer_C.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_buffer_F.f b/src/axom/sidre/tests/sidre_buffer_F.f index 29dcf960e2..6c3ed78ab0 100644 --- a/src/axom/sidre/tests/sidre_buffer_F.f +++ b/src/axom/sidre/tests/sidre_buffer_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_buffer_unit.cpp b/src/axom/sidre/tests/sidre_buffer_unit.cpp index c352f5a881..53cafa737e 100644 --- a/src/axom/sidre/tests/sidre_buffer_unit.cpp +++ b/src/axom/sidre/tests/sidre_buffer_unit.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_class.cpp b/src/axom/sidre/tests/sidre_class.cpp index a8671ce1cb..16bd9022d9 100644 --- a/src/axom/sidre/tests/sidre_class.cpp +++ b/src/axom/sidre/tests/sidre_class.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_collections.cpp b/src/axom/sidre/tests/sidre_collections.cpp index 6bf33a870c..3a7f395d56 100644 --- a/src/axom/sidre/tests/sidre_collections.cpp +++ b/src/axom/sidre/tests/sidre_collections.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -934,6 +934,7 @@ TYPED_TEST(IndexedCollectionTest, insertBadIdx) if(idx < 0) { EXPECT_EQ(sidre::InvalidIndex, insertedIdx); + delete val; } else { diff --git a/src/axom/sidre/tests/sidre_datastore.cpp b/src/axom/sidre/tests/sidre_datastore.cpp index 64139e0b6c..a668557e60 100644 --- a/src/axom/sidre/tests/sidre_datastore.cpp +++ b/src/axom/sidre/tests/sidre_datastore.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_datastore_unit.cpp b/src/axom/sidre/tests/sidre_datastore_unit.cpp index a112ee8aa6..8d1b00a1c0 100644 --- a/src/axom/sidre/tests/sidre_datastore_unit.cpp +++ b/src/axom/sidre/tests/sidre_datastore_unit.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_external.cpp b/src/axom/sidre/tests/sidre_external.cpp index 8ecbddd8a3..889e6ed094 100644 --- a/src/axom/sidre/tests/sidre_external.cpp +++ b/src/axom/sidre/tests/sidre_external.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -171,7 +171,7 @@ TEST(sidre_external, transition_external_view_to_empty) EXPECT_EQ(idata, view->getVoidPtr()); // Transition from EXTERNAL to EMPTY - view->setExternalDataPtr(NULL); + view->setExternalDataPtr(nullptr); EXPECT_TRUE(view->isDescribed()); EXPECT_FALSE(view->isAllocated()); diff --git a/src/axom/sidre/tests/sidre_external_C.cpp b/src/axom/sidre/tests/sidre_external_C.cpp index c51245ea2f..bcf765e30b 100644 --- a/src/axom/sidre/tests/sidre_external_C.cpp +++ b/src/axom/sidre/tests/sidre_external_C.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_external_F.f b/src/axom/sidre/tests/sidre_external_F.f index 89cda4ba9c..572f77d6bb 100644 --- a/src/axom/sidre/tests/sidre_external_F.f +++ b/src/axom/sidre/tests/sidre_external_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_group.cpp b/src/axom/sidre/tests/sidre_group.cpp index 01a1ac24a8..5a4194d436 100644 --- a/src/axom/sidre/tests/sidre_group.cpp +++ b/src/axom/sidre/tests/sidre_group.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -1024,7 +1024,7 @@ TEST(sidre_group, create_destroy_has_view) IndexType indx = group->getFirstValidViewIndex(); IndexType bindx = group->getView(indx)->getBuffer()->getIndex(); group->destroyViewAndData(indx); - EXPECT_TRUE(ds->getBuffer(bindx) == NULL); + EXPECT_TRUE(ds->getBuffer(bindx) == nullptr); // Destroy view but not the buffer view = group->createViewAndAllocate("viewWithLength2", INT_ID, 50); @@ -1489,6 +1489,132 @@ TEST(sidre_group, groups_move_copy) delete ds; } +//------------------------------------------------------------------------------ +TEST(sidre_group, group_deep_copy) +{ + DataStore* ds = new DataStore(); + Group* flds = ds->getRoot()->createGroup("fields"); + + Group* ga = flds->createGroup("a"); + Group* gb = flds->createGroup("b"); + + double dval0 = 100.0; + double dval1 = 301.0; + + ga->createView("i0")->setScalar(1); + ga->createView("d0")->setScalar(dval0); + gb->createView("d1")->setScalar(dval1); + gb->createView("s0")->setString("my string"); + + // check that all sub groups exist + EXPECT_TRUE(flds->hasGroup("a")); + EXPECT_TRUE(flds->hasGroup("b")); + + int viewlen = 8; + View* ownsbuf = ga->createViewAndAllocate("ownsbuf", DataType::c_int(viewlen)); + + int* int_vals = ownsbuf->getData(); + for(int i = 0; i < viewlen; ++i) + { + int_vals[i] = i + 1; + } + + IndexType buflen = 24; + Buffer* dbuff = ds->createBuffer()->allocate(FLOAT64_ID, buflen); + + dbuff->allocate(); + conduit::float64* buf_ptr = dbuff->getData(); + + for(int i = 0; i < buflen; ++i) + { + buf_ptr[i] = 2.0 * conduit::float64(i); + } + + const int NUM_VIEWS = 4; + int size[NUM_VIEWS] = {5, 4, 10, 11}; + int stride[NUM_VIEWS] = {3, 2, 2, 1}; + int offset[NUM_VIEWS] = {2, 9, 0, 10}; + std::string names[NUM_VIEWS] = {"viewa", "viewb", "viewc", "viewd"}; + + for(int i = 0; i < NUM_VIEWS; ++i) + { + ga->createView(names[i], dbuff)->apply(size[i], offset[i], stride[i]); + } + + const int extlen = 30; + conduit::float64 ext_array[extlen]; + for(int i = 0; i < extlen; ++i) + { + ext_array[i] = -1.0 * conduit::float64(i); + } + + for(int i = 0; i < NUM_VIEWS; ++i) + { + gb->createView(names[i], ext_array) + ->apply(FLOAT64_ID, size[i], offset[i], stride[i]); + } + + Group* deep_copy = ds->getRoot()->createGroup("deep_copy"); + deep_copy->deepCopyGroup(flds); + + EXPECT_TRUE(deep_copy->hasGroup("fields/a")); + EXPECT_TRUE(deep_copy->hasGroup("fields/b")); + + Group* copy_ga = deep_copy->getGroup("fields/a"); + Group* copy_gb = deep_copy->getGroup("fields/b"); + + int io_val = copy_ga->getView("i0")->getScalar(); + EXPECT_EQ(io_val, 1); + EXPECT_NEAR(copy_ga->getView("d0")->getScalar(), dval0, 1.0e-12); + EXPECT_NEAR(copy_gb->getView("d1")->getScalar(), dval1, 1.0e-12); + EXPECT_EQ(copy_gb->getView("s0")->getString(), std::string("my string")); + + for(int i = 0; i < NUM_VIEWS; ++i) + { + EXPECT_TRUE(copy_ga->hasView(names[i])); + View* copy_view = copy_ga->getView(names[i]); + EXPECT_TRUE(copy_view->hasBuffer()); + + // The deep copy creates a compact buffer in the copied View, associated + // only with that View. + Buffer* buffer = copy_view->getBuffer(); + EXPECT_EQ(buffer->getNumViews(), 1); + EXPECT_EQ(buffer->getNumElements(), size[i]); + EXPECT_EQ(copy_view->getOffset(), 0); + EXPECT_EQ(copy_view->getStride(), 1); + + conduit::float64* fdata = copy_view->getData(); + for(int j = 0; j < size[i]; ++j) + { + EXPECT_NEAR(fdata[j], 2.0 * (offset[i] + j * stride[i]), 1.0e-12); + } + } + + for(int i = 0; i < NUM_VIEWS; ++i) + { + EXPECT_TRUE(copy_gb->hasView(names[i])); + View* copy_view = copy_gb->getView(names[i]); + EXPECT_TRUE(copy_view->hasBuffer()); + + // The deep copy creates a compact buffer in the copied View, associated + // only with that View. Here external data was copied to internal + // buffers. + Buffer* buffer = copy_view->getBuffer(); + EXPECT_EQ(buffer->getNumViews(), 1); + EXPECT_EQ(buffer->getNumElements(), size[i]); + EXPECT_EQ(copy_view->getOffset(), 0); + EXPECT_EQ(copy_view->getStride(), 1); + + conduit::float64* fdata = copy_view->getData(); + for(int j = 0; j < size[i]; ++j) + { + EXPECT_NEAR(fdata[j], -1.0 * (offset[i] + j * stride[i]), 1.0e-12); + } + } + + delete ds; +} + //------------------------------------------------------------------------------ TEST(sidre_group, create_destroy_view_and_buffer2) { @@ -1671,6 +1797,8 @@ TEST(sidre_group, copy_to_conduit_node) EXPECT_EQ(chld_views["d1/value"].as_string(), std::string("33.0")); } } + + delete ds1; } //------------------------------------------------------------------------------ TEST(sidre_group, save_restore_empty_datastore) @@ -1682,7 +1810,7 @@ TEST(sidre_group, save_restore_empty_datastore) for(const auto& protocol : protocols) { const std::string file_path = file_path_base + protocol; - ds1->getRoot()->save(file_path, protocol); + EXPECT_TRUE(ds1->getRoot()->save(file_path, protocol)); } delete ds1; @@ -1694,7 +1822,7 @@ TEST(sidre_group, save_restore_empty_datastore) DataStore* ds2 = new DataStore(); Group* root2 = ds2->getRoot(); - root2->load(file_path, default_protocol); + EXPECT_TRUE(root2->load(file_path, default_protocol)); EXPECT_TRUE(ds2->getNumBuffers() == 0); EXPECT_TRUE(root2->getNumGroups() == 0); @@ -1723,12 +1851,13 @@ TEST(sidre_group, save_load_via_hdf5_ids) } // save using the sidre_hdf5 protocol - root->save("out_save_load_via_hdf5_ids.sidre_hdf5", "sidre_hdf5"); + EXPECT_TRUE(root->save("out_save_load_via_hdf5_ids.sidre_hdf5", "sidre_hdf5")); // load via path based DataStore ds_load_generic; - ds_load_generic.getRoot()->load("out_save_load_via_hdf5_ids.sidre_hdf5", - "sidre_hdf5"); + EXPECT_TRUE( + ds_load_generic.getRoot()->load("out_save_load_via_hdf5_ids.sidre_hdf5", + "sidre_hdf5")); // load via hdf5 id DataStore ds_load_hdf5; @@ -1738,7 +1867,7 @@ TEST(sidre_group, save_load_via_hdf5_ids) EXPECT_TRUE(h5_id >= 0); // this implies protocol == "sidre_hdf5" - ds_load_hdf5.getRoot()->load(h5_id); + EXPECT_TRUE(ds_load_hdf5.getRoot()->load(h5_id)); // ? Does isEquivalentTo check values? // check path based with source @@ -1789,7 +1918,7 @@ TEST(sidre_group, save_root_restore_as_child) for(const auto& protocol : protocols) { const std::string file_path = file_path_base + protocol; - root->save(file_path, protocol); + EXPECT_TRUE(root->save(file_path, protocol)); } // Restore the original DataStore into a child group @@ -1812,7 +1941,7 @@ TEST(sidre_group, save_root_restore_as_child) if(axom::utilities::filesystem::pathExists(file_path)) { std::cout << "loading " << file_path << std::endl; - cg->load(file_path, protocol); + EXPECT_TRUE(cg->load(file_path, protocol)); EXPECT_TRUE(cg->isEquivalentTo(root, false)); EXPECT_TRUE(root->isEquivalentTo(cg, false)); @@ -1872,7 +2001,7 @@ TEST(sidre_group, save_child_restore_as_root) for(const auto& protocol : protocols) { const std::string file_path = file_path_base + protocol; - child1->save(file_path, protocol); + EXPECT_TRUE(child1->save(file_path, protocol)); } // Restore the saved child1 into a root group @@ -1888,7 +2017,7 @@ TEST(sidre_group, save_child_restore_as_root) const std::string file_path = file_path_base + protocol; if(axom::utilities::filesystem::pathExists(file_path)) { - dscopy->getRoot()->load(file_path, protocol); + EXPECT_TRUE(dscopy->getRoot()->load(file_path, protocol)); EXPECT_TRUE(dscopy->getRoot()->isEquivalentTo(child1, false)); EXPECT_TRUE(child1->isEquivalentTo(dscopy->getRoot(), false)); @@ -1917,13 +2046,13 @@ TEST(sidre_group, save_restore_api) // These should be produce identical files. // No group provided, defaults to root group - root1->save("sidre_save_fulltree_conduit", "json"); + EXPECT_TRUE(root1->save("sidre_save_fulltree_conduit", "json")); const std::vector& protocols = Group::getValidIOProtocols(); for(const auto& protocol : protocols) { const std::string file_path = file_path_base + protocol; - root1->save(file_path, protocol); + EXPECT_TRUE(root1->save(file_path, protocol)); } //These are commented out because createViewScalar creates a scalar View @@ -1933,13 +2062,13 @@ TEST(sidre_group, save_restore_api) #if 0 DataStore* ds2 = new DataStore(); Group* root2 = ds2->getRoot(); - root2->load("sidre_save_fulltree_conduit", "json"); + EXPECT_TRUE(root2->load("sidre_save_fulltree_conduit", "json")); EXPECT_TRUE( ds2->getRoot()->isEquivalentTo(root1) ); delete ds2; DataStore* ds3 = new DataStore(); Group* root3 = ds3->getRoot(); - root3->load("sidre_save_subtree_sidre_json", "sidre_json"); + EXPECT_TRUE(root3->load("sidre_save_subtree_sidre_json", "sidre_json")); EXPECT_TRUE( ds3->getRoot()->isEquivalentTo(root1) ); delete ds3; #endif @@ -1947,7 +2076,7 @@ TEST(sidre_group, save_restore_api) #ifdef AXOM_USE_HDF5 DataStore* ds4 = new DataStore(); Group* root4 = ds4->getRoot(); - root4->load("sidre_save_subtree_sidre_hdf5", "sidre_hdf5"); + EXPECT_TRUE(root4->load("sidre_save_subtree_sidre_hdf5", "sidre_hdf5")); EXPECT_TRUE(ds4->getRoot()->isEquivalentTo(root1)); delete ds4; #endif @@ -1955,7 +2084,7 @@ TEST(sidre_group, save_restore_api) #if 0 DataStore* ds5 = new DataStore(); Group* root5 = ds5->getRoot(); - root5->load("sidre_save_subtree_json", "json"); + EXPECT_TRUE(root5->load("sidre_save_subtree_json", "json")); EXPECT_TRUE( ds5->getRoot()->isEquivalentTo(root1) ); delete ds5; #endif @@ -1969,8 +2098,8 @@ TEST(sidre_group, save_restore_api) Group* load1 = tree1->createGroup("subtree"); Group* load2 = tree2->createGroup("subtree"); - load1->load("sidre_save_subtree_sidre_json", "sidre_json"); - load2->load("sidre_save_subtree_sidre_json", "sidre_json"); + EXPECT_TRUE(load1->load("sidre_save_subtree_sidre_json", "sidre_json")); + EXPECT_TRUE(load2->load("sidre_save_subtree_sidre_json", "sidre_json")); EXPECT_TRUE(load1->isEquivalentTo(load2)); @@ -2037,7 +2166,7 @@ TEST(sidre_group, save_restore_scalars_and_strings) // if ( protocol == "conduit_hdf5") // continue; // XXX - Does not work const std::string file_path = file_path_base + protocol; - root1->save(file_path, protocol); + EXPECT_TRUE(root1->save(file_path, protocol)); } for(const auto& protocol : protocols) @@ -2053,7 +2182,7 @@ TEST(sidre_group, save_restore_scalars_and_strings) DataStore* ds2 = new DataStore(); Group* root2 = ds2->getRoot(); - root2->load(file_path, protocol); + EXPECT_TRUE(root2->load(file_path, protocol)); EXPECT_TRUE(root1->isEquivalentTo(root2)); @@ -2136,7 +2265,7 @@ TEST(sidre_group, save_restore_name_change) // if ( protocol == "conduit_hdf5") // continue; // XXX - Does not work const std::string file_path = file_path_base + protocol; - child1->save(file_path, protocol); + EXPECT_TRUE(child1->save(file_path, protocol)); } std::string groupname; @@ -2156,7 +2285,7 @@ TEST(sidre_group, save_restore_name_change) EXPECT_EQ(child2->getName(), "child2"); - child2->load(file_path, protocol, false, groupname); + EXPECT_TRUE(child2->load(file_path, protocol, false, groupname)); EXPECT_EQ(child2->getName(), "child2"); @@ -2197,7 +2326,7 @@ TEST(sidre_group, save_restore_external_data) int2d1[i] = i; int2d2[i] = 0; } - foo3 = NULL; + foo3 = nullptr; DataStore* ds1 = new DataStore(); Group* root1 = ds1->getRoot(); @@ -2213,7 +2342,7 @@ TEST(sidre_group, save_restore_external_data) for(const auto& protocol : protocols) { const std::string file_path = file_path_base + protocol; - root1->save(file_path, protocol); + EXPECT_TRUE(root1->save(file_path, protocol)); } delete ds1; @@ -2234,7 +2363,7 @@ TEST(sidre_group, save_restore_external_data) DataStore* ds2 = new DataStore(); Group* root2 = ds2->getRoot(); - root2->load(file_path, protocol); + EXPECT_TRUE(root2->load(file_path, protocol)); // load has set the type and size of the view. // Now set the external address before calling loadExternal. @@ -2276,7 +2405,7 @@ TEST(sidre_group, save_restore_external_data) view4->setExternalDataPtr(int2d2); // Read external data into views - root2->loadExternalData(file_path); + EXPECT_TRUE(root2->loadExternalData(file_path)); // Make sure addresses have not changed EXPECT_TRUE(view1->getVoidPtr() == static_cast(foo2)); @@ -2294,6 +2423,25 @@ TEST(sidre_group, save_restore_external_data) } delete ds2; + + // Now try to load external from an incorrect path. This will fail, + // causing loadExternalData() to return false. + DataStore* ds3 = new DataStore(); + Group* root3 = ds3->getRoot(); + root3->load(file_path, protocol); + View* view31 = root3->getView("external_array"); + view31->setExternalDataPtr(foo2); + View* view32 = root3->getView("empty_array"); + view32->setExternalDataPtr(foo3); + View* view33 = root3->getView("external_undescribed"); + view33->setExternalDataPtr(foo2); + View* view34 = root3->getView("int2d"); + view34->setExternalDataPtr(int2d2); + + const std::string bad_file_path = "garbage_" + file_path; + EXPECT_FALSE(root3->loadExternalData(bad_file_path)); + + delete ds3; } } @@ -2427,7 +2575,7 @@ TEST(sidre_group, save_restore_buffer) for(const auto& protocol : protocols) { const std::string file_path = file_path_base + protocol; - root1->save(file_path, protocol); + EXPECT_TRUE(root1->save(file_path, protocol)); } // Now load back in. @@ -2444,7 +2592,7 @@ TEST(sidre_group, save_restore_buffer) DataStore* ds2 = new DataStore(); Group* root2 = ds2->getRoot(); - root2->load(file_path, protocol); + EXPECT_TRUE(root2->load(file_path, protocol)); bool isequivalent = root1->isEquivalentTo(root2); EXPECT_TRUE(isequivalent); @@ -2489,7 +2637,7 @@ TEST(sidre_group, save_restore_other) for(const auto& protocol : protocols) { const std::string file_path = file_path_base + protocol; - root1->save(file_path, protocol); + EXPECT_TRUE(root1->save(file_path, protocol)); } delete ds1; @@ -2510,7 +2658,7 @@ TEST(sidre_group, save_restore_other) DataStore* ds2 = new DataStore(); Group* root2 = ds2->getRoot(); - root2->load(file_path, protocol); + EXPECT_TRUE(root2->load(file_path, protocol)); View* view1 = root2->getView("empty_view"); EXPECT_TRUE(view1->isEmpty()); @@ -2575,7 +2723,7 @@ TEST(sidre_group, save_restore_complex) for(const auto& protocol : protocols) { const std::string file_path = file_path_base + protocol; - ds1->getRoot()->save(file_path, protocol); + EXPECT_TRUE(ds1->getRoot()->save(file_path, protocol)); } for(const auto& protocol : protocols) @@ -2590,7 +2738,7 @@ TEST(sidre_group, save_restore_complex) DataStore* ds2 = new DataStore(); - ds2->getRoot()->load(file_path, protocol); + EXPECT_TRUE(ds2->getRoot()->load(file_path, protocol)); EXPECT_TRUE(ds1->getRoot()->isEquivalentTo(ds2->getRoot())); @@ -2718,10 +2866,15 @@ TEST(sidre_group, save_load_all_protocols) SLIC_INFO("Testing protocol: " << protocol); const std::string file_path = file_path_base + protocol; // save using current protocol - ds.getRoot()->save(file_path, protocol); + EXPECT_TRUE(ds.getRoot()->save(file_path, protocol)); DataStore ds_load; - ds_load.getRoot()->load(file_path, protocol); + EXPECT_TRUE(ds_load.getRoot()->load(file_path, protocol)); + EXPECT_FALSE(ds.getConduitErrorOccurred()); + ds.appendToConduitErrors("test: dummy error"); + EXPECT_TRUE(ds.getConduitErrorOccurred()); + ds.clearConduitErrors(); + EXPECT_FALSE(ds.getConduitErrorOccurred()); SLIC_INFO("Tree from protocol: " << protocol); // show the result @@ -2752,6 +2905,66 @@ TEST(sidre_group, save_load_all_protocols) DataStore::setConduitDefaultMessageHandlers(); } +//------------------------------------------------------------------------------ +TEST(sidre_group, fail_save_all_protocols) +{ + const std::string file_path_base("sidre_fail_save_all_protocols."); + DataStore ds; + + Group* flds = ds.getRoot()->createGroup("fields"); + + Group* ga = flds->createGroup("a"); + Group* gb = flds->createGroup("b"); + Group* gc = flds->createGroup("c"); + int ndata = 10; + + // prep a tree that can exactly restored by all + // i/o protocols. + // Specially, use int64 and float64 b/c the + // json i/o case uses those types for parsed integers + // and floating point numbers. + + ga->createViewScalar("i0", 100); + ga->createViewScalar("d0", 3000.00); + gb->createViewString("s0", "foo"); + + gc->createViewAndAllocate("int10", DataType::int64(ndata)); + conduit::int64* data_ptr = gc->getView("int10")->getArray(); + for(int i = 0; i < ndata; ++i) + { + data_ptr[i] = (conduit::int64)i; + } + + // show the source tree + SLIC_INFO("Source tree"); + ds.print(); + + // + // test all protocols + // + const std::vector& protocols = Group::getValidIOProtocols(); + for(const auto& protocol : protocols) + { + SLIC_INFO("Testing fail to save or load protocol: " << protocol); + const std::string save_file_path = file_path_base + "save." + protocol; + // create a directory named file_path + axom::utilities::filesystem::makeDirsForPath(save_file_path); + // fail to save, since there's a directory with the same name + EXPECT_FALSE(ds.getRoot()->save(save_file_path, protocol)); + EXPECT_TRUE(ds.getConduitErrorOccurred()); + std::string errstring = ds.getConduitErrors(); + EXPECT_GT(errstring.length(), 0); + + DataStore ds_load; + const std::string load_file_path = file_path_base + "load." + protocol; + // fail to load, since there's a directory, not a data file + EXPECT_FALSE(ds_load.getRoot()->load(load_file_path, protocol)); + EXPECT_TRUE(ds.getConduitErrorOccurred()); + errstring = ds.getConduitErrors(); + EXPECT_GT(errstring.length(), 0); + } +} + //------------------------------------------------------------------------------ TEST(sidre_group, save_load_preserve_contents) { @@ -2789,7 +3002,7 @@ TEST(sidre_group, save_load_preserve_contents) for(const auto& protocol : protocols) { std::string file_path0 = file_path_tree0 + protocol; - tree0->save(file_path0, protocol); + EXPECT_TRUE(tree0->save(file_path0, protocol)); Group* tree1 = tree0->createGroup("tree1"); @@ -2808,7 +3021,7 @@ TEST(sidre_group, save_load_preserve_contents) std::string file_path1 = file_path_tree1 + protocol; - tree1->save(file_path1, protocol); + EXPECT_TRUE(tree1->save(file_path1, protocol)); // show the source tree SLIC_INFO("Source tree"); @@ -2816,8 +3029,8 @@ TEST(sidre_group, save_load_preserve_contents) DataStore ds_load; Group* loadtree0 = ds_load.getRoot()->createGroup("tree0"); - loadtree0->load(file_path0, protocol, false, groupname); - loadtree0->load(file_path1, protocol, true, groupname); + EXPECT_TRUE(loadtree0->load(file_path0, protocol, false, groupname)); + EXPECT_TRUE(loadtree0->load(file_path1, protocol, true, groupname)); loadtree0->rename(groupname); SLIC_INFO("Tree from protocol: " << protocol); @@ -2901,9 +3114,9 @@ TEST(sidre_group, save_layout_protocols) gc->createView("empty_view"); std::string file_path = file_path_base + "sidre_layout_json"; - ds.getRoot()->save(file_path, "sidre_layout_json"); + EXPECT_TRUE(ds.getRoot()->save(file_path, "sidre_layout_json")); file_path = file_path_base + "conduit_layout_json"; - ds.getRoot()->save(file_path, "conduit_layout_json"); + EXPECT_TRUE(ds.getRoot()->save(file_path, "conduit_layout_json")); //restore conduit default errors DataStore::setConduitDefaultMessageHandlers(); @@ -3137,10 +3350,10 @@ TEST(sidre_group, import_conduit_lists) std::string lists_protocol = "sidre_json"; #endif - ds.getRoot()->save(lists_file, lists_protocol); + EXPECT_TRUE(ds.getRoot()->save(lists_file, lists_protocol)); DataStore load_ds; - load_ds.getRoot()->load(lists_file, lists_protocol); + EXPECT_TRUE(load_ds.getRoot()->load(lists_file, lists_protocol)); { EXPECT_EQ( @@ -3392,7 +3605,7 @@ TEST(sidre_group, get_data_info) Group* gp_D = gp_C->createGroup("D"); num_groups_chk += 1; - View* view_D1 = gp_D->createView("ext_D1", INT_ID, 10, &extdata + 10); + View* view_D1 = gp_D->createView("ext_D1", INT_ID, 10, extdata + 10); num_views_chk += 1; num_views_external_chk += 1; num_bytes_external_chk += view_D1->getTotalBytes(); diff --git a/src/axom/sidre/tests/sidre_group_C.cpp b/src/axom/sidre/tests/sidre_group_C.cpp index e9c42a225c..d859a230e0 100644 --- a/src/axom/sidre/tests/sidre_group_C.cpp +++ b/src/axom/sidre/tests/sidre_group_C.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -791,6 +791,8 @@ TEST(C_sidre_group, rename_group) success = SIDRE_Group_rename(child3, "g_b"); EXPECT_FALSE(success); EXPECT_TRUE(strcmp(SIDRE_Group_get_name(child3), "g_c") == 0); + + SIDRE_DataStore_delete(ds); } //------------------------------------------------------------------------------ @@ -850,8 +852,8 @@ TEST(C_sidre_group, save_restore_complex) EXPECT_NEAR(SIDRE_View_get_data_double(d0_view), 3000.0, 1e-12); SIDRE_DataStore_print(ds2); +#endif - SIDRE_DataStore_delete(ds); SIDRE_DataStore_delete(ds2); -#endif + SIDRE_DataStore_delete(ds); } diff --git a/src/axom/sidre/tests/sidre_group_F.F b/src/axom/sidre/tests/sidre_group_F.F index e86e4c63fc..5a403ef8c8 100644 --- a/src/axom/sidre/tests/sidre_group_F.F +++ b/src/axom/sidre/tests/sidre_group_F.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_mcarray.cpp b/src/axom/sidre/tests/sidre_mcarray.cpp index 7ddc0b518d..eb9e714d78 100644 --- a/src/axom/sidre/tests/sidre_mcarray.cpp +++ b/src/axom/sidre/tests/sidre_mcarray.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_mfem_datacollection.cpp b/src/axom/sidre/tests/sidre_mfem_datacollection.cpp index fa59055db8..d3bb3601f2 100644 --- a/src/axom/sidre/tests/sidre_mfem_datacollection.cpp +++ b/src/axom/sidre/tests/sidre_mfem_datacollection.cpp @@ -1,9 +1,10 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) #include "axom/config.hpp" +#include "axom/core.hpp" #include "axom/slic.hpp" #include "axom/sidre.hpp" #include "axom/fmt.hpp" @@ -22,7 +23,7 @@ using axom::sidre::Group; using axom::sidre::MFEMSidreDataCollection; -const double EPSILON = 1.0e-6; +constexpr double EPSILON = 1.0e-6; std::string testName() { @@ -38,9 +39,9 @@ TEST(sidre_datacollection, dc_alloc_no_mesh) TEST(sidre_datacollection, dc_alloc_owning_mesh) { // 1D mesh divided into 10 segments - auto mesh = mfem::Mesh::MakeCartesian1D(10); - bool owns_mesh = true; - MFEMSidreDataCollection sdc(testName(), &mesh, owns_mesh); + auto* mesh = new mfem::Mesh(mfem::Mesh::MakeCartesian1D(10)); + const bool owns_mesh_data = true; + MFEMSidreDataCollection sdc(testName(), mesh, owns_mesh_data); EXPECT_TRUE(sdc.verifyMeshBlueprint()); } @@ -48,8 +49,8 @@ TEST(sidre_datacollection, dc_alloc_nonowning_mesh) { // 1D mesh divided into 10 segments auto mesh = mfem::Mesh::MakeCartesian1D(10); - bool owns_mesh = false; - MFEMSidreDataCollection sdc(testName(), &mesh, owns_mesh); + const bool owns_mesh_data = false; + MFEMSidreDataCollection sdc(testName(), &mesh, owns_mesh_data); EXPECT_TRUE(sdc.verifyMeshBlueprint()); } @@ -155,22 +156,24 @@ TEST(sidre_datacollection, dc_reload_gf) { const std::string field_name = "test_field"; // 2D mesh divided into triangles - auto mesh = mfem::Mesh::MakeCartesian2D(10, 10, mfem::Element::TRIANGLE); - mfem::H1_FECollection fec(1, mesh.Dimension()); - mfem::FiniteElementSpace fes(&mesh, &fec); + auto* mesh = + new mfem::Mesh(mfem::Mesh::MakeCartesian2D(10, 10, mfem::Element::TRIANGLE)); + auto* fec = new mfem::H1_FECollection(1, mesh->Dimension()); + auto* fes = new mfem::FiniteElementSpace(mesh, fec); // The mesh and field(s) must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) - bool owns_mesh = true; - MFEMSidreDataCollection sdc_writer(testName(), &mesh, owns_mesh); - mfem::GridFunction gf_write(&fes, nullptr); + const bool owns_mesh_data = true; + MFEMSidreDataCollection sdc_writer(testName(), mesh, owns_mesh_data); + auto* gf_write = new mfem::GridFunction(fes, nullptr); + gf_write->MakeOwner(fec); // Register to allocate storage internally, then write to it - sdc_writer.RegisterField(field_name, &gf_write); + sdc_writer.RegisterField(field_name, gf_write); EXPECT_TRUE(sdc_writer.HasField(field_name)); mfem::ConstantCoefficient three_and_a_half(3.5); - gf_write.ProjectCoefficient(three_and_a_half); + gf_write->ProjectCoefficient(three_and_a_half); EXPECT_TRUE(sdc_writer.verifyMeshBlueprint()); @@ -192,7 +195,7 @@ TEST(sidre_datacollection, dc_reload_gf) EXPECT_TRUE(sdc_reader.HasField(field_name)); // No need to reregister, it already exists - auto gf_read = sdc_reader.GetField(field_name); + auto* gf_read = sdc_reader.GetField(field_name); // Make sure the gridfunction was actually read in EXPECT_LT(gf_read->ComputeL2Error(three_and_a_half), EPSILON); @@ -211,8 +214,11 @@ TEST(sidre_datacollection, dc_reload_gf_vdim) // The mesh and field(s) must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) - bool owns_mesh = true; - MFEMSidreDataCollection sdc_writer(testName(), &mesh, owns_mesh); + const bool owns_mesh_data = true; + MFEMSidreDataCollection sdc_writer(testName(), &mesh, owns_mesh_data); + // the following prevents mfem::DataCollection from deleting the mesh and gfs + // see 'dc_reload_gf' test for a case where the DataCollection also owns the mesh and gf data + sdc_writer.SetOwnData(false); mfem::GridFunction gf_write(&fes, nullptr); // Register to allocate storage internally, then write to it @@ -260,8 +266,9 @@ TEST(sidre_datacollection, dc_reload_mesh) // The mesh and field(s) must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) - bool owns_mesh = true; - MFEMSidreDataCollection sdc_writer(testName(), &mesh, owns_mesh); + const bool owns_mesh_data = true; + MFEMSidreDataCollection sdc_writer(testName(), &mesh, owns_mesh_data); + sdc_writer.SetOwnData(false); #if defined(AXOM_USE_MPI) && defined(MFEM_USE_MPI) sdc_writer.SetComm(MPI_COMM_WORLD); #endif @@ -317,8 +324,9 @@ TEST(sidre_datacollection, dc_reload_qf) // The mesh and field(s) must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) - bool owns_mesh = true; - MFEMSidreDataCollection sdc_writer(testName(), &mesh, owns_mesh); + const bool owns_mesh_data = true; + MFEMSidreDataCollection sdc_writer(testName(), &mesh, owns_mesh_data); + sdc_writer.SetOwnData(false); #if defined(AXOM_USE_MPI) && defined(MFEM_USE_MPI) sdc_writer.SetComm(MPI_COMM_WORLD); #endif @@ -639,24 +647,49 @@ TEST(sidre_datacollection, create_material_dependent_field_multi_fraction) #if defined(AXOM_USE_MPI) && defined(MFEM_USE_MPI) -TEST(sidre_datacollection, dc_alloc_owning_parmesh) +TEST(sidre_datacollection, dc_alloc_parmesh) { - // 1D mesh divided into 10 segments - auto mesh = mfem::Mesh::MakeCartesian1D(10); - mfem::ParMesh parmesh(MPI_COMM_WORLD, mesh); - bool owns_mesh = true; - MFEMSidreDataCollection sdc(testName(), &parmesh, owns_mesh); - EXPECT_TRUE(sdc.verifyMeshBlueprint()); -} + // case 1: serial and parallel mesh are not pointers + { + constexpr bool owns_mesh_data = true; -TEST(sidre_datacollection, dc_alloc_nonowning_parmesh) -{ - // 1D mesh divided into 10 segments - auto mesh = mfem::Mesh::MakeCartesian1D(10); - mfem::ParMesh parmesh(MPI_COMM_WORLD, mesh); - bool owns_mesh = false; - MFEMSidreDataCollection sdc(testName(), &parmesh, owns_mesh); - EXPECT_TRUE(sdc.verifyMeshBlueprint()); + // 1D mesh divided into 10 segments + auto mesh = mfem::Mesh::MakeCartesian1D(10); + mfem::ParMesh parmesh(MPI_COMM_WORLD, mesh); + MFEMSidreDataCollection sdc(testName(), &parmesh, owns_mesh_data); + + // Must set this to avoid mfem's DataCollection from deleting the parmesh + sdc.SetOwnData(false); + + EXPECT_TRUE(sdc.verifyMeshBlueprint()); + } + + // case 2: serial and parallel meshes are pointers + // data collection owns and deletes parmesh + { + constexpr bool owns_mesh_data = true; + + // 1D mesh divided into 10 segments + auto* mesh = new mfem::Mesh(mfem::Mesh::MakeCartesian1D(10)); + auto* parmesh = new mfem::ParMesh(MPI_COMM_WORLD, *mesh); + delete mesh; + + MFEMSidreDataCollection sdc(testName(), parmesh, owns_mesh_data); + + EXPECT_TRUE(sdc.verifyMeshBlueprint()); + } + + // case 3: data collection doesn't own mesh/data + { + constexpr bool owns_mesh_data = false; + + // 1D mesh divided into 10 segments + auto mesh = mfem::Mesh::MakeCartesian1D(10); + mfem::ParMesh parmesh(MPI_COMM_WORLD, mesh); + + MFEMSidreDataCollection sdc(testName(), &parmesh, owns_mesh_data); + EXPECT_TRUE(sdc.verifyMeshBlueprint()); + } } struct ParMeshGroupData @@ -705,16 +738,13 @@ static std::vector getGroupData(const mfem::ParMesh& parmesh) static void testParallelMeshReload(mfem::Mesh& base_mesh, const int part_method = 1) { - mfem::ParMesh parmesh(MPI_COMM_WORLD, base_mesh, nullptr, part_method); - - // Use second-order elements to ensure that the nodal gridfunction gets set up properly as well - mfem::H1_FECollection fec(2, base_mesh.Dimension()); - mfem::ParFiniteElementSpace parfes(&parmesh, &fec); + auto* parmesh = + new mfem::ParMesh(MPI_COMM_WORLD, base_mesh, nullptr, part_method); // The mesh must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) - const bool owns_mesh = true; - MFEMSidreDataCollection sdc_writer(testName(), &parmesh, owns_mesh); + const bool owns_mesh_data = true; + MFEMSidreDataCollection sdc_writer(testName(), parmesh, owns_mesh_data); // Save some basic info about the mesh const int n_verts = sdc_writer.GetMesh()->GetNV(); @@ -731,6 +761,8 @@ static void testParallelMeshReload(mfem::Mesh& base_mesh, // Group-specific info auto writer_group_data = getGroupData(*writer_pmesh); + EXPECT_TRUE(sdc_writer.verifyMeshBlueprint()); + sdc_writer.SetCycle(0); sdc_writer.Save(); @@ -772,7 +804,7 @@ static void testParallelMeshReload(mfem::Mesh& base_mesh, static void testParallelMeshReloadAllPartitionings(mfem::Mesh& base_mesh) { // MFEM supports partition methods [0, 5] - static constexpr int MAX_PART_METHOD = 5; + constexpr int MAX_PART_METHOD = 5; for(int part_method = 0; part_method <= MAX_PART_METHOD; part_method++) { testParallelMeshReload(base_mesh, part_method); @@ -791,8 +823,9 @@ TEST(sidre_datacollection, dc_par_reload_gf) // The mesh must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) - bool owns_mesh = true; - MFEMSidreDataCollection sdc_writer(testName(), &parmesh, owns_mesh); + bool owns_mesh_data = true; + MFEMSidreDataCollection sdc_writer(testName(), &parmesh, owns_mesh_data); + sdc_writer.SetOwnData(false); // The mesh and field(s) must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) @@ -848,8 +881,9 @@ TEST(sidre_datacollection, dc_par_reload_gf_ordering) // The mesh must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) - bool owns_mesh = true; - MFEMSidreDataCollection sdc_writer(testName(), &parmesh, owns_mesh); + bool owns_mesh_data = true; + MFEMSidreDataCollection sdc_writer(testName(), &parmesh, owns_mesh_data); + sdc_writer.SetOwnData(false); // The mesh and field(s) must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) @@ -908,6 +942,7 @@ TEST(sidre_datacollection, dc_par_reload_multi_datastore) const std::string second_coll_name = testName() + "second"; const std::string field_name = "test_field"; const std::string useless_view_name = "useless_view"; + // 3D tet mesh auto mesh = mfem::Mesh::MakeCartesian3D(2, 2, 2, mfem::Element::TETRAHEDRON); mfem::ParMesh first_parmesh(MPI_COMM_WORLD, mesh); @@ -937,18 +972,18 @@ TEST(sidre_datacollection, dc_par_reload_multi_datastore) // The mesh must be owned by Sidre to properly manage data in case of // a simulated restart (save -> load) - bool owns_mesh = true; + bool owns_mesh_data = true; MFEMSidreDataCollection first_sdc_writer(first_coll_name, first_bp_index_grp, first_domain_grp, - owns_mesh); + owns_mesh_data); first_sdc_writer.SetComm(MPI_COMM_WORLD); first_sdc_writer.SetMesh(&first_parmesh); MFEMSidreDataCollection second_sdc_writer(second_coll_name, second_bp_index_grp, second_domain_grp, - owns_mesh); + owns_mesh_data); second_sdc_writer.SetComm(MPI_COMM_WORLD); second_sdc_writer.SetMesh(&second_parmesh); @@ -991,11 +1026,11 @@ TEST(sidre_datacollection, dc_par_reload_multi_datastore) MFEMSidreDataCollection first_sdc_reader(first_coll_name, first_bp_index_grp, first_domain_grp, - owns_mesh); + owns_mesh_data); MFEMSidreDataCollection second_sdc_reader(second_coll_name, second_bp_index_grp, second_domain_grp, - owns_mesh); + owns_mesh_data); // Needs to be set "manually" in order for everything to be loaded in properly first_sdc_reader.SetComm(MPI_COMM_WORLD); diff --git a/src/axom/sidre/tests/sidre_native_layout.cpp b/src/axom/sidre/tests/sidre_native_layout.cpp index b4bd1f76b1..a3ae78d52e 100644 --- a/src/axom/sidre/tests/sidre_native_layout.cpp +++ b/src/axom/sidre/tests/sidre_native_layout.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_opaque.cpp b/src/axom/sidre/tests/sidre_opaque.cpp index 48cb41ad8b..537e3fbd8b 100644 --- a/src/axom/sidre/tests/sidre_opaque.cpp +++ b/src/axom/sidre/tests/sidre_opaque.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_opaque_C.cpp b/src/axom/sidre/tests/sidre_opaque_C.cpp index 1e4832fd63..cbbf7b7a6a 100644 --- a/src/axom/sidre/tests/sidre_opaque_C.cpp +++ b/src/axom/sidre/tests/sidre_opaque_C.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -25,11 +25,11 @@ enum DType _UnknownType_ }; -typedef struct +struct AA_extent { int ilo; int ihi; -} AA_extent; +}; AA_extent* AA_extent_new(int lo, int hi) { @@ -60,12 +60,12 @@ int AA_get_num_pts(AA_extent* self, Centering cent) return retval; } -typedef struct +struct AA_meshvar { Centering cent; DType type; int depth; -} AA_meshvar; +}; AA_meshvar* AA_meshvar_new(Centering cent, DType type, int depth) { @@ -137,6 +137,8 @@ TEST(C_sidre_opaque, basic_inout) int test_ihi2 = test_extent2->ihi; EXPECT_EQ(test_ihi2, 2 * ihi_val); + + AA_extent_delete(ext2); #endif // clean up... diff --git a/src/axom/sidre/tests/sidre_opaque_F.f b/src/axom/sidre/tests/sidre_opaque_F.f index e72c911e57..0e4b9ff61d 100644 --- a/src/axom/sidre/tests/sidre_opaque_F.f +++ b/src/axom/sidre/tests/sidre_opaque_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_smoke.cpp b/src/axom/sidre/tests/sidre_smoke.cpp index 9941acb1e3..e5dda5098d 100644 --- a/src/axom/sidre/tests/sidre_smoke.cpp +++ b/src/axom/sidre/tests/sidre_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_smoke_C.cpp b/src/axom/sidre/tests/sidre_smoke_C.cpp index 6007bc7b01..7002625766 100644 --- a/src/axom/sidre/tests/sidre_smoke_C.cpp +++ b/src/axom/sidre/tests/sidre_smoke_C.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_smoke_F.f b/src/axom/sidre/tests/sidre_smoke_F.f index 14f2edfab7..f8e2411ee7 100644 --- a/src/axom/sidre/tests/sidre_smoke_F.f +++ b/src/axom/sidre/tests/sidre_smoke_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_types_C.cpp b/src/axom/sidre/tests/sidre_types_C.cpp index 550e8c04bf..2c8c90ce2b 100644 --- a/src/axom/sidre/tests/sidre_types_C.cpp +++ b/src/axom/sidre/tests/sidre_types_C.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_view.cpp b/src/axom/sidre/tests/sidre_view.cpp index e32196ad60..4ccd1202d2 100644 --- a/src/axom/sidre/tests/sidre_view.cpp +++ b/src/axom/sidre/tests/sidre_view.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -1180,7 +1180,7 @@ TEST(sidre_view, view_offset_and_stride) // string, scalar, empty, opaque Group* othersGroup = root->createGroup("others"); - typedef std::vector ViewVec; + using ViewVec = std::vector; ViewVec views; std::uint8_t ui8 = 3; std::uint16_t ui16 = 4; @@ -1720,6 +1720,8 @@ TEST(sidre_view, import_array_node) v4->importArrayNode(n_ints); EXPECT_TRUE(v4->isString()); + + delete ds; } //------------------------------------------------------------------------------ @@ -1820,6 +1822,8 @@ TEST(sidre_view, clear_view) view->clear(); EXPECT_TRUE(checkViewValues(view, EMPTY, false, false, false, 0)); } + + delete ds; } //------------------------------------------------------------------------------ diff --git a/src/axom/sidre/tests/sidre_view_C.cpp b/src/axom/sidre/tests/sidre_view_C.cpp index eff3a5853d..d45a09f031 100644 --- a/src/axom/sidre/tests/sidre_view_C.cpp +++ b/src/axom/sidre/tests/sidre_view_C.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/sidre_view_F.f b/src/axom/sidre/tests/sidre_view_F.f index 2046e19214..144c254a1c 100644 --- a/src/axom/sidre/tests/sidre_view_F.f +++ b/src/axom/sidre/tests/sidre_view_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/spio/CMakeLists.txt b/src/axom/sidre/tests/spio/CMakeLists.txt index 792f44d758..0c15866f63 100644 --- a/src/axom/sidre/tests/spio/CMakeLists.txt +++ b/src/axom/sidre/tests/spio/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/spio/F_spio_basicWriteRead.F b/src/axom/sidre/tests/spio/F_spio_basicWriteRead.F index ffcbb5712b..1efd72cd3c 100644 --- a/src/axom/sidre/tests/spio/F_spio_basicWriteRead.F +++ b/src/axom/sidre/tests/spio/F_spio_basicWriteRead.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/spio/F_spio_blueprintIndex.F b/src/axom/sidre/tests/spio/F_spio_blueprintIndex.F index 93862d9d51..6955f52029 100644 --- a/src/axom/sidre/tests/spio/F_spio_blueprintIndex.F +++ b/src/axom/sidre/tests/spio/F_spio_blueprintIndex.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/spio/F_spio_externalWriteRead.F b/src/axom/sidre/tests/spio/F_spio_externalWriteRead.F index a6c7e24c9c..0793088be0 100644 --- a/src/axom/sidre/tests/spio/F_spio_externalWriteRead.F +++ b/src/axom/sidre/tests/spio/F_spio_externalWriteRead.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/spio/F_spio_irregularWriteRead.F b/src/axom/sidre/tests/spio/F_spio_irregularWriteRead.F index db3345940f..29fa54dc5f 100644 --- a/src/axom/sidre/tests/spio/F_spio_irregularWriteRead.F +++ b/src/axom/sidre/tests/spio/F_spio_irregularWriteRead.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/spio/F_spio_parallelWriteRead.F b/src/axom/sidre/tests/spio/F_spio_parallelWriteRead.F index eff1c066cb..34abd37d09 100644 --- a/src/axom/sidre/tests/spio/F_spio_parallelWriteRead.F +++ b/src/axom/sidre/tests/spio/F_spio_parallelWriteRead.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/spio/F_spio_preserveWriteRead.F b/src/axom/sidre/tests/spio/F_spio_preserveWriteRead.F index 59751ee5e1..170a2e9b1a 100644 --- a/src/axom/sidre/tests/spio/F_spio_preserveWriteRead.F +++ b/src/axom/sidre/tests/spio/F_spio_preserveWriteRead.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/sidre/tests/spio/spio_basic.hpp b/src/axom/sidre/tests/spio/spio_basic.hpp index d1ec7dddc7..161f13a426 100644 --- a/src/axom/sidre/tests/spio/spio_basic.hpp +++ b/src/axom/sidre/tests/spio/spio_basic.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -7,6 +7,7 @@ #include "axom/sidre/spio/IOManager.hpp" #include "axom/sidre/spio/IOBaton.hpp" +#include "axom/fmt.hpp" #include "mpi.h" @@ -29,13 +30,12 @@ TEST(spio_basic, root_name) protocolMap["json"] = "json"; protocolMap["sidre_conduit_json"] = "conduit_json"; - typedef std::map::const_iterator MapIt; - for(MapIt it = protocolMap.begin(); it != protocolMap.end(); ++it) + for(const auto& kv : protocolMap) { - const std::string& sidreProtocol = it->first; - const std::string& expRelayProtocol = it->second; + const std::string& sidreProtocol = kv.first; + const std::string& expRelayProtocol = kv.second; - std::string relayProtocol = + const std::string relayProtocol = IOManager::correspondingRelayProtocol(sidreProtocol); EXPECT_EQ(expRelayProtocol, relayProtocol); @@ -117,11 +117,9 @@ TEST(spio_basic, baton) // Test baton for different numbers of files for(int nFiles = 1; nFiles <= num_ranks; ++nFiles) { - std::stringstream sstr; - sstr << "Checking baton for " << nFiles << " files " - << " with " << num_ranks << " ranks"; - - SCOPED_TRACE(sstr.str()); + SCOPED_TRACE(axom::fmt::format("Checking baton for {} files with {} ranks", + nFiles, + num_ranks)); checkBaton(nFiles, num_ranks, my_rank); } } diff --git a/src/axom/sidre/tests/spio/spio_main.cpp b/src/axom/sidre/tests/spio/spio_main.cpp index 11444951b6..a3c7b57ca7 100644 --- a/src/axom/sidre/tests/spio/spio_main.cpp +++ b/src/axom/sidre/tests/spio/spio_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -9,14 +9,11 @@ #include "axom/config.hpp" #include "axom/slic.hpp" +#include "axom/sidre.hpp" namespace { -#ifdef AXOM_USE_HDF5 -const std::string PROTOCOL = "sidre_hdf5"; -#else -const std::string PROTOCOL = "sidre_json"; -#endif +const std::string PROTOCOL = axom::sidre::Group::getDefaultIOProtocol(); const std::string ROOT_EXT = ".root"; } // namespace diff --git a/src/axom/sidre/tests/spio/spio_parallel.hpp b/src/axom/sidre/tests/spio/spio_parallel.hpp index 888ad4029b..974e7d5241 100644 --- a/src/axom/sidre/tests/spio/spio_parallel.hpp +++ b/src/axom/sidre/tests/spio/spio_parallel.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -19,12 +19,10 @@ #include "gtest/gtest.h" // _parallel_io_headers_start -#include "axom/config.hpp" // for AXOM_USE_HDF5 +#include "axom/config.hpp" #include "conduit_blueprint.hpp" - #include "conduit_relay.hpp" - #ifdef AXOM_USE_HDF5 #include "conduit_relay_io_hdf5.hpp" #endif @@ -250,10 +248,7 @@ TEST(spio_parallel, write_read_write) MPI_Comm_size(MPI_COMM_WORLD, &num_ranks); const int num_files = numOutputFiles(num_ranks); - - std::stringstream sstr; - sstr << "out_spio_WRW_" << num_ranks; - std::string filename = sstr.str(); + const std::string filename = axom::fmt::format("out_spio_WRW_{}", num_ranks); // Initialize a datastore and dump to disk DataStore* ds = new DataStore(); @@ -280,6 +275,8 @@ TEST(spio_parallel, write_read_write) // minor: Unable to open file IOManager writer_b(MPI_COMM_WORLD); writer_b.write(ds_r.getRoot(), num_files, filename, PROTOCOL); + + delete ds; } //------------------------------------------------------------------------------ @@ -329,7 +326,7 @@ TEST(spio_parallel, external_writeread) /* * Contents of the DataStore written to files with IOManager. */ - int num_files = num_output; + const int num_files = num_output; IOManager writer(MPI_COMM_WORLD); const std::string file_name = "out_spio_external_write_read"; diff --git a/src/axom/sidre/tests/spio/spio_serial.hpp b/src/axom/sidre/tests/spio/spio_serial.hpp index 34b60d82ce..ccbb74d17b 100644 --- a/src/axom/sidre/tests/spio/spio_serial.hpp +++ b/src/axom/sidre/tests/spio/spio_serial.hpp @@ -1,13 +1,14 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) #include "gtest/gtest.h" -#include "axom/config.hpp" // for AXOM_USE_HDF5 -#include "axom/core/Types.hpp" // for common::std::int64_t +#include "axom/config.hpp" #include "axom/sidre.hpp" +#include "axom/fmt.hpp" + #include #include "mpi.h" @@ -16,8 +17,6 @@ using axom::sidre::DataStore; using axom::sidre::Group; using axom::sidre::IOManager; -using std::int64_t; - //------------------------------------------------------------------------------ TEST(spio_serial, basic_writeread) @@ -36,7 +35,7 @@ TEST(spio_serial, basic_writeread) ga->createViewScalar("i0", 101); gb->createViewScalar("i1", 404); - int num_files = 1; + const int num_files = 1; IOManager writer(MPI_COMM_WORLD); const std::string file_name = "out_spio_basic_write_read"; @@ -83,12 +82,8 @@ TEST(spio_serial, basic_writeread_protocols) protocols.push_back("sidre_conduit_json"); protocols.push_back("sidre_json"); - for(std::list::const_iterator itr = protocols.begin(); - itr != protocols.end(); - ++itr) + for(const auto& protocol : protocols) { - const std::string& protocol = *itr; - DataStore* ds1 = new DataStore(); Group* root1 = ds1->getRoot(); @@ -103,7 +98,7 @@ TEST(spio_serial, basic_writeread_protocols) ga->createViewScalar("i0", 101); gb->createViewScalar("i1", 404); - int num_files = 1; + const int num_files = 1; IOManager writer(MPI_COMM_WORLD); const std::string file_name = "out_spio_basic_write_read" + protocol; @@ -144,10 +139,8 @@ TEST(spio_serial, write_read_write) MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); MPI_Comm_size(MPI_COMM_WORLD, &num_ranks); - int num_files = std::max(num_ranks / 2, 1); - std::stringstream sstr; - sstr << "out_spio_WRW_" << num_ranks; - std::string filename = sstr.str(); + const int num_files = std::max(num_ranks / 2, 1); + const std::string filename = axom::fmt::format("out_spio_WRW_{}", num_ranks); // Initialize a datastore and dump to disk DataStore* ds = new DataStore(); @@ -174,6 +167,8 @@ TEST(spio_serial, write_read_write) // minor: Unable to open file IOManager writer_b(MPI_COMM_WORLD); writer_b.write(ds_r.getRoot(), num_files, filename, PROTOCOL); + + delete ds; } //------------------------------------------------------------------------------ @@ -221,5 +216,7 @@ TEST(spio_serial, rootfile_suffix) ds->getRoot()->getView("grp/i")->getData()); EXPECT_EQ(ds_suffix.getRoot()->getView("grp/i")->getData(), ds_nosuffix.getRoot()->getView("grp/i")->getData()); + + delete ds; } #endif // AXOM_USE_HDF5 diff --git a/src/axom/slam/BitSet.cpp b/src/axom/slam/BitSet.cpp index 4c83f01b95..92bc87587c 100644 --- a/src/axom/slam/BitSet.cpp +++ b/src/axom/slam/BitSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -59,7 +59,7 @@ int BitSet::count() const for(int i = 0; i < m_data.size(); ++i) { - ctr += axom::utilities::popCount(m_data[i]); + ctr += axom::utilities::popcount(m_data[i]); } return ctr; } @@ -130,7 +130,7 @@ BitSet::Index BitSet::find_next(Index idx) const if(startWord != Word(0)) { return (startWordIdx * BitsPerWord) + - axom::utilities::trailingZeros(startWord << startOffset); + axom::utilities::countr_zero(startWord << startOffset); } ++startWordIdx; @@ -142,7 +142,7 @@ BitSet::Index BitSet::find_next(Index idx) const const Word& w = m_data[i]; if(w != Word(0)) { - return (i * BitsPerWord) + axom::utilities::trailingZeros(w); + return (i * BitsPerWord) + axom::utilities::countr_zero(w); } } return BitSet::npos; diff --git a/src/axom/slam/BitSet.hpp b/src/axom/slam/BitSet.hpp index 1c1a1d085b..0d8af38d03 100644 --- a/src/axom/slam/BitSet.hpp +++ b/src/axom/slam/BitSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/BivariateMap.hpp b/src/axom/slam/BivariateMap.hpp index a5d899d0d7..6afe7cd6fd 100644 --- a/src/axom/slam/BivariateMap.hpp +++ b/src/axom/slam/BivariateMap.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/BivariateSet.hpp b/src/axom/slam/BivariateSet.hpp index 72d2804ad4..0156928fd8 100644 --- a/src/axom/slam/BivariateSet.hpp +++ b/src/axom/slam/BivariateSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/CMakeLists.txt b/src/axom/slam/CMakeLists.txt index 79df250ca7..f25056ae2e 100644 --- a/src/axom/slam/CMakeLists.txt +++ b/src/axom/slam/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/DynamicConstantRelation.hpp b/src/axom/slam/DynamicConstantRelation.hpp index a5a3f0779e..7b78dcab25 100644 --- a/src/axom/slam/DynamicConstantRelation.hpp +++ b/src/axom/slam/DynamicConstantRelation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/DynamicMap.hpp b/src/axom/slam/DynamicMap.hpp index 9cbc9846a4..ee8d6b4e51 100644 --- a/src/axom/slam/DynamicMap.hpp +++ b/src/axom/slam/DynamicMap.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/DynamicSet.hpp b/src/axom/slam/DynamicSet.hpp index 20ae79cbb9..c63c592ce5 100644 --- a/src/axom/slam/DynamicSet.hpp +++ b/src/axom/slam/DynamicSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/DynamicVariableRelation.cpp b/src/axom/slam/DynamicVariableRelation.cpp index f97c26daff..a6485fa026 100644 --- a/src/axom/slam/DynamicVariableRelation.cpp +++ b/src/axom/slam/DynamicVariableRelation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/DynamicVariableRelation.hpp b/src/axom/slam/DynamicVariableRelation.hpp index 3c82bf2bd4..d10f02bdfe 100644 --- a/src/axom/slam/DynamicVariableRelation.hpp +++ b/src/axom/slam/DynamicVariableRelation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/FieldRegistry.hpp b/src/axom/slam/FieldRegistry.hpp index f8c7b24a0f..048c01a7e2 100644 --- a/src/axom/slam/FieldRegistry.hpp +++ b/src/axom/slam/FieldRegistry.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/IndirectionSet.hpp b/src/axom/slam/IndirectionSet.hpp index 2d5858e4df..190f5e8385 100644 --- a/src/axom/slam/IndirectionSet.hpp +++ b/src/axom/slam/IndirectionSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/Map.hpp b/src/axom/slam/Map.hpp index 58a3de1bcc..2d4c56b356 100644 --- a/src/axom/slam/Map.hpp +++ b/src/axom/slam/Map.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/MapBase.hpp b/src/axom/slam/MapBase.hpp index b65be121b6..603f742fed 100644 --- a/src/axom/slam/MapBase.hpp +++ b/src/axom/slam/MapBase.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/ModularInt.hpp b/src/axom/slam/ModularInt.hpp index 32092283ff..cf93a69790 100644 --- a/src/axom/slam/ModularInt.hpp +++ b/src/axom/slam/ModularInt.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/NullSet.hpp b/src/axom/slam/NullSet.hpp index d357fe423f..afcf29e68d 100644 --- a/src/axom/slam/NullSet.hpp +++ b/src/axom/slam/NullSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/OrderedSet.cpp b/src/axom/slam/OrderedSet.cpp index 061d07a4fd..22168e1c0e 100644 --- a/src/axom/slam/OrderedSet.cpp +++ b/src/axom/slam/OrderedSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/OrderedSet.hpp b/src/axom/slam/OrderedSet.hpp index 9d2c940b8f..267b0b9c9b 100644 --- a/src/axom/slam/OrderedSet.hpp +++ b/src/axom/slam/OrderedSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/ProductSet.hpp b/src/axom/slam/ProductSet.hpp index 18b35f0c63..36d2ba995a 100644 --- a/src/axom/slam/ProductSet.hpp +++ b/src/axom/slam/ProductSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/RangeSet.hpp b/src/axom/slam/RangeSet.hpp index ea067b450c..fb9252e8d8 100644 --- a/src/axom/slam/RangeSet.hpp +++ b/src/axom/slam/RangeSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/Relation.hpp b/src/axom/slam/Relation.hpp index 913761f749..7300f7493d 100644 --- a/src/axom/slam/Relation.hpp +++ b/src/axom/slam/Relation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/RelationSet.hpp b/src/axom/slam/RelationSet.hpp index 4afe95398e..4dc35e8b30 100644 --- a/src/axom/slam/RelationSet.hpp +++ b/src/axom/slam/RelationSet.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/Set.hpp b/src/axom/slam/Set.hpp index b7af6a72b6..a2f8c7dc35 100644 --- a/src/axom/slam/Set.hpp +++ b/src/axom/slam/Set.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/StaticRelation.hpp b/src/axom/slam/StaticRelation.hpp index 98688992a0..a3ba2fb62d 100644 --- a/src/axom/slam/StaticRelation.hpp +++ b/src/axom/slam/StaticRelation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/SubMap.hpp b/src/axom/slam/SubMap.hpp index 2ebe1c575e..60a711dd85 100644 --- a/src/axom/slam/SubMap.hpp +++ b/src/axom/slam/SubMap.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/Utilities.hpp b/src/axom/slam/Utilities.hpp index df82733fa5..aa92235e8a 100644 --- a/src/axom/slam/Utilities.hpp +++ b/src/axom/slam/Utilities.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/benchmarks/CMakeLists.txt b/src/axom/slam/benchmarks/CMakeLists.txt index 6cf19a9af3..cbf3b4084a 100644 --- a/src/axom/slam/benchmarks/CMakeLists.txt +++ b/src/axom/slam/benchmarks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/benchmarks/slam_array.cpp b/src/axom/slam/benchmarks/slam_array.cpp index 1c848e732d..106c1bb24c 100644 --- a/src/axom/slam/benchmarks/slam_array.cpp +++ b/src/axom/slam/benchmarks/slam_array.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/benchmarks/slam_sets.cpp b/src/axom/slam/benchmarks/slam_sets.cpp index 42a6f8b1ca..9306fed52a 100644 --- a/src/axom/slam/benchmarks/slam_sets.cpp +++ b/src/axom/slam/benchmarks/slam_sets.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/docs/sphinx/core_concepts.rst b/src/axom/slam/docs/sphinx/core_concepts.rst index f0bd70c219..8354fc9b2d 100644 --- a/src/axom/slam/docs/sphinx/core_concepts.rst +++ b/src/axom/slam/docs/sphinx/core_concepts.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/docs/sphinx/examples.rst b/src/axom/slam/docs/sphinx/examples.rst index 15429fda7b..cf980c8485 100644 --- a/src/axom/slam/docs/sphinx/examples.rst +++ b/src/axom/slam/docs/sphinx/examples.rst @@ -1,6 +1,6 @@ :orphan: -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/docs/sphinx/first_example.rst b/src/axom/slam/docs/sphinx/first_example.rst index 2fc34bbdeb..412e4d7f43 100644 --- a/src/axom/slam/docs/sphinx/first_example.rst +++ b/src/axom/slam/docs/sphinx/first_example.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/docs/sphinx/implementation_details.rst b/src/axom/slam/docs/sphinx/implementation_details.rst index dbc838df1c..7257156291 100644 --- a/src/axom/slam/docs/sphinx/implementation_details.rst +++ b/src/axom/slam/docs/sphinx/implementation_details.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/docs/sphinx/index.rst b/src/axom/slam/docs/sphinx/index.rst index e34bcbee3b..f6b26c4c85 100644 --- a/src/axom/slam/docs/sphinx/index.rst +++ b/src/axom/slam/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/docs/sphinx/more.rst b/src/axom/slam/docs/sphinx/more.rst index 278f5c5455..a64e278cf4 100644 --- a/src/axom/slam/docs/sphinx/more.rst +++ b/src/axom/slam/docs/sphinx/more.rst @@ -1,6 +1,6 @@ :orphan: -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/CMakeLists.txt b/src/axom/slam/examples/CMakeLists.txt index 5050676050..67099a9fa7 100644 --- a/src/axom/slam/examples/CMakeLists.txt +++ b/src/axom/slam/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/HandleMesh.cpp b/src/axom/slam/examples/HandleMesh.cpp index d3384c7ab0..7a3da8eed1 100644 --- a/src/axom/slam/examples/HandleMesh.cpp +++ b/src/axom/slam/examples/HandleMesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/PolicyPrototype.cpp b/src/axom/slam/examples/PolicyPrototype.cpp index 5e5c93f035..ebf615e857 100644 --- a/src/axom/slam/examples/PolicyPrototype.cpp +++ b/src/axom/slam/examples/PolicyPrototype.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/ShockTube.cpp b/src/axom/slam/examples/ShockTube.cpp index da3d78a3d3..3a40d99a41 100644 --- a/src/axom/slam/examples/ShockTube.cpp +++ b/src/axom/slam/examples/ShockTube.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/UnstructMeshField.cpp b/src/axom/slam/examples/UnstructMeshField.cpp index 3ac3646ec3..6e4962c006 100644 --- a/src/axom/slam/examples/UnstructMeshField.cpp +++ b/src/axom/slam/examples/UnstructMeshField.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/UserDocs.cpp b/src/axom/slam/examples/UserDocs.cpp index bc6e6e126d..50664862de 100644 --- a/src/axom/slam/examples/UserDocs.cpp +++ b/src/axom/slam/examples/UserDocs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/lulesh2.0.3/CMakeLists.txt b/src/axom/slam/examples/lulesh2.0.3/CMakeLists.txt index fb160701f0..ad9b2d6ecb 100644 --- a/src/axom/slam/examples/lulesh2.0.3/CMakeLists.txt +++ b/src/axom/slam/examples/lulesh2.0.3/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -47,7 +47,7 @@ if(AXOM_ENABLE_TESTS) axom_add_test(NAME slam_lulesh COMMAND slam_lulesh_ex NUM_MPI_TASKS 8 - NUM_OMP_THREADS 4 ) + NUM_OMP_THREADS 1 ) else() axom_add_test(NAME slam_lulesh COMMAND slam_lulesh_ex diff --git a/src/axom/slam/examples/lulesh2.0.3/lulesh-comm.cpp b/src/axom/slam/examples/lulesh2.0.3/lulesh-comm.cpp index 2720675e1c..e329a79de1 100644 --- a/src/axom/slam/examples/lulesh2.0.3/lulesh-comm.cpp +++ b/src/axom/slam/examples/lulesh2.0.3/lulesh-comm.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/lulesh2.0.3/lulesh-init.cpp b/src/axom/slam/examples/lulesh2.0.3/lulesh-init.cpp index 6d9572dd03..a130ec7f6b 100644 --- a/src/axom/slam/examples/lulesh2.0.3/lulesh-init.cpp +++ b/src/axom/slam/examples/lulesh2.0.3/lulesh-init.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -208,6 +208,14 @@ namespace slamLulesh { } // End constructor +Domain::~Domain() +{ +#ifdef AXOM_USE_MPI + delete [] commDataSend; + delete [] commDataRecv; +#endif +} + //////////////////////////////////////////////////////////////////////////////// void Domain::BuildMesh(Int_t nx, Int_t edgeNodes, Int_t edgeElems) diff --git a/src/axom/slam/examples/lulesh2.0.3/lulesh-util.cpp b/src/axom/slam/examples/lulesh2.0.3/lulesh-util.cpp index cd48b48c6b..045ab25e29 100644 --- a/src/axom/slam/examples/lulesh2.0.3/lulesh-util.cpp +++ b/src/axom/slam/examples/lulesh2.0.3/lulesh-util.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/lulesh2.0.3/lulesh-viz.cpp b/src/axom/slam/examples/lulesh2.0.3/lulesh-viz.cpp index a7e4e3d4ff..ac80488332 100644 --- a/src/axom/slam/examples/lulesh2.0.3/lulesh-viz.cpp +++ b/src/axom/slam/examples/lulesh2.0.3/lulesh-viz.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/lulesh2.0.3/lulesh.cpp b/src/axom/slam/examples/lulesh2.0.3/lulesh.cpp index 198d145279..b97f108fa1 100644 --- a/src/axom/slam/examples/lulesh2.0.3/lulesh.cpp +++ b/src/axom/slam/examples/lulesh2.0.3/lulesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/lulesh2.0.3/lulesh.hpp b/src/axom/slam/examples/lulesh2.0.3/lulesh.hpp index 61741c5de6..77c45757b5 100644 --- a/src/axom/slam/examples/lulesh2.0.3/lulesh.hpp +++ b/src/axom/slam/examples/lulesh2.0.3/lulesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -205,6 +205,10 @@ namespace slamLulesh { Index_t rowLoc, Index_t planeLoc, Index_t nx, Int_t tp, Int_t nr, Int_t balance, Int_t cost); + + // Destructor + ~Domain(); + // // ALLOCATION // @@ -497,8 +501,8 @@ namespace slamLulesh { #ifdef AXOM_USE_MPI // Communication Work space - Real_t *commDataSend; - Real_t *commDataRecv; + Real_t *commDataSend {nullptr}; + Real_t *commDataRecv {nullptr}; // Maximum number of block neighbors MPI_Request recvRequest[26]; // 6 faces + 12 edges + 8 corners diff --git a/src/axom/slam/examples/lulesh2.0.3/lulesh_tuple.hpp b/src/axom/slam/examples/lulesh2.0.3/lulesh_tuple.hpp index 8e83dbc052..e48294e718 100644 --- a/src/axom/slam/examples/lulesh2.0.3/lulesh_tuple.hpp +++ b/src/axom/slam/examples/lulesh2.0.3/lulesh_tuple.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/lulesh2.0.3_orig/CMakeLists.txt b/src/axom/slam/examples/lulesh2.0.3_orig/CMakeLists.txt index 75e5d14b0d..72f7f9f76c 100644 --- a/src/axom/slam/examples/lulesh2.0.3_orig/CMakeLists.txt +++ b/src/axom/slam/examples/lulesh2.0.3_orig/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/CMakeLists.txt b/src/axom/slam/examples/tinyHydro/CMakeLists.txt index b5e2d0e295..4a60d721f1 100644 --- a/src/axom/slam/examples/tinyHydro/CMakeLists.txt +++ b/src/axom/slam/examples/tinyHydro/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/HydroC.cpp b/src/axom/slam/examples/tinyHydro/HydroC.cpp index c0b813c9e8..ecb85f5fb8 100644 --- a/src/axom/slam/examples/tinyHydro/HydroC.cpp +++ b/src/axom/slam/examples/tinyHydro/HydroC.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/HydroC.hpp b/src/axom/slam/examples/tinyHydro/HydroC.hpp index c0ae6ce330..7d0f369ce3 100644 --- a/src/axom/slam/examples/tinyHydro/HydroC.hpp +++ b/src/axom/slam/examples/tinyHydro/HydroC.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/Part.cpp b/src/axom/slam/examples/tinyHydro/Part.cpp index add0c83119..5e7d5d1764 100644 --- a/src/axom/slam/examples/tinyHydro/Part.cpp +++ b/src/axom/slam/examples/tinyHydro/Part.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/Part.hpp b/src/axom/slam/examples/tinyHydro/Part.hpp index 847060def2..e8a2a7c6ae 100644 --- a/src/axom/slam/examples/tinyHydro/Part.hpp +++ b/src/axom/slam/examples/tinyHydro/Part.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/PolygonMeshXY.cpp b/src/axom/slam/examples/tinyHydro/PolygonMeshXY.cpp index fa843789af..4a27837a37 100644 --- a/src/axom/slam/examples/tinyHydro/PolygonMeshXY.cpp +++ b/src/axom/slam/examples/tinyHydro/PolygonMeshXY.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/PolygonMeshXY.hpp b/src/axom/slam/examples/tinyHydro/PolygonMeshXY.hpp index f13386ca53..69cc62fccf 100644 --- a/src/axom/slam/examples/tinyHydro/PolygonMeshXY.hpp +++ b/src/axom/slam/examples/tinyHydro/PolygonMeshXY.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/State.cpp b/src/axom/slam/examples/tinyHydro/State.cpp index 5db3b41dea..d6182ea060 100644 --- a/src/axom/slam/examples/tinyHydro/State.cpp +++ b/src/axom/slam/examples/tinyHydro/State.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/State.hpp b/src/axom/slam/examples/tinyHydro/State.hpp index 9ca89a7159..a9e4dc3324 100644 --- a/src/axom/slam/examples/tinyHydro/State.hpp +++ b/src/axom/slam/examples/tinyHydro/State.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/TinyHydroTypes.cpp b/src/axom/slam/examples/tinyHydro/TinyHydroTypes.cpp index fad7baada7..cff8896119 100644 --- a/src/axom/slam/examples/tinyHydro/TinyHydroTypes.cpp +++ b/src/axom/slam/examples/tinyHydro/TinyHydroTypes.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/TinyHydroTypes.hpp b/src/axom/slam/examples/tinyHydro/TinyHydroTypes.hpp index 28a23d27ba..128c23480c 100644 --- a/src/axom/slam/examples/tinyHydro/TinyHydroTypes.hpp +++ b/src/axom/slam/examples/tinyHydro/TinyHydroTypes.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/VectorXY.hpp b/src/axom/slam/examples/tinyHydro/VectorXY.hpp index 5250798ac8..cbaed8abfb 100644 --- a/src/axom/slam/examples/tinyHydro/VectorXY.hpp +++ b/src/axom/slam/examples/tinyHydro/VectorXY.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_sedovTwoPart.cpp b/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_sedovTwoPart.cpp index 52c92ba323..092aa0f452 100644 --- a/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_sedovTwoPart.cpp +++ b/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_sedovTwoPart.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_sod1DTwoPart.cpp b/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_sod1DTwoPart.cpp index 7015ba340f..ed6b8592c2 100644 --- a/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_sod1DTwoPart.cpp +++ b/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_sod1DTwoPart.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_unitTests.cpp b/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_unitTests.cpp index 2607bc11f3..63763d050e 100644 --- a/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_unitTests.cpp +++ b/src/axom/slam/examples/tinyHydro/tests/slam_tinyHydro_unitTests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/mesh_struct/IA.hpp b/src/axom/slam/mesh_struct/IA.hpp index 7781cf8f60..ac6be95bd8 100644 --- a/src/axom/slam/mesh_struct/IA.hpp +++ b/src/axom/slam/mesh_struct/IA.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/mesh_struct/IA_impl.hpp b/src/axom/slam/mesh_struct/IA_impl.hpp index 7c7fb782c2..1375776c7c 100644 --- a/src/axom/slam/mesh_struct/IA_impl.hpp +++ b/src/axom/slam/mesh_struct/IA_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -667,7 +667,7 @@ void IAMesh::fixVertexNeighborhood( { // Add all element-face associations to an array; // we'll update the adjacencies outside this loop - FaceLinkVerts face_link_verts; + FaceLinkVerts face_link_verts {}; for(int i = 0, idx = 0; i < TDIM; ++i) { if(i != vert_i && // i is a vertex in face_i diff --git a/src/axom/slam/policies/BivariateSetInterfacePolicies.hpp b/src/axom/slam/policies/BivariateSetInterfacePolicies.hpp index 4c39f9125b..e96083beea 100644 --- a/src/axom/slam/policies/BivariateSetInterfacePolicies.hpp +++ b/src/axom/slam/policies/BivariateSetInterfacePolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/CardinalityPolicies.hpp b/src/axom/slam/policies/CardinalityPolicies.hpp index 54d07ec0cc..f63fd23661 100644 --- a/src/axom/slam/policies/CardinalityPolicies.hpp +++ b/src/axom/slam/policies/CardinalityPolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/IndirectionPolicies.hpp b/src/axom/slam/policies/IndirectionPolicies.hpp index bf843d3a8e..4ab9c87d3b 100644 --- a/src/axom/slam/policies/IndirectionPolicies.hpp +++ b/src/axom/slam/policies/IndirectionPolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/InterfacePolicies.hpp b/src/axom/slam/policies/InterfacePolicies.hpp index fc88318764..626aea75e7 100644 --- a/src/axom/slam/policies/InterfacePolicies.hpp +++ b/src/axom/slam/policies/InterfacePolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/MapInterfacePolicies.hpp b/src/axom/slam/policies/MapInterfacePolicies.hpp index 75b231b2f3..de89c2bae1 100644 --- a/src/axom/slam/policies/MapInterfacePolicies.hpp +++ b/src/axom/slam/policies/MapInterfacePolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/OffsetPolicies.hpp b/src/axom/slam/policies/OffsetPolicies.hpp index 09ac3d0a15..949df3bef6 100644 --- a/src/axom/slam/policies/OffsetPolicies.hpp +++ b/src/axom/slam/policies/OffsetPolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/PolicyTraits.hpp b/src/axom/slam/policies/PolicyTraits.hpp index e372d0388f..9e790c1f7f 100644 --- a/src/axom/slam/policies/PolicyTraits.hpp +++ b/src/axom/slam/policies/PolicyTraits.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/SetInterfacePolicies.hpp b/src/axom/slam/policies/SetInterfacePolicies.hpp index 6b3d48a6fe..05fce845db 100644 --- a/src/axom/slam/policies/SetInterfacePolicies.hpp +++ b/src/axom/slam/policies/SetInterfacePolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/SizePolicies.hpp b/src/axom/slam/policies/SizePolicies.hpp index bd88416f59..e9ea27399a 100644 --- a/src/axom/slam/policies/SizePolicies.hpp +++ b/src/axom/slam/policies/SizePolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/StridePolicies.hpp b/src/axom/slam/policies/StridePolicies.hpp index fc0615c1a9..d023303448 100644 --- a/src/axom/slam/policies/StridePolicies.hpp +++ b/src/axom/slam/policies/StridePolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/policies/SubsettingPolicies.hpp b/src/axom/slam/policies/SubsettingPolicies.hpp index fd6e44d31c..3418c33da0 100644 --- a/src/axom/slam/policies/SubsettingPolicies.hpp +++ b/src/axom/slam/policies/SubsettingPolicies.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/CMakeLists.txt b/src/axom/slam/tests/CMakeLists.txt index b8304738f9..8b1b46637c 100644 --- a/src/axom/slam/tests/CMakeLists.txt +++ b/src/axom/slam/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_AccessingRelationDataInMap.cpp b/src/axom/slam/tests/slam_AccessingRelationDataInMap.cpp index 025bdd1c78..c5a2104b62 100644 --- a/src/axom/slam/tests/slam_AccessingRelationDataInMap.cpp +++ b/src/axom/slam/tests/slam_AccessingRelationDataInMap.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_IA.cpp b/src/axom/slam/tests/slam_IA.cpp index c03d2322a0..668420cdda 100644 --- a/src/axom/slam/tests/slam_IA.cpp +++ b/src/axom/slam/tests/slam_IA.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_ModularInt.cpp b/src/axom/slam/tests/slam_ModularInt.cpp index 969e87f5f1..ab8fdfd593 100644 --- a/src/axom/slam/tests/slam_ModularInt.cpp +++ b/src/axom/slam/tests/slam_ModularInt.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_map_BivariateMap.cpp b/src/axom/slam/tests/slam_map_BivariateMap.cpp index f972718240..fb4b398fad 100644 --- a/src/axom/slam/tests/slam_map_BivariateMap.cpp +++ b/src/axom/slam/tests/slam_map_BivariateMap.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -51,12 +51,12 @@ using RelationSetType = slam::RelationSet; template using BivariateMapType = slam::BivariateMap; -static const SetPosition MAX_SET_SIZE1 = 10; -static const SetPosition MAX_SET_SIZE2 = 15; +constexpr SetPosition MAX_SET_SIZE1 = 10; +constexpr SetPosition MAX_SET_SIZE2 = 15; -static double const multFac3 = 0000.1; -static double const multFac1 = 1000.0; -static double const multFac2 = 0010.0; +constexpr double multFac3 = 0000.1; +constexpr double multFac1 = 1000.0; +constexpr double multFac2 = 0010.0; } // end anonymous namespace diff --git a/src/axom/slam/tests/slam_map_DynamicMap.cpp b/src/axom/slam/tests/slam_map_DynamicMap.cpp index 8a65c0cdad..ecb1840801 100644 --- a/src/axom/slam/tests/slam_map_DynamicMap.cpp +++ b/src/axom/slam/tests/slam_map_DynamicMap.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -26,7 +26,7 @@ using SetPosition = slam::DefaultPositionType; using SetElement = slam::DefaultElementType; using SetType = slam::DynamicSet; -static const SetPosition MAX_SET_SIZE = 10; +constexpr SetPosition MAX_SET_SIZE = 10; using IntMap = slam::DynamicMap; using RealMap = slam::DynamicMap; diff --git a/src/axom/slam/tests/slam_map_Map.cpp b/src/axom/slam/tests/slam_map_Map.cpp index 3fa933d513..2a76edb221 100644 --- a/src/axom/slam/tests/slam_map_Map.cpp +++ b/src/axom/slam/tests/slam_map_Map.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -31,7 +31,7 @@ using RealMap = slam::Map; template using VecIndirection = policies::STLVectorIndirection; -static SetPosition const MAX_SET_SIZE = 10; +constexpr SetPosition MAX_SET_SIZE = 10; template using CompileTimeStrideType = policies::CompileTimeStride; diff --git a/src/axom/slam/tests/slam_map_SubMap.cpp b/src/axom/slam/tests/slam_map_SubMap.cpp index 99d1c0a125..7770bc44c8 100644 --- a/src/axom/slam/tests/slam_map_SubMap.cpp +++ b/src/axom/slam/tests/slam_map_SubMap.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -41,9 +41,9 @@ using OrderedSetType = axom::slam::OrderedSet< slam::policies::StrideOne, slam::policies::STLVectorIndirection>; -static const double multFac = 1.0001; +constexpr double multFac = 1.0001; -static PositionType const MAX_SET_SIZE = 10; +PositionType const MAX_SET_SIZE = 10; template T getValue(int idx) diff --git a/src/axom/slam/tests/slam_relation_DynamicConstant.cpp b/src/axom/slam/tests/slam_relation_DynamicConstant.cpp index 8413208af8..fe9157d694 100644 --- a/src/axom/slam/tests/slam_relation_DynamicConstant.cpp +++ b/src/axom/slam/tests/slam_relation_DynamicConstant.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_relation_DynamicVariable.cpp b/src/axom/slam/tests/slam_relation_DynamicVariable.cpp index 1c2a76f9fd..11c74f46f9 100644 --- a/src/axom/slam/tests/slam_relation_DynamicVariable.cpp +++ b/src/axom/slam/tests/slam_relation_DynamicVariable.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_relation_StaticConstant.cpp b/src/axom/slam/tests/slam_relation_StaticConstant.cpp index 9329c4e116..441ce4dae2 100644 --- a/src/axom/slam/tests/slam_relation_StaticConstant.cpp +++ b/src/axom/slam/tests/slam_relation_StaticConstant.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_relation_StaticVariable.cpp b/src/axom/slam/tests/slam_relation_StaticVariable.cpp index 0f7d318f33..8056d4d41b 100644 --- a/src/axom/slam/tests/slam_relation_StaticVariable.cpp +++ b/src/axom/slam/tests/slam_relation_StaticVariable.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_set_BitSet.cpp b/src/axom/slam/tests/slam_set_BitSet.cpp index 0281465a60..e5a8250823 100644 --- a/src/axom/slam/tests/slam_set_BitSet.cpp +++ b/src/axom/slam/tests/slam_set_BitSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_set_BivariateSet.cpp b/src/axom/slam/tests/slam_set_BivariateSet.cpp index 9cf1c45cc0..1169e086c3 100644 --- a/src/axom/slam/tests/slam_set_BivariateSet.cpp +++ b/src/axom/slam/tests/slam_set_BivariateSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -26,11 +26,11 @@ namespace policies = axom::slam::policies; namespace { -static const int SET_SIZE_1 = 5; -static const int SET_SIZE_2 = 16; +constexpr int SET_SIZE_1 = 5; +constexpr int SET_SIZE_2 = 16; -static const int SET_OFFSET_1 = 3; -static const int SET_OFFSET_2 = 2; +constexpr int SET_OFFSET_1 = 3; +constexpr int SET_OFFSET_2 = 2; // Template aliases to simplify specifying some sets and relations template diff --git a/src/axom/slam/tests/slam_set_DynamicSet.cpp b/src/axom/slam/tests/slam_set_DynamicSet.cpp index 577b6d6ccf..6e279748ce 100644 --- a/src/axom/slam/tests/slam_set_DynamicSet.cpp +++ b/src/axom/slam/tests/slam_set_DynamicSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_set_IndirectionSet.cpp b/src/axom/slam/tests/slam_set_IndirectionSet.cpp index f705b02c89..a3b7f1b32d 100644 --- a/src/axom/slam/tests/slam_set_IndirectionSet.cpp +++ b/src/axom/slam/tests/slam_set_IndirectionSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -24,7 +24,7 @@ namespace slam = axom::slam; namespace { -static const int MAX_SET_SIZE = 10; +constexpr int MAX_SET_SIZE = 10; } /** diff --git a/src/axom/slam/tests/slam_set_Iterator.cpp b/src/axom/slam/tests/slam_set_Iterator.cpp index 257f2e11c1..9c38e96a9d 100644 --- a/src/axom/slam/tests/slam_set_Iterator.cpp +++ b/src/axom/slam/tests/slam_set_Iterator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -41,7 +41,7 @@ using RangeSet = slam::RangeSet; using VectorSet = slam::VectorIndirectionSet; using CArraySet = slam::CArrayIndirectionSet; -static const int SET_SIZE = 10; +constexpr int SET_SIZE = 10; /// Utility function to initialize a set for the test data /// Specialized for each set type diff --git a/src/axom/slam/tests/slam_set_NullSet.cpp b/src/axom/slam/tests/slam_set_NullSet.cpp index 935f19863e..8f7e1ad95d 100644 --- a/src/axom/slam/tests/slam_set_NullSet.cpp +++ b/src/axom/slam/tests/slam_set_NullSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slam/tests/slam_set_PositionSet.cpp b/src/axom/slam/tests/slam_set_PositionSet.cpp index 719cffa023..34d85d0c24 100644 --- a/src/axom/slam/tests/slam_set_PositionSet.cpp +++ b/src/axom/slam/tests/slam_set_PositionSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -27,7 +27,7 @@ using SetType = axom::slam::PositionSet<>; using SetPosition = SetType::PositionType; using SetElement = SetType::ElementType; -static const SetPosition MAX_SET_SIZE = 10; +constexpr SetPosition MAX_SET_SIZE = 10; } // end anonymous namespace diff --git a/src/axom/slam/tests/slam_set_RangeSet.cpp b/src/axom/slam/tests/slam_set_RangeSet.cpp index c6f7abb152..bfa4c768d3 100644 --- a/src/axom/slam/tests/slam_set_RangeSet.cpp +++ b/src/axom/slam/tests/slam_set_RangeSet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -32,10 +32,10 @@ using SetType = axom::slam::RangeSet<>; using SetPosition = SetType::PositionType; using SetElement = SetType::ElementType; -static const SetPosition MAX_SIZE = 20; -static const SetElement lowerIndex = static_cast(.3 * MAX_SIZE); -static const SetElement upperIndex = static_cast(.7 * MAX_SIZE); -static const SetElement range = upperIndex - lowerIndex; +constexpr SetPosition MAX_SIZE = 20; +constexpr SetElement lowerIndex = static_cast(.3 * MAX_SIZE); +constexpr SetElement upperIndex = static_cast(.7 * MAX_SIZE); +constexpr SetElement range = upperIndex - lowerIndex; } // end anonymous namespace diff --git a/src/axom/slam/tests/slam_set_Set.cpp b/src/axom/slam/tests/slam_set_Set.cpp index d4a4d7358c..bcbe6fa912 100644 --- a/src/axom/slam/tests/slam_set_Set.cpp +++ b/src/axom/slam/tests/slam_set_Set.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,7 +14,7 @@ namespace { -static int const NUM_ELEMS = 5; +constexpr int NUM_ELEMS = 5; namespace slam = axom::slam; using RangeSetType = slam::RangeSet<>; diff --git a/src/axom/slic/CMakeLists.txt b/src/axom/slic/CMakeLists.txt index e1829a67e1..31a7d8f598 100644 --- a/src/axom/slic/CMakeLists.txt +++ b/src/axom/slic/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/core/LogStream.cpp b/src/axom/slic/core/LogStream.cpp index 87fbc70959..17e2efb5c0 100644 --- a/src/axom/slic/core/LogStream.cpp +++ b/src/axom/slic/core/LogStream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/core/LogStream.hpp b/src/axom/slic/core/LogStream.hpp index 8bc809ffe6..f69eb4218e 100644 --- a/src/axom/slic/core/LogStream.hpp +++ b/src/axom/slic/core/LogStream.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -88,6 +88,8 @@ class LogStream * \param [in] line the line within the file at which the message is appended. * \param [in] filter_duplicates optional parameter that indicates whether * duplicate messages resulting from running in parallel will be filtered out. + * /param [in] tag_stream_only optional parameter that indicates whether the + * message will go only to streams bound to tagName. * * \note The following wildcards may be used to ignore a particular field: *
    @@ -101,7 +103,8 @@ class LogStream const std::string& tagName, const std::string& fileName, int line, - bool filter_duplicates) = 0; + bool filter_duplicates, + bool tag_stream_only) = 0; /*! * \brief Outputs the log stream on the current rank to the console. diff --git a/src/axom/slic/core/Logger.cpp b/src/axom/slic/core/Logger.cpp index 3daafc09d9..cf4c820993 100644 --- a/src/axom/slic/core/Logger.cpp +++ b/src/axom/slic/core/Logger.cpp @@ -1,16 +1,14 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) #include "axom/slic/core/Logger.hpp" - #include "axom/slic/core/LogStream.hpp" - -#include "axom/core/utilities/Utilities.hpp" // for utilities::processAbort() +#include "axom/core/utilities/Utilities.hpp" // C/C++ includes -#include // for std::cout, std::cerr +#include namespace axom { @@ -64,17 +62,17 @@ Logger::Logger(const std::string& name) //------------------------------------------------------------------------------ Logger::~Logger() { - std::map::iterator it = m_streamObjectsManager.begin(); - for(; it != m_streamObjectsManager.end(); ++it) + for(auto& kv : m_streamObjectsManager) { - delete it->second; - } // END for all logStreams + delete kv.second; + } for(int level = message::Error; level < message::Num_Levels; ++level) { m_logStreams[level].clear(); + } - } // END for all levels + m_taggedStreams.clear(); } //------------------------------------------------------------------------------ @@ -144,7 +142,33 @@ void Logger::addStreamToMsgLevel(LogStream* ls, } //------------------------------------------------------------------------------ -void Logger::addStreamToAllMsgLevels(LogStream* ls) +void Logger::addStreamToTag(LogStream* ls, + const std::string& tag, + bool pass_ownership) +{ + if(ls == nullptr) + { + std::cerr << "WARNING: supplied log stream is NULL!\n"; + return; + } + + if(m_taggedStreams.find(tag) == m_taggedStreams.end()) + { + m_taggedStreams[tag] = std::vector {ls}; + } + else + { + m_taggedStreams[tag].push_back(ls); + } + + if(pass_ownership) + { + m_streamObjectsManager[ls] = ls; + } +} + +//------------------------------------------------------------------------------ +void Logger::addStreamToAllMsgLevels(LogStream* ls, bool pass_ownership) { if(ls == nullptr) { @@ -154,9 +178,36 @@ void Logger::addStreamToAllMsgLevels(LogStream* ls) for(int level = message::Error; level < message::Num_Levels; ++level) { - this->addStreamToMsgLevel(ls, static_cast(level)); + this->addStreamToMsgLevel(ls, + static_cast(level), + pass_ownership); + } +} - } // END for all levels +//------------------------------------------------------------------------------ +void Logger::addStreamToAllTags(LogStream* ls, bool pass_ownership) +{ + if(ls == nullptr) + { + std::cerr << "WARNING: supplied log stream is NULL!\n"; + return; + } + + if(m_taggedStreams.empty()) + { + std::cerr << "WARNING: no tags are available!\n"; + if(pass_ownership) + { + m_streamObjectsManager[ls] = ls; + } + + return; + } + + for(auto& kv : m_taggedStreams) + { + this->addStreamToTag(ls, kv.first, pass_ownership); + } } //------------------------------------------------------------------------------ @@ -165,6 +216,17 @@ int Logger::getNumStreamsAtMsgLevel(message::Level level) return static_cast(m_logStreams[level].size()); } +//------------------------------------------------------------------------------ +int Logger::getNumStreamsWithTag(const std::string& tag) +{ + if(m_taggedStreams.find(tag) == m_taggedStreams.end()) + { + return 0; + } + + return static_cast(m_taggedStreams[tag].size()); +} + //------------------------------------------------------------------------------ LogStream* Logger::getStream(message::Level level, int i) { @@ -177,6 +239,24 @@ LogStream* Logger::getStream(message::Level level, int i) return m_logStreams[level][i]; } +//------------------------------------------------------------------------------ +LogStream* Logger::getStream(const std::string& tag, int i) +{ + if(m_taggedStreams.find(tag) == m_taggedStreams.end()) + { + std::cerr << "ERROR: tag does not exist!\n"; + return nullptr; + } + + if(i < 0 || i >= static_cast(m_taggedStreams[tag].size())) + { + std::cerr << "ERROR: stream index is out-of-bounds!\n"; + return nullptr; + } + + return m_taggedStreams[tag][i]; +} + //------------------------------------------------------------------------------ void Logger::logMessage(message::Level level, const std::string& message, @@ -187,21 +267,24 @@ void Logger::logMessage(message::Level level, MSG_IGNORE_TAG, MSG_IGNORE_FILE, MSG_IGNORE_LINE, - filter_duplicates); + filter_duplicates, + false); } //------------------------------------------------------------------------------ void Logger::logMessage(message::Level level, const std::string& message, const std::string& tagName, - bool filter_duplicates) + bool filter_duplicates, + bool tag_stream_only) { this->logMessage(level, message, tagName, MSG_IGNORE_FILE, MSG_IGNORE_LINE, - filter_duplicates); + filter_duplicates, + tag_stream_only); } //------------------------------------------------------------------------------ @@ -211,7 +294,13 @@ void Logger::logMessage(message::Level level, int line, bool filter_duplicates) { - this->logMessage(level, message, MSG_IGNORE_TAG, fileName, line, filter_duplicates); + this->logMessage(level, + message, + MSG_IGNORE_TAG, + fileName, + line, + filter_duplicates, + false); } //------------------------------------------------------------------------------ @@ -220,24 +309,63 @@ void Logger::logMessage(message::Level level, const std::string& tagName, const std::string& fileName, int line, - bool filter_duplicates) + bool filter_duplicates, + bool tag_stream_only) { - if(m_isEnabled[level] == false) + if(m_isEnabled[level] == false && tag_stream_only == false) + { + return; + } + + if(tag_stream_only == true && tagName == MSG_IGNORE_TAG) { + std::cerr << "ERROR: message for tagged streams does not have a tag!\n"; return; } - unsigned nstreams = static_cast(m_logStreams[level].size()); - for(unsigned istream = 0; istream < nstreams; ++istream) + if(tag_stream_only == true && + m_taggedStreams.find(tagName) == m_taggedStreams.end()) + { + std::cerr << "ERROR: tag does not exist!\n"; + return; + } + + // Message for message levels + if(tag_stream_only == false) + { + unsigned nstreams = static_cast(m_logStreams[level].size()); + for(unsigned istream = 0; istream < nstreams; ++istream) + { + m_logStreams[level][istream]->append(level, + message, + tagName, + fileName, + line, + filter_duplicates, + tag_stream_only); + } + } + + // Message for tagged streams + else { - m_logStreams[level][istream] - ->append(level, message, tagName, fileName, line, filter_duplicates); + for(unsigned int i = 0; i < m_taggedStreams[tagName].size(); i++) + { + m_taggedStreams[tagName][i]->append(level, + message, + tagName, + fileName, + line, + filter_duplicates, + tag_stream_only); + } } } //------------------------------------------------------------------------------ void Logger::outputLocalMessages() { + //Output for all message levels for(int level = message::Error; level < message::Num_Levels; ++level) { unsigned nstreams = static_cast(m_logStreams[level].size()); @@ -248,11 +376,23 @@ void Logger::outputLocalMessages() } // END for all streams } // END for all levels + + // Output for all tagged streams + std::map>::iterator it; + + for(it = m_taggedStreams.begin(); it != m_taggedStreams.end(); it++) + { + for(unsigned int i = 0; i < it->second.size(); i++) + { + it->second[i]->outputLocal(); + } + } } //------------------------------------------------------------------------------ void Logger::flushStreams() { + //Flush for all message levels for(int level = message::Error; level < message::Num_Levels; ++level) { unsigned nstreams = static_cast(m_logStreams[level].size()); @@ -263,11 +403,23 @@ void Logger::flushStreams() } // END for all streams } // END for all levels + + // Flush for all tagged streams + std::map>::iterator it; + + for(it = m_taggedStreams.begin(); it != m_taggedStreams.end(); it++) + { + for(unsigned int i = 0; i < it->second.size(); i++) + { + it->second[i]->flush(); + } + } } //------------------------------------------------------------------------------ void Logger::pushStreams() { + //Push for all message levels for(int level = message::Error; level < message::Num_Levels; ++level) { unsigned nstreams = static_cast(m_logStreams[level].size()); @@ -278,6 +430,17 @@ void Logger::pushStreams() } // END for all streams } // END for all levels + + // Push for all tagged streams + std::map>::iterator it; + + for(it = m_taggedStreams.begin(); it != m_taggedStreams.end(); it++) + { + for(unsigned int i = 0; i < it->second.size(); i++) + { + it->second[i]->push(); + } + } } //------------------------------------------------------------------------------ @@ -361,16 +524,15 @@ bool Logger::activateLogger(const std::string& name) void Logger::finalize() { Loggermap& loggers = getLoggers(); - for(Loggermap::iterator it = loggers.begin(); it != loggers.end(); ++it) + for(auto& kv : loggers) { - it->second->flushStreams(); + kv.second->flushStreams(); } - for(Loggermap::iterator it = loggers.begin(); it != loggers.end(); ++it) + for(auto& kv : loggers) { - delete it->second; + delete kv.second; } - loggers.clear(); getLogger() = nullptr; diff --git a/src/axom/slic/core/Logger.hpp b/src/axom/slic/core/Logger.hpp index 87c3ff8a06..fd52dc4e85 100644 --- a/src/axom/slic/core/Logger.hpp +++ b/src/axom/slic/core/Logger.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -156,11 +156,14 @@ class Logger * \brief Binds the given stream to all the levels for this Logger instance. * * \param [in] ls pointer to the user-supplied LogStream object. + * \param [in] pass_ownership flag that indicates whether the given logger + * instance owns the supplied LogStream object. This parameter is optional. + * Default is true. * * \note The Logger takes ownership of the LogStream object. * \pre ls != NULL. */ - void addStreamToAllMsgLevels(LogStream* ls); + void addStreamToAllMsgLevels(LogStream* ls, bool pass_ownership = true); /*! * \brief Returns the number of streams at the given level. @@ -184,6 +187,58 @@ class Logger */ LogStream* getStream(message::Level level, int i); + /*! + * \brief Binds the given stream to the given tag for this Logger instance. + * + * \param [in] ls pointer to the user-supplied LogStream object. + * \param [in] tag the tag that this stream will be associated with. + * \param [in] pass_ownership flag that indicates whether the given logger + * instance owns the supplied LogStream object. This parameter is optional. + * Default is true. + * + * \note The Logger takes ownership of the LogStream object. + * \pre ls != NULL. + */ + void addStreamToTag(LogStream* ls, + const std::string& tag, + bool pass_ownership = true); + + /*! + * \brief Binds the given stream to all the tags for this Logger instance. + * + * \param [in] ls pointer to the user-supplied LogStream object. + * \param [in] pass_ownership flag that indicates whether the given logger + * instance owns the supplied LogStream object. This parameter is optional. + * Default is true. + * + * \note The Logger takes ownership of the LogStream object. + * \pre ls != NULL. + */ + void addStreamToAllTags(LogStream* ls, bool pass_ownership = true); + + /*! + * \brief Returns the number of streams for a given tag. + * Returns 0 if the tag does not exist. + * + * \param [in] tag the tag in query. + * + * \return N the number of streams for the given tag. + * \post N >= 0 + */ + int getNumStreamsWithTag(const std::string& tag); + + /*! + * \brief Returns the ith stream at the given tag. + * + * \param [in] tag the tag in query. + * \param [in] i the index of the stream in query. + * + * \return stream_ptr pointer to the stream. + * \pre i >= 0 && i < this->getNumStreamsWithTag( tag ) + * \post stream_ptr != NULL. + */ + LogStream* getStream(const std::string& tag, int i); + /*! * \brief Logs the given message to all registered streams. * @@ -206,11 +261,14 @@ class Logger * \param [in] filter_duplicates optional parameter that indicates whether * duplicate messages resulting from running in parallel will be filtered out. * Default is false. + * /param [in] tag_stream_only optional parameter that indicates whether the + * message will go only to streams bound to tagName. Default is false. */ void logMessage(message::Level level, const std::string& message, const std::string& tagName, - bool filter_duplicates = false); + bool filter_duplicates = false, + bool tag_stream_only = false); /*! * \brief Logs the given message to all registered streams. @@ -240,13 +298,16 @@ class Logger * \param [in] filter_duplicates optional parameter that indicates whether * duplicate messages resulting from running in parallel will be filtered out. * Default is false. + * /param [in] tag_stream_only optional parameter that indicates whether the + * message will go only to streams bound to tagName. Default is false. */ void logMessage(message::Level level, const std::string& message, const std::string& tagName, const std::string& fileName, int line, - bool filter_duplicates = false); + bool filter_duplicates = false, + bool tag_stream_only = false); /*! * \brief For the current rank, outputs messages from all streams to the @@ -388,6 +449,7 @@ class Logger std::string m_name; bool m_abortOnError; + std::map> m_taggedStreams; bool m_abortOnWarning; void (*m_abortFunction)(void); diff --git a/src/axom/slic/core/MessageLevel.hpp b/src/axom/slic/core/MessageLevel.hpp index 08fffaca53..1896722e7c 100644 --- a/src/axom/slic/core/MessageLevel.hpp +++ b/src/axom/slic/core/MessageLevel.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/core/SimpleLogger.hpp b/src/axom/slic/core/SimpleLogger.hpp index fe9bd709f1..71ec480f40 100644 --- a/src/axom/slic/core/SimpleLogger.hpp +++ b/src/axom/slic/core/SimpleLogger.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/docs/sphinx/index.rst b/src/axom/slic/docs/sphinx/index.rst index c307ef579f..ac87ce210a 100644 --- a/src/axom/slic/docs/sphinx/index.rst +++ b/src/axom/slic/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/docs/sphinx/sections/appendix.rst b/src/axom/slic/docs/sphinx/sections/appendix.rst index 0670519325..81828a49dc 100644 --- a/src/axom/slic/docs/sphinx/sections/appendix.rst +++ b/src/axom/slic/docs/sphinx/sections/appendix.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -87,6 +87,7 @@ The table below details which SLIC macros are collective: | | ``SLIC_INFO_IF`` | | | | | ``SLIC_INFO_ROOT`` | | | | | ``SLIC_INFO_ROOT_IF`` | | | +| | ``SLIC_INFO_TAGGED`` | | | +----------------------------+----------------------------------------------------------------------------+ | | ``SLIC_ERROR`` | | Collective by default. | | | ``SLIC_ERROR_IF`` | | Collective after calling ``slic::enableAbortOnError()``. | diff --git a/src/axom/slic/docs/sphinx/sections/architecture.rst b/src/axom/slic/docs/sphinx/sections/architecture.rst index 8686823162..7b044f2be6 100644 --- a/src/axom/slic/docs/sphinx/sections/architecture.rst +++ b/src/axom/slic/docs/sphinx/sections/architecture.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/docs/sphinx/sections/citations.rst b/src/axom/slic/docs/sphinx/sections/citations.rst index c37111968a..fda2c87c92 100644 --- a/src/axom/slic/docs/sphinx/sections/citations.rst +++ b/src/axom/slic/docs/sphinx/sections/citations.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/docs/sphinx/sections/getting_started.rst b/src/axom/slic/docs/sphinx/sections/getting_started.rst index 4bac29708c..525c633e5c 100644 --- a/src/axom/slic/docs/sphinx/sections/getting_started.rst +++ b/src/axom/slic/docs/sphinx/sections/getting_started.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -167,6 +167,24 @@ The :ref:`GenericOutputStream`, takes two arguments in its constructor: Slic maintains ownership of all registered :ref:`LogStream` instances and will deallocate them when ``slic::finalize()`` is called. +Step 5.1: Tagged Log Streams +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Slic has limited support for tags, where users can bind streams +to user-defined tags. The bound streams only output messages with the +given tag, disregarding the message's :ref:`logMessageLevel`. The tagged +:ref:`LogStream` can be created by calling ``slic::addStreamToTag()``. + +The following code snippet uses the :ref:`GenericOutputStream` object to +specify ``std::cout`` as the output destination for messages tagged with +the custom tag ``myTag``. + +.. literalinclude:: ../../../examples/basic/logging.cpp + :start-after: SPHINX_SLIC_SET_TAGGED_STREAM_BEGIN + :end-before: SPHINX_SLIC_SET_TAGGED_STREAM_END + :language: C++ + :linenos: + Step 6: Log Messages ^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/axom/slic/docs/sphinx/sections/wrapping_slic_in_macros.rst b/src/axom/slic/docs/sphinx/sections/wrapping_slic_in_macros.rst index 7813d19c61..4efab0bd59 100644 --- a/src/axom/slic/docs/sphinx/sections/wrapping_slic_in_macros.rst +++ b/src/axom/slic/docs/sphinx/sections/wrapping_slic_in_macros.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/CMakeLists.txt b/src/axom/slic/examples/CMakeLists.txt index ca4ee2eb60..fa3c8d6cc2 100644 --- a/src/axom/slic/examples/CMakeLists.txt +++ b/src/axom/slic/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/basic/cpplogger.cpp b/src/axom/slic/examples/basic/cpplogger.cpp index b8627d3004..62b3570b7f 100644 --- a/src/axom/slic/examples/basic/cpplogger.cpp +++ b/src/axom/slic/examples/basic/cpplogger.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/basic/custom_abort_logger.cpp b/src/axom/slic/examples/basic/custom_abort_logger.cpp index 107360f910..ad4484133f 100644 --- a/src/axom/slic/examples/basic/custom_abort_logger.cpp +++ b/src/axom/slic/examples/basic/custom_abort_logger.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/basic/flogger.f b/src/axom/slic/examples/basic/flogger.f index e7c5a9a922..11ebeac549 100644 --- a/src/axom/slic/examples/basic/flogger.f +++ b/src/axom/slic/examples/basic/flogger.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/basic/logging.cpp b/src/axom/slic/examples/basic/logging.cpp index b887e99d88..c4149b427d 100644 --- a/src/axom/slic/examples/basic/logging.cpp +++ b/src/axom/slic/examples/basic/logging.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -26,8 +26,8 @@ int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) // SPHINX_SLIC_FORMAT_MSG_BEGIN std::string format = std::string("\n") + - std::string("[]: \n") + std::string("FILE=\n") + - std::string("LINE=\n\n"); + std::string("[ ]: \n") + + std::string("FILE=\n") + std::string("LINE=\n\n"); // SPHINX_SLIC_FORMAT_MSG_END @@ -42,12 +42,20 @@ int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) // SPHINX_SLIC_SET_STREAM_END + // SPHINX_SLIC_SET_TAGGED_STREAM_BEGIN + slic::addStreamToTag(new slic::GenericOutputStream(&std::cout, format), + "myTag"); + + // SPHINX_SLIC_SET_TAGGED_STREAM_END + // SPHINX_SLIC_LOG_MESSAGES_BEGIN SLIC_DEBUG("Here is a debug message!"); SLIC_INFO("Here is an info mesage!"); SLIC_WARNING("Here is a warning!"); SLIC_ERROR("Here is an error message!"); + SLIC_INFO_TAGGED("Here is a message for tagged streams with tag 'myTag'!", + "myTag"); // SPHINX_SLIC_LOG_MESSAGES_END diff --git a/src/axom/slic/examples/basic/logging_F.f b/src/axom/slic/examples/basic/logging_F.f index 99180f23ed..17a3f920dc 100644 --- a/src/axom/slic/examples/basic/logging_F.f +++ b/src/axom/slic/examples/basic/logging_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/basic/lumberjack_logging.cpp b/src/axom/slic/examples/basic/lumberjack_logging.cpp index 7348ea8227..1d0b8f5a02 100644 --- a/src/axom/slic/examples/basic/lumberjack_logging.cpp +++ b/src/axom/slic/examples/basic/lumberjack_logging.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/basic/parallel_logging.cpp b/src/axom/slic/examples/basic/parallel_logging.cpp index 120613c87a..a400779ca0 100644 --- a/src/axom/slic/examples/basic/parallel_logging.cpp +++ b/src/axom/slic/examples/basic/parallel_logging.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/basic/separate_file_per_rank.cpp b/src/axom/slic/examples/basic/separate_file_per_rank.cpp index 19c30269ed..8da342bfed 100644 --- a/src/axom/slic/examples/basic/separate_file_per_rank.cpp +++ b/src/axom/slic/examples/basic/separate_file_per_rank.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/multicode/driver.cpp b/src/axom/slic/examples/multicode/driver.cpp index 51ca248b2d..6a65422a33 100644 --- a/src/axom/slic/examples/multicode/driver.cpp +++ b/src/axom/slic/examples/multicode/driver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/multicode/physicsA.hpp b/src/axom/slic/examples/multicode/physicsA.hpp index 3548abd5f1..bb695a23ea 100644 --- a/src/axom/slic/examples/multicode/physicsA.hpp +++ b/src/axom/slic/examples/multicode/physicsA.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/examples/multicode/physicsB.hpp b/src/axom/slic/examples/multicode/physicsB.hpp index f1cda1de6a..da04bca567 100644 --- a/src/axom/slic/examples/multicode/physicsB.hpp +++ b/src/axom/slic/examples/multicode/physicsB.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/interface/CMakeLists.txt b/src/axom/slic/interface/CMakeLists.txt index 3cbe9f21a7..ac90fd1048 100644 --- a/src/axom/slic/interface/CMakeLists.txt +++ b/src/axom/slic/interface/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/interface/c_fortran/typesSLIC.h b/src/axom/slic/interface/c_fortran/typesSLIC.h index e82bf1b52c..bc85a0655e 100644 --- a/src/axom/slic/interface/c_fortran/typesSLIC.h +++ b/src/axom/slic/interface/c_fortran/typesSLIC.h @@ -1,7 +1,7 @@ // typesSLIC.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -10,10 +10,16 @@ #ifndef TYPESSLIC_H #define TYPESSLIC_H +// splicer begin types.CXX_declarations +// splicer end types.CXX_declarations + #ifdef __cplusplus extern "C" { #endif +// splicer begin types.C_declarations +// splicer end types.C_declarations + // helper capsule_SLIC_GenericOutputStream struct s_SLIC_GenericOutputStream { diff --git a/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.cpp b/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.cpp index 556c93d829..a17ab4c743 100644 --- a/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.cpp +++ b/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.cpp @@ -1,20 +1,39 @@ // wrapGenericOutputStream.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapGenericOutputStream.h" -#include -#include + #include "axom/slic/streams/GenericOutputStream.hpp" +#include +#include +#include "wrapGenericOutputStream.h" // splicer begin class.GenericOutputStream.CXX_definitions // splicer end class.GenericOutputStream.CXX_definitions extern "C" { +// helper ShroudLenTrim +// Returns the length of character string src with length nsrc, +// ignoring any trailing blanks. +static int ShroudLenTrim(const char *src, int nsrc) +{ + int i; + + for(i = nsrc - 1; i >= 0; i--) + { + if(src[i] != ' ') + { + break; + } + } + + return i + 1; +} + // splicer begin class.GenericOutputStream.C_definitions // splicer end class.GenericOutputStream.C_definitions @@ -33,12 +52,12 @@ SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_default( } SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_default_bufferify( - const char *stream, - int Lstream, + char *stream, + int SHT_stream_len, SLIC_GenericOutputStream *SHC_rv) { // splicer begin class.GenericOutputStream.method.ctor_default_bufferify - const std::string SHCXX_stream(stream, Lstream); + const std::string SHCXX_stream(stream, ShroudLenTrim(stream, SHT_stream_len)); axom::slic::GenericOutputStream *SHCXX_rv = new axom::slic::GenericOutputStream(SHCXX_stream); SHC_rv->addr = static_cast(SHCXX_rv); @@ -64,15 +83,15 @@ SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_format( } SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_format_bufferify( - const char *stream, - int Lstream, - const char *format, - int Lformat, + char *stream, + int SHT_stream_len, + char *format, + int SHT_format_len, SLIC_GenericOutputStream *SHC_rv) { // splicer begin class.GenericOutputStream.method.ctor_format_bufferify - const std::string SHCXX_stream(stream, Lstream); - const std::string SHCXX_format(format, Lformat); + const std::string SHCXX_stream(stream, ShroudLenTrim(stream, SHT_stream_len)); + const std::string SHCXX_format(format, ShroudLenTrim(format, SHT_format_len)); axom::slic::GenericOutputStream *SHCXX_rv = new axom::slic::GenericOutputStream(SHCXX_stream, SHCXX_format); SHC_rv->addr = static_cast(SHCXX_rv); diff --git a/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.h b/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.h index d80e0534d9..2cadb7be78 100644 --- a/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.h +++ b/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.h @@ -1,7 +1,7 @@ // wrapGenericOutputStream.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -26,28 +26,28 @@ extern "C" { // splicer begin class.GenericOutputStream.C_declarations // splicer end class.GenericOutputStream.C_declarations -SLIC_GenericOutputStream* SLIC_GenericOutputStream_ctor_default( - const char* stream, - SLIC_GenericOutputStream* SHC_rv); +SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_default( + const char *stream, + SLIC_GenericOutputStream *SHC_rv); -SLIC_GenericOutputStream* SLIC_GenericOutputStream_ctor_default_bufferify( - const char* stream, - int Lstream, - SLIC_GenericOutputStream* SHC_rv); +SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_default_bufferify( + char *stream, + int SHT_stream_len, + SLIC_GenericOutputStream *SHC_rv); -SLIC_GenericOutputStream* SLIC_GenericOutputStream_ctor_format( - const char* stream, - const char* format, - SLIC_GenericOutputStream* SHC_rv); +SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_format( + const char *stream, + const char *format, + SLIC_GenericOutputStream *SHC_rv); -SLIC_GenericOutputStream* SLIC_GenericOutputStream_ctor_format_bufferify( - const char* stream, - int Lstream, - const char* format, - int Lformat, - SLIC_GenericOutputStream* SHC_rv); +SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_format_bufferify( + char *stream, + int SHT_stream_len, + char *format, + int SHT_format_len, + SLIC_GenericOutputStream *SHC_rv); -void SLIC_GenericOutputStream_delete(SLIC_GenericOutputStream* self); +void SLIC_GenericOutputStream_delete(SLIC_GenericOutputStream *self); #ifdef __cplusplus } diff --git a/src/axom/slic/interface/c_fortran/wrapSLIC.cpp b/src/axom/slic/interface/c_fortran/wrapSLIC.cpp index 81e413562b..41109bc5fe 100644 --- a/src/axom/slic/interface/c_fortran/wrapSLIC.cpp +++ b/src/axom/slic/interface/c_fortran/wrapSLIC.cpp @@ -1,23 +1,40 @@ // wrapSLIC.cpp -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) -#include "wrapSLIC.h" -#include -#include -#include + #include "axom/slic/interface/slic.hpp" +#include #include "axom/slic/streams/GenericOutputStream.hpp" -#include "typesSLIC.h" +#include +#include "wrapSLIC.h" // splicer begin CXX_definitions // splicer end CXX_definitions extern "C" { +// helper ShroudLenTrim +// Returns the length of character string src with length nsrc, +// ignoring any trailing blanks. +static int ShroudLenTrim(const char *src, int nsrc) +{ + int i; + + for(i = nsrc - 1; i >= 0; i--) + { + if(src[i] != ' ') + { + break; + } + } + + return i + 1; +} + // helper ShroudStrCopy // Copy src into dest, blank fill to ndest characters // Truncate if dest is too short. @@ -30,16 +47,10 @@ static void ShroudStrCopy(char *dest, int ndest, const char *src, int nsrc) } else { - if(nsrc < 0) - { - nsrc = std::strlen(src); - } + if(nsrc < 0) nsrc = std::strlen(src); int nm = nsrc < ndest ? nsrc : ndest; std::memcpy(dest, src, nm); - if(ndest > nm) - { - std::memset(dest + nm, ' ', ndest - nm); // blank fill - } + if(ndest > nm) std::memset(dest + nm, ' ', ndest - nm); // blank fill } } // splicer begin C_definitions @@ -52,196 +63,198 @@ void SLIC_initialize(void) // splicer end function.initialize } -bool SLIC_is_initialized(void) +bool SLIC_isInitialized(void) { - // splicer begin function.is_initialized + // splicer begin function.isInitialized bool SHC_rv = axom::slic::isInitialized(); return SHC_rv; - // splicer end function.is_initialized + // splicer end function.isInitialized } -void SLIC_create_logger(const char *name, char imask) +void SLIC_createLogger(const char *name, char imask) { - // splicer begin function.create_logger + // splicer begin function.createLogger const std::string SHCXX_name(name); axom::slic::createLogger(SHCXX_name, imask); - // splicer end function.create_logger + // splicer end function.createLogger } -void SLIC_create_logger_bufferify(const char *name, int Lname, char imask) +void SLIC_createLogger_bufferify(char *name, int SHT_name_len, char imask) { - // splicer begin function.create_logger_bufferify - const std::string SHCXX_name(name, Lname); + // splicer begin function.createLogger_bufferify + const std::string SHCXX_name(name, ShroudLenTrim(name, SHT_name_len)); axom::slic::createLogger(SHCXX_name, imask); - // splicer end function.create_logger_bufferify + // splicer end function.createLogger_bufferify } -bool SLIC_activate_logger(const char *name) +bool SLIC_activateLogger(const char *name) { - // splicer begin function.activate_logger + // splicer begin function.activateLogger const std::string SHCXX_name(name); bool SHC_rv = axom::slic::activateLogger(SHCXX_name); return SHC_rv; - // splicer end function.activate_logger + // splicer end function.activateLogger } -bool SLIC_activate_logger_bufferify(const char *name, int Lname) +bool SLIC_activateLogger_bufferify(char *name, int SHT_name_len) { - // splicer begin function.activate_logger_bufferify - const std::string SHCXX_name(name, Lname); + // splicer begin function.activateLogger_bufferify + const std::string SHCXX_name(name, ShroudLenTrim(name, SHT_name_len)); bool SHC_rv = axom::slic::activateLogger(SHCXX_name); return SHC_rv; - // splicer end function.activate_logger_bufferify + // splicer end function.activateLogger_bufferify } -void SLIC_get_active_logger_name_bufferify(char *name, int Nname) +void SLIC_getActiveLoggerName_bufferify(char *name, int SHT_name_len) { - // splicer begin function.get_active_logger_name_bufferify + // splicer begin function.getActiveLoggerName_bufferify std::string SHCXX_rv = axom::slic::getActiveLoggerName(); if(SHCXX_rv.empty()) { - ShroudStrCopy(name, Nname, nullptr, 0); + ShroudStrCopy(name, SHT_name_len, nullptr, 0); } else { - ShroudStrCopy(name, Nname, SHCXX_rv.data(), SHCXX_rv.size()); + ShroudStrCopy(name, SHT_name_len, SHCXX_rv.data(), SHCXX_rv.size()); } - // splicer end function.get_active_logger_name_bufferify + // splicer end function.getActiveLoggerName_bufferify } -int SLIC_get_logging_msg_level(void) +int SLIC_getLoggingMsgLevel(void) { - // splicer begin function.get_logging_msg_level + // splicer begin function.getLoggingMsgLevel axom::slic::message::Level SHCXX_rv = axom::slic::getLoggingMsgLevel(); int SHC_rv = static_cast(SHCXX_rv); return SHC_rv; - // splicer end function.get_logging_msg_level + // splicer end function.getLoggingMsgLevel } -void SLIC_set_logging_msg_level(int level) +void SLIC_setLoggingMsgLevel(int level) { - // splicer begin function.set_logging_msg_level + // splicer begin function.setLoggingMsgLevel axom::slic::message::Level SHCXX_level = static_cast(level); axom::slic::setLoggingMsgLevel(SHCXX_level); - // splicer end function.set_logging_msg_level + // splicer end function.setLoggingMsgLevel } -void SLIC_add_stream_to_msg_level(SLIC_GenericOutputStream *ls, int level) +void SLIC_addStreamToMsgLevel(SLIC_GenericOutputStream *ls, int level) { - // splicer begin function.add_stream_to_msg_level + // splicer begin function.addStreamToMsgLevel axom::slic::GenericOutputStream *SHCXX_ls = static_cast(ls->addr); axom::slic::message::Level SHCXX_level = static_cast(level); axom::slic::addStreamToMsgLevel(SHCXX_ls, SHCXX_level); - // splicer end function.add_stream_to_msg_level + // splicer end function.addStreamToMsgLevel } -void SLIC_add_stream_to_all_msg_levels(SLIC_GenericOutputStream *ls) +void SLIC_addStreamToAllMsgLevels(SLIC_GenericOutputStream *ls) { - // splicer begin function.add_stream_to_all_msg_levels + // splicer begin function.addStreamToAllMsgLevels axom::slic::GenericOutputStream *SHCXX_ls = static_cast(ls->addr); axom::slic::addStreamToAllMsgLevels(SHCXX_ls); - // splicer end function.add_stream_to_all_msg_levels + // splicer end function.addStreamToAllMsgLevels } -void SLIC_set_abort_on_error(bool status) +void SLIC_setAbortOnError(bool status) { - // splicer begin function.set_abort_on_error + // splicer begin function.setAbortOnError axom::slic::setAbortOnError(status); - // splicer end function.set_abort_on_error + // splicer end function.setAbortOnError } -void SLIC_enable_abort_on_error(void) +void SLIC_enableAbortOnError(void) { - // splicer begin function.enable_abort_on_error + // splicer begin function.enableAbortOnError axom::slic::enableAbortOnError(); - // splicer end function.enable_abort_on_error + // splicer end function.enableAbortOnError } -void SLIC_disable_abort_on_error(void) +void SLIC_disableAbortOnError(void) { - // splicer begin function.disable_abort_on_error + // splicer begin function.disableAbortOnError axom::slic::disableAbortOnError(); - // splicer end function.disable_abort_on_error + // splicer end function.disableAbortOnError } -bool SLIC_is_abort_on_errors_enabled(void) +bool SLIC_isAbortOnErrorsEnabled(void) { - // splicer begin function.is_abort_on_errors_enabled + // splicer begin function.isAbortOnErrorsEnabled bool SHC_rv = axom::slic::isAbortOnErrorsEnabled(); return SHC_rv; - // splicer end function.is_abort_on_errors_enabled + // splicer end function.isAbortOnErrorsEnabled } -void SLIC_set_abort_on_warning(bool status) +void SLIC_setAbortOnWarning(bool status) { - // splicer begin function.set_abort_on_warning + // splicer begin function.setAbortOnWarning axom::slic::setAbortOnWarning(status); - // splicer end function.set_abort_on_warning + // splicer end function.setAbortOnWarning } -void SLIC_enable_abort_on_warning(void) +void SLIC_enableAbortOnWarning(void) { - // splicer begin function.enable_abort_on_warning + // splicer begin function.enableAbortOnWarning axom::slic::enableAbortOnWarning(); - // splicer end function.enable_abort_on_warning + // splicer end function.enableAbortOnWarning } -void SLIC_disable_abort_on_warning(void) +void SLIC_disableAbortOnWarning(void) { - // splicer begin function.disable_abort_on_warning + // splicer begin function.disableAbortOnWarning axom::slic::disableAbortOnWarning(); - // splicer end function.disable_abort_on_warning + // splicer end function.disableAbortOnWarning } -bool SLIC_is_abort_on_warnings_enabled(void) +bool SLIC_isAbortOnWarningsEnabled(void) { - // splicer begin function.is_abort_on_warnings_enabled + // splicer begin function.isAbortOnWarningsEnabled bool SHC_rv = axom::slic::isAbortOnWarningsEnabled(); return SHC_rv; - // splicer end function.is_abort_on_warnings_enabled + // splicer end function.isAbortOnWarningsEnabled } -void SLIC_log_message_file_line(int level, - const char *message, - const char *fileName, - int line) +void SLIC_logMessage_file_line(int level, + const char *message, + const char *fileName, + int line) { - // splicer begin function.log_message_file_line + // splicer begin function.logMessage_file_line axom::slic::message::Level SHCXX_level = static_cast(level); const std::string SHCXX_message(message); const std::string SHCXX_fileName(fileName); axom::slic::logMessage(SHCXX_level, SHCXX_message, SHCXX_fileName, line); - // splicer end function.log_message_file_line + // splicer end function.logMessage_file_line } -void SLIC_log_message_file_line_bufferify(int level, - const char *message, - int Lmessage, - const char *fileName, - int LfileName, - int line) +void SLIC_logMessage_file_line_bufferify(int level, + char *message, + int SHT_message_len, + char *fileName, + int SHT_fileName_len, + int line) { - // splicer begin function.log_message_file_line_bufferify + // splicer begin function.logMessage_file_line_bufferify axom::slic::message::Level SHCXX_level = static_cast(level); - const std::string SHCXX_message(message, Lmessage); - const std::string SHCXX_fileName(fileName, LfileName); + const std::string SHCXX_message(message, + ShroudLenTrim(message, SHT_message_len)); + const std::string SHCXX_fileName(fileName, + ShroudLenTrim(fileName, SHT_fileName_len)); axom::slic::logMessage(SHCXX_level, SHCXX_message, SHCXX_fileName, line); - // splicer end function.log_message_file_line_bufferify + // splicer end function.logMessage_file_line_bufferify } -void SLIC_log_message_file_line_filter(int level, - const char *message, - const char *fileName, - int line, - bool filter_duplicates) +void SLIC_logMessage_file_line_filter(int level, + const char *message, + const char *fileName, + int line, + bool filter_duplicates) { - // splicer begin function.log_message_file_line_filter + // splicer begin function.logMessage_file_line_filter axom::slic::message::Level SHCXX_level = static_cast(level); const std::string SHCXX_message(message); @@ -251,78 +264,82 @@ void SLIC_log_message_file_line_filter(int level, SHCXX_fileName, line, filter_duplicates); - // splicer end function.log_message_file_line_filter + // splicer end function.logMessage_file_line_filter } -void SLIC_log_message_file_line_filter_bufferify(int level, - const char *message, - int Lmessage, - const char *fileName, - int LfileName, - int line, - bool filter_duplicates) +void SLIC_logMessage_file_line_filter_bufferify(int level, + char *message, + int SHT_message_len, + char *fileName, + int SHT_fileName_len, + int line, + bool filter_duplicates) { - // splicer begin function.log_message_file_line_filter_bufferify + // splicer begin function.logMessage_file_line_filter_bufferify axom::slic::message::Level SHCXX_level = static_cast(level); - const std::string SHCXX_message(message, Lmessage); - const std::string SHCXX_fileName(fileName, LfileName); + const std::string SHCXX_message(message, + ShroudLenTrim(message, SHT_message_len)); + const std::string SHCXX_fileName(fileName, + ShroudLenTrim(fileName, SHT_fileName_len)); axom::slic::logMessage(SHCXX_level, SHCXX_message, SHCXX_fileName, line, filter_duplicates); - // splicer end function.log_message_file_line_filter_bufferify + // splicer end function.logMessage_file_line_filter_bufferify } -void SLIC_log_message(int level, const char *message) +void SLIC_logMessage(int level, const char *message) { - // splicer begin function.log_message + // splicer begin function.logMessage axom::slic::message::Level SHCXX_level = static_cast(level); const std::string SHCXX_message(message); axom::slic::logMessage(SHCXX_level, SHCXX_message); - // splicer end function.log_message + // splicer end function.logMessage } -void SLIC_log_message_bufferify(int level, const char *message, int Lmessage) +void SLIC_logMessage_bufferify(int level, char *message, int SHT_message_len) { - // splicer begin function.log_message_bufferify + // splicer begin function.logMessage_bufferify axom::slic::message::Level SHCXX_level = static_cast(level); - const std::string SHCXX_message(message, Lmessage); + const std::string SHCXX_message(message, + ShroudLenTrim(message, SHT_message_len)); axom::slic::logMessage(SHCXX_level, SHCXX_message); - // splicer end function.log_message_bufferify + // splicer end function.logMessage_bufferify } -void SLIC_log_message_filter(int level, const char *message, bool filter_duplicates) +void SLIC_logMessage_filter(int level, const char *message, bool filter_duplicates) { - // splicer begin function.log_message_filter + // splicer begin function.logMessage_filter axom::slic::message::Level SHCXX_level = static_cast(level); const std::string SHCXX_message(message); axom::slic::logMessage(SHCXX_level, SHCXX_message, filter_duplicates); - // splicer end function.log_message_filter + // splicer end function.logMessage_filter } -void SLIC_log_message_filter_bufferify(int level, - const char *message, - int Lmessage, - bool filter_duplicates) +void SLIC_logMessage_filter_bufferify(int level, + char *message, + int SHT_message_len, + bool filter_duplicates) { - // splicer begin function.log_message_filter_bufferify + // splicer begin function.logMessage_filter_bufferify axom::slic::message::Level SHCXX_level = static_cast(level); - const std::string SHCXX_message(message, Lmessage); + const std::string SHCXX_message(message, + ShroudLenTrim(message, SHT_message_len)); axom::slic::logMessage(SHCXX_level, SHCXX_message, filter_duplicates); - // splicer end function.log_message_filter_bufferify + // splicer end function.logMessage_filter_bufferify } -void SLIC_flush_streams(void) +void SLIC_flushStreams(void) { - // splicer begin function.flush_streams + // splicer begin function.flushStreams axom::slic::flushStreams(); - // splicer end function.flush_streams + // splicer end function.flushStreams } void SLIC_finalize(void) @@ -332,32 +349,4 @@ void SLIC_finalize(void) // splicer end function.finalize } -// Release library allocated memory. -void SLIC_SHROUD_memory_destructor(SLIC_SHROUD_capsule_data *cap) -{ - void *ptr = cap->addr; - switch(cap->idtor) - { - case 0: // --none-- - { - // Nothing to delete - break; - } - case 1: // axom::slic::GenericOutputStream - { - axom::slic::GenericOutputStream *cxx_ptr = - reinterpret_cast(ptr); - delete cxx_ptr; - break; - } - default: - { - // Unexpected case in destructor - break; - } - } - cap->addr = nullptr; - cap->idtor = 0; // avoid deleting again -} - } // extern "C" diff --git a/src/axom/slic/interface/c_fortran/wrapSLIC.h b/src/axom/slic/interface/c_fortran/wrapSLIC.h index e6a90afdcb..d5a98179ce 100644 --- a/src/axom/slic/interface/c_fortran/wrapSLIC.h +++ b/src/axom/slic/interface/c_fortran/wrapSLIC.h @@ -1,7 +1,7 @@ // wrapSLIC.h -// This file is generated by Shroud 0.12.2. Do not edit. +// This file is generated by Shroud 0.13.0. Do not edit. // -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,10 +14,10 @@ #ifndef WRAPSLIC_H #define WRAPSLIC_H -#include "typesSLIC.h" #ifndef __cplusplus #include #endif +#include "typesSLIC.h" // splicer begin CXX_declarations // splicer end CXX_declarations @@ -41,82 +41,80 @@ enum SLIC_message_Level void SLIC_initialize(void); -bool SLIC_is_initialized(void); +bool SLIC_isInitialized(void); -void SLIC_create_logger(const char* name, char imask); +void SLIC_createLogger(const char *name, char imask); -void SLIC_create_logger_bufferify(const char* name, int Lname, char imask); +void SLIC_createLogger_bufferify(char *name, int SHT_name_len, char imask); -bool SLIC_activate_logger(const char* name); +bool SLIC_activateLogger(const char *name); -bool SLIC_activate_logger_bufferify(const char* name, int Lname); +bool SLIC_activateLogger_bufferify(char *name, int SHT_name_len); -void SLIC_get_active_logger_name_bufferify(char* name, int Nname); +void SLIC_getActiveLoggerName_bufferify(char *name, int SHT_name_len); -int SLIC_get_logging_msg_level(void); +int SLIC_getLoggingMsgLevel(void); -void SLIC_set_logging_msg_level(int level); +void SLIC_setLoggingMsgLevel(int level); -void SLIC_add_stream_to_msg_level(SLIC_GenericOutputStream* ls, int level); +void SLIC_addStreamToMsgLevel(SLIC_GenericOutputStream *ls, int level); -void SLIC_add_stream_to_all_msg_levels(SLIC_GenericOutputStream* ls); +void SLIC_addStreamToAllMsgLevels(SLIC_GenericOutputStream *ls); -void SLIC_set_abort_on_error(bool status); +void SLIC_setAbortOnError(bool status); -void SLIC_enable_abort_on_error(void); +void SLIC_enableAbortOnError(void); -void SLIC_disable_abort_on_error(void); +void SLIC_disableAbortOnError(void); -bool SLIC_is_abort_on_errors_enabled(void); +bool SLIC_isAbortOnErrorsEnabled(void); -void SLIC_set_abort_on_warning(bool status); +void SLIC_setAbortOnWarning(bool status); -void SLIC_enable_abort_on_warning(void); +void SLIC_enableAbortOnWarning(void); -void SLIC_disable_abort_on_warning(void); +void SLIC_disableAbortOnWarning(void); -bool SLIC_is_abort_on_warnings_enabled(void); +bool SLIC_isAbortOnWarningsEnabled(void); -void SLIC_log_message_file_line(int level, - const char* message, - const char* fileName, - int line); +void SLIC_logMessage_file_line(int level, + const char *message, + const char *fileName, + int line); -void SLIC_log_message_file_line_bufferify(int level, - const char* message, - int Lmessage, - const char* fileName, - int LfileName, - int line); +void SLIC_logMessage_file_line_bufferify(int level, + char *message, + int SHT_message_len, + char *fileName, + int SHT_fileName_len, + int line); -void SLIC_log_message_file_line_filter(int level, - const char* message, - const char* fileName, - int line, - bool filter_duplicates); +void SLIC_logMessage_file_line_filter(int level, + const char *message, + const char *fileName, + int line, + bool filter_duplicates); -void SLIC_log_message_file_line_filter_bufferify(int level, - const char* message, - int Lmessage, - const char* fileName, - int LfileName, - int line, - bool filter_duplicates); +void SLIC_logMessage_file_line_filter_bufferify(int level, + char *message, + int SHT_message_len, + char *fileName, + int SHT_fileName_len, + int line, + bool filter_duplicates); -void SLIC_log_message(int level, const char* message); +void SLIC_logMessage(int level, const char *message); -void SLIC_log_message_bufferify(int level, const char* message, int Lmessage); +void SLIC_logMessage_bufferify(int level, char *message, int SHT_message_len); -void SLIC_log_message_filter(int level, - const char* message, - bool filter_duplicates); +void SLIC_logMessage_filter(int level, const char *message, bool filter_duplicates); -void SLIC_log_message_filter_bufferify(int level, - const char* message, - int Lmessage, - bool filter_duplicates); +void SLIC_logMessage_filter_bufferify(int level, + char *message, + int SHT_message_len, + bool filter_duplicates); -void SLIC_flush_streams(void); +void SLIC_flushStreams(void); void SLIC_finalize(void); diff --git a/src/axom/slic/interface/c_fortran/wrapfslic.f b/src/axom/slic/interface/c_fortran/wrapfslic.f index 82a580ed8f..94fddd1762 100644 --- a/src/axom/slic/interface/c_fortran/wrapfslic.f +++ b/src/axom/slic/interface/c_fortran/wrapfslic.f @@ -1,7 +1,7 @@ ! wrapfslic.f -! This file is generated by Shroud 0.12.2. Do not edit. +! This file is generated by Shroud 0.13.0. Do not edit. ! -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) @@ -20,6 +20,12 @@ module axom_slic ! splicer begin module_top ! splicer end module_top + ! helper capsule_data_helper + type, bind(C) :: SLIC_SHROUD_capsule_data + type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory + integer(C_INT) :: idtor = 0 ! index of destructor + end type SLIC_SHROUD_capsule_data + ! enum axom::slic::message::Level integer(C_INT), parameter :: message_error = 0 integer(C_INT), parameter :: message_warning = 1 @@ -27,95 +33,87 @@ module axom_slic integer(C_INT), parameter :: message_debug = 3 integer(C_INT), parameter :: message_num_levels = 4 - type, bind(C) :: SLIC_SHROUD_genericoutputstream_capsule - type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory - integer(C_INT) :: idtor = 0 ! index of destructor - end type SLIC_SHROUD_genericoutputstream_capsule - type SlicGenericOutputStream - type(SLIC_SHROUD_genericoutputstream_capsule) :: cxxmem + type(SLIC_SHROUD_capsule_data) :: cxxmem ! splicer begin class.GenericOutputStream.component_part ! splicer end class.GenericOutputStream.component_part contains - procedure :: delete => slic_genericoutputstream_delete - procedure :: get_instance => slic_genericoutputstream_get_instance - procedure :: set_instance => slic_genericoutputstream_set_instance - procedure :: associated => slic_genericoutputstream_associated + procedure :: delete => slic_generic_output_stream_delete + procedure :: get_instance => slic_generic_output_stream_get_instance + procedure :: set_instance => slic_generic_output_stream_set_instance + procedure :: associated => slic_generic_output_stream_associated ! splicer begin class.GenericOutputStream.type_bound_procedure_part ! splicer end class.GenericOutputStream.type_bound_procedure_part end type SlicGenericOutputStream interface operator (.eq.) - module procedure genericoutputstream_eq + module procedure generic_output_stream_eq end interface interface operator (.ne.) - module procedure genericoutputstream_ne + module procedure generic_output_stream_ne end interface interface - function c_genericoutputstream_ctor_default(stream, SHT_crv) & - result(SHT_rv) & + function c_generic_output_stream_ctor_default(stream, SHT_rv) & + result(SHT_prv) & bind(C, name="SLIC_GenericOutputStream_ctor_default") use iso_c_binding, only : C_CHAR, C_PTR - import :: SLIC_SHROUD_genericoutputstream_capsule + import :: SLIC_SHROUD_capsule_data implicit none character(kind=C_CHAR), intent(IN) :: stream(*) - type(SLIC_SHROUD_genericoutputstream_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_genericoutputstream_ctor_default + type(SLIC_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) SHT_prv + end function c_generic_output_stream_ctor_default - function c_genericoutputstream_ctor_default_bufferify(stream, & - Lstream, SHT_crv) & - result(SHT_rv) & + function c_generic_output_stream_ctor_default_bufferify(stream, & + SHT_stream_len, SHT_rv) & + result(SHT_prv) & bind(C, name="SLIC_GenericOutputStream_ctor_default_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SLIC_SHROUD_genericoutputstream_capsule + import :: SLIC_SHROUD_capsule_data implicit none character(kind=C_CHAR), intent(IN) :: stream(*) - integer(C_INT), value, intent(IN) :: Lstream - type(SLIC_SHROUD_genericoutputstream_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_genericoutputstream_ctor_default_bufferify - - function c_genericoutputstream_ctor_format(stream, format, & - SHT_crv) & - result(SHT_rv) & + integer(C_INT), value, intent(IN) :: SHT_stream_len + type(SLIC_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) SHT_prv + end function c_generic_output_stream_ctor_default_bufferify + + function c_generic_output_stream_ctor_format(stream, format, & + SHT_rv) & + result(SHT_prv) & bind(C, name="SLIC_GenericOutputStream_ctor_format") use iso_c_binding, only : C_CHAR, C_PTR - import :: SLIC_SHROUD_genericoutputstream_capsule + import :: SLIC_SHROUD_capsule_data implicit none character(kind=C_CHAR), intent(IN) :: stream(*) character(kind=C_CHAR), intent(IN) :: format(*) - type(SLIC_SHROUD_genericoutputstream_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_genericoutputstream_ctor_format + type(SLIC_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) SHT_prv + end function c_generic_output_stream_ctor_format - function c_genericoutputstream_ctor_format_bufferify(stream, & - Lstream, format, Lformat, SHT_crv) & - result(SHT_rv) & + function c_generic_output_stream_ctor_format_bufferify(stream, & + SHT_stream_len, format, SHT_format_len, SHT_rv) & + result(SHT_prv) & bind(C, name="SLIC_GenericOutputStream_ctor_format_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SLIC_SHROUD_genericoutputstream_capsule + import :: SLIC_SHROUD_capsule_data implicit none character(kind=C_CHAR), intent(IN) :: stream(*) - integer(C_INT), value, intent(IN) :: Lstream + integer(C_INT), value, intent(IN) :: SHT_stream_len character(kind=C_CHAR), intent(IN) :: format(*) - integer(C_INT), value, intent(IN) :: Lformat - type(SLIC_SHROUD_genericoutputstream_capsule), intent(OUT) :: SHT_crv - type(C_PTR) SHT_rv - end function c_genericoutputstream_ctor_format_bufferify + integer(C_INT), value, intent(IN) :: SHT_format_len + type(SLIC_SHROUD_capsule_data), intent(OUT) :: SHT_rv + type(C_PTR) SHT_prv + end function c_generic_output_stream_ctor_format_bufferify - subroutine c_genericoutputstream_delete(self) & + subroutine c_generic_output_stream_delete(self) & bind(C, name="SLIC_GenericOutputStream_delete") - import :: SLIC_SHROUD_genericoutputstream_capsule + import :: SLIC_SHROUD_capsule_data implicit none - type(SLIC_SHROUD_genericoutputstream_capsule), intent(IN) :: self - end subroutine c_genericoutputstream_delete - - ! splicer begin class.GenericOutputStream.additional_interfaces - ! splicer end class.GenericOutputStream.additional_interfaces + type(SLIC_SHROUD_capsule_data), intent(INOUT) :: self + end subroutine c_generic_output_stream_delete subroutine slic_initialize() & bind(C, name="SLIC_initialize") @@ -124,132 +122,133 @@ end subroutine slic_initialize function c_is_initialized() & result(SHT_rv) & - bind(C, name="SLIC_is_initialized") + bind(C, name="SLIC_isInitialized") use iso_c_binding, only : C_BOOL implicit none logical(C_BOOL) :: SHT_rv end function c_is_initialized subroutine c_create_logger(name, imask) & - bind(C, name="SLIC_create_logger") + bind(C, name="SLIC_createLogger") use iso_c_binding, only : C_CHAR implicit none character(kind=C_CHAR), intent(IN) :: name(*) character(kind=C_CHAR), value, intent(IN) :: imask end subroutine c_create_logger - subroutine c_create_logger_bufferify(name, Lname, imask) & - bind(C, name="SLIC_create_logger_bufferify") + subroutine c_create_logger_bufferify(name, SHT_name_len, imask) & + bind(C, name="SLIC_createLogger_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: name(*) - integer(C_INT), value, intent(IN) :: Lname + integer(C_INT), value, intent(IN) :: SHT_name_len character(kind=C_CHAR), value, intent(IN) :: imask end subroutine c_create_logger_bufferify function c_activate_logger(name) & result(SHT_rv) & - bind(C, name="SLIC_activate_logger") + bind(C, name="SLIC_activateLogger") use iso_c_binding, only : C_BOOL, C_CHAR implicit none character(kind=C_CHAR), intent(IN) :: name(*) logical(C_BOOL) :: SHT_rv end function c_activate_logger - function c_activate_logger_bufferify(name, Lname) & + function c_activate_logger_bufferify(name, SHT_name_len) & result(SHT_rv) & - bind(C, name="SLIC_activate_logger_bufferify") + bind(C, name="SLIC_activateLogger_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: name(*) - integer(C_INT), value, intent(IN) :: Lname + integer(C_INT), value, intent(IN) :: SHT_name_len logical(C_BOOL) :: SHT_rv end function c_activate_logger_bufferify - subroutine c_get_active_logger_name_bufferify(name, Nname) & - bind(C, name="SLIC_get_active_logger_name_bufferify") + subroutine c_get_active_logger_name_bufferify(name, & + SHT_name_len) & + bind(C, name="SLIC_getActiveLoggerName_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(OUT) :: name(*) - integer(C_INT), value, intent(IN) :: Nname + integer(C_INT), value, intent(IN) :: SHT_name_len end subroutine c_get_active_logger_name_bufferify function slic_get_logging_msg_level() & result(SHT_rv) & - bind(C, name="SLIC_get_logging_msg_level") + bind(C, name="SLIC_getLoggingMsgLevel") use iso_c_binding, only : C_INT implicit none integer(C_INT) :: SHT_rv end function slic_get_logging_msg_level subroutine slic_set_logging_msg_level(level) & - bind(C, name="SLIC_set_logging_msg_level") + bind(C, name="SLIC_setLoggingMsgLevel") use iso_c_binding, only : C_INT implicit none integer(C_INT), value, intent(IN) :: level end subroutine slic_set_logging_msg_level subroutine c_add_stream_to_msg_level(ls, level) & - bind(C, name="SLIC_add_stream_to_msg_level") + bind(C, name="SLIC_addStreamToMsgLevel") use iso_c_binding, only : C_INT - import :: SLIC_SHROUD_genericoutputstream_capsule + import :: SLIC_SHROUD_capsule_data implicit none - type(SLIC_SHROUD_genericoutputstream_capsule), intent(INOUT) :: ls + type(SLIC_SHROUD_capsule_data), intent(INOUT) :: ls integer(C_INT), value, intent(IN) :: level end subroutine c_add_stream_to_msg_level subroutine c_add_stream_to_all_msg_levels(ls) & - bind(C, name="SLIC_add_stream_to_all_msg_levels") - import :: SLIC_SHROUD_genericoutputstream_capsule + bind(C, name="SLIC_addStreamToAllMsgLevels") + import :: SLIC_SHROUD_capsule_data implicit none - type(SLIC_SHROUD_genericoutputstream_capsule), intent(INOUT) :: ls + type(SLIC_SHROUD_capsule_data), intent(INOUT) :: ls end subroutine c_add_stream_to_all_msg_levels subroutine c_set_abort_on_error(status) & - bind(C, name="SLIC_set_abort_on_error") + bind(C, name="SLIC_setAbortOnError") use iso_c_binding, only : C_BOOL implicit none logical(C_BOOL), value, intent(IN) :: status end subroutine c_set_abort_on_error subroutine slic_enable_abort_on_error() & - bind(C, name="SLIC_enable_abort_on_error") + bind(C, name="SLIC_enableAbortOnError") implicit none end subroutine slic_enable_abort_on_error subroutine slic_disable_abort_on_error() & - bind(C, name="SLIC_disable_abort_on_error") + bind(C, name="SLIC_disableAbortOnError") implicit none end subroutine slic_disable_abort_on_error function c_is_abort_on_errors_enabled() & result(SHT_rv) & - bind(C, name="SLIC_is_abort_on_errors_enabled") + bind(C, name="SLIC_isAbortOnErrorsEnabled") use iso_c_binding, only : C_BOOL implicit none logical(C_BOOL) :: SHT_rv end function c_is_abort_on_errors_enabled subroutine c_set_abort_on_warning(status) & - bind(C, name="SLIC_set_abort_on_warning") + bind(C, name="SLIC_setAbortOnWarning") use iso_c_binding, only : C_BOOL implicit none logical(C_BOOL), value, intent(IN) :: status end subroutine c_set_abort_on_warning subroutine slic_enable_abort_on_warning() & - bind(C, name="SLIC_enable_abort_on_warning") + bind(C, name="SLIC_enableAbortOnWarning") implicit none end subroutine slic_enable_abort_on_warning subroutine slic_disable_abort_on_warning() & - bind(C, name="SLIC_disable_abort_on_warning") + bind(C, name="SLIC_disableAbortOnWarning") implicit none end subroutine slic_disable_abort_on_warning function c_is_abort_on_warnings_enabled() & result(SHT_rv) & - bind(C, name="SLIC_is_abort_on_warnings_enabled") + bind(C, name="SLIC_isAbortOnWarningsEnabled") use iso_c_binding, only : C_BOOL implicit none logical(C_BOOL) :: SHT_rv @@ -257,7 +256,7 @@ end function c_is_abort_on_warnings_enabled subroutine c_log_message_file_line(level, message, fileName, & line) & - bind(C, name="SLIC_log_message_file_line") + bind(C, name="SLIC_logMessage_file_line") use iso_c_binding, only : C_CHAR, C_INT implicit none integer(C_INT), value, intent(IN) :: level @@ -267,21 +266,21 @@ subroutine c_log_message_file_line(level, message, fileName, & end subroutine c_log_message_file_line subroutine c_log_message_file_line_bufferify(level, message, & - Lmessage, fileName, LfileName, line) & - bind(C, name="SLIC_log_message_file_line_bufferify") + SHT_message_len, fileName, SHT_fileName_len, line) & + bind(C, name="SLIC_logMessage_file_line_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none integer(C_INT), value, intent(IN) :: level character(kind=C_CHAR), intent(IN) :: message(*) - integer(C_INT), value, intent(IN) :: Lmessage + integer(C_INT), value, intent(IN) :: SHT_message_len character(kind=C_CHAR), intent(IN) :: fileName(*) - integer(C_INT), value, intent(IN) :: LfileName + integer(C_INT), value, intent(IN) :: SHT_fileName_len integer(C_INT), value, intent(IN) :: line end subroutine c_log_message_file_line_bufferify subroutine c_log_message_file_line_filter(level, message, & fileName, line, filter_duplicates) & - bind(C, name="SLIC_log_message_file_line_filter") + bind(C, name="SLIC_logMessage_file_line_filter") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT implicit none integer(C_INT), value, intent(IN) :: level @@ -292,40 +291,41 @@ subroutine c_log_message_file_line_filter(level, message, & end subroutine c_log_message_file_line_filter subroutine c_log_message_file_line_filter_bufferify(level, & - message, Lmessage, fileName, LfileName, line, & - filter_duplicates) & - bind(C, name="SLIC_log_message_file_line_filter_bufferify") + message, SHT_message_len, fileName, SHT_fileName_len, & + line, filter_duplicates) & + bind(C, name="SLIC_logMessage_file_line_filter_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT implicit none integer(C_INT), value, intent(IN) :: level character(kind=C_CHAR), intent(IN) :: message(*) - integer(C_INT), value, intent(IN) :: Lmessage + integer(C_INT), value, intent(IN) :: SHT_message_len character(kind=C_CHAR), intent(IN) :: fileName(*) - integer(C_INT), value, intent(IN) :: LfileName + integer(C_INT), value, intent(IN) :: SHT_fileName_len integer(C_INT), value, intent(IN) :: line logical(C_BOOL), value, intent(IN) :: filter_duplicates end subroutine c_log_message_file_line_filter_bufferify subroutine c_log_message(level, message) & - bind(C, name="SLIC_log_message") + bind(C, name="SLIC_logMessage") use iso_c_binding, only : C_CHAR, C_INT implicit none integer(C_INT), value, intent(IN) :: level character(kind=C_CHAR), intent(IN) :: message(*) end subroutine c_log_message - subroutine c_log_message_bufferify(level, message, Lmessage) & - bind(C, name="SLIC_log_message_bufferify") + subroutine c_log_message_bufferify(level, message, & + SHT_message_len) & + bind(C, name="SLIC_logMessage_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none integer(C_INT), value, intent(IN) :: level character(kind=C_CHAR), intent(IN) :: message(*) - integer(C_INT), value, intent(IN) :: Lmessage + integer(C_INT), value, intent(IN) :: SHT_message_len end subroutine c_log_message_bufferify subroutine c_log_message_filter(level, message, & filter_duplicates) & - bind(C, name="SLIC_log_message_filter") + bind(C, name="SLIC_logMessage_filter") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT implicit none integer(C_INT), value, intent(IN) :: level @@ -334,18 +334,18 @@ subroutine c_log_message_filter(level, message, & end subroutine c_log_message_filter subroutine c_log_message_filter_bufferify(level, message, & - Lmessage, filter_duplicates) & - bind(C, name="SLIC_log_message_filter_bufferify") + SHT_message_len, filter_duplicates) & + bind(C, name="SLIC_logMessage_filter_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT implicit none integer(C_INT), value, intent(IN) :: level character(kind=C_CHAR), intent(IN) :: message(*) - integer(C_INT), value, intent(IN) :: Lmessage + integer(C_INT), value, intent(IN) :: SHT_message_len logical(C_BOOL), value, intent(IN) :: filter_duplicates end subroutine c_log_message_filter_bufferify subroutine slic_flush_streams() & - bind(C, name="SLIC_flush_streams") + bind(C, name="SLIC_flushStreams") implicit none end subroutine slic_flush_streams @@ -353,14 +353,11 @@ subroutine slic_finalize() & bind(C, name="SLIC_finalize") implicit none end subroutine slic_finalize - - ! splicer begin additional_interfaces - ! splicer end additional_interfaces end interface interface SlicGenericOutputStream - module procedure slic_genericoutputstream_ctor_default - module procedure slic_genericoutputstream_ctor_format + module procedure slic_generic_output_stream_ctor_default + module procedure slic_generic_output_stream_ctor_format end interface SlicGenericOutputStream interface log_message @@ -370,63 +367,71 @@ end subroutine slic_finalize module procedure slic_log_message_filter end interface log_message + ! splicer begin additional_declarations + ! splicer end additional_declarations + contains - function slic_genericoutputstream_ctor_default(stream) & + function slic_generic_output_stream_ctor_default(stream) & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR character(len=*), intent(IN) :: stream type(SlicGenericOutputStream) :: SHT_rv - ! splicer begin class.GenericOutputStream.method.ctor_default type(C_PTR) :: SHT_prv - SHT_prv = c_genericoutputstream_ctor_default_bufferify(stream, & - len_trim(stream, kind=C_INT), SHT_rv%cxxmem) + ! splicer begin class.GenericOutputStream.method.ctor_default + integer(C_INT) SHT_stream_len + SHT_stream_len = len(stream, kind=C_INT) + SHT_prv = c_generic_output_stream_ctor_default_bufferify(stream, & + SHT_stream_len, SHT_rv%cxxmem) ! splicer end class.GenericOutputStream.method.ctor_default - end function slic_genericoutputstream_ctor_default + end function slic_generic_output_stream_ctor_default - function slic_genericoutputstream_ctor_format(stream, format) & + function slic_generic_output_stream_ctor_format(stream, format) & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR character(len=*), intent(IN) :: stream character(len=*), intent(IN) :: format type(SlicGenericOutputStream) :: SHT_rv - ! splicer begin class.GenericOutputStream.method.ctor_format type(C_PTR) :: SHT_prv - SHT_prv = c_genericoutputstream_ctor_format_bufferify(stream, & - len_trim(stream, kind=C_INT), format, & - len_trim(format, kind=C_INT), SHT_rv%cxxmem) + ! splicer begin class.GenericOutputStream.method.ctor_format + integer(C_INT) SHT_stream_len + integer(C_INT) SHT_format_len + SHT_stream_len = len(stream, kind=C_INT) + SHT_format_len = len(format, kind=C_INT) + SHT_prv = c_generic_output_stream_ctor_format_bufferify(stream, & + SHT_stream_len, format, SHT_format_len, SHT_rv%cxxmem) ! splicer end class.GenericOutputStream.method.ctor_format - end function slic_genericoutputstream_ctor_format + end function slic_generic_output_stream_ctor_format - subroutine slic_genericoutputstream_delete(obj) + subroutine slic_generic_output_stream_delete(obj) class(SlicGenericOutputStream) :: obj ! splicer begin class.GenericOutputStream.method.delete - call c_genericoutputstream_delete(obj%cxxmem) + call c_generic_output_stream_delete(obj%cxxmem) ! splicer end class.GenericOutputStream.method.delete - end subroutine slic_genericoutputstream_delete + end subroutine slic_generic_output_stream_delete ! Return pointer to C++ memory. - function slic_genericoutputstream_get_instance(obj) result (cxxptr) + function slic_generic_output_stream_get_instance(obj) result (cxxptr) use iso_c_binding, only: C_PTR class(SlicGenericOutputStream), intent(IN) :: obj type(C_PTR) :: cxxptr cxxptr = obj%cxxmem%addr - end function slic_genericoutputstream_get_instance + end function slic_generic_output_stream_get_instance - subroutine slic_genericoutputstream_set_instance(obj, cxxmem) + subroutine slic_generic_output_stream_set_instance(obj, cxxmem) use iso_c_binding, only: C_PTR class(SlicGenericOutputStream), intent(INOUT) :: obj type(C_PTR), intent(IN) :: cxxmem obj%cxxmem%addr = cxxmem obj%cxxmem%idtor = 0 - end subroutine slic_genericoutputstream_set_instance + end subroutine slic_generic_output_stream_set_instance - function slic_genericoutputstream_associated(obj) result (rv) + function slic_generic_output_stream_associated(obj) result (rv) use iso_c_binding, only: c_associated class(SlicGenericOutputStream), intent(IN) :: obj logical rv rv = c_associated(obj%cxxmem%addr) - end function slic_genericoutputstream_associated + end function slic_generic_output_stream_associated ! splicer begin class.GenericOutputStream.additional_functions ! splicer end class.GenericOutputStream.additional_functions @@ -445,8 +450,9 @@ subroutine slic_create_logger(name, imask) character(len=*), intent(IN) :: name character, value, intent(IN) :: imask ! splicer begin function.create_logger - call c_create_logger_bufferify(name, len_trim(name, kind=C_INT), & - imask) + integer(C_INT) SHT_name_len + SHT_name_len = len(name, kind=C_INT) + call c_create_logger_bufferify(name, SHT_name_len, imask) ! splicer end function.create_logger end subroutine slic_create_logger @@ -456,8 +462,9 @@ function slic_activate_logger(name) & character(len=*), intent(IN) :: name logical :: SHT_rv ! splicer begin function.activate_logger - SHT_rv = c_activate_logger_bufferify(name, & - len_trim(name, kind=C_INT)) + integer(C_INT) SHT_name_len + SHT_name_len = len(name, kind=C_INT) + SHT_rv = c_activate_logger_bufferify(name, SHT_name_len) ! splicer end function.activate_logger end function slic_activate_logger @@ -465,8 +472,9 @@ subroutine slic_get_active_logger_name(name) use iso_c_binding, only : C_INT character(len=*), intent(OUT) :: name ! splicer begin function.get_active_logger_name - call c_get_active_logger_name_bufferify(name, & - len(name, kind=C_INT)) + integer(C_INT) SHT_name_len + SHT_name_len = len(name, kind=C_INT) + call c_get_active_logger_name_bufferify(name, SHT_name_len) ! splicer end function.get_active_logger_name end subroutine slic_get_active_logger_name @@ -532,9 +540,12 @@ subroutine slic_log_message_file_line(level, message, fileName, & character(len=*), intent(IN) :: fileName integer(C_INT), value, intent(IN) :: line ! splicer begin function.log_message_file_line + integer(C_INT) SHT_message_len + integer(C_INT) SHT_fileName_len + SHT_message_len = len(message, kind=C_INT) + SHT_fileName_len = len(fileName, kind=C_INT) call c_log_message_file_line_bufferify(level, message, & - len_trim(message, kind=C_INT), fileName, & - len_trim(fileName, kind=C_INT), line) + SHT_message_len, fileName, SHT_fileName_len, line) ! splicer end function.log_message_file_line end subroutine slic_log_message_file_line @@ -547,11 +558,15 @@ subroutine slic_log_message_file_line_filter(level, message, & integer(C_INT), value, intent(IN) :: line logical, value, intent(IN) :: filter_duplicates ! splicer begin function.log_message_file_line_filter + integer(C_INT) SHT_message_len + integer(C_INT) SHT_fileName_len logical(C_BOOL) SH_filter_duplicates + SHT_message_len = len(message, kind=C_INT) + SHT_fileName_len = len(fileName, kind=C_INT) SH_filter_duplicates = filter_duplicates ! coerce to C_BOOL call c_log_message_file_line_filter_bufferify(level, message, & - len_trim(message, kind=C_INT), fileName, & - len_trim(fileName, kind=C_INT), line, SH_filter_duplicates) + SHT_message_len, fileName, SHT_fileName_len, line, & + SH_filter_duplicates) ! splicer end function.log_message_file_line_filter end subroutine slic_log_message_file_line_filter @@ -560,8 +575,9 @@ subroutine slic_log_message(level, message) integer(C_INT), value, intent(IN) :: level character(len=*), intent(IN) :: message ! splicer begin function.log_message - call c_log_message_bufferify(level, message, & - len_trim(message, kind=C_INT)) + integer(C_INT) SHT_message_len + SHT_message_len = len(message, kind=C_INT) + call c_log_message_bufferify(level, message, SHT_message_len) ! splicer end function.log_message end subroutine slic_log_message @@ -572,17 +588,19 @@ subroutine slic_log_message_filter(level, message, & character(len=*), intent(IN) :: message logical, value, intent(IN) :: filter_duplicates ! splicer begin function.log_message_filter + integer(C_INT) SHT_message_len logical(C_BOOL) SH_filter_duplicates + SHT_message_len = len(message, kind=C_INT) SH_filter_duplicates = filter_duplicates ! coerce to C_BOOL call c_log_message_filter_bufferify(level, message, & - len_trim(message, kind=C_INT), SH_filter_duplicates) + SHT_message_len, SH_filter_duplicates) ! splicer end function.log_message_filter end subroutine slic_log_message_filter ! splicer begin additional_functions ! splicer end additional_functions - function genericoutputstream_eq(a,b) result (rv) + function generic_output_stream_eq(a,b) result (rv) use iso_c_binding, only: c_associated type(SlicGenericOutputStream), intent(IN) ::a,b logical :: rv @@ -591,9 +609,9 @@ function genericoutputstream_eq(a,b) result (rv) else rv = .false. endif - end function genericoutputstream_eq + end function generic_output_stream_eq - function genericoutputstream_ne(a,b) result (rv) + function generic_output_stream_ne(a,b) result (rv) use iso_c_binding, only: c_associated type(SlicGenericOutputStream), intent(IN) ::a,b logical :: rv @@ -602,6 +620,6 @@ function genericoutputstream_ne(a,b) result (rv) else rv = .false. endif - end function genericoutputstream_ne + end function generic_output_stream_ne end module axom_slic diff --git a/src/axom/slic/interface/slic.cpp b/src/axom/slic/interface/slic.cpp index 5f7b3bfff8..414c2c0c21 100644 --- a/src/axom/slic/interface/slic.cpp +++ b/src/axom/slic/interface/slic.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -178,6 +178,41 @@ void addStreamToAllMsgLevels(GenericOutputStream* ls) Logger::getActiveLogger()->addStreamToAllMsgLevels(ls); } +//------------------------------------------------------------------------------ +void addStreamToTag(LogStream* ls, const std::string& tag) +{ + ensureInitialized(); + Logger::getActiveLogger()->addStreamToTag(ls, tag); +} + +//------------------------------------------------------------------------------ +void addStreamToTag(GenericOutputStream* ls, const std::string& tag) +{ + ensureInitialized(); + Logger::getActiveLogger()->addStreamToTag(ls, tag); +} + +//------------------------------------------------------------------------------ +void addStreamToAllTags(LogStream* ls) +{ + ensureInitialized(); + Logger::getActiveLogger()->addStreamToAllTags(ls); +} + +//------------------------------------------------------------------------------ +void addStreamToAllTags(GenericOutputStream* ls) +{ + ensureInitialized(); + Logger::getActiveLogger()->addStreamToAllTags(ls); +} + +//------------------------------------------------------------------------------ +int getNumStreamsWithTag(const std::string& tag) +{ + ensureInitialized(); + return Logger::getActiveLogger()->getNumStreamsWithTag(tag); +} + //------------------------------------------------------------------------------ void logMessage(message::Level level, const std::string& message, @@ -191,10 +226,15 @@ void logMessage(message::Level level, void logMessage(message::Level level, const std::string& message, const std::string& tag, - bool filter_duplicates) + bool filter_duplicates, + bool tag_stream_only) { ensureInitialized(); - Logger::getActiveLogger()->logMessage(level, message, tag, filter_duplicates); + Logger::getActiveLogger()->logMessage(level, + message, + tag, + filter_duplicates, + tag_stream_only); } //------------------------------------------------------------------------------ @@ -218,11 +258,17 @@ void logMessage(message::Level level, const std::string& tag, const std::string& fileName, int line, - bool filter_duplicates) + bool filter_duplicates, + bool tag_stream_only) { ensureInitialized(); - Logger::getActiveLogger() - ->logMessage(level, message, tag, fileName, line, filter_duplicates); + Logger::getActiveLogger()->logMessage(level, + message, + tag, + fileName, + line, + filter_duplicates, + tag_stream_only); } //------------------------------------------------------------------------------ diff --git a/src/axom/slic/interface/slic.hpp b/src/axom/slic/interface/slic.hpp index 97e274b40b..4d7e6ecc02 100644 --- a/src/axom/slic/interface/slic.hpp +++ b/src/axom/slic/interface/slic.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -226,6 +226,55 @@ void addStreamToAllMsgLevels(LogStream* ls); */ void addStreamToAllMsgLevels(GenericOutputStream* ls); +/*! +* \brief Binds the given stream to the given tag. +* +* \param [in] ls pointer to the user-supplied LogStream object. +* \param [in] tag the tag that this stream will be associated with. +* +* \pre ls != nullptr. +*/ +void addStreamToTag(LogStream* ls, const std::string& tag); + +/*! +* \brief Binds the given GenericOutputStream to the given tag. +* +* \param [in] ls pointer to the user-supplied GenericOutputStream. +* \param [in] tag the tag that this stream will be associated with. +* +* \pre ls != nullptr. +*/ +void addStreamToTag(GenericOutputStream* ls, const std::string& tag); + +/*! +* \brief Binds the given stream to all the tags. +* +* \param [in] ls pointer to the user-supplied LogStream object. +* +* \pre ls != nullptr. +*/ +void addStreamToAllTags(LogStream* ls); + +/*! +* \brief Binds the given GenericOutputStream to all the tags. +* +* \param [in] ls pointer to the user-supplied GenericOutputStream. +* +* \pre ls != nullptr. +*/ +void addStreamToAllTags(GenericOutputStream* ls); + +/*! +* \brief Returns the number of streams for a given tag. +* Returns 0 if the tag does not exist. +* +* \param [in] tag the tag in query. +* +* \return N the number of streams for the given tag. +* \post N >= 0 +*/ +int getNumStreamsWithTag(const std::string& tag); + /*! * \brief Logs the given message to all registered streams. * @@ -248,11 +297,14 @@ void logMessage(message::Level level, * \param [in] filter_duplicates optional parameter that indicates whether * duplicate messages resulting from running in parallel will be filtered out. * Default is false. + * /param [in] tag_stream_only optional parameter that indicates whether the + * message will go only to streams bound to tagName. Default is false. */ void logMessage(message::Level level, const std::string& message, const std::string& tag, - bool filter_duplicates = false); + bool filter_duplicates = false, + bool tag_stream_only = false); /*! * \brief Logs the given message to all registered streams. @@ -282,13 +334,16 @@ void logMessage(message::Level level, * \param [in] filter_duplicates optional parameter that indicates whether * duplicate messages resulting from running in parallel will be filtered out. * Default is false. + * /param [in] tag_stream_only optional parameter that indicates whether the + * message will go only to streams bound to tagName. Default is false. */ void logMessage(message::Level level, const std::string& message, const std::string& tag, const std::string& fileName, int line, - bool filter_duplicates = false); + bool filter_duplicates = false, + bool tag_stream_only = false); /*! * \brief Convenience method to log an error message. diff --git a/src/axom/slic/interface/slic_macros.hpp b/src/axom/slic/interface/slic_macros.hpp index 62db4b72ab..4086deae7c 100644 --- a/src/axom/slic/interface/slic_macros.hpp +++ b/src/axom/slic/interface/slic_macros.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -578,6 +578,35 @@ AXOM_HOST_DEVICE inline blackhole &operator<<(blackhole &bh, T) __LINE__); \ } while(axom::slic::detail::false_value) +/*! + * \def SLIC_INFO_TAGGED( msg, tag ) + * \brief Logs an Info message to a tagged stream + * + * \param [in] msg user-supplied message + * \param [in] tag user-supplied tag + * + * \note The SLIC_INFO_TAGGED macro is always active. + * + * Usage: + * \code + * SLIC_INFO_TAGGED("informative text goes here", "tag"); + * \endcode + * + */ +#define SLIC_INFO_TAGGED(msg, tag) \ + do \ + { \ + std::ostringstream __oss; \ + __oss << msg; \ + axom::slic::logMessage(axom::slic::message::Info, \ + __oss.str(), \ + tag, \ + __FILE__, \ + __LINE__, \ + false, \ + true); \ + } while(axom::slic::detail::false_value) + /*! * \def SLIC_INFO_IF( EXP, msg ) * \brief Logs an Info message iff EXP is true diff --git a/src/axom/slic/interface/slic_shroud.yaml b/src/axom/slic/interface/slic_shroud.yaml index 55b51d0a78..70d56204fb 100644 --- a/src/axom/slic/interface/slic_shroud.yaml +++ b/src/axom/slic/interface/slic_shroud.yaml @@ -3,7 +3,7 @@ # copyright: - - - Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and + - Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and - other Axom Project Developers. See the top-level LICENSE file for details. - - "SPDX-License-Identifier: (BSD-3-Clause)" @@ -17,7 +17,7 @@ options: C_line_length: 1000 F_module_name_library_template: axom_{library_lower} # Change the default template for Fortran functions to include the library name. - F_name_impl_template: "{library_lower}_{F_name_scope}{underscore_name}{function_suffix}" + F_name_impl_template: "{library_lower}_{F_name_scope}{F_name_api}{function_suffix}" format: C_prefix: SLIC_ diff --git a/src/axom/slic/interface/slic_types.yaml b/src/axom/slic/interface/slic_types.yaml index 2a15f6f573..0466e68bd0 100644 --- a/src/axom/slic/interface/slic_types.yaml +++ b/src/axom/slic/interface/slic_types.yaml @@ -1,7 +1,7 @@ # slic_types.yaml -# This file is generated by Shroud 0.12.2. Do not edit. +# This file is generated by Shroud 0.13.0. Do not edit. # -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -19,5 +19,5 @@ typemap: c_type: SLIC_GenericOutputStream f_module_name: axom_slic f_derived_type: SlicGenericOutputStream - f_capsule_data_type: SLIC_SHROUD_genericoutputstream_capsule + f_capsule_data_type: SLIC_SHROUD_capsule_data f_to_c: "{f_var}%cxxmem" diff --git a/src/axom/slic/internal/stacktrace.cpp b/src/axom/slic/internal/stacktrace.cpp index 357617898e..6f267df353 100644 --- a/src/axom/slic/internal/stacktrace.cpp +++ b/src/axom/slic/internal/stacktrace.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/internal/stacktrace.hpp b/src/axom/slic/internal/stacktrace.hpp index 6eb078441c..7a7aaed379 100644 --- a/src/axom/slic/internal/stacktrace.hpp +++ b/src/axom/slic/internal/stacktrace.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/streams/GenericOutputStream.cpp b/src/axom/slic/streams/GenericOutputStream.cpp index 7e7d679dce..39de7df769 100644 --- a/src/axom/slic/streams/GenericOutputStream.cpp +++ b/src/axom/slic/streams/GenericOutputStream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -61,7 +61,8 @@ void GenericOutputStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_UNUSED_PARAM(filtered_duplicates)) + bool AXOM_UNUSED_PARAM(filtered_duplicates), + bool AXOM_UNUSED_PARAM(tag_stream_only)) { if(m_stream == nullptr) { diff --git a/src/axom/slic/streams/GenericOutputStream.hpp b/src/axom/slic/streams/GenericOutputStream.hpp index 1edbdf03a7..83ccf65fe7 100644 --- a/src/axom/slic/streams/GenericOutputStream.hpp +++ b/src/axom/slic/streams/GenericOutputStream.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -85,7 +85,8 @@ class GenericOutputStream : public LogStream const std::string& tagName, const std::string& fileName, int line, - bool filter_duplicates); + bool filter_duplicates, + bool tag_stream_only); /*! * \brief Outputs the log stream to the console. diff --git a/src/axom/slic/streams/LumberjackStream.cpp b/src/axom/slic/streams/LumberjackStream.cpp index 96a75ac27a..c9353cc057 100644 --- a/src/axom/slic/streams/LumberjackStream.cpp +++ b/src/axom/slic/streams/LumberjackStream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -11,6 +11,7 @@ #include "axom/lumberjack/BinaryTreeCommunicator.hpp" #include "axom/lumberjack/Lumberjack.hpp" +#include "axom/lumberjack/TextTagCombiner.hpp" namespace axom { @@ -72,7 +73,8 @@ void LumberjackStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_UNUSED_PARAM(filter_duplicates)) + bool AXOM_UNUSED_PARAM(filter_duplicates), + bool AXOM_UNUSED_PARAM(tag_stream_only)) { if(m_lj == nullptr) { diff --git a/src/axom/slic/streams/LumberjackStream.hpp b/src/axom/slic/streams/LumberjackStream.hpp index 77e00c9ee5..5bac899a46 100644 --- a/src/axom/slic/streams/LumberjackStream.hpp +++ b/src/axom/slic/streams/LumberjackStream.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -68,6 +68,8 @@ class LumberjackStream : public LogStream * \param [in] line the line within the file at which the message is appended. * \param [in] filter_duplicates optional parameter that indicates whether * duplicate messages resulting from running in parallel will be filtered out. + * /param [in] tag_stream_only optional parameter that indicates whether the + * message will go only to streams bound to tagName. * * \note This method doesn't put anything to the console. Instead the * messages are cached locally to each ranks and are dumped to the console @@ -78,7 +80,8 @@ class LumberjackStream : public LogStream const std::string& tagName, const std::string& fileName, int line, - bool filter_duplicates); + bool filter_duplicates, + bool tag_stream_only); /*! * \brief Pushes the messages from the current rank directly to the diff --git a/src/axom/slic/streams/SynchronizedStream.cpp b/src/axom/slic/streams/SynchronizedStream.cpp index 3d19c4635e..12d00ed33c 100644 --- a/src/axom/slic/streams/SynchronizedStream.cpp +++ b/src/axom/slic/streams/SynchronizedStream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -74,7 +74,8 @@ void SynchronizedStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_UNUSED_PARAM(filter_duplicates)) + bool AXOM_UNUSED_PARAM(filter_duplicates), + bool AXOM_UNUSED_PARAM(tag_stream_only)) { if(m_cache == nullptr) { diff --git a/src/axom/slic/streams/SynchronizedStream.hpp b/src/axom/slic/streams/SynchronizedStream.hpp index 2e81c9b877..36a45b7750 100644 --- a/src/axom/slic/streams/SynchronizedStream.hpp +++ b/src/axom/slic/streams/SynchronizedStream.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -60,6 +60,8 @@ class SynchronizedStream : public LogStream * \param [in] line the line within the file at which the message is appended. * \param [in] filter_duplicates optional parameter that indicates whether * duplicate messages resulting from running in parallel will be filtered out. + * /param [in] tag_stream_only optional parameter that indicates whether the + * message will go only to streams bound to tagName. * * \note This method doesn't put anything to the console. Instead the * messages are cached locally to each ranks and are dumped to the console @@ -70,7 +72,8 @@ class SynchronizedStream : public LogStream const std::string& tagName, const std::string& fileName, int line, - bool filter_duplicates); + bool filter_duplicates, + bool tag_stream_only); /*! * \brief Dumps the messages from the current rank directly to the diff --git a/src/axom/slic/tests/CMakeLists.txt b/src/axom/slic/tests/CMakeLists.txt index fc1a39ff4d..3851d90f38 100644 --- a/src/axom/slic/tests/CMakeLists.txt +++ b/src/axom/slic/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/tests/slic_asserts.cpp b/src/axom/slic/tests/slic_asserts.cpp index f6e4f2de10..0f13b38c0b 100644 --- a/src/axom/slic/tests/slic_asserts.cpp +++ b/src/axom/slic/tests/slic_asserts.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/tests/slic_benchmark_asserts.cpp b/src/axom/slic/tests/slic_benchmark_asserts.cpp index 5f9ea48ce5..f9f80924dc 100644 --- a/src/axom/slic/tests/slic_benchmark_asserts.cpp +++ b/src/axom/slic/tests/slic_benchmark_asserts.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/tests/slic_fmt.cpp b/src/axom/slic/tests/slic_fmt.cpp index 4293ebe88b..b9fb54a615 100644 --- a/src/axom/slic/tests/slic_fmt.cpp +++ b/src/axom/slic/tests/slic_fmt.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/tests/slic_interface.cpp b/src/axom/slic/tests/slic_interface.cpp index 9a5c5b8af4..f603753482 100644 --- a/src/axom/slic/tests/slic_interface.cpp +++ b/src/axom/slic/tests/slic_interface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/tests/slic_interface_F.f b/src/axom/slic/tests/slic_interface_F.f index f43484d192..83324c43e8 100644 --- a/src/axom/slic/tests/slic_interface_F.f +++ b/src/axom/slic/tests/slic_interface_F.f @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/slic/tests/slic_macros.cpp b/src/axom/slic/tests/slic_macros.cpp index 66d929c134..f5701c944f 100644 --- a/src/axom/slic/tests/slic_macros.cpp +++ b/src/axom/slic/tests/slic_macros.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -103,6 +103,17 @@ void check_line(const std::string& msg, int expected_line) EXPECT_EQ(line, expected_line); } +//------------------------------------------------------------------------------ +void check_tag(const std::string& msg, const std::string& expected_tag) +{ + EXPECT_FALSE(msg.empty()); + + // extract tag + size_t start = msg.rfind("##") + 2; + std::string tag = msg.substr(start, expected_tag.length()); + EXPECT_EQ(tag, expected_tag); +} + } // end anonymous namespace //------------------------------------------------------------------------------ @@ -381,6 +392,26 @@ TEST(slic_macros, test_check_macros) #endif } +//------------------------------------------------------------------------------ +TEST(slic_macros, test_tagged_macros) +{ + EXPECT_TRUE(slic::internal::is_stream_empty()); + SLIC_INFO_TAGGED("test tagged info message", "myTag"); + EXPECT_FALSE(slic::internal::is_stream_empty()); + check_level(slic::internal::test_stream.str(), "INFO"); + check_msg(slic::internal::test_stream.str(), "test tagged info message"); + check_file(slic::internal::test_stream.str()); + check_line(slic::internal::test_stream.str(), __LINE__ - 5); + check_tag(slic::internal::test_stream.str(), "myTag"); + slic::internal::clear(); + + SLIC_INFO_TAGGED("this message should not be logged (no tag given)!", ""); + EXPECT_TRUE(slic::internal::is_stream_empty()); + + SLIC_INFO_TAGGED("this message should not be logged (tag DNE)!", "tag404"); + EXPECT_TRUE(slic::internal::is_stream_empty()); +} + //------------------------------------------------------------------------------ int main(int argc, char* argv[]) { @@ -398,6 +429,12 @@ int main(int argc, char* argv[]) slic::addStreamToAllMsgLevels( new slic::GenericOutputStream(&slic::internal::test_stream, msgfmt)); + std::string msgtagfmt = + "[]:;;;;\n##\n@@\n@@"; + slic::addStreamToTag( + new slic::GenericOutputStream(&slic::internal::test_stream, msgtagfmt), + "myTag"); + // finalized when exiting main scope result = RUN_ALL_TESTS(); diff --git a/src/axom/slic/tests/slic_macros_parallel.cpp b/src/axom/slic/tests/slic_macros_parallel.cpp index ef2a68de4e..01419f0d59 100644 --- a/src/axom/slic/tests/slic_macros_parallel.cpp +++ b/src/axom/slic/tests/slic_macros_parallel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -28,15 +28,30 @@ namespace slic { namespace internal { +// Stream for message levels std::ostringstream test_stream; +// Stream for tagged streams +std::ostringstream test_tag_stream; + bool is_stream_empty() { return test_stream.str().empty(); } +bool is_tag_stream_empty() { return test_tag_stream.str().empty(); } + +bool are_all_streams_empty() +{ + return (is_stream_empty() && is_tag_stream_empty()); +} + void clear_streams() { test_stream.clear(); test_stream.str(""); - EXPECT_TRUE(is_stream_empty()); + + test_tag_stream.clear(); + test_tag_stream.str(""); + + EXPECT_TRUE(are_all_streams_empty()); } } // namespace internal @@ -104,6 +119,17 @@ void check_line(const std::string& msg, int expected_line) EXPECT_EQ(line, expected_line); } +//------------------------------------------------------------------------------ +void check_tag(const std::string& msg, const std::string& expected_tag) +{ + EXPECT_FALSE(msg.empty()); + + // extract tag + size_t start = msg.rfind("##") + 2; + std::string tag = msg.substr(start, expected_tag.length()); + EXPECT_EQ(tag, expected_tag); +} + //------------------------------------------------------------------------------ bool has_aborted = false; void custom_abort_function() { has_aborted = true; } @@ -137,6 +163,9 @@ class SlicMacrosParallel : public ::testing::TestWithParam std::string msgfmt = "[]:;;;;\n@@\n@@"; + std::string msgtagfmt = + "[]:;;;;\n##\n@@\n@@"; + if(stream_type == "Lumberjack") { slic::addStreamToAllMsgLevels( @@ -144,6 +173,13 @@ class SlicMacrosParallel : public ::testing::TestWithParam MPI_COMM_WORLD, RLIMIT, msgfmt)); + + slic::addStreamToTag( + new slic::LumberjackStream(&slic::internal::test_tag_stream, + MPI_COMM_WORLD, + RLIMIT, + msgtagfmt), + "myTag"); } if(stream_type == "Synchronized") @@ -152,6 +188,12 @@ class SlicMacrosParallel : public ::testing::TestWithParam new slic::SynchronizedStream(&slic::internal::test_stream, MPI_COMM_WORLD, msgfmt)); + + slic::addStreamToTag( + new slic::SynchronizedStream(&slic::internal::test_tag_stream, + MPI_COMM_WORLD, + msgtagfmt), + "myTag"); } } @@ -168,12 +210,12 @@ class SlicMacrosParallel : public ::testing::TestWithParam //------------------------------------------------------------------------------ TEST_P(SlicMacrosParallel, test_error_macros) { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_ERROR("test error message"); slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "test error message"); check_file(slic::internal::test_stream.str()); @@ -183,13 +225,13 @@ TEST_P(SlicMacrosParallel, test_error_macros) SLIC_ERROR_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_ERROR_IF(true, "this message is logged!"); slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -201,7 +243,7 @@ TEST_P(SlicMacrosParallel, test_error_macros) axom::slic::setIsRoot(false); SLIC_ERROR_ROOT_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Check selective filter based on root == true axom::slic::setIsRoot(true); @@ -209,7 +251,7 @@ TEST_P(SlicMacrosParallel, test_error_macros) slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -221,13 +263,13 @@ TEST_P(SlicMacrosParallel, test_error_macros) axom::slic::setIsRoot(true); SLIC_ERROR_ROOT_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // is not root, and conditional is true -> no message axom::slic::setIsRoot(false); SLIC_ERROR_ROOT_IF(true, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Check for one rank being root axom::slic::setIsRoot(rank == 0); @@ -235,7 +277,7 @@ TEST_P(SlicMacrosParallel, test_error_macros) slic::flushStreams(); if(rank == 0) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -243,7 +285,7 @@ TEST_P(SlicMacrosParallel, test_error_macros) } else { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); } slic::internal::clear_streams(); @@ -254,7 +296,7 @@ TEST_P(SlicMacrosParallel, test_error_macros) if(((rank % 2) == 0 && GetParam() == "Synchronized") || (rank == 0 && GetParam() == "Lumberjack")) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -262,7 +304,7 @@ TEST_P(SlicMacrosParallel, test_error_macros) } else { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); } slic::internal::clear_streams(); } @@ -270,12 +312,12 @@ TEST_P(SlicMacrosParallel, test_error_macros) //------------------------------------------------------------------------------ TEST_P(SlicMacrosParallel, test_warning_macros) { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_WARNING("test warning message"); slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "test warning message"); check_file(slic::internal::test_stream.str()); @@ -285,13 +327,13 @@ TEST_P(SlicMacrosParallel, test_warning_macros) SLIC_WARNING_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_WARNING_IF(true, "this message is logged!"); slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -303,7 +345,7 @@ TEST_P(SlicMacrosParallel, test_warning_macros) axom::slic::setIsRoot(false); SLIC_WARNING_ROOT_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Check selective filter based on root == true axom::slic::setIsRoot(true); @@ -311,7 +353,7 @@ TEST_P(SlicMacrosParallel, test_warning_macros) slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -323,13 +365,13 @@ TEST_P(SlicMacrosParallel, test_warning_macros) axom::slic::setIsRoot(true); SLIC_WARNING_ROOT_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // is not root, and conditional is true -> no message axom::slic::setIsRoot(false); SLIC_WARNING_ROOT_IF(true, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Check for one rank being root axom::slic::setIsRoot(rank == 0); @@ -337,7 +379,7 @@ TEST_P(SlicMacrosParallel, test_warning_macros) slic::flushStreams(); if(rank == 0) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -345,7 +387,7 @@ TEST_P(SlicMacrosParallel, test_warning_macros) } else { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); } slic::internal::clear_streams(); @@ -356,7 +398,7 @@ TEST_P(SlicMacrosParallel, test_warning_macros) if(((rank % 2) == 0 && GetParam() == "Synchronized") || (rank == 0 && GetParam() == "Lumberjack")) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -364,7 +406,7 @@ TEST_P(SlicMacrosParallel, test_warning_macros) } else { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); } slic::internal::clear_streams(); } @@ -372,12 +414,12 @@ TEST_P(SlicMacrosParallel, test_warning_macros) //------------------------------------------------------------------------------ TEST_P(SlicMacrosParallel, test_info_macros) { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_INFO("test info message"); slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "INFO"); check_msg(slic::internal::test_stream.str(), "test info message"); check_file(slic::internal::test_stream.str()); @@ -385,15 +427,59 @@ TEST_P(SlicMacrosParallel, test_info_macros) } slic::internal::clear_streams(); + SLIC_INFO_TAGGED("test tagged info message", "myTag"); + slic::flushStreams(); + if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) + { + EXPECT_FALSE(slic::internal::is_tag_stream_empty()); + check_level(slic::internal::test_tag_stream.str(), "INFO"); + check_msg(slic::internal::test_tag_stream.str(), "test tagged info message"); + check_file(slic::internal::test_tag_stream.str()); + check_line(slic::internal::test_tag_stream.str(), __LINE__ - 8); + check_tag(slic::internal::test_tag_stream.str(), "myTag"); + EXPECT_TRUE(slic::internal::is_stream_empty()); + } + slic::internal::clear_streams(); + + SLIC_INFO("test info message only for normal message-level stream"); + SLIC_INFO_TAGGED("test tagged info message only for tagged stream", "myTag"); + slic::flushStreams(); + if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) + { + EXPECT_FALSE(slic::internal::is_stream_empty()); + check_level(slic::internal::test_stream.str(), "INFO"); + check_msg(slic::internal::test_stream.str(), + "test info message only for normal message-level stream"); + check_file(slic::internal::test_stream.str()); + check_line(slic::internal::test_stream.str(), __LINE__ - 10); + + EXPECT_FALSE(slic::internal::is_tag_stream_empty()); + check_level(slic::internal::test_tag_stream.str(), "INFO"); + check_msg(slic::internal::test_tag_stream.str(), + "test tagged info message only for tagged stream"); + check_file(slic::internal::test_tag_stream.str()); + check_line(slic::internal::test_tag_stream.str(), __LINE__ - 16); + check_tag(slic::internal::test_tag_stream.str(), "myTag"); + } + slic::internal::clear_streams(); + + SLIC_INFO_TAGGED("this message should not be logged (no tag given)!", ""); + slic::flushStreams(); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); + + SLIC_INFO_TAGGED("this message should not be logged (tag DNE)!", "tag404"); + slic::flushStreams(); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); + SLIC_INFO_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_INFO_IF(true, "this message is logged!"); slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "INFO"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -405,7 +491,7 @@ TEST_P(SlicMacrosParallel, test_info_macros) axom::slic::setIsRoot(false); SLIC_INFO_ROOT_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Check selective filter based on root == true axom::slic::setIsRoot(true); @@ -413,7 +499,7 @@ TEST_P(SlicMacrosParallel, test_info_macros) slic::flushStreams(); if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "INFO"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -425,13 +511,13 @@ TEST_P(SlicMacrosParallel, test_info_macros) axom::slic::setIsRoot(true); SLIC_INFO_ROOT_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // is not root, and conditional is true -> no message axom::slic::setIsRoot(false); SLIC_INFO_ROOT_IF(true, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Check for one rank being root axom::slic::setIsRoot(rank == 0); @@ -439,7 +525,7 @@ TEST_P(SlicMacrosParallel, test_info_macros) slic::flushStreams(); if(rank == 0) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "INFO"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -447,7 +533,7 @@ TEST_P(SlicMacrosParallel, test_info_macros) } else { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); } slic::internal::clear_streams(); @@ -458,7 +544,7 @@ TEST_P(SlicMacrosParallel, test_info_macros) if(((rank % 2) == 0 && GetParam() == "Synchronized") || (rank == 0 && GetParam() == "Lumberjack")) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "INFO"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -466,7 +552,7 @@ TEST_P(SlicMacrosParallel, test_info_macros) } else { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); } slic::internal::clear_streams(); } @@ -474,13 +560,13 @@ TEST_P(SlicMacrosParallel, test_info_macros) //------------------------------------------------------------------------------ TEST_P(SlicMacrosParallel, test_debug_macros) { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_DEBUG("test debug message"); slic::flushStreams(); #ifdef AXOM_DEBUG if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "DEBUG"); check_msg(slic::internal::test_stream.str(), "test debug message"); check_file(slic::internal::test_stream.str()); @@ -489,19 +575,19 @@ TEST_P(SlicMacrosParallel, test_debug_macros) slic::internal::clear_streams(); #else // SLIC_DEBUG macros only log messages when AXOM_DEBUG is defined - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif SLIC_DEBUG_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_DEBUG_IF(true, "this message is logged!"); slic::flushStreams(); #ifdef AXOM_DEBUG if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "DEBUG"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -510,14 +596,14 @@ TEST_P(SlicMacrosParallel, test_debug_macros) slic::internal::clear_streams(); #else // SLIC_DEBUG macros only log messages when AXOM_DEBUG is defined - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif // Check selective filtering based on root == false axom::slic::setIsRoot(false); SLIC_DEBUG_ROOT_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Check selective filter based on root == true axom::slic::setIsRoot(true); @@ -526,7 +612,7 @@ TEST_P(SlicMacrosParallel, test_debug_macros) #ifdef AXOM_DEBUG if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "DEBUG"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -535,20 +621,20 @@ TEST_P(SlicMacrosParallel, test_debug_macros) slic::internal::clear_streams(); #else // SLIC_DEBUG macros only log messages when AXOM_DEBUG is defined - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif // is root, but conditional is false -> no message axom::slic::setIsRoot(true); SLIC_DEBUG_ROOT_IF(false, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // is not root, and conditional is true -> no message axom::slic::setIsRoot(false); SLIC_DEBUG_ROOT_IF(true, "this message should not be logged!"); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Check for one rank being root axom::slic::setIsRoot(rank == 0); @@ -557,7 +643,7 @@ TEST_P(SlicMacrosParallel, test_debug_macros) #ifdef AXOM_DEBUG if(rank == 0) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "DEBUG"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -565,12 +651,12 @@ TEST_P(SlicMacrosParallel, test_debug_macros) } else { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); } slic::internal::clear_streams(); #else // SLIC_DEBUG macros only log messages when AXOM_DEBUG is defined - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif // Check for more than one rank being root @@ -581,7 +667,7 @@ TEST_P(SlicMacrosParallel, test_debug_macros) if(((rank % 2) == 0 && GetParam() == "Synchronized") || (rank == 0 && GetParam() == "Lumberjack")) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "DEBUG"); check_msg(slic::internal::test_stream.str(), "this message is logged!"); check_file(slic::internal::test_stream.str()); @@ -589,12 +675,12 @@ TEST_P(SlicMacrosParallel, test_debug_macros) } else { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); } slic::internal::clear_streams(); #else // SLIC_DEBUG macros only log messages when AXOM_DEBUG is defined - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif } @@ -605,7 +691,7 @@ TEST_P(SlicMacrosParallel, test_abort_error_macros) slic::enableAbortOnError(); /* enable abort for testing purposes */ slic::setAbortFunction(custom_abort_function); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Test for each rank for(int i = 0; i < nranks; i++) @@ -644,7 +730,7 @@ TEST_P(SlicMacrosParallel, test_abort_error_macros) SLIC_ERROR_IF(val == 42, "SLIC_ERROR_IF message is logged!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "SLIC_ERROR_IF message is logged!"); @@ -655,7 +741,7 @@ TEST_P(SlicMacrosParallel, test_abort_error_macros) SLIC_ERROR_ROOT("SLIC_ERROR_ROOT message is logged!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "SLIC_ERROR_ROOT message is logged!"); @@ -666,7 +752,7 @@ TEST_P(SlicMacrosParallel, test_abort_error_macros) SLIC_ERROR_ROOT_IF(val == 42, "SLIC_ERROR_ROOT_IF message is logged!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "SLIC_ERROR_ROOT_IF message is logged!"); @@ -677,7 +763,7 @@ TEST_P(SlicMacrosParallel, test_abort_error_macros) SLIC_ASSERT(val < 0); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "Failed Assert: val < 0"); check_file(slic::internal::test_stream.str()); @@ -687,7 +773,7 @@ TEST_P(SlicMacrosParallel, test_abort_error_macros) SLIC_ASSERT_MSG(val < 0, "val should be negative!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "Failed Assert: val < 0\nval should be negative!"); @@ -703,7 +789,7 @@ TEST_P(SlicMacrosParallel, test_abort_error_macros) AXOM_UNUSED_VAR(has_aborted); reset_state(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif } //end NUM_ABORT_STATES loop @@ -721,7 +807,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) slic::enableAbortOnWarning(); /* enable abort for testing purposes */ slic::setAbortFunction(custom_abort_function); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); // Test for each rank for(int i = 0; i < nranks; i++) @@ -749,7 +835,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) SLIC_WARNING("SLIC_WARNING message is logged!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "SLIC_WARNING message is logged!"); @@ -761,7 +847,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) SLIC_WARNING_IF(val == 42, "SLIC_WARNING_IF message is logged!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "SLIC_WARNING_IF message is logged!"); @@ -772,7 +858,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) SLIC_WARNING_ROOT("SLIC_WARNING_ROOT message is logged!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "SLIC_WARNING_ROOT message is logged!"); @@ -783,7 +869,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) SLIC_WARNING_ROOT_IF(val == 42, "SLIC_WARNING_ROOT_IF msg logged!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "SLIC_WARNING_ROOT_IF msg logged!"); @@ -794,7 +880,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) SLIC_CHECK(val < 0); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "Failed Check: val < 0"); check_file(slic::internal::test_stream.str()); @@ -804,7 +890,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) SLIC_CHECK_MSG(val < 0, "val should be negative!"); slic::outputLocalMessages(); EXPECT_EQ(has_aborted, abort_enabled); - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "Failed Check: val < 0\nval should be negative!"); @@ -817,7 +903,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) #else // SLIC_CHECK macros only log messages when AXOM_DEBUG is defined - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif } //end NUM_ABORT_STATES loop @@ -831,7 +917,7 @@ TEST_P(SlicMacrosParallel, test_abort_warning_macros) TEST_P(SlicMacrosParallel, test_assert_macros) { slic::internal::clear_streams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); constexpr int val = 42; SLIC_ASSERT(val < 0); @@ -839,7 +925,7 @@ TEST_P(SlicMacrosParallel, test_assert_macros) #if defined(AXOM_DEBUG) && !defined(AXOM_DEVICE_CODE) if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "Failed Assert: val < 0"); check_file(slic::internal::test_stream.str()); @@ -849,19 +935,19 @@ TEST_P(SlicMacrosParallel, test_assert_macros) #else // SLIC_ASSERT macros only log messages when AXOM_DEBUG is defined AXOM_UNUSED_VAR(val); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif SLIC_ASSERT(val > 0); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_ASSERT_MSG(val < 0, "val should be negative!"); slic::flushStreams(); #if defined(AXOM_DEBUG) && !defined(AXOM_DEVICE_CODE) if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "ERROR"); check_msg(slic::internal::test_stream.str(), "Failed Assert: val < 0\nval should be negative!"); @@ -872,14 +958,14 @@ TEST_P(SlicMacrosParallel, test_assert_macros) #else // SLIC_ASSERT macros only log messages when AXOM_DEBUG is defined AXOM_UNUSED_VAR(val); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif } // ------------------------------------------------------------------------------ TEST_P(SlicMacrosParallel, test_check_macros) { - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); constexpr int val = 42; SLIC_CHECK(val < 0); @@ -887,7 +973,7 @@ TEST_P(SlicMacrosParallel, test_check_macros) #if defined(AXOM_DEBUG) && !defined(AXOM_DEVICE_CODE) if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "Failed Check: val < 0"); check_file(slic::internal::test_stream.str()); @@ -897,19 +983,19 @@ TEST_P(SlicMacrosParallel, test_check_macros) #else // SLIC_CHECK macros only log messages when AXOM_DEBUG is defined AXOM_UNUSED_VAR(val); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif SLIC_CHECK(val > 0); slic::flushStreams(); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); SLIC_CHECK_MSG(val < 0, "val should be negative!"); slic::flushStreams(); #if defined(AXOM_DEBUG) && !defined(AXOM_DEVICE_CODE) if(GetParam() == "Synchronized" || (GetParam() == "Lumberjack" && rank == 0)) { - EXPECT_FALSE(slic::internal::is_stream_empty()); + EXPECT_FALSE(slic::internal::are_all_streams_empty()); check_level(slic::internal::test_stream.str(), "WARNING"); check_msg(slic::internal::test_stream.str(), "Failed Check: val < 0\nval should be negative!"); @@ -920,7 +1006,7 @@ TEST_P(SlicMacrosParallel, test_check_macros) #else // SLIC_CHECK macros only log messages when AXOM_DEBUG is defined AXOM_UNUSED_VAR(val); - EXPECT_TRUE(slic::internal::is_stream_empty()); + EXPECT_TRUE(slic::internal::are_all_streams_empty()); #endif } diff --git a/src/axom/slic/tests/slic_uninit.cpp b/src/axom/slic/tests/slic_uninit.cpp index cce67f56d0..4f4a21d848 100644 --- a/src/axom/slic/tests/slic_uninit.cpp +++ b/src/axom/slic/tests/slic_uninit.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -27,6 +27,8 @@ TEST(slic_uninit, log_macro) []() { SLIC_DEBUG_IF(true, "debug message should print"); }); #endif testInit("info message", []() { SLIC_INFO("test info message"); }); + testInit("tagged info message", + []() { SLIC_INFO_TAGGED("test info message", "test_tag"); }); testInit("info_if", []() { SLIC_INFO_IF(true, "info message should print"); }); testInit("warning message", []() { SLIC_WARNING("test warning message"); }); testInit("warning_if", []() { SLIC_WARNING_IF(true, "test warning message"); }); @@ -78,11 +80,24 @@ TEST(slic_uninit, manage_loggers) new axom::slic::GenericOutputStream(&std::cout, format), axom::slic::message::Info); }); + testInit("addStreamToTag", []() { + std::string format("[]: \n"); + axom::slic::addStreamToTag( + new axom::slic::GenericOutputStream(&std::cout, format), + "Test"); + }); testInit("addStreamToAllMsgLevels", []() { std::string format("[]: \n"); axom::slic::addStreamToAllMsgLevels( new axom::slic::GenericOutputStream(&std::cout, format)); }); + testInit("addStreamToAllTags", []() { + std::string format("[]: \n"); + axom::slic::addStreamToAllTags( + new axom::slic::GenericOutputStream(&std::cout, format)); + }); + testInit("getNumStreamsWithTag", + []() { axom::slic::getNumStreamsWithTag("Test"); }); } TEST(slic_uninit, log_methods) @@ -96,12 +111,18 @@ TEST(slic_uninit, log_methods) testInit("logMessage_B", [&]() { axom::slic::logMessage(lvl, "another info message", "tagB"); }); + testInit("logMessage_B_Tagged", [&]() { + axom::slic::logMessage(lvl, "another info message", "tagB", false, true); + }); testInit("logMessage_C", [&, fname]() { axom::slic::logMessage(lvl, "info msg", fname, line); }); testInit("logMessage_D", [&, fname]() { axom::slic::logMessage(lvl, "info msg", "tagD", fname, line); }); + testInit("logMessage_D_Tagged", [&, fname]() { + axom::slic::logMessage(lvl, "info msg", "tagD", fname, line, false, true); + }); testInit("logErrorMessage", [&, fname]() { axom::slic::logErrorMessage("an error message", fname, line); diff --git a/src/axom/spin/BVH.hpp b/src/axom/spin/BVH.hpp index 33fae12814..d5eec63ae7 100644 --- a/src/axom/spin/BVH.hpp +++ b/src/axom/spin/BVH.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/Brood.hpp b/src/axom/spin/Brood.hpp index 44afcffcf0..5d0263689a 100644 --- a/src/axom/spin/Brood.hpp +++ b/src/axom/spin/Brood.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/CMakeLists.txt b/src/axom/spin/CMakeLists.txt index e5b1b1df45..2eafefbcbc 100644 --- a/src/axom/spin/CMakeLists.txt +++ b/src/axom/spin/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/DenseOctreeLevel.hpp b/src/axom/spin/DenseOctreeLevel.hpp index 88f55550d9..c77614cc4c 100644 --- a/src/axom/spin/DenseOctreeLevel.hpp +++ b/src/axom/spin/DenseOctreeLevel.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/ImplicitGrid.hpp b/src/axom/spin/ImplicitGrid.hpp index 42bd4e8d6b..54a0ed0c4d 100644 --- a/src/axom/spin/ImplicitGrid.hpp +++ b/src/axom/spin/ImplicitGrid.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -7,13 +7,13 @@ #define AXOM_SPIN_IMPLICIT_GRID__HPP_ #include "axom/config.hpp" -#include "axom/core.hpp" // for clamp functions +#include "axom/core.hpp" #include "axom/slic.hpp" #include "axom/slam.hpp" -#include "axom/core/execution/execution_space.hpp" // for execution spaces -#include "axom/core/memory_management.hpp" // for setDefaultAllocator() -#include "axom/core/utilities/BitUtilities.hpp" // for popCount() +#include "axom/core/execution/execution_space.hpp" +#include "axom/core/memory_management.hpp" +#include "axom/core/utilities/BitUtilities.hpp" #include "axom/primal/geometry/BoundingBox.hpp" #include "axom/primal/geometry/Point.hpp" @@ -864,8 +864,13 @@ void ImplicitGrid::getCandidatesAsArray( totalCountReduce += outCounts[i]; }); - // Step 2: exclusive scan for offsets in candidate array + // Step 2: exclusive scan for offsets in candidate array + // Intel oneAPI compiler segfaults with OpenMP RAJA scan + #ifdef __INTEL_LLVM_COMPILER + using exec_policy = typename axom::execution_space::loop_policy; + #else using exec_policy = typename axom::execution_space::loop_policy; + #endif RAJA::exclusive_scan(RAJA::make_span(outCounts.data(), qsize), RAJA::make_span(outOffsets.data(), qsize), RAJA::operators::plus {}); @@ -948,9 +953,8 @@ ImplicitGrid::QueryObject::countCandidates( { continue; } - // currWord now contains the resulting candidacy information - // for our given point - ncandidates += axom::utilities::popCount(currWord); + // currWord now contains the resulting candidacy information for our given point + ncandidates += axom::utilities::popcount(currWord); } return ncandidates; } @@ -1004,9 +1008,8 @@ ImplicitGrid::QueryObject::countCandidates( { continue; } - // currWord now contains the resulting candidacy information - // for our given point - ncandidates += axom::utilities::popCount(currWord); + // currWord now contains the resulting candidacy information for our given point + ncandidates += axom::utilities::popcount(currWord); } return ncandidates; } @@ -1055,16 +1058,15 @@ ImplicitGrid::QueryObject::visitCandidates( { continue; } - // currWord now contains the resulting candidacy information - // for our given point + // currWord now contains the resulting candidacy information for our given point int numBits = axom::utilities::min(bitsPerWord, nbits - (iword * 64)); - int currBit = axom::utilities::trailingZeros(currWord); + int currBit = axom::utilities::countr_zero(currWord); while(currBit < numBits) { bool found = getVisitResult(candidatePredicate, iword * BitsetType::BitsPerWord + currBit); currBit++; - currBit += axom::utilities::trailingZeros(currWord >> currBit); + currBit += axom::utilities::countr_zero(currWord >> currBit); if(found) { return; @@ -1128,13 +1130,13 @@ ImplicitGrid::QueryObject::visitCandidates( // currWord now contains the resulting candidacy information // for our given point int numBits = axom::utilities::min(bitsPerWord, nbits - (iword * 64)); - int currBit = axom::utilities::trailingZeros(currWord); + int currBit = axom::utilities::countr_zero(currWord); while(currBit < numBits) { bool found = getVisitResult(candidatePredicate, iword * BitsetType::BitsPerWord + currBit); currBit++; - currBit += axom::utilities::trailingZeros(currWord >> currBit); + currBit += axom::utilities::countr_zero(currWord >> currBit); if(found) { return; diff --git a/src/axom/spin/MortonIndex.hpp b/src/axom/spin/MortonIndex.hpp index 4034e06c01..ce9d8ad5ef 100644 --- a/src/axom/spin/MortonIndex.hpp +++ b/src/axom/spin/MortonIndex.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/OctreeBase.hpp b/src/axom/spin/OctreeBase.hpp index ff344d86ff..3bf0e6ac16 100644 --- a/src/axom/spin/OctreeBase.hpp +++ b/src/axom/spin/OctreeBase.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -20,7 +20,7 @@ #include "axom/spin/OctreeLevel.hpp" #include "axom/spin/SparseOctreeLevel.hpp" -#include // for ostream in print +#include namespace axom { diff --git a/src/axom/spin/OctreeLevel.hpp b/src/axom/spin/OctreeLevel.hpp index a79ad1f8bc..9cf43e79d3 100644 --- a/src/axom/spin/OctreeLevel.hpp +++ b/src/axom/spin/OctreeLevel.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/RectangularLattice.hpp b/src/axom/spin/RectangularLattice.hpp index 18f2eff82d..3d7313becb 100644 --- a/src/axom/spin/RectangularLattice.hpp +++ b/src/axom/spin/RectangularLattice.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/SparseOctreeLevel.hpp b/src/axom/spin/SparseOctreeLevel.hpp index 9572cf7e59..b6f0731448 100644 --- a/src/axom/spin/SparseOctreeLevel.hpp +++ b/src/axom/spin/SparseOctreeLevel.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/SpatialOctree.hpp b/src/axom/spin/SpatialOctree.hpp index e13a013901..deecfe44e6 100644 --- a/src/axom/spin/SpatialOctree.hpp +++ b/src/axom/spin/SpatialOctree.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/UniformGrid.hpp b/src/axom/spin/UniformGrid.hpp index eeaf689ae1..d4469789cd 100644 --- a/src/axom/spin/UniformGrid.hpp +++ b/src/axom/spin/UniformGrid.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -745,8 +745,13 @@ void UniformGrid::getCandidatesAsArray( totalCountReduce += counts_view[i]; }); - // Step 2: exclusive scan for offsets in candidate array + // Step 2: exclusive scan for offsets in candidate array + // Intel oneAPI compiler segfaults with OpenMP RAJA scan + #ifdef __INTEL_LLVM_COMPILER + using exec_policy = typename axom::execution_space::loop_policy; + #else using exec_policy = typename axom::execution_space::loop_policy; + #endif RAJA::exclusive_scan(RAJA::make_span(outCounts.data(), qsize), RAJA::make_span(outOffsets.data(), qsize), RAJA::operators::plus {}); diff --git a/src/axom/spin/docs/sphinx/bvh.rst b/src/axom/spin/docs/sphinx/bvh.rst index a1133436dd..343b58c084 100644 --- a/src/axom/spin/docs/sphinx/bvh.rst +++ b/src/axom/spin/docs/sphinx/bvh.rst @@ -94,7 +94,7 @@ might be used in a broad-phase collision detection problem. First, we initialize the BVH with the bounding boxes of all the query objects (mesh elements), and create a traverser object: -.. literalinclude:: ../../examples/spin_bvh_two_pass.cpp +.. literalinclude:: ../../../quest/examples/quest_bvh_two_pass.cpp :start-after: _bvh_traverse_init_start :end-before: _bvh_traverse_init_end :language: C++ @@ -104,7 +104,7 @@ in the mesh against each other, our query objects are bounding boxes. Thus, the traversal predicate tests if the query bounding box intersects with the bounding boxes of nodes in the BVH: -.. literalinclude:: ../../examples/spin_bvh_two_pass.cpp +.. literalinclude:: ../../../quest/examples/quest_bvh_two_pass.cpp :start-after: _bvh_traverse_predicate_start :end-before: _bvh_traverse_predicate_end :language: C++ @@ -114,7 +114,7 @@ traverse the BVH twice; for the first traversal we count the number of candidate intersections for each query object, allowing us to compute offset indices and total storage requirements for the collision pairs: -.. literalinclude:: ../../examples/spin_bvh_two_pass.cpp +.. literalinclude:: ../../../quest/examples/quest_bvh_two_pass.cpp :start-after: _bvh_traverse_first_pass_start :end-before: _bvh_traverse_first_pass_end :language: C++ @@ -123,7 +123,7 @@ After computing offset indices and allocating output arrays, we can then perform a second traversal through the BVH. This time, we will store candidate collision pairs when we reach a leaf node: -.. literalinclude:: ../../examples/spin_bvh_two_pass.cpp +.. literalinclude:: ../../../quest/examples/quest_bvh_two_pass.cpp :start-after: _bvh_traverse_second_pass_start :end-before: _bvh_traverse_second_pass_end :language: C++ diff --git a/src/axom/spin/docs/sphinx/index.rst b/src/axom/spin/docs/sphinx/index.rst index b4d16189f3..5ec0057958 100644 --- a/src/axom/spin/docs/sphinx/index.rst +++ b/src/axom/spin/docs/sphinx/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/examples/CMakeLists.txt b/src/axom/spin/examples/CMakeLists.txt index 1d4d5a174a..88e399a3aa 100644 --- a/src/axom/spin/examples/CMakeLists.txt +++ b/src/axom/spin/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -18,17 +18,3 @@ axom_add_executable( DEPENDS_ON ${spin_example_depends} FOLDER axom/spin/examples ) - -# Note: The following example uses quest to read in an STL file -# and mint for meshing -if (AXOM_ENABLE_QUEST AND RAJA_FOUND AND UMPIRE_FOUND) - - axom_add_executable( - NAME spin_bvh_two_pass_ex - SOURCES spin_bvh_two_pass.cpp - OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY} - DEPENDS_ON quest - FOLDER axom/spin/examples - ) - -endif() diff --git a/src/axom/spin/examples/spin_introduction.cpp b/src/axom/spin/examples/spin_introduction.cpp index dde580dcd3..d023bcf8e3 100644 --- a/src/axom/spin/examples/spin_introduction.cpp +++ b/src/axom/spin/examples/spin_introduction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/internal/linear_bvh/RadixTree.hpp b/src/axom/spin/internal/linear_bvh/RadixTree.hpp index bd72c7b2aa..ac5e7b4613 100644 --- a/src/axom/spin/internal/linear_bvh/RadixTree.hpp +++ b/src/axom/spin/internal/linear_bvh/RadixTree.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/internal/linear_bvh/build_radix_tree.hpp b/src/axom/spin/internal/linear_bvh/build_radix_tree.hpp index c98b4fbe0f..14c1c4e093 100644 --- a/src/axom/spin/internal/linear_bvh/build_radix_tree.hpp +++ b/src/axom/spin/internal/linear_bvh/build_radix_tree.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -6,12 +6,12 @@ #ifndef AXOM_SPIN_BUILD_RADIX_TREE_H_ #define AXOM_SPIN_BUILD_RADIX_TREE_H_ -#include "axom/config.hpp" // for axom compile-time definitions +#include "axom/config.hpp" #include "axom/core/execution/execution_space.hpp" #include "axom/core/execution/for_all.hpp" -#include "axom/core/utilities/AnnotationMacros.hpp" // for annotations +#include "axom/core/utilities/AnnotationMacros.hpp" #include "axom/primal/geometry/BoundingBox.hpp" #include "axom/primal/geometry/Point.hpp" @@ -20,16 +20,16 @@ #include "axom/spin/MortonIndex.hpp" -#include "axom/core/utilities/Utilities.hpp" // for isNearlyEqual() -#include "axom/core/utilities/BitUtilities.hpp" // for leadingZeros() -#include "axom/slic/interface/slic.hpp" // for slic +#include "axom/core/utilities/Utilities.hpp" +#include "axom/core/utilities/BitUtilities.hpp" +#include "axom/slic/interface/slic.hpp" #if defined(AXOM_USE_RAJA) // RAJA includes #include "RAJA/RAJA.hpp" #endif -#include // For std::atomic_thread_fence +#include #if defined(AXOM_USE_CUDA) && defined(AXOM_USE_RAJA) // NOTE: uses the cub installation that is bundled with RAJA @@ -300,7 +300,7 @@ AXOM_HOST_DEVICE IntType delta(const IntType& a, tie = (exor == 0); //break the tie, a and b must always differ exor = tie ? std::uint32_t(a) ^ std::uint32_t(bb) : exor; - std::int32_t count = axom::utilities::leadingZeros(exor); + std::int32_t count = axom::utilities::countl_zero(exor); if(tie) { count += 32; diff --git a/src/axom/spin/internal/linear_bvh/bvh_traverse.hpp b/src/axom/spin/internal/linear_bvh/bvh_traverse.hpp index d5dec4e280..1723a5d0bf 100644 --- a/src/axom/spin/internal/linear_bvh/bvh_traverse.hpp +++ b/src/axom/spin/internal/linear_bvh/bvh_traverse.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/internal/linear_bvh/bvh_vtkio.hpp b/src/axom/spin/internal/linear_bvh/bvh_vtkio.hpp index 27571de1a3..0c594cc1b8 100644 --- a/src/axom/spin/internal/linear_bvh/bvh_vtkio.hpp +++ b/src/axom/spin/internal/linear_bvh/bvh_vtkio.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/policy/LinearBVH.hpp b/src/axom/spin/policy/LinearBVH.hpp index 2994f9773d..62a51f2656 100644 --- a/src/axom/spin/policy/LinearBVH.hpp +++ b/src/axom/spin/policy/LinearBVH.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -354,8 +354,13 @@ axom::Array LinearBVH::findCandidatesImp total_count_reduce += count; });); - // STEP 2: exclusive scan to get offsets in candidate array for each query + // STEP 2: exclusive scan to get offsets in candidate array for each query + // Intel oneAPI compiler segfaults with OpenMP RAJA scan + #ifdef __INTEL_LLVM_COMPILER + using exec_policy = typename axom::execution_space::loop_policy; + #else using exec_policy = typename axom::execution_space::loop_policy; + #endif AXOM_PERF_MARK_SECTION( "exclusive_scan", RAJA::exclusive_scan(RAJA::make_span(counts.data(), numObjs), diff --git a/src/axom/spin/policy/UniformGridStorage.hpp b/src/axom/spin/policy/UniformGridStorage.hpp index 3d54854053..db94b2b136 100644 --- a/src/axom/spin/policy/UniformGridStorage.hpp +++ b/src/axom/spin/policy/UniformGridStorage.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/tests/CMakeLists.txt b/src/axom/spin/tests/CMakeLists.txt index eca572c37b..20a6d7c6e5 100644 --- a/src/axom/spin/tests/CMakeLists.txt +++ b/src/axom/spin/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/tests/spin_bvh.cpp b/src/axom/spin/tests/spin_bvh.cpp index d839bae807..d62de37cf7 100644 --- a/src/axom/spin/tests/spin_bvh.cpp +++ b/src/axom/spin/tests/spin_bvh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -1173,9 +1173,9 @@ void check_find_points_zip3d() BoxType* aabbs = nullptr; generate_aabbs_and_centroids(&mesh, aabbs, centroids); - FloatType* xs = axom::allocate(ncells); - FloatType* ys = axom::allocate(ncells); - FloatType* zs = axom::allocate(ncells); + axom::Array xs(ncells, ncells); + axom::Array ys(ncells, ncells); + axom::Array zs(ncells, ncells); for(int icell = 0; icell < ncells; icell++) { @@ -1184,7 +1184,7 @@ void check_find_points_zip3d() zs[icell] = centroids[icell][2]; } - primal::ZipIndexable zip_test {{xs, ys, zs}}; + primal::ZipIndexable zip_test {{xs.data(), ys.data(), zs.data()}}; // construct the BVH spin::BVH bvh; @@ -1213,11 +1213,8 @@ void check_find_points_zip3d() const int donorCellIdx = ug.getBinIndex(q); EXPECT_EQ(counts[i], 1); EXPECT_EQ(donorCellIdx, candidates[offsets[i]]); - } // END for all cell centroids + } - axom::deallocate(xs); - axom::deallocate(ys); - axom::deallocate(zs); axom::deallocate(aabbs); axom::setDefaultAllocator(current_allocator); @@ -1265,9 +1262,9 @@ void check_find_points_zip2d() BoxType* aabbs = nullptr; generate_aabbs_and_centroids(&mesh, aabbs, centroids); - FloatType* xs = axom::allocate(ncells); - FloatType* ys = axom::allocate(ncells); - FloatType* zs = nullptr; + axom::Array xs(ncells, ncells); + axom::Array ys(ncells, ncells); + FloatType* zs {nullptr}; for(int icell = 0; icell < ncells; icell++) { @@ -1275,7 +1272,7 @@ void check_find_points_zip2d() ys[icell] = centroids[icell][1]; } - primal::ZipIndexable zip_test {{xs, ys, zs}}; + primal::ZipIndexable zip_test {{xs.data(), ys.data(), zs}}; // construct the BVH spin::BVH bvh; @@ -1865,7 +1862,7 @@ AXOM_CUDA_TEST(spin_bvh, use_pool_allocator) 0, 1, AXOM_LAMBDA(axom::IndexType idx) { - boxes[idx] = {PointType(0.), PointType(1.)}; + boxes[idx] = BoxType {PointType(0.), PointType(1.)}; }); // construct a BVH with a single box diff --git a/src/axom/spin/tests/spin_implicit_grid.cpp b/src/axom/spin/tests/spin_implicit_grid.cpp index 5c44a7cd91..d1c0c706b6 100644 --- a/src/axom/spin/tests/spin_implicit_grid.cpp +++ b/src/axom/spin/tests/spin_implicit_grid.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/tests/spin_morton.cpp b/src/axom/spin/tests/spin_morton.cpp index 27ffd7c5fb..1f1ed34d98 100644 --- a/src/axom/spin/tests/spin_morton.cpp +++ b/src/axom/spin/tests/spin_morton.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -26,7 +26,7 @@ using axom::primal::Point; namespace { -static const int MAX_ITER = 10000; +constexpr int MAX_ITER = 10000; // Generate a random integer in the range [beg, end) template diff --git a/src/axom/spin/tests/spin_octree.cpp b/src/axom/spin/tests/spin_octree.cpp index 58d6d2b370..34625e5818 100644 --- a/src/axom/spin/tests/spin_octree.cpp +++ b/src/axom/spin/tests/spin_octree.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/tests/spin_rectangular_lattice.cpp b/src/axom/spin/tests/spin_rectangular_lattice.cpp index f3c1b8e98f..7431c064d1 100644 --- a/src/axom/spin/tests/spin_rectangular_lattice.cpp +++ b/src/axom/spin/tests/spin_rectangular_lattice.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/tests/spin_spatial_octree.cpp b/src/axom/spin/tests/spin_spatial_octree.cpp index 80848633f6..c68c54b1c7 100644 --- a/src/axom/spin/tests/spin_spatial_octree.cpp +++ b/src/axom/spin/tests/spin_spatial_octree.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/axom/spin/tests/spin_uniform_grid.cpp b/src/axom/spin/tests/spin_uniform_grid.cpp index 563d2e258a..f90a2827d8 100644 --- a/src/axom/spin/tests/spin_uniform_grid.cpp +++ b/src/axom/spin/tests/spin_uniform_grid.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/AxomConfig.cmake b/src/cmake/AxomConfig.cmake index e887e06d46..6d4865b544 100644 --- a/src/cmake/AxomConfig.cmake +++ b/src/cmake/AxomConfig.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -147,6 +147,8 @@ install( ${AXOM_INSTALL_CMAKE_MODULE_DIR} ) +# Install BLT files that recreate BLT targets in downstream projects +blt_install_tpl_setups(DESTINATION ${AXOM_INSTALL_CMAKE_MODULE_DIR}) #------------------------------------------------------------------------------ # Create a list of exported targets so that other projects that include Axom @@ -156,10 +158,7 @@ install( # Add it to a temporary list before creating the cache variable to use list(APPEND) set(_axom_exported_targets ${AXOM_COMPONENTS_ENABLED}) -blt_list_append(TO _axom_exported_targets ELEMENTS cuda cuda_runtime IF AXOM_ENABLE_CUDA) -blt_list_append(TO _axom_exported_targets ELEMENTS hip hip_runtime IF AXOM_ENABLE_HIP) - -set(_optional_targets cli11 fmt hdf5 lua openmp sol sparsehash) +set(_optional_targets cli11 fmt hdf5 lua sol sparsehash) foreach(_tar ${_optional_targets}) string(TOUPPER ${_tar} _upper_tar) if(ENABLE_${_upper_tar} OR ${_upper_tar}_FOUND) diff --git a/src/cmake/AxomMacros.cmake b/src/cmake/AxomMacros.cmake index 0fddf186e5..d70caec9c5 100644 --- a/src/cmake/AxomMacros.cmake +++ b/src/cmake/AxomMacros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -259,6 +259,30 @@ macro(axom_add_test) endmacro(axom_add_test) +#------------------------------------------------------------------------------ +# Asserts that the given VARIABLE_NAME's value is a directory and exists. +# Fails with a helpful message when it doesn't. +#------------------------------------------------------------------------------ +macro(axom_assert_is_directory) + + set(options) + set(singleValueArgs VARIABLE_NAME) + set(multiValueArgs) + + # Parse the arguments to the macro + cmake_parse_arguments(arg + "${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN}) + + if (NOT EXISTS "${${arg_VARIABLE_NAME}}") + message(FATAL_ERROR "Given ${arg_VARIABLE_NAME} does not exist: ${${arg_VARIABLE_NAME}}") + endif() + + if (NOT IS_DIRECTORY "${${arg_VARIABLE_NAME}}") + message(FATAL_ERROR "Given ${arg_VARIABLE_NAME} is not a directory: ${${arg_VARIABLE_NAME}}") + endif() + +endmacro(axom_assert_is_directory) + ##------------------------------------------------------------------------------ ## convert_to_native_escaped_file_path( path output ) ## @@ -444,7 +468,7 @@ macro(axom_write_unified_header) set(_header ${PROJECT_BINARY_DIR}/include/axom/${_lcname}.hpp) set(_tmp_header ${_header}.tmp) - file(WRITE ${_tmp_header} "\/\/ Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and + file(WRITE ${_tmp_header} "\/\/ Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and \/\/ other Axom Project Developers. See the top-level LICENSE file for details. \/\/ \/\/ SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/AxomOptions.cmake b/src/cmake/AxomOptions.cmake index c3cf37b1cd..9340ae4075 100644 --- a/src/cmake/AxomOptions.cmake +++ b/src/cmake/AxomOptions.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/AxomVersion.cmake b/src/cmake/AxomVersion.cmake index 9b69ecef0c..64e3554110 100644 --- a/src/cmake/AxomVersion.cmake +++ b/src/cmake/AxomVersion.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -9,8 +9,8 @@ # otherwise, the hard-coded values will go in to the config. #------------------------------------------------------------------------------ set(AXOM_VERSION_MAJOR 0) -set(AXOM_VERSION_MINOR 8) -set(AXOM_VERSION_PATCH 1) +set(AXOM_VERSION_MINOR 9) +set(AXOM_VERSION_PATCH 0) 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 362b316258..ff60181902 100644 --- a/src/cmake/CMakeBasics.cmake +++ b/src/cmake/CMakeBasics.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -216,17 +216,17 @@ endif() #------------------------------------------------------------------------------ # Build up an AXOM_CONFIG_NAME if not already provided +# Note: some variables might be defined but empty (e.g. CMAKE_BUILD_TYPE in our +# MacOS CI AppleClang configuration) so check before appending them to the list if(NOT DEFINED AXOM_CONFIG_NAME) set(_config "") - if(DEFINED ENV{SYS_TYPE}) + if(DEFINED ENV{SYS_TYPE} AND NOT "$ENV{SYS_TYPE}" STREQUAL "") blt_list_append(TO _config ELEMENTS $ENV{SYS_TYPE}) endif() - if(DEFINED ENV{LCSCHEDCLUSTER}) + if(DEFINED ENV{LCSCHEDCLUSTER} AND NOT "$ENV{LCSCHEDCLUSTER}" STREQUAL "") blt_list_append(TO _config ELEMENTS $ENV{LCSCHEDCLUSTER}) endif() blt_list_append(TO _config ELEMENTS ${CMAKE_CXX_COMPILER_ID}) - # Note: the second condition is required since CMAKE_BUILD_TYPE might be empty - # e.g. in our MacOS CI AppleClang configuration if(NOT CMAKE_CONFIGURATION_TYPES AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "") blt_list_append(TO _config ELEMENTS ${CMAKE_BUILD_TYPE}) endif() diff --git a/src/cmake/Dashboard.cmake.in b/src/cmake/Dashboard.cmake.in index 8dc22ab982..5630bcee17 100644 --- a/src/cmake/Dashboard.cmake.in +++ b/src/cmake/Dashboard.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/axom-config.cmake.in b/src/cmake/axom-config.cmake.in index 1d08e79267..e8f47bfb78 100644 --- a/src/cmake/axom-config.cmake.in +++ b/src/cmake/axom-config.cmake.in @@ -1,10 +1,10 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) #------------------------------------------------------------------------------ -cmake_minimum_required(VERSION 3.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.8 FATAL_ERROR) @PACKAGE_INIT@ @@ -75,6 +75,11 @@ if(NOT AXOM_FOUND) #---------------------------------------------------------------------------- include(CMakeFindDependencyMacro) + # Enable various find commands to look in non-default paths + set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE) + set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE) + set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE) + # c2c if(AXOM_USE_C2C) set(AXOM_C2C_DIR "@C2C_DIR@") @@ -84,10 +89,28 @@ if(NOT AXOM_FOUND) # camp if(AXOM_USE_CAMP) set(AXOM_CAMP_DIR "@CAMP_DIR@") - if(NOT CAMP_DIR) + if(NOT CAMP_DIR) set(CAMP_DIR ${AXOM_CAMP_DIR}) endif() - find_dependency(camp REQUIRED NO_DEFAULT_PATH PATHS "${CAMP_DIR}/lib/cmake/camp") + find_dependency(camp REQUIRED PATHS "${CAMP_DIR}") + endif() + + # umpire + if(AXOM_USE_UMPIRE) + set(AXOM_UMPIRE_DIR "@UMPIRE_DIR@") + if(NOT UMPIRE_DIR) + set(UMPIRE_DIR ${AXOM_UMPIRE_DIR}) + endif() + find_dependency(umpire REQUIRED PATHS "${UMPIRE_DIR}") + endif() + + # raja + if(AXOM_USE_RAJA) + set(AXOM_RAJA_DIR "@RAJA_DIR@") + if(NOT RAJA_DIR) + set(RAJA_DIR ${AXOM_RAJA_DIR}) + endif() + find_dependency(RAJA REQUIRED PATHS "${RAJA_DIR}") endif() # conduit @@ -102,54 +125,33 @@ if(NOT AXOM_FOUND) find_package(MPI REQUIRED) endif() - find_dependency(Conduit REQUIRED NO_DEFAULT_PATH - PATHS "${CONDUIT_DIR}/@AXOM_CONDUIT_CONFIG_SUBDIR@") + find_dependency(Conduit REQUIRED + PATHS "${CONDUIT_DIR}" + "${CONDUIT_DIR}/lib/cmake/conduit") endif() # hdf5 if(AXOM_USE_HDF5) set(AXOM_HDF5_DIR "@HDF5_DIR@") - # Note: Targets not currently imported + # Note: 'hdf5" target is exported as 'axom::hdf5' endif() # lua if(AXOM_USE_LUA) set(AXOM_LUA_DIR "@LUA_DIR@") - # Note: Targets not currently imported + # Note: 'lua" target is exported as 'axom::lua' endif() # mfem if(AXOM_USE_MFEM) set(AXOM_MFEM_DIR "@MFEM_DIR@") - # Note: Targets not currently imported - endif() - - # raja - if(AXOM_USE_RAJA) - set(AXOM_RAJA_DIR "@RAJA_DIR@") - if(NOT RAJA_DIR) - set(RAJA_DIR ${AXOM_RAJA_DIR}) - endif() - find_dependency(RAJA REQUIRED NO_DEFAULT_PATH - PATHS "${RAJA_DIR}/share/raja/cmake" - "${RAJA_DIR}/lib/cmake/raja") + # Note: 'mfem" target is exported as 'axom::mfem' endif() # scr if(AXOM_USE_SCR) set(AXOM_SCR_DIR "@SCR_DIR@") - # Note: Targets not currently imported - endif() - - # umpire - if(AXOM_USE_UMPIRE) - set(AXOM_UMPIRE_DIR "@UMPIRE_DIR@") - if(NOT UMPIRE_DIR) - set(UMPIRE_DIR ${AXOM_UMPIRE_DIR}) - endif() - find_dependency(umpire REQUIRED NO_DEFAULT_PATH - PATHS "${UMPIRE_DIR}/share/umpire/cmake" - "${UMPIRE_DIR}/lib/cmake/umpire") + # Note: 'scr" target is exported as 'axom::scr' endif() #---------------------------------------------------------------------------- @@ -165,6 +167,7 @@ if(NOT AXOM_FOUND) # we want the import root, which is right above the "lib" prefix get_filename_component(_IMPORT_ROOT "${_IMPORT_PREFIX}" PATH) + include(${AXOM_CMAKE_CONFIG_DIR}/BLTSetupTargets.cmake) include(${AXOM_CMAKE_CONFIG_DIR}/axom-targets.cmake) # Create convenience target that bundles all Axom targets (axom) @@ -181,16 +184,100 @@ if(NOT AXOM_FOUND) APPEND) endforeach() - # HACK: Clear INTERFACE_COMPILE_OPTIONS to avoid requiring OpenMP in user code - # This can (hopefully) be removed when we fix blt's treatment of OpenMP - if(TARGET RAJA AND AXOM_USE_OPENMP) - set_target_properties(RAJA PROPERTIES INTERFACE_COMPILE_OPTIONS "") + #--------------------------------------------------------------------------- + # Remove non-existant INTERFACE_INCLUDE_DIRECTORIES from imported targets + # to work around CMake error + #--------------------------------------------------------------------------- + + # Support IN_LIST operator for if() + # Policy added in 3.3+ + if(POLICY CMP0057) + cmake_policy(SET CMP0057 NEW) endif() + ## axom_find_target_dependencies(TARGET TLIST ) + ## + ## Store all targets' dependencies (link libraries and interface link libraries) + ## recursively in the variable name TLIST holds. + macro(axom_find_target_dependencies) + + set(options) + set(singleValuedArgs TARGET TLIST) + set(multiValuedArgs) + + # parse the arguments to the macro + cmake_parse_arguments(arg + "${options}" "${singleValuedArgs}" "${multiValuedArgs}" ${ARGN}) + + # check for required arguments + if(NOT DEFINED arg_TARGET) + message(FATAL_ERROR "TARGET is a required parameter for the axom_find_target_dependencies macro") + endif() + + if(NOT DEFINED arg_TLIST OR NOT DEFINED ${arg_TLIST}) + message(FATAL_ERROR "TLIST is a required parameter for the axom_find_target_dependencies macro") + endif() + + set(_depends_on "") + + # Get dependencies if BLT registered library + string(TOUPPER ${arg_TARGET} _target_upper) + if(_BLT_${_target_upper}_IS_REGISTERED_LIBRARY) + list(APPEND _depends_on "${_BLT_${_target_upper}_DEPENDS_ON}") + endif() + + # Get dependencies if CMake target + if(TARGET ${arg_TARGET}) + get_property(_target_type TARGET ${arg_TARGET} PROPERTY TYPE) + if(NOT "${_target_type}" STREQUAL "INTERFACE_LIBRARY") + get_target_property(_propval ${arg_TARGET} LINK_LIBRARIES) + if(_propval) + list(APPEND _depends_on ${_propval}) + endif() + endif() + + # get interface link libraries + get_target_property(_propval ${arg_TARGET} INTERFACE_LINK_LIBRARIES) + if (_propval) + list(APPEND _depends_on ${_propval}) + endif() + endif() + + blt_list_remove_duplicates(TO _depends_on) + foreach(t ${_depends_on}) + if (NOT "${t}" IN_LIST ${arg_TLIST}) + list(APPEND ${arg_TLIST} ${t}) + axom_find_target_dependencies(TARGET ${t} TLIST ${arg_TLIST}) + endif() + endforeach() + + unset(_depends_on) + endmacro(axom_find_target_dependencies) + + set(_deps "") + axom_find_target_dependencies(TARGET axom TLIST _deps) + list(REMOVE_DUPLICATES _deps) + message(STATUS "Removing non-existant include directories from Axom's dependencies...") + + foreach(_target ${_deps}) + if(TARGET ${_target}) + get_target_property(_dirs ${_target} INTERFACE_INCLUDE_DIRECTORIES) + set(_existing_dirs) + foreach(_dir ${_dirs}) + if (EXISTS "${_dir}") + list(APPEND _existing_dirs "${_dir}") + endif() + endforeach() + if (_existing_dirs) + set_target_properties(${_target} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_existing_dirs}" ) + endif() + endif() + endforeach() + #---------------------------------------------------------------------------- - # Indicate that axom is correctly set up + # Indicate that Axom is correctly set up #---------------------------------------------------------------------------- set(AXOM_FOUND TRUE) endif() - diff --git a/src/cmake/blt b/src/cmake/blt index 4e1fa86639..c98f320835 160000 --- a/src/cmake/blt +++ b/src/cmake/blt @@ -1 +1 @@ -Subproject commit 4e1fa86639496e30a22cc10eaf0cd199bcc53008 +Subproject commit c98f320835d71f778fbffcc48f07675142c08635 diff --git a/src/cmake/thirdparty/FindC2C.cmake b/src/cmake/thirdparty/FindC2C.cmake index 66b536f386..3a05a79fea 100644 --- a/src/cmake/thirdparty/FindC2C.cmake +++ b/src/cmake/thirdparty/FindC2C.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/thirdparty/FindConduit.cmake b/src/cmake/thirdparty/FindConduit.cmake deleted file mode 100644 index b460067fc3..0000000000 --- a/src/cmake/thirdparty/FindConduit.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and -# other Axom Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: (BSD-3-Clause) -#------------------------------------------------------------------------------ -# Setup Conduit -#------------------------------------------------------------------------------ -# This file defines: -# CONDUIT_FOUND - If Conduit was found -# -# If found, the Conduit CMake targets will also be imported -#------------------------------------------------------------------------------ - -# first Check for CONDUIT_DIR - -if(NOT CONDUIT_DIR) - MESSAGE(FATAL_ERROR "Could not find Conduit. Conduit requires explicit CONDUIT_DIR.") -endif() - -# This is used in axom-config.cmake.in -set(AXOM_CONDUIT_CONFIG_SUBDIR "lib/cmake/conduit" CACHE PATH "") - -if(NOT WIN32) - set(_conduit_config "${CONDUIT_DIR}/${AXOM_CONDUIT_CONFIG_SUBDIR}/ConduitConfig.cmake") - if(NOT EXISTS ${_conduit_config}) - MESSAGE(FATAL_ERROR "Could not find Conduit cmake include file ${_conduit_config}") - endif() - - find_package(Conduit REQUIRED - NO_DEFAULT_PATH - PATHS ${CONDUIT_DIR}/${AXOM_CONDUIT_CONFIG_SUBDIR}) -else() - # Allow for several different configurations of Conduit - find_package(Conduit CONFIG - REQUIRED - HINTS ${CONDUIT_DIR}/${AXOM_CONDUIT_CONFIG_SUBDIR} - ${CONDUIT_DIR}/cmake/conduit - ${CONDUIT_DIR}/share/cmake/conduit - ${CONDUIT_DIR}/share/conduit - ${CONDUIT_DIR}/cmake) -endif() \ No newline at end of file diff --git a/src/cmake/thirdparty/FindLUA.cmake b/src/cmake/thirdparty/FindLUA.cmake index 7028614b29..bab40fcbab 100644 --- a/src/cmake/thirdparty/FindLUA.cmake +++ b/src/cmake/thirdparty/FindLUA.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/thirdparty/FindMFEM.cmake b/src/cmake/thirdparty/FindMFEM.cmake index 33ec2e5b6d..311aa8ae9b 100644 --- a/src/cmake/thirdparty/FindMFEM.cmake +++ b/src/cmake/thirdparty/FindMFEM.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/thirdparty/FindROCTracer.cmake b/src/cmake/thirdparty/FindROCTracer.cmake index 30c969579e..5894e5ae00 100644 --- a/src/cmake/thirdparty/FindROCTracer.cmake +++ b/src/cmake/thirdparty/FindROCTracer.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/thirdparty/FindSCR.cmake b/src/cmake/thirdparty/FindSCR.cmake index 1ee48aaf88..2bf4f57cfb 100644 --- a/src/cmake/thirdparty/FindSCR.cmake +++ b/src/cmake/thirdparty/FindSCR.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/cmake/thirdparty/SetupAxomThirdParty.cmake b/src/cmake/thirdparty/SetupAxomThirdParty.cmake index a7ba6e59dc..54e7a12012 100644 --- a/src/cmake/thirdparty/SetupAxomThirdParty.cmake +++ b/src/cmake/thirdparty/SetupAxomThirdParty.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -15,11 +15,13 @@ endif() set(TPL_DEPS) +include(CMakeFindDependencyMacro) + #------------------------------------------------------------------------------ # Create global variable to toggle between GPU targets #------------------------------------------------------------------------------ if(AXOM_ENABLE_CUDA) - set(axom_device_depends cuda CACHE STRING "" FORCE) + set(axom_device_depends blt::cuda CACHE STRING "" FORCE) endif() if(AXOM_ENABLE_HIP) set(axom_device_depends blt::hip CACHE STRING "" FORCE) @@ -32,33 +34,29 @@ if ((RAJA_DIR OR UMPIRE_DIR) AND NOT CAMP_DIR) message(FATAL_ERROR "CAMP_DIR is required if RAJA_DIR or UMPIRE_DIR is provided.") endif() -# Note: Let Umpire find Camp via camp_DIR, don't find it ourselves -set(camp_DIR ${CAMP_DIR}) +if(CAMP_DIR) + axom_assert_is_directory(VARIABLE_NAME CAMP_DIR) + find_dependency(camp REQUIRED PATHS "${CAMP_DIR}") + set(CAMP_FOUND TRUE CACHE BOOL "") +else() + set(CAMP_FOUND FALSE CACHE BOOL "") +endif() #------------------------------------------------------------------------------ # UMPIRE #------------------------------------------------------------------------------ if (UMPIRE_DIR) - if (NOT EXISTS "${UMPIRE_DIR}") - message(FATAL_ERROR "Given UMPIRE_DIR does not exist: ${UMPIRE_DIR}") - endif() - - if (NOT IS_DIRECTORY "${UMPIRE_DIR}") - message(FATAL_ERROR "Given UMPIRE_DIR is not a directory: ${UMPIRE_DIR}") - endif() - - find_package(umpire REQUIRED PATHS ${UMPIRE_DIR} ) + axom_assert_is_directory(VARIABLE_NAME UMPIRE_DIR) + find_dependency(umpire REQUIRED PATHS "${UMPIRE_DIR}") message(STATUS "Checking for expected Umpire target 'umpire'") if (NOT TARGET umpire) message(FATAL_ERROR "Umpire failed to load: ${UMPIRE_DIR}") - else() - message(STATUS "Umpire loaded: ${UMPIRE_DIR}") - set_property(TARGET umpire - APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES - ${UMPIRE_INCLUDE_DIRS}) - set(UMPIRE_FOUND TRUE CACHE BOOL "") endif() + message(STATUS "Umpire loaded: ${UMPIRE_DIR}") + set(UMPIRE_FOUND TRUE CACHE BOOL "") + + blt_convert_to_system_includes(TARGET umpire) else() message(STATUS "Umpire support is OFF") set(UMPIRE_FOUND FALSE CACHE BOOL "") @@ -69,42 +67,15 @@ endif() # RAJA #------------------------------------------------------------------------------ if (RAJA_DIR) - if (NOT EXISTS "${RAJA_DIR}") - message(FATAL_ERROR "Given RAJA_DIR does not exist: ${RAJA_DIR}") - endif() - - if (NOT IS_DIRECTORY "${RAJA_DIR}") - message(FATAL_ERROR "Given RAJA_DIR is not a directory: ${RAJA_DIR}") - endif() - - find_package(RAJA REQUIRED PATHS ${RAJA_DIR} ) + axom_assert_is_directory(VARIABLE_NAME RAJA_DIR) + find_dependency(raja REQUIRED PATHS "${RAJA_DIR}") message(STATUS "Checking for expected RAJA target 'RAJA'") if (NOT TARGET RAJA) message(FATAL_ERROR "RAJA failed to load: ${RAJA_DIR}") - else() - message(STATUS "RAJA loaded: ${RAJA_DIR}") - set(RAJA_FOUND TRUE CACHE BOOL "") endif() - - # Suppress warnings from cub and cuda related to the (low) version - # of clang that XL compiler pretends to be. - if(C_COMPILER_FAMILY_IS_XL) - if(TARGET RAJA::cub) - blt_add_target_definitions( - TO RAJA::cub - SCOPE INTERFACE - TARGET_DEFINITIONS CUB_IGNORE_DEPRECATED_CPP_DIALECT) - endif() - - if(TARGET cuda) - blt_add_target_definitions( - TO cuda - SCOPE INTERFACE - TARGET_DEFINITIONS THRUST_IGNORE_DEPRECATED_CPP_DIALECT) - endif() - endif() - + message(STATUS "RAJA loaded: ${RAJA_DIR}") + set(RAJA_FOUND TRUE CACHE BOOL "") else() message(STATUS "RAJA support is OFF" ) set(RAJA_FOUND FALSE CACHE BOOL "") @@ -116,16 +87,19 @@ endif() # Find Conduit first, then find HDF5 to fix "Could NOT find HDF5" issue with # newer CMake versions if (CONDUIT_DIR) - include(cmake/thirdparty/FindConduit.cmake) - - # Manually set includes as system includes - set_property(TARGET conduit::conduit - APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES - "${CONDUIT_INSTALL_PREFIX}/include/") + axom_assert_is_directory(VARIABLE_NAME CONDUIT_DIR) + find_dependency(Conduit REQUIRED + PATHS "${CONDUIT_DIR}" + "${CONDUIT_DIR}/lib/cmake/conduit") + + message(STATUS "Checking for expected Conduit target 'conduit::conduit'") + if (NOT TARGET conduit::conduit) + message(FATAL_ERROR "Conduit failed to load: ${CONDUIT_DIR}") + endif() + message(STATUS "Conduit loaded: ${CONDUIT_DIR}") + set(CONDUIT_FOUND TRUE CACHE BOOL "") - set_property(TARGET conduit::conduit - APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES - "${CONDUIT_INSTALL_PREFIX}/include/conduit/") + blt_convert_to_system_includes(TARGET conduit::conduit) else() message(STATUS "Conduit support is OFF") endif() @@ -134,6 +108,7 @@ endif() # HDF5 #------------------------------------------------------------------------------ if (HDF5_DIR) + axom_assert_is_directory(VARIABLE_NAME HDF5_DIR) include(cmake/thirdparty/SetupHDF5.cmake) blt_list_append(TO TPL_DEPS ELEMENTS hdf5) else() @@ -148,12 +123,19 @@ if (TARGET mfem) # Note - white238: I can't seem to get this to pass install testing due to mfem being included # in multiple export sets message(STATUS "MFEM support is ON, using existing mfem target") + # Add it to this export set but don't prefix it with axom:: - install(TARGETS mfem - EXPORT axom-targets - DESTINATION lib) + # NOTE: imported targets cannot be part of an export set + get_target_property(_is_imported mfem IMPORTED) + if(NOT "${_is_imported}") + install(TARGETS mfem + EXPORT axom-targets + DESTINATION lib) + endif() + set(MFEM_FOUND TRUE CACHE BOOL "" FORCE) elseif (MFEM_DIR) + axom_assert_is_directory(VARIABLE_NAME MFEM_DIR) include(cmake/thirdparty/FindMFEM.cmake) # If the CMake build system was used, a CMake target for mfem already exists if (NOT TARGET mfem) @@ -227,6 +209,8 @@ endif() # SCR #------------------------------------------------------------------------------ if (SCR_DIR) + axom_assert_is_directory(VARIABLE_NAME SCR_DIR) + include(cmake/thirdparty/FindSCR.cmake) blt_import_library( NAME scr INCLUDES ${SCR_INCLUDE_DIRS} @@ -234,6 +218,7 @@ if (SCR_DIR) TREAT_INCLUDES_AS_SYSTEM ON EXPORTABLE ON) blt_list_append(TO TPL_DEPS ELEMENTS scr) + set(SCR_FOUND ON CACHE BOOL "") else() message(STATUS "SCR support is OFF") endif() @@ -243,6 +228,7 @@ endif() # LUA #------------------------------------------------------------------------------ if (LUA_DIR) + axom_assert_is_directory(VARIABLE_NAME LUA_DIR) include(cmake/thirdparty/FindLUA.cmake) if(NOT TARGET lua) blt_import_library( NAME lua @@ -263,6 +249,7 @@ endif() # C2C #------------------------------------------------------------------------------ if (C2C_DIR) + axom_assert_is_directory(VARIABLE_NAME C2C_DIR) include(cmake/thirdparty/FindC2C.cmake) blt_import_library( NAME c2c @@ -276,57 +263,15 @@ else() set(C2C_FOUND OFF CACHE BOOL "") endif() - #------------------------------------------------------------------------------ -# Remove exported OpenMP flags because they are not language agnostic +# jsonschema - for Inlet testing purposes #------------------------------------------------------------------------------ -set(_props) -if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0" ) - list(APPEND _props INTERFACE_LINK_OPTIONS) -endif() -list(APPEND _props INTERFACE_COMPILE_OPTIONS) - -foreach(_target RAJA camp umpire umpire_alloc conduit::conduit) - if(TARGET ${_target}) - message(STATUS "Removing OpenMP Flags from target[${_target}]") - - foreach(_prop ${_props}) - get_target_property(_flags ${_target} ${_prop}) - if ( _flags ) - string( REPLACE "${OpenMP_CXX_FLAGS}" "" - correct_flags "${_flags}" ) - string( REPLACE "${OpenMP_Fortran_FLAGS}" "" - correct_flags "${correct_flags}" ) - - set_target_properties( ${_target} PROPERTIES ${_prop} "${correct_flags}" ) - endif() - endforeach() - endif() -endforeach() - -# Newer versions of RAJA keeps its flags in a specific target -if(TARGET RAJA) - get_target_property(_flags RAJA INTERFACE_LINK_LIBRARIES) - if ( _flags ) - list(REMOVE_ITEM _flags "RAJA::openmp") - set_target_properties( RAJA PROPERTIES INTERFACE_LINK_LIBRARIES "${_flags}" ) - endif() -endif() - -# Clear Camp's openmp target until BLT handles this fully -if (TARGET blt::openmp) - set_target_properties(blt::openmp PROPERTIES INTERFACE_COMPILE_OPTIONS "") - set_target_properties(blt::openmp PROPERTIES INTERFACE_LINK_OPTIONS "") -endif() +set(ENABLE_JSONSCHEMA ON) # required by blt_find_executable +blt_find_executable(NAME jsonschema) #------------------------------------------------------------------------------ # Targets that need to be exported but don't have a CMake config file #------------------------------------------------------------------------------ -blt_list_append(TO TPL_DEPS ELEMENTS cuda cuda_runtime IF AXOM_ENABLE_CUDA) -blt_list_append(TO TPL_DEPS ELEMENTS blt_hip blt_hip_runtime IF AXOM_ENABLE_HIP) -blt_list_append(TO TPL_DEPS ELEMENTS openmp IF AXOM_ENABLE_OPENMP) -blt_list_append(TO TPL_DEPS ELEMENTS mpi IF AXOM_ENABLE_MPI) - foreach(dep ${TPL_DEPS}) # If the target is EXPORTABLE, add it to the export set get_target_property(_is_imported ${dep} IMPORTED) diff --git a/src/cmake/thirdparty/SetupHDF5.cmake b/src/cmake/thirdparty/SetupHDF5.cmake index 2417790072..864a23657d 100644 --- a/src/cmake/thirdparty/SetupHDF5.cmake +++ b/src/cmake/thirdparty/SetupHDF5.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/conf.py b/src/conf.py index 8008a8b2a2..f662a92b0d 100644 --- a/src/conf.py +++ b/src/conf.py @@ -54,6 +54,7 @@ 'sphinx.ext.graphviz', 'sphinx.ext.autodoc', 'sphinx.ext.doctest', + 'sphinxcontrib.jquery', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.mathjax' @@ -77,7 +78,7 @@ # General information about the project. project = u'Axom' -copyright = u'2017-2023, Lawrence Livermore National Security, LLNS' +copyright = u'2017-2024, Lawrence Livermore National Security, LLNS' # -- Option for numbering figures/tables/etc.----------------------------------- # Note: numfig requires Sphinx (1.3+) @@ -244,8 +245,16 @@ # primal, quest, sphinx: # override wide tables in RTD theme # (Thanks to https://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html) -html_context = { 'css_files': [ '_static/theme_overrides.css', ], } +# These folders are copied to the documentation's HTML output +html_static_path = ['docs/sphinx/_static/theme_overrides.css'] +# These paths are either relative to html_static_path +# or fully qualified paths (eg. https://...) +html_css_files = [ + 'theme_overrides.css', +] + +html_logo = "../share/axom/logo/axom_logo_transparent.png" # -- Options for LaTeX output --------------------------------------------- diff --git a/src/docs/CMakeLists.txt b/src/docs/CMakeLists.txt index f22195a3b9..e8eff3bbbc 100644 --- a/src/docs/CMakeLists.txt +++ b/src/docs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/doxygen/CMakeLists.txt b/src/docs/doxygen/CMakeLists.txt index 1a3f035304..728d9c1f19 100644 --- a/src/docs/doxygen/CMakeLists.txt +++ b/src/docs/doxygen/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/doxygen/Doxyfile.in b/src/docs/doxygen/Doxyfile.in index 015383c699..548d1bfad6 100644 --- a/src/docs/doxygen/Doxyfile.in +++ b/src/docs/doxygen/Doxyfile.in @@ -231,12 +231,6 @@ TAB_SIZE = 4 ALIASES = "accelerated=\xrefitem accelerated_list \"\"\"\"" \ "collective=\xrefitem collective_list \"\"\"\"" -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -800,7 +794,6 @@ INPUT = @PROJECT_SOURCE_DIR@/axom/doxygen_mainpage.md \ @PROJECT_SOURCE_DIR@/axom/quest \ @PROJECT_SOURCE_DIR@/axom/quest/doxygen_mainpage.md \ @PROJECT_SOURCE_DIR@/axom/quest/interface \ - @PROJECT_SOURCE_DIR@/axom/quest/stl \ @PROJECT_SOURCE_DIR@/axom/sidre/doxygen_mainpage.md \ @PROJECT_SOURCE_DIR@/axom/sidre/core \ @PROJECT_SOURCE_DIR@/axom/sidre/spio \ @@ -1081,13 +1074,6 @@ VERBATIM_HEADERS = NO ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -2081,7 +2067,10 @@ INCLUDE_FILE_PATTERNS = # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. PREDEFINED = MINT_USE_SIDRE \ - AXOM_DEBUG + AXOM_DEBUG \ + AXOM_RUNTIME_POLICY_USE_OPENMP \ + AXOM_RUNTIME_POLICY_USE_CUDA \ + AXOM_RUNTIME_POLICY_USE_HIP # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2148,12 +2137,6 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = @SAMRAI_PERL@ - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2167,15 +2150,6 @@ PERL_PATH = @SAMRAI_PERL@ CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2374,7 +2348,7 @@ INTERACTIVE_SVG = YES # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = @DOT_PATH@ +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile diff --git a/src/docs/licenses.rst b/src/docs/licenses.rst index f00c81d2e4..60eb4e415d 100644 --- a/src/docs/licenses.rst +++ b/src/docs/licenses.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/requirements.txt b/src/docs/requirements.txt index 93120e66c8..0a42ee80cd 100644 --- a/src/docs/requirements.txt +++ b/src/docs/requirements.txt @@ -1 +1,3 @@ -docutils<0.18 +docutils +sphinx==6.2.1 +sphinx-rtd-theme==1.2.2 diff --git a/src/docs/sphinx/_static/theme_overrides.css b/src/docs/sphinx/_static/theme_overrides.css index 63ee6cc74c..2b9dcf80da 100644 --- a/src/docs/sphinx/_static/theme_overrides.css +++ b/src/docs/sphinx/_static/theme_overrides.css @@ -11,3 +11,12 @@ overflow: visible !important; } } + +a img.logo { + transform: scale(.75) +} + +/* Sidebar header (and topbar for mobile) */ +.wy-side-nav-search, .wy-nav-top { + background: #343131; +} diff --git a/src/docs/sphinx/coding_guide/index.rst b/src/docs/sphinx/coding_guide/index.rst index 3a5df4938d..e2f1222db9 100644 --- a/src/docs/sphinx/coding_guide/index.rst +++ b/src/docs/sphinx/coding_guide/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/references.rst b/src/docs/sphinx/coding_guide/references.rst index 0def332fec..6324b5ad4c 100644 --- a/src/docs/sphinx/coding_guide/references.rst +++ b/src/docs/sphinx/coding_guide/references.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec01_changing_code.rst b/src/docs/sphinx/coding_guide/sec01_changing_code.rst index 1b2b40bf43..7b04a66d45 100644 --- a/src/docs/sphinx/coding_guide/sec01_changing_code.rst +++ b/src/docs/sphinx/coding_guide/sec01_changing_code.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec02_names.rst b/src/docs/sphinx/coding_guide/sec02_names.rst index 7b88f0f7c8..9a74330940 100644 --- a/src/docs/sphinx/coding_guide/sec02_names.rst +++ b/src/docs/sphinx/coding_guide/sec02_names.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec03_dir_org.rst b/src/docs/sphinx/coding_guide/sec03_dir_org.rst index d5a639c94d..db1cb268ff 100644 --- a/src/docs/sphinx/coding_guide/sec03_dir_org.rst +++ b/src/docs/sphinx/coding_guide/sec03_dir_org.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec04_header_org.rst b/src/docs/sphinx/coding_guide/sec04_header_org.rst index 77082a339e..1db08ae897 100644 --- a/src/docs/sphinx/coding_guide/sec04_header_org.rst +++ b/src/docs/sphinx/coding_guide/sec04_header_org.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec05_source_org.rst b/src/docs/sphinx/coding_guide/sec05_source_org.rst index 5590eb2b02..46743d9792 100644 --- a/src/docs/sphinx/coding_guide/sec05_source_org.rst +++ b/src/docs/sphinx/coding_guide/sec05_source_org.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec06_scope.rst b/src/docs/sphinx/coding_guide/sec06_scope.rst index df91e12801..ec3979827c 100644 --- a/src/docs/sphinx/coding_guide/sec06_scope.rst +++ b/src/docs/sphinx/coding_guide/sec06_scope.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec07_documentation.rst b/src/docs/sphinx/coding_guide/sec07_documentation.rst index c197ca3c5e..671ef063e6 100644 --- a/src/docs/sphinx/coding_guide/sec07_documentation.rst +++ b/src/docs/sphinx/coding_guide/sec07_documentation.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -215,7 +215,7 @@ files. .. code-block:: cpp /* - * Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC. + * Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC. * Produced at the Lawrence Livermore National Laboratory. * * All rights reserved. diff --git a/src/docs/sphinx/coding_guide/sec08_design_implement.rst b/src/docs/sphinx/coding_guide/sec08_design_implement.rst index 9e2d2de1ed..a8886896c8 100644 --- a/src/docs/sphinx/coding_guide/sec08_design_implement.rst +++ b/src/docs/sphinx/coding_guide/sec08_design_implement.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec09_format.rst b/src/docs/sphinx/coding_guide/sec09_format.rst index 9765d35bf7..a79b5f68b3 100644 --- a/src/docs/sphinx/coding_guide/sec09_format.rst +++ b/src/docs/sphinx/coding_guide/sec09_format.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec10_dev_macros.rst b/src/docs/sphinx/coding_guide/sec10_dev_macros.rst index 095de25658..cf92fd2956 100644 --- a/src/docs/sphinx/coding_guide/sec10_dev_macros.rst +++ b/src/docs/sphinx/coding_guide/sec10_dev_macros.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/coding_guide/sec11_portability.rst b/src/docs/sphinx/coding_guide/sec11_portability.rst index e131633bde..bd913b599f 100644 --- a/src/docs/sphinx/coding_guide/sec11_portability.rst +++ b/src/docs/sphinx/coding_guide/sec11_portability.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/component_org.rst b/src/docs/sphinx/dev_guide/component_org.rst index cb30b79f36..b5bfeec236 100644 --- a/src/docs/sphinx/dev_guide/component_org.rst +++ b/src/docs/sphinx/dev_guide/component_org.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/continuous_integration.rst b/src/docs/sphinx/dev_guide/continuous_integration.rst index 57e48cfa8e..a003f8b314 100644 --- a/src/docs/sphinx/dev_guide/continuous_integration.rst +++ b/src/docs/sphinx/dev_guide/continuous_integration.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/dev_summary.rst b/src/docs/sphinx/dev_guide/dev_summary.rst index ce723a6aaf..7185a659a9 100644 --- a/src/docs/sphinx/dev_guide/dev_summary.rst +++ b/src/docs/sphinx/dev_guide/dev_summary.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/gitflow_branching.rst b/src/docs/sphinx/dev_guide/gitflow_branching.rst index 236ae8b1d8..411a1c9592 100644 --- a/src/docs/sphinx/dev_guide/gitflow_branching.rst +++ b/src/docs/sphinx/dev_guide/gitflow_branching.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/github.rst b/src/docs/sphinx/dev_guide/github.rst index 6f75e94863..b7cbc37d98 100644 --- a/src/docs/sphinx/dev_guide/github.rst +++ b/src/docs/sphinx/dev_guide/github.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/gpu_porting.rst b/src/docs/sphinx/dev_guide/gpu_porting.rst index f9eaa22957..cf0ffaca9f 100644 --- a/src/docs/sphinx/dev_guide/gpu_porting.rst +++ b/src/docs/sphinx/dev_guide/gpu_porting.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/index.rst b/src/docs/sphinx/dev_guide/index.rst index 5ede84dad1..80f8b6a96d 100644 --- a/src/docs/sphinx/dev_guide/index.rst +++ b/src/docs/sphinx/dev_guide/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/misc_tasks.rst b/src/docs/sphinx/dev_guide/misc_tasks.rst index cde8160614..753376ca7d 100644 --- a/src/docs/sphinx/dev_guide/misc_tasks.rst +++ b/src/docs/sphinx/dev_guide/misc_tasks.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/pull_requests.rst b/src/docs/sphinx/dev_guide/pull_requests.rst index 57c94d6d75..e26ca82d2d 100644 --- a/src/docs/sphinx/dev_guide/pull_requests.rst +++ b/src/docs/sphinx/dev_guide/pull_requests.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/release.rst b/src/docs/sphinx/dev_guide/release.rst index 729a2e835a..d4cc93bca6 100644 --- a/src/docs/sphinx/dev_guide/release.rst +++ b/src/docs/sphinx/dev_guide/release.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -88,7 +88,9 @@ release changes can be reviewed. Such changes include: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Merge the release candidate branch into the main branch once it is ready and -approved. At this point, the release candidate branch can be deleted. +approved. Do not "squash merge:" that will make the histories of main and +release branches disagree, and we want to preserve the history. After +merging, the release candidate branch can be deleted. 4: Draft a Github Release @@ -120,8 +122,9 @@ approved. At this point, the release candidate branch can be deleted. ^^^^^^^^^^^^^^^^^^^^^^^^^^ * Checkout the main branch locally and run ``axom/scripts/make_release_tarball.sh --with-data`` - This will generate a two tarballs of the form ``Axom-v0.3.1.tar.gz`` and ``AxomData-v0.3.1.tar.gz`` - each consistsing of the axom source and data respectively. + Run this script from the top level ``axom`` subdirectory. This will + generate a two tarballs of the form ``Axom-v0.3.1.tar.gz`` and ``AxomData-v0.3.1.tar.gz`` + consisting of the axom source and data respectively. * Upload the tarballs for the corresponding release, by going to the `Github Releases section `_ and ``Edit`` diff --git a/src/docs/sphinx/dev_guide/semantic_versioning.rst b/src/docs/sphinx/dev_guide/semantic_versioning.rst index ac614caab1..d0f98c1655 100644 --- a/src/docs/sphinx/dev_guide/semantic_versioning.rst +++ b/src/docs/sphinx/dev_guide/semantic_versioning.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/testing.rst b/src/docs/sphinx/dev_guide/testing.rst index 34564cea85..c9e22d7c87 100644 --- a/src/docs/sphinx/dev_guide/testing.rst +++ b/src/docs/sphinx/dev_guide/testing.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/dev_guide/updating_tpls.rst b/src/docs/sphinx/dev_guide/updating_tpls.rst index a546f03f05..09a3f43792 100644 --- a/src/docs/sphinx/dev_guide/updating_tpls.rst +++ b/src/docs/sphinx/dev_guide/updating_tpls.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -308,7 +308,7 @@ other Axom developers to use during development, in Axom Gitlab CI testing, etc. # blueos $ lalloc 1 -W 120 scripts/llnl/build_tpl.py - # toss3 + # toss_4 $ srun -N1 --interactive -t 120 scripts/llnl/build_tpl.py This script will build all third-party libraries for all compilers specs diff --git a/src/docs/sphinx/quickstart_guide/config_build.rst b/src/docs/sphinx/quickstart_guide/config_build.rst index 167216e178..2629bb834e 100644 --- a/src/docs/sphinx/quickstart_guide/config_build.rst +++ b/src/docs/sphinx/quickstart_guide/config_build.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/quickstart_guide/index.rst b/src/docs/sphinx/quickstart_guide/index.rst index 00448f076f..393092af7e 100644 --- a/src/docs/sphinx/quickstart_guide/index.rst +++ b/src/docs/sphinx/quickstart_guide/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/quickstart_guide/the_code.rst b/src/docs/sphinx/quickstart_guide/the_code.rst index 953d8c6cbb..c8d3878a9d 100644 --- a/src/docs/sphinx/quickstart_guide/the_code.rst +++ b/src/docs/sphinx/quickstart_guide/the_code.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/docs/sphinx/quickstart_guide/zero_to_axom.rst b/src/docs/sphinx/quickstart_guide/zero_to_axom.rst index 20e3a91742..15f58ecb23 100644 --- a/src/docs/sphinx/quickstart_guide/zero_to_axom.rst +++ b/src/docs/sphinx/quickstart_guide/zero_to_axom.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -40,7 +40,7 @@ command line option. Supported compiler specs can be found in the Spack compiler We currently regularly test the following Spack configuration files: * Linux Ubuntu 20.04 (via Windows WSL 2) -* TOSS 3 (On ruby at LC) +* TOSS 4 (On Ruby at LC) * BlueOS (On Lassen at LC) To install Axom on a new platform, it is a good idea to start with a known Spack configuration directory @@ -127,8 +127,8 @@ See: ``examples/axom/using-with-blt`` Makefile-based build system example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. literalinclude:: ../../../examples/using-with-make/Makefile +.. literalinclude:: ../../../examples/using-with-make/Makefile.in :language: make - :lines: 20-25 + :lines: 28-39 See: ``examples/axom/using-with-make`` diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt index faa87bb5ab..9deb328ee9 100644 --- a/src/examples/CMakeLists.txt +++ b/src/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/examples/using-with-blt/CMakeLists.txt b/src/examples/using-with-blt/CMakeLists.txt index bd0630cf94..8a1846f203 100644 --- a/src/examples/using-with-blt/CMakeLists.txt +++ b/src/examples/using-with-blt/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/examples/using-with-blt/example.cpp b/src/examples/using-with-blt/example.cpp index 3cac54a58b..816ddbf984 100644 --- a/src/examples/using-with-blt/example.cpp +++ b/src/examples/using-with-blt/example.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/examples/using-with-blt/host-config.cmake.in b/src/examples/using-with-blt/host-config.cmake.in index fe6e9620f0..e039d671e2 100644 --- a/src/examples/using-with-blt/host-config.cmake.in +++ b/src/examples/using-with-blt/host-config.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/examples/using-with-cmake/CMakeLists.txt b/src/examples/using-with-cmake/CMakeLists.txt index e127e9bdfc..63eeca1150 100644 --- a/src/examples/using-with-cmake/CMakeLists.txt +++ b/src/examples/using-with-cmake/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -20,7 +20,11 @@ # #------------------------------------------------------------------------------ -cmake_minimum_required(VERSION 3.14) +if (ENABLE_HIP OR AXOM_ENABLE_HIP OR ENABLE_CUDA OR AXOM_ENABLE_CUDA) + cmake_minimum_required(VERSION 3.21) +else() + cmake_minimum_required(VERSION 3.18) +endif() project(using_with_cmake) @@ -70,14 +74,6 @@ if(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE) ${BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE}) endif() -# HACK: Define the `mpi` target as an alias to `axom::mpi` if/when necessary -# Details: An axom dependency has a link dependency to `mpi`, but it might -# not be a target. Need to mark axom::mpi as global to use it for an alias. -if(NOT TARGET mpi AND TARGET axom::mpi) - set_target_properties(axom::mpi PROPERTIES IMPORTED_GLOBAL TRUE) - add_library(mpi ALIAS axom::mpi) -endif() - #------------------------------------------------------------------------------ # Set up example target that depends on axom #------------------------------------------------------------------------------ diff --git a/src/examples/using-with-cmake/example.cpp b/src/examples/using-with-cmake/example.cpp index 3cac54a58b..816ddbf984 100644 --- a/src/examples/using-with-cmake/example.cpp +++ b/src/examples/using-with-cmake/example.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/examples/using-with-cmake/host-config.cmake.in b/src/examples/using-with-cmake/host-config.cmake.in index 30b62805ae..527b4a8e48 100644 --- a/src/examples/using-with-cmake/host-config.cmake.in +++ b/src/examples/using-with-cmake/host-config.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/examples/using-with-make/Makefile.in b/src/examples/using-with-make/Makefile.in index c323f49090..dc754c6281 100644 --- a/src/examples/using-with-make/Makefile.in +++ b/src/examples/using-with-make/Makefile.in @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/examples/using-with-make/example.cpp b/src/examples/using-with-make/example.cpp index 45de7da081..e2186c1a0c 100644 --- a/src/examples/using-with-make/example.cpp +++ b/src/examples/using-with-make/example.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/index.rst b/src/index.rst index b3421c8fcf..091ee817bd 100644 --- a/src/index.rst +++ b/src/index.rst @@ -1,4 +1,4 @@ -.. ## Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +.. ## Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and .. ## other Axom Project Developers. See the top-level LICENSE file for details. .. ## .. ## SPDX-License-Identifier: (BSD-3-Clause) @@ -181,7 +181,7 @@ Axom Copyright and License Information Please see the :ref:`axom-license`. -Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC. +Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-741217 diff --git a/src/thirdparty/CMakeLists.txt b/src/thirdparty/CMakeLists.txt index 545f2b3204..1b9e6ae643 100644 --- a/src/thirdparty/CMakeLists.txt +++ b/src/thirdparty/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/axom/fmt.hpp b/src/thirdparty/axom/fmt.hpp index 0e70bd00bf..7315055c68 100644 --- a/src/thirdparty/axom/fmt.hpp +++ b/src/thirdparty/axom/fmt.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -10,19 +10,19 @@ #include "axom/config.hpp" // Include all fmt header files -#include "fmt/core.h" -#include "fmt/format.h" +#include "axom/fmt/core.h" +#include "axom/fmt/format.h" -#include "fmt/args.h" -#include "fmt/chrono.h" -#include "fmt/color.h" -#include "fmt/compile.h" -#include "fmt/os.h" -#include "fmt/ostream.h" -#include "fmt/printf.h" -#include "fmt/ranges.h" -#include "fmt/std.h" -#include "fmt/xchar.h" +#include "axom/fmt/args.h" +#include "axom/fmt/chrono.h" +#include "axom/fmt/color.h" +#include "axom/fmt/compile.h" +#include "axom/fmt/os.h" +#include "axom/fmt/ostream.h" +#include "axom/fmt/printf.h" +#include "axom/fmt/ranges.h" +#include "axom/fmt/std.h" +#include "axom/fmt/xchar.h" #endif // AXOM_FMT_H_ diff --git a/src/thirdparty/tests/CMakeLists.txt b/src/thirdparty/tests/CMakeLists.txt index be84e1e291..5dbf56c584 100644 --- a/src/thirdparty/tests/CMakeLists.txt +++ b/src/thirdparty/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -88,17 +88,17 @@ if (CONDUIT_FOUND) FOLDER axom/thirdparty/tests ) axom_add_test(NAME conduit_smoke - COMMAND conduit_smoke_test) + COMMAND conduit_smoke_test) if (ENABLE_FORTRAN) axom_add_executable(NAME conduit_smoke_F_test - SOURCES f_conduit_smoke.f - OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON conduit::conduit fruit - FOLDER axom/thirdparty/tests ) + SOURCES f_conduit_smoke.f + OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} + DEPENDS_ON conduit::conduit fruit + FOLDER axom/thirdparty/tests ) axom_add_test(NAME conduit_smoke_F - COMMAND conduit_smoke_F_test) + COMMAND conduit_smoke_F_test) endif() endif() @@ -126,7 +126,6 @@ endif() # Smoke test for fmt third party library #------------------------------------------------------------------------------ set(fmt_smoke_dependencies fmt gtest) -blt_list_append( TO fmt_smoke_dependencies ELEMENTS cuda IF AXOM_ENABLE_CUDA) axom_add_executable( NAME fmt_smoke_test diff --git a/src/thirdparty/tests/c2c_smoke.cpp b/src/thirdparty/tests/c2c_smoke.cpp index 89b2b5770d..6faca3298f 100644 --- a/src/thirdparty/tests/c2c_smoke.cpp +++ b/src/thirdparty/tests/c2c_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/cli11_smoke.cpp b/src/thirdparty/tests/cli11_smoke.cpp index 38aebcb38f..7c8f05d1b2 100644 --- a/src/thirdparty/tests/cli11_smoke.cpp +++ b/src/thirdparty/tests/cli11_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/compiler_flag_fortran_preprocessor.F b/src/thirdparty/tests/compiler_flag_fortran_preprocessor.F index d6db89a045..9e70af5f64 100644 --- a/src/thirdparty/tests/compiler_flag_fortran_preprocessor.F +++ b/src/thirdparty/tests/compiler_flag_fortran_preprocessor.F @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and ! other Axom Project Developers. See the top-level LICENSE file for details. ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/compiler_flag_omp_pragma.cpp b/src/thirdparty/tests/compiler_flag_omp_pragma.cpp index 5b2a42b3b0..58fa14087b 100644 --- a/src/thirdparty/tests/compiler_flag_omp_pragma.cpp +++ b/src/thirdparty/tests/compiler_flag_omp_pragma.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/compiler_flag_strict_aliasing.cpp b/src/thirdparty/tests/compiler_flag_strict_aliasing.cpp index 7fa2b796fd..2a467d6897 100644 --- a/src/thirdparty/tests/compiler_flag_strict_aliasing.cpp +++ b/src/thirdparty/tests/compiler_flag_strict_aliasing.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -29,7 +29,7 @@ struct Bar int main() { - Foo foo = {1, NULL}; + Foo foo = {1, nullptr}; ((Bar*)(&foo))->i++; // violates strict aliasing std::cout << " foo.i: " << foo.i << std::endl; diff --git a/src/thirdparty/tests/compiler_flag_uninitialized.cpp b/src/thirdparty/tests/compiler_flag_uninitialized.cpp index 8dc3bc4eca..9a897a51d0 100644 --- a/src/thirdparty/tests/compiler_flag_uninitialized.cpp +++ b/src/thirdparty/tests/compiler_flag_uninitialized.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/compiler_flag_unused_local_typedef.cpp b/src/thirdparty/tests/compiler_flag_unused_local_typedef.cpp index f1a25f1685..1799d6b5f6 100644 --- a/src/thirdparty/tests/compiler_flag_unused_local_typedef.cpp +++ b/src/thirdparty/tests/compiler_flag_unused_local_typedef.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -14,7 +14,9 @@ int main() { + // NOLINTBEGIN typedef int IntT; + // NOLINTEND std::cout << "I have defined type IntT, but am not using it." << std::endl; return 0; diff --git a/src/thirdparty/tests/compiler_flag_unused_param.cpp b/src/thirdparty/tests/compiler_flag_unused_param.cpp index a23b5b3f3b..2304b2a971 100644 --- a/src/thirdparty/tests/compiler_flag_unused_param.cpp +++ b/src/thirdparty/tests/compiler_flag_unused_param.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/compiler_flag_unused_var.cpp b/src/thirdparty/tests/compiler_flag_unused_var.cpp index 59775bf628..b566e8be73 100644 --- a/src/thirdparty/tests/compiler_flag_unused_var.cpp +++ b/src/thirdparty/tests/compiler_flag_unused_var.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/conduit_smoke.cpp b/src/thirdparty/tests/conduit_smoke.cpp index e991d9529e..5505f5db7d 100644 --- a/src/thirdparty/tests/conduit_smoke.cpp +++ b/src/thirdparty/tests/conduit_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/fmt_smoke.cpp b/src/thirdparty/tests/fmt_smoke.cpp index ca796b56d8..a7ffeaa920 100644 --- a/src/thirdparty/tests/fmt_smoke.cpp +++ b/src/thirdparty/tests/fmt_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/hdf5_smoke.cpp b/src/thirdparty/tests/hdf5_smoke.cpp index 2bdafad2c8..5ccafe291e 100644 --- a/src/thirdparty/tests/hdf5_smoke.cpp +++ b/src/thirdparty/tests/hdf5_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -59,7 +59,7 @@ TEST(hdf5_smoke, create_dset) // Create the data space for the dataset. dims[0] = 4; dims[1] = 6; - dataspace_id = H5Screate_simple(2, dims, NULL); + dataspace_id = H5Screate_simple(2, dims, nullptr); EXPECT_GE(dataspace_id, 0); // Create the dataset. diff --git a/src/thirdparty/tests/mfem_smoke.cpp b/src/thirdparty/tests/mfem_smoke.cpp index 82d9bd27b1..3208b9d450 100644 --- a/src/thirdparty/tests/mfem_smoke.cpp +++ b/src/thirdparty/tests/mfem_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/raja_smoke.cpp b/src/thirdparty/tests/raja_smoke.cpp index 7a6acbf44c..0bd39b4b96 100644 --- a/src/thirdparty/tests/raja_smoke.cpp +++ b/src/thirdparty/tests/raja_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/sol_smoke.cpp b/src/thirdparty/tests/sol_smoke.cpp index 4e35561074..3f0c7b52b7 100644 --- a/src/thirdparty/tests/sol_smoke.cpp +++ b/src/thirdparty/tests/sol_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/thirdparty/tests/sparsehash_smoke.cpp b/src/thirdparty/tests/sparsehash_smoke.cpp index 39b1bd2e87..bb1ed3255a 100644 --- a/src/thirdparty/tests/sparsehash_smoke.cpp +++ b/src/thirdparty/tests/sparsehash_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -17,7 +17,7 @@ //----------------------------------------------------------------------------- TEST(sparsehash_smoke, basic_use) { - typedef axom::google::dense_hash_map MapType; + using MapType = axom::google::dense_hash_map; const std::string deletedKey = "DELETED"; const std::string emptyKey = "EMPTY"; diff --git a/src/thirdparty/tests/umpire_smoke.cpp b/src/thirdparty/tests/umpire_smoke.cpp index 94fac6c19f..f83e30b084 100644 --- a/src/thirdparty/tests/umpire_smoke.cpp +++ b/src/thirdparty/tests/umpire_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 325436a3b9..448f653d53 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and # other Axom Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: (BSD-3-Clause) @@ -84,6 +84,20 @@ if(AXOM_ENABLE_QUEST) blt_list_append(TO _policies ELEMENTS "raja_omp" IF AXOM_ENABLE_OPENMP) blt_list_append(TO _policies ELEMENTS "raja_cuda" IF AXOM_ENABLE_CUDA) + # Test with HIP policy for select optimization flags. + # Check for Debug flags that have been overwritten. + if(AXOM_ENABLE_HIP) + if((CMAKE_BUILD_TYPE MATCHES "(Release|RelWithDebInfo)") OR + (CMAKE_BUILD_TYPE MATCHES "Debug" AND + CMAKE_CXX_FLAGS_DEBUG MATCHES "\-O1 \-g \-DNDEBUG")) + list(APPEND _policies "raja_hip") + else() + message(STATUS + "HIP policy for mesh_tester executable is not being tested" + ) + endif() + endif() + foreach(_method ${_methods}) foreach(_policy ${_policies}) diff --git a/src/tools/convert_sidre_protocol.cpp b/src/tools/convert_sidre_protocol.cpp index 244597e069..c9de60aec5 100644 --- a/src/tools/convert_sidre_protocol.cpp +++ b/src/tools/convert_sidre_protocol.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/src/tools/data_collection_util.cpp b/src/tools/data_collection_util.cpp index fbdee7fd9f..db4d877124 100644 --- a/src/tools/data_collection_util.cpp +++ b/src/tools/data_collection_util.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -570,7 +570,7 @@ int main(int argc, char** argv) sidre::MFEMSidreDataCollection dc(params.dcName, nullptr, true); // Create or load the serial mfem mesh - mfem::Mesh* mesh = nullptr; + mfem::Mesh* mesh {nullptr}; switch(params.meshForm) { case MeshForm::Box: diff --git a/src/tools/gen-multidom-structured-mesh.py b/src/tools/gen-multidom-structured-mesh.py index aa3de00354..3f649b0139 100755 --- a/src/tools/gen-multidom-structured-mesh.py +++ b/src/tools/gen-multidom-structured-mesh.py @@ -17,14 +17,15 @@ import numpy as np def i_c(s): - '''Integer coordinates.''' + '''Convert comma-separated string to list of integers.''' return list(map(int, s.split(','))) + def f_c(s): - '''Floating point coordinates.''' + '''Convert comma-separated string to list of floating point numbers.''' return list(map(float, s.split(','))) from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter -ps = ArgumentParser(description='Write a blueprint multidomain unstructured mesh.', +ps = ArgumentParser(description='Write a blueprint strided-unstructured mesh.', formatter_class=ArgumentDefaultsHelpFormatter) ps.add_argument('--useList', action='store_true', help='Put domains in a list instead of a map') ps.add_argument('-ml', type=f_c, default=(0.,0.), help='Mesh lower coordinates') @@ -32,8 +33,10 @@ def f_c(s): ps.add_argument('-ms', type=i_c, default=(3,3), help='Logical size of mesh (cells)') ps.add_argument('-dc', type=i_c, default=(1,1), help='Domain counts in each index direction') ps.add_argument('-o', '--output', type=str, default='mdmesh', help='Output file base name') +ps.add_argument('--strided', action='store_true', help='Use strided_structured (has ghosts)') +ps.add_argument('-v', '--verbose', action='store_true', help='Print additional info') opts,unkn = ps.parse_known_args() -print(opts, unkn) +if(opts.verbose): print(opts, unkn) if(unkn): print("Unrecognized arguments:", *unkn) quit(1) @@ -51,60 +54,88 @@ def f_c(s): if sum(goodDc) < dim: raise RuntimeError(f'ms ({opts.ms}) must be >= dc ({opts.dc}) in all directions.') +# Number of phony nodes on left and right sides, for strided option +if opts.strided: + npnl, npnr = 2, 1 +else: + npnl, npnr = 0, 0 + def scale_structured_domain(n, startCoord, endCoord): '''This function scales and shifts a blueprint structured domain after it has been created. There's no way to specify the physical extent - of a domain using conduit.blueprint.mesh.examples.basic, as far as I - can tell. - + of a domain using conduit.blueprint.mesh.examples methods, as far as + I can tell. ''' + #print(f'Rescaling to {startCoord} -> {endCoord}') + + ndim = n['coordsets/coords/values'].number_of_children() + + domLens = n['topologies/mesh/elements/dims'] + dirs = 'ij' if ndim == 2 else 'ijk' + domLens = [ domLens[d] for d in dirs ] + domLens = np.array(domLens) domPhysicalSize = np.array(endCoord) - np.array(startCoord) - xyz = 'xyz' + #print(f'domLens={domLens} domPhysicalSize={domPhysicalSize}') assert(n['topologies/mesh/type'] == 'structured') - ndim = n['coordsets/coords/values'].number_of_children() assert(len(startCoord) >= ndim) assert(len(domPhysicalSize) >= ndim) + + coordArrayLens = domLens + 1 + npnl + npnr + #print(f'coordArrayLens={coordArrayLens}') + + xyz = 'xyz' for d in range(ndim): coords = n['coordsets/coords/values'][d] - minC, maxC = min(coords), max(coords) + coords = np.reshape(coords, np.flip(coordArrayLens)) + + # realCoords excludes the ghost layers. + if ndim == 2: + if npnr == 0: + realCoords = coords[npnl:, npnl:] + else: + realCoords = coords[npnl:-npnr, npnl:-npnr] + else: + if npnr == 0: + realCoords = coords[npnl:, npnl:, npnl:] + else: + realCoords = coords[npnl:-npnr, npnl:-npnr, npnl:-npnr] + + minC, maxC = np.amin(realCoords), np.amax(realCoords) curRange = maxC - minC shift = startCoord[d] - minC + scale = domPhysicalSize[d]/curRange coords = (coords - minC) * domPhysicalSize[d]/curRange + startCoord[d] n['coordsets/coords/values'][xyz[d]] = coords domType = 'structured' -domCounts = opts.dc if dim == 3 else (*opts.dc, 1) -meshSize = opts.ms if dim == 3 else (*opts.ms, 1) -meshLower = opts.ml if dim == 3 else (*opts.ml, 0) -meshUpper = opts.mu if dim == 3 else (*opts.mu, 0) +domCounts = opts.dc if dim == 3 else (*opts.dc, 1) # domCounts must be length 3, even for 2D. +meshSize = opts.ms +meshLower = opts.ml +meshUpper = opts.mu # Convert to np.array to use element-wise arithmetic. -domCounts = np.array(domCounts, dtype=np.int) -meshSize = np.array(meshSize, dtype=np.int) +domCounts = np.array(domCounts, dtype=int) +meshSize = np.array(meshSize, dtype=int) meshLower = np.array(meshLower) meshUpper = np.array(meshUpper) -domPhysicalSize = (meshUpper - meshLower)/domCounts +domPhysicalSize = (meshUpper - meshLower)/domCounts[:dim] cellPhysicalSize = (meshUpper - meshLower)/meshSize -domSize = meshSize//domCounts -domSizeRem = meshSize % domCounts -print(f'meshSize={meshSize} cells, domCounts={domCounts} domSize={domSize} domSizeRem={domSizeRem}') - -def domain_size(di, dj, dk): - rval = np.array(domSize) - rval += (di,dj,dk) < domSizeRem - rval[0:dim] += 1 - return rval - -def domain_index_begin(di, dj, dk): - '''Compute first cell index of domain (di, dj, dk).''' - idx = np.array( (di, dj, dk) ) - std = np.array(domSize) * (di, dj, dk) - extra = np.where( idx < domSizeRem, idx, domSizeRem ) +domSize = meshSize//domCounts[:dim] +domSizeRem = meshSize % domCounts[:dim] +if opts.verbose: + print(f'meshSize={meshSize} cells, domCounts={domCounts[0:dim]}' + f' domSize={domSize} domSizeRem={domSizeRem}') + +def domain_index_begin(di, dj, dk=None): + '''Compute first cell index of the domain with multi-dimensional index (di, dj, dk).''' + ds = (di, dj) if dim == 2 else (di, dj, dk) + idx = np.array(ds) + std = domSize * ds + extra = np.where( idx < domSizeRem[:dim], idx, domSizeRem[:dim] ) begin = std + extra - #print(di, dj, dk, f'begin={begin}, std={std}, extra={extra}') return begin mdMesh = conduit.Node() @@ -114,25 +145,46 @@ def domain_index_begin(di, dj, dk): if opts.useList: dom = mdMesh.append() else: - domName = f'domain_{di:1d}_{dj:1d}' if len(opts.dc) == 2 else f'domain_{di:1d}_{dj:1d}_{dk:1d}' + domName = f'domain_{di:1d}_{dj:1d}' + if len(opts.dc) == 3: domName += f'_{dk:1d}' dom = mdMesh[domName] cellStart = domain_index_begin(di, dj, dk) - cellEnd = domain_index_begin(di+1, dj+1, dk+1) - pointCounts = cellEnd - cellStart + (1, 1, 1 if dim == 3 else 0) - #print(di, dj, dk, f'{cellStart} -> {cellEnd}, {pointCounts}') - - conduit.blueprint.mesh.examples.basic(domType, *pointCounts, dom) + cellEnd = domain_index_begin(di+1, dj+1, dk+1 if dim == 3 else 0) + pointCounts = cellEnd - cellStart + 1 + #print(f'cellStart={cellStart} cellEnd={cellEnd} pointCounts={pointCounts}') + + elemExtents = (cellEnd - cellStart) + (npnl + npnr + 1) + vertExtents = np.array(pointCounts) + (npnl + npnr) + elemOffset = np.full(dim, npnl) + vertOffset = np.full(dim, npnl) + #print(f'\n{domName}: {cellStart} -> {cellEnd}') + + pointCounts3 = pointCounts if len(pointCounts) == 3 else (*pointCounts, 0) + if opts.strided: + desc = conduit.Node() + desc['vertex_data/shape'].set(vertExtents) + desc['vertex_data/origin'].set(vertOffset) + desc['element_data/shape'].set(elemExtents) + desc['element_data/origin'].set(elemOffset) + #print(f'\ndesc({di},{dj},{dk}):', end=''); print(desc) + conduit.blueprint.mesh.examples.strided_structured(desc, *pointCounts3, dom) + if dom.has_child("state"): dom.remove_child("state") + else: + conduit.blueprint.mesh.examples.basic(domType, *pointCounts3, dom) - domLower = meshLower + cellStart * cellPhysicalSize - domUpper = meshLower + cellEnd * cellPhysicalSize + domLower = meshLower[:dim] + cellStart * cellPhysicalSize[:dim] + domUpper = meshLower[:dim] + cellEnd * cellPhysicalSize[:dim] scale_structured_domain(dom, domLower, domUpper) + # if opts.verbose: print(f'Domain [{di},{dj},{dk}]: {dom}') -# print(mdMesh) +if opts.verbose: + print('mdMesh:'); print(mdMesh) info = conduit.Node() if not conduit.blueprint.mesh.verify(mdMesh, info): - print(info) + print("Mesh failed blueprint verification. Info:") + print(info) -conduit.relay.io.blueprint.save_mesh(mdMesh,opts.output, "hdf5") +conduit.relay.io.blueprint.save_mesh(mdMesh, opts.output, "hdf5") print(f'Wrote mesh {opts.output}') diff --git a/src/tools/mesh_tester.cpp b/src/tools/mesh_tester.cpp index e55011a541..c045a27645 100644 --- a/src/tools/mesh_tester.cpp +++ b/src/tools/mesh_tester.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) @@ -50,6 +50,13 @@ using seq_exec = axom::SEQ_EXEC; #else using cuda_exec = seq_exec; #endif + + #if defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) && defined(NDEBUG) + constexpr int HIP_BLOCK_SIZE = 256; + using hip_exec = axom::HIP_EXEC; + #else + using hip_exec = seq_exec; + #endif #endif // clang-format on @@ -82,7 +89,8 @@ enum RuntimePolicy seq = 0, raja_seq = 1, raja_omp = 2, - raja_cuda = 3 + raja_cuda = 3, + raja_hip = 4 }; struct Input @@ -131,6 +139,9 @@ const std::map Input::s_validPolicies({ #ifdef AXOM_USE_CUDA , {"raja_cuda", raja_cuda} #endif + #if defined(AXOM_USE_HIP) && defined(NDEBUG) + , {"raja_hip", raja_hip} + #endif #endif }); // clang-format on @@ -142,33 +153,36 @@ void Input::parse(int argc, char** argv, axom::CLI::App& app) "-m, --method", method, "Method to use. \n" - "Set to \'bvh\' to use the bounding volume hierarchy spatial index.\n" - "Set to \'naive\' to use the naive algorithm (without a spatial index).\n" - "Set to \'uniform\' to use the uniform grid spatial index.\n" - "Set to \'implicit\' to use the implicit grid spatial index.") + "Set to 'bvh' to use the bounding volume hierarchy spatial index.\n" + "Set to 'naive' to use the naive algorithm (without a spatial index).\n" + "Set to 'uniform' to use the uniform grid spatial index.\n" + "Set to 'implicit' to use the implicit grid spatial index.") ->capture_default_str() ->check(axom::CLI::IsMember {Input::s_validMethods}); app .add_option("-r,--resolution", resolution, - "With \'-m uniform\', set resolution of uniform grid. \n" + "With '-m uniform', set resolution of uniform grid. \n" "Set to less than 1 to use the uniform grid spatial index\n" "with a resolution of the cube root of the number of\n" "triangles.") ->capture_default_str(); std::stringstream pol_sstr; - pol_sstr << "With \'-m bvh\' or \'-m naive\', set runtime policy. \n" - << "Set to \'seq\' or 0 to use the sequential algorithm " + pol_sstr << "With '-m bvh' or '-m naive', set runtime policy. \n" + << "Set to 'seq' or 0 to use the sequential algorithm " << "(w/o RAJA)."; #ifdef AXOM_USE_RAJA - pol_sstr << "\nSet to \'raja_seq\' or 1 to use the RAJA sequential policy."; + pol_sstr << "\nSet to 'raja_seq' or 1 to use the RAJA sequential policy."; #ifdef AXOM_USE_OPENMP - pol_sstr << "\nSet to \'raja_omp\' or 2 to use the RAJA OpenMP policy."; + pol_sstr << "\nSet to 'raja_omp' or 2 to use the RAJA OpenMP policy."; #endif #ifdef AXOM_USE_CUDA - pol_sstr << "\nSet to \'raja_cuda\' or 3 to use the RAJA CUDA policy."; + pol_sstr << "\nSet to 'raja_cuda' or 3 to use the RAJA CUDA policy."; + #endif + #if defined(AXOM_USE_HIP) && defined(NDEBUG) + pol_sstr << "\nSet to 'raja_hip' or 4 to use the RAJA HIP policy."; #endif #endif @@ -238,6 +252,9 @@ void Input::parse(int argc, char** argv, axom::CLI::App& app) << ((method == "naive" || method == "bvh") && policy == raja_cuda ? " (use RAJA CUDA policy)" : "") + << ((method == "naive" || method == "bvh") && policy == raja_hip + ? " (use RAJA HIP policy)" + : "") << "\n weld threshold = " << weldThreshold << "\n " << (skipWeld ? "" : "not ") << "skipping weld" << "\n intersection tolerance = " << intersectionThreshold @@ -609,6 +626,14 @@ int main(int argc, char** argv) } #endif +#if defined(AXOM_USE_HIP) && defined(NDEBUG) + if(params.policy == raja_hip) + { + using GPUExec = axom::HIP_EXEC<256>; + axom::setDefaultAllocator(axom::execution_space::allocatorID()); + } +#endif + // _read_stl_file_start // Read file SLIC_INFO("Reading file: '" << params.stlInput << "'...\n"); @@ -684,6 +709,14 @@ int main(int argc, char** argv) params.intersectionThreshold); break; #endif + #if defined(AXOM_USE_HIP) && defined(NDEBUG) + case raja_hip: + collisions = + naiveIntersectionAlgorithm(surface_mesh, + degenerate, + params.intersectionThreshold); + break; + #endif #endif // AXOM_USE_RAJA && AXOM_USE_UMPIRE default: @@ -733,6 +766,15 @@ int main(int argc, char** argv) params.intersectionThreshold); break; #endif + #if defined(AXOM_USE_HIP) && defined(NDEBUG) + case raja_hip: + quest::findTriMeshIntersectionsBVH( + surface_mesh, + collisions, + degenerate, + params.intersectionThreshold); + break; + #endif #endif // AXOM_USE_RAJA && AXOM_USE_UMPIRE default: SLIC_ERROR("Unhandled runtime policy case " << params.policy); @@ -785,6 +827,16 @@ int main(int argc, char** argv) params.intersectionThreshold); break; #endif + #if defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) && defined(NDEBUG) + case raja_hip: + quest::findTriMeshIntersectionsImplicitGrid( + surface_mesh, + collisions, + degenerate, + params.resolution, + params.intersectionThreshold); + break; + #endif #endif // AXOM_USE_RAJA default: SLIC_ERROR("Unhandled runtime policy case " << params.policy); @@ -834,6 +886,16 @@ int main(int argc, char** argv) params.intersectionThreshold); break; #endif + #if defined(AXOM_USE_HIP) && defined(AXOM_USE_UMPIRE) && defined(NDEBUG) + case raja_hip: + quest::findTriMeshIntersectionsUniformGrid( + surface_mesh, + collisions, + degenerate, + params.resolution, + params.intersectionThreshold); + break; + #endif #endif // AXOM_USE_RAJA default: SLIC_ERROR("Unhandled runtime policy case " << params.policy);