X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_metis.c;h=0b372f4e6d573d185292ef0f0b5ecba8aad3d710;hb=79386ac5c73f8365c428b8ef595c4ef004959667;hp=0a7e241e8381bd7ffde291a7beba02771f811d91;hpb=f1a947b32a36d8dc8e3079b25305bb50e8cb59a0;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_metis.c b/src/MEDPartitioner/MEDPARTITIONER_metis.c index 0a7e241e8..0b372f4e6 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_metis.c +++ b/src/MEDPartitioner/MEDPARTITIONER_metis.c @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -26,30 +26,56 @@ #include "MEDPARTITIONER_metis.h" -#if defined(MED_ENABLE_METIS) - #include +#if defined(MED_ENABLE_METIS) & !defined(MED_ENABLE_PARMETIS) + #ifndef MED_ENABLE_METIS_V5 + #include "defs.h" + #endif // MED_ENABLE_METIS_V5 + #include "metis.h" + #ifdef MED_ENABLE_METIS_V5 + #define idxtype idx_t + #endif // MED_ENABLE_METIS_V5 #else typedef int idxtype; -#endif +#endif // defined(MED_ENABLE_METIS) & !defined(MED_ENABLE_PARMETIS) -void MEDPARTITIONER_METIS_PartGraphRecursive(int *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt, - idxtype *adjwgt, int *wgtflag, int *numflag, int *nparts, +void MEDPARTITIONER_METIS_PartGraphRecursive(int *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt, + idxtype *adjwgt, int *wgtflag, int *numflag, int *nparts, int *options, int *edgecut, idxtype *part) { #if defined(MED_ENABLE_METIS) - METIS_PartGraphRecursive(nvtxs, xadj, adjncy, vwgt, - adjwgt, wgtflag, numflag, nparts, + #ifndef MED_ENABLE_METIS_V5 + METIS_PartGraphRecursive(nvtxs, xadj, adjncy, vwgt, + adjwgt, wgtflag, numflag, nparts, + options, edgecut, part); + #else + int ncon=1; + options[METIS_OPTION_NCUTS]=1; + options[METIS_OPTION_NITER]=1; + options[METIS_OPTION_UFACTOR]=1; + METIS_PartGraphRecursive(nvtxs, &ncon, xadj, adjncy, vwgt, 0 /* vsize*/, + adjwgt, nparts,/* tpwgts*/ 0,/* ubvec */ 0, options, edgecut, part); + #endif #endif } -void MEDPARTITIONER_METIS_PartGraphKway(int *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt, - idxtype *adjwgt, int *wgtflag, int *numflag, int *nparts, +void MEDPARTITIONER_METIS_PartGraphKway(int *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt, + idxtype *adjwgt, int *wgtflag, int *numflag, int *nparts, int *options, int *edgecut, idxtype *part) { #if defined(MED_ENABLE_METIS) - METIS_PartGraphKway(nvtxs, xadj, adjncy, vwgt, - adjwgt, wgtflag, numflag, nparts, + #ifndef MED_ENABLE_METIS_V5 + METIS_PartGraphKway(nvtxs, xadj, adjncy, vwgt, + adjwgt, wgtflag, numflag, nparts, + options, edgecut, part); + #else + int ncon=1; + options[METIS_OPTION_NCUTS]=1; + options[METIS_OPTION_NITER]=1; + options[METIS_OPTION_UFACTOR]=1; + METIS_PartGraphKway(nvtxs, &ncon, xadj, adjncy, vwgt, 0 /* vsize*/, + adjwgt, nparts, 0 , 0 /* ubvec */, options, edgecut, part); + #endif #endif }