[Core][MPI] Adding SpatialSearchResultContainer and SpatialSearchResultContainerMap (v.2.0)#11416
Closed
loumalouomega wants to merge 113 commits intomasterfrom
Closed
[Core][MPI] Adding SpatialSearchResultContainer and SpatialSearchResultContainerMap (v.2.0)#11416loumalouomega wants to merge 113 commits intomasterfrom
SpatialSearchResultContainer and SpatialSearchResultContainerMap (v.2.0)#11416loumalouomega wants to merge 113 commits intomasterfrom
Conversation
Member
Author
|
Ping @pooyan-dadvand |
loumalouomega
commented
Sep 18, 2023
| /***********************************************************************************/ | ||
|
|
||
| template <class TObjectType> | ||
| std::vector<Vector> SpatialSearchResultContainer<TObjectType>::GetResultShapeFunctions(const array_1d<double, 3>& rPoint) |
Member
pooyan-dadvand
left a comment
There was a problem hiding this comment.
As we discussed with @roigcarlo and @RiccardoRossi and @jcotela we will pass the new interface to a new meta search class for MPI and leave the one by one interface only for local searches as before
| /// The type of geometrical object to be stored in the bins | ||
| using CellType = std::vector<GeometricalObject*>; | ||
| using ResultType = SpatialSearchResult<GeometricalObject>; | ||
| using ResultTypeContainer = SpatialSearchResultContainer<GeometricalObject>; |
| using CellType = std::vector<GeometricalObject*>; | ||
| using ResultType = SpatialSearchResult<GeometricalObject>; | ||
| using ResultTypeContainer = SpatialSearchResultContainer<GeometricalObject>; | ||
| using ResultTypeContainerMap = SpatialSearchResultContainerMap<GeometricalObject>; |
| } | ||
| mBoundingBox.Extend(Tolerance); | ||
| } | ||
| mBoundingBox.Extend(mTolerance); |
|
|
||
| // Synchronize if needed | ||
| if (SyncronizeResults) { | ||
| rResults.SynchronizeAll(ParallelEnvironment::GetDefaultDataCommunicator()); |
Member
There was a problem hiding this comment.
I am not sure using only the default communicator is not very limiting
Member
Author
|
Closing as included in #11719 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
#11205 + addressed comments
This PR introduces a new class named
SpatialSearchResultContainerandSpatialSearchResultContainerMap. The class provides storage and operations related to spatial search results. This is a transition PR to finally give support for MPI search usingGeometricalObjectBins.The
SpatialSearchResultContainerclass stores:PointerVectorSet)The class includes functions such as,
SynchronizeAll,HasResult,GetResultIndices,AddResult... The interesting part is that integrates a global pointer communicator, so it is possible to calculate anything passing a functor. The most common operations required are already implemented:GetResultShapeFunctions,GetResultIndicesandGetResultCoordinates,The
SynchronizeAllmethod synchronizes the container between partitions. TheAddResultmethod adds a result to the local pointers. There is apush_backwhich does the same.The
SpatialSearchResultContainerMapclass stores an unordered map ofSpatialSearchResultContainer, using an integer as hash. The hash is computed from the point coordinates pointer address (comment from #11205 by @pooyan-dadvand ) which we are computing the results.This commit seems to be a significant enhancement, providing a new means of handling and manipulating spatial search results in the Kratos library.
We need to derive
SpatialSearchResultfrom indexed object in order to be able to usePointerVectorSetin #11416, seeKratos/kratos/spatial_containers/spatial_search_result_container.h
Line 62 in b506cc1
SpatialSearchResulttheGlobalPointerUtilitiesin pourpose, with the corresponding debugging, problematics and error prone due to code duplication. This solution is therefore much cleaner.🆕 Changelog
spatial_search_result_container.cppandspatial_search_result_container.hfiles have been added, representing the implementation and header for theSpatialSearchResultContainerandSpatialSearchResultContainerMapclasses.SpatialSearchResultContainerandSpatialSearchResultContainerMapSpatialSearchResultContainerandSpatialSearchResultContainerMapGlobalPointerclass in global_pointer.h #11206== operatorinSpatialSearchResult#11221SpatialSearchResultderived fromIndexedObject#11414