X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/149c63f36e15b8500b1e826bda5138318ff7ba2b..2c0aa88e3d941e79fc79d39e3e58224d282b76d3:/examples/s4u/app-masterworkers/s4u-app-masterworkers-fun.cpp diff --git a/examples/s4u/app-masterworkers/s4u-app-masterworkers-fun.cpp b/examples/s4u/app-masterworkers/s4u-app-masterworkers-fun.cpp index 072903b77f..72ff9cdd1b 100644 --- a/examples/s4u/app-masterworkers/s4u-app-masterworkers-fun.cpp +++ b/examples/s4u/app-masterworkers/s4u-app-masterworkers-fun.cpp @@ -16,9 +16,9 @@ static void master(std::vector args) { xbt_assert(args.size() > 4, "The master function expects at least 3 arguments"); - long tasks_count = std::stol(args[1]); - double compute_cost = std::stod(args[2]); - double communication_cost = std::stod(args[3]); + long tasks_count = std::stol(args[1]); + double compute_cost = std::stod(args[2]); + long communication_cost = std::stol(args[3]); std::vector workers; for (unsigned int i = 4; i < args.size(); i++) workers.push_back(simgrid::s4u::Mailbox::by_name(args[i])); @@ -54,13 +54,12 @@ static void worker(std::vector args) double compute_cost; do { - const double* msg = static_cast(mailbox->get()); + const auto* msg = static_cast(mailbox->get()); compute_cost = *msg; delete msg; if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */ simgrid::s4u::this_actor::execute(compute_cost); - } while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */ XBT_INFO("Exiting now.");