ascent: add v0.9.3 (#44571)

* add new ascent version
* add requirement for new version of umpire/raja
* add patch for vtk-m dependency
This commit is contained in:
Chris White 2024-06-17 18:37:50 -07:00 committed by GitHub
parent 24b8d0666e
commit 12866eb0d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 169 additions and 8 deletions

View File

@ -55,13 +55,17 @@ class Ascent(CMakePackage, CudaPackage):
version("develop", branch="develop", submodules=True)
version(
"0.9.2",
tag="v0.9.2",
commit="b842516d12640e4a0d9433a18c7249440ef6fc3d",
"0.9.3",
tag="v0.9.3",
commit="e69d6ec77938846caae8fea7ed988b1151ac9b81",
submodules=True,
preferred=True,
)
version(
"0.9.2", tag="v0.9.2", commit="b842516d12640e4a0d9433a18c7249440ef6fc3d", submodules=True
)
version(
"0.9.1", tag="v0.9.1", commit="027a2fe184f65a4923817a8cdfed0b0c61c2c75a", submodules=True
)
@ -155,6 +159,7 @@ class Ascent(CMakePackage, CudaPackage):
depends_on("conduit@:0.7.2", when="@:0.7.1")
depends_on("conduit@0.8.2:", when="@0.8:")
depends_on("conduit@0.8.6:", when="@0.9:")
depends_on("conduit@0.9.1:", when="@0.9.3:")
depends_on("conduit+python", when="+python")
depends_on("conduit~python", when="~python")
depends_on("conduit+mpi", when="+mpi")
@ -183,12 +188,18 @@ class Ascent(CMakePackage, CudaPackage):
#######################
# RAJA and Umpire
# Note: Let RAJA/Umpire handle the Camp version constraints
#######################
depends_on("raja", when="+raja")
depends_on("raja+openmp", when="+raja +openmp")
depends_on("raja~openmp", when="+raja ~openmp")
depends_on("umpire", when="+umpire")
depends_on("umpire@:2023.06.0", when="@:0.9.2 +umpire")
with when("+raja"):
depends_on("raja")
depends_on("raja@2024.02.1:", when="@0.9.3:")
depends_on("raja+openmp", when="+openmp")
depends_on("raja~openmp", when="~openmp")
with when("+umpire"):
depends_on("umpire")
depends_on("umpire@:2023.06.0", when="@:0.9.2")
depends_on("umpire@2024.02.1:", when="@0.9.3:")
#######################
# BabelFlow
@ -215,6 +226,7 @@ class Ascent(CMakePackage, CudaPackage):
depends_on("vtk-m~shared+fpic", when="@0.8.0: ~shared")
# Ascent defaults to C++11
depends_on("kokkos cxxstd=11", when="+vtkh ^vtk-m +kokkos")
depends_on("kokkos@3.7.02", when="@0.9.3: +vtkh ^vtk-m +kokkos")
#######################
# VTK-h

View File

@ -139,6 +139,10 @@ class VtkM(CMakePackage, CudaPackage, ROCmPackage):
# Patch
patch("diy-include-cstddef.patch", when="@1.5.3:1.8.0")
# VTK-M PR#3215
# https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/3215
patch("vtkm-mr3215-ext-geom-fix.patch", when="@2.1")
# VTK-M PR#2972
# https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/2972
patch("vtkm-cuda-swap-conflict-pr2972.patch", when="@1.9 +cuda ^cuda@12:")

View File

@ -0,0 +1,145 @@
From 49518e5054c607942f644c82a5289e12b0f50476 Mon Sep 17 00:00:00 2001
From: Kenneth Moreland <morelandkd@ornl.gov>
Date: Fri, 3 May 2024 09:22:56 -0400
Subject: [PATCH] Fix bug with ExtractGeometry filter
The `ExtractGeometry` filter was outputing datasets containing
`CellSetPermutation` as the representation for the cells. Although this is
technically correct and a very fast implementation, it is essentially
useless. The problem is that any downstream processing will have to know
that the data has a `CellSetPermutation`. None do (because the permutation
can be on any other cell set type, which creates an explosion of possible
cell types).
Like was done with `Threshold` a while ago, this problem is fixed by deep
copying the result into a `CellSetExplicit`. This behavior is consistent
with VTK.
---
.../changelog/extract-geometry-permutation.md | 13 +++++++
.../testing/UnitTestExtractGeometryFilter.cxx | 13 ++++++-
.../worklet/ExtractGeometry.h | 34 +++++++------------
3 files changed, 37 insertions(+), 23 deletions(-)
create mode 100644 docs/changelog/extract-geometry-permutation.md
diff --git a/docs/changelog/extract-geometry-permutation.md b/docs/changelog/extract-geometry-permutation.md
new file mode 100644
index 0000000000..8a90495f76
--- /dev/null
+++ b/docs/changelog/extract-geometry-permutation.md
@@ -0,0 +1,13 @@
+# Fix bug with ExtractGeometry filter
+
+The `ExtractGeometry` filter was outputing datasets containing
+`CellSetPermutation` as the representation for the cells. Although this is
+technically correct and a very fast implementation, it is essentially
+useless. The problem is that any downstream processing will have to know
+that the data has a `CellSetPermutation`. None do (because the permutation
+can be on any other cell set type, which creates an explosion of possible
+cell types).
+
+Like was done with `Threshold` a while ago, this problem is fixed by deep
+copying the result into a `CellSetExplicit`. This behavior is consistent
+with VTK.
diff --git a/vtkm/filter/entity_extraction/testing/UnitTestExtractGeometryFilter.cxx b/vtkm/filter/entity_extraction/testing/UnitTestExtractGeometryFilter.cxx
index 675df8f77c..14de333666 100644
--- a/vtkm/filter/entity_extraction/testing/UnitTestExtractGeometryFilter.cxx
+++ b/vtkm/filter/entity_extraction/testing/UnitTestExtractGeometryFilter.cxx
@@ -11,6 +11,7 @@
#include <vtkm/cont/testing/MakeTestDataSet.h>
#include <vtkm/cont/testing/Testing.h>
+#include <vtkm/filter/clean_grid/CleanGrid.h>
#include <vtkm/filter/entity_extraction/ExtractGeometry.h>
using vtkm::cont::testing::MakeTestDataSet;
@@ -41,11 +42,21 @@ public:
vtkm::cont::DataSet output = extractGeometry.Execute(dataset);
VTKM_TEST_ASSERT(test_equal(output.GetNumberOfCells(), 8), "Wrong result for ExtractGeometry");
+ vtkm::filter::clean_grid::CleanGrid cleanGrid;
+ cleanGrid.SetCompactPointFields(true);
+ cleanGrid.SetMergePoints(false);
+ vtkm::cont::DataSet cleanOutput = cleanGrid.Execute(output);
+
vtkm::cont::ArrayHandle<vtkm::Float32> outCellData;
- output.GetField("cellvar").GetData().AsArrayHandle(outCellData);
+ cleanOutput.GetField("cellvar").GetData().AsArrayHandle(outCellData);
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(0) == 21.f, "Wrong cell field data");
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(7) == 42.f, "Wrong cell field data");
+
+ vtkm::cont::ArrayHandle<vtkm::Float32> outPointData;
+ cleanOutput.GetField("pointvar").GetData().AsArrayHandle(outPointData);
+ VTKM_TEST_ASSERT(outPointData.ReadPortal().Get(0) == 99);
+ VTKM_TEST_ASSERT(outPointData.ReadPortal().Get(7) == 90);
}
static void TestUniformByBox1()
diff --git a/vtkm/filter/entity_extraction/worklet/ExtractGeometry.h b/vtkm/filter/entity_extraction/worklet/ExtractGeometry.h
index 97521335f2..449d7eae60 100644
--- a/vtkm/filter/entity_extraction/worklet/ExtractGeometry.h
+++ b/vtkm/filter/entity_extraction/worklet/ExtractGeometry.h
@@ -10,11 +10,13 @@
#ifndef vtkm_m_worklet_ExtractGeometry_h
#define vtkm_m_worklet_ExtractGeometry_h
+#include <vtkm/worklet/CellDeepCopy.h>
#include <vtkm/worklet/WorkletMapTopology.h>
#include <vtkm/cont/Algorithm.h>
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/cont/ArrayHandle.h>
+#include <vtkm/cont/CellSetExplicit.h>
#include <vtkm/cont/CellSetPermutation.h>
#include <vtkm/cont/CoordinateSystem.h>
#include <vtkm/cont/Invoker.h>
@@ -114,28 +116,13 @@ public:
}
};
- ////////////////////////////////////////////////////////////////////////////////////
- // Extract cells by ids permutes input data
- template <typename CellSetType>
- vtkm::cont::CellSetPermutation<CellSetType> Run(const CellSetType& cellSet,
- const vtkm::cont::ArrayHandle<vtkm::Id>& cellIds)
- {
- using OutputType = vtkm::cont::CellSetPermutation<CellSetType>;
-
- vtkm::cont::ArrayCopy(cellIds, this->ValidCellIds);
-
- return OutputType(this->ValidCellIds, cellSet);
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Extract cells by implicit function permutes input data
template <typename CellSetType, typename ImplicitFunction>
- vtkm::cont::CellSetPermutation<CellSetType> Run(const CellSetType& cellSet,
- const vtkm::cont::CoordinateSystem& coordinates,
- const ImplicitFunction& implicitFunction,
- bool extractInside,
- bool extractBoundaryCells,
- bool extractOnlyBoundaryCells)
+ vtkm::cont::CellSetExplicit<> Run(const CellSetType& cellSet,
+ const vtkm::cont::CoordinateSystem& coordinates,
+ const ImplicitFunction& implicitFunction,
+ bool extractInside,
+ bool extractBoundaryCells,
+ bool extractOnlyBoundaryCells)
{
// Worklet output will be a boolean passFlag array
vtkm::cont::ArrayHandle<bool> passFlags;
@@ -149,7 +136,10 @@ public:
vtkm::cont::Algorithm::CopyIf(indices, passFlags, this->ValidCellIds);
// generate the cellset
- return vtkm::cont::CellSetPermutation<CellSetType>(this->ValidCellIds, cellSet);
+ vtkm::cont::CellSetPermutation<CellSetType> permutedCellSet(this->ValidCellIds, cellSet);
+
+ vtkm::cont::CellSetExplicit<> outputCells;
+ return vtkm::worklet::CellDeepCopy::Run(permutedCellSet);
}
vtkm::cont::ArrayHandle<vtkm::Id> GetValidCellIds() const { return this->ValidCellIds; }
--
GitLab