48 communicator comm = ios_ownership.
comm();
54 if (partition.dis_size() <= nproc || dis_nv <= nproc) {
56 for (
size_type ie = 0, nie = ios_ownership.
size(); ie < nie; ie++) {
57 partition [ie] = my_proc;
63 std::vector<idxtype> elmdist (nproc+1);
65 ios_ownership.
begin(),
68 std::vector<idxtype> eptr (ios_ownership.
dis_size()+1);
74 for (const_iterator_by_variant iter = ios_geo_element [variant].begin(), last = ios_geo_element [variant].end();
75 iter != last; iter++, ie++) {
77 eptr [ie+1] = eptr[ie] + K.
size();
81 std::vector<idxtype> eind (eptr [ios_ownership.
size()]);
82 std::vector<idxtype>::iterator iter_eind = eind.begin();
86 for (const_iterator_by_variant iter = ios_geo_element [variant].begin(), last = ios_geo_element [variant].end();
87 iter != last; iter++) {
89 for (
size_type iloc = 0; iloc < K.
size(); iloc++, iter_eind++) {
97 idxtype mgcnum = map_dim;
99 idxtype nparts = nproc;
100 std::vector<float> tpwgts (nparts*ncon);
101 std::fill (tpwgts.begin(), tpwgts.end(), 1./nparts);
103 std::fill (ubvec, ubvec+ncon, 1.05);
104 idxtype options [10];
106 const int pvm3_option_dbglvl = 1;
107 const int pvm3_option_seed = 2;
108 options[pvm3_option_dbglvl] = 0;
109 options[pvm3_option_seed] = 0;
111 MPI_Comm raw_comm = comm;
113#if defined(_RHEOLEF_HAVE_SCOTCH)
115 elmdist.begin().operator->(),
116 eptr.begin().operator->(),
122 tpwgts.begin().operator->(),
125 part.begin().operator->(),
127#elif defined(_RHEOLEF_HAVE_PARMETIS)
128 ParMETIS_V3_PartMeshKway(
129 elmdist.begin().operator->(),
130 eptr.begin().operator->(),
131 eind.begin().operator->(),
138 tpwgts.begin().operator->(),
142 part.begin().operator->(),
145# error either parmetis nor scotch partitioner founded
149 std::copy (part.begin(), part.end(), partition.begin());
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)
disarray< size_t > geo_mpi_partition(const std::array< hack_array< geo_element_hack >, reference_element::max_variant > &ios_geo_element, const distributor &ownership_by_dimension, size_t map_dim, size_t dis_nv)