Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename simix::kernelImmediate into simix::simcall
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 12 May 2018 00:43:24 +0000 (02:43 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 12 May 2018 00:43:24 +0000 (02:43 +0200)
20 files changed:
include/simgrid/simix.hpp
include/simgrid/simix/blocking_simcall.hpp
src/kernel/context/Context.cpp
src/msg/msg_synchro.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_ConditionVariable.cpp
src/s4u/s4u_Engine.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Link.cpp
src/s4u/s4u_Mailbox.cpp
src/s4u/s4u_Netzone.cpp
src/s4u/s4u_Storage.cpp
src/simix/ActorImpl.cpp
src/simix/libsmx.cpp
src/smpi/bindings/smpi_pmpi.cpp
src/surf/plugins/host_energy.cpp
src/surf/plugins/link_energy.cpp
teshsuite/simix/generic-simcalls/generic-simcalls.cpp

index ed5e128..eee08fc 100644 (file)
@@ -49,8 +49,7 @@ namespace simix {
  *  More importantly, this enforces a deterministic/reproducible ordering
  *  of the operation with respect to other simcalls.
  */
-template<class F>
-typename std::result_of<F()>::type kernelImmediate(F&& code)
+template <class F> typename std::result_of<F()>::type simcall(F&& code)
 {
   // If we are in the maestro, we take the fast path and execute the
   // code directly without simcall mashalling/unmarshalling/dispatch:
index ccfc8a1..dcc7b1d 100644 (file)
@@ -153,8 +153,7 @@ auto kernelAsync(F code)
   typedef decltype(code().get()) T;
 
   // Execute the code in the kernel and get the kernel future:
-  simgrid::kernel::Future<T> future =
-    simgrid::simix::kernelImmediate(std::move(code));
+  simgrid::kernel::Future<T> future = simgrid::simix::simcall(std::move(code));
 
   // Wrap the kernel future in a actor future:
   return simgrid::simix::Future<T>(std::move(future));
index 73dccc4..b1af4dc 100644 (file)
@@ -80,7 +80,7 @@ void Context::stop()
   this->process_->suspended = 0;
 
   this->iwannadie = false;
-  simgrid::simix::kernelImmediate([this] { SIMIX_process_cleanup(this->process_); });
+  simgrid::simix::simcall([this] { SIMIX_process_cleanup(this->process_); });
   this->iwannadie = true;
 }
 
index c2895a3..bce88e5 100644 (file)
@@ -19,7 +19,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_synchro, msg, "Logging specific to MSG (sync
 
 /** @brief creates a semaphore object of the given initial capacity */
 msg_sem_t MSG_sem_init(int initial_value) {
-  return simgrid::simix::kernelImmediate([initial_value] { return SIMIX_sem_init(initial_value); });
+  return simgrid::simix::simcall([initial_value] { return SIMIX_sem_init(initial_value); });
 }
 
 /** @brief locks on a semaphore object */
@@ -34,11 +34,11 @@ msg_error_t MSG_sem_acquire_timeout(msg_sem_t sem, double timeout) {
 
 /** @brief releases the semaphore object */
 void MSG_sem_release(msg_sem_t sem) {
-  simgrid::simix::kernelImmediate([sem] { SIMIX_sem_release(sem); });
+  simgrid::simix::simcall([sem] { SIMIX_sem_release(sem); });
 }
 
 int MSG_sem_get_capacity(msg_sem_t sem) {
-  return simgrid::simix::kernelImmediate([sem] { return SIMIX_sem_get_capacity(sem); });
+  return simgrid::simix::simcall([sem] { return SIMIX_sem_get_capacity(sem); });
 }
 
 void MSG_sem_destroy(msg_sem_t sem) {
@@ -51,7 +51,7 @@ void MSG_sem_destroy(msg_sem_t sem) {
  * But that's a classical semaphore issue, and SimGrid's semaphore are not different to usual ones here.
  */
 int MSG_sem_would_block(msg_sem_t sem) {
-  return simgrid::simix::kernelImmediate([sem] { return SIMIX_sem_would_block(sem); });
+  return simgrid::simix::simcall([sem] { return SIMIX_sem_would_block(sem); });
 }
 
 /*-**** barrier related functions ****-*/
index 29174e3..2985b7c 100644 (file)
@@ -66,7 +66,7 @@ void VirtualMachine::start()
 {
   on_start(*this);
 
-  simgrid::simix::kernelImmediate([this]() {
+  simgrid::simix::simcall([this]() {
     simgrid::vm::VmHostExt::ensureVmExtInstalled();
 
     simgrid::s4u::Host* pm = this->pimpl_vm_->getPm();
@@ -85,7 +85,7 @@ void VirtualMachine::start()
           total_ramsize_of_vms += ws_vm->getRamsize();
 
       if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) {
-        XBT_WARN("cannnot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
+        XBT_WARN("cannot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
                  this->get_cname(), pm->get_cname(), vm_ramsize, pm_ramsize - total_ramsize_of_vms, pm_ramsize);
         THROWF(vm_error, 0, "Memory shortage on host '%s', VM '%s' cannot be started", pm->get_cname(),
                this->get_cname());
@@ -102,7 +102,7 @@ void VirtualMachine::suspend()
 {
   on_suspend(*this);
   smx_actor_t issuer = SIMIX_process_self();
-  simgrid::simix::kernelImmediate([this, issuer]() { pimpl_vm_->suspend(issuer); });
+  simgrid::simix::simcall([this, issuer]() { pimpl_vm_->suspend(issuer); });
 }
 
 void VirtualMachine::resume()
@@ -114,7 +114,7 @@ void VirtualMachine::resume()
 void VirtualMachine::shutdown()
 {
   smx_actor_t issuer = SIMIX_process_self();
-  simgrid::simix::kernelImmediate([this, issuer]() { pimpl_vm_->shutdown(issuer); });
+  simgrid::simix::simcall([this, issuer]() { pimpl_vm_->shutdown(issuer); });
   on_shutdown(*this);
 }
 
@@ -134,12 +134,12 @@ simgrid::s4u::Host* VirtualMachine::getPm()
 
 void VirtualMachine::setPm(simgrid::s4u::Host* pm)
 {
-  simgrid::simix::kernelImmediate([this, pm]() { pimpl_vm_->setPm(pm); });
+  simgrid::simix::simcall([this, pm]() { pimpl_vm_->setPm(pm); });
 }
 
 e_surf_vm_state_t VirtualMachine::getState()
 {
-  return simgrid::simix::kernelImmediate([this]() { return pimpl_vm_->getState(); });
+  return simgrid::simix::simcall([this]() { return pimpl_vm_->getState(); });
 }
 
 size_t VirtualMachine::getRamsize()
@@ -179,7 +179,7 @@ void VirtualMachine::setRamsize(size_t ramsize)
  */
 void VirtualMachine::setBound(double bound)
 {
-  simgrid::simix::kernelImmediate([this, bound]() { pimpl_vm_->setBound(bound); });
+  simgrid::simix::simcall([this, bound]() { pimpl_vm_->setBound(bound); });
 }
 
 } // namespace simgrid
index ed73dc9..1267fdb 100644 (file)
@@ -69,12 +69,12 @@ void Actor::join(double timeout)
 
 void Actor::set_auto_restart(bool autorestart)
 {
-  simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; });
+  simgrid::simix::simcall([this, autorestart]() { pimpl_->auto_restart = autorestart; });
 }
 
 void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data)
 {
-  simgrid::simix::kernelImmediate([this, fun, data] { SIMIX_process_on_exit(pimpl_, fun, data); });
+  simgrid::simix::simcall([this, fun, data] { SIMIX_process_on_exit(pimpl_, fun, data); });
 }
 
 /** @brief Moves the actor to another host
@@ -90,7 +90,7 @@ void Actor::migrate(Host* new_host)
 {
   s4u::Actor::on_migration_start(this);
 
-  simgrid::simix::kernelImmediate([this, new_host]() {
+  simgrid::simix::simcall([this, new_host]() {
     if (pimpl_->waiting_synchro != nullptr) {
       // The actor is blocked on an activity. If it's an exec, migrate it too.
       // FIXME: implement the migration of other kind of activities
@@ -112,7 +112,7 @@ s4u::Host* Actor::get_host()
 
 void Actor::daemonize()
 {
-  simgrid::simix::kernelImmediate([this]() { pimpl_->daemonize(); });
+  simgrid::simix::simcall([this]() { pimpl_->daemonize(); });
 }
 
 bool Actor::is_daemon() const
@@ -148,13 +148,13 @@ void Actor::suspend()
 
 void Actor::resume()
 {
-  simgrid::simix::kernelImmediate([this] { pimpl_->resume(); });
+  simgrid::simix::simcall([this] { pimpl_->resume(); });
   s4u::Actor::on_resume(this);
 }
 
 int Actor::is_suspended()
 {
-  return simgrid::simix::kernelImmediate([this] { return pimpl_->suspended; });
+  return simgrid::simix::simcall([this] { return pimpl_->suspended; });
 }
 
 void Actor::set_kill_time(double time)
@@ -173,7 +173,7 @@ void Actor::kill(aid_t pid)
   smx_actor_t killer  = SIMIX_process_self();
   smx_actor_t process = SIMIX_process_from_PID(pid);
   if (process != nullptr) {
-    simgrid::simix::kernelImmediate([killer, process] { SIMIX_process_kill(process, killer); });
+    simgrid::simix::simcall([killer, process] { SIMIX_process_kill(process, killer); });
   } else {
     std::ostringstream oss;
     oss << "kill: (" << pid << ") - No such actor" << std::endl;
@@ -184,7 +184,7 @@ void Actor::kill(aid_t pid)
 void Actor::kill()
 {
   smx_actor_t process = SIMIX_process_self();
-  simgrid::simix::kernelImmediate(
+  simgrid::simix::simcall(
       [this, process] { SIMIX_process_kill(pimpl_, (pimpl_ == simix_global->maestro_process) ? pimpl_ : process); });
 }
 
@@ -207,28 +207,28 @@ ActorPtr Actor::by_pid(aid_t pid)
 void Actor::kill_all()
 {
   smx_actor_t self = SIMIX_process_self();
-  simgrid::simix::kernelImmediate([&self] { SIMIX_process_killall(self); });
+  simgrid::simix::simcall([&self] { SIMIX_process_killall(self); });
 }
 
 std::map<std::string, std::string>* Actor::get_properties()
 {
-  return simgrid::simix::kernelImmediate([this] { return this->pimpl_->getProperties(); });
+  return simgrid::simix::simcall([this] { return this->pimpl_->getProperties(); });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
 const char* Actor::get_property(const char* key)
 {
-  return simgrid::simix::kernelImmediate([this, key] { return pimpl_->getProperty(key); });
+  return simgrid::simix::simcall([this, key] { return pimpl_->getProperty(key); });
 }
 
 void Actor::set_property(const char* key, const char* value)
 {
-  simgrid::simix::kernelImmediate([this, key, value] { pimpl_->setProperty(key, value); });
+  simgrid::simix::simcall([this, key, value] { pimpl_->setProperty(key, value); });
 }
 
 Actor* Actor::restart()
 {
-  return simgrid::simix::kernelImmediate([this]() { return pimpl_->restart(); });
+  return simgrid::simix::simcall([this]() { return pimpl_->restart(); });
 }
 
 // ***** this_actor *****
@@ -258,7 +258,7 @@ void sleep_for(double duration)
 
 void yield()
 {
-  simgrid::simix::kernelImmediate([] { /* do nothing*/ });
+  simgrid::simix::simcall([] { /* do nothing*/ });
 }
 
 XBT_PUBLIC void sleep_until(double timeout)
@@ -342,20 +342,20 @@ void suspend()
 void resume()
 {
   smx_actor_t process = SIMIX_process_self();
-  simgrid::simix::kernelImmediate([process] { process->resume(); });
+  simgrid::simix::simcall([process] { process->resume(); });
   simgrid::s4u::Actor::on_resume(process->iface());
 }
 
 bool is_suspended()
 {
   smx_actor_t process = SIMIX_process_self();
-  return simgrid::simix::kernelImmediate([process] { return process->suspended; });
+  return simgrid::simix::simcall([process] { return process->suspended; });
 }
 
 void kill()
 {
   smx_actor_t process = SIMIX_process_self();
-  simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); });
+  simgrid::simix::simcall([process] { SIMIX_process_kill(process, process); });
 }
 
 void on_exit(int_f_pvoid_pvoid_t fun, void* data)
index 9df1f73..2a08728 100644 (file)
@@ -66,12 +66,12 @@ std::cv_status ConditionVariable::wait_until(std::unique_lock<Mutex>& lock, doub
  */
 void ConditionVariable::notify_one()
 {
-  simgrid::simix::kernelImmediate([this]() { cond_->signal(); });
+  simgrid::simix::simcall([this]() { cond_->signal(); });
 }
 
 void ConditionVariable::notify_all()
 {
-  simgrid::simix::kernelImmediate([this]() { cond_->broadcast(); });
+  simgrid::simix::simcall([this]() { cond_->broadcast(); });
 }
 
 void intrusive_ptr_add_ref(ConditionVariable* cond)
index 5860786..ab520f2 100644 (file)
@@ -244,14 +244,14 @@ std::vector<simgrid::kernel::routing::NetPoint*> Engine::get_all_netpoints()
 /** @brief Register a new netpoint to the system */
 void Engine::netpoint_register(simgrid::kernel::routing::NetPoint* point)
 {
-  // simgrid::simix::kernelImmediate([&]{ FIXME: this segfaults in set_thread
+  // simgrid::simix::simcall([&]{ FIXME: this segfaults in set_thread
   pimpl->netpoints_[point->get_name()] = point;
   // });
 }
 /** @brief Unregister a given netpoint */
 void Engine::netpoint_unregister(simgrid::kernel::routing::NetPoint* point)
 {
-  simgrid::simix::kernelImmediate([this, point] {
+  simgrid::simix::simcall([this, point] {
     pimpl->netpoints_.erase(point->get_name());
     delete point;
   });
index 41ffe89..607e50e 100644 (file)
@@ -99,7 +99,7 @@ Host* Exec::get_host()
 /** @brief Returns the amount of flops that remain to be done */
 double Exec::get_remaining()
 {
-  return simgrid::simix::kernelImmediate(
+  return simgrid::simix::simcall(
       [this]() { return boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->get_remaining(); });
 }
 
@@ -109,7 +109,7 @@ double Exec::get_remaining()
  */
 double Exec::get_remaining_ratio()
 {
-  return simgrid::simix::kernelImmediate([this]() {
+  return simgrid::simix::simcall([this]() {
     return boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->get_remaining_ratio();
   });
 }
index 97dd8ba..bd963f4 100644 (file)
@@ -92,7 +92,7 @@ Host* Host::current()
 void Host::turnOn()
 {
   if (isOff()) {
-    simgrid::simix::kernelImmediate([this] {
+    simgrid::simix::simcall([this] {
       this->extension<simgrid::simix::Host>()->turnOn();
       this->pimpl_cpu->turn_on();
       onStateChange(*this);
@@ -104,7 +104,7 @@ void Host::turnOff()
 {
   if (isOn()) {
     smx_actor_t self = SIMIX_process_self();
-    simgrid::simix::kernelImmediate([this, self] {
+    simgrid::simix::simcall([this, self] {
       SIMIX_host_off(this, self);
       onStateChange(*this);
     });
@@ -168,7 +168,7 @@ void Host::routeTo(Host* dest, std::vector<kernel::resource::LinkImpl*>& links,
 /** Get the properties assigned to a host */
 std::map<std::string, std::string>* Host::getProperties()
 {
-  return simgrid::simix::kernelImmediate([this] { return this->pimpl_->getProperties(); });
+  return simgrid::simix::simcall([this] { return this->pimpl_->getProperties(); });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
@@ -179,7 +179,7 @@ const char* Host::getProperty(const char* key)
 
 void Host::setProperty(std::string key, std::string value)
 {
-  simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
+  simgrid::simix::simcall([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 
 /** Get the processes attached to the host */
@@ -199,8 +199,7 @@ int Host::get_actor_count()
 /** @brief Get the peak processor speed (in flops/s), at the specified pstate  */
 double Host::getPstateSpeed(int pstate_index)
 {
-  return simgrid::simix::kernelImmediate(
-      [this, pstate_index] { return this->pimpl_cpu->getPstateSpeed(pstate_index); });
+  return simgrid::simix::simcall([this, pstate_index] { return this->pimpl_cpu->getPstateSpeed(pstate_index); });
 }
 
 /** @brief Get the peak processor speed (under full load (=1.0), in flops/s), at the current pstate */
@@ -218,7 +217,7 @@ int Host::getCoreCount()
 /** @brief Set the pstate at which the host should run */
 void Host::setPstate(int pstate_index)
 {
-  simgrid::simix::kernelImmediate([this, pstate_index] { this->pimpl_cpu->setPState(pstate_index); });
+  simgrid::simix::simcall([this, pstate_index] { this->pimpl_cpu->setPState(pstate_index); });
 }
 /** @brief Retrieve the pstate at which the host is currently running */
 int Host::getPstate()
@@ -233,13 +232,13 @@ int Host::getPstate()
  */
 std::vector<const char*> Host::get_attached_storages()
 {
-  return simgrid::simix::kernelImmediate([this] { return this->pimpl_->get_attached_storages(); });
+  return simgrid::simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
 }
 
 void Host::getAttachedStorages(std::vector<const char*>* storages)
 {
   std::vector<const char*> local_storages =
-      simgrid::simix::kernelImmediate([this] { return this->pimpl_->get_attached_storages(); });
+      simgrid::simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
   for (auto elm : local_storages)
     storages->push_back(elm);
 }
index b6b1a58..954969d 100644 (file)
@@ -70,11 +70,11 @@ double Link::getUsage()
 
 void Link::turnOn()
 {
-  simgrid::simix::kernelImmediate([this]() { this->pimpl_->turn_on(); });
+  simgrid::simix::simcall([this]() { this->pimpl_->turn_on(); });
 }
 void Link::turnOff()
 {
-  simgrid::simix::kernelImmediate([this]() { this->pimpl_->turn_off(); });
+  simgrid::simix::simcall([this]() { this->pimpl_->turn_off(); });
 }
 
 void* Link::getData()
@@ -83,20 +83,20 @@ void* Link::getData()
 }
 void Link::setData(void* d)
 {
-  simgrid::simix::kernelImmediate([this, d]() { this->pimpl_->setData(d); });
+  simgrid::simix::simcall([this, d]() { this->pimpl_->setData(d); });
 }
 
 void Link::setStateTrace(tmgr_trace_t trace)
 {
-  simgrid::simix::kernelImmediate([this, trace]() { this->pimpl_->setStateTrace(trace); });
+  simgrid::simix::simcall([this, trace]() { this->pimpl_->setStateTrace(trace); });
 }
 void Link::setBandwidthTrace(tmgr_trace_t trace)
 {
-  simgrid::simix::kernelImmediate([this, trace]() { this->pimpl_->setBandwidthTrace(trace); });
+  simgrid::simix::simcall([this, trace]() { this->pimpl_->setBandwidthTrace(trace); });
 }
 void Link::setLatencyTrace(tmgr_trace_t trace)
 {
-  simgrid::simix::kernelImmediate([this, trace]() { this->pimpl_->setLatencyTrace(trace); });
+  simgrid::simix::simcall([this, trace]() { this->pimpl_->setLatencyTrace(trace); });
 }
 
 const char* Link::getProperty(const char* key)
@@ -105,7 +105,7 @@ const char* Link::getProperty(const char* key)
 }
 void Link::setProperty(std::string key, std::string value)
 {
-  simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
+  simgrid::simix::simcall([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 } // namespace s4u
 } // namespace simgrid
index c135ce7..f57874e 100644 (file)
@@ -30,7 +30,7 @@ MailboxPtr Mailbox::byName(const char* name)
 {
   kernel::activity::MailboxImpl* mbox = kernel::activity::MailboxImpl::byNameOrNull(name);
   if (mbox == nullptr) {
-    mbox = simix::kernelImmediate([name] { return kernel::activity::MailboxImpl::byNameOrCreate(name); });
+    mbox = simix::simcall([name] { return kernel::activity::MailboxImpl::byNameOrCreate(name); });
   }
   return MailboxPtr(&mbox->piface_, true);
 }
@@ -57,7 +57,7 @@ smx_activity_t Mailbox::front()
 
 void Mailbox::setReceiver(ActorPtr actor)
 {
-  simix::kernelImmediate([this, actor]() { this->pimpl_->setReceiver(actor); });
+  simix::simcall([this, actor]() { this->pimpl_->setReceiver(actor); });
 }
 
 /** @brief get the receiver (process associated to the mailbox) */
index 5a60eeb..da67bc6 100644 (file)
@@ -40,7 +40,7 @@ NetZone::~NetZone()
 
 std::unordered_map<std::string, std::string>* NetZone::getProperties()
 {
-  return simgrid::simix::kernelImmediate([this] { return &properties_; });
+  return simgrid::simix::simcall([this] { return &properties_; });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
@@ -50,7 +50,7 @@ const char* NetZone::getProperty(const char* key)
 }
 void NetZone::setProperty(const char* key, const char* value)
 {
-  simgrid::simix::kernelImmediate([this, key, value] { properties_[key] = value; });
+  simgrid::simix::simcall([this, key, value] { properties_[key] = value; });
 }
 
 /** @brief Returns the list of direct children (no grand-children)
index 6080b06..95e250c 100644 (file)
@@ -57,7 +57,7 @@ Host* Storage::getHost()
 
 std::map<std::string, std::string>* Storage::getProperties()
 {
-  return simgrid::simix::kernelImmediate([this] { return pimpl_->getProperties(); });
+  return simgrid::simix::simcall([this] { return pimpl_->getProperties(); });
 }
 
 const char* Storage::getProperty(std::string key)
@@ -67,7 +67,7 @@ const char* Storage::getProperty(std::string key)
 
 void Storage::setProperty(std::string key, std::string value)
 {
-  simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
+  simgrid::simix::simcall([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 
 sg_size_t Storage::read(sg_size_t size)
index e0b79eb..202aa8f 100644 (file)
@@ -814,7 +814,7 @@ smx_actor_t simcall_process_create(const char* name, std::function<void()> code,
   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);
   });
 }
index 298aaf4..13b9cc1 100644 (file)
@@ -65,7 +65,7 @@ smx_activity_t simcall_execution_start(const char* name, double flops_amount, do
   xbt_assert(std::isfinite(flops_amount), "flops_amount is not finite!");
   xbt_assert(std::isfinite(priority), "priority is not finite!");
 
-  return simgrid::simix::kernelImmediate([name, flops_amount, priority, bound, host] {
+  return simgrid::simix::simcall([name, flops_amount, priority, bound, host] {
     return SIMIX_execution_start(name, flops_amount, priority, bound, host);
   });
 }
@@ -101,7 +101,7 @@ smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, s
 
   xbt_assert(std::isfinite(rate), "rate is not finite!");
 
-  return simgrid::simix::kernelImmediate([name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout] {
+  return simgrid::simix::simcall([name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout] {
     return SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
   });
 }
@@ -119,9 +119,7 @@ void simcall_execution_cancel(smx_activity_t execution)
       boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
   if (exec->surf_action_ == nullptr) // FIXME: One test fails if I remove this, but I don't get why...
     return;
-  simgrid::simix::kernelImmediate([exec] {
-    exec->cancel();
-  });
+  simgrid::simix::simcall([exec] { exec->cancel(); });
 }
 
 /**
@@ -136,7 +134,7 @@ void simcall_execution_set_priority(smx_activity_t execution, double priority)
 {
   /* checking for infinite values */
   xbt_assert(std::isfinite(priority), "priority is not finite!");
-  simgrid::simix::kernelImmediate([execution, priority] {
+  simgrid::simix::simcall([execution, priority] {
 
     simgrid::kernel::activity::ExecImplPtr exec =
         boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
@@ -154,7 +152,7 @@ void simcall_execution_set_priority(smx_activity_t execution, double priority)
  */
 void simcall_execution_set_bound(smx_activity_t execution, double bound)
 {
-  simgrid::simix::kernelImmediate([execution, bound] {
+  simgrid::simix::simcall([execution, bound] {
     simgrid::kernel::activity::ExecImplPtr exec =
         boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
     exec->set_bound(bound);
@@ -206,7 +204,7 @@ void simcall_process_suspend(smx_actor_t process)
  */
 void simcall_process_set_data(smx_actor_t process, void *data)
 {
-  simgrid::simix::kernelImmediate([process, data] { process->setUserData(data); });
+  simgrid::simix::simcall([process, data] { process->setUserData(data); });
 }
 
 /**
@@ -343,7 +341,7 @@ smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type,
  */
 void simcall_comm_cancel(smx_activity_t synchro)
 {
-  simgrid::simix::kernelImmediate([synchro] {
+  simgrid::simix::simcall([synchro] {
     simgrid::kernel::activity::CommImplPtr comm =
         boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
     comm->cancel();
@@ -389,7 +387,7 @@ void simcall_set_category(smx_activity_t synchro, const char *category)
   if (category == nullptr) {
     return;
   }
-  simgrid::simix::kernelImmediate([synchro, category] { SIMIX_set_category(synchro, category); });
+  simgrid::simix::simcall([synchro, category] { SIMIX_set_category(synchro, category); });
 }
 
 /**
@@ -411,7 +409,7 @@ smx_mutex_t simcall_mutex_init()
     fprintf(stderr,"You must run MSG_init before using MSG\n"); // We can't use xbt_die since we may get there before the initialization
     xbt_abort();
   }
-  return simgrid::simix::kernelImmediate([] { return new simgrid::kernel::activity::MutexImpl(); });
+  return simgrid::simix::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
 }
 
 /**
@@ -447,7 +445,7 @@ void simcall_mutex_unlock(smx_mutex_t mutex)
  */
 smx_cond_t simcall_cond_init()
 {
-  return simgrid::simix::kernelImmediate([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
+  return simgrid::simix::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
 }
 
 /**
index 9028c78..2911844 100644 (file)
@@ -120,7 +120,7 @@ int PMPI_Abort(MPI_Comm /*comm*/, int /*errorcode*/)
   smpi_bench_end();
   // FIXME: should kill all processes in comm instead
   smx_actor_t process = SIMIX_process_self();
-  simgrid::simix::kernelImmediate([process] { SIMIX_process_kill(process, process); });
+  simgrid::simix::simcall([process] { SIMIX_process_kill(process, process); });
   return MPI_SUCCESS;
 }
 
index e8f4fa4..a90c80e 100644 (file)
@@ -307,7 +307,7 @@ double HostEnergy::getCurrentWattsValue(double cpu_load)
 double HostEnergy::getConsumedEnergy()
 {
   if (last_updated < surf_get_clock()) // We need to simcall this as it modifies the environment
-    simgrid::simix::kernelImmediate(std::bind(&HostEnergy::update, this));
+    simgrid::simix::simcall(std::bind(&HostEnergy::update, this));
 
   return total_energy;
 }
@@ -473,7 +473,7 @@ void sg_host_energy_plugin_init()
  */
 void sg_host_energy_update_all()
 {
-  simgrid::simix::kernelImmediate([]() {
+  simgrid::simix::simcall([]() {
     std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::get_instance()->get_all_hosts();
     for (auto const& host : list)
       if (dynamic_cast<simgrid::s4u::VirtualMachine*>(host) == nullptr) // Ignore virtual machines
index 32dff12..bce16c3 100644 (file)
@@ -135,7 +135,7 @@ double LinkEnergy::getPower()
 double LinkEnergy::getConsumedEnergy()
 {
   if (lastUpdated_ < surf_get_clock()) // We need to simcall this as it modifies the environment
-    simgrid::simix::kernelImmediate(std::bind(&LinkEnergy::update, this));
+    simgrid::simix::simcall(std::bind(&LinkEnergy::update, this));
   return this->totalEnergy_;
 }
 }
index 14f1c6d..94b9558 100644 (file)
@@ -35,7 +35,7 @@ static int master(int argc, char* argv[])
 {
   // Test the simple immediate execution:
   XBT_INFO("Start");
-  simgrid::simix::kernelImmediate([] { XBT_INFO("kernel"); });
+  simgrid::simix::simcall([] { XBT_INFO("kernel"); });
   XBT_INFO("kernel, returned");
 
   // Synchronize on a successful Future<void>: