X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b02538071ffda15d09efbe85f1459e2c4688f68d..cc4ca208c5e056ac569cd07e08f09a416f3606fe:/examples/s4u/app-masterworker/s4u-app-masterworker.cpp diff --git a/examples/s4u/app-masterworker/s4u-app-masterworker.cpp b/examples/s4u/app-masterworker/s4u-app-masterworker.cpp index c0ce006b50..199299ae05 100644 --- a/examples/s4u/app-masterworker/s4u-app-masterworker.cpp +++ b/examples/s4u/app-masterworker/s4u-app-masterworker.cpp @@ -3,7 +3,6 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "xbt/str.h" #include "xbt/sysdep.h" #include #include @@ -38,7 +37,7 @@ public: if (number_of_tasks < 10000 || i % 10000 == 0) XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", (std::string("Task_") + std::to_string(i)).c_str(), - number_of_tasks, mailbox->getName()); + number_of_tasks, mailbox->getCname()); /* - Send the computation amount to the @ref worker */ mailbox->put(new double(comp_size), comm_size); @@ -85,20 +84,19 @@ public: int main(int argc, char* argv[]) { - simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv); + simgrid::s4u::Engine e(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); - e->loadPlatform(argv[1]); /** - Load the platform description */ - e->registerFunction("master"); - e->registerFunction("worker"); /** - Register the function to be executed by the processes */ - e->loadDeployment(argv[2]); /** - Deploy the application */ + e.loadPlatform(argv[1]); /** - Load the platform description */ + e.registerFunction("master"); + e.registerFunction("worker"); /** - Register the function to be executed by the processes */ + e.loadDeployment(argv[2]); /** - Deploy the application */ - e->run(); /** - Run the simulation */ + e.run(); /** - Run the simulation */ - XBT_INFO("Simulation time %g", e->getClock()); + XBT_INFO("Simulation time %g", e.getClock()); - delete e; return 0; }