Skip to content

Commit 5d1370f

Browse files
author
Sepideh Maleki
committed
output
1 parent 38cd91c commit 5d1370f

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lonestar/analytics/cpu/bipart/bipart.cpp

+9-11
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ void Partition(MetisGraph* metisGraph, unsigned coarsenTo, unsigned K) {
124124
Ctime += (T.get()/1000.0f);
125125
Ptime += (T2.get()/1000.0f);
126126
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";
130127

131128
execTime.stop();
132129
}
@@ -500,22 +497,23 @@ int main(int argc, char** argv) {
500497
computingBalance(graph));
501498

502499
totalTime.stop();
503-
504500
if (output) {
505501

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);
508503

509504
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);
512507
}
513508

514509
std::ofstream outputFile(outfile.c_str());
515510

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+
}
519517
outputFile.close();
520518
}
521519
return 0;

0 commit comments

Comments
 (0)