]> AND Public Git Repository - simgrid.git/blobdiff - examples/s4u/app-pingpong/s4u-app-pingpong.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case s4u::Mailbox
[simgrid.git] / examples / s4u / app-pingpong / s4u-app-pingpong.cpp
index e09f35ea5e7263a7ad542613a0d3f47690cea205..3d7d79e99b9f029bb01d916efb053171ca01fb8b 100644 (file)
@@ -16,14 +16,14 @@ static void pinger(std::vector<std::string> args)
 
   /* - Do the ping with a 1-Byte task (latency bound) ... */
   double* payload = new double();
-  *payload        = simgrid::s4u::Engine::getClock();
+  *payload        = simgrid::s4u::Engine::get_clock();
 
-  simgrid::s4u::Mailbox::byName(args[0])->put(payload, 1);
+  simgrid::s4u::Mailbox::by_name(args[0])->put(payload, 1);
   /* - ... then wait for the (large) pong */
   double* sender_time =
-      static_cast<double*>(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::get_host()->get_name())->get());
+      static_cast<double*>(simgrid::s4u::Mailbox::by_name(simgrid::s4u::this_actor::get_host()->get_name())->get());
 
-  double communication_time = simgrid::s4u::Engine::getClock() - *sender_time;
+  double communication_time = simgrid::s4u::Engine::get_clock() - *sender_time;
   XBT_INFO("Task received : large communication (bandwidth bound)");
   XBT_INFO("Pong time (bandwidth bound): %.3f", communication_time);
   delete sender_time;
@@ -38,25 +38,25 @@ static void ponger(std::vector<std::string> args)
 
   /* - Receive the (small) ping first ....*/
   double* sender_time =
-      static_cast<double*>(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::get_host()->get_name())->get());
-  double communication_time = simgrid::s4u::Engine::getClock() - *sender_time;
+      static_cast<double*>(simgrid::s4u::Mailbox::by_name(simgrid::s4u::this_actor::get_host()->get_name())->get());
+  double communication_time = simgrid::s4u::Engine::get_clock() - *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();
-  *payload        = simgrid::s4u::Engine::getClock();
+  *payload        = simgrid::s4u::Engine::get_clock();
   XBT_INFO("task_bw->data = %.3f", *payload);
 
-  simgrid::s4u::Mailbox::byName(args[0])->put(payload, 1e9);
+  simgrid::s4u::Mailbox::by_name(args[0])->put(payload, 1e9);
 }
 
 int main(int argc, char* argv[])
 {
   simgrid::s4u::Engine e(&argc, argv);
 
-  e.loadPlatform(argv[1]);
+  e.load_platform(argv[1]);
   std::vector<std::string> args;
   args.push_back("Jupiter");
   simgrid::s4u::Actor::create("pinger", simgrid::s4u::Host::by_name("Tremblay"), pinger, args);
@@ -68,7 +68,7 @@ int main(int argc, char* argv[])
 
   e.run();
 
-  XBT_INFO("Total simulation time: %.3f", e.getClock());
+  XBT_INFO("Total simulation time: %.3f", e.get_clock());
 
   return 0;
 }