A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[sonar] Replace redundant type with "auto" (examples/).
[simgrid.git]
/
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 072903b77fa6b01cad5d281ab067f03feb2853a3..72ff9cdd1ba007d79e4aeb778156f2630b8cba12 100644
(file)
--- 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<std::string> 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<simgrid::s4u::Mailbox*> 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<std::string> args)
double compute_cost;
do {
- const
double
* msg = static_cast<double*>(mailbox->get());
+ const
auto
* msg = static_cast<double*>(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.");