Skip to content

Commit

Permalink
Choose different codepath if METIS 5 is found (METIS_PartGraphRecursi…
Browse files Browse the repository at this point in the history
…ve). METIS_VER_MAJOR macro is defined in METIS 5.x.x
  • Loading branch information
alamages committed Mar 23, 2015
1 parent 6ef23f2 commit 87516d4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dune/istl/repartition.hh
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.

Copy link
@gruenich

gruenich Mar 23, 2015

Wouldn't it be better to use METIS_VER_MAJOR >= 5? This makes it more obvious that the change is since Metis 5.

This comment has been minimized.

Copy link
@alamages

alamages Mar 23, 2015

Author Owner

@gruenich yes you are right, this makes more sence. I will change it

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;
Expand Down

1 comment on commit 87516d4

@gruenich
Copy link

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.

Please sign in to comment.