00001
00024 #ifndef GMETISCONFIG_H_
00025 #define GMETISCONFIG_H_
00026
00027
00028
00029 #include "Galois/Graphs/Graph.h"
00030
00031 #include "Galois/Galois.h"
00032 #include "MetisNode.h"
00033 #include "Galois/Timer.h"
00034 #include "Galois/Runtime/mm/mem.h"
00035 #include <stdlib.h>
00036 #include "ArraySet.h"
00037 typedef int METISINT;
00038 typedef double METISDOUBLE;
00039
00040
00041 typedef Galois::Graph::FirstGraph<MetisNode,METISINT, true> GGraph;
00042 typedef Galois::Graph::FirstGraph<MetisNode,METISINT, true>::GraphNode GNode;
00043
00044 #include <set>
00045 using namespace std;
00046 typedef ArraySet< GNode > GNodeSet;
00047 struct GNodeSetCompare
00048 {
00049 bool operator()(const GNode s1, const GNode s2) const
00050 {
00051 return s1.getData(Galois::NONE).getNodeId() < s2.getData(Galois::NONE).getNodeId();
00052 }
00053 };
00054 typedef set< GNode, GNodeSetCompare, GaloisRuntime::MM::FSBGaloisAllocator<GNode> > GNodeSTLSet;
00055
00056
00057 template <typename T>
00058 void arrayFill(T* array, int length, T value){
00059 for(int i=0;i<length;++i){
00060 array[i] = value;
00061 }
00062 }
00063
00064 int gNodeToInt(GNode node);
00065 int getRandom(int num);
00066
00067 struct PerCPUValue{
00068 int mincutInc;
00069 GNodeSTLSet changedBndNodes;
00070 PerCPUValue(){
00071 mincutInc = 0;
00072 }
00073 };
00074
00075 struct mergeP {
00076 void operator()(PerCPUValue& a, PerCPUValue& b);
00077 };
00078
00079 int intlog2(int a);
00080 #endif