From 4485d715fa3a090c1dd38def83ab8239feebecb3 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 11 Feb 2019 20:40:35 +0100 Subject: [PATCH] Deprecate the is_off() methods. They are simply the negation of is_on() and, when the two forms are defined, we may wonder if there is some kind of intermediate state neither on(), nor off(). --- include/simgrid/host.h | 2 +- include/simgrid/kernel/resource/Resource.hpp | 2 +- include/simgrid/msg.h | 6 +++--- include/simgrid/s4u/Host.hpp | 4 ++-- include/simgrid/s4u/Link.hpp | 1 - src/kernel/activity/ExecImpl.cpp | 2 +- src/kernel/activity/SleepImpl.cpp | 4 ++-- src/kernel/context/Context.cpp | 2 +- src/kernel/resource/Resource.cpp | 2 +- src/msg/msg_legacy.cpp | 4 ++-- src/plugins/vm/VirtualMachineImpl.cpp | 2 +- src/plugins/vm/VmLiveMigration.cpp | 4 ++-- src/s4u/s4u_Host.cpp | 15 +++++---------- src/s4u/s4u_Link.cpp | 4 ---- src/simix/ActorImpl.cpp | 8 ++++---- src/simix/smx_host.cpp | 6 +++--- src/simix/smx_io.cpp | 6 +++--- src/simix/smx_network.cpp | 8 ++++---- src/smpi/plugins/load_balancer/LoadBalancer.cpp | 5 ++--- src/surf/StorageImpl.cpp | 2 +- src/surf/cpu_cas01.cpp | 10 ++++++---- src/surf/cpu_ti.cpp | 4 ++-- src/surf/network_cm02.cpp | 5 +++-- src/surf/network_interface.cpp | 2 +- src/surf/ptask_L07.cpp | 4 ++-- src/surf/storage_n11.cpp | 6 +++--- 26 files changed, 56 insertions(+), 64 deletions(-) diff --git a/include/simgrid/host.h b/include/simgrid/host.h index f59db85299..0289c0579b 100644 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@ -101,7 +101,7 @@ XBT_PUBLIC void sg_host_set_pstate(sg_host_t host, int pstate); XBT_PUBLIC void sg_host_turn_on(sg_host_t host); XBT_PUBLIC void sg_host_turn_off(sg_host_t host); XBT_PUBLIC int sg_host_is_on(sg_host_t host); -XBT_PUBLIC int sg_host_is_off(sg_host_t host); +XBT_ATTRIB_DEPRECATED_v325("Please use !sg_host_is_on()") XBT_PUBLIC int sg_host_is_off(sg_host_t host); /** @ingroup m_host_management * @brief Returns a xbt_dict_t consisting of the list of properties assigned to this host diff --git a/include/simgrid/kernel/resource/Resource.hpp b/include/simgrid/kernel/resource/Resource.hpp index fa581d1800..ced454389a 100644 --- a/include/simgrid/kernel/resource/Resource.hpp +++ b/include/simgrid/kernel/resource/Resource.hpp @@ -58,7 +58,7 @@ public: /** @brief Check if the current Resource is active */ virtual bool is_on() const; /** @brief Check if the current Resource is shut down */ - virtual bool is_off() const; + XBT_ATTRIB_DEPRECATED_v325("Please use !is_on()") virtual bool is_off() const; /** @brief Turn on the current Resource */ virtual void turn_on(); /** @brief Turn off the current Resource */ diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 97087ae715..1014114523 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -110,18 +110,18 @@ XBT_PUBLIC int MSG_host_get_pstate(sg_host_t host); XBT_PUBLIC void MSG_host_set_pstate(sg_host_t host, int pstate); /** @brief Start the host if it is off * - * See also #MSG_host_is_on() and #MSG_host_is_off() to test the current state of the host and @ref SURF_plugin_energy + * See also #MSG_host_is_on() to test the current state of the host and @ref SURF_plugin_energy * for more info on DVFS. */ XBT_PUBLIC void MSG_host_on(sg_host_t h); /** @brief Stop the host if it is on * - * See also MSG_host_is_on() and MSG_host_is_off() to test the current state of the host and @ref SURF_plugin_energy + * See also MSG_host_is_on() to test the current state of the host and @ref SURF_plugin_energy * for more info on DVFS. */ XBT_PUBLIC void MSG_host_off(sg_host_t h); XBT_PUBLIC int MSG_host_is_on(sg_host_t h); -XBT_PUBLIC int MSG_host_is_off(sg_host_t h); +XBT_ATTRIB_DEPRECATED_v325("Please use !MSG_host_is_on()") XBT_PUBLIC int MSG_host_is_off(sg_host_t h); XBT_PUBLIC xbt_dict_t MSG_host_get_properties(sg_host_t host); XBT_PUBLIC const char* MSG_host_get_property_value(sg_host_t host, const char* name); XBT_PUBLIC void MSG_host_set_property_value(sg_host_t host, const char* name, const char* value); diff --git a/include/simgrid/s4u/Host.hpp b/include/simgrid/s4u/Host.hpp index 45bfeb173d..f39f06fcfa 100644 --- a/include/simgrid/s4u/Host.hpp +++ b/include/simgrid/s4u/Host.hpp @@ -95,7 +95,7 @@ public: /** Returns if that host is currently up and running */ bool is_on() const; /** Returns if that host is currently down and offline */ - bool is_off() const { return not is_on(); } + XBT_ATTRIB_DEPRECATED_v325("Please use !is_on()") bool is_off() const { return not is_on(); } const char* get_property(std::string key) const; void set_property(std::string key, std::string value); @@ -188,7 +188,7 @@ public: /** @deprecated See Host::is_on() */ XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_on()") bool isOn() { return is_on(); } /** @deprecated See Host::is_off() */ - XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_off()") bool isOff() { return is_off(); } + XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_off()") bool isOff() { return not is_on(); } /** @deprecated See Host::get_property() */ XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_property()") const char* getProperty(const char* key) { diff --git a/include/simgrid/s4u/Link.hpp b/include/simgrid/s4u/Link.hpp index c34383a283..29a2412f5e 100644 --- a/include/simgrid/s4u/Link.hpp +++ b/include/simgrid/s4u/Link.hpp @@ -62,7 +62,6 @@ public: void turn_on(); bool is_on() const; void turn_off(); - bool is_off() const; void* get_data(); /** Should be used only from the C interface. Prefer extensions in C++ */ void set_data(void* d); diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index 5da186d396..cac429ac5f 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -91,7 +91,7 @@ void ExecImpl::set_priority(double priority) void ExecImpl::post() { - if (host_ && host_->is_off()) { /* FIXME: handle resource failure for parallel tasks too */ + if (host_ && not host_->is_on()) { /* FIXME: handle resource failure for parallel tasks too */ /* If the host running the synchro failed, notice it. This way, the asking * process can be killed if it runs on that host itself */ state_ = SIMIX_FAILED; diff --git a/src/kernel/activity/SleepImpl.cpp b/src/kernel/activity/SleepImpl.cpp index ea0fe2d2ee..f666d03dcf 100644 --- a/src/kernel/activity/SleepImpl.cpp +++ b/src/kernel/activity/SleepImpl.cpp @@ -42,7 +42,7 @@ void SleepImpl::post() smx_simcall_t simcall = simcalls_.front(); simcalls_.pop_front(); e_smx_state_t result; - if (host_ && host_->is_off()) { + if (host_ && not host_->is_on()) { /* If the host running the synchro failed, notice it. This way, the asking * actor can be killed if it runs on that host itself */ result = SIMIX_SRC_HOST_FAILURE; @@ -64,7 +64,7 @@ void SleepImpl::post() THROW_IMPOSSIBLE; break; } - if (simcall->issuer->host_->is_off()) { + if (not simcall->issuer->host_->is_on()) { simcall->issuer->context_->iwannadie = true; } simcall_process_sleep__set__result(simcall, result); diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index 9d66f8c649..5831381222 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -86,7 +86,7 @@ void Context::stop() { actor_->finished_ = true; - if (actor_->auto_restart_ && actor_->host_->is_off()) { + if (actor_->auto_restart_ && not actor_->host_->is_on()) { XBT_DEBUG("Insert host %s to watched_hosts because it's off and %s needs to restart", actor_->host_->get_cname(), actor_->get_cname()); watched_hosts.insert(actor_->host_->get_cname()); diff --git a/src/kernel/resource/Resource.cpp b/src/kernel/resource/Resource.cpp index e835455196..28d84cf6fe 100644 --- a/src/kernel/resource/Resource.cpp +++ b/src/kernel/resource/Resource.cpp @@ -23,7 +23,7 @@ bool Resource::is_on() const { return is_on_; } -bool Resource::is_off() const +bool Resource::is_off() const // deprecated { return not is_on_; } diff --git a/src/msg/msg_legacy.cpp b/src/msg/msg_legacy.cpp index 7636c9d10e..578f862cf2 100644 --- a/src/msg/msg_legacy.cpp +++ b/src/msg/msg_legacy.cpp @@ -283,9 +283,9 @@ int MSG_host_is_on(sg_host_t h) { return sg_host_is_on(h); } -int MSG_host_is_off(sg_host_t h) +int MSG_host_is_off(sg_host_t h) // deprecated { - return sg_host_is_off(h); + return not sg_host_is_on(h); } xbt_dict_t MSG_host_get_properties(sg_host_t host) { diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index 3ea36336f6..2d0b97d79a 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -42,7 +42,7 @@ const double virt_overhead = 1; // 0.95 static void hostStateChange(s4u::Host& host) { - if (host.is_off()) { // just turned off. + if (not host.is_on()) { // just turned off. std::vector trash; /* Find all VMs living on that host */ for (s4u::VirtualMachine* const& vm : VirtualMachineImpl::allVms_) diff --git a/src/plugins/vm/VmLiveMigration.cpp b/src/plugins/vm/VmLiveMigration.cpp index 8d408120a0..209ec15631 100644 --- a/src/plugins/vm/VmLiveMigration.cpp +++ b/src/plugins/vm/VmLiveMigration.cpp @@ -326,10 +326,10 @@ void sg_vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm) { simgrid::s4u::Host* src_pm = vm->get_pm(); - if (src_pm->is_off()) + if (not src_pm->is_on()) THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->get_cname(), src_pm->get_cname()); - if (dst_pm->is_off()) + if (not dst_pm->is_on()) THROWF(vm_error, 0, "Cannot migrate VM '%s' to host '%s', which is offline.", vm->get_cname(), dst_pm->get_cname()); if (vm->get_state() != simgrid::s4u::VirtualMachine::state::RUNNING) THROWF(vm_error, 0, "Cannot migrate VM '%s' that is not running yet.", vm->get_cname()); diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index 3c5e613344..515f776f7f 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -84,7 +84,7 @@ Host* Host::current() void Host::turn_on() { - if (is_off()) { + if (not is_on()) { simgrid::simix::simcall([this] { this->pimpl_cpu->turn_on(); this->pimpl_->turn_on(); @@ -490,7 +490,7 @@ void sg_host_set_pstate(sg_host_t host, int pstate) * * @brief Start the host if it is off * - * See also #sg_host_is_on() and #sg_host_is_off() to test the current state of the host and @ref plugin_energy + * See also #sg_host_is_on() to test the current state of the host and @ref plugin_energy * for more info on DVFS. */ void sg_host_turn_on(sg_host_t host) @@ -502,7 +502,7 @@ void sg_host_turn_on(sg_host_t host) * * @brief Stop the host if it is on * - * See also #MSG_host_is_on() and #MSG_host_is_off() to test the current state of the host and @ref plugin_energy + * See also #MSG_host_is_on() to test the current state of the host and @ref plugin_energy * for more info on DVFS. */ void sg_host_turn_off(sg_host_t host) @@ -524,15 +524,10 @@ int sg_host_is_on(sg_host_t host) return host->is_on(); } -/** @ingroup m_host_management - * @brief Determine if a host is currently off. - * - * See also #sg_host_turn_on() and #sg_host_turn_off() to switch the host ON and OFF and @ref plugin_energy for more - * info on DVFS. - */ +/** @deprecated */ int sg_host_is_off(sg_host_t host) { - return host->is_off(); + return not host->is_on(); } /** @brief Get the properties of a host */ diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index b3470e59e0..d09897b673 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -82,10 +82,6 @@ bool Link::is_on() const { return this->pimpl_->is_on(); } -bool Link::is_off() const -{ - return this->pimpl_->is_off(); -} void* Link::get_data() { diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index eb14cb6fc8..f81c789bd9 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -115,7 +115,7 @@ void ActorImpl::exit() exception = nullptr; // Forcefully kill the actor if its host is turned off. Not a HostFailureException because you should not survive that - if (host_->is_off()) + if (not host_->is_on()) this->throw_exception(std::make_exception_ptr(simgrid::kernel::context::StopRequest("host failed"))); /* destroy the blocking synchro if any */ @@ -279,7 +279,7 @@ void ActorImpl::resume() smx_activity_t ActorImpl::sleep(double duration) { - if (host_->is_off()) + if (not host_->is_on()) throw_exception(std::make_exception_ptr(simgrid::HostFailureException( XBT_THROW_POINT, std::string("Host ") + std::string(host_->get_cname()) + " failed, you cannot sleep there."))); @@ -349,7 +349,7 @@ ActorImplPtr ActorImpl::create(std::string name, simgrid::simix::ActorCode code, XBT_DEBUG("Start actor %s@'%s'", name.c_str(), host->get_cname()); - if (host->is_off()) { + if (not host->is_on()) { XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name.c_str(), host->get_cname()); return nullptr; } @@ -417,7 +417,7 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn sg_host_t host = sg_host_by_name(hostname); XBT_DEBUG("Attach process %s on host '%s'", name, hostname); - if (host->is_off()) { + if (not host->is_on()) { XBT_WARN("Cannot launch process '%s' on failed host '%s'", name, hostname); return nullptr; } diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 597021e6d7..fa667b6d9d 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -129,9 +129,9 @@ void SIMIX_execution_finish(smx_activity_t synchro) simcall_execution_wait__set__result(simcall, exec->state_); /* Fail the process if the host is down */ - if (simcall->issuer->host_->is_off()) - simcall->issuer->context_->iwannadie = true; - else + if (simcall->issuer->host_->is_on()) SIMIX_simcall_answer(simcall); + else + simcall->issuer->context_->iwannadie = true; } } diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index 24947e8600..bb18ed00fb 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -54,9 +54,9 @@ void SIMIX_io_finish(smx_activity_t synchro) } simcall->issuer->waiting_synchro = nullptr; - if (simcall->issuer->host_->is_off()) - simcall->issuer->context_->iwannadie = true; - else + if (simcall->issuer->host_->is_on()) SIMIX_simcall_answer(simcall); + else + simcall->issuer->context_->iwannadie = true; } } diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index ed7189c6d9..06e856a24d 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -520,7 +520,7 @@ void SIMIX_comm_finish(smx_activity_t synchro) /* Check out for errors */ - if (simcall->issuer->host_->is_off()) { + if (not simcall->issuer->host_->is_on()) { simcall->issuer->context_->iwannadie = true; simcall->issuer->exception = std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed")); @@ -640,10 +640,10 @@ void SIMIX_comm_finish(smx_activity_t synchro) } } - if (simcall->issuer->host_->is_off()) - simcall->issuer->context_->iwannadie = true; - else + if (simcall->issuer->host_->is_on()) SIMIX_simcall_answer(simcall); + else + simcall->issuer->context_->iwannadie = true; } } diff --git a/src/smpi/plugins/load_balancer/LoadBalancer.cpp b/src/smpi/plugins/load_balancer/LoadBalancer.cpp index 2b6ea9d794..987ce391fd 100644 --- a/src/smpi/plugins/load_balancer/LoadBalancer.cpp +++ b/src/smpi/plugins/load_balancer/LoadBalancer.cpp @@ -53,9 +53,8 @@ LoadBalancer::~LoadBalancer() void LoadBalancer::run() { simgrid::s4u::Engine* engine = simgrid::s4u::Engine::get_instance(); - std::vector available_hosts = engine->get_filtered_hosts([](simgrid::s4u::Host* host) { - return not host->is_off(); - }); + std::vector available_hosts = + engine->get_filtered_hosts([](simgrid::s4u::Host* host) { return host->is_on(); }); xbt_assert(available_hosts.size() > 0, "No hosts available; are they all switched off?"); // TODO: Account for daemon background load (-> use especially the availability file) diff --git a/src/surf/StorageImpl.cpp b/src/surf/StorageImpl.cpp index c709305076..0053a4f8c8 100644 --- a/src/surf/StorageImpl.cpp +++ b/src/surf/StorageImpl.cpp @@ -81,7 +81,7 @@ void StorageImpl::apply_event(kernel::profile::Event* /*event*/, double /*value* void StorageImpl::turn_on() { - if (is_off()) { + if (not is_on()) { Resource::turn_on(); s4u::Storage::on_state_change(this->piface_); } diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index c3ca28c4cd..ab669d9683 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -130,7 +130,7 @@ void CpuCas01::apply_event(kernel::profile::Event* event, double value) xbt_assert(get_core_count() == 1, "FIXME: add state change code also for constraint_core[i]"); if (value > 0) { - if (is_off()) { + if (not is_on()) { XBT_VERB("Restart processes on host %s", get_host()->get_cname()); get_host()->turn_on(); } @@ -163,12 +163,13 @@ void CpuCas01::apply_event(kernel::profile::Event* event, double value) /** @brief Start a new execution on this CPU lasting @param size flops and using one core */ CpuAction* CpuCas01::execution_start(double size) { - return new CpuCas01Action(get_model(), size, is_off(), speed_.scale * speed_.peak, get_constraint()); + return new CpuCas01Action(get_model(), size, not is_on(), speed_.scale * speed_.peak, get_constraint()); } CpuAction* CpuCas01::execution_start(double size, int requested_cores) { - return new CpuCas01Action(get_model(), size, is_off(), speed_.scale * speed_.peak, get_constraint(), requested_cores); + return new CpuCas01Action(get_model(), size, not is_on(), speed_.scale * speed_.peak, get_constraint(), + requested_cores); } CpuAction* CpuCas01::sleep(double duration) @@ -177,7 +178,8 @@ CpuAction* CpuCas01::sleep(double duration) duration = std::max(duration, sg_surf_precision); XBT_IN("(%s,%g)", get_cname(), duration); - CpuCas01Action* action = new CpuCas01Action(get_model(), 1.0, is_off(), speed_.scale * speed_.peak, get_constraint()); + CpuCas01Action* action = + new CpuCas01Action(get_model(), 1.0, not is_on(), speed_.scale * speed_.peak, get_constraint()); // FIXME: sleep variables should not consume 1.0 in System::expand() action->set_max_duration(duration); diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 35c0c0316e..0f5809fcef 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -400,7 +400,7 @@ void CpuTi::apply_event(kernel::profile::Event* event, double value) } else if (event == state_event_) { if (value > 0) { - if (is_off()) { + if (not is_on()) { XBT_VERB("Restart processes on host %s", get_host()->get_cname()); get_host()->turn_on(); } @@ -583,7 +583,7 @@ void CpuTi::set_modified(bool modified) * Action * **********/ -CpuTiAction::CpuTiAction(CpuTi* cpu, double cost) : CpuAction(cpu->get_model(), cost, cpu->is_off()), cpu_(cpu) +CpuTiAction::CpuTiAction(CpuTi* cpu, double cost) : CpuAction(cpu->get_model(), cost, not cpu->is_on()), cpu_(cpu) { cpu_->set_modified(true); } diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 1c75de1fb1..3deb80ea8c 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -222,12 +222,13 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz "You're trying to send data from %s to %s but there is no connecting path between these two hosts.", src->get_cname(), dst->get_cname()); - bool failed = std::any_of(route.begin(), route.end(), [](const LinkImpl* link) { return link->is_off(); }); + bool failed = std::any_of(route.begin(), route.end(), [](const LinkImpl* link) { return not link->is_on(); }); if (cfg_crosstraffic) { dst->route_to(src, back_route, nullptr); if (not failed) - failed = std::any_of(back_route.begin(), back_route.end(), [](const LinkImpl* link) { return link->is_off(); }); + failed = + std::any_of(back_route.begin(), back_route.end(), [](const LinkImpl* link) { return not link->is_on(); }); } NetworkCm02Action *action = new NetworkCm02Action(this, size, failed); diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 6d2a96e063..9bdcd82cb2 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -126,7 +126,7 @@ s4u::Link::SharingPolicy LinkImpl::get_sharing_policy() void LinkImpl::turn_on() { - if (is_off()) { + if (not is_on()) { Resource::turn_on(); s4u::Link::on_state_change(this->piface_); } diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index acda211363..9668d51126 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -121,7 +121,7 @@ void HostL07Model::update_actions_state(double /*now*/, double delta) while (cnst != nullptr) { i++; void* constraint_id = cnst->get_id(); - if (static_cast(constraint_id)->is_off()) { + if (not static_cast(constraint_id)->is_on()) { XBT_DEBUG("Action (%p) Failed!!", &action); action.finish(kernel::resource::Action::State::FAILED); break; @@ -324,7 +324,7 @@ void CpuL07::apply_event(kernel::profile::Event* triggered, double value) } else if (triggered == state_event_) { if (value > 0) { - if (is_off()) { + if (not is_on()) { XBT_VERB("Restart processes on host %s", get_host()->get_cname()); get_host()->turn_on(); } diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 31693c91b7..2b120369e3 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -101,17 +101,17 @@ StorageN11::StorageN11(StorageModel* model, std::string name, kernel::lmm::Syste StorageAction* StorageN11::io_start(sg_size_t size, s4u::Io::OpType type) { - return new StorageN11Action(get_model(), size, is_off(), this, type); + return new StorageN11Action(get_model(), size, not is_on(), this, type); } StorageAction* StorageN11::read(sg_size_t size) { - return new StorageN11Action(get_model(), size, is_off(), this, s4u::Io::OpType::READ); + return new StorageN11Action(get_model(), size, not is_on(), this, s4u::Io::OpType::READ); } StorageAction* StorageN11::write(sg_size_t size) { - return new StorageN11Action(get_model(), size, is_off(), this, s4u::Io::OpType::WRITE); + return new StorageN11Action(get_model(), size, not is_on(), this, s4u::Io::OpType::WRITE); } /********** -- 2.20.1