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

patchkernel: initialize partitioning in the constructor #82

Merged
merged 22 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cd11bde
test/surfunstructured: avoid using deprecated functions
andrea-iob Dec 19, 2020
019a5ab
discretization: fix assert condition
andrea-iob Jan 4, 2021
8ca8b60
volunstructured: fix initialization of partitioning status
andrea-iob Aug 26, 2020
b7e2b82
voloctree: add an early return to "_partitioningAlter" if the dimensi…
andrea-iob Aug 26, 2020
3ac2de1
POD: initialize mesh communicator only if a valid communicator is set
andrea-iob Aug 26, 2020
83a7cc8
examples/POD: no need to set the communicator of the patch
andrea-iob Aug 26, 2020
d3bb0d4
containers/flatVector2D: remove unneeded checks
andrea-iob Jan 3, 2021
1f9bbb2
test/POD: add a dedicated parallel test
andrea-iob Dec 31, 2020
4b7613f
PABLO: delete stale code
andrea-iob Dec 30, 2020
b676fa5
PABLO: fix evaluation of partition when some processors receive no oc…
andrea-iob Jan 3, 2021
105c982
PABLO: fix evaluation of ghosts when there are no face virtual neighb…
andrea-iob Jan 3, 2021
8fb043a
PABLO: fix load balance when there are partitions with no octants
andrea-iob Jan 3, 2021
443170d
PABLO: fix evaluation of maximum depth when the tree is emtpy
andrea-iob Jan 20, 2021
8f07c6e
PABLO: update maximum depth after coarsening the tree
andrea-iob Jan 20, 2021
9c83d58
PABLO: do not create the root octant if no dimension is set
andrea-iob Jan 3, 2021
e70164b
test/levelset: partition the mesh before evaluating the levelset
andrea-iob Jan 3, 2021
5f92fa7
patchkernel: use partitioning flag when extracting patch numbering info
andrea-iob Jan 3, 2021
6e81452
patchkernel: allow to initialize partitioning information in patch co…
andrea-iob Aug 26, 2020
48434b5
levelset: use the same communicator of the patch when extracting face…
andrea-iob Jan 3, 2021
0679932
patchkernel: check if the patch is partitioned using the 'isPartition…
andrea-iob Jan 19, 2021
c96efb5
patchkernel: declare functions that handle the communicator as privat…
andrea-iob Jan 3, 2021
6620ad4
patchkernel: initialize partitioning in the constructor
andrea-iob Jan 3, 2021
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
3 changes: 0 additions & 3 deletions examples/POD_example_00002.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ void run(int rank, int nProcs)
int dumpBlock = (nProcs > 1) ? rank : -1;
std::string filename = "./data/test.0.mesh";
IBinaryArchive binaryReader(filename, dumpBlock);
#if BITPIT_ENABLE_MPI
meshr->setCommunicator(MPI_COMM_WORLD);
#endif
meshr->restore(binaryReader.getStream());
binaryReader.close();
}
Expand Down
14 changes: 10 additions & 4 deletions src/PABLO/LocalTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ namespace bitpit {
};

/*! Get max depth reached in local tree
* If the tree is empty a negative number is returned.
* \return Max depth in local partition of the octree.
*/
uint8_t
int8_t
LocalTree::getLocalMaxDepth() const{
return m_localMaxDepth;
};
Expand Down Expand Up @@ -364,14 +365,14 @@ namespace bitpit {
m_lastGhostBros.clear();
m_firstGhostBros.clear();

m_localMaxDepth = 0;

clearConnectivity();
intervector().swap(m_intersections);

std::fill(m_periodic.begin(), m_periodic.end(), false);

if (createRoot) {
if (m_dim > 0 && createRoot) {
m_localMaxDepth = 0;

m_octants.push_back(Octant(m_dim));

Octant firstDesc(TreeConstants::MAX_LEVEL,0,0,0);
Expand All @@ -380,6 +381,8 @@ namespace bitpit {
Octant lastDesc(m_dim,TreeConstants::MAX_LEVEL,TreeConstants::MAX_LENGTH-1,TreeConstants::MAX_LENGTH-1,(m_dim-2)*(TreeConstants::MAX_LENGTH-1));
m_lastDescMorton = lastDesc.computeMorton();
} else {
m_localMaxDepth = -1;

Octant octDesc(m_dim,TreeConstants::MAX_LEVEL,pow(2,TreeConstants::MAX_LEVEL),pow(2,TreeConstants::MAX_LEVEL),(m_dim > 2 ? pow(2,TreeConstants::MAX_LEVEL) : 0));
m_lastDescMorton = octDesc.computeMorton();
m_firstDescMorton = PABLO::INVALID_MORTON;
Expand Down Expand Up @@ -824,6 +827,9 @@ namespace bitpit {

m_sizeOctants = m_octants.size();

// Update maximum depth
updateLocalMaxDepth();

// Set final last desc
setFirstDescMorton();
setLastDescMorton();
Expand Down
4 changes: 2 additions & 2 deletions src/PABLO/LocalTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class LocalTree{
uint64_t m_lastDescMorton; /**< Morton number of last (Morton order) most refined octant possible in local partition */
uint32_t m_sizeGhosts; /**< Size of vector of ghost octants */
uint32_t m_sizeOctants; /**< Size of vector of local octants */
uint8_t m_localMaxDepth; /**< Reached max depth in local tree */
int8_t m_localMaxDepth; /**< Reached max depth in local tree */
uint8_t m_balanceCodim; /**<Maximum codimension of the entity for 2:1 balancing (1 = 2:1 balance through faces (default);
2 = 2:1 balance through edges and faces;
3 = 2:1 balance through nodes, edges and faces)*/
Expand Down Expand Up @@ -157,7 +157,7 @@ class LocalTree{
uint64_t getLastDescMorton() const;
uint32_t getNumGhosts() const;
uint32_t getNumOctants() const;
uint8_t getLocalMaxDepth() const;
int8_t getLocalMaxDepth() const;
int8_t getMarker(int32_t idx) const;
uint8_t getLevel(int32_t idx) const;
uint64_t computeMorton(int32_t idx) const;
Expand Down
Loading