]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/activity/IoImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "Only recompile the jar file when something changed"
[simgrid.git] / src / kernel / activity / IoImpl.cpp
index c9f8e3553a2b687ae7580c5dfb15142a0c6ad074..2d27c1af109252f9f9be448f2044f3f7829cac57 100644 (file)
@@ -26,6 +26,11 @@ namespace activity {
 IoImpl::IoImpl()
 {
   piface_ = new s4u::Io(this);
+  actor::ActorImpl* self = actor::ActorImpl::self();
+  if (self) {
+    set_actor(self);
+    self->activities_.emplace_back(this);
+  }
 }
 
 IoImpl& IoImpl::set_sharing_penalty(double sharing_penalty)
@@ -74,6 +79,7 @@ IoImpl* IoImpl::start()
       disk_->get_host()->get_netpoint()->get_englobing_zone()->get_disk_model()->io_start(disk_, size_, type_);
   surf_action_->set_sharing_penalty(sharing_penalty_);
   surf_action_->set_activity(this);
+  start_time_ = surf_action_->get_start_time();
 
   XBT_DEBUG("Create IO synchro %p %s", this, get_cname());
 
@@ -113,7 +119,7 @@ void IoImpl::set_exception(actor::ActorImpl* issuer)
   switch (state_) {
     case State::FAILED:
       issuer->context_->set_wannadie();
-      piface_->complete(s4u::Activity::State::FAILED);
+      static_cast<s4u::Io*>(get_iface())->complete(s4u::Activity::State::FAILED);
       issuer->exception_ = std::make_exception_ptr(StorageFailureException(XBT_THROW_POINT, "Storage failed"));
       break;
     case State::CANCELED: