mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-10 05:57:57 -05:00
Maintenance.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user