Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bb22d20
Directly compute object bounding box and remove an unneeded templated…
gunney1 May 17, 2024
7e80da7
Rename m_sqDistanceThreshold to m_sqUserDistanceThreshold.
gunney1 Jun 5, 2024
71db1c7
Clean up outdated comments.
gunney1 Jun 5, 2024
cee44f7
Compute and gather min-max distance threshold.
gunney1 Jun 5, 2024
1d2c444
Use the computed distance threshold to filter communication and searc…
gunney1 Jun 5, 2024
3049520
Fix bugs in new code.
gunney1 Jun 6, 2024
d9b09d7
More robust handling of non-unique strides in ArrayBase.
gunney1 Jun 6, 2024
81655eb
Robust handling of insufficient size specified when creating data fields
gunney1 Jun 6, 2024
5ae1ab3
Add cell ranks to mesh output, for debugging.
gunney1 Jun 6, 2024
75f94d2
Count number of times xferNode is locally searched, for analysis and …
gunney1 Jun 6, 2024
869d456
Reformat.
gunney1 Jun 7, 2024
43f5b52
Special treatment for domain underloading, which causes invalid bound…
gunney1 Jun 7, 2024
0a28c48
Comment and minor changes.
gunney1 Jun 7, 2024
37466d4
Compute analytical distances for non-spherical object mesh.
gunney1 Jun 7, 2024
d6b9dcc
Fix bug in computing object partitions bounding box.
gunney1 Jul 5, 2024
662f2cc
Add performance diagnostics to the example.
gunney1 Jul 5, 2024
30a4b72
Improve output formatting and fix an error in computing tolerance in 3D.
gunney1 Jul 10, 2024
e2f41f5
Implement a switch for filtering search by ranks.
gunney1 Jul 18, 2024
3bc2019
Implement mesh-swapping switch to facilite changing the mesh configur…
gunney1 Sep 4, 2024
827c46c
Time the all-gather communication.
gunney1 Feb 18, 2026
45e6999
Merge remote-tracking branch 'gh/develop' into feature/gunney/point-s…
gunney1 Feb 19, 2026
a76dbf1
Autoformat.
gunney1 Feb 19, 2026
4122716
Remove dead code.
gunney1 Feb 19, 2026
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
16 changes: 13 additions & 3 deletions src/axom/core/ArrayBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,16 +371,26 @@ class ArrayBase
updateStrides();
}

/// \brief Set the shape and stride
/*!
\brief Set the shape and stride

\param [in] shape
\param [in] stride
\param [in] orderPref Preference for resolving non-unique strides.
\a ROW means to advance left index first. \a COLUMN means to advance
right index first. Indexing is correct regardless of the
preference, but the index ordering is dependent on the choice.
*/
AXOM_SUPPRESS_HD_WARN
AXOM_HOST_DEVICE void setShapeAndStride(const StackArray<IndexType, DIM>& shape,
const StackArray<IndexType, DIM>& stride)
const StackArray<IndexType, DIM>& stride,
axom::ArrayStrideOrder orderPref = axom::ArrayStrideOrder::ROW)
{
#ifdef AXOM_DEBUG
validateShapeAndStride(shape, stride);
#endif
m_shape = shape;
m_mapping.initializeStrides(stride);
m_mapping.initializeStrides(stride, orderPref);
m_minStride = m_mapping.fastestStrideLength();
}

Expand Down
10 changes: 6 additions & 4 deletions src/axom/core/MDMapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,13 @@ class MDMapping
}
os << strides[DIM - 1] << ")";
std::cerr << "ERROR: MDMapping: 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 MDMapping initializer.\n";
utilities::processAbort();
<< "Caused by multi-dim array shape of 1 in some direction.\n"
<< "It is impossible to compute index ordering.\n"
<< "Use initializeStrides() with the stride order preference to fix.\n"
<< "The resulting slowestDirs() depends on the preference\n"
<< "but the array mapping will still be correct.\n";
#endif
utilities::processAbort();
}

// 2nd argument doesn't matter because strides are unique.
Expand Down
10 changes: 9 additions & 1 deletion src/axom/quest/DistributedClosestPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,12 @@ bool DistributedClosestPoint::generateBVHTree()
void DistributedClosestPoint::computeClosestPoints(conduit::Node& query_node,
const std::string& topology)
{
SLIC_ASSERT_MSG(m_impl, "Must call 'setObjectMesh' before calling generateBVHTree");
SLIC_ASSERT_MSG(m_impl, "Must call 'setObjectMesh' before calling computeClosestPoints");

SLIC_ASSERT(this->isValidBlueprint(query_node));

m_impl->setSquaredDistanceThreshold(m_sqDistanceThreshold);
m_impl->setFilterFarPartitions(m_filterFarPartitions);
m_impl->setMpiCommunicator(m_mpiComm);
m_impl->setOutputSwitches(m_outputRank,
m_outputIndex,
Expand Down Expand Up @@ -301,5 +302,12 @@ void DistributedClosestPoint::verifyTopologyName(const conduit::Node& meshNode,
}
}

axom::IndexType DistributedClosestPoint::searchCount() const { return m_impl->searchCount(); }

double DistributedClosestPoint::effectiveDistanceThreshold() const
{
return m_impl->effectiveDistanceThreshold();
}

} // end namespace quest
} // end namespace axom
34 changes: 34 additions & 0 deletions src/axom/quest/DistributedClosestPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "axom/config.hpp"
#include "axom/core/execution/runtime_policy.hpp"
// #include "axom/core/Types.hpp"
#include "axom/slic.hpp"

#include "conduit_node.hpp"
Expand Down Expand Up @@ -104,6 +105,21 @@ class DistributedClosestPoint
*/
void setDistanceThreshold(double threshold);

/*!
* @brief Sets whether to filter out far partitions.
* \param [in] filterFarPartitions Filter out ranks that are too far
* to give productive results.
*
* Filtering examines the bounding boxes of all the partitions to
* exclude unproductive partition searches. Filtering is enabled by
* default. The benefits are highly configuration-dependent, but
* cost is typically negligible.
*/
void setFilterFarPartitions(bool filterFarPartitions)
{
m_filterFarPartitions = filterFarPartitions;
}

/*!
@brief Set what fields to output.

Expand Down Expand Up @@ -172,6 +188,23 @@ class DistributedClosestPoint
*/
void computeClosestPoints(conduit::Node& query_node, const std::string& topology);

/*!
@brief Return the number of searches done on the last query
mesh's local partition.

This count includes 1 by the owner rank plus however many remote
ranks searched the partition.
*/
axom::IndexType searchCount() const;
/*!
@brief Return the effective distance threshold used for the
last query mesh's local partition.

Due to optimizations, this may be smaller than the value set
in setDistanceThreshold().
*/
double effectiveDistanceThreshold() const;

private:
/*!
@brief Allocate the DistributedClosestPointImpl object, which actually does the work.
Expand Down Expand Up @@ -199,6 +232,7 @@ class DistributedClosestPoint
int m_dimension {-1};
bool m_isVerbose {false};
double m_sqDistanceThreshold;
bool m_filterFarPartitions {true};

bool m_outputRank = true;
bool m_outputIndex = true;
Expand Down
27 changes: 18 additions & 9 deletions src/axom/quest/MeshViewUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,26 @@ static void shapesToStridesAndOffsets(const axom::StackArray<IType, DIM>& realSh
}

/*!
* @brief Convert blueprint-style offsets and strides to shape specifications.
* @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 valuesCount [i] Number of values in
* ghost-padded data. If this is too small (results in
* a negative \a hiPads for the slowest stride
* direction), that padding will be bumped to zero.
* @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.
* @param minStride [i] Stride of fastest advancing
* index direction.
* @param strideOrder [i] Fastest-to-slowest advancing
* index directions.
*/
template <typename IType, int DIM>
static void stridesAndOffsetsToShapes(const axom::StackArray<IType, DIM>& realShape,
Expand Down Expand Up @@ -159,7 +165,9 @@ static void stridesAndOffsetsToShapes(const axom::StackArray<IType, DIM>& realSh
const int& nextDir = strideOrder[nd + 1];
paddedShape[curDir] = strides[nextDir] / strides[curDir];
}
paddedShape[strideOrder[DIM - 1]] = valuesCount / strides[strideOrder[DIM - 1]];
const int slowestDir = strideOrder[DIM - 1];
paddedShape[slowestDir] =
std::max(valuesCount / strides[slowestDir], realShape[slowestDir] + offsets[slowestDir]);

for(int d = 0; d < DIM; ++d)
{
Expand Down Expand Up @@ -471,10 +479,10 @@ class MeshViewUtil

/*!
* @brief Return view to a scalar field variable.
*
*
* @warning 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.
*/
Expand Down Expand Up @@ -602,8 +610,9 @@ class MeshViewUtil
*
* @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] dtype Conduit data type to put in the field. If this is not
* big enough for the strides and offsets specified, a minimally
* sufficient size will be used to avoid negative ghost padding.
* @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.
*
Expand Down
Loading
Loading