-
Notifications
You must be signed in to change notification settings - Fork 65
Add METIS splitter/balancer #487
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
Conversation
|
@cwsmith I want to move |
|
@bobpaw How about making it a free function in apfMesh.h ? IIRC, it tags the face (element) on the other side of a given edge (face). |
|
@cwsmith the only thing is there are some static helper functions. But if you prefer to group functions in apfMesh.cc then I can rename any conflicts. I can also put the declaration in apfMesh.h and only keep the definitions separate which might be the best option. |
|
/runtests |
|
Build Log |
7ee49f5 to
4edc9ca
Compare
|
Checks for the user example project are failing because the CI builds make static libraries. There is a line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you.
A handful of relatively small comments are below.
In general, it would be nice to see more asserts on function inputs, but if other places in the code are already checking then it is fine.
Is there still an issue with shared vs static linking?
|
/runtests |
|
Build Log |
Should I be adding PCU_ALWAYS_ASSERT or PCU_DEBUG_ASSERT in general? |
|
I'd prefer ALWAYS... but if we documented a non-trivial performance hit then DEBUG would be fine. Alternatively, functions that are called infrequently can be ALWAYS while functions that are called many times (i.e., once per mesh entity) could use DEBUG. |
I checked for |
|
(Rebased onto develop) |
|
/runtests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you. I only have one minor suggestion below.
|
Build Log |
|
/runtests |
|
Build Log |
- for balancing, transfer graph info back to rank 0 and call metis partitioner. Signed-off-by: Aiden Woodruff <[email protected]>
- ma/CMakeLists.txt: add METIS compile/link flags. - ma/maBalance.cc: move <numeric> and <mpi.h> to global scope. - (runLocalizedGraphMetis): build adj_cts first and then adjncy to put edges in the correct locations. - get number when assigning adjncy to put edges in the right spot. - adjust iteration variable names. - add #ifdef APW_LGMETIS_SER to partition without migrating. - add #ifdef APW_LGMETIS_VIZ to make VTK renders of migration plan. - calculate edge cut. - test/CMakeLists.txt: add lgmsplit test. - test/lgmsplit.cc: add test of localizedGraphMetis copied from split.cc. Signed-off-by: Aiden Woodruff <[email protected]>
- ma/maBalance.cc: add fstream for writing debug info.
- (runLocalizedGraphMetis): only allow 3d mesh.
- remove early Allgather of global element counts.
- rename nelm to n_owned_elm.
- update makeGlobal comment.
- use Exscan for global numbering.
- rename `opposites` to `opp_tag` to clarify meaning.
- remove local_xadj fixme since it's no longer recalculated.
- add fixmes.
- refactor xadj and adjncy localization.
- fix adjncy Gatherv displs.
- add APW_LGMETIS_DUMP vtk section compiled conditionally.
- takes time to localize centroids.
- add APW_LGMETIS_SER to force splitting on serial runs.
- update scatterv call.
Signed-off-by: Aiden Woodruff <[email protected]>
- metis/CMakeLists.txt: use different sources depending on ENABLE_METIS. - add apfMETISempty.cc without ENABLE_METIS. - metis/apfMETIS.h: add apf::hasMETIS. - metis/apfMETIS.cc: define hasMETIS. - metis/apfMETISempty.cc: add empty defintions like apf_zoltan. - define hasMETIS. - test/CMakeLists.txt: compile msplit conditionally. - test/testing.cmake: add msplit tests conditionally. Signed-off-by: Aiden Woodruff <[email protected]>
- metis/CMakeLists.txt: remove PRIVATE c++14 feature. - metis/apfMETISbalancer.cc: replace lambda auto parameters with using-decltype. Signed-off-by: Aiden Woodruff <[email protected]>
- zoltan/apfZoltan.h: remove tagOpposites declaration. - zoltan/apfInterElement.cc: remove tagOpposites source. - apf/apfMesh.h: add tagOpposites declaration. - reformat documentation comment. - apf/apfOpposites: add new file with tagOpposites source and helpers. - apf/CMakeLists.txt: add apfOpposites.cc to SOURCES. Signed-off-by: Aiden Woodruff <[email protected]>
- ma/maInput.h: add pre, mid, and post METIS flags and documentation. - ma/maInput.cc (setDefaultValues): initialize new balancer flags to false. - (moreThanOneOptionIsTrue): replace arguments with std::initializer_list to support arbitrarily many options. - (validateInput): use new moreThanOneOptionIsTrue. - add METIS flags to moreThanOneOptionIsTrue calls. - reformat to fit 80 characters. - reject metis flags when compiled without METIS. - ma/maBalance.cc: run metis in preBalance, midBalance, postBalance if requested. Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
- test/mbalance.cc: add metis balancer test based on balance.cc. - test/CMakeLists.txt: add mbalance. - test/testing.cmake: add mbalance. Signed-off-by: Aiden Woodruff <[email protected]>
- test/mbalance.cc: add try-catch block to avoid calling pcu::Finalize before pcu_obj destructor. Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
- metis/apfMETISbalancer.cc: move graph gather/part scatter into helper functions. - this is the first step of removing direct MPI calls. Signed-off-by: Aiden Woodruff <[email protected]>
- metis/apfMETISbalancer.cc (gatherGraph): replace Gatherv with PCU Pack/Unpack. - remove localized vtx_displs in favor of Exscan and send. - (scatterPart): remove vtx_displs argument. - replace Scatterv with PCU Pack/Unpack. - (MetisBalancer::balance): remove MPI_Comm. Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
- test/mbalance.cc: fix imbalance argument being an int. Signed-off-by: Aiden Woodruff <[email protected]>
- .github/workflows/cmake.yml: revert cmake update. the image already comes with a new version. - cmake/FindMETIS.cmake: add METIS_LIBRARIES and METIS_INCLUDE_DIRS as output variables. - make METIS_PREFIX a HINT not a PATH because HINTS are searched first. - metis/CMakeLists.txt: remove MODULE from find_package to allow using a Config script. - use METIS_LIBRARIES instead of METIS_INCLUDE_DIRS to fix static builds. Signed-off-by: Aiden Woodruff <[email protected]>
- metis/CMakeLists.txt: remove apf_zoltan from linking since tagOpposites is in apf now. - metis/apfMETIScommon.cc: remove apfZoltan.h. Signed-off-by: Aiden Woodruff <[email protected]>
- metis/apfMETIS.h: move \page metis to metis.dox. - add function documentation. - add Partitioning Doxygen group. - metis/metis.dox: specify localization to rank 0 and change "only relevant" to "necessary". - change "minimize migration" to "minimize data sent" because migration may or may not be more than ParMETIS. - scorec.dox: add metis subpage. - Doxyfile.in: add metis input files. - Doxyfile_internal.in: add metis input files. - apf/apfMesh.h (tagOpposites): update detailed paragraph. - metis/apfMETISbalancer.cc: update ignoring weights message. - metis/apfMETISsplitter.cc: update ignoring weights message. Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
- metis/apfMETISbalancer.cc (gatherGraph): check MPI world size, confirm no empty parts, and check that the last element of xadj is at least correct. - (scatterPart): check mpi size, vtx_cts is rightly sized, no empty part, sum of vtx_counts is right (on non-0 rank vtx_cts and part are both empty). - (MetisBalancer::balance): confirm tolerance is at least more than 1 (required by METIS). - remove assert about idx_t. - metis/apfMETISsplitter.cc: check that tolerance is good and splitting to more than 1 part. - remove idx_t size assert. Signed-off-by: Aiden Woodruff <[email protected]>
- metis/apfMETISbalancer.cc (MetisBalancer::balance): replace numbering code with Exscan and makeNumbering. Used Exscan in this function because gn_offset is required later on. - metis/apfMETISsplitter.cc (MetisSplitter::split): replace numbering with makeNumbering. - metis/apfMETIScommon.cc: add makeNumbering function which combines the behavior of the splitter and balancer. skipped intermediate Numbering* to ensure only elements are numbered and let the balancer enforce rank contiguity. - metis/apfMETIScommon.h: add makeNumbering with default start of 0 for splitter. Signed-off-by: Aiden Woodruff <[email protected]>
- metis/apfMETIScommon.h: add runMETIS. - metis/aofMETIScommon.cc: add runMETIS which creates necessary input arguments, prints errors, and returns bool. - metis/apfMETISbalancer.cc: use runMETIS. - add remap timer. - print that adapt continues without balancing. - metis/apfMETISsplitter.cc: remove old comment. - use runMETIS. Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
- metis/apfMETIS.h: add APF_METIS_MAXRANKS macro. - metis/apfMETISbalancer.cc: fail with error message when more than 256 peers. - metis/apfMETISsplitter.cc: fail when more than 256 peers. - metis/apfMETIScommon.h: add STRINGIFY macro for error messages. - ma/maBalance.cc: fallback to Parma when PUMI_HAS_METIS but more than 256 peers to avoid failure. Signed-off-by: Aiden Woodruff <[email protected]>
- metis/apfMETIScommon.c (makePlan): send to all ranks to avoid empty ranks on split. - metis/apfMETISsplitter.cc (MetisSplitter::split): spread parts during multiproc split. - test/msplit.cc: update msplit documentation. - (Args): add back factor. - (getConfig): add factor parameter. - (main): split into modulo factor parts. - test/testing.cmake: add 2 to 6 metis split test. Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
|
/runtests |
|
Build Log |
Add METIS splitter/balancer
Add a direct METIS splitter and a balancer which only localizes graph connectivity. Adds
msplit_2andmsplit_3test cases.Waiting on #486 to avoid rebasing.