#include "mc/mc.h"
#include "smx_private.hpp"
+#include "src/kernel/activity/IoImpl.hpp"
#include "src/kernel/activity/SleepImpl.hpp"
-#include "src/kernel/activity/SynchroIo.hpp"
#include "src/kernel/activity/SynchroRaw.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/mc/remote/Client.hpp"
smx_activity_t ActorImpl::sleep(double duration)
{
- if (host->isOff())
+ if (host->is_off())
THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host->get_cname());
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
XBT_DEBUG("Start process %s on host '%s'", name, host->get_cname());
- if (host->isOff()) {
+ if (host->is_off()) {
XBT_WARN("Cannot launch process '%s' on failed host '%s'", name, host->get_cname());
return nullptr;
}
/* Add properties */
if (properties != nullptr)
for (auto const& kv : *properties)
- process->setProperty(kv.first, kv.second);
+ process->set_property(kv.first, kv.second);
/* Make sure that the process is initialized for simix, in case we are called from the Host::onCreation signal */
if (host->extension<simgrid::simix::Host>() == nullptr)
sg_host_t host = sg_host_by_name(hostname);
XBT_DEBUG("Attach process %s on host '%s'", name, hostname);
- if (host->isOff()) {
+ if (host->is_off()) {
XBT_WARN("Cannot launch process '%s' on failed host '%s'", name, hostname);
return nullptr;
}
/* Add properties */
if (properties != nullptr)
for (auto const& kv : *properties)
- process->setProperty(kv.first, kv.second);
+ process->set_property(kv.first, kv.second);
/* Add the process to it's host process list */
host->extension<simgrid::simix::Host>()->process_list.push_back(*process);
[](void*, void* arg) {
auto sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(arg);
if (sleep->surf_sleep)
- sleep->surf_sleep->finish(simgrid::kernel::resource::Action::State::done);
+ sleep->surf_sleep->finish(simgrid::kernel::resource::Action::State::FINISHED);
intrusive_ptr_release(sleep);
return 0;
},
/* execute the on_exit functions */
SIMIX_process_on_exit_runall(self);
/* Add the process to the list of process to restart, only if the host is down */
- if (self->auto_restart && self->host->isOff()) {
+ if (self->auto_restart && self->host->is_off()) {
SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->getUserData(),
- SIMIX_timer_get_date(self->kill_timer), self->getProperties(),
+ SIMIX_timer_get_date(self->kill_timer), self->get_properties(),
self->auto_restart);
}
XBT_DEBUG("Process %s@%s is dead", self->get_cname(), self->host->get_cname());
if (name == nullptr)
name = "";
smx_actor_t self = SIMIX_process_self();
- return simgrid::simix::kernelImmediate([name, code, data, host, properties, self] {
+ return simgrid::simix::simcall([name, code, data, host, properties, self] {
return SIMIX_process_create(name, std::move(code), data, host, properties, self);
});
}