bool replaying_ = false; /* is the process replaying a trace */
msg_bar_t finalization_barrier_;
smpi_trace_call_location_t trace_call_loc_;
- simgrid::s4u::ActorPtr process_ = nullptr;
+ simgrid::s4u::ActorPtr actor_ = nullptr;
smpi_privatization_region_t privatized_region_;
int optind=0; /*for getopt replacement */
#if HAVE_PAPI
int sampling();
msg_bar_t finalization_barrier();
static void init(int *argc, char ***argv);
- simgrid::s4u::ActorPtr process();
+ simgrid::s4u::ActorPtr get_actor();
int get_optind();
void set_optind(int optind);
};
void smpi_execute_flops(double flops) {
xbt_assert(flops >= 0, "You're trying to execute a negative amount of flops (%f)!", flops);
XBT_DEBUG("Handle real computation time: %f flops", flops);
- smx_activity_t action = simcall_execution_start("computation", flops, 1, 0, smpi_process()->process()->get_host());
+ smx_activity_t action = simcall_execution_start("computation", flops, 1, 0, smpi_process()->get_actor()->get_host());
simcall_set_category (action, TRACE_internal_smpi_get_category());
simcall_execution_wait(action);
smpi_switch_data_segment(simgrid::s4u::Actor::self());
using simgrid::s4u::ActorPtr;
Process::Process(ActorPtr actor, msg_bar_t finalization_barrier)
- : finalization_barrier_(finalization_barrier), process_(actor)
+ : finalization_barrier_(finalization_barrier), actor_(actor)
{
- mailbox_ = simgrid::s4u::Mailbox::byName("SMPI-" + std::to_string(process_->get_pid()));
- mailbox_small_ = simgrid::s4u::Mailbox::byName("small-" + std::to_string(process_->get_pid()));
+ mailbox_ = simgrid::s4u::Mailbox::byName("SMPI-" + std::to_string(actor_->get_pid()));
+ mailbox_small_ = simgrid::s4u::Mailbox::byName("small-" + std::to_string(actor_->get_pid()));
mailboxes_mutex_ = xbt_mutex_init();
timer_ = xbt_os_timer_new();
state_ = SMPI_UNINITIALIZED;
if (barrier != nullptr) // don't overwrite the current one if the instance has none
finalization_barrier_ = barrier;
- process_ = simgrid::s4u::Actor::self();
- static_cast<simgrid::msg::ActorExt*>(process_->get_impl()->getUserData())->data = this;
+ actor_ = simgrid::s4u::Actor::self();
+ static_cast<simgrid::msg::ActorExt*>(actor_->get_impl()->getUserData())->data = this;
if (*argc > 3) {
memmove(&(*argv)[0], &(*argv)[2], sizeof(char*) * (*argc - 2));
argc_ = argc;
argv_ = argv;
// set the process attached to the mailbox
- mailbox_small_->setReceiver(process_);
- XBT_DEBUG("<%ld> SMPI process has been initialized: %p", process_->get_pid(), process_.get());
+ mailbox_small_->setReceiver(actor_);
+ XBT_DEBUG("<%ld> SMPI process has been initialized: %p", actor_->get_pid(), actor_.get());
}
/** @brief Prepares the current process for termination. */
void Process::finalize()
{
state_ = SMPI_FINALIZED;
- XBT_DEBUG("<%ld> Process left the game", process_->get_pid());
+ XBT_DEBUG("<%ld> Process left the game", actor_->get_pid());
// This leads to an explosion of the search graph which cannot be reduced:
if(MC_is_active() || MC_record_replay_is_active())
return data_;
}
-ActorPtr Process::process(){
- return process_;
+ActorPtr Process::get_actor()
+{
+ return actor_;
}
/**
if(comm_self_==MPI_COMM_NULL){
MPI_Group group = new Group(1);
comm_self_ = new Comm(group, nullptr);
- group->set_mapping(process_, 0);
+ group->set_mapping(actor_, 0);
}
return comm_self_;
}
// we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
real_size_=size_;
action_ = simcall_comm_irecv(
- process->process()->get_impl(), mailbox, buf_, &real_size_, &match_recv,
+ process->get_actor()->get_impl(), mailbox, buf_, &real_size_, &match_recv,
process->replaying() ? &smpi_comm_null_copy_buffer_callback : smpi_comm_copy_data_callback, this, -1.0);
XBT_DEBUG("recv simcall posted");
if (smpi_iprobe_sleep > 0) {
smx_activity_t iprobe_sleep = simcall_execution_start(
"iprobe", /* flops to executek*/ nsleeps * smpi_iprobe_sleep * speed * maxrate, /* priority */ 1.0,
- /* performance bound */ maxrate * speed, smpi_process()->process()->get_impl()->host);
+ /* performance bound */ maxrate * speed, smpi_process()->get_actor()->get_host());
simcall_execution_wait(iprobe_sleep);
}
// behave like a receive, but don't do it