Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Keep tutorial examples simple; don't use Mailbox::get_unique.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 18 Dec 2020 07:55:33 +0000 (08:55 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 18 Dec 2020 07:55:33 +0000 (08:55 +0100)
docs/source/tuto_s4u/master-workers-lab1.cpp
docs/source/tuto_s4u/master-workers-lab2.cpp
docs/source/tuto_s4u/master-workers-lab3.cpp
docs/source/tuto_s4u/master-workers-lab4.cpp

index 2bf93a2..12fcdda 100644 (file)
@@ -58,8 +58,9 @@ static void worker(std::vector<std::string> args)
 
   double compute_cost;
   do {
-    auto msg     = mailbox->get_unique<double>();
+    double* msg  = mailbox->get<double>();
     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);
index a87631b..df78adf 100644 (file)
@@ -23,8 +23,9 @@ static void worker()
 
   double compute_cost;
   do {
-    auto msg     = mailbox->get_unique<double>();
+    double* msg  = mailbox->get<double>();
     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);
index 5e012ff..a2f3963 100644 (file)
@@ -22,8 +22,9 @@ static void worker()
   simgrid::s4u::Mailbox* mailbox   = simgrid::s4u::Mailbox::by_name(mailbox_name);
 
   while (true) { // Master forcefully kills the workers by the end of the simulation
-    auto msg            = mailbox->get_unique<double>();
+    double* msg         = mailbox->get<double>();
     double compute_cost = *msg;
+    delete msg;
 
     simgrid::s4u::this_actor::execute(compute_cost);
   }
index c2c8f4d..7752e31 100644 (file)
@@ -22,8 +22,9 @@ static void worker(std::string category)
   simgrid::s4u::Mailbox* mailbox   = simgrid::s4u::Mailbox::by_name(mailbox_name);
 
   while (true) { // Master forcefully kills the workers by the end of the simulation
-    auto msg            = mailbox->get_unique<double>();
+    double* msg         = mailbox->get<double>();
     double compute_cost = *msg;
+    delete msg;
 
     // simgrid::s4u::this_actor::exec_init(compute_cost)->set_tracing_category(category)->wait();
     /* Long form:*/