Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move the simcall template to the kernel::actor namespace
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 12 Aug 2019 09:37:10 +0000 (11:37 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 15 Aug 2019 13:37:40 +0000 (15:37 +0200)
22 files changed:
include/simgrid/simix.hpp
include/simgrid/simix/blocking_simcall.hpp
src/kernel/actor/ActorImpl.cpp
src/plugins/host_energy.cpp
src/plugins/link_energy.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_ConditionVariable.cpp
src/s4u/s4u_Engine.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Io.cpp
src/s4u/s4u_Link.cpp
src/s4u/s4u_Mailbox.cpp
src/s4u/s4u_Mutex.cpp
src/s4u/s4u_Netzone.cpp
src/s4u/s4u_Semaphore.cpp
src/s4u/s4u_Storage.cpp
src/simix/libsmx.cpp
src/smpi/bindings/smpi_pmpi.cpp
teshsuite/simix/generic-simcalls/generic-simcalls.cpp

index 2b979d7..f28dbb2 100644 (file)
@@ -20,7 +20,8 @@ XBT_PUBLIC void simcall_run_kernel(std::function<void()> const& code);
 XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code);
 
 namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace actor {
 
 /** Execute some code in kernel context on behalf of the user code.
  *
@@ -86,6 +87,11 @@ template <class F> typename std::result_of<F()>::type simcall_blocking(F&& code)
   simcall_run_blocking([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); });
   return result.get();
 }
+} // namespace actor
+} // namespace kernel
+} // namespace simgrid
+namespace simgrid {
+namespace simix {
 
 XBT_ATTRIB_DEPRECATED_v325("Please manifest if you actually need this function")
     XBT_PUBLIC const std::vector<smx_actor_t>& process_get_runnable();
index 43565d3..c8ba0f7 100644 (file)
@@ -149,7 +149,7 @@ template <class F> auto kernel_async(F code) -> Future<decltype(code().get())>
   typedef decltype(code().get()) T;
 
   // Execute the code in the kernel and get the kernel future:
-  simgrid::kernel::Future<T> future = simgrid::simix::simcall(std::move(code));
+  simgrid::kernel::Future<T> future = simgrid::kernel::actor::simcall(std::move(code));
 
   // Wrap the kernel future in a actor future:
   return simgrid::simix::Future<T>(std::move(future));
index 0d45213..8cd4120 100644 (file)
@@ -68,7 +68,7 @@ ActorImpl::~ActorImpl()
   if (simix_global != nullptr && this != simix_global->maestro_process) {
     if (context_.get() != nullptr) /* the actor was not start()ed yet. This happens if its host was initially off */
       context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
-    simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); });
+    simgrid::kernel::actor::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); });
     if (context_.get() != nullptr)
       context_->iwannadie = true;
   }
@@ -193,7 +193,7 @@ void ActorImpl::cleanup()
   simix_global->mutex.unlock();
 
   context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
-  simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_termination(*ciface()); });
+  simgrid::kernel::actor::simcall([this] { simgrid::s4u::Actor::on_termination(*ciface()); });
   context_->iwannadie = true;
 }
 
@@ -650,12 +650,12 @@ smx_actor_t simcall_process_create(const std::string& name, const simgrid::simix
                                    sg_host_t host, std::unordered_map<std::string, std::string>* properties)
 {
   smx_actor_t self = SIMIX_process_self();
-  return simgrid::simix::simcall([&name, &code, data, host, properties, self] {
+  return simgrid::kernel::actor::simcall([&name, &code, data, host, properties, self] {
     return simgrid::kernel::actor::ActorImpl::create(name, code, data, host, properties, self).get();
   });
 }
 
 void simcall_process_set_data(smx_actor_t process, void* data)
 {
-  simgrid::simix::simcall([process, data] { process->set_user_data(data); });
+  simgrid::kernel::actor::simcall([process, data] { process->set_user_data(data); });
 }
index d85f013..2dd43f5 100644 (file)
@@ -334,7 +334,7 @@ double HostEnergy::get_current_watts_value(double cpu_load)
 double HostEnergy::get_consumed_energy()
 {
   if (last_updated_ < surf_get_clock()) // We need to simcall this as it modifies the environment
-    simgrid::simix::simcall(std::bind(&HostEnergy::update, this));
+    simgrid::kernel::actor::simcall(std::bind(&HostEnergy::update, this));
 
   return total_energy_;
 }
@@ -517,7 +517,7 @@ void sg_host_energy_plugin_init()
  */
 void sg_host_energy_update_all()
 {
-  simgrid::simix::simcall([]() {
+  simgrid::kernel::actor::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 d6ff797..bdf842b 100644 (file)
@@ -136,7 +136,7 @@ double LinkEnergy::get_power()
 double LinkEnergy::get_consumed_energy()
 {
   if (last_updated_ < surf_get_clock()) // We need to simcall this as it modifies the environment
-    simgrid::simix::simcall(std::bind(&LinkEnergy::update, this));
+    simgrid::kernel::actor::simcall(std::bind(&LinkEnergy::update, this));
   return this->total_energy_;
 }
 } // namespace plugin
index 7dd96b8..3cf72b4 100644 (file)
@@ -64,7 +64,7 @@ void VirtualMachine::start()
 {
   on_start(*this);
 
-  simgrid::simix::simcall([this]() {
+  simgrid::kernel::actor::simcall([this]() {
     simgrid::vm::VmHostExt::ensureVmExtInstalled();
 
     simgrid::s4u::Host* pm = this->pimpl_vm_->get_physical_host();
@@ -101,7 +101,7 @@ void VirtualMachine::suspend()
 {
   on_suspend(*this);
   smx_actor_t issuer = SIMIX_process_self();
-  simgrid::simix::simcall([this, issuer]() { pimpl_vm_->suspend(issuer); });
+  simgrid::kernel::actor::simcall([this, issuer]() { pimpl_vm_->suspend(issuer); });
 }
 
 void VirtualMachine::resume()
@@ -113,7 +113,7 @@ void VirtualMachine::resume()
 void VirtualMachine::shutdown()
 {
   smx_actor_t issuer = SIMIX_process_self();
-  simgrid::simix::simcall([this, issuer]() { pimpl_vm_->shutdown(issuer); });
+  simgrid::kernel::actor::simcall([this, issuer]() { pimpl_vm_->shutdown(issuer); });
   on_shutdown(*this);
 }
 
@@ -133,12 +133,12 @@ simgrid::s4u::Host* VirtualMachine::get_pm()
 
 void VirtualMachine::set_pm(simgrid::s4u::Host* pm)
 {
-  simgrid::simix::simcall([this, pm]() { pimpl_vm_->set_physical_host(pm); });
+  simgrid::kernel::actor::simcall([this, pm]() { pimpl_vm_->set_physical_host(pm); });
 }
 
 VirtualMachine::state VirtualMachine::get_state()
 {
-  return simgrid::simix::simcall([this]() { return pimpl_vm_->get_state(); });
+  return simgrid::kernel::actor::simcall([this]() { return pimpl_vm_->get_state(); });
 }
 
 size_t VirtualMachine::get_ramsize()
@@ -178,7 +178,7 @@ void VirtualMachine::set_ramsize(size_t ramsize)
  */
 void VirtualMachine::set_bound(double bound)
 {
-  simgrid::simix::simcall([this, bound]() { pimpl_vm_->set_bound(bound); });
+  simgrid::kernel::actor::simcall([this, bound]() { pimpl_vm_->set_bound(bound); });
 }
 
 } // namespace simgrid
index 83e905f..4239ef2 100644 (file)
@@ -46,13 +46,14 @@ Actor* Actor::self()
 ActorPtr Actor::init(const std::string& name, s4u::Host* host)
 {
   smx_actor_t self = SIMIX_process_self();
-  kernel::actor::ActorImpl* actor = simix::simcall([self, &name, host] { return self->init(name, host).get(); });
+  kernel::actor::ActorImpl* actor =
+      kernel::actor::simcall([self, &name, host] { return self->init(name, host).get(); });
   return actor->iface();
 }
 
 ActorPtr Actor::start(const std::function<void()>& code)
 {
-  simgrid::simix::simcall([this, &code] { pimpl_->start(code); });
+  simgrid::kernel::actor::simcall([this, &code] { pimpl_->start(code); });
   return this;
 }
 
@@ -60,7 +61,7 @@ ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::func
 {
   smx_actor_t self = SIMIX_process_self();
   kernel::actor::ActorImpl* actor =
-      simix::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
+      kernel::actor::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
 
   return actor->iface();
 }
@@ -96,7 +97,7 @@ void Actor::join(double timeout)
 {
   auto issuer = SIMIX_process_self();
   auto target = pimpl_;
-  simix::simcall_blocking([issuer, target, timeout] {
+  kernel::actor::simcall_blocking([issuer, target, timeout] {
     if (target->finished_) {
       // The joined process is already finished, just wake up the issuer right away
       issuer->simcall_answer();
@@ -110,7 +111,7 @@ void Actor::join(double timeout)
 
 void Actor::set_auto_restart(bool autorestart)
 {
-  simix::simcall([this, autorestart]() {
+  kernel::actor::simcall([this, autorestart]() {
     xbt_assert(autorestart && not pimpl_->has_to_auto_restart()); // FIXME: handle all cases
     pimpl_->set_auto_restart(autorestart);
 
@@ -127,14 +128,14 @@ void Actor::on_exit(const std::function<void(int, void*)>& fun, void* data) /* d
 
 void Actor::on_exit(const std::function<void(bool /*failed*/)>& fun) const
 {
-  simix::simcall([this, &fun] { SIMIX_process_on_exit(pimpl_, fun); });
+  kernel::actor::simcall([this, &fun] { SIMIX_process_on_exit(pimpl_, fun); });
 }
 
 void Actor::migrate(Host* new_host)
 {
   s4u::Actor::on_migration_start(*this);
 
-  simix::simcall([this, new_host]() {
+  kernel::actor::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
@@ -156,7 +157,7 @@ s4u::Host* Actor::get_host() const
 
 void Actor::daemonize()
 {
-  simix::simcall([this]() { pimpl_->daemonize(); });
+  kernel::actor::simcall([this]() { pimpl_->daemonize(); });
 }
 
 bool Actor::is_daemon() const
@@ -189,7 +190,7 @@ void Actor::suspend()
   auto issuer = SIMIX_process_self();
   auto target = pimpl_;
   s4u::Actor::on_suspend(*this);
-  simix::simcall_blocking([issuer, target]() {
+  kernel::actor::simcall_blocking([issuer, target]() {
     target->suspend(issuer);
     if (target != issuer) {
       /* If we are suspending ourselves, then just do not finish the simcall now */
@@ -200,7 +201,7 @@ void Actor::suspend()
 
 void Actor::resume()
 {
-  simix::simcall([this] { pimpl_->resume(); });
+  kernel::actor::simcall([this] { pimpl_->resume(); });
   s4u::Actor::on_resume(*this);
 }
 
@@ -211,7 +212,7 @@ bool Actor::is_suspended()
 
 void Actor::set_kill_time(double kill_time)
 {
-  simix::simcall([this, kill_time] { pimpl_->set_kill_time(kill_time); });
+  kernel::actor::simcall([this, kill_time] { pimpl_->set_kill_time(kill_time); });
 }
 
 /** @brief Get the kill time of an actor(or 0 if unset). */
@@ -225,7 +226,7 @@ void Actor::kill(aid_t pid) // deprecated
   kernel::actor::ActorImpl* killer = SIMIX_process_self();
   kernel::actor::ActorImpl* victim = SIMIX_process_from_PID(pid);
   if (victim != nullptr) {
-    simix::simcall([killer, victim] { killer->kill(victim); });
+    kernel::actor::simcall([killer, victim] { killer->kill(victim); });
   } else {
     std::ostringstream oss;
     oss << "kill: (" << pid << ") - No such actor" << std::endl;
@@ -236,7 +237,7 @@ void Actor::kill(aid_t pid) // deprecated
 void Actor::kill()
 {
   kernel::actor::ActorImpl* process = SIMIX_process_self();
-  simix::simcall([this, process] {
+  kernel::actor::simcall([this, process] {
     xbt_assert(pimpl_ != simix_global->maestro_process, "Killing maestro is a rather bad idea");
     process->kill(pimpl_);
   });
@@ -256,7 +257,7 @@ ActorPtr Actor::by_pid(aid_t pid)
 void Actor::kill_all()
 {
   kernel::actor::ActorImpl* self = SIMIX_process_self();
-  simix::simcall([self] { self->kill_all(); });
+  kernel::actor::simcall([self] { self->kill_all(); });
 }
 
 const std::unordered_map<std::string, std::string>* Actor::get_properties() const
@@ -272,12 +273,12 @@ const char* Actor::get_property(const std::string& key) const
 
 void Actor::set_property(const std::string& key, const std::string& value)
 {
-  simix::simcall([this, &key, &value] { pimpl_->set_property(key, value); });
+  kernel::actor::simcall([this, &key, &value] { pimpl_->set_property(key, value); });
 }
 
 Actor* Actor::restart()
 {
-  return simix::simcall([this]() { return pimpl_->restart(); });
+  return kernel::actor::simcall([this]() { return pimpl_->restart(); });
 }
 
 // ***** this_actor *****
@@ -307,7 +308,7 @@ void sleep_for(double duration)
     kernel::actor::ActorImpl* issuer = SIMIX_process_self();
     Actor::on_sleep(*issuer->ciface());
 
-    simix::simcall_blocking([issuer, duration]() {
+    kernel::actor::simcall_blocking([issuer, duration]() {
       if (MC_is_active() || MC_record_replay_is_active()) {
         MC_process_clock_add(issuer, duration);
         issuer->simcall_answer();
@@ -325,7 +326,7 @@ void sleep_for(double duration)
 
 void yield()
 {
-  simix::simcall([] { /* do nothing*/ });
+  kernel::actor::simcall([] { /* do nothing*/ });
 }
 
 XBT_PUBLIC void sleep_until(double wakeup_time)
@@ -449,14 +450,14 @@ void suspend()
 void resume()
 {
   kernel::actor::ActorImpl* self = SIMIX_process_self();
-  simix::simcall([self] { self->resume(); });
+  kernel::actor::simcall([self] { self->resume(); });
   Actor::on_resume(*self->ciface());
 }
 
 void exit()
 {
   kernel::actor::ActorImpl* self = SIMIX_process_self();
-  simgrid::simix::simcall([self] { self->exit(); });
+  simgrid::kernel::actor::simcall([self] { self->exit(); });
 }
 
 void on_exit(const std::function<void(bool)>& fun)
index 0c28a0b..730a6b4 100644 (file)
@@ -200,7 +200,7 @@ Comm* Comm::detach()
 
 Comm* Comm::cancel()
 {
-  simix::simcall([this] {
+  kernel::actor::simcall([this] {
     if (pimpl_)
       boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->cancel();
   });
index 1656d7f..0e9683f 100644 (file)
@@ -19,7 +19,7 @@ namespace s4u {
 ConditionVariablePtr ConditionVariable::create()
 {
   kernel::activity::ConditionVariableImpl* cond =
-      simix::simcall([] { return new kernel::activity::ConditionVariableImpl(); });
+      kernel::actor::simcall([] { return new kernel::activity::ConditionVariableImpl(); });
   return ConditionVariablePtr(&cond->cond_, false);
 }
 
@@ -67,12 +67,12 @@ std::cv_status ConditionVariable::wait_until(std::unique_lock<Mutex>& lock, doub
  */
 void ConditionVariable::notify_one()
 {
-  simgrid::simix::simcall([this]() { cond_->signal(); });
+  simgrid::kernel::actor::simcall([this]() { cond_->signal(); });
 }
 
 void ConditionVariable::notify_all()
 {
-  simgrid::simix::simcall([this]() { cond_->broadcast(); });
+  simgrid::kernel::actor::simcall([this]() { cond_->broadcast(); });
 }
 
 void intrusive_ptr_add_ref(ConditionVariable* cond)
@@ -92,7 +92,7 @@ void intrusive_ptr_release(ConditionVariable* cond)
 sg_cond_t sg_cond_init()
 {
   simgrid::kernel::activity::ConditionVariableImpl* cond =
-      simgrid::simix::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
+      simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
 
   return new simgrid::s4u::ConditionVariable(cond);
 }
index 0c124e0..64cb7f6 100644 (file)
@@ -351,7 +351,7 @@ std::vector<kernel::routing::NetPoint*> Engine::get_all_netpoints()
 /** @brief Register a new netpoint to the system */
 void Engine::netpoint_register(kernel::routing::NetPoint* point)
 {
-  // simgrid::simix::simcall([&]{ FIXME: this segfaults in set_thread
+  // simgrid::kernel::actor::simcall([&]{ FIXME: this segfaults in set_thread
   pimpl->netpoints_[point->get_name()] = point;
   // });
 }
@@ -359,7 +359,7 @@ void Engine::netpoint_register(kernel::routing::NetPoint* point)
 /** @brief Unregister a given netpoint */
 void Engine::netpoint_unregister(kernel::routing::NetPoint* point)
 {
-  simix::simcall([this, point] {
+  kernel::actor::simcall([this, point] {
     pimpl->netpoints_.erase(point->get_name());
     delete point;
   });
index 17fa93c..48d7d4d 100644 (file)
@@ -63,7 +63,7 @@ int Exec::wait_any_for(std::vector<ExecPtr>* execs, double timeout)
 
 Exec* Exec::cancel()
 {
-  simix::simcall([this] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->cancel(); });
+  kernel::actor::simcall([this] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->cancel(); });
   state_ = State::CANCELED;
   return this;
 }
@@ -134,7 +134,7 @@ ExecSeq::ExecSeq(sg_host_t host, double flops_amount) : Exec(), flops_amount_(fl
 
 Exec* ExecSeq::start()
 {
-  simix::simcall([this] {
+  kernel::actor::simcall([this] {
     (*boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_))
         .set_name(name_)
         .set_tracing_category(tracing_category_)
@@ -173,7 +173,7 @@ Host* ExecSeq::get_host()
 /** @brief Returns the amount of flops that remain to be done */
 double ExecSeq::get_remaining()
 {
-  return simgrid::simix::simcall(
+  return simgrid::kernel::actor::simcall(
       [this]() { return boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->get_remaining(); });
 }
 
@@ -183,7 +183,7 @@ double ExecSeq::get_remaining()
  */
 double ExecSeq::get_remaining_ratio()
 {
-  return simgrid::simix::simcall([this]() {
+  return simgrid::kernel::actor::simcall([this]() {
     return boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->get_seq_remaining_ratio();
   });
 }
@@ -197,7 +197,7 @@ ExecPar::ExecPar(const std::vector<s4u::Host*>& hosts, const std::vector<double>
 
 Exec* ExecPar::start()
 {
-  simix::simcall([this] {
+  kernel::actor::simcall([this] {
     (*boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_))
         .set_hosts(hosts_)
         .set_timeout(timeout_)
@@ -212,7 +212,7 @@ Exec* ExecPar::start()
 
 double ExecPar::get_remaining_ratio()
 {
-  return simix::simcall(
+  return kernel::actor::simcall(
       [this]() { return boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->get_par_remaining_ratio(); });
 }
 
index db85aa3..29eb24b 100644 (file)
@@ -87,7 +87,7 @@ Host* Host::current()
 void Host::turn_on()
 {
   if (not is_on()) {
-    simix::simcall([this] {
+    kernel::actor::simcall([this] {
       this->pimpl_cpu->turn_on();
       this->pimpl_->turn_on();
       on_state_change(*this);
@@ -99,7 +99,7 @@ void Host::turn_on()
 void Host::turn_off()
 {
   if (is_on()) {
-    simix::simcall([this] {
+    kernel::actor::simcall([this] {
       for (VirtualMachine* const& vm : vm::VirtualMachineImpl::allVms_)
         if (vm->get_pm() == this) {
           vm->shutdown();
@@ -199,19 +199,19 @@ const char* Host::get_property(const std::string& key) const
 
 void Host::set_property(const std::string& key, const std::string& value)
 {
-  simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
 }
 
 void Host::set_properties(const std::map<std::string, std::string>& properties)
 {
-  simix::simcall([this, &properties] { this->pimpl_->set_properties(properties); });
+  kernel::actor::simcall([this, &properties] { this->pimpl_->set_properties(properties); });
 }
 
 /** Specify a profile turning the host on and off according to a exhaustive list or a stochastic law.
  * The profile must contain boolean values. */
 void Host::set_state_profile(kernel::profile::Profile* p)
 {
-  return simix::simcall([this, p] { pimpl_cpu->set_state_profile(p); });
+  return kernel::actor::simcall([this, p] { pimpl_cpu->set_state_profile(p); });
 }
 /** Specify a profile modeling the external load according to a exhaustive list or a stochastic law.
  *
@@ -221,7 +221,7 @@ void Host::set_state_profile(kernel::profile::Profile* p)
  */
 void Host::set_speed_profile(kernel::profile::Profile* p)
 {
-  return simix::simcall([this, p] { pimpl_cpu->set_speed_profile(p); });
+  return kernel::actor::simcall([this, p] { pimpl_cpu->set_speed_profile(p); });
 }
 
 /** @brief Get the peak processor speed (in flops/s), at the specified pstate  */
@@ -276,7 +276,7 @@ int Host::get_core_count() const
 /** @brief Set the pstate at which the host should run */
 void Host::set_pstate(int pstate_index)
 {
-  simix::simcall([this, pstate_index] { this->pimpl_cpu->set_pstate(pstate_index); });
+  kernel::actor::simcall([this, pstate_index] { this->pimpl_cpu->set_pstate(pstate_index); });
 }
 /** @brief Retrieve the pstate at which the host is currently running */
 int Host::get_pstate() const
@@ -291,7 +291,7 @@ int Host::get_pstate() const
  */
 std::vector<const char*> Host::get_attached_storages() const
 {
-  return simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
+  return kernel::actor::simcall([this] { return this->pimpl_->get_attached_storages(); });
 }
 
 std::unordered_map<std::string, Storage*> const& Host::get_mounted_storages()
index 7a89c7b..924dfec 100644 (file)
@@ -21,7 +21,7 @@ Io::Io(sg_storage_t storage, sg_size_t size, OpType type) : storage_(storage), s
 
 Io* Io::start()
 {
-  simix::simcall([this] {
+  kernel::actor::simcall([this] {
     (*boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_))
         .set_name(name_)
         .set_storage(storage_->get_impl())
@@ -35,7 +35,7 @@ Io* Io::start()
 
 Io* Io::cancel()
 {
-  simgrid::simix::simcall([this] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->cancel(); });
+  simgrid::kernel::actor::simcall([this] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->cancel(); });
   state_ = State::CANCELED;
   return this;
 }
@@ -70,13 +70,13 @@ bool Io::test()
 /** @brief Returns the amount of flops that remain to be done */
 double Io::get_remaining()
 {
-  return simix::simcall(
+  return kernel::actor::simcall(
       [this]() { return boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->get_remaining(); });
 }
 
 sg_size_t Io::get_performed_ioops()
 {
-  return simix::simcall(
+  return kernel::actor::simcall(
       [this]() { return boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->get_performed_ioops(); });
 }
 
index 866436c..4fecbd4 100644 (file)
@@ -71,11 +71,11 @@ double Link::get_usage()
 
 void Link::turn_on()
 {
-  simgrid::simix::simcall([this]() { this->pimpl_->turn_on(); });
+  simgrid::kernel::actor::simcall([this]() { this->pimpl_->turn_on(); });
 }
 void Link::turn_off()
 {
-  simgrid::simix::simcall([this]() { this->pimpl_->turn_off(); });
+  simgrid::kernel::actor::simcall([this]() { this->pimpl_->turn_off(); });
 }
 
 bool Link::is_on() const
@@ -89,20 +89,20 @@ void* Link::get_data()
 }
 void Link::set_data(void* d)
 {
-  simgrid::simix::simcall([this, d]() { this->pimpl_->set_data(d); });
+  simgrid::kernel::actor::simcall([this, d]() { this->pimpl_->set_data(d); });
 }
 
 void Link::set_state_profile(kernel::profile::Profile* profile)
 {
-  simgrid::simix::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
+  simgrid::kernel::actor::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
 }
 void Link::set_bandwidth_profile(kernel::profile::Profile* profile)
 {
-  simgrid::simix::simcall([this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
+  simgrid::kernel::actor::simcall([this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
 }
 void Link::set_latency_profile(kernel::profile::Profile* trace)
 {
-  simgrid::simix::simcall([this, trace]() { this->pimpl_->set_latency_profile(trace); });
+  simgrid::kernel::actor::simcall([this, trace]() { this->pimpl_->set_latency_profile(trace); });
 }
 
 const char* Link::get_property(const std::string& key) const
@@ -111,7 +111,7 @@ const char* Link::get_property(const std::string& key) const
 }
 void Link::set_property(const std::string& key, const std::string& value)
 {
-  simgrid::simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  simgrid::kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
 }
 } // namespace s4u
 } // namespace simgrid
index baa91b8..d9d6c6c 100644 (file)
@@ -29,7 +29,7 @@ Mailbox* Mailbox::by_name(const std::string& name)
 {
   kernel::activity::MailboxImpl* mbox = kernel::activity::MailboxImpl::by_name_or_null(name);
   if (mbox == nullptr) {
-    mbox = simix::simcall([&name] { return kernel::activity::MailboxImpl::by_name_or_create(name); });
+    mbox = kernel::actor::simcall([&name] { return kernel::activity::MailboxImpl::by_name_or_create(name); });
   }
   return &mbox->piface_;
 }
@@ -63,7 +63,7 @@ kernel::activity::CommImplPtr Mailbox::front()
 
 void Mailbox::set_receiver(ActorPtr actor)
 {
-  simix::simcall([this, actor]() { this->pimpl_->set_receiver(actor); });
+  kernel::actor::simcall([this, actor]() { this->pimpl_->set_receiver(actor); });
 }
 
 /** @brief get the receiver (process associated to the mailbox) */
@@ -152,7 +152,7 @@ void* Mailbox::get(double timeout)
 
 smx_activity_t Mailbox::iprobe(int type, int (*match_fun)(void*, void*, kernel::activity::CommImpl*), void* data)
 {
-  return simix::simcall([this, type, match_fun, data] { return pimpl_->iprobe(type, match_fun, data); });
+  return kernel::actor::simcall([this, type, match_fun, data] { return pimpl_->iprobe(type, match_fun, data); });
 }
 } // namespace s4u
 } // namespace simgrid
index 95658bb..6494276 100644 (file)
@@ -44,7 +44,7 @@ bool Mutex::try_lock()
  */
 MutexPtr Mutex::create()
 {
-  kernel::activity::MutexImpl* mutex = simix::simcall([] { return new kernel::activity::MutexImpl(); });
+  kernel::activity::MutexImpl* mutex = kernel::actor::simcall([] { return new kernel::activity::MutexImpl(); });
   return MutexPtr(&mutex->mutex(), false);
 }
 
@@ -69,7 +69,7 @@ void intrusive_ptr_release(Mutex* mutex)
 sg_mutex_t sg_mutex_init()
 {
   simgrid::kernel::activity::MutexImpl* mutex =
-      simgrid::simix::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
+      simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
 
   return new simgrid::s4u::Mutex(mutex);
 }
index 1576fae..dec17ec 100644 (file)
@@ -35,7 +35,7 @@ const char* NetZone::get_property(const std::string& key) const
 
 void NetZone::set_property(const std::string& key, const std::string& value)
 {
-  simix::simcall([this, &key, &value] { properties_[key] = value; });
+  kernel::actor::simcall([this, &key, &value] { properties_[key] = value; });
 }
 
 /** @brief Returns the list of direct children (no grand-children) */
index 8476633..debf3ec 100644 (file)
@@ -15,7 +15,7 @@ namespace s4u {
 
 Semaphore::Semaphore(unsigned int initial_capacity)
 {
-  sem_ = simix::simcall([initial_capacity] { return new kernel::activity::SemaphoreImpl(initial_capacity); });
+  sem_ = kernel::actor::simcall([initial_capacity] { return new kernel::activity::SemaphoreImpl(initial_capacity); });
 }
 
 Semaphore::~Semaphore()
@@ -43,17 +43,17 @@ int Semaphore::acquire_timeout(double timeout)
 
 void Semaphore::release()
 {
-  simix::simcall([this] { sem_->release(); });
+  kernel::actor::simcall([this] { sem_->release(); });
 }
 
 int Semaphore::get_capacity()
 {
-  return simix::simcall([this] { return sem_->get_capacity(); });
+  return kernel::actor::simcall([this] { return sem_->get_capacity(); });
 }
 
 int Semaphore::would_block()
 {
-  return simix::simcall([this] { return sem_->would_block(); });
+  return kernel::actor::simcall([this] { return sem_->would_block(); });
 }
 
 void intrusive_ptr_add_ref(Semaphore* sem)
index 8de6680..08ad078 100644 (file)
@@ -53,7 +53,7 @@ const char* Storage::get_property(const std::string& key) const
 
 void Storage::set_property(const std::string& key, const std::string& value)
 {
-  simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
 }
 
 IoPtr Storage::io_init(sg_size_t size, Io::OpType type)
index 70b4014..4a0aa0e 100644 (file)
@@ -155,7 +155,7 @@ smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type,
 {
   xbt_assert(mbox, "No rendez-vous point defined for iprobe");
 
-  return simgrid::simix::simcall([mbox, type, match_fun, data] { return mbox->iprobe(type, match_fun, data); });
+  return simgrid::kernel::actor::simcall([mbox, type, match_fun, data] { return mbox->iprobe(type, match_fun, data); });
 }
 
 /**
@@ -225,7 +225,7 @@ smx_mutex_t simcall_mutex_init()
                                                                                  // get there before the initialization
     xbt_abort();
   }
-  return simgrid::simix::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
+  return simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
 }
 
 /**
@@ -261,7 +261,7 @@ void simcall_mutex_unlock(smx_mutex_t mutex)
  */
 smx_cond_t simcall_cond_init()
 {
-  return simgrid::simix::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
+  return simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
 }
 
 /**
@@ -342,20 +342,22 @@ void unblock(smx_actor_t actor)
 /* ****************************DEPRECATED CALLS******************************* */
 void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
 {
-  simgrid::simix::simcall([process, kill_time] { process->set_kill_time(kill_time); });
+  simgrid::kernel::actor::simcall([process, kill_time] { process->set_kill_time(kill_time); });
 }
 void simcall_comm_cancel(smx_activity_t comm)
 {
-  simgrid::simix::simcall([comm] { boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(comm)->cancel(); });
+  simgrid::kernel::actor::simcall(
+      [comm] { boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(comm)->cancel(); });
 }
 void simcall_execution_cancel(smx_activity_t exec)
 {
-  simgrid::simix::simcall([exec] { boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->cancel(); });
+  simgrid::kernel::actor::simcall(
+      [exec] { boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->cancel(); });
 }
 
 void simcall_execution_set_bound(smx_activity_t exec, double bound)
 {
-  simgrid::simix::simcall(
+  simgrid::kernel::actor::simcall(
       [exec, bound] { boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->set_bound(bound); });
 }
 
@@ -363,7 +365,7 @@ void simcall_execution_set_bound(smx_activity_t exec, double bound)
 smx_activity_t simcall_execution_start(const std::string& name, const std::string& category, double flops_amount,
                                        double sharing_penalty, double bound, sg_host_t host)
 {
-  return simgrid::simix::simcall([name, category, flops_amount, sharing_penalty, bound, host] {
+  return simgrid::kernel::actor::simcall([name, category, flops_amount, sharing_penalty, bound, host] {
     simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl();
     (*exec)
         .set_name(name)
@@ -409,7 +411,7 @@ smx_activity_t simcall_execution_parallel_start(const std::string& name, int hos
     flops_parallel_amount = std::vector<double>(flops_amount, flops_amount + host_nb);
   if (bytes_amount != nullptr)
     bytes_parallel_amount = std::vector<double>(bytes_amount, bytes_amount + host_nb * host_nb);
-  return simgrid::simix::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] {
+  return simgrid::kernel::actor::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] {
     simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl();
     (*exec)
         .set_name(name)
index c05c46d..663ac17 100644 (file)
@@ -124,7 +124,7 @@ int PMPI_Abort(MPI_Comm /*comm*/, int /*errorcode*/)
   smpi_bench_end();
   // FIXME: should kill all processes in comm instead
   smx_actor_t actor = SIMIX_process_self();
-  simgrid::simix::simcall([actor] { actor->exit(); });
+  simgrid::kernel::actor::simcall([actor] { actor->exit(); });
   return MPI_SUCCESS;
 }
 
index 74cdbbe..758b519 100644 (file)
@@ -35,7 +35,7 @@ static void master()
 {
   // Test the simple immediate execution:
   XBT_INFO("Start");
-  simgrid::simix::simcall([] { XBT_INFO("kernel"); });
+  simgrid::kernel::actor::simcall([] { XBT_INFO("kernel"); });
   XBT_INFO("kernel, returned");
 
   // Synchronize on a successful Future<void>: