Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Partially snake_case ActorImpl
[simgrid.git] / src / smpi / internals / smpi_process.cpp
index 603c39e..d5edd03 100644 (file)
@@ -25,7 +25,7 @@ Process::Process(ActorPtr actor, msg_bar_t finalization_barrier)
   mailbox_small_   = simgrid::s4u::Mailbox::by_name("small-" + std::to_string(actor_->get_pid()));
   mailboxes_mutex_ = xbt_mutex_init();
   timer_           = xbt_os_timer_new();
-  state_           = SMPI_UNINITIALIZED;
+  state_           = SmpiProcessState::UNINITIALIZED;
   if (MC_is_active())
     MC_ignore_heap(timer_, xbt_os_timer_size());
 
@@ -66,7 +66,7 @@ void Process::set_data(int* argc, char*** argv)
     finalization_barrier_ = barrier;
 
   actor_                                                                        = simgrid::s4u::Actor::self();
-  static_cast<simgrid::msg::ActorExt*>(actor_->get_impl()->getUserData())->data = this;
+  static_cast<simgrid::msg::ActorExt*>(actor_->get_impl()->get_user_data())->data = this;
 
   if (*argc > 3) {
     memmove(&(*argv)[0], &(*argv)[2], sizeof(char*) * (*argc - 2));
@@ -84,7 +84,7 @@ void Process::set_data(int* argc, char*** argv)
 /** @brief Prepares the current process for termination. */
 void Process::finalize()
 {
-  state_ = SMPI_FINALIZED;
+  state_ = SmpiProcessState::FINALIZED;
   XBT_DEBUG("<%ld> Process left the game", actor_->get_pid());
 
   // This leads to an explosion of the search graph which cannot be reduced:
@@ -97,7 +97,7 @@ void Process::finalize()
 /** @brief Check if a process is finalized */
 int Process::finalized()
 {
-  return (state_ == SMPI_FINALIZED);
+  return (state_ == SmpiProcessState::FINALIZED);
 }
 
 /** @brief Check if a process is initialized */
@@ -105,18 +105,18 @@ int Process::initialized()
 {
   // TODO cheinrich: Check if we still need this. This should be a global condition, not for a
   // single process ... ?
-  return (state_ == SMPI_INITIALIZED);
+  return (state_ == SmpiProcessState::INITIALIZED);
 }
 
 /** @brief Mark a process as initialized (=MPI_Init called) */
 void Process::mark_as_initialized()
 {
-  if (state_ != SMPI_FINALIZED)
-    state_ = SMPI_INITIALIZED;
+  if (state_ != SmpiProcessState::FINALIZED)
+    state_ = SmpiProcessState::INITIALIZED;
 }
 
 void Process::set_replaying(bool value){
-  if (state_ != SMPI_FINALIZED)
+  if (state_ != SmpiProcessState::FINALIZED)
     replaying_ = value;
 }
 
@@ -243,7 +243,7 @@ void Process::init(int *argc, char ***argv){
   }
   if (argc != nullptr && argv != nullptr) {
     simgrid::s4u::ActorPtr proc = simgrid::s4u::Actor::self();
-    proc->get_impl()->context->set_cleanup(&MSG_process_cleanup_from_SIMIX);
+    proc->get_impl()->context_->set_cleanup(&MSG_process_cleanup_from_SIMIX);
 
     char* instance_id = (*argv)[1];
     try {
@@ -256,7 +256,7 @@ void Process::init(int *argc, char ***argv){
     // cheinrich: I'm not sure what the impact of the SMPI_switch_data_segment on this call is. I moved
     // this up here so that I can set the privatized region before the switch.
     Process* process = smpi_process_remote(proc);
-    if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap) {
+    if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP) {
       /* Now using the segment index of this process  */
       process->set_privatized_region(smpi_init_global_memory_segment_process());
       /* Done at the process's creation */