2
/// This file is part of Rheolef.
4
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
6
/// Rheolef is free software; you can redistribute it and/or modify
7
/// it under the terms of the GNU General Public License as published by
8
/// the Free Software Foundation; either version 2 of the License, or
9
/// (at your option) any later version.
11
/// Rheolef is distributed in the hope that it will be useful,
12
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
/// GNU General Public License for more details.
16
/// You should have received a copy of the GNU General Public License
17
/// along with Rheolef; if not, write to the Free Software
18
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
/// =========================================================================
21
#include "rheolef/config.h"
22
#ifdef _RHEOLEF_HAVE_MPI
24
#include "rheolef/distributed.h"
26
#include "geo_partition_scotch.h"
34
vector<my_idxtype>& eind,
36
vector<my_idxtype>& xadj,
37
vector<my_idxtype>& adjncy,
38
const mpi::communicator& comm);
41
void ParMETIS_V3_PartKway (const int * const, int * const, int * const, int * const, int * const, const int * const, const int * const, const int * const, const int * const, const float * const, const float * const, const int * const, int * const, int * const, MPI_Comm * const);
43
// -------------------------------------------------------------------------------------
44
// This function is the entry point of the distributed k-way multilevel mesh partitionioner
45
// This function assumes nothing about the mesh distribution.
46
// It is the general case.
47
// -------------------------------------------------------------------------------------
48
void geo_partition_scotch (
51
vector<my_idxtype>& eind,
60
const mpi::communicator& comm)
62
if (eind.size() == 0) {
63
error_macro ("empty sizes not supported");
65
// Try and take care bad inputs
66
if (elmdist == NULL || eptr == NULL ||
67
ncon == NULL || ncommonnodes == NULL || nparts == NULL ||
68
tpwgts == NULL || ubvec == NULL || edgecut == NULL ||
70
error_macro ("one or more required parameters is NULL");
74
vector<my_idxtype> xadj;
75
vector<my_idxtype> adjncy;
87
// Partition the graph
88
MPI_Comm raw_comm = comm;
91
options[PMV3_OPTION_DBGLVL] = 0; // otherwise: timming print to stdout...
92
options[PMV3_OPTION_SEED] = 0;
97
xadj.begin().operator->(),
98
adjncy.begin().operator->(),
115
} // namespace rheolef
116
#endif // _RHEOLEF_HAVE_MPI