49 #ifndef _ZOLTAN2_ALGND_HPP_ 50 #define _ZOLTAN2_ALGND_HPP_ 66 void buildPartTree(
int level,
int leftPart,
int splitPart,
int rightPart, std::vector<int> &partTree);
84 template <
typename Adapter>
91 typedef typename Adapter::part_t part_t;
93 typedef typename Adapter::lno_t lno_t;
94 typedef typename Adapter::gno_t gno_t;
97 const RCP<const Environment> mEnv;
98 const RCP<Comm<int> > mProblemComm;
100 const RCP<const GraphModel<Adapter> > mGraphModel;
101 const RCP<const CoordinateModel<Adapter> > mIds;
103 const RCP<const Adapter> mBaseInputAdapter;
106 void getBoundLayerSep(
int levelIndx,
const std::vector<part_t> &partMap,
107 const part_t * parts,
108 std::vector<int> &boundVerts,
109 std::vector<std::vector<int> > &boundVertsST,
110 const std::set<int> &sepVerts);
114 AlgND(
const RCP<const Environment> &env_,
115 const RCP<Comm<int> > &problemComm_,
118 const RCP<const Adapter> baseInputAdapter_)
119 :mEnv(env_), mProblemComm(problemComm_), mGraphModel(gModel_), mIds(cModel_),
120 mBaseInputAdapter(baseInputAdapter_)
122 #ifndef INCLUDE_ZOLTAN2_EXPERIMENTAL 126 #ifndef INCLUDE_ZOLTAN2_EXPERIMENTAL_WOLF 130 if(mProblemComm->getSize()!=1)
145 template <
typename Adapter>
268 template <
typename Adapter>
270 const part_t * parts,
271 std::vector<int> &boundVerts,
272 std::vector<std::vector<int> > &boundVertsST,
273 const std::set<int> &sepVerts)
275 typedef typename Adapter::lno_t lno_t;
276 typedef typename Adapter::scalar_t
scalar_t;
279 int numVerts = mGraphModel->getLocalNumVertices();
282 ArrayView< const lno_t > eIDs;
283 ArrayView< const lno_t > vOffsets;
284 ArrayView< input_t > wgts;
298 for(
int v1=0;v1<numVerts;v1++)
301 part_t vpart1 = partMap[parts[v1]];
303 bool correctBL = (vpart1 >= 2*levelIndx && vpart1 < 2*(levelIndx+1) );
314 if(sepVerts.find(v1)!=sepVerts.end())
321 for(
int j=vOffsets[v1];j<vOffsets[v1+1];j++)
326 part_t vpart2 = partMap[parts[v2]];
328 correctBL = (vpart2 >= 2*levelIndx && vpart2 < 2*(levelIndx+1) );
339 if(sepVerts.find(v2)!=sepVerts.end())
344 if ( vpart1 != vpart2 )
347 boundVerts.push_back(v1);
352 boundVertsST[0].push_back(v1);
357 boundVertsST[1].push_back(v1);
373 void buildPartTree(
int level,
int leftPart,
int splitPart,
int rightPart, std::vector<int> &partTree)
376 partTree.push_back(level);
377 partTree.push_back(leftPart);
378 partTree.push_back(splitPart);
379 partTree.push_back(rightPart);
382 if(splitPart-leftPart > 1)
384 int newSplit = leftPart+(splitPart-leftPart-1)/2 + 1;
389 if(rightPart-splitPart>1)
391 int newSplit = splitPart+(rightPart-splitPart-1)/2 + 1;
392 buildPartTree(level+1,splitPart,newSplit,rightPart,partTree);
#define Z2_THROW_SERIAL(mystr)
Throw an error when code is run on more than one processor.
#define Z2_THROW_EXPERIMENTAL_WOLF(mystr)
Throw an error when wolf experimental code is requested but not compiled.
AlgND(const RCP< const Environment > &env_, const RCP< Comm< int > > &problemComm_, const RCP< const GraphModel< Adapter > > &gModel_, const RCP< const CoordinateModel< Adapter > > &cModel_, const RCP< const Adapter > baseInputAdapter_)
interface to the Zoltan package
Defines the PartitioningSolution class.
sub-steps, each method's entry and exit
This class provides geometric coordinates with optional weights to the Zoltan2 algorithm.
Defines the IdentifierModel interface.
void buildPartTree(int level, int leftPart, int splitPart, int rightPart, std::vector< int > &partTree)
Adapter::scalar_t scalar_t
The StridedData class manages lists of weights or coordinates.
Algorithm defines the base class for all algorithms.
#define Z2_THROW_EXPERIMENTAL(mystr)
Throw an error when experimental code is requested but not compiled.
GraphModel defines the interface required for graph models.
The class containing ordering solutions.
int order(const RCP< OrderingSolution< lno_t, gno_t > > &solution_)
Ordering method.