Skip to content

Commit

Permalink
Test results are written in a .csv file.
Browse files Browse the repository at this point in the history
  • Loading branch information
rapfamily4 committed Jun 8, 2024
1 parent 64ec0e0 commit cf5f059
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,23 +478,23 @@ class Application {
plotOverlays();

// Write log with performance results.
std::ofstream ofile{ "performance_log.txt" };
std::ofstream ofile{ "data.csv" };
if (ofile) {
ofile << "runs_count = " << performanceTestBatches << " \n";
ofile << "seeds_count = " << partitioner.getSeeds().size() << " \n";
ofile << "vertices_count = " << model.getVerticesMatrix().rows() << " \n";
ofile << "tris_count = " << model.getFacesMatrix().rows() << " \n\n";
ofile << "graph_type\t greedy_mode\t opt_macro\t opt_micro\t time_min\t time_avg\t time_max\t part_min\t part_avg\t part_max\t " <<
"greedy_min\t greedy_avg\t greedy_max\t precise_min\t precise_avg\t precise_max\t\n";
ofile << "# runs_count = " << performanceTestBatches << " \n";
ofile << "# seeds_count = " << partitioner.getSeeds().size() << " \n";
ofile << "# vertices_count = " << model.getVerticesMatrix().rows() << " \n";
ofile << "# tris_count = " << model.getFacesMatrix().rows() << " \n";
ofile << "graph_type,greedy_mode,opt_macro,opt_micro,time_min,time_avg,time_max,part_min,part_avg,part_max," <<
"greedy_min,greedy_avg,greedy_max,precise_min,precise_avg,precise_max\n";
for (std::map<int, BatchPerformanceStatistics>::iterator t = testResults.begin(); t != testResults.end(); t++) {
ofile << (t->first / 1000) << ' ' << (t->first / 100 % 10) << ' ' << (t->first / 10 % 10) << ' ' << (t->first % 10) << ' ' <<
t->second.getMinTime() << ' ' << t->second.getAvgTime() << ' ' << t->second.getMaxTime() << ' ' <<
t->second.getMinPhaseCount(0) << ' ' << t->second.getAvgPhaseCount(0) << ' ' << t->second.getMaxPhaseCount(0) << ' ' <<
t->second.getMinPhaseCount(1) << ' ' << t->second.getAvgPhaseCount(1) << ' ' << t->second.getMaxPhaseCount(1) << ' ' <<
t->second.getMinPhaseCount(2) << ' ' << t->second.getAvgPhaseCount(2) << ' ' << t->second.getMaxPhaseCount(2) << "\n";
ofile << (t->first / 1000) << ',' << (t->first / 100 % 10) << ',' << (t->first / 10 % 10) << ',' << (t->first % 10) << ',' <<
t->second.getMinTime() << ',' << t->second.getAvgTime() << ',' << t->second.getMaxTime() << ',' <<
t->second.getMinPhaseCount(0) << ',' << t->second.getAvgPhaseCount(0) << ',' << t->second.getMaxPhaseCount(0) << ',' <<
t->second.getMinPhaseCount(1) << ',' << t->second.getAvgPhaseCount(1) << ',' << t->second.getMaxPhaseCount(1) << ',' <<
t->second.getMinPhaseCount(2) << ',' << t->second.getAvgPhaseCount(2) << ',' << t->second.getMaxPhaseCount(2) << "\n";
}
std::cout << "-----------\n";
std::cout << "Performance log has been written in ./performance_log.txt\n\n";
std::cout << "Results have been written in ./data.csv\n\n";
}

// Restore previous parameters.
Expand Down

0 comments on commit cf5f059

Please sign in to comment.