77
88#include " eval/evaluator_inc.hpp"
99#include " lang/analyzer.hpp"
10- #include " lang/comments.hpp"
1110#include " lang/parser.hpp"
1211#include " lang/program_util.hpp"
1312#include " seq/managed_seq.hpp"
@@ -21,7 +20,7 @@ const std::string Stats::PROGRAMS_HEADER("id,length,usages,inc_eval,log_eval");
2120const std::string Stats::STEPS_HEADER (" total,min,max,runs" );
2221const std::string Stats::SUMMARY_HEADER (
2322 " num_sequences,num_programs,num_formulas" );
24- const std::string SUBMITTERS_HEADER = " submitter,count" ;
23+ const std::string SUBMITTERS_HEADER = " submitter,id, count" ;
2524
2625void checkHeader (std::istream &in, const std::string &header,
2726 const std::string &file) {
@@ -228,8 +227,9 @@ void Stats::load(std::string path) {
228227 while (std::getline (submitters, line)) {
229228 std::stringstream s (line);
230229 std::getline (s, k, ' ,' );
231- std::getline (s, v);
232- num_programs_per_submitter[k] = std::stoll (v);
230+ std::getline (s, v, ' ,' );
231+ std::getline (s, w);
232+ num_programs_per_submitter[k] = std::stoll (w);
233233 }
234234 submitters.close ();
235235 }
@@ -341,8 +341,9 @@ void Stats::save(std::string path) {
341341
342342 std::ofstream submitters (path + " submitters.csv" );
343343 submitters << SUBMITTERS_HEADER << " \n " ;
344+ int64_t index = 1 ;
344345 for (const auto &e : num_programs_per_submitter) {
345- submitters << e.first << sep << e.second << " \n " ;
346+ submitters << e.first << sep << (index++) << sep << e.second << " \n " ;
346347 }
347348 submitters.close ();
348349
@@ -355,14 +356,14 @@ std::string Stats::getMainStatsFile(std::string path) const {
355356 return path;
356357}
357358
358- void Stats::updateProgramStats (UID id, const Program &program) {
359+ void Stats::updateProgramStats (UID id, const Program &program,
360+ const std::string &submitter) {
359361 const size_t num_ops = ProgramUtil::numOps (program, false );
360362 program_lengths[id] = num_ops;
361363 if (num_ops >= num_programs_per_length.size ()) {
362364 num_programs_per_length.resize (num_ops + 1 );
363365 }
364366 num_programs_per_length[num_ops]++;
365- auto submitter = Comments::getSubmitter (program);
366367 if (!submitter.empty ()) {
367368 num_programs_per_submitter[submitter]++;
368369 }
0 commit comments