+
+simgrid::kernel::activity::ActivityImpl*
+simgrid::kernel::activity::ExecImpl::migrate(simgrid::s4u::Host* to)
+{
+
+ if (not MC_is_active() && not MC_record_replay_is_active()) {
+ simgrid::kernel::resource::Action* oldAction = this->surfAction_;
+ simgrid::kernel::resource::Action* newAction = to->pimpl_cpu->execution_start(oldAction->get_cost());
+ newAction->set_remains(oldAction->get_remains());
+ newAction->set_data(this);
+ newAction->set_priority(oldAction->get_priority());
+
+ // FIXME: the user-defined bound seem to not be kept by LMM, that seem to overwrite it for the multi-core modeling.
+ // I hope that the user did not provide any.
+
+ oldAction->set_data(nullptr);
+ oldAction->cancel();
+ oldAction->unref();
+ this->surfAction_ = newAction;
+ }
+
+ onMigration(this, to);
+ return this;
+}
+
+/*************
+ * Callbacks *
+ *************/
+simgrid::xbt::signal<void(simgrid::kernel::activity::ExecImplPtr)> simgrid::kernel::activity::ExecImpl::onCreation;
+simgrid::xbt::signal<void(simgrid::kernel::activity::ExecImplPtr)> simgrid::kernel::activity::ExecImpl::onCompletion;
+simgrid::xbt::signal<void(simgrid::kernel::activity::ExecImplPtr, simgrid::s4u::Host*)> simgrid::kernel::activity::ExecImpl::onMigration;