Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Blueprint mesh in shaping #1455

Merged
merged 124 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
0b42e2f
Transitioning to support blueprint mesh in conduit::Node.
gunney1 Sep 25, 2024
cc80862
Remove obsolete GridFunctionView utility class.
gunney1 Sep 25, 2024
0017bfc
Add missing IntersectionShaper for using blueprint mesh in conduit::N…
gunney1 Sep 25, 2024
280fc5b
Support shaping even without MFEM.
gunney1 Sep 25, 2024
56bad3d
Avoid using removed util function getUmpireDeviceId.
gunney1 Oct 3, 2024
3238825
Make private function populateHexesFromMesh public because NVCC compl…
gunney1 Oct 3, 2024
6603742
Revert to GridFunctionView because of bugs in TempArrayAccess utility.
gunney1 Oct 3, 2024
deaa200
Merge remote-tracking branch 'dvl/feature/gunney/construct-shapes-in-…
gunney1 Oct 7, 2024
aaec48d
Simplify include guards in shaping code.
gunney1 Oct 7, 2024
f38509a
Minor comment and white-space change.
gunney1 Oct 9, 2024
5c6b1a4
Remove support for reading in MFEM mesh in the new test.
gunney1 Oct 14, 2024
9e983fe
Remove unused code (for sampling shaping) in the new test.
gunney1 Oct 14, 2024
09056da
Autoformat.
gunney1 Oct 15, 2024
4b00511
Add ability to generate cartesian mesh as an unstructured hex mesh.
gunney1 Oct 15, 2024
d5e23b4
Progress toward using blueprint mesh.
gunney1 Oct 15, 2024
ccf29b0
Remove code for MFEM mesh that's been replaced by more general code.
gunney1 Oct 16, 2024
add072e
Further progress toward using Blueprint mesh in test.
gunney1 Oct 16, 2024
6d3baf1
Debug new code supporting blueprint mesh.
gunney1 Oct 17, 2024
9205f47
Remove overly restrictive requirements for Mesh object.
gunney1 Oct 17, 2024
dede781
Debug scalar field generation with blueprint mesh (add missing bluepr…
gunney1 Oct 17, 2024
a8114fd
Autoformat.
gunney1 Oct 17, 2024
f4c54cc
Allow reshaping sidre::View holding array data.
gunney1 Oct 17, 2024
71e3fdb
More progress toward Blueprint support in IntersectionShaper.
gunney1 Oct 17, 2024
12e8ea0
More progress toward testing Blueprint support.
gunney1 Oct 18, 2024
8c7efef
Slight refactor for readability.
gunney1 Oct 18, 2024
8d0c269
Add missing matsets data to blueprint mesh.
gunney1 Oct 18, 2024
6dd0dcc
Debug test code. First largely working version.
gunney1 Oct 18, 2024
5edb0cb
Fix bug in new structured box mesh generator utility.
gunney1 Oct 20, 2024
8c7a75b
Fix non-MFEM builds and add switch to toggle MFEM mesh.
gunney1 Oct 21, 2024
fea24a1
Remove debug code.
gunney1 Oct 21, 2024
54548b3
Autoformat.
gunney1 Oct 21, 2024
6c6b7db
Fix bugs in handling meshType intput.
gunney1 Oct 22, 2024
9925815
Fix error in guards against using MFEM when it's not there.
gunney1 Oct 22, 2024
fa99f5b
Fix scope of MFEM variable.
gunney1 Oct 22, 2024
78914f8
Fix error setting up tet geometry.
gunney1 Oct 22, 2024
c0d566a
Tweak shapes to center them and reduce resolution-related bumps.
gunney1 Oct 22, 2024
b1d84e1
Test non-grid-aligned VOR directin.
gunney1 Oct 22, 2024
a02fc77
Fix a weird numerical error, maybe caused by large floating point val…
gunney1 Oct 22, 2024
a26dc9b
Tilt the plane shape away from the axes.
gunney1 Oct 23, 2024
10f97fc
Don't test MFEM mesh if no MFEM.
gunney1 Oct 23, 2024
00a3074
Autoformat.
gunney1 Oct 23, 2024
ec2e1d0
Debug device runtime policies in shaper and test code.
gunney1 Oct 24, 2024
6f745d4
Add conduit::Node mesh support, not tested yet.
gunney1 Oct 25, 2024
12f0c83
Add utilities to check memory spaces against execution spaces.
gunney1 Oct 27, 2024
2ff4ac0
Importing Conduit array into View should use the parent Group's memor…
gunney1 Oct 27, 2024
5d08506
Fix mesh_helper inconsistencies in mixing host and device data.
gunney1 Oct 27, 2024
34debeb
Fix IntersectionShaper to work in a single memory space.
gunney1 Oct 27, 2024
64c0c31
Fix bug in populating vertices array with cuda + mfem.
gunney1 Oct 28, 2024
8ea5baa
Autoformat.
gunney1 Oct 28, 2024
58d0d6d
Silence warnings.
gunney1 Oct 28, 2024
4092122
Silence more warnings.
gunney1 Oct 28, 2024
6affea0
Mods and guards for building without RAJA or Umpire.
gunney1 Oct 28, 2024
af8ba2b
Autoformat.
gunney1 Oct 28, 2024
13b8f91
Add guards for non-sidre builds.
gunney1 Oct 29, 2024
3dcd78d
Merge remote-tracking branch 'gh/feature/gunney/construct-shapes-in-m…
gunney1 Nov 7, 2024
8fbb4b4
Silence compiler warnings: unused variables and shadow declarations.
gunney1 Nov 8, 2024
fd9fa7a
Support external BP mesh as a Conduit Node.
gunney1 Nov 14, 2024
512591c
Don't create vol frac data unless/until it's needed in applyReplaceme…
gunney1 Nov 15, 2024
6528a57
More informative handling of missing fields in conduit mesh.
gunney1 Nov 15, 2024
7ee5a7e
Allow access to individual shape results for apps that have their own…
gunney1 Nov 15, 2024
5d13366
Add notes for future code clean-up.
gunney1 Nov 15, 2024
81363e6
Set the directory path from the ShapeSet when constructing Shaper.
gunney1 Nov 21, 2024
1eb49ad
Remove ShapeSet's obsolete path resolution code.
gunney1 Nov 21, 2024
eb6b86c
Remove resolvePath in favor of using the file utilities.
gunney1 Nov 21, 2024
1c723ba
Add utility to return the parent path from a filesystem path.
gunney1 Nov 21, 2024
2f577e3
Fix missing and unneeded #includes.
gunney1 Nov 22, 2024
e0e09e6
Replace kernel to set array values with calls to fill.
gunney1 Nov 23, 2024
6c660f6
Add logic to avoid unnecessarily recomputing some arrays when
gunney1 Nov 23, 2024
edd924b
Merge remote-tracking branch 'dvl/feature/gunney/construct-shapes-in-…
gunney1 Nov 26, 2024
92b33ed
Fix bug accessing existing field in blueprint mesh.
gunney1 Nov 26, 2024
703b0be
Autoformat and remove unused code.
gunney1 Nov 26, 2024
f8c7d7d
Add timers and make other changes.
gunney1 Dec 6, 2024
b0998b4
Fix new code that work on Conduit mesh. This broke the MFEM tests.
gunney1 Dec 11, 2024
5218ddd
remove obsolete code.
gunney1 Dec 12, 2024
0e1c249
Don't test MFEM mesh if not configured with MFEM.
gunney1 Dec 13, 2024
383ea19
Guess allocator directly from external data's pointer.
gunney1 Dec 13, 2024
fe6e758
Fix bug that put some blueprint mesh data in the wrong memspace.
gunney1 Dec 14, 2024
9ca000a
Remove vestige of 2D support that was copied from another example.
gunney1 Dec 14, 2024
e3b553c
Convert structured to unstructured Blueprint mesh in Axom.
gunney1 Jan 3, 2025
51bcc63
Merge remote-tracking branch 'gh/feature/gunney/construct-shapes-in-m…
gunney1 Jan 3, 2025
0c77c09
Fix non-C2C build.
gunney1 Jan 4, 2025
9d6eacc
Fix non-Conduit build.
gunney1 Jan 4, 2025
1d2abe3
Always use axom::IndexType for Blueprint connectivity data.
gunney1 Jan 6, 2025
310f1ad
Autoformat.
gunney1 Jan 6, 2025
e4ab7ae
Timer for Shaper::loadShapeInternal.
gunney1 Jan 7, 2025
9921031
Remove a check that unintentionally requires user data to be Umpire-a…
gunney1 Jan 8, 2025
5d2372e
Fix breakage that occurs when user data isn't Umpire-allocated.
gunney1 Jan 8, 2025
2b11975
Merge remote-tracking branch 'gh/develop' into feature/gunney/bluepri…
gunney1 Jan 14, 2025
1fe19a2
Autoformat.
gunney1 Jan 15, 2025
91fceda
Less confusing variable name.
gunney1 Jan 15, 2025
fead20d
Merge remote-tracking branch 'gh/develop' into feature/gunney/bluepri…
gunney1 Jan 15, 2025
ff0236c
Silence warning about unreachable instruction.
gunney1 Jan 16, 2025
92fb7af
Fix crash in usesAllocId when the id is not from Umpire.
gunney1 Jan 16, 2025
6b84ee7
Add missing methods in ASYNC versions of device execution spaces.
gunney1 Jan 16, 2025
5fce87d
Update RELEASE-NOTES for interface changes.
gunney1 Jan 16, 2025
d810dd6
Changes to comments.
gunney1 Jan 16, 2025
d14f583
Update IntersectionShaper dox comments.
gunney1 Jan 16, 2025
7e7c141
Autoformat.
gunney1 Jan 16, 2025
68b0808
Change "volume of revolution" to "surface of revolution."
gunney1 Jan 16, 2025
a765335
Dox comment changes and remove an unused method.
gunney1 Jan 17, 2025
2c2a370
Avoid unneccesarily re-allocating memory.
gunney1 Jan 17, 2025
2a9d6f9
Add convenience method to get default allocator id for a runtime exec…
gunney1 Jan 18, 2025
8ab007a
Let user specify allocator ID for shapers.
gunney1 Jan 18, 2025
5abc0af
Move one-time initialization into setMeshDependentData().
gunney1 Jan 22, 2025
5b53a7b
Make a member variable local.
gunney1 Jan 22, 2025
b831511
Merge remote-tracking branch 'gh/develop' into feature/gunney/bluepri…
gunney1 Jan 22, 2025
6bd51f8
Replace bad allocator id with auto.
gunney1 Jan 22, 2025
1001742
Autoformat, correct comments and remove debug code.
gunney1 Jan 23, 2025
01f8fa5
Add comment about Windows path separator.
gunney1 Jan 23, 2025
d4a5db8
Merge branch 'develop' into feature/gunney/blueprint-mesh-shaping
rhornung67 Jan 23, 2025
88c6531
Fix a double-free error by removing a static object.
gunney1 Jan 24, 2025
97b531c
Merge remote-tracking branch 'gh/develop' into feature/gunney/bluepri…
gunney1 Jan 27, 2025
ec6b94d
Remove redundant computation of m_hex_bbs.
gunney1 Jan 27, 2025
ef96c29
Remove a non-essential output.
gunney1 Jan 27, 2025
d93d3ed
Move conduitDataIdOfAxomIndexType to quest not everything is dependen…
gunney1 Jan 27, 2025
0f75517
Add comments.
gunney1 Jan 29, 2025
022a867
Introduce symbol DYNAMIC_ALLOCATOR_ID so we don't hardwire its value …
gunney1 Jan 29, 2025
152e47a
Avoid exception when getting allocator space for non-umpire ids.
gunney1 Jan 29, 2025
1bbda0a
Make blueprint mesh argument a reference (formerly a pointer).
gunney1 Jan 29, 2025
5b7b104
Add tests for new file utilities, and fix exposed robustness.
gunney1 Jan 29, 2025
1769b81
Comments and small changes from PR comments.
gunney1 Jan 29, 2025
a4fbe6f
Autoformat.
gunney1 Jan 29, 2025
8bb3b94
Merge remote-tracking branch 'gh/develop' into feature/gunney/bluepri…
gunney1 Jan 29, 2025
59d3aed
Silence a warning.
gunney1 Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/axom/core/execution/execution_space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "axom/config.hpp"
#include "axom/core/memory_management.hpp"
#include "axom/core/execution/runtime_policy.hpp"

/*!
* \file execution_space.hpp
Expand Down Expand Up @@ -88,6 +89,18 @@ struct execution_space
static constexpr bool onDevice() noexcept { return false; }
static constexpr char* name() noexcept { return (char*)"[UNDEFINED]"; }
static int allocatorID() noexcept { return axom::INVALID_ALLOCATOR_ID; }
static constexpr runtime_policy::Policy runtimePolicy() noexcept
{
return runtime_policy::Policy::seq;
}
static bool usesMemorySpace(axom::MemorySpace m) noexcept
{
return m == memory_space;
}
static bool usesAllocId(int allocId) noexcept
{
return usesMemorySpace(axom::detail::getAllocatorSpace(allocId));
}
};

} // namespace axom
Expand Down
12 changes: 12 additions & 0 deletions src/axom/core/execution/internal/cuda_exec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ struct execution_space<CUDA_EXEC<BLOCK_SIZE, SYNCHRONOUS>>
{
return axom::getUmpireResourceAllocatorID(umpire::resource::Device);
}
static constexpr runtime_policy::Policy runtimePolicy() noexcept
{
return runtime_policy::Policy::cuda;
}
static bool usesMemorySpace(axom::MemorySpace m) noexcept
{
return m == memory_space || m == MemorySpace::Unified;
}
static bool usesAllocId(int allocId) noexcept
{
return usesMemorySpace(axom::detail::getAllocatorSpace(allocId));
}
};

/*!
Expand Down
12 changes: 12 additions & 0 deletions src/axom/core/execution/internal/hip_exec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ struct execution_space<HIP_EXEC<BLOCK_SIZE, SYNCHRONOUS>>
{
return axom::getUmpireResourceAllocatorID(umpire::resource::Device);
}
static constexpr runtime_policy::Policy runtimePolicy() noexcept
{
return runtime_policy::Policy::hip;
}
static bool usesMemorySpace(axom::MemorySpace m) noexcept
{
return m == memory_space || m == MemorySpace::Unified;
}
static bool usesAllocId(int allocId) noexcept
{
return usesMemorySpace(axom::detail::getAllocatorSpace(allocId));
}
};

/*!
Expand Down
16 changes: 16 additions & 0 deletions src/axom/core/execution/internal/omp_exec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ struct execution_space<OMP_EXEC>
return axom::getDefaultAllocatorID();
#endif
}
static constexpr runtime_policy::Policy runtimePolicy() noexcept
{
return runtime_policy::Policy::omp;
}
static bool usesMemorySpace(axom::MemorySpace m) noexcept
{
return m == memory_space
#ifdef AXOM_USE_UMPIRE
|| m == MemorySpace::Unified
#endif
;
}
static bool usesAllocId(int allocId) noexcept
{
return usesMemorySpace(axom::detail::getAllocatorSpace(allocId));
}
};

} // namespace axom
Expand Down
16 changes: 16 additions & 0 deletions src/axom/core/execution/internal/seq_exec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ struct execution_space<SEQ_EXEC>
return axom::getDefaultAllocatorID();
#endif
}
static constexpr runtime_policy::Policy runtimePolicy() noexcept
{
return runtime_policy::Policy::seq;
}
static bool usesMemorySpace(axom::MemorySpace m) noexcept
{
return m == memory_space
#ifdef AXOM_USE_UMPIRE
|| m == MemorySpace::Unified
#endif
;
}
static bool usesAllocId(int allocId) noexcept
{
return usesMemorySpace(axom::detail::getAllocatorSpace(allocId));
}
};

} // namespace axom
Expand Down
21 changes: 21 additions & 0 deletions src/axom/core/memory_management.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ inline int getDefaultAllocatorID()
#endif
}

/*!
* \brief Get the allocator id from which data has been allocated.
* \return Allocator id. If Umpire doesn't have an allocator for
* the pointer, or Axom wasn't configured with Umpire, return 0.
*
* \pre ptr has a valid pointer value.
*/
inline int getAllocatorIDFromPointer(const void* ptr)
{
#ifdef AXOM_USE_UMPIRE
umpire::ResourceManager& rm = umpire::ResourceManager::getInstance();
if(rm.hasAllocator(const_cast<void*>(ptr)))
{
umpire::Allocator allocator = rm.getAllocator(const_cast<void*>(ptr));
return allocator.getId();
}
#endif
AXOM_UNUSED_VAR(ptr);
return 0;
gunney1 marked this conversation as resolved.
Show resolved Hide resolved
}

/*!
* \brief Allocates a chunk of memory of type T.
*
Expand Down
23 changes: 10 additions & 13 deletions src/axom/mint/mesh/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,19 @@ Mesh::Mesh(sidre::Group* group, const std::string& topo)
m_coordset =
blueprint::getCoordsetGroup(m_group, getTopologyGroup())->getName();

SLIC_ERROR_IF(!m_group->hasChildGroup("state"),
"root group does not have a state group.");

sidre::Group* state_group = m_group->getGroup("state");
SLIC_ERROR_IF(!state_group->hasChildGroup(m_topology),
"state group has no " << m_topology << " child group.");

state_group = state_group->getGroup(m_topology);
if(state_group->hasChildView("block_id"))
if(state_group != nullptr && state_group->hasChildGroup(m_topology))
{
m_block_idx = state_group->getView("block_id")->getScalar();
}
state_group = state_group->getGroup(m_topology);
if(state_group->hasChildView("block_id"))
{
m_block_idx = state_group->getView("block_id")->getScalar();
}

if(state_group->hasChildView("partition_id"))
{
m_part_idx = state_group->getView("partition_id")->getScalar();
if(state_group->hasChildView("partition_id"))
{
m_part_idx = state_group->getView("partition_id")->getScalar();
}
}

SLIC_ERROR_IF(!validMeshType(), "invalid mesh type=" << m_type);
Expand Down
4 changes: 4 additions & 0 deletions src/axom/multimat/multimat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ bool AllocatorOnDevice(int allocatorId)
return true;
}
#endif
AXOM_UNUSED_VAR(allocatorId);
return false;
}

Expand Down Expand Up @@ -509,6 +510,9 @@ void ScanRelationOffsetsRAJA(const axom::ArrayView<const IndexType> counts,
}
});
#else
AXOM_UNUSED_VAR(counts);
AXOM_UNUSED_VAR(begins);
AXOM_UNUSED_VAR(firstIndices);
SLIC_ASSERT_MSG(
false,
"Calling ScanRelationOffsetsRAJA requires support for RAJA and Umpire.");
Expand Down
18 changes: 11 additions & 7 deletions src/axom/quest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,20 @@ blt_list_append(

blt_list_append( TO quest_depends_on ELEMENTS conduit::conduit IF CONDUIT_FOUND )

if(MFEM_FOUND AND AXOM_ENABLE_KLEE AND AXOM_ENABLE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION)
if(AXOM_ENABLE_KLEE AND AXOM_ENABLE_SIDRE AND ((MFEM_FOUND AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION) OR CONDUIT_FOUND))
gunney1 marked this conversation as resolved.
Show resolved Hide resolved
list(APPEND quest_headers Shaper.hpp
SamplingShaper.hpp
IntersectionShaper.hpp
DiscreteShape.hpp
detail/shaping/shaping_helpers.hpp)
DiscreteShape.hpp)
list(APPEND quest_sources Shaper.cpp
DiscreteShape.cpp
detail/shaping/shaping_helpers.cpp)
DiscreteShape.cpp)
list(APPEND quest_depends_on klee)
if(RAJA_FOUND)
list(APPEND quest_headers IntersectionShaper.hpp)
endif()
endif()

if(AXOM_ENABLE_KLEE AND AXOM_ENABLE_SIDRE AND (MFEM_FOUND AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION))
list(APPEND quest_headers SamplingShaper.hpp detail/shaping/shaping_helpers.hpp)
list(APPEND quest_sources detail/shaping/shaping_helpers.cpp)
endif()

if(C2C_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion src/axom/quest/DiscreteShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void DiscreteShape::createPlaneRepresentation()
const auto& plane = geometry.getPlane();
// Generate a big bounding hex on the positive side of the plane.
axom::primal::Hexahedron<double, 3> boundingHex;
const double len = 1e6; // Big enough to contain anticipated mesh.
const double len = 1e4; // Big enough to contain anticipated mesh.
// We should compute based on the mesh.
// clang-format off
boundingHex[0] = Point3D{0.0, -len, -len};
Expand Down
Loading
Loading