Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics and comments
[simgrid.git] / src / mc / mc_base.cpp
index e567c57..f84aad4 100644 (file)
@@ -33,17 +33,16 @@ namespace 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;
-  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) {
-      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);
     }
@@ -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)
 {
+  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