Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
an enum class of size of 2 is a well named bool
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 10 Dec 2019 09:23:31 +0000 (10:23 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 10 Dec 2019 09:23:31 +0000 (10:23 +0100)
src/simix/smx_deployment.cpp
src/surf/sg_platf.cpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_sax_cb.cpp

index 1955bf7..1038309 100644 (file)
@@ -80,11 +80,11 @@ void SIMIX_process_set_function(const char* process_host, const char* process_fu
   simgrid::simix::ActorCodeFactory& parse_code = SIMIX_get_actor_code_factory(process_function);
   xbt_assert(parse_code, "Function '%s' unknown", process_function);
 
   simgrid::simix::ActorCodeFactory& parse_code = SIMIX_get_actor_code_factory(process_function);
   xbt_assert(parse_code, "Function '%s' unknown", process_function);
 
-  actor.function   = process_function;
-  actor.host       = process_host;
-  actor.kill_time  = process_kill_time;
-  actor.start_time = process_start_time;
-  actor.on_failure = simgrid::kernel::routing::ActorOnFailure::DIE;
+  actor.function           = process_function;
+  actor.host               = process_host;
+  actor.kill_time          = process_kill_time;
+  actor.start_time         = process_start_time;
+  actor.restart_on_failure = false;
   sg_platf_new_actor(&actor);
 }
 
   sg_platf_new_actor(&actor);
 }
 
index e57d0d0..6300328 100644 (file)
@@ -451,7 +451,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
 
   double start_time = actor->start_time;
   double kill_time  = actor->kill_time;
 
   double start_time = actor->start_time;
   double kill_time  = actor->kill_time;
-  bool auto_restart = actor->on_failure != simgrid::kernel::routing::ActorOnFailure::DIE;
+  bool auto_restart = actor->restart_on_failure;
 
   std::string actor_name     = actor->args[0];
   simgrid::simix::ActorCode code = factory(std::move(actor->args));
 
   std::string actor_name     = actor->args[0];
   simgrid::simix::ActorCode code = factory(std::move(actor->args));
index af6afba..6133bea 100644 (file)
@@ -171,8 +171,6 @@ public:
   std::string element;
 };
 
   std::string element;
 };
 
-enum class ActorOnFailure { DIE, RESTART }; // FIXME: move to a better namespace
-
 class ActorCreationArgs {
 public:
   std::vector<std::string> args;
 class ActorCreationArgs {
 public:
   std::vector<std::string> args;
@@ -181,7 +179,7 @@ public:
   const char* function                   = nullptr;
   double start_time                      = 0.0;
   double kill_time                       = 0.0;
   const char* function                   = nullptr;
   double start_time                      = 0.0;
   double kill_time                       = 0.0;
-  ActorOnFailure on_failure;
+  bool restart_on_failure                                  = false;
 };
 
 class ZoneCreationArgs {
 };
 
 class ZoneCreationArgs {
index 5433be3..2cd4006 100644 (file)
@@ -951,10 +951,10 @@ void ETag_surfxml_actor()
   switch (A_surfxml_actor_on___failure) {
   case AU_surfxml_actor_on___failure:
   case A_surfxml_actor_on___failure_DIE:
   switch (A_surfxml_actor_on___failure) {
   case AU_surfxml_actor_on___failure:
   case A_surfxml_actor_on___failure_DIE:
-    actor.on_failure = simgrid::kernel::routing::ActorOnFailure::DIE;
+    actor.restart_on_failure = false;
     break;
   case A_surfxml_actor_on___failure_RESTART:
     break;
   case A_surfxml_actor_on___failure_RESTART:
-    actor.on_failure = simgrid::kernel::routing::ActorOnFailure::RESTART;
+    actor.restart_on_failure = true;
     break;
   default:
     surf_parse_error("Invalid on failure behavior");
     break;
   default:
     surf_parse_error("Invalid on failure behavior");