Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics and comments
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 17 Jul 2017 22:44:01 +0000 (00:44 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 17 Jul 2017 22:44:14 +0000 (00:44 +0200)
src/mc/mc_base.cpp
src/mc/mc_base.h

index e567c57..f84aad4 100644 (file)
@@ -33,17 +33,16 @@ namespace mc {
 void wait_for_requests()
 {
 #if SIMGRID_HAVE_MC
 void wait_for_requests()
 {
 #if SIMGRID_HAVE_MC
-  xbt_assert(mc_model_checker == nullptr);
+  xbt_assert(mc_model_checker == nullptr, "This must be called from the client");
 #endif
 
   smx_actor_t process;
 #endif
 
   smx_actor_t process;
-  smx_simcall_t req;
   unsigned int iter;
 
   while (not xbt_dynar_is_empty(simix_global->process_to_run)) {
     SIMIX_process_runall();
     xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
   unsigned int iter;
 
   while (not xbt_dynar_is_empty(simix_global->process_to_run)) {
     SIMIX_process_runall();
     xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
-      req = &process->simcall;
+      smx_simcall_t req = &process->simcall;
       if (req->call != SIMCALL_NONE && not simgrid::mc::request_is_visible(req))
         SIMIX_simcall_handle(req, 0);
     }
       if (req->call != SIMCALL_NONE && not simgrid::mc::request_is_visible(req))
         SIMIX_simcall_handle(req, 0);
     }
@@ -193,8 +192,12 @@ bool actor_is_enabled(smx_actor_t actor)
   }
 }
 
   }
 }
 
+/* This is the list of requests that are visible from the checker algorithm.
+ * Any other requests are handled right away on the application side.
+ */
 bool request_is_visible(smx_simcall_t req)
 {
 bool request_is_visible(smx_simcall_t req)
 {
+  xbt_assert(mc_model_checker == nullptr, "This should be called from the client side");
   return req->call == SIMCALL_COMM_ISEND
       || req->call == SIMCALL_COMM_IRECV
       || req->call == SIMCALL_COMM_WAIT
   return req->call == SIMCALL_COMM_ISEND
       || req->call == SIMCALL_COMM_IRECV
       || req->call == SIMCALL_COMM_WAIT
index 54a209b..798dbba 100644 (file)
@@ -39,10 +39,7 @@ XBT_PRIVATE void handle_simcall(smx_simcall_t req, int req_num);
  */
 XBT_PRIVATE bool actor_is_enabled(smx_actor_t process);
 
  */
 XBT_PRIVATE bool actor_is_enabled(smx_actor_t process);
 
-/** Check if the given simcall is visible
- *
- *  \return `TRUE` or `FALSE`
- */
+/** Check if the given simcall is visible */
 XBT_PRIVATE bool request_is_visible(smx_simcall_t req);
 
 }
 XBT_PRIVATE bool request_is_visible(smx_simcall_t req);
 
 }