iface() becomes get_iface() for ActorImpl too.
env->ReleaseStringUTFChars(jname, name);
/* Retrieve the kill time from the actor */
- actor->ciface()->set_kill_time((double)env->GetDoubleField(jprocess, jprocess_field_Process_killTime));
+ actor->get_ciface()->set_kill_time((double)env->GetDoubleField(jprocess, jprocess_field_Process_killTime));
/* sets the PID and the PPID of the actor */
- env->SetIntField(jprocess, jprocess_field_Process_pid, (jint)actor->ciface()->get_pid());
- env->SetIntField(jprocess, jprocess_field_Process_ppid, (jint)actor->ciface()->get_ppid());
+ env->SetIntField(jprocess, jprocess_field_Process_pid, (jint)actor->get_ciface()->get_pid());
+ env->SetIntField(jprocess, jprocess_field_Process_ppid, (jint)actor->get_ciface()->get_ppid());
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess)
ActorImpl::~ActorImpl()
{
if (simix_global != nullptr && this != simix_global->maestro_)
- s4u::Actor::on_destruction(*ciface());
+ s4u::Actor::on_destruction(*get_ciface());
}
/* Become an actor in the simulation
context->attach_start();
/* The on_creation() signal must be delayed until there, where the pid and everything is set */
- s4u::Actor::on_creation(*actor->ciface());
+ s4u::Actor::on_creation(*actor->get_ciface());
return ActorImplPtr(actor);
}
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(*ciface()); });
+ actor::simcall([this] { s4u::Actor::on_termination(*get_ciface()); });
context_->set_wannadie();
}
}
if (SMPI_switch_data_segment && not finished_) {
- SMPI_switch_data_segment(iface());
+ SMPI_switch_data_segment(get_iface());
}
}
actor->set_kill_time(arg.kill_time);
actor->set_auto_restart(arg.auto_restart);
- return actor->ciface();
+ return actor->get_ciface();
}
void ActorImpl::suspend()
intrusive_ptr_add_ref(actor);
/* The on_creation() signal must be delayed until there, where the pid and everything is set */
- s4u::Actor::on_creation(*actor->ciface());
+ s4u::Actor::on_creation(*actor->get_ciface());
return ActorImplPtr(actor);
}
void undaemonize();
public:
- s4u::ActorPtr iface() { return s4u::ActorPtr(&piface_); }
- s4u::Actor* ciface() { return &piface_; }
+ s4u::ActorPtr get_iface() { return s4u::ActorPtr(&piface_); }
+ s4u::Actor* get_ciface() { return &piface_; }
ActorImplPtr init(const std::string& name, s4u::Host* host) const;
ActorImpl* start(const ActorCode& code);
});
simgrid::s4u::Exec::on_completion.connect([this](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
// For more than one host (not yet supported), we can access the host via
- // simcalls_.front()->issuer->iface()->get_host()
+ // simcalls_.front()->issuer->get_iface()->get_host()
if (activity.get_host() == get_host() && iteration_running) {
comp_timer += activity.get_finish_time() - activity.get_start_time();
}
if (self_context == nullptr)
return nullptr;
- return self_context->get_actor()->ciface();
+ return self_context->get_actor()->get_ciface();
}
ActorPtr Actor::init(const std::string& name, s4u::Host* host)
kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
kernel::actor::ActorImpl* actor =
kernel::actor::simcall([self, &name, host] { return self->init(name, host).get(); });
- return actor->iface();
+ return actor->get_iface();
}
/** Set a non-default stack size for this context (in Kb)
kernel::actor::ActorImpl* actor =
kernel::actor::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
- return actor->iface();
+ return actor->get_iface();
}
ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::string& function,
{
kernel::actor::ActorImpl* actor = SIMIX_process_from_PID(pid);
if (actor != nullptr)
- return actor->iface();
+ return actor->get_iface();
else
return ActorPtr();
}
if (duration > 0) {
kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
- Actor::on_sleep(*issuer->ciface());
+ Actor::on_sleep(*issuer->get_ciface());
kernel::actor::simcall_blocking<void>([issuer, duration]() {
if (MC_is_active() || MC_record_replay_is_active()) {
sync->register_simcall(&issuer->simcall_);
});
- Actor::on_wake_up(*issuer->ciface());
+ Actor::on_wake_up(*issuer->get_ciface());
}
}
void suspend()
{
kernel::actor::ActorImpl* self = simgrid::kernel::actor::ActorImpl::self();
- s4u::Actor::on_suspend(*self->ciface());
+ s4u::Actor::on_suspend(*self->get_ciface());
kernel::actor::simcall_blocking<void>([self] { self->suspend(); });
}
void on_exit(const std::function<void(bool)>& fun)
{
- simgrid::kernel::actor::ActorImpl::self()->iface()->on_exit(fun);
+ simgrid::kernel::actor::ActorImpl::self()->get_iface()->on_exit(fun);
}
/** @brief Moves the current actor to another host
*/
void set_host(Host* new_host)
{
- simgrid::kernel::actor::ActorImpl::self()->iface()->set_host(new_host);
+ simgrid::kernel::actor::ActorImpl::self()->get_iface()->set_host(new_host);
}
void migrate(Host* new_host) // deprecated
{
}
simgrid::s4u::this_actor::yield();
- return actor->ciface();
+ return actor->get_ciface();
}
void sg_actor_detach()
kernel::actor::ActorImplPtr sender = nullptr;
if (pimpl_)
sender = boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->src_actor_;
- return sender ? sender->ciface() : nullptr;
+ return sender ? sender->get_ciface() : nullptr;
}
} // namespace s4u
{
std::vector<ActorPtr> actor_list;
for (auto const& kv : simix_global->process_list) {
- actor_list.push_back(kv.second->iface());
+ actor_list.push_back(kv.second->get_iface());
}
return actor_list;
}
{
std::vector<ActorPtr> actor_list;
for (auto const& kv : simix_global->process_list) {
- if (filter(kv.second->iface()))
- actor_list.push_back(kv.second->iface());
+ if (filter(kv.second->get_iface()))
+ actor_list.push_back(kv.second->get_iface());
}
return actor_list;
}
{
if (pimpl_->permanent_receiver_ == nullptr)
return ActorPtr();
- return pimpl_->permanent_receiver_->iface();
+ return pimpl_->permanent_receiver_->get_iface();
}
CommPtr Mailbox::put_init()
void simcall_process_suspend(smx_actor_t process) // XBT_DEPRECATED_v328
{
- process->iface()->suspend();
+ process->get_iface()->suspend();
}
simgrid::kernel::activity::State simcall_process_sleep(double duration) // XBT_ATTRIB_DEPRECATED_v329
(static_cast<char*>(buff) >= smpi_data_exe_start) &&
(static_cast<char*>(buff) < smpi_data_exe_start + smpi_data_exe_size)) {
XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
- smpi_switch_data_segment(comm->src_actor_->iface());
+ smpi_switch_data_segment(comm->src_actor_->get_iface());
tmpbuff = xbt_malloc(buff_size);
memcpy_private(tmpbuff, buff, private_blocks);
}
((char*)comm->dst_buff_ >= smpi_data_exe_start) &&
((char*)comm->dst_buff_ < smpi_data_exe_start + smpi_data_exe_size)) {
XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment");
- smpi_switch_data_segment(comm->dst_actor_->iface());
+ smpi_switch_data_segment(comm->dst_actor_->get_iface());
}
XBT_DEBUG("Copying %zu bytes from %p to %p", buff_size, tmpbuff, comm->dst_buff_);
memcpy_private(comm->dst_buff_, tmpbuff, private_blocks);
int min_index = INT_MAX; // the minimum index will be the leader
for (auto& actor : actor_list) {
int index = actor.get_pid();
- if (this->group()->rank(actor.ciface()) != MPI_UNDEFINED) { // Is this process in the current group?
+ if (this->group()->rank(actor.get_ciface()) != MPI_UNDEFINED) { // Is this process in the current group?
intra_comm_size++;
if (index < min_index)
min_index = index;
auto* group_intra = new Group(intra_comm_size);
int i = 0;
for (auto& actor : actor_list) {
- if (this->group()->rank(actor.ciface()) != MPI_UNDEFINED) {
- group_intra->set_mapping(actor.ciface(), i);
+ if (this->group()->rank(actor.get_ciface()) != MPI_UNDEFINED) {
+ group_intra->set_mapping(actor.get_ciface(), i);
i++;
}
}
{
std::vector<s4u::ActorPtr> res;
for (auto& actor : actor_list_)
- res.emplace_back(actor.ciface());
+ res.emplace_back(actor.get_ciface());
return res;
}
size_t HostImpl::get_actor_count() const