1 #ifndef _RHEOLEF_PARMETIS_TOOLS_H
2 #define _RHEOLEF_PARMETIS_TOOLS_H
24 #include "rheolef/distributor.h"
29 #define IDX_DATATYPE MPI_INT
36 std::vector<my_idxtype>& eind,
45 const mpi::communicator& comm);
59 #define UNBALANCE_FRACTION 1.05
61 #define PMV3_OPTION_DBGLVL 1
62 #define PMV3_OPTION_SEED 2
98 MeshType::MeshType(
const MeshType& x)
99 : ownership(x.ownership),
100 elements(x.elements),
108 gminnode(x.gminnode),
124 #define amax(a, b) ((a) >= (b) ? (a) : (b))
125 #define icopy(n, a, b) memcpy((b), (a), sizeof(int)*(n))
126 #define idxcopy(n, a, b) memcpy((b), (a), sizeof(my_idxtype)*(n))
127 #define SHIFTCSR(i, n, a) \
129 for (i=n; i>0; i--) a[i] = a[i-1]; \
133 template <
class Size,
class RandomIOIterator>
134 static inline void init_csr_ptr (Size
n,
const RandomIOIterator& aptr) {
135 for (Size i=1; i<
n; i++) aptr[i] += aptr[i-1];
136 for (Size i=
n; i>0; i--) aptr[i] = aptr[i-1];
139 template <
class Size,
class RandomIOIterator>
140 static inline void shift_csr_ptr (Size
n,
const RandomIOIterator& aptr) {
141 for (
long int i =
n; i > 0; i--) aptr[i] = aptr[i-1];
152 for (
int i=1; i<
n; i++) min = (x[i] < x[min] ? i : min);
162 for (
int i=1; i<
n; i++) max = (x[i] > x[max] ? i : max);
see the distributor page for the full documentation
This file is part of Rheolef.
int idxamax(int n, const std::vector< my_idxtype > &x)
void geo_partition_scotch(my_idxtype *elmdist, my_idxtype *eptr, vector< my_idxtype > &eind, my_idxtype *elmwgt, int *ncon, int *ncommonnodes, int *nparts, float *tpwgts, float *ubvec, int *edgecut, my_idxtype *part, const mpi::communicator &comm)
int idxamin(int n, const std::vector< my_idxtype > &x)
std::vector< my_idxtype > elements
rheolef::distributor ownership