Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Specialize parameter for simcall execution_wait.
[simgrid.git] / src / kernel / activity / ExecImpl.cpp
index ba2413b..d6796c2 100644 (file)
@@ -15,9 +15,9 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
 
-void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro)
+void simcall_HANDLER_execution_wait(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* synchro)
 {
-  XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro.get(), (int)synchro->state_);
+  XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state_);
 
   /* Associate this simcall to the synchro */
   synchro->simcalls_.push_back(simcall);
@@ -26,21 +26,21 @@ void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchr
   /* set surf's synchro */
   if (MC_is_active() || MC_record_replay_is_active()) {
     synchro->state_ = SIMIX_DONE;
-    boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro)->finish();
+    synchro->finish();
     return;
   }
 
   /* If the synchro is already finished then perform the error handling */
   if (synchro->state_ != SIMIX_RUNNING)
-    boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro)->finish();
+    synchro->finish();
 }
 
-void simcall_HANDLER_execution_test(smx_simcall_t simcall, smx_activity_t synchro)
+void simcall_HANDLER_execution_test(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* synchro)
 {
   int res = (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING);
   if (res) {
     synchro->simcalls_.push_back(simcall);
-    boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro)->finish();
+    synchro->finish();
   } else {
     SIMIX_simcall_answer(simcall);
   }
@@ -162,29 +162,29 @@ void ExecImpl::finish()
 
       case SIMIX_DONE:
         /* do nothing, synchro done */
-        XBT_DEBUG("SIMIX_execution_finished: execution successful");
+        XBT_DEBUG("ExecImpl::finish(): execution successful");
         break;
 
       case SIMIX_FAILED:
-        XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->get_host()->get_cname());
+        XBT_DEBUG("ExecImpl::finish(): host '%s' failed", simcall->issuer->get_host()->get_cname());
         simcall->issuer->context_->iwannadie = true;
         simcall->issuer->exception_ =
             std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
         break;
 
       case SIMIX_CANCELED:
-        XBT_DEBUG("SIMIX_execution_finished: execution canceled");
+        XBT_DEBUG("ExecImpl::finish(): execution canceled");
         simcall->issuer->exception_ =
             std::make_exception_ptr(simgrid::CancelException(XBT_THROW_POINT, "Execution Canceled"));
         break;
 
       case SIMIX_TIMEOUT:
-        XBT_DEBUG("SIMIX_execution_finished: execution timeouted");
+        XBT_DEBUG("ExecImpl::finish(): execution timeouted");
         simcall->issuer->exception_ = std::make_exception_ptr(simgrid::TimeoutError(XBT_THROW_POINT, "Timeouted"));
         break;
 
       default:
-        xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d", static_cast<int>(state_));
+        xbt_die("Internal error in ExecImpl::finish(): unexpected synchro state %d", static_cast<int>(state_));
     }
 
     simcall->issuer->waiting_synchro = nullptr;