@@ -124,9 +124,6 @@ void Partition(MetisGraph* metisGraph, unsigned coarsenTo, unsigned K) {
124
124
Ctime += (T.get ()/1000 .0f );
125
125
Ptime += (T2.get ()/1000 .0f );
126
126
Rtime += (T3.get ()/1000 .0f );
127
- // std::cout << "coarsen:," << T.get() << "\n";
128
- // std::cout << "clustering:," << T2.get() << '\n';
129
- // std::cout << "Refinement:," << T3.get() << "\n";
130
127
131
128
execTime.stop ();
132
129
}
@@ -500,22 +497,23 @@ int main(int argc, char** argv) {
500
497
computingBalance (graph));
501
498
502
499
totalTime.stop ();
503
-
504
500
if (output) {
505
501
506
- std::vector<uint32_t > parts (graph.size () - graph.hedges );
507
- std::vector<uint64_t > IDs (graph.size () - graph.hedges );
502
+ std::vector<std::vector<uint64_t > >parts (numPartitions);
508
503
509
504
for (GNode n = graph.hedges ; n < graph.size (); n++) {
510
- parts[n - graph. hedges ] = graph.getData (n).getPart ();
511
- IDs[n - graph. hedges ] = n - graph.hedges + 1 ;
505
+ unsigned p = graph.getData (n).getPart ();
506
+ parts[p]. push_back ( n - graph.hedges + 1 ) ;
512
507
}
513
508
514
509
std::ofstream outputFile (outfile.c_str ());
515
510
516
- for (size_t i = 0 ; i < parts.size (); i++)
517
- outputFile << IDs[i] << " " << parts[i] << " \n " ;
518
-
511
+ for (unsigned i = 0 ; i < numPartitions; i++) {
512
+ outputFile << i+1 << " " ;
513
+ for (auto v : parts[i])
514
+ outputFile << v << " " ;
515
+ outputFile << " \n " ;
516
+ }
519
517
outputFile.close ();
520
518
}
521
519
return 0 ;
0 commit comments