-
Notifications
You must be signed in to change notification settings - Fork 65
add support for Zoltan with PT-Scotch #478
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -9,7 +9,9 @@ | |||||
#include "apfZoltanMesh.h" | ||||||
#include "apfZoltan.h" | ||||||
#include "apfShape.h" | ||||||
#ifdef PUMI_HAS_PARMETIS | ||||||
#include <metis.h> | ||||||
#endif | ||||||
#include <pcu_util.h> | ||||||
#include <lionPrint.h> | ||||||
#include <cstdlib> | ||||||
|
@@ -29,9 +31,33 @@ static int setZoltanLbMethod(struct Zoltan_Struct* ztn, ZoltanMesh* zb) | |||||
case HYPERGRAPH: | ||||||
lbMethod = "HYPERGRAPH"; break; | ||||||
case PARMETIS: //fall into GRAPH settings | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should remove the 'fall into GRAPH settings' comment |
||||||
lbMethod = "GRAPH"; | ||||||
#ifdef PUMI_HAS_PARMETIS | ||||||
Zoltan_Set_Param(ztn, "GRAPH_PACKAGE", "PARMETIS"); | ||||||
#else | ||||||
lion_oprint(1, "WARNING: ParMETIS ZoltanMethod requested but ParMETIS" | ||||||
" was not enabled at build time.\n"); | ||||||
Comment on lines
+38
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should make this an error (i.e., stop execution) or, indicate to the user that PHG will be used instead (IIUC): Also, |
||||||
#endif | ||||||
break; | ||||||
case PTSCOTCH: | ||||||
lbMethod = "GRAPH"; | ||||||
#ifdef PUMI_HAS_PTSCOTCH | ||||||
Zoltan_Set_Param(ztn, "GRAPH_PACKAGE", "Scotch"); | ||||||
#else | ||||||
lion_oprint(1, "WARNING: PT-Scotch ZoltanMethod requested but PT-Scotch" | ||||||
" was not enabled at build time.\n"); | ||||||
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should make this an error (i.e., stop execution) or, indicate to the user that PHG will be used instead (IIUC): Also, lion_oprint will write on all ranks; we should probably only print from rank 0 here. |
||||||
#endif | ||||||
break; | ||||||
case GRAPH: | ||||||
lbMethod = "GRAPH"; | ||||||
Zoltan_Set_Param(ztn, "GRAPH_PACKAGE", "PARMETIS"); // instead of PHG | ||||||
// Prefer ParMETIS, then PT-Scotch, then Zoltan-native PHG. | ||||||
#if defined(PUMI_HAS_PARMETIS) | ||||||
Zoltan_Set_Param(ztn, "GRAPH_PACKAGE", "PARMETIS"); | ||||||
#elif defined(PUMI_HAS_PTSCOTCH) | ||||||
Zoltan_Set_Param(ztn, "GRAPH_PACKAGE", "Scotch"); | ||||||
#else | ||||||
// Zoltan_Set_Param(ztn, "HYPERGRAPH_PACKAGE", "PHG"); //FIXME: not required? | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we are providing at least some of the hypergraph callbacks core/zoltan/apfZoltanCallbacks.cc Lines 363 to 364 in 17ad033
so I think this should work as a decent fallback. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think even if the hypergraph functions are not fully implemented we can use PHG and the hypergraph will be constructed using the graph query operations. https://sandialabs.github.io/Zoltan/ug_html/ug_graph_vs_hg.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. Thank you. So, whatever we do for the above 'warnings' (i.e., GRAPH requested but PHG provided) we should do that here in the |
||||||
#endif | ||||||
break; | ||||||
default: | ||||||
lion_oprint(1,"ERROR %s Invalid LB_METHOD %d\n",__func__, zb->method); | ||||||
|
@@ -68,8 +94,14 @@ static int setZoltanLbApproach(struct Zoltan_Struct* ztn, ZoltanMesh* zb) | |||||
return 1; | ||||||
} | ||||||
Zoltan_Set_Param(ztn, "LB_APPROACH", ptnAp.c_str()); | ||||||
if ( (3 == zb->method) || (4 == zb->method) ) | ||||||
if (zb->method == PARMETIS | ||||||
#ifdef PUMI_HAS_PARMETIS // in this case GRAPH implies PARMETIS. | ||||||
|| zb->method == GRAPH | ||||||
#endif | ||||||
) { | ||||||
Zoltan_Set_Param(ztn, "PARMETIS_METHOD", pMethod.c_str()); | ||||||
} | ||||||
// No zb->method == PTSCOTCH because Zoltan only supports RBISECT. | ||||||
return 0; | ||||||
} | ||||||
|
||||||
|
@@ -304,7 +336,9 @@ ZoltanData::~ZoltanData() | |||||
void ZoltanData::run() | ||||||
{ | ||||||
/* ensure Metis indices are the same size as Zoltan indices */ | ||||||
#ifdef PUMI_HAS_PARMETIS | ||||||
PCU_ALWAYS_ASSERT(IDXTYPEWIDTH == sizeof(ZOLTAN_ID_TYPE)*8); | ||||||
#endif | ||||||
setup(); | ||||||
ptn(); | ||||||
} | ||||||
|
@@ -331,7 +365,9 @@ void ZoltanData::setup() | |||||
if ( zb->isLocal && 0 != m->getPCU()->Self() ) | ||||||
snprintf(paramStr, 128, "%d", 0); //if local silence all but rank 0 | ||||||
Zoltan_Set_Param(ztn, "debug_level", paramStr); | ||||||
#ifdef PUMI_HAS_PARMETIS | ||||||
Zoltan_Set_Param(ztn, "PARMETIS_OUTPUT_LEVEL", paramStr); | ||||||
#endif | ||||||
Zoltan_Set_Param(ztn, "CHECK_GRAPH", "0"); | ||||||
Zoltan_Set_Param(ztn, "CHECK_HYPERGRAPH", "0"); | ||||||
|
||||||
|
Uh oh!
There was an error while loading. Please reload this page.