Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename sg::k::actor::simcall ::actor::simcall_answered
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 27 Feb 2022 22:04:00 +0000 (23:04 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 27 Feb 2022 22:24:04 +0000 (23:24 +0100)
26 files changed:
include/simgrid/simix.hpp
src/kernel/actor/ActorImpl.cpp
src/mc/mc_base.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/plugins/host_energy.cpp
src/plugins/link_energy.cpp
src/s4u/s4u_Activity.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_ConditionVariable.cpp
src/s4u/s4u_Disk.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_VirtualMachine.cpp
src/simix/libsmx.cpp
src/smpi/bindings/smpi_pmpi.cpp
src/smpi/mpi/smpi_request.cpp
teshsuite/kernel/simcall-generic/blocking_simcall.hpp
teshsuite/kernel/simcall-generic/simcall-generic.cpp

index c990263..76e1f8f 100644 (file)
@@ -15,8 +15,8 @@
 #include <string>
 #include <unordered_map>
 
-XBT_PUBLIC void simcall_run_kernel(std::function<void()> const& code,
-                                   simgrid::kernel::actor::SimcallObserver* observer);
+XBT_PUBLIC void simcall_run_answered(std::function<void()> const& code,
+                                     simgrid::kernel::actor::SimcallObserver* observer);
 XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code,
                                      simgrid::kernel::actor::SimcallObserver* observer);
 
@@ -43,7 +43,7 @@ namespace actor {
  * you may need to wait for that mutex to be unlocked by its current owner.
  * Potentially blocking simcall must be issued using simcall_blocking(), right below in this file.
  */
-template <class F> typename std::result_of_t<F()> simcall(F&& code, SimcallObserver* observer = nullptr)
+template <class F> typename std::result_of_t<F()> simcall_answered(F&& code, SimcallObserver* observer = nullptr)
 {
   // If we are in the maestro, we take the fast path and execute the
   // code directly without simcall marshalling/unmarshalling/dispatch:
@@ -55,7 +55,7 @@ template <class F> typename std::result_of_t<F()> simcall(F&& code, SimcallObser
   // conveniently handles the success/failure value for us.
   using R = typename std::result_of_t<F()>;
   simgrid::xbt::Result<R> result;
-  simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); }, observer);
+  simcall_run_answered([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); }, observer);
   return result.get();
 }
 
index 4e12056..a6fef78 100644 (file)
@@ -189,7 +189,7 @@ void ActorImpl::cleanup()
   cleanup_from_simix();
 
   context_->set_wannadie(false); // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
-  actor::simcall([this] { s4u::Actor::on_termination(*get_ciface()); });
+  actor::simcall_answered([this] { s4u::Actor::on_termination(*get_ciface()); });
   context_->set_wannadie();
 }
 
index 9ecb0de..6ffa2c5 100644 (file)
@@ -34,7 +34,7 @@ int MC_random(int min, int max)
     return prng.uniform_int(min, max);
   }
   simgrid::kernel::actor::RandomSimcall observer{simgrid::kernel::actor::ActorImpl::self(), min, max};
-  return simgrid::kernel::actor::simcall([&observer] { return observer.get_value(); }, &observer);
+  return simgrid::kernel::actor::simcall_answered([&observer] { return observer.get_value(); }, &observer);
 }
 
 namespace simgrid {
index 51d3ccc..75686e5 100644 (file)
@@ -71,7 +71,7 @@ File::File(const std::string& fullpath, void* userdata) : File(fullpath, Host::c
 
 File::File(const std::string& fullpath, const_sg_host_t host, void* userdata) : fullpath_(fullpath)
 {
-  kernel::actor::simcall([this, &host, userdata] {
+  kernel::actor::simcall_answered([this, &host, userdata] {
     this->set_data(userdata);
     // this cannot fail because we get a xbt_die if the mountpoint does not exist
     local_disk_ = find_local_disk_on(host);
@@ -108,7 +108,7 @@ File::~File()
 {
   std::vector<int>* desc_table =
       Host::current()->extension<simgrid::s4u::FileDescriptorHostExt>()->file_descriptor_table.get();
-  kernel::actor::simcall([this, desc_table] { desc_table->push_back(this->desc_id); });
+  kernel::actor::simcall_answered([this, desc_table] { desc_table->push_back(this->desc_id); });
 }
 
 File* File::open(const std::string& fullpath, void* userdata)
@@ -193,7 +193,7 @@ sg_size_t File::write(sg_size_t size, bool write_inside)
     if (current_position_ > size_)
       size_ = current_position_;
   }
-  kernel::actor::simcall([this] {
+  kernel::actor::simcall_answered([this] {
     std::map<std::string, sg_size_t, std::less<>>* content = local_disk_->extension<FileSystemDiskExt>()->get_content();
 
     content->erase(path_);
@@ -379,12 +379,12 @@ std::map<std::string, sg_size_t, std::less<>>* FileSystemDiskExt::parse_content(
 
 void FileSystemDiskExt::decr_used_size(sg_size_t size)
 {
-  simgrid::kernel::actor::simcall([this, size] { used_size_ -= size; });
+  simgrid::kernel::actor::simcall_answered([this, size] { used_size_ -= size; });
 }
 
 void FileSystemDiskExt::incr_used_size(sg_size_t size)
 {
-  simgrid::kernel::actor::simcall([this, size] { used_size_ += size; });
+  simgrid::kernel::actor::simcall_answered([this, size] { used_size_ += size; });
 }
 }
 }
index 4fbb275..ef191bf 100644 (file)
@@ -333,7 +333,7 @@ double HostEnergy::get_current_watts_value(double cpu_load) const
 double HostEnergy::get_consumed_energy()
 {
   if (last_updated_ < simgrid::s4u::Engine::get_clock()) // We need to simcall this as it modifies the environment
-    simgrid::kernel::actor::simcall(std::bind(&HostEnergy::update, this));
+    simgrid::kernel::actor::simcall_answered(std::bind(&HostEnergy::update, this));
 
   return total_energy_;
 }
@@ -509,7 +509,7 @@ void sg_host_energy_plugin_init()
  */
 void sg_host_energy_update_all()
 {
-  simgrid::kernel::actor::simcall([]() {
+  simgrid::kernel::actor::simcall_answered([]() {
     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 23f6de0..5046420 100644 (file)
@@ -138,7 +138,7 @@ double LinkEnergy::get_power() const
 double LinkEnergy::get_consumed_energy()
 {
   if (last_updated_ < simgrid::s4u::Engine::get_clock()) // We need to simcall this as it modifies the environment
-    kernel::actor::simcall(std::bind(&LinkEnergy::update, this));
+    kernel::actor::simcall_answered(std::bind(&LinkEnergy::update, this));
   return this->total_energy_;
 }
 } // namespace plugin
index 15111b8..dcc650d 100644 (file)
@@ -84,7 +84,8 @@ bool Activity::test()
 
   kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
   kernel::actor::ActivityTestSimcall observer{issuer, pimpl_.get()};
-  if (kernel::actor::simcall([&observer] { return observer.get_activity()->test(observer.get_issuer()); }, &observer)) {
+  if (kernel::actor::simcall_answered([&observer] { return observer.get_activity()->test(observer.get_issuer()); },
+                                      &observer)) {
     complete(State::FINISHED);
     return true;
   }
@@ -99,7 +100,7 @@ ssize_t Activity::test_any(const std::vector<ActivityPtr>& activities)
 
   kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
   kernel::actor::ActivityTestanySimcall observer{issuer, ractivities};
-  ssize_t changed_pos = kernel::actor::simcall(
+  ssize_t changed_pos = kernel::actor::simcall_answered(
       [&observer] {
         return kernel::activity::ActivityImpl::test_any(observer.get_issuer(), observer.get_activities());
       },
@@ -130,7 +131,7 @@ ssize_t Activity::wait_any_for(const std::vector<ActivityPtr>& activities, doubl
 
 Activity* Activity::cancel()
 {
-  kernel::actor::simcall([this] {
+  kernel::actor::simcall_answered([this] {
     XBT_HERE();
     if (pimpl_)
       pimpl_->cancel();
index 576f0b1..605a4c6 100644 (file)
@@ -51,7 +51,7 @@ ActorPtr Actor::init(const std::string& name, s4u::Host* host)
 {
   const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::ActorImpl* actor =
-      kernel::actor::simcall([self, &name, host] { return self->init(name, host).get(); });
+      kernel::actor::simcall_answered([self, &name, host] { return self->init(name, host).get(); });
   return actor->get_iface();
 }
 
@@ -66,7 +66,7 @@ ActorPtr Actor::set_stacksize(unsigned stacksize)
 
 ActorPtr Actor::start(const std::function<void()>& code)
 {
-  simgrid::kernel::actor::simcall([this, &code] { pimpl_->start(code); });
+  simgrid::kernel::actor::simcall_answered([this, &code] { pimpl_->start(code); });
   return this;
 }
 
@@ -74,7 +74,7 @@ ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::func
 {
   const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::ActorImpl* actor =
-      kernel::actor::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
+      kernel::actor::simcall_answered([self, &name, host, &code] { return self->init(name, host)->start(code); });
 
   return actor->get_iface();
 }
@@ -124,7 +124,7 @@ void Actor::join(double timeout) const
 
 Actor* Actor::set_auto_restart(bool autorestart)
 {
-  kernel::actor::simcall([this, autorestart]() {
+  kernel::actor::simcall_answered([this, autorestart]() {
     xbt_assert(autorestart && not pimpl_->has_to_auto_restart()); // FIXME: handle all cases
     pimpl_->set_auto_restart(autorestart);
 
@@ -137,14 +137,14 @@ Actor* Actor::set_auto_restart(bool autorestart)
 
 void Actor::on_exit(const std::function<void(bool /*failed*/)>& fun) const
 {
-  kernel::actor::simcall([this, &fun] { pimpl_->on_exit->emplace_back(fun); });
+  kernel::actor::simcall_answered([this, &fun] { pimpl_->on_exit->emplace_back(fun); });
 }
 
 void Actor::set_host(Host* new_host)
 {
   const s4u::Host* previous_location = get_host();
 
-  kernel::actor::simcall([this, new_host]() {
+  kernel::actor::simcall_answered([this, new_host]() {
     for (auto const& activity : pimpl_->activities_) {
       // FIXME: implement the migration of other kinds of activities
       if (auto exec = boost::dynamic_pointer_cast<kernel::activity::ExecImpl>(activity))
@@ -163,7 +163,7 @@ s4u::Host* Actor::get_host() const
 
 Actor* Actor::daemonize()
 {
-  kernel::actor::simcall([this]() { pimpl_->daemonize(); });
+  kernel::actor::simcall_answered([this]() { pimpl_->daemonize(); });
   return this;
 }
 
@@ -214,7 +214,7 @@ void Actor::suspend()
 
 void Actor::resume()
 {
-  kernel::actor::simcall([this] { pimpl_->resume(); });
+  kernel::actor::simcall_answered([this] { pimpl_->resume(); });
   s4u::Actor::on_resume(*this);
 }
 
@@ -225,7 +225,7 @@ bool Actor::is_suspended() const
 
 void Actor::set_kill_time(double kill_time)
 {
-  kernel::actor::simcall([this, kill_time] { pimpl_->set_kill_time(kill_time); });
+  kernel::actor::simcall_answered([this, kill_time] { pimpl_->set_kill_time(kill_time); });
 }
 
 /** @brief Get the kill time of an actor(or 0 if unset). */
@@ -237,7 +237,7 @@ double Actor::get_kill_time() const
 void Actor::kill()
 {
   const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
-  kernel::actor::simcall([this, self] { self->kill(pimpl_); });
+  kernel::actor::simcall_answered([this, self] { self->kill(pimpl_); });
 }
 
 // ***** Static functions *****
@@ -254,7 +254,7 @@ ActorPtr Actor::by_pid(aid_t pid)
 void Actor::kill_all()
 {
   const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
-  kernel::actor::simcall([self] { self->kill_all(); });
+  kernel::actor::simcall_answered([self] { self->kill_all(); });
 }
 
 const std::unordered_map<std::string, std::string>* Actor::get_properties() const
@@ -270,12 +270,12 @@ const char* Actor::get_property(const std::string& key) const
 
 void Actor::set_property(const std::string& key, const std::string& value)
 {
-  kernel::actor::simcall([this, &key, &value] { pimpl_->set_property(key, value); });
+  kernel::actor::simcall_answered([this, &key, &value] { pimpl_->set_property(key, value); });
 }
 
 Actor* Actor::restart()
 {
-  return kernel::actor::simcall([this]() { return pimpl_->restart(); });
+  return kernel::actor::simcall_answered([this]() { return pimpl_->restart(); });
 }
 
 // ***** this_actor *****
@@ -332,7 +332,7 @@ void sleep_for(double duration)
 
 void yield()
 {
-  kernel::actor::simcall([] { /* do nothing*/ });
+  kernel::actor::simcall_answered([] { /* do nothing*/ });
 }
 
 XBT_PUBLIC void sleep_until(double wakeup_time)
@@ -431,7 +431,7 @@ void suspend()
 void exit()
 {
   kernel::actor::ActorImpl* self = simgrid::kernel::actor::ActorImpl::self();
-  simgrid::kernel::actor::simcall([self] { self->exit(); });
+  simgrid::kernel::actor::simcall_answered([self] { self->exit(); });
   THROW_IMPOSSIBLE;
 }
 
index e834664..69421d9 100644 (file)
@@ -212,7 +212,7 @@ Comm* Comm::start()
     xbt_assert(from_ != nullptr && to_ != nullptr, "When either from_ or to_ is specified, both must be.");
     xbt_assert(src_buff_ == nullptr && dst_buff_ == nullptr,
                "Direct host-to-host communications cannot carry any data.");
-    pimpl_ = kernel::actor::simcall([this] {
+    pimpl_ = kernel::actor::simcall_answered([this] {
       kernel::activity::CommImplPtr res(new kernel::activity::CommImpl(this->from_, this->to_, this->get_remaining()));
       res->start();
       return res;
@@ -231,7 +231,8 @@ Comm* Comm::start()
                                              copy_data_function_,
                                              get_data<void>(),
                                              detached_};
-    pimpl_ = kernel::actor::simcall([&observer] { return kernel::activity::CommImpl::isend(&observer); }, &observer);
+    pimpl_ = kernel::actor::simcall_answered([&observer] { return kernel::activity::CommImpl::isend(&observer); },
+                                             &observer);
   } else if (dst_buff_ != nullptr) { // Receiver side
     xbt_assert(not detached_, "Receive cannot be detached");
     on_recv(*this);
@@ -243,7 +244,8 @@ Comm* Comm::start()
                                              copy_data_function_,
                                              get_data<void>(),
                                              rate_};
-    pimpl_ = kernel::actor::simcall([&observer] { return kernel::activity::CommImpl::irecv(&observer); }, &observer);
+    pimpl_ = kernel::actor::simcall_answered([&observer] { return kernel::activity::CommImpl::irecv(&observer); },
+                                             &observer);
   } else {
     xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver");
   }
index 1e654dd..6ad846c 100644 (file)
@@ -18,7 +18,7 @@ namespace s4u {
 ConditionVariablePtr ConditionVariable::create()
 {
   kernel::activity::ConditionVariableImpl* cond =
-      kernel::actor::simcall([] { return new kernel::activity::ConditionVariableImpl(); });
+      kernel::actor::simcall_answered([] { return new kernel::activity::ConditionVariableImpl(); });
   return ConditionVariablePtr(cond->get_iface(), false);
 }
 
@@ -77,12 +77,12 @@ std::cv_status ConditionVariable::wait_until(const std::unique_lock<Mutex>& lock
  */
 void ConditionVariable::notify_one()
 {
-  simgrid::kernel::actor::simcall([this]() { pimpl_->signal(); });
+  simgrid::kernel::actor::simcall_answered([this]() { pimpl_->signal(); });
 }
 
 void ConditionVariable::notify_all()
 {
-  simgrid::kernel::actor::simcall([this]() { pimpl_->broadcast(); });
+  simgrid::kernel::actor::simcall_answered([this]() { pimpl_->broadcast(); });
 }
 
 void intrusive_ptr_add_ref(const ConditionVariable* cond)
index b95164d..fa64f72 100644 (file)
@@ -31,13 +31,13 @@ const char* Disk::get_cname() const
 
 Disk* Disk::set_read_bandwidth(double read_bw)
 {
-  kernel::actor::simcall([this, read_bw] { pimpl_->set_read_bandwidth(read_bw); });
+  kernel::actor::simcall_answered([this, read_bw] { pimpl_->set_read_bandwidth(read_bw); });
   return this;
 }
 
 Disk* Disk::set_write_bandwidth(double write_bw)
 {
-  kernel::actor::simcall([this, write_bw] { pimpl_->set_write_bandwidth(write_bw); });
+  kernel::actor::simcall_answered([this, write_bw] { pimpl_->set_write_bandwidth(write_bw); });
   return this;
 }
 
@@ -48,7 +48,7 @@ double Disk::get_read_bandwidth() const
 
 Disk* Disk::set_readwrite_bandwidth(double bw)
 {
-  kernel::actor::simcall([this, bw] { pimpl_->set_readwrite_bandwidth(bw); });
+  kernel::actor::simcall_answered([this, bw] { pimpl_->set_readwrite_bandwidth(bw); });
   return this;
 }
 
@@ -80,34 +80,34 @@ const char* Disk::get_property(const std::string& key) const
 
 Disk* Disk::set_property(const std::string& key, const std::string& value)
 {
-  kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  kernel::actor::simcall_answered([this, &key, &value] { this->pimpl_->set_property(key, value); });
   return this;
 }
 
 Disk* Disk::set_properties(const std::unordered_map<std::string, std::string>& properties)
 {
-  kernel::actor::simcall([this, properties] { this->pimpl_->set_properties(properties); });
+  kernel::actor::simcall_answered([this, properties] { this->pimpl_->set_properties(properties); });
   return this;
 }
 
 Disk* Disk::set_state_profile(kernel::profile::Profile* profile)
 {
   xbt_assert(not pimpl_->is_sealed(), "Cannot set a state profile once the Disk is sealed");
-  kernel::actor::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
+  kernel::actor::simcall_answered([this, profile]() { this->pimpl_->set_state_profile(profile); });
   return this;
 }
 
 Disk* Disk::set_read_bandwidth_profile(kernel::profile::Profile* profile)
 {
   xbt_assert(not pimpl_->is_sealed(), "Cannot set a bandwidth profile once the Disk is sealed");
-  kernel::actor::simcall([this, profile]() { this->pimpl_->set_read_bandwidth_profile(profile); });
+  kernel::actor::simcall_answered([this, profile]() { this->pimpl_->set_read_bandwidth_profile(profile); });
   return this;
 }
 
 Disk* Disk::set_write_bandwidth_profile(kernel::profile::Profile* profile)
 {
   xbt_assert(not pimpl_->is_sealed(), "Cannot set a bandwidth profile once the Disk is sealed");
-  kernel::actor::simcall([this, profile]() { this->pimpl_->set_write_bandwidth_profile(profile); });
+  kernel::actor::simcall_answered([this, profile]() { this->pimpl_->set_write_bandwidth_profile(profile); });
   return this;
 }
 
@@ -156,7 +156,7 @@ sg_size_t Disk::write(sg_size_t size, double priority) const
 
 Disk* Disk::set_sharing_policy(Disk::Operation op, Disk::SharingPolicy policy, const NonLinearResourceCb& cb)
 {
-  kernel::actor::simcall([this, op, policy, &cb] { pimpl_->set_sharing_policy(op, policy, cb); });
+  kernel::actor::simcall_answered([this, op, policy, &cb] { pimpl_->set_sharing_policy(op, policy, cb); });
   return this;
 }
 
@@ -167,13 +167,13 @@ Disk::SharingPolicy Disk::get_sharing_policy(Operation op) const
 
 Disk* Disk::set_factor_cb(const std::function<IoFactorCb>& cb)
 {
-  kernel::actor::simcall([this, &cb] { pimpl_->set_factor_cb(cb); });
+  kernel::actor::simcall_answered([this, &cb] { pimpl_->set_factor_cb(cb); });
   return this;
 }
 
 Disk* Disk::seal()
 {
-  kernel::actor::simcall([this]{ pimpl_->seal(); });
+  kernel::actor::simcall_answered([this] { pimpl_->seal(); });
   Disk::on_creation(*this); // notify the signal
   return this;
 }
index 5fc537a..8baf07d 100644 (file)
@@ -94,7 +94,7 @@ double Engine::get_clock()
 void Engine::add_model(std::shared_ptr<kernel::resource::Model> model,
                        const std::vector<kernel::resource::Model*>& dependencies)
 {
-  kernel::actor::simcall([this, &model, &dependencies] { pimpl->add_model(std::move(model), dependencies); });
+  kernel::actor::simcall_answered([this, &model, &dependencies] { pimpl->add_model(std::move(model), dependencies); });
 }
 
 const std::vector<simgrid::kernel::resource::Model*>& Engine::get_all_models() const
@@ -152,12 +152,12 @@ void Engine::register_default(const std::function<void(int, char**)>& code)
 }
 void Engine::register_default(const kernel::actor::ActorCodeFactory& code)
 {
-  simgrid::kernel::actor::simcall([this, &code]() { pimpl->register_default(code); });
+  simgrid::kernel::actor::simcall_answered([this, &code]() { pimpl->register_default(code); });
 }
 
 void Engine::register_function(const std::string& name, const kernel::actor::ActorCodeFactory& code)
 {
-  simgrid::kernel::actor::simcall([this, name, &code]() { pimpl->register_function(name, code); });
+  simgrid::kernel::actor::simcall_answered([this, name, &code]() { pimpl->register_function(name, code); });
 }
 
 /** Load a deployment file and launch the actors that it contains
@@ -256,7 +256,7 @@ Link* Engine::link_by_name_or_null(const std::string& name) const
 Mailbox* Engine::mailbox_by_name_or_create(const std::string& name) const
 {
   /* two actors may have pushed the same mbox_create simcall at the same time */
-  kernel::activity::MailboxImpl* mbox = kernel::actor::simcall([&name, this] {
+  kernel::activity::MailboxImpl* mbox = kernel::actor::simcall_answered([&name, this] {
     auto m = pimpl->mailboxes_.emplace(name, nullptr);
     if (m.second) {
       m.first->second = new kernel::activity::MailboxImpl(name);
@@ -410,13 +410,13 @@ std::vector<kernel::routing::NetPoint*> Engine::get_all_netpoints() const
 /** @brief Register a new netpoint to the system */
 void Engine::netpoint_register(kernel::routing::NetPoint* point)
 {
-  simgrid::kernel::actor::simcall([this, point] { pimpl->netpoints_[point->get_name()] = point; });
+  simgrid::kernel::actor::simcall_answered([this, point] { pimpl->netpoints_[point->get_name()] = point; });
 }
 
 /** @brief Unregister a given netpoint */
 void Engine::netpoint_unregister(kernel::routing::NetPoint* point)
 {
-  kernel::actor::simcall([this, point] {
+  kernel::actor::simcall_answered([this, point] {
     pimpl->netpoints_.erase(point->get_name());
     delete point;
   });
index 14f8e74..8f5ec42 100644 (file)
@@ -44,7 +44,7 @@ ExecPtr Exec::init()
 
 Exec* Exec::start()
 {
-  kernel::actor::simcall([this] {
+  kernel::actor::simcall_answered([this] {
     (*boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_))
         .set_name(get_name())
         .set_tracing_category(get_tracing_category())
@@ -75,7 +75,7 @@ ExecPtr Exec::set_bound(double bound)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
              "Cannot change the bound of an exec after its start");
-  kernel::actor::simcall(
+  kernel::actor::simcall_answered(
       [this, bound] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_bound(bound); });
   return this;
 }
@@ -90,7 +90,7 @@ ExecPtr Exec::set_priority(double priority)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
              "Cannot change the priority of an exec after its start");
-  kernel::actor::simcall([this, priority] {
+  kernel::actor::simcall_answered([this, priority] {
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_sharing_penalty(1. / priority);
   });
   return this;
@@ -98,7 +98,7 @@ ExecPtr Exec::set_priority(double priority)
 
 ExecPtr Exec::update_priority(double priority)
 {
-  kernel::actor::simcall([this, priority] {
+  kernel::actor::simcall_answered([this, priority] {
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->update_sharing_penalty(1. / priority);
   });
   return this;
@@ -108,7 +108,7 @@ ExecPtr Exec::set_flops_amount(double flops_amount)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
       "Cannot change the flop_amount of an exec after its start");
-  kernel::actor::simcall([this, flops_amount] {
+  kernel::actor::simcall_answered([this, flops_amount] {
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_flops_amount(flops_amount);
   });
   Activity::set_remaining(flops_amount);
@@ -119,7 +119,7 @@ ExecPtr Exec::set_flops_amounts(const std::vector<double>& flops_amounts)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
       "Cannot change the flops_amounts of an exec after its start");
-  kernel::actor::simcall([this, flops_amounts] {
+  kernel::actor::simcall_answered([this, flops_amounts] {
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_flops_amounts(flops_amounts);
   });
   parallel_      = true;
@@ -130,7 +130,7 @@ ExecPtr Exec::set_bytes_amounts(const std::vector<double>& bytes_amounts)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
       "Cannot change the bytes_amounts of an exec after its start");
-  kernel::actor::simcall([this, bytes_amounts] {
+  kernel::actor::simcall_answered([this, bytes_amounts] {
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_bytes_amounts(bytes_amounts);
   });
   parallel_      = true;
@@ -160,7 +160,7 @@ ExecPtr Exec::set_host(Host* host)
   if (state_ == State::STARTED)
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->migrate(host);
 
-  kernel::actor::simcall(
+  kernel::actor::simcall_answered(
       [this, host] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_host(host); });
 
   if (state_ == State::STARTING)
@@ -175,7 +175,7 @@ ExecPtr Exec::set_hosts(const std::vector<Host*>& hosts)
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
              "Cannot change the hosts of an exec once it's done (state: %s)", to_c_str(state_));
 
-  kernel::actor::simcall(
+  kernel::actor::simcall_answered(
       [this, hosts] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_hosts(hosts); });
   parallel_ = true;
 
@@ -213,7 +213,7 @@ double Exec::get_remaining() const
     XBT_WARN("Calling get_remaining() on a parallel execution is not allowed. Call get_remaining_ratio() instead.");
     return get_remaining_ratio();
   } else
-    return kernel::actor::simcall(
+    return kernel::actor::simcall_answered(
         [this]() { return boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->get_remaining(); });
 }
 
@@ -224,10 +224,10 @@ double Exec::get_remaining() const
 double Exec::get_remaining_ratio() const
 {
   if (is_parallel())
-    return kernel::actor::simcall(
+    return kernel::actor::simcall_answered(
         [this]() { return boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->get_par_remaining_ratio(); });
   else
-    return kernel::actor::simcall(
+    return kernel::actor::simcall_answered(
         [this]() { return boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->get_seq_remaining_ratio(); });
 }
 
index f90eba1..d84f23e 100644 (file)
@@ -65,7 +65,7 @@ Host::~Host()
  */
 void Host::destroy()
 {
-  kernel::actor::simcall([this] { this->pimpl_->destroy(); });
+  kernel::actor::simcall_answered([this] { this->pimpl_->destroy(); });
 }
 
 Host* Host::by_name(const std::string& name)
@@ -97,7 +97,7 @@ const char* Host::get_cname() const
 void Host::turn_on()
 {
   if (not is_on()) {
-    kernel::actor::simcall([this] {
+    kernel::actor::simcall_answered([this] {
       this->pimpl_cpu_->turn_on();
       this->pimpl_->turn_on();
       on_state_change(*this);
@@ -110,7 +110,7 @@ void Host::turn_off()
 {
   if (is_on()) {
     const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
-    kernel::actor::simcall([this, self] {
+    kernel::actor::simcall_answered([this, self] {
       for (VirtualMachine* const& vm : kernel::resource::VirtualMachineImpl::allVms_)
         if (vm->get_pm() == this) {
           vm->shutdown();
@@ -201,13 +201,13 @@ const char* Host::get_property(const std::string& key) const
 
 Host* Host::set_property(const std::string& key, const std::string& value)
 {
-  kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  kernel::actor::simcall_answered([this, &key, &value] { this->pimpl_->set_property(key, value); });
   return this;
 }
 
 Host* Host::set_properties(const std::unordered_map<std::string, std::string>& properties)
 {
-  kernel::actor::simcall([this, &properties] { this->pimpl_->set_properties(properties); });
+  kernel::actor::simcall_answered([this, &properties] { this->pimpl_->set_properties(properties); });
   return this;
 }
 
@@ -215,7 +215,7 @@ Host* Host::set_properties(const std::unordered_map<std::string, std::string>& p
  * The profile must contain boolean values. */
 Host* Host::set_state_profile(kernel::profile::Profile* p)
 {
-  kernel::actor::simcall([this, p] { pimpl_cpu_->set_state_profile(p); });
+  kernel::actor::simcall_answered([this, p] { pimpl_cpu_->set_state_profile(p); });
   return this;
 }
 /** Specify a profile modeling the external load according to an exhaustive list or a stochastic law.
@@ -226,7 +226,7 @@ Host* Host::set_state_profile(kernel::profile::Profile* p)
  */
 Host* Host::set_speed_profile(kernel::profile::Profile* p)
 {
-  kernel::actor::simcall([this, p] { pimpl_cpu_->set_speed_profile(p); });
+  kernel::actor::simcall_answered([this, p] { pimpl_cpu_->set_speed_profile(p); });
   return this;
 }
 
@@ -251,7 +251,7 @@ double Host::get_available_speed() const
 
 Host* Host::set_sharing_policy(SharingPolicy policy, const s4u::NonLinearResourceCb& cb)
 {
-  kernel::actor::simcall([this, policy, &cb] { pimpl_cpu_->set_sharing_policy(policy, cb); });
+  kernel::actor::simcall_answered([this, policy, &cb] { pimpl_cpu_->set_sharing_policy(policy, cb); });
   return this;
 }
 
@@ -267,13 +267,13 @@ int Host::get_core_count() const
 
 Host* Host::set_core_count(int core_count)
 {
-  kernel::actor::simcall([this, core_count] { this->pimpl_cpu_->set_core_count(core_count); });
+  kernel::actor::simcall_answered([this, core_count] { this->pimpl_cpu_->set_core_count(core_count); });
   return this;
 }
 
 Host* Host::set_pstate_speed(const std::vector<double>& speed_per_state)
 {
-  kernel::actor::simcall([this, &speed_per_state] { pimpl_cpu_->set_pstate_speed(speed_per_state); });
+  kernel::actor::simcall_answered([this, &speed_per_state] { pimpl_cpu_->set_pstate_speed(speed_per_state); });
   return this;
 }
 
@@ -301,7 +301,7 @@ Host* Host::set_pstate_speed(const std::vector<std::string>& speed_per_state)
 /** @brief Set the pstate at which the host should run */
 Host* Host::set_pstate(unsigned long pstate_index)
 {
-  kernel::actor::simcall([this, pstate_index] { this->pimpl_cpu_->set_pstate(pstate_index); });
+  kernel::actor::simcall_answered([this, pstate_index] { this->pimpl_cpu_->set_pstate(pstate_index); });
   return this;
 }
 
@@ -313,14 +313,14 @@ unsigned long Host::get_pstate() const
 
 Host* Host::set_factor_cb(const std::function<CpuFactorCb>& cb)
 {
-  kernel::actor::simcall([this, &cb] { pimpl_cpu_->set_factor_cb(cb); });
+  kernel::actor::simcall_answered([this, &cb] { pimpl_cpu_->set_factor_cb(cb); });
   return this;
 }
 
 Host* Host::set_coordinates(const std::string& coords)
 {
   if (not coords.empty())
-    kernel::actor::simcall([this, coords] { this->pimpl_netpoint_->set_coordinates(coords); });
+    kernel::actor::simcall_answered([this, coords] { this->pimpl_netpoint_->set_coordinates(coords); });
   return this;
 }
 std::vector<Disk*> Host::get_disks() const
@@ -330,7 +330,7 @@ std::vector<Disk*> Host::get_disks() const
 
 Disk* Host::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
 {
-  return kernel::actor::simcall([this, &name, read_bandwidth, write_bandwidth] {
+  return kernel::actor::simcall_answered([this, &name, read_bandwidth, write_bandwidth] {
     auto* disk = pimpl_->create_disk(name, read_bandwidth, write_bandwidth);
     pimpl_->add_disk(disk);
     return disk;
@@ -358,12 +358,12 @@ Disk* Host::create_disk(const std::string& name, const std::string& read_bandwid
 
 void Host::add_disk(const Disk* disk)
 {
-  kernel::actor::simcall([this, disk] { this->pimpl_->add_disk(disk); });
+  kernel::actor::simcall_answered([this, disk] { this->pimpl_->add_disk(disk); });
 }
 
 void Host::remove_disk(const std::string& disk_name)
 {
-  kernel::actor::simcall([this, disk_name] { this->pimpl_->remove_disk(disk_name); });
+  kernel::actor::simcall_answered([this, disk_name] { this->pimpl_->remove_disk(disk_name); });
 }
 
 VirtualMachine* Host::create_vm(const std::string& name, int core_amount)
@@ -398,7 +398,7 @@ void Host::execute(double flops, double priority) const
 
 Host* Host::seal()
 {
-  kernel::actor::simcall([this]() { this->pimpl_->seal(); });
+  kernel::actor::simcall_answered([this]() { this->pimpl_->seal(); });
   simgrid::s4u::Host::on_creation(*this); // notify the signal
   return this;
 }
index 77856e7..cd1cdbe 100644 (file)
@@ -28,7 +28,7 @@ IoPtr Io::init()
 
 Io* Io::start()
 {
-  kernel::actor::simcall(
+  kernel::actor::simcall_answered(
       [this] { (*boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)).set_name(get_name()).start(); });
 
   if (suspended_)
@@ -51,7 +51,7 @@ IoPtr Io::set_disk(const_sg_disk_t disk)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING, "Cannot set disk once the Io is started");
 
-  kernel::actor::simcall(
+  kernel::actor::simcall_answered(
       [this, disk] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_disk(disk->get_impl()); });
 
   // Setting the disk may allow to start the activity, let's try
@@ -65,7 +65,7 @@ IoPtr Io::set_priority(double priority)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
              "Cannot change the priority of an io after its start");
-  kernel::actor::simcall([this, priority] {
+  kernel::actor::simcall_answered([this, priority] {
     boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_sharing_penalty(1. / priority);
   });
   return this;
@@ -74,7 +74,7 @@ IoPtr Io::set_priority(double priority)
 IoPtr Io::set_size(sg_size_t size)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING, "Cannot set size once the Io is started");
-  kernel::actor::simcall(
+  kernel::actor::simcall_answered(
       [this, size] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_size(size); });
   Activity::set_remaining(size);
   return this;
@@ -83,14 +83,14 @@ IoPtr Io::set_size(sg_size_t size)
 IoPtr Io::set_op_type(OpType type)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING, "Cannot set size once the Io is started");
-  kernel::actor::simcall(
+  kernel::actor::simcall_answered(
       [this, type] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_type(type); });
   return this;
 }
 
 IoPtr Io::update_priority(double priority)
 {
-  kernel::actor::simcall([this, priority] {
+  kernel::actor::simcall_answered([this, priority] {
     boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->update_sharing_penalty(1. / priority);
   });
   return this;
@@ -99,7 +99,7 @@ IoPtr Io::update_priority(double priority)
 /** @brief Returns the amount of flops that remain to be done */
 double Io::get_remaining() const
 {
-  return kernel::actor::simcall(
+  return kernel::actor::simcall_answered(
       [this]() { return boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->get_remaining(); });
 }
 
index ff36c71..c1d4ffb 100644 (file)
@@ -72,7 +72,7 @@ double Link::get_latency() const
 
 Link* Link::set_latency(double value)
 {
-  kernel::actor::simcall([this, value] { pimpl_->set_latency(value); });
+  kernel::actor::simcall_answered([this, value] { pimpl_->set_latency(value); });
   return this;
 }
 
@@ -95,7 +95,7 @@ double Link::get_bandwidth() const
 
 Link* Link::set_bandwidth(double value)
 {
-  kernel::actor::simcall([this, value] { pimpl_->set_bandwidth(value); });
+  kernel::actor::simcall_answered([this, value] { pimpl_->set_bandwidth(value); });
   return this;
 }
 
@@ -105,7 +105,7 @@ Link* Link::set_sharing_policy(Link::SharingPolicy policy, const NonLinearResour
     throw std::invalid_argument(std::string("Impossible to set wifi or split-duplex for the link: ") + get_name() +
                                 std::string(". Use appropriate create function in NetZone."));
 
-  kernel::actor::simcall([this, policy, &cb] { pimpl_->set_sharing_policy(policy, cb); });
+  kernel::actor::simcall_answered([this, policy, &cb] { pimpl_->set_sharing_policy(policy, cb); });
   return this;
 }
 Link::SharingPolicy Link::get_sharing_policy() const
@@ -122,7 +122,7 @@ void Link::set_host_wifi_rate(const s4u::Host* host, int level) const
 
 Link* Link::set_concurrency_limit(int limit)
 {
-  kernel::actor::simcall([this, limit] { pimpl_->set_concurrency_limit(limit); });
+  kernel::actor::simcall_answered([this, limit] { pimpl_->set_concurrency_limit(limit); });
   return this;
 }
 
@@ -133,15 +133,15 @@ double Link::get_usage() const
 
 void Link::turn_on()
 {
-  kernel::actor::simcall([this]() { this->pimpl_->turn_on(); });
+  kernel::actor::simcall_answered([this]() { this->pimpl_->turn_on(); });
 }
 void Link::turn_off()
 {
-  kernel::actor::simcall([this]() { this->pimpl_->turn_off(); });
+  kernel::actor::simcall_answered([this]() { this->pimpl_->turn_off(); });
 }
 Link* Link::seal()
 {
-  kernel::actor::simcall([this]() { this->pimpl_->seal(); });
+  kernel::actor::simcall_answered([this]() { this->pimpl_->seal(); });
   s4u::Link::on_creation(*this); // notify the signal
   return this;
 }
@@ -154,21 +154,21 @@ bool Link::is_on() const
 Link* Link::set_state_profile(kernel::profile::Profile* profile)
 {
   xbt_assert(not pimpl_->is_sealed(), "Cannot set a state profile once the Link is sealed");
-  kernel::actor::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
+  kernel::actor::simcall_answered([this, profile]() { this->pimpl_->set_state_profile(profile); });
   return this;
 }
 
 Link* Link::set_bandwidth_profile(kernel::profile::Profile* profile)
 {
   xbt_assert(not pimpl_->is_sealed(), "Cannot set a bandwidth profile once the Link is sealed");
-  kernel::actor::simcall([this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
+  kernel::actor::simcall_answered([this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
   return this;
 }
 
 Link* Link::set_latency_profile(kernel::profile::Profile* profile)
 {
   xbt_assert(not pimpl_->is_sealed(), "Cannot set a latency profile once the Link is sealed");
-  kernel::actor::simcall([this, profile]() { this->pimpl_->set_latency_profile(profile); });
+  kernel::actor::simcall_answered([this, profile]() { this->pimpl_->set_latency_profile(profile); });
   return this;
 }
 
@@ -178,7 +178,7 @@ const char* Link::get_property(const std::string& key) const
 }
 Link* Link::set_property(const std::string& key, const std::string& value)
 {
-  kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  kernel::actor::simcall_answered([this, &key, &value] { this->pimpl_->set_property(key, value); });
   return this;
 }
 
@@ -189,7 +189,7 @@ const std::unordered_map<std::string, std::string>* Link::get_properties() const
 
 Link* Link::set_properties(const std::unordered_map<std::string, std::string>& properties)
 {
-  kernel::actor::simcall([this, &properties] { this->pimpl_->set_properties(properties); });
+  kernel::actor::simcall_answered([this, &properties] { this->pimpl_->set_properties(properties); });
   return this;
 }
 
index eda04e7..b3a33a6 100644 (file)
@@ -73,7 +73,7 @@ kernel::activity::CommImplPtr Mailbox::front() const
 
 void Mailbox::set_receiver(ActorPtr actor)
 {
-  kernel::actor::simcall([this, actor]() { this->pimpl_->set_receiver(actor); });
+  kernel::actor::simcall_answered([this, actor]() { this->pimpl_->set_receiver(actor); });
 }
 
 /** @brief get the receiver (process associated to the mailbox) */
@@ -132,7 +132,8 @@ CommPtr Mailbox::get_init()
 kernel::activity::ActivityImplPtr
 Mailbox::iprobe(int type, bool (*match_fun)(void*, void*, kernel::activity::CommImpl*), void* data)
 {
-  return kernel::actor::simcall([this, type, match_fun, data] { return pimpl_->iprobe(type, match_fun, data); });
+  return kernel::actor::simcall_answered(
+      [this, type, match_fun, data] { return pimpl_->iprobe(type, match_fun, data); });
 }
 } // namespace s4u
 } // namespace simgrid
index 3fca4c4..27fda2f 100644 (file)
@@ -20,7 +20,8 @@ void Mutex::lock()
 
   if (MC_is_active() || MC_record_replay_is_active()) { // Split in 2 simcalls for transition persistency
     kernel::actor::MutexObserver lock_observer{issuer, mc::Transition::Type::MUTEX_LOCK, pimpl_};
-    auto acquisition = kernel::actor::simcall([issuer, this] { return pimpl_->lock_async(issuer); }, &lock_observer);
+    auto acquisition =
+        kernel::actor::simcall_answered([issuer, this] { return pimpl_->lock_async(issuer); }, &lock_observer);
 
     kernel::actor::MutexObserver wait_observer{issuer, mc::Transition::Type::MUTEX_WAIT, pimpl_};
     kernel::actor::simcall_blocking([issuer, acquisition] { return acquisition->wait_for(issuer, -1); },
@@ -39,7 +40,7 @@ void Mutex::unlock()
 {
   kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
   kernel::actor::MutexObserver observer{issuer, mc::Transition::Type::MUTEX_UNLOCK, pimpl_};
-  kernel::actor::simcall([this, issuer] { this->pimpl_->unlock(issuer); }, &observer);
+  kernel::actor::simcall_answered([this, issuer] { this->pimpl_->unlock(issuer); }, &observer);
 }
 
 /** @brief Acquire the mutex if it's free, and return false (without blocking) if not */
@@ -47,8 +48,8 @@ bool Mutex::try_lock()
 {
   kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
   kernel::actor::MutexObserver observer{issuer, mc::Transition::Type::MUTEX_TRYLOCK, pimpl_};
-  return kernel::actor::simcall([&observer] { return observer.get_mutex()->try_lock(observer.get_issuer()); },
-                                &observer);
+  return kernel::actor::simcall_answered([&observer] { return observer.get_mutex()->try_lock(observer.get_issuer()); },
+                                         &observer);
 }
 
 /** @brief Create a new mutex
index b17d6a3..06950ef 100644 (file)
@@ -38,7 +38,7 @@ const char* NetZone::get_property(const std::string& key) const
 
 void NetZone::set_property(const std::string& key, const std::string& value)
 {
-  kernel::actor::simcall([this, &key, &value] { pimpl_->set_property(key, value); });
+  kernel::actor::simcall_answered([this, &key, &value] { pimpl_->set_property(key, value); });
 }
 
 /** @brief Returns the list of direct children (no grand-children) */
@@ -73,7 +73,7 @@ NetZone* NetZone::get_parent() const
 
 NetZone* NetZone::set_parent(const NetZone* parent)
 {
-  kernel::actor::simcall([this, parent] { pimpl_->set_parent(parent->get_impl()); });
+  kernel::actor::simcall_answered([this, parent] { pimpl_->set_parent(parent->get_impl()); });
   return this;
 }
 
@@ -149,7 +149,7 @@ void NetZone::extract_xbt_graph(const s_xbt_graph_t* graph, std::map<std::string
 
 NetZone* NetZone::seal()
 {
-  kernel::actor::simcall([this] { pimpl_->seal(); });
+  kernel::actor::simcall_answered([this] { pimpl_->seal(); });
   return this;
 }
 
@@ -160,7 +160,7 @@ s4u::Host* NetZone::create_host(const std::string& name, double speed)
 
 s4u::Host* NetZone::create_host(const std::string& name, const std::vector<double>& speed_per_pstate)
 {
-  return kernel::actor::simcall(
+  return kernel::actor::simcall_answered(
       [this, &name, &speed_per_pstate] { return pimpl_->create_host(name, speed_per_pstate); });
 }
 
@@ -181,7 +181,7 @@ s4u::Link* NetZone::create_link(const std::string& name, double bandwidth)
 
 s4u::Link* NetZone::create_link(const std::string& name, const std::vector<double>& bandwidths)
 {
-  return kernel::actor::simcall([this, &name, &bandwidths] { return pimpl_->create_link(name, bandwidths); });
+  return kernel::actor::simcall_answered([this, &name, &bandwidths] { return pimpl_->create_link(name, bandwidths); });
 }
 
 s4u::Link* NetZone::create_link(const std::string& name, const std::string& bandwidth)
@@ -203,7 +203,7 @@ s4u::SplitDuplexLink* NetZone::create_split_duplex_link(const std::string& name,
 
 s4u::SplitDuplexLink* NetZone::create_split_duplex_link(const std::string& name, double bandwidth)
 {
-  return kernel::actor::simcall(
+  return kernel::actor::simcall_answered(
       [this, &name, &bandwidth] { return pimpl_->create_split_duplex_link(name, std::vector<double>{bandwidth}); });
 }
 
@@ -225,7 +225,7 @@ s4u::Link* NetZone::create_link(const std::string& name, const std::vector<std::
 
 kernel::routing::NetPoint* NetZone::create_router(const std::string& name)
 {
-  return kernel::actor::simcall([this, &name] { return pimpl_->create_router(name); });
+  return kernel::actor::simcall_answered([this, &name] { return pimpl_->create_router(name); });
 }
 
 kernel::routing::NetPoint* NetZone::get_netpoint()
index d0a1b79..6f8565a 100644 (file)
@@ -35,17 +35,17 @@ bool Semaphore::acquire_timeout(double timeout)
 
 void Semaphore::release()
 {
-  kernel::actor::simcall([this] { pimpl_->release(); });
+  kernel::actor::simcall_answered([this] { pimpl_->release(); });
 }
 
 int Semaphore::get_capacity() const
 {
-  return kernel::actor::simcall([this] { return pimpl_->get_capacity(); });
+  return kernel::actor::simcall_answered([this] { return pimpl_->get_capacity(); });
 }
 
 bool Semaphore::would_block() const
 {
-  return kernel::actor::simcall([this] { return pimpl_->would_block(); });
+  return kernel::actor::simcall_answered([this] { return pimpl_->would_block(); });
 }
 
 /* refcounting of the intrusive_ptr is delegated to the implementation object */
index 1eea2ee..b53de10 100644 (file)
@@ -66,7 +66,7 @@ void VirtualMachine::start()
 
   VmHostExt::ensureVmExtInstalled();
 
-  kernel::actor::simcall([this]() {
+  kernel::actor::simcall_answered([this]() {
     Host* pm = this->pimpl_vm_->get_physical_host();
     if (pm->extension<VmHostExt>() == nullptr)
       pm->extension_set(new VmHostExt());
@@ -97,7 +97,7 @@ void VirtualMachine::suspend()
 {
   on_suspend(*this);
   const kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
-  kernel::actor::simcall([this, issuer]() { pimpl_vm_->suspend(issuer); });
+  kernel::actor::simcall_answered([this, issuer]() { pimpl_vm_->suspend(issuer); });
 }
 
 void VirtualMachine::resume()
@@ -109,7 +109,7 @@ void VirtualMachine::resume()
 void VirtualMachine::shutdown()
 {
   kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
-  kernel::actor::simcall([this, issuer]() { pimpl_vm_->shutdown(issuer); });
+  kernel::actor::simcall_answered([this, issuer]() { pimpl_vm_->shutdown(issuer); });
   on_shutdown(*this);
 }
 
@@ -122,7 +122,7 @@ void VirtualMachine::destroy()
     XBT_DEBUG("destroy %s", get_cname());
     on_destruction(*this);
     /* Then, destroy the VM object */
-    kernel::actor::simcall([this]() {
+    kernel::actor::simcall_answered([this]() {
       get_vm_impl()->vm_destroy();
       get_impl()->destroy();
 
@@ -150,13 +150,13 @@ simgrid::s4u::Host* VirtualMachine::get_pm() const
 
 VirtualMachine* VirtualMachine::set_pm(simgrid::s4u::Host* pm)
 {
-  kernel::actor::simcall([this, pm]() { pimpl_vm_->set_physical_host(pm); });
+  kernel::actor::simcall_answered([this, pm]() { pimpl_vm_->set_physical_host(pm); });
   return this;
 }
 
 VirtualMachine::State VirtualMachine::get_state() const
 {
-  return kernel::actor::simcall([this]() { return pimpl_vm_->get_state(); });
+  return kernel::actor::simcall_answered([this]() { return pimpl_vm_->get_state(); });
 }
 
 size_t VirtualMachine::get_ramsize() const
@@ -197,7 +197,7 @@ VirtualMachine* VirtualMachine::set_ramsize(size_t ramsize)
  */
 VirtualMachine* VirtualMachine::set_bound(double bound)
 {
-  kernel::actor::simcall([this, bound]() { pimpl_vm_->set_bound(bound); });
+  kernel::actor::simcall_answered([this, bound]() { pimpl_vm_->set_bound(bound); });
   return this;
 }
 
index 2cbde14..128d2d9 100644 (file)
@@ -50,7 +50,7 @@ void simcall_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size,
     simgrid::kernel::actor::CommIsendSimcall send_observer{
         sender,  mbox,          task_size, rate, static_cast<unsigned char*>(src_buff), src_buff_size, match_fun,
         nullptr, copy_data_fun, data,      false};
-    comm = simgrid::kernel::actor::simcall(
+    comm = simgrid::kernel::actor::simcall_answered(
         [&send_observer] { return simgrid::kernel::activity::CommImpl::isend(&send_observer); }, &send_observer);
 
     simgrid::kernel::actor::ActivityWaitSimcall wait_observer{sender, comm.get(), timeout};
@@ -92,7 +92,8 @@ simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, dou
   simgrid::kernel::actor::CommIsendSimcall observer(sender, mbox, task_size, rate,
                                                     static_cast<unsigned char*>(src_buff), src_buff_size, match_fun,
                                                     clean_fun, copy_data_fun, data, detached);
-  return simgrid::kernel::actor::simcall([&observer] { return simgrid::kernel::activity::CommImpl::isend(&observer); });
+  return simgrid::kernel::actor::simcall_answered(
+      [&observer] { return simgrid::kernel::activity::CommImpl::isend(&observer); });
 }
 
 /**
@@ -112,7 +113,7 @@ void simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff,
 
     simgrid::kernel::actor::CommIrecvSimcall observer{
         receiver, mbox, static_cast<unsigned char*>(dst_buff), dst_buff_size, match_fun, copy_data_fun, data, rate};
-    comm = simgrid::kernel::actor::simcall(
+    comm = simgrid::kernel::actor::simcall_answered(
         [&observer] { return simgrid::kernel::activity::CommImpl::irecv(&observer); }, &observer);
 
     simgrid::kernel::actor::ActivityWaitSimcall wait_observer{receiver, comm.get(), timeout};
@@ -146,7 +147,8 @@ simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, siz
 
   simgrid::kernel::actor::CommIrecvSimcall observer(receiver, mbox, static_cast<unsigned char*>(dst_buff),
                                                     dst_buff_size, match_fun, copy_data_fun, data, rate);
-  return simgrid::kernel::actor::simcall([&observer] { return simgrid::kernel::activity::CommImpl::irecv(&observer); });
+  return simgrid::kernel::actor::simcall_answered(
+      [&observer] { return simgrid::kernel::activity::CommImpl::irecv(&observer); });
 }
 
 /**
@@ -235,7 +237,7 @@ static void simcall(simgrid::simix::Simcall call, std::function<void()> const& c
   }
 }
 
-void simcall_run_kernel(std::function<void()> const& code, simgrid::kernel::actor::SimcallObserver* observer)
+void simcall_run_answered(std::function<void()> const& code, simgrid::kernel::actor::SimcallObserver* observer)
 {
   simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = observer;
   // The function `code` is called in kernel mode (either because we are already in maestor or after a context switch)
index f2638de..842e16a 100644 (file)
@@ -135,10 +135,10 @@ int PMPI_Abort(MPI_Comm comm, int /*errorcode*/)
   for (int i = 0; i < comm->size(); i++){
     auto actor = simgrid::kernel::actor::ActorImpl::by_pid(comm->group()->actor(i));
     if (actor != nullptr && actor != myself)
-      simgrid::kernel::actor::simcall([actor] { actor->exit(); });
+      simgrid::kernel::actor::simcall_answered([actor] { actor->exit(); });
   }
   // now ourself
-  simgrid::kernel::actor::simcall([myself] { myself->exit(); });
+  simgrid::kernel::actor::simcall_answered([myself] { myself->exit(); });
   return MPI_SUCCESS;
 }
 
index e8ab078..a4785c8 100644 (file)
@@ -521,7 +521,8 @@ void Request::start()
                                              -1.0};
     observer.set_tag(tag_);
 
-    action_ = kernel::actor::simcall([&observer] { return kernel::activity::CommImpl::irecv(&observer); }, &observer);
+    action_ = kernel::actor::simcall_answered([&observer] { return kernel::activity::CommImpl::irecv(&observer); },
+                                              &observer);
 
     XBT_DEBUG("recv simcall posted");
 
@@ -626,7 +627,8 @@ void Request::start()
         // detach if msg size < eager/rdv switch limit
         detached_};
     observer.set_tag(tag_);
-    action_ = kernel::actor::simcall([&observer] { return kernel::activity::CommImpl::isend(&observer); }, &observer);
+    action_ = kernel::actor::simcall_answered([&observer] { return kernel::activity::CommImpl::isend(&observer); },
+                                              &observer);
     XBT_DEBUG("send simcall posted");
 
     /* FIXME: detached sends are not traceable (action_ == nullptr) */
@@ -684,8 +686,8 @@ int Request::test(MPI_Request * request, MPI_Status * status, int* flag) {
       try{
         kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
         kernel::actor::ActivityTestSimcall observer{issuer, (*request)->action_.get()};
-        *flag = kernel::actor::simcall([&observer] { return observer.get_activity()->test(observer.get_issuer()); },
-                                       &observer);
+        *flag = kernel::actor::simcall_answered(
+            [&observer] { return observer.get_activity()->test(observer.get_issuer()); }, &observer);
       } catch (const Exception&) {
         *flag = 0;
         return ret;
@@ -774,7 +776,7 @@ int Request::testany(int count, MPI_Request requests[], int *index, int* flag, M
     try{
       kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
       kernel::actor::ActivityTestanySimcall observer{issuer, comms};
-      i = kernel::actor::simcall(
+      i = kernel::actor::simcall_answered(
           [&observer] {
             return kernel::activity::ActivityImpl::test_any(observer.get_issuer(), observer.get_activities());
           },
index 4b13a2f..c670884 100644 (file)
@@ -149,7 +149,7 @@ template <class F> auto kernel_async(F code) -> Future<decltype(code().get())>
   using T = decltype(code().get());
 
   // Execute the code in the kernel and get the kernel future:
-  kernel::Future<T> future = kernel::actor::simcall(std::move(code));
+  kernel::Future<T> future = kernel::actor::simcall_answered(std::move(code));
 
   // Wrap the kernel future in an actor future:
   return Future<T>(std::move(future));
index b8ea7c8..3f98901 100644 (file)
@@ -38,7 +38,7 @@ static void master()
 {
   // Test the simple immediate execution:
   XBT_INFO("Start");
-  simgrid::kernel::actor::simcall([] { XBT_INFO("kernel"); });
+  simgrid::kernel::actor::simcall_answered([] { XBT_INFO("kernel"); });
   XBT_INFO("kernel, returned");
 
   // Synchronize on a successful Future<void>: