X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fa4b54a83a3ee1a38c068ed8e4c021dba440a18b..8579400ae5e0389b237a2b52e9ea62bebbe1f4d9:/examples/s4u/app-pingpong/s4u_app-pingpong.cpp diff --git a/examples/s4u/app-pingpong/s4u_app-pingpong.cpp b/examples/s4u/app-pingpong/s4u_app-pingpong.cpp index d8c0384a3a..d47ff48d45 100644 --- a/examples/s4u/app-pingpong/s4u_app-pingpong.cpp +++ b/examples/s4u/app-pingpong/s4u_app-pingpong.cpp @@ -20,12 +20,13 @@ static void pinger(std::vector args) simgrid::s4u::Mailbox::byName(args[0])->put(payload, 1); /* - ... then wait for the (large) pong */ - double sender_time = - *(static_cast(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->getName())->get())); + double* sender_time = + static_cast(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->getName())->get()); - double communication_time = simgrid::s4u::Engine::getClock() - sender_time; + double communication_time = simgrid::s4u::Engine::getClock() - *sender_time; XBT_INFO("Task received : large communication (bandwidth bound)"); XBT_INFO("Pong time (bandwidth bound): %.3f", communication_time); + delete sender_time; } static void ponger(std::vector args) @@ -37,10 +38,11 @@ static void ponger(std::vector args) /* - Receive the (small) ping first ....*/ double* sender_time = - (static_cast(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->getName())->get())); + static_cast(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->getName())->get()); double communication_time = simgrid::s4u::Engine::getClock() - *sender_time; XBT_INFO("Task received : small communication (latency bound)"); XBT_INFO(" Ping time (latency bound) %f", communication_time); + delete sender_time; /* - ... Then send a 1GB pong back (bandwidth bound) */ double* payload = new double();