00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef DomainPartitioner_h
00035 #define DomainPartitioner_h
00036
00037 #ifndef _bool_h
00038 #include <bool.h>
00039 #endif
00040
00041 #include <ID.h>
00042
00043 class GraphPartitioner;
00044 class LoadBalancer;
00045 class PartitionedDomain;
00046 class Vector;
00047 class Graph;
00048 class TaggedObjectStorage;
00049
00050 class DomainPartitioner
00051 {
00052 public:
00053
00054 DomainPartitioner(GraphPartitioner &theGraphPartitioner,
00055 LoadBalancer &theLoadBalancer);
00056
00057 DomainPartitioner(GraphPartitioner &theGraphPartitioner);
00058 virtual ~DomainPartitioner();
00059
00060 virtual void setPartitionedDomain(PartitionedDomain &theDomain);
00061 virtual int partition(int numParts, bool useMainDomain = false, int mainPartition = 0);
00062
00063 virtual int balance(Graph &theWeightedSubdomainGraph);
00064
00065
00066 virtual int getNumPartitions(void) const;
00067 virtual Graph &getPartitionGraph(void);
00068 virtual Graph &getColoredGraph(void);
00069
00070 virtual int swapVertex(int from,
00071 int to,
00072 int vertexTag,
00073 bool adjacentVertexNotInOther = true);
00074
00075 virtual int swapBoundary(int from,
00076 int to,
00077 bool adjacentVertexNotInOther = true);
00078
00079 virtual int releaseVertex(int from,
00080 int vertexTag,
00081 Graph &theWeightedPartitionGraph,
00082 bool mustReleaseToLighter = true,
00083 double factorGreater = 1.0,
00084 bool adjacentVertexNotInOther = true);
00085
00086 virtual int releaseBoundary(int from,
00087 Graph &theWeightedPartitionGraph,
00088 bool mustReleaseToLighter = true,
00089 double factorGreater = 1.0,
00090 bool adjacentVertexNotInOther = true);
00091
00092 protected:
00093
00094 private:
00095 PartitionedDomain *myDomain;
00096 GraphPartitioner &thePartitioner;
00097 LoadBalancer *theBalancer;
00098
00099 Graph *theElementGraph;
00100 Graph **theBoundaryElements;
00101
00102 TaggedObjectStorage *theNodeLocations;
00103 ID *elementPlace;
00104 int numPartitions;
00105 ID primes;
00106 bool partitionFlag;
00107
00108 bool usingMainDomain;
00109 int mainPartition;
00110 };
00111
00112 #endif
00113
00114