4040
4141namespace cll = llvm::cl;
4242
43- static const char * name = " HYPAR " ;
43+ static const char * name = " BIPART " ;
4444static const char * desc =
4545 " Partitions a hypergraph into K parts and minimizing the graph cut" ;
46- static const char * url = " HyPar " ;
46+ static const char * url = " BiPart " ;
4747
4848static cll::opt<std::string>
4949 inputFile (cll::Positional, cll::desc(" <input file>" ), cll::Required);
@@ -98,29 +98,6 @@ static cll::opt<bool>
9898 output (" output" , cll::desc(" Specify if partitions need to be written" ),
9999 cll::init(false ));
100100
101- // const double COARSEN_FRACTION = 0.9;
102-
103- /* int cutsize(GGraph& g) {
104- unsigned size = std::distance(g.cellList().begin(), g.cellList().end());
105- unsigned sizen = std::distance(g.getNets().begin(), g.getNets().end());
106- int cutsize = 0;
107- std::vector<int> cells;
108- for (auto n : g.getNets()) {
109- bool cut_status = false;
110- for (auto e : g.edges(n)) {
111- auto cell1 = g.getEdgeDst(e);
112- for (auto c : g.edges(n)) {
113- auto cell2 = g.getEdgeDst(c);
114- if(g.getData(cell1).getPart() != g.getData(cell2).getPart() && cell1 !=
115- cell2) { cutsize++; cut_status = true; break;
116- }
117- }
118- if (cut_status == true)
119- break;
120- }
121- }
122- return cutsize;
123- }*/
124101/* *
125102 * Partitioning
126103 */
@@ -391,7 +368,7 @@ int main(int argc, char** argv) {
391368 galois::iterate (uint32_t {0 }, totalnodes),
392369 [&](uint32_t c) {
393370 pre_edges[c] = edges_ids[c].size ();
394- num_edges_acc += prefix_edges [c];
371+ num_edges_acc += pre_edges [c];
395372 },
396373 galois::steal ());
397374 edges = num_edges_acc.reduce ();
@@ -410,7 +387,7 @@ int main(int argc, char** argv) {
410387 gr.getData (n).netval = INT_MAX ;
411388 gr.getData (n).nodeid = n + 1 ;
412389 });
413- Partition (&metisG, 25 , kValue [i]);
390+ Partition (&metisG, csize , kValue [i]);
414391 MetisGraph* mcg = &metisG;
415392
416393 while (mcg->getCoarserGraph () != NULL ) {
@@ -445,8 +422,8 @@ int main(int argc, char** argv) {
445422 toProcessNew.clear ();
446423 }
447424 // std::cout<<"Total Edge Cut: "<<computingCut(graph)<<"\n";
448- galois::runtime::reportStat_Single (" HyPar " , " Edge Cut" , computingCut (graph));
449- galois::runtime::reportStat_Single (" HyParzo " , " zero-one" ,
425+ galois::runtime::reportStat_Single (" BiPart " , " Edge Cut" , computingCut (graph));
426+ galois::runtime::reportStat_Single (" BiPart " , " zero-one" ,
450427 computingBalance (graph));
451428 // galois::reportPageAlloc("MeminfoPost");
452429
0 commit comments