Maintenance.

This commit is contained in:
Marcel Keller
2022-01-11 16:04:59 +11:00
parent cdb0c0f898
commit e07d9bf2a3
216 changed files with 2410 additions and 1117 deletions

View File

@@ -110,22 +110,31 @@ void BaseMachine::time()
void BaseMachine::start(int n)
{
cout << "Starting timer " << n << " at " << timer[n].elapsed()
<< " (" << timer[n].mb_sent() << " MB)"
<< " after " << timer[n].idle() << endl;
timer[n].start();
timer[n].start(total_comm());
}
void BaseMachine::stop(int n)
{
timer[n].stop();
cout << "Stopped timer " << n << " at " << timer[n].elapsed() << endl;
timer[n].stop(total_comm());
cout << "Stopped timer " << n << " at " << timer[n].elapsed() << " ("
<< timer[n].mb_sent() << " MB)" << endl;
}
void BaseMachine::print_timers()
{
cerr << "The following timing is ";
if (OnlineOptions::singleton.live_prep)
cerr << "in";
else
cerr << "ex";
cerr << "clusive preprocessing." << endl;
cerr << "Time = " << timer[0].elapsed() << " seconds " << endl;
timer.erase(0);
for (map<int,Timer>::iterator it = timer.begin(); it != timer.end(); it++)
cerr << "Time" << it->first << " = " << it->second.elapsed() << " seconds " << endl;
for (auto it = timer.begin(); it != timer.end(); it++)
cerr << "Time" << it->first << " = " << it->second.elapsed() << " seconds ("
<< it->second.mb_sent() << " MB)" << endl;
}
string BaseMachine::memory_filename(const string& type_short, int my_number)
@@ -170,3 +179,18 @@ bigint BaseMachine::prime_from_schedule(string progname)
else
return 0;
}
NamedCommStats BaseMachine::total_comm()
{
NamedCommStats res;
for (auto& queue : queues)
res += queue->get_comm_stats();
return res;
}
void BaseMachine::set_thread_comm(const NamedCommStats& stats)
{
auto queue = queues.at(BaseMachine::thread_num);
assert(queue);
queue->set_comm_stats(stats);
}