forked from dune-project/dune-istl
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Choose different codepath if METIS 5 is found (METIS_PartGraphRecursi…
…ve). METIS_VER_MAJOR macro is defined in METIS 5.x.x
- Loading branch information
Showing
1 changed file
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -767,6 +767,7 @@ namespace Dune | |
typedef std::size_t idxtype; | ||
#endif | ||
|
||
#ifndef METIS_VER_MAJOR | ||
extern "C" | ||
{ | ||
// backwards compatibility to parmetis < 4.0.0 | ||
|
@@ -778,6 +779,7 @@ namespace Dune | |
idxtype *adjwgt, int *wgtflag, int *numflag, int *nparts, | ||
int *options, int *edgecut, idxtype *part); | ||
} | ||
#endif | ||
#else | ||
typedef std::size_t idxtype; | ||
#endif // HAVE_PARMETIS | ||
|
@@ -1134,9 +1136,17 @@ namespace Dune | |
std::cout<<"Creating grah one 1 process took "<<time.elapsed()<<std::endl; | ||
time.reset(); | ||
options[0]=0; options[1]=1; options[2]=1; options[3]=3; options[4]=3; | ||
#if METIS_VER_MAJOR > 4 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
alamages
Author
Owner
|
||
idxtype moptions[METIS_NOPTIONS]; | ||
METIS_SetDefaultOptions(moptions); | ||
moptions[METIS_OPTION_NUMBERING] = numflag; | ||
METIS_PartGraphRecursive(&noVertices, 1, gxadj, gadjncy, gvwgt, NULL, gadjwgt, | ||
&nparts, NULL, NULL, moptions, &edgecut, gpart); | ||
#else | ||
// Call metis | ||
METIS_PartGraphRecursive(&noVertices, gxadj, gadjncy, gvwgt, gadjwgt, &wgtflag, | ||
&numflag, &nparts, options, &edgecut, gpart); | ||
#endif | ||
|
||
if(verbose && oocomm.communicator().rank()==0) | ||
std::cout<<"METIS took "<<time.elapsed()<<std::endl; | ||
|
1 comment
on commit 87516d4
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.
Would you mind to change the commit comment? Start with a short line about what you did, then one empty line, followod by a more detailed description, similar what you wrote to our mailing list.
Wouldn't it be better to use METIS_VER_MAJOR >= 5? This makes it more obvious that the change is since Metis 5.