Skip to content

Commit

Permalink
[Porthos] Print comm, speed in MiB instead of MB.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhatuzdanamemsr committed Apr 26, 2021
1 parent da94a98 commit 9d3c6ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Porthos/src/connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ void end_communication()
{
cout << "------------------------------------" << endl;
cout << "Communication for execution, P" << partyNum << ": "
<< (float)commObject.getSent()/1000000 << "MB (sent) "
<< (float)commObject.getRecv()/1000000 << "MB (recv)" << endl;
<< (float)commObject.getSent()/(1024 * 1024) << "MiB (sent) "
<< (float)commObject.getRecv()/(1024 * 1024) << "MiB (recv)" << endl;
cout << "#Calls, P" << partyNum << ": "
<< commObject.getRoundsSent() << "(sends) "
<< commObject.getRoundsRecv() << "(recvs)" << endl;
Expand Down
8 changes: 4 additions & 4 deletions Porthos/src/connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void sendVector(const vector<T> &vec,
cout << "porthosSecretType";
else
cout << "smallType";
cout<<" in time "<<tt<<" seconds at speed = "<<(bytesSent/(1.0*tt*1000000))<<" MBps."<<endl;
cout<<" in time "<<tt<<" seconds at speed = "<<(bytesSent/(1.0*tt* (1024 *1024) ))<<" MiBps."<<endl;
#endif
}

Expand Down Expand Up @@ -182,7 +182,7 @@ void sendArr(T* arr,
cout << "porthosSecretType";
else
cout << "smallType";
cout<<" in time "<<tt<<" seconds at speed = "<<(bytesSent/(1.0*tt*1000000))<<" MBps."<<endl;
cout<<" in time "<<tt<<" seconds at speed = "<<(bytesSent/(1.0*tt*(1024 *1024)))<<" MiBps."<<endl;
#endif
}

Expand Down Expand Up @@ -216,7 +216,7 @@ void receiveVector(vector<T> &vec,
cout << "porthosSecretType";
else
cout << "smallType";
cout<<" in time "<<tt<<" seconds at speed = "<<(bytesReceived/(1.0*tt*1000000))<<" MBps."<<endl;
cout<<" in time "<<tt<<" seconds at speed = "<<(bytesReceived/(1.0*tt*(1024 *1024)))<<" MiBps."<<endl;
#endif

}
Expand Down Expand Up @@ -251,7 +251,7 @@ void receiveArr(T* arr,
cout << "porthosSecretType";
else
cout << "smallType";
cout<<" in time "<<tt<<" seconds at speed = "<<(bytesReceived/(1.0*tt*1000000))<<" MBps."<<endl;
cout<<" in time "<<tt<<" seconds at speed = "<<(bytesReceived/(1.0*tt*(1024 *1024)))<<" MiBps."<<endl;
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion Porthos/src/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void aggregateCommunication()
if (partyNum == PARTY_A)
{
cout << "------------------------------------" << endl;
cout << "Total communication: " << (double)vec[0]/1000000 << "MB (sent) and " << (double)vec[1]/1000000 << "MB (recv)\n";
cout << "Total communication: " << (double)vec[0]/(1024 * 1024) << "MiB (sent) and " << (double)vec[1]/(1024 * 1024) << "MiB (recv)\n";
cout << "Total #calls: " << vec[2] << " (sends) and " << vec[3] << " (recvs)" << endl;
cout << "------------------------------------" << endl;
}
Expand Down

0 comments on commit 9d3c6ef

Please sign in to comment.