X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1282bea34802164b8173a518bcd379fd845bb684..ed5b6e45b9957b00a2c41f01ce9da418da78cecb:/examples/cxx/ping_pong/Receiver.cxx diff --git a/examples/cxx/ping_pong/Receiver.cxx b/examples/cxx/ping_pong/Receiver.cxx index 41ad22013c..cf58070e0d 100644 --- a/examples/cxx/ping_pong/Receiver.cxx +++ b/examples/cxx/ping_pong/Receiver.cxx @@ -1,46 +1,46 @@ -#include "Receiver.hpp" -#include "PingPongTask.hpp" -#include -#include -#include - -#include - -MSG_IMPLEMENT_DYNAMIC(Receiver, Process); - -const double commSizeLat = 1; -const double commSizeBw = 100000000; - -int Receiver::main(int argc, char** argv) -{ - info("Hello"); - double communicationTime=0; - double time = getClock(); - StringHelper bw; - - info("Try to get a task"); - - PingPongTask* task = reinterpret_cast(Task::get(0)); - - double timeGot = getClock(); - double timeSent = task->getTime(); - - delete task; - - info(TEXT_("Got at time ") + TEXT_(timeGot)); - info(TEXT_("Was sent at time ") + TEXT_(timeSent)); - - time = timeSent; - - communicationTime = timeGot - time; - - info(TEXT_( "Communication time : ") + TEXT_(communicationTime)); - - info(TEXT_(" --- BW ") + bw.append(commSizeBw/communicationTime,"%07lf") + TEXT_(" ----")); - - info("Goodbye!"); - - delete this; - - return 0; -} \ No newline at end of file +#include "Receiver.hpp" +#include "PingPongTask.hpp" +#include +#include +#include + +#include + +MSG_IMPLEMENT_DYNAMIC(Receiver, Process) + +const double commSizeLat = 1; +const double commSizeBw = 100000000; + +int Receiver::main(int argc, char** argv) +{ + info("Hello"); + double communicationTime=0; + double time = getClock(); + StringHelper bw; + + info("Try to get a task"); + + PingPongTask* task = reinterpret_cast(Task::get(0)); + + double timeGot = getClock(); + double timeSent = task->getTime(); + + delete task; + + info(TEXT_("Got at time ") + TEXT_(timeGot)); + info(TEXT_("Was sent at time ") + TEXT_(timeSent)); + + time = timeSent; + + communicationTime = timeGot - time; + + info(TEXT_( "Communication time : ") + TEXT_(communicationTime)); + + info(TEXT_(" --- BW ") + bw.append(commSizeBw/communicationTime,"%07lf") + TEXT_(" ----")); + + info("Goodbye!"); + + delete this; + + return 0; +}