Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Partially snake_case ActorImpl
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 30 Jun 2018 13:29:44 +0000 (15:29 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 30 Jun 2018 16:17:16 +0000 (18:17 +0200)
I'm sick of snake casing, this one will have to wait.

41 files changed:
include/simgrid/s4u/Actor.hpp
src/bindings/java/JavaContext.cpp
src/bindings/java/jmsg_process.cpp
src/kernel/activity/ConditionVariableImpl.cpp
src/kernel/activity/MutexImpl.cpp
src/kernel/activity/SleepImpl.cpp
src/kernel/context/Context.cpp
src/kernel/context/ContextBoost.cpp
src/kernel/context/ContextRaw.cpp
src/kernel/context/ContextThread.cpp
src/kernel/context/ContextUnix.cpp
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/checker/SafetyChecker.cpp
src/mc/mc_base.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_comm_pattern.cpp
src/mc/mc_global.cpp
src/mc/mc_request.cpp
src/mc/mc_smx.cpp
src/mc/mc_state.cpp
src/mc/mc_state.hpp
src/mc/remote/Client.cpp
src/msg/msg_process.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Host.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/simix/libsmx.cpp
src/simix/popping.cpp
src/simix/popping_bodies.cpp
src/simix/popping_generated.cpp
src/simix/simcalls.py
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/simix/smx_io.cpp
src/simix/smx_network.cpp
src/simix/smx_synchro.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_process.cpp
src/smpi/mpi/smpi_comm.cpp

index 46e268b..e3a0f6b 100644 (file)
@@ -230,7 +230,7 @@ public:
   void yield();
 
   /** Returns true if the actor is suspended. */
-  int is_suspended();
+  bool is_suspended();
 
   /** If set to true, the actor will automatically restart when its host reboots */
   void set_auto_restart(bool autorestart);
index 87c5e9e..e602914 100644 (file)
@@ -48,7 +48,7 @@ JavaContext* JavaContextFactory::create_context(
 void JavaContextFactory::run_all()
 {
   for (smx_actor_t const& process : simgrid::simix::process_get_runnable()) {
-    static_cast<JavaContext*>(process->context)->resume();
+    static_cast<JavaContext*>(process->context_)->resume();
   }
 }
 
index 1d68839..d1e554b 100644 (file)
@@ -25,7 +25,8 @@ jfieldID jprocess_field_Process_ppid;
 
 jobject jprocess_from_native(msg_process_t process)
 {
-  simgrid::kernel::context::JavaContext* context = (simgrid::kernel::context::JavaContext*)process->get_impl()->context;
+  simgrid::kernel::context_::JavaContext* context =
+      (simgrid::kernel::context_::JavaContext*)process->get_impl()->context_;
   return context->jprocess;
 }
 
@@ -73,7 +74,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv* env, jobject
   jstring jname         = (jstring)env->GetObjectField(jprocess, jprocess_field_Process_name);
   const char* name      = env->GetStringUTFChars(jname, 0);
   msg_process_t process =
-      MSG_process_create_from_stdfunc(name, [jprocess]() { simgrid::kernel::context::java_main_jprocess(jprocess); },
+      MSG_process_create_from_stdfunc(name, [jprocess]() { simgrid::kernel::context_::java_main_jprocess(jprocess); },
                                       /*data*/ nullptr, jhost_get_native(env, jhost), /* properties*/ nullptr);
   env->ReleaseStringUTFChars(jname, name);
 
index 84190d0..d59d899 100644 (file)
@@ -28,7 +28,7 @@ static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout,
     mutex->unlock(issuer);
   }
 
-  synchro = SIMIX_synchro_wait(issuer->host, timeout);
+  synchro = SIMIX_synchro_wait(issuer->host_, timeout);
   synchro->simcalls_.push_front(simcall);
   issuer->waiting_synchro = synchro;
   cond->sleeping.push_back(*simcall->issuer);
index 2a68661..9581637 100644 (file)
@@ -34,7 +34,7 @@ void MutexImpl::lock(smx_actor_t issuer)
   if (this->locked) {
     /* FIXME: check if the host is active ? */
     /* Somebody using the mutex, use a synchronization to get host failures */
-    synchro = SIMIX_synchro_wait(issuer->host, -1);
+    synchro = SIMIX_synchro_wait(issuer->host_, -1);
     synchro->simcalls_.push_back(&issuer->simcall);
     issuer->waiting_synchro = synchro;
     this->sleeping.push_back(*issuer);
@@ -81,7 +81,7 @@ void MutexImpl::unlock(smx_actor_t issuer)
   /* If the mutex is not owned by the issuer, that's not good */
   if (issuer != this->owner)
     THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
-           this->owner->get_cname(), this->owner->pid);
+           this->owner->get_cname(), this->owner->pid_);
 
   if (not this->sleeping.empty()) {
     /*process to wake up */
index aea4da1..041440e 100644 (file)
@@ -34,7 +34,7 @@ void simgrid::kernel::activity::SleepImpl::post()
     e_smx_state_t result;
     switch (surf_sleep->get_state()) {
       case simgrid::kernel::resource::Action::State::FAILED:
-        simcall->issuer->context->iwannadie = 1;
+        simcall->issuer->context_->iwannadie = 1;
         result                              = SIMIX_SRC_HOST_FAILURE;
         break;
 
@@ -46,14 +46,14 @@ void simgrid::kernel::activity::SleepImpl::post()
         THROW_IMPOSSIBLE;
         break;
     }
-    if (simcall->issuer->host->is_off()) {
-      simcall->issuer->context->iwannadie = 1;
+    if (simcall->issuer->host_->is_off()) {
+      simcall->issuer->context_->iwannadie = 1;
     }
     simcall_process_sleep__set__result(simcall, result);
     simcall->issuer->waiting_synchro = nullptr;
-    if (simcall->issuer->suspended) {
+    if (simcall->issuer->suspended_) {
       XBT_DEBUG("Wait! This process is suspended and can't wake up now.");
-      simcall->issuer->suspended = 0;
+      simcall->issuer->suspended_ = 0;
       simcall_HANDLER_process_suspend(simcall, simcall->issuer);
     } else {
       SIMIX_simcall_answer(simcall);
index b1af4dc..dfa1791 100644 (file)
@@ -77,7 +77,7 @@ void Context::stop()
 {
   if (this->cleanup_func_)
     this->cleanup_func_(this->process_);
-  this->process_->suspended = 0;
+  this->process_->suspended_ = 0;
 
   this->iwannadie = false;
   simgrid::simix::simcall([this] { SIMIX_process_cleanup(this->process_); });
index 5673295..b458eed 100644 (file)
@@ -77,13 +77,13 @@ BoostContext::BoostContext(std::function<void()> code, void_pfn_smxprocess_t cle
 #endif
     ASAN_ONLY(this->asan_stack_ = stack);
 #if BOOST_VERSION < 106100
-    this->fc_ = boost::context::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper);
+    this->fc_ = boost::context_::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper);
 #else
     this->fc_ = boost::context::detail::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper);
 #endif
   } else {
 #if BOOST_VERSION < 105600
-    this->fc_ = new boost::context::fcontext_t();
+    this->fc_ = new boost::context_::fcontext_t();
 #endif
     if (BoostContext::maestro_context_ == nullptr)
       BoostContext::maestro_context_ = this;
@@ -104,11 +104,11 @@ BoostContext::~BoostContext()
 void BoostContext::wrapper(BoostContext::arg_type arg)
 {
 #if BOOST_VERSION < 106100
-  BoostContext* context = reinterpret_cast<BoostContext*>(arg);
+  BoostContext* context_ = reinterpret_cast<BoostContext*>(arg);
 #else
   BoostContext* context = static_cast<BoostContext**>(arg.data)[1];
-  ASAN_ONLY(xbt_assert(context->asan_ctx_ == static_cast<BoostContext**>(arg.data)[0]));
-  ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
+  ASAN_ONLY(xbt_assert(context_->asan_ctx_ == static_cast<BoostContext**>(arg.data)[0]));
+  ASAN_FINISH_SWITCH(nullptr, &context_->asan_ctx_->asan_stack_, &context_->asan_ctx_->asan_stack_size_);
   static_cast<BoostContext**>(arg.data)[0]->fc_ = arg.fctx;
 #endif
   try {
@@ -117,16 +117,16 @@ void BoostContext::wrapper(BoostContext::arg_type arg)
   } catch (StopRequest const&) {
     XBT_DEBUG("Caught a StopRequest");
   }
-  ASAN_ONLY(context->asan_stop_ = true);
+  ASAN_ONLY(context_->asan_stop_ = true);
   context->suspend();
 }
 
 inline void BoostContext::swap(BoostContext* from, BoostContext* to)
 {
 #if BOOST_VERSION < 105600
-  boost::context::jump_fcontext(from->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
+  boost::context_::jump_fcontext(from->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
 #elif BOOST_VERSION < 106100
-  boost::context::jump_fcontext(&from->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
+  boost::context_::jump_fcontext(&from->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
 #else
   BoostContext* ctx[2] = {from, to};
   ASAN_ONLY(void* fake_stack = nullptr);
@@ -159,7 +159,7 @@ void SerialBoostContext::suspend()
   if (i < simix_global->process_to_run.size()) {
     /* execute the next process */
     XBT_DEBUG("Run next process");
-    next_context = static_cast<SerialBoostContext*>(simix_global->process_to_run[i]->context);
+    next_context = static_cast<SerialBoostContext*>(simix_global->process_to_run[i]->context_);
   } else {
     /* all processes were run, return to maestro */
     XBT_DEBUG("No more process to run");
@@ -182,7 +182,7 @@ void SerialBoostContext::run_all()
   smx_actor_t first_process = simix_global->process_to_run.front();
   process_index_            = 1;
   /* execute the first process */
-  static_cast<SerialBoostContext*>(first_process->context)->resume();
+  static_cast<SerialBoostContext*>(first_process->context_)->resume();
 }
 
 // ParallelBoostContext
@@ -217,7 +217,7 @@ void ParallelBoostContext::run_all()
     parmap_ = new simgrid::xbt::Parmap<smx_actor_t>(SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
   parmap_->apply(
       [](smx_actor_t process) {
-        ParallelBoostContext* context = static_cast<ParallelBoostContext*>(process->context);
+        ParallelBoostContext* context = static_cast<ParallelBoostContext*>(process->context_);
         context->resume();
       },
       simix_global->process_to_run);
@@ -229,7 +229,7 @@ void ParallelBoostContext::suspend()
   ParallelBoostContext* next_context;
   if (next_work) {
     XBT_DEBUG("Run next process");
-    next_context = static_cast<ParallelBoostContext*>(next_work.get()->context);
+    next_context = static_cast<ParallelBoostContext*>(next_work.get()->context_);
   } else {
     XBT_DEBUG("No more processes to run");
     uintptr_t worker_id = reinterpret_cast<uintptr_t>(xbt_os_thread_get_specific(worker_id_key_));
index fbaec9b..c522d82 100644 (file)
@@ -258,14 +258,14 @@ RawContext::~RawContext()
 void RawContext::wrapper(void* arg)
 {
   RawContext* context = static_cast<RawContext*>(arg);
-  ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
+  ASAN_FINISH_SWITCH(nullptr, &context_->asan_ctx_->asan_stack_, &context_->asan_ctx_->asan_stack_size_);
   try {
     (*context)();
     context->Context::stop();
   } catch (StopRequest const&) {
     XBT_DEBUG("Caught a StopRequest");
   }
-  ASAN_ONLY(context->asan_stop_ = true);
+  ASAN_ONLY(context_->asan_stop_ = true);
   context->suspend();
 }
 
@@ -297,7 +297,7 @@ void SerialRawContext::suspend()
   if (i < simix_global->process_to_run.size()) {
     /* execute the next process */
     XBT_DEBUG("Run next process");
-    next_context = static_cast<SerialRawContext*>(simix_global->process_to_run[i]->context);
+    next_context = static_cast<SerialRawContext*>(simix_global->process_to_run[i]->context_);
   } else {
     /* all processes were run, return to maestro */
     XBT_DEBUG("No more process to run");
@@ -319,7 +319,7 @@ void SerialRawContext::run_all()
     return;
   smx_actor_t first_process = simix_global->process_to_run.front();
   process_index_            = 1;
-  static_cast<SerialRawContext*>(first_process->context)->resume();
+  static_cast<SerialRawContext*>(first_process->context_)->resume();
 }
 
 // ParallelRawContext
@@ -355,7 +355,7 @@ void ParallelRawContext::run_all()
     parmap_ = new simgrid::xbt::Parmap<smx_actor_t>(SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
   parmap_->apply(
       [](smx_actor_t process) {
-        ParallelRawContext* context = static_cast<ParallelRawContext*>(process->context);
+        ParallelRawContext* context = static_cast<ParallelRawContext*>(process->context_);
         context->resume();
       },
       simix_global->process_to_run);
@@ -369,7 +369,7 @@ void ParallelRawContext::suspend()
   if (next_work) {
     /* there is a next process to resume */
     XBT_DEBUG("Run next process");
-    next_context = static_cast<ParallelRawContext*>(next_work.get()->context);
+    next_context = static_cast<ParallelRawContext*>(next_work.get()->context_);
   } else {
     /* all processes were run, go to the barrier */
     XBT_DEBUG("No more processes to run");
index 26d0b21..7362e84 100644 (file)
@@ -169,7 +169,7 @@ void ThreadContext::suspend()
 void ThreadContext::attach_start()
 {
   // We're breaking the layers here by depending on the upper layer:
-  ThreadContext* maestro = (ThreadContext*) simix_global->maestro_process->context;
+  ThreadContext* maestro = (ThreadContext*)simix_global->maestro_process->context_;
   xbt_os_sem_release(maestro->begin_);
   xbt_assert(not this->isMaestro());
   this->start();
@@ -180,7 +180,7 @@ void ThreadContext::attach_stop()
   xbt_assert(not this->isMaestro());
   this->yield();
 
-  ThreadContext* maestro = (ThreadContext*) simix_global->maestro_process->context;
+  ThreadContext* maestro = (ThreadContext*)simix_global->maestro_process->context_;
   xbt_os_sem_acquire(maestro->end_);
 
   xbt_os_thread_set_extra_data(nullptr);
@@ -192,7 +192,7 @@ void SerialThreadContext::run_all()
 {
   for (smx_actor_t const& process : simix_global->process_to_run) {
     XBT_DEBUG("Handling %p", process);
-    ThreadContext* context = static_cast<ThreadContext*>(process->context);
+    ThreadContext* context = static_cast<ThreadContext*>(process->context_);
     context->release();
     context->wait();
   }
@@ -216,9 +216,9 @@ void ParallelThreadContext::finalize()
 void ParallelThreadContext::run_all()
 {
   for (smx_actor_t const& process : simix_global->process_to_run)
-    static_cast<ThreadContext*>(process->context)->release();
+    static_cast<ThreadContext*>(process->context_)->release();
   for (smx_actor_t const& process : simix_global->process_to_run)
-    static_cast<ThreadContext*>(process->context)->wait();
+    static_cast<ThreadContext*>(process->context_)->wait();
 }
 
 void ParallelThreadContext::start_hook()
index af76c2c..362b014 100644 (file)
@@ -118,14 +118,14 @@ void UContext::smx_ctx_sysv_wrapper(int i1, int i2)
   simgrid::kernel::context::UContext* context;
   memcpy(&context, ctx_addr, sizeof context);
 
-  ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
+  ASAN_FINISH_SWITCH(nullptr, &context_->asan_ctx_->asan_stack_, &context_->asan_ctx_->asan_stack_size_);
   try {
     (*context)();
     context->Context::stop();
   } catch (simgrid::kernel::context::Context::StopRequest const&) {
     XBT_DEBUG("Caught a StopRequest");
   }
-  ASAN_ONLY(context->asan_stop_ = true);
+  ASAN_ONLY(context_->asan_stop_ = true);
   context->suspend();
 }
 
@@ -170,7 +170,7 @@ void SerialUContext::suspend()
   if (i < simix_global->process_to_run.size()) {
     /* execute the next process */
     XBT_DEBUG("Run next process");
-    next_context = static_cast<SerialUContext*>(simix_global->process_to_run[i]->context);
+    next_context = static_cast<SerialUContext*>(simix_global->process_to_run[i]->context_);
   } else {
     /* all processes were run, return to maestro */
     XBT_DEBUG("No more process to run");
@@ -192,7 +192,7 @@ void SerialUContext::run_all()
     return;
   smx_actor_t first_process = simix_global->process_to_run.front();
   process_index_            = 1;
-  static_cast<SerialUContext*>(first_process->context)->resume();
+  static_cast<SerialUContext*>(first_process->context_)->resume();
 }
 
 // ParallelUContext
@@ -233,7 +233,7 @@ void ParallelUContext::run_all()
     parmap_ = new simgrid::xbt::Parmap<smx_actor_t>(SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
   parmap_->apply(
       [](smx_actor_t process) {
-        ParallelUContext* context = static_cast<ParallelUContext*>(process->context);
+        ParallelUContext* context = static_cast<ParallelUContext*>(process->context_);
         context->resume();
       },
       simix_global->process_to_run);
@@ -255,7 +255,7 @@ void ParallelUContext::suspend()
   if (next_work) {
     // There is a next soul to embody (ie, a next process to resume)
     XBT_DEBUG("Run next process");
-    next_context = static_cast<ParallelUContext*>(next_work.get()->context);
+    next_context = static_cast<ParallelUContext*>(next_work.get()->context_);
   } else {
     // All processes were run, go to the barrier
     XBT_DEBUG("No more processes to run");
index 0d1aa71..5b8d3ff 100644 (file)
@@ -103,8 +103,8 @@ static void update_comm_pattern(simgrid::mc::PatternCommunication* comm_pattern,
 
   smx_actor_t src_proc   = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->src_proc));
   smx_actor_t dst_proc   = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_proc));
-  comm_pattern->src_proc = src_proc->pid;
-  comm_pattern->dst_proc = dst_proc->pid;
+  comm_pattern->src_proc = src_proc->pid_;
+  comm_pattern->dst_proc = dst_proc->pid_;
   comm_pattern->src_host = MC_smx_actor_get_host_name(src_proc);
   comm_pattern->dst_host = MC_smx_actor_get_host_name(dst_proc);
   if (comm_pattern->data.size() == 0 && comm->src_buff != nullptr) {
@@ -173,8 +173,8 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim
 {
   const smx_actor_t issuer = MC_smx_simcall_get_issuer(request);
   simgrid::mc::PatternCommunicationList* initial_pattern =
-      xbt_dynar_get_as(initial_communications_pattern, issuer->pid, simgrid::mc::PatternCommunicationList*);
-  xbt_dynar_t incomplete_pattern = xbt_dynar_get_as(incomplete_communications_pattern, issuer->pid, xbt_dynar_t);
+      xbt_dynar_get_as(initial_communications_pattern, issuer->pid_, simgrid::mc::PatternCommunicationList*);
+  xbt_dynar_t incomplete_pattern = xbt_dynar_get_as(incomplete_communications_pattern, issuer->pid_, xbt_dynar_t);
 
   std::unique_ptr<simgrid::mc::PatternCommunication> pattern =
       std::unique_ptr<simgrid::mc::PatternCommunication>(new simgrid::mc::PatternCommunication());
@@ -194,7 +194,7 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim
     char* remote_name = mc_model_checker->process().read<char*>(
         RemotePtr<char*>((uint64_t)(synchro->mbox ? &synchro->mbox->name_ : &synchro->mbox_cpy->name_)));
     pattern->rdv      = mc_model_checker->process().read_string(RemotePtr<char>(remote_name));
-    pattern->src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(synchro->src_proc))->pid;
+    pattern->src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(synchro->src_proc))->pid_;
     pattern->src_host = MC_smx_actor_get_host_name(issuer);
 
     simgrid::smpi::Request mpi_request = mc_model_checker->process().read<simgrid::smpi::Request>(
@@ -238,13 +238,13 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim
         &remote_name, remote(comm->mbox ? &simgrid::xbt::string::to_string_data(comm->mbox->name_).data
                                         : &simgrid::xbt::string::to_string_data(comm->mbox_cpy->name_).data));
     pattern->rdv      = mc_model_checker->process().read_string(RemotePtr<char>(remote_name));
-    pattern->dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_proc))->pid;
+    pattern->dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_proc))->pid_;
     pattern->dst_host = MC_smx_actor_get_host_name(issuer);
   } else
     xbt_die("Unexpected call_type %i", (int) call_type);
 
-  XBT_DEBUG("Insert incomplete comm pattern %p for process %ld", pattern.get(), issuer->pid);
-  xbt_dynar_t dynar = xbt_dynar_get_as(incomplete_communications_pattern, issuer->pid, xbt_dynar_t);
+  XBT_DEBUG("Insert incomplete comm pattern %p for process %ld", pattern.get(), issuer->pid_);
+  xbt_dynar_t dynar = xbt_dynar_get_as(incomplete_communications_pattern, issuer->pid_, xbt_dynar_t);
   simgrid::mc::PatternCommunication* pattern2 = pattern.release();
   xbt_dynar_push(dynar, &pattern2);
 }
index b44a106..9aeaff7 100644 (file)
@@ -230,7 +230,7 @@ void SafetyChecker::backtrack()
               state->num);
           }
 
-          if (not prev_state->actorStates[issuer->pid].isDone())
+          if (not prev_state->actorStates[issuer->pid_].isDone())
             prev_state->addInterleavingSet(issuer);
           else
             XBT_DEBUG("Process %p is in done set", req->issuer);
@@ -246,11 +246,8 @@ void SafetyChecker::backtrack()
 
           const smx_actor_t previous_issuer = MC_smx_simcall_get_issuer(&prev_state->internal_req);
           XBT_DEBUG("Simcall %d, process %ld (state %d) and simcall %d, process %ld (state %d) are independent",
-                    req->call, issuer->pid, state->num,
-                    prev_state->internal_req.call,
-                    previous_issuer->pid,
+                    req->call, issuer->pid_, state->num, prev_state->internal_req.call, previous_issuer->pid_,
                     prev_state->num);
-
         }
       }
     }
index b525f40..b9baf91 100644 (file)
@@ -73,7 +73,7 @@ bool actor_is_enabled(smx_actor_t actor)
 #if SIMGRID_HAVE_MC
   // If in the MCer, ask the client app since it has all the data
   if (mc_model_checker != nullptr) {
-    return mc_model_checker->process().actor_is_enabled(actor->pid);
+    return mc_model_checker->process().actor_is_enabled(actor->pid_);
   }
 #endif
 
@@ -116,7 +116,7 @@ bool actor_is_enabled(smx_actor_t actor)
 
       if (mutex->owner == nullptr)
         return true;
-      return mutex->owner->pid == req->issuer->pid;
+      return mutex->owner->pid_ == req->issuer->pid_;
     }
 
     case SIMCALL_SEM_ACQUIRE: {
index 8e872d9..e579040 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2008-2018. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2008-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -549,7 +548,7 @@ std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
   std::shared_ptr<simgrid::mc::Snapshot> snapshot = std::make_shared<simgrid::mc::Snapshot>(mc_process, num_state);
 
   for (auto const& p : mc_model_checker->process().actors())
-    snapshot->enabled_processes.insert(p.copy.getBuffer()->pid);
+    snapshot->enabled_processes.insert(p.copy.getBuffer()->pid_);
 
   snapshot_handle_ignore(snapshot.get());
 
index 3bcefee..8baa20a 100644 (file)
@@ -95,8 +95,7 @@ void MC_handle_comm_pattern(
                                 value, sizeof(comm_addr));
       comm_addr = remote(addr);
       }
-      checker->complete_comm_pattern(pattern, comm_addr,
-        MC_smx_simcall_get_issuer(req)->pid, backtracking);
+      checker->complete_comm_pattern(pattern, comm_addr, MC_smx_simcall_get_issuer(req)->pid_, backtracking);
     }
     break;
   default:
index ac4ccd4..9b8ce3c 100644 (file)
@@ -175,11 +175,11 @@ double MC_process_clock_get(smx_actor_t process)
   if (simgrid::mc::processes_time.empty())
     return 0;
   if (process != nullptr)
-    return simgrid::mc::processes_time[process->pid];
+    return simgrid::mc::processes_time[process->pid_];
   return -1;
 }
 
 void MC_process_clock_add(smx_actor_t process, double amount)
 {
-  simgrid::mc::processes_time[process->pid] += amount;
+  simgrid::mc::processes_time[process->pid_] += amount;
 }
index 09f9c88..86f9ce8 100644 (file)
@@ -221,11 +221,11 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
     type = "iSend";
     char* p = pointer_to_string(simcall_comm_isend__get__src_buff(req));
     char* bs = buff_size_to_string(simcall_comm_isend__get__src_buff_size(req));
-    if (issuer->host)
-      args = bprintf("src=(%ld)%s (%s), buff=%s, size=%s", issuer->pid, MC_smx_actor_get_host_name(issuer),
+    if (issuer->host_)
+      args = bprintf("src=(%ld)%s (%s), buff=%s, size=%s", issuer->pid_, MC_smx_actor_get_host_name(issuer),
                      MC_smx_actor_get_name(issuer), p, bs);
     else
-      args = bprintf("src=(%ld)%s, buff=%s, size=%s", issuer->pid, MC_smx_actor_get_name(issuer), p, bs);
+      args = bprintf("src=(%ld)%s, buff=%s, size=%s", issuer->pid_, MC_smx_actor_get_name(issuer), p, bs);
     xbt_free(bs);
     xbt_free(p);
     break;
@@ -241,11 +241,11 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
     type = "iRecv";
     char* p = pointer_to_string(simcall_comm_irecv__get__dst_buff(req));
     char* bs = buff_size_to_string(size);
-    if (issuer->host)
-      args = bprintf("dst=(%ld)%s (%s), buff=%s, size=%s", issuer->pid, MC_smx_actor_get_host_name(issuer),
+    if (issuer->host_)
+      args = bprintf("dst=(%ld)%s (%s), buff=%s, size=%s", issuer->pid_, MC_smx_actor_get_host_name(issuer),
                      MC_smx_actor_get_name(issuer), p, bs);
     else
-      args = bprintf("dst=(%ld)%s, buff=%s, size=%s", issuer->pid, MC_smx_actor_get_name(issuer), p, bs);
+      args = bprintf("dst=(%ld)%s, buff=%s, size=%s", issuer->pid_, MC_smx_actor_get_name(issuer), p, bs);
     xbt_free(bs);
     xbt_free(p);
     break;
@@ -275,9 +275,9 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
       smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->src_proc));
       smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->dst_proc));
       args =
-          bprintf("comm=%s [(%ld)%s (%s)-> (%ld)%s (%s)]", p, src_proc ? src_proc->pid : 0,
+          bprintf("comm=%s [(%ld)%s (%s)-> (%ld)%s (%s)]", p, src_proc ? src_proc->pid_ : 0,
                   src_proc ? MC_smx_actor_get_host_name(src_proc) : "", src_proc ? MC_smx_actor_get_name(src_proc) : "",
-                  dst_proc ? dst_proc->pid : 0, dst_proc ? MC_smx_actor_get_host_name(dst_proc) : "",
+                  dst_proc ? dst_proc->pid_ : 0, dst_proc ? MC_smx_actor_get_host_name(dst_proc) : "",
                   dst_proc ? MC_smx_actor_get_name(dst_proc) : "");
     }
     xbt_free(p);
@@ -307,8 +307,8 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
 
       smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->src_proc));
       smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->dst_proc));
-      args = bprintf("comm=%s [(%ld)%s (%s) -> (%ld)%s (%s)]", p, src_proc->pid, MC_smx_actor_get_name(src_proc),
-                     MC_smx_actor_get_host_name(src_proc), dst_proc->pid, MC_smx_actor_get_name(dst_proc),
+      args = bprintf("comm=%s [(%ld)%s (%s) -> (%ld)%s (%s)]", p, src_proc->pid_, MC_smx_actor_get_name(src_proc),
+                     MC_smx_actor_get_host_name(src_proc), dst_proc->pid_, MC_smx_actor_get_name(dst_proc),
                      MC_smx_actor_get_host_name(dst_proc));
     }
     xbt_free(p);
@@ -363,7 +363,7 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
     args =
         bprintf("locked = %d, owner = %d, sleeping = n/a", mutex.getBuffer()->locked,
                 mutex.getBuffer()->owner != nullptr
-                    ? (int)mc_model_checker->process().resolveActor(simgrid::mc::remote(mutex.getBuffer()->owner))->pid
+                    ? (int)mc_model_checker->process().resolveActor(simgrid::mc::remote(mutex.getBuffer()->owner))->pid_
                     : -1);
     break;
   }
@@ -381,10 +381,10 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
 
   std::string str;
   if (args != nullptr)
-    str = simgrid::xbt::string_printf("[(%ld)%s (%s)] %s(%s)", issuer->pid, MC_smx_actor_get_host_name(issuer),
+    str = simgrid::xbt::string_printf("[(%ld)%s (%s)] %s(%s)", issuer->pid_, MC_smx_actor_get_host_name(issuer),
                                       MC_smx_actor_get_name(issuer), type, args);
   else
-    str = simgrid::xbt::string_printf("[(%ld)%s (%s)] %s ", issuer->pid, MC_smx_actor_get_host_name(issuer),
+    str = simgrid::xbt::string_printf("[(%ld)%s (%s)] %s ", issuer->pid_, MC_smx_actor_get_host_name(issuer),
                                       MC_smx_actor_get_name(issuer), type);
   xbt_free(args);
   return str;
@@ -452,25 +452,25 @@ std::string request_get_dot_output(smx_simcall_t req, int value)
 
   switch (req->call) {
   case SIMCALL_COMM_ISEND:
-    if (issuer->host)
-      label = simgrid::xbt::string_printf("[(%ld)%s] iSend", issuer->pid, MC_smx_actor_get_host_name(issuer));
+    if (issuer->host_)
+      label = simgrid::xbt::string_printf("[(%ld)%s] iSend", issuer->pid_, MC_smx_actor_get_host_name(issuer));
     else
-      label = bprintf("[(%ld)] iSend", issuer->pid);
+      label = bprintf("[(%ld)] iSend", issuer->pid_);
     break;
 
   case SIMCALL_COMM_IRECV:
-    if (issuer->host)
-      label = simgrid::xbt::string_printf("[(%ld)%s] iRecv", issuer->pid, MC_smx_actor_get_host_name(issuer));
+    if (issuer->host_)
+      label = simgrid::xbt::string_printf("[(%ld)%s] iRecv", issuer->pid_, MC_smx_actor_get_host_name(issuer));
     else
-      label = simgrid::xbt::string_printf("[(%ld)] iRecv", issuer->pid);
+      label = simgrid::xbt::string_printf("[(%ld)] iRecv", issuer->pid_);
     break;
 
   case SIMCALL_COMM_WAIT:
     if (value == -1) {
-      if (issuer->host)
-        label = simgrid::xbt::string_printf("[(%ld)%s] WaitTimeout", issuer->pid, MC_smx_actor_get_host_name(issuer));
+      if (issuer->host_)
+        label = simgrid::xbt::string_printf("[(%ld)%s] WaitTimeout", issuer->pid_, MC_smx_actor_get_host_name(issuer));
       else
-        label = simgrid::xbt::string_printf("[(%ld)] WaitTimeout", issuer->pid);
+        label = simgrid::xbt::string_printf("[(%ld)] WaitTimeout", issuer->pid_);
     } else {
       simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_wait__getraw__comm(req);
       simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
@@ -480,15 +480,13 @@ std::string request_get_dot_output(smx_simcall_t req, int value)
 
       smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->src_proc));
       smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_proc));
-      if (issuer->host)
-        label = simgrid::xbt::string_printf("[(%ld)%s] Wait [(%ld)->(%ld)]", issuer->pid,
-                                            MC_smx_actor_get_host_name(issuer), src_proc ? src_proc->pid : 0,
-                                            dst_proc ? dst_proc->pid : 0);
+      if (issuer->host_)
+        label = simgrid::xbt::string_printf("[(%ld)%s] Wait [(%ld)->(%ld)]", issuer->pid_,
+                                            MC_smx_actor_get_host_name(issuer), src_proc ? src_proc->pid_ : 0,
+                                            dst_proc ? dst_proc->pid_ : 0);
       else
-        label = simgrid::xbt::string_printf("[(%ld)] Wait [(%ld)->(%ld)]",
-                    issuer->pid,
-                    src_proc ? src_proc->pid : 0,
-                    dst_proc ? dst_proc->pid : 0);
+        label = simgrid::xbt::string_printf("[(%ld)] Wait [(%ld)->(%ld)]", issuer->pid_, src_proc ? src_proc->pid_ : 0,
+                                            dst_proc ? dst_proc->pid_ : 0);
     }
     break;
 
@@ -498,15 +496,15 @@ std::string request_get_dot_output(smx_simcall_t req, int value)
     mc_model_checker->process().read(temp_comm, remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
     simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
     if (comm->src_proc == nullptr || comm->dst_proc == nullptr) {
-      if (issuer->host)
-        label = simgrid::xbt::string_printf("[(%ld)%s] Test FALSE", issuer->pid, MC_smx_actor_get_host_name(issuer));
+      if (issuer->host_)
+        label = simgrid::xbt::string_printf("[(%ld)%s] Test FALSE", issuer->pid_, MC_smx_actor_get_host_name(issuer));
       else
-        label = bprintf("[(%ld)] Test FALSE", issuer->pid);
+        label = bprintf("[(%ld)] Test FALSE", issuer->pid_);
     } else {
-      if (issuer->host)
-        label = simgrid::xbt::string_printf("[(%ld)%s] Test TRUE", issuer->pid, MC_smx_actor_get_host_name(issuer));
+      if (issuer->host_)
+        label = simgrid::xbt::string_printf("[(%ld)%s] Test TRUE", issuer->pid_, MC_smx_actor_get_host_name(issuer));
       else
-        label = simgrid::xbt::string_printf("[(%ld)] Test TRUE", issuer->pid);
+        label = simgrid::xbt::string_printf("[(%ld)] Test TRUE", issuer->pid_);
     }
     break;
   }
@@ -514,55 +512,53 @@ std::string request_get_dot_output(smx_simcall_t req, int value)
   case SIMCALL_COMM_WAITANY: {
     unsigned long comms_size = read_length(
       mc_model_checker->process(), remote(simcall_comm_waitany__get__comms(req)));
-    if (issuer->host)
-      label = simgrid::xbt::string_printf("[(%ld)%s] WaitAny [%d of %lu]", issuer->pid,
+    if (issuer->host_)
+      label = simgrid::xbt::string_printf("[(%ld)%s] WaitAny [%d of %lu]", issuer->pid_,
                                           MC_smx_actor_get_host_name(issuer), value + 1, comms_size);
     else
-      label = simgrid::xbt::string_printf("[(%ld)] WaitAny [%d of %lu]",
-                  issuer->pid, value + 1, comms_size);
+      label = simgrid::xbt::string_printf("[(%ld)] WaitAny [%d of %lu]", issuer->pid_, value + 1, comms_size);
     break;
   }
 
   case SIMCALL_COMM_TESTANY:
     if (value == -1) {
-      if (issuer->host)
-        label = simgrid::xbt::string_printf("[(%ld)%s] TestAny FALSE", issuer->pid, MC_smx_actor_get_host_name(issuer));
+      if (issuer->host_)
+        label =
+            simgrid::xbt::string_printf("[(%ld)%s] TestAny FALSE", issuer->pid_, MC_smx_actor_get_host_name(issuer));
       else
-        label = simgrid::xbt::string_printf("[(%ld)] TestAny FALSE", issuer->pid);
+        label = simgrid::xbt::string_printf("[(%ld)] TestAny FALSE", issuer->pid_);
     } else {
-      if (issuer->host)
-        label = simgrid::xbt::string_printf("[(%ld)%s] TestAny TRUE [%d of %lu]", issuer->pid,
+      if (issuer->host_)
+        label = simgrid::xbt::string_printf("[(%ld)%s] TestAny TRUE [%d of %lu]", issuer->pid_,
                                             MC_smx_actor_get_host_name(issuer), value + 1,
                                             simcall_comm_testany__get__count(req));
       else
-        label = simgrid::xbt::string_printf("[(%ld)] TestAny TRUE [%d of %lu]",
-                    issuer->pid,
-                    value + 1,
-                    simcall_comm_testany__get__count(req));
+        label = simgrid::xbt::string_printf("[(%ld)] TestAny TRUE [%d of %lu]", issuer->pid_, value + 1,
+                                            simcall_comm_testany__get__count(req));
     }
     break;
 
   case SIMCALL_MUTEX_TRYLOCK:
-    label = simgrid::xbt::string_printf("[(%ld)] Mutex TRYLOCK", issuer->pid);
+    label = simgrid::xbt::string_printf("[(%ld)] Mutex TRYLOCK", issuer->pid_);
     break;
 
   case SIMCALL_MUTEX_LOCK:
-    label = simgrid::xbt::string_printf("[(%ld)] Mutex LOCK", issuer->pid);
+    label = simgrid::xbt::string_printf("[(%ld)] Mutex LOCK", issuer->pid_);
     break;
 
   case SIMCALL_MC_RANDOM:
-    if (issuer->host)
-      label = simgrid::xbt::string_printf("[(%ld)%s] MC_RANDOM (%d)", issuer->pid, MC_smx_actor_get_host_name(issuer),
+    if (issuer->host_)
+      label = simgrid::xbt::string_printf("[(%ld)%s] MC_RANDOM (%d)", issuer->pid_, MC_smx_actor_get_host_name(issuer),
                                           value);
     else
-      label = simgrid::xbt::string_printf("[(%ld)] MC_RANDOM (%d)", issuer->pid, value);
+      label = simgrid::xbt::string_printf("[(%ld)] MC_RANDOM (%d)", issuer->pid_, value);
     break;
 
   default:
     THROW_UNIMPLEMENTED;
   }
 
-  const char* color = get_color(issuer->pid - 1);
+  const char* color = get_color(issuer->pid_ - 1);
   return  simgrid::xbt::string_printf(
         "label = \"%s\", color = %s, fontcolor = %s", label.c_str(),
         color, color);
index 7191cb4..c591270 100644 (file)
@@ -117,7 +117,7 @@ smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall const* req)
 const char* MC_smx_actor_get_host_name(smx_actor_t actor)
 {
   if (mc_model_checker == nullptr)
-    return actor->host->get_cname();
+    return actor->host_->get_cname();
 
   simgrid::mc::RemoteClient* process = &mc_model_checker->process();
 
@@ -141,7 +141,7 @@ const char* MC_smx_actor_get_host_name(smx_actor_t actor)
 
   // Read the simgrid::xbt::string in the MCed process:
   simgrid::mc::ActorInformation* info     = actor_info_cast(actor);
-  auto remote_string_address              = remote((simgrid::xbt::string_data*)((char*)actor->host + offset));
+  auto remote_string_address              = remote((simgrid::xbt::string_data*)((char*)actor->host_ + offset));
   simgrid::xbt::string_data remote_string = process->read(remote_string_address);
   char hostname[remote_string.len];
   process->read_bytes(hostname, remote_string.len + 1, remote(remote_string.data));
@@ -153,11 +153,11 @@ const char* MC_smx_actor_get_name(smx_actor_t actor)
 {
   simgrid::mc::RemoteClient* process = &mc_model_checker->process();
   if (mc_model_checker == nullptr)
-    return actor->name.c_str();
+    return actor->get_cname();
 
   simgrid::mc::ActorInformation* info = actor_info_cast(actor);
   if (info->name.empty()) {
-    simgrid::xbt::string_data string_data = simgrid::xbt::string::to_string_data(actor->name);
+    simgrid::xbt::string_data string_data = simgrid::xbt::string::to_string_data(actor->name_);
     info->name = process->read_string(remote(string_data.data), string_data.len);
   }
   return info->name.c_str();
index 92aff1f..491f2dc 100644 (file)
@@ -70,7 +70,7 @@ Transition State::getTransition() const
 static inline smx_simcall_t MC_state_get_request_for_process(simgrid::mc::State* state, smx_actor_t actor)
 {
   /* reset the outgoing transition */
-  simgrid::mc::ProcessState* procstate = &state->actorStates[actor->pid];
+  simgrid::mc::ProcessState* procstate = &state->actorStates[actor->pid_];
   state->transition.pid                = -1;
   state->transition.argument           = -1;
   state->executed_req.call             = SIMCALL_NONE;
@@ -152,7 +152,7 @@ static inline smx_simcall_t MC_state_get_request_for_process(simgrid::mc::State*
   if (not req)
     return nullptr;
 
-  state->transition.pid = actor->pid;
+  state->transition.pid = actor->pid_;
   state->executed_req = *req;
   // Fetch the data of the request and translate it:
   state->internal_req = *req;
@@ -212,7 +212,7 @@ smx_simcall_t MC_state_get_request(simgrid::mc::State* state)
 {
   for (auto& actor : mc_model_checker->process().actors()) {
     /* Only consider the actors that were marked as interleaving by the checker algorithm */
-    if (not state->actorStates[actor.copy.getBuffer()->pid].isTodo())
+    if (not state->actorStates[actor.copy.getBuffer()->pid_].isTodo())
       continue;
 
     smx_simcall_t res = MC_state_get_request_for_process(state, actor.copy.getBuffer());
index ed4ce9a..dc3a52b 100644 (file)
@@ -129,7 +129,7 @@ public:
   explicit State(unsigned long state_number);
 
   std::size_t interleaveSize() const;
-  void addInterleavingSet(smx_actor_t actor) { this->actorStates[actor->pid].consider(); }
+  void addInterleavingSet(smx_actor_t actor) { this->actorStates[actor->pid_].consider(); }
   Transition getTransition() const;
 };
 }
index df02e4a..055a90a 100644 (file)
@@ -259,7 +259,7 @@ void Client::declareStack(void* stack, size_t size, smx_actor_t process, ucontex
   region.block   = ((char*)stack - (char*)heap->heapbase) / BLOCKSIZE + 1;
 #if HAVE_SMPI
   if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP && process)
-    region.process_index = process->pid - 1;
+    region.process_index = process->pid_ - 1;
   else
 #endif
     region.process_index = -1;
index 12084ff..2c6ef63 100644 (file)
@@ -40,7 +40,7 @@ void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_actor)
     msg_actor = (simgrid::msg::ActorExt*)SIMIX_process_self_get_data();
     SIMIX_process_self_set_data(nullptr);
   } else {
-    msg_actor = (simgrid::msg::ActorExt*)smx_actor->getUserData();
+    msg_actor = (simgrid::msg::ActorExt*)smx_actor->get_user_data();
     simcall_process_set_data(smx_actor, nullptr);
   }
 
@@ -210,7 +210,7 @@ void* MSG_process_get_data(msg_process_t process)
   xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
 
   /* get from SIMIX the MSG process data, and then the user data */
-  simgrid::msg::ActorExt* msgExt = (simgrid::msg::ActorExt*)process->get_impl()->getUserData();
+  simgrid::msg::ActorExt* msgExt = (simgrid::msg::ActorExt*)process->get_impl()->get_user_data();
   if (msgExt)
     return msgExt->data;
   else
@@ -226,7 +226,7 @@ msg_error_t MSG_process_set_data(msg_process_t process, void *data)
 {
   xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
 
-  static_cast<simgrid::msg::ActorExt*>(process->get_impl()->getUserData())->data = data;
+  static_cast<simgrid::msg::ActorExt*>(process->get_impl()->get_user_data())->data = data;
 
   return MSG_OK;
 }
@@ -264,7 +264,7 @@ int MSG_process_get_number()
 int MSG_process_self_PID()
 {
   smx_actor_t self = SIMIX_process_self();
-  return self == nullptr ? 0 : self->pid;
+  return self == nullptr ? 0 : self->pid_;
 }
 
 /** \ingroup m_process_management
@@ -296,7 +296,7 @@ msg_process_t MSG_process_self()
 }
 
 smx_context_t MSG_process_get_smx_ctx(msg_process_t process) { // deprecated -- smx_context_t should die afterward
-  return process->get_impl()->context;
+  return process->get_impl()->context_;
 }
 /**
  * \ingroup m_process_management
index 19a7b8c..0b89632 100644 (file)
@@ -143,7 +143,7 @@ void VirtualMachineImpl::suspend(smx_actor_t issuer)
 {
   if (get_state() != s4u::VirtualMachine::state::RUNNING)
     THROWF(vm_error, 0, "Cannot suspend VM %s: it is not running.", piface_->get_cname());
-  if (issuer->host == piface_)
+  if (issuer->host_ == piface_)
     THROWF(vm_error, 0, "Actor %s cannot suspend the VM %s in which it runs", issuer->get_cname(),
            piface_->get_cname());
 
@@ -153,7 +153,7 @@ void VirtualMachineImpl::suspend(smx_actor_t issuer)
   action_->suspend();
 
   for (auto& smx_process : process_list) {
-    XBT_DEBUG("suspend %s", smx_process.name.c_str());
+    XBT_DEBUG("suspend %s", smx_process.get_cname());
     smx_process.suspend(issuer);
   }
 
@@ -213,7 +213,7 @@ void VirtualMachineImpl::shutdown(smx_actor_t issuer)
 
   for (auto& smx_process : process_list) {
     XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", smx_process.get_cname(),
-              smx_process.host->get_cname(), issuer->get_cname());
+              smx_process.host_->get_cname(), issuer->get_cname());
     SIMIX_process_kill(&smx_process, issuer);
   }
 
index 105cd93..4dc1133 100644 (file)
@@ -71,7 +71,7 @@ void Actor::join(double timeout)
 
 void Actor::set_auto_restart(bool autorestart)
 {
-  simgrid::simix::simcall([this, autorestart]() { pimpl_->auto_restart = autorestart; });
+  simgrid::simix::simcall([this, autorestart]() { pimpl_->auto_restart_ = autorestart; });
 }
 
 void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
@@ -114,7 +114,7 @@ void Actor::migrate(Host* new_host)
 
 s4u::Host* Actor::get_host()
 {
-  return this->pimpl_->host;
+  return this->pimpl_->host_;
 }
 
 void Actor::daemonize()
@@ -124,7 +124,7 @@ void Actor::daemonize()
 
 bool Actor::is_daemon() const
 {
-  return this->pimpl_->isDaemon();
+  return this->pimpl_->is_daemon();
 }
 
 const simgrid::xbt::string& Actor::get_name() const
@@ -139,12 +139,12 @@ const char* Actor::get_cname() const
 
 aid_t Actor::get_pid() const
 {
-  return this->pimpl_->pid;
+  return this->pimpl_->pid_;
 }
 
 aid_t Actor::get_ppid() const
 {
-  return this->pimpl_->ppid;
+  return this->pimpl_->ppid_;
 }
 
 void Actor::suspend()
@@ -159,9 +159,9 @@ void Actor::resume()
   s4u::Actor::on_resume(this);
 }
 
-int Actor::is_suspended()
+bool Actor::is_suspended()
 {
-  return simgrid::simix::simcall([this] { return pimpl_->suspended; });
+  return simgrid::simix::simcall([this] { return pimpl_->suspended_; });
 }
 
 void Actor::set_kill_time(double time)
@@ -321,12 +321,12 @@ ExecPtr exec_async(double flops)
 
 aid_t get_pid()
 {
-  return SIMIX_process_self()->pid;
+  return SIMIX_process_self()->pid_;
 }
 
 aid_t get_ppid()
 {
-  return SIMIX_process_self()->ppid;
+  return SIMIX_process_self()->ppid_;
 }
 
 std::string get_name()
@@ -341,7 +341,7 @@ const char* get_cname()
 
 Host* get_host()
 {
-  return SIMIX_process_self()->host;
+  return SIMIX_process_self()->host_;
 }
 
 void suspend()
@@ -362,7 +362,7 @@ void resume()
 bool is_suspended()
 {
   smx_actor_t process = SIMIX_process_self();
-  return simgrid::simix::simcall([process] { return process->suspended; });
+  return simgrid::simix::simcall([process] { return process->suspended_; });
 }
 
 void kill()
index 476ea1c..f897380 100644 (file)
@@ -86,7 +86,7 @@ Host* Host::current()
   smx_actor_t smx_proc = SIMIX_process_self();
   if (smx_proc == nullptr)
     xbt_die("Cannot call Host::current() from the maestro context");
-  return smx_proc->host;
+  return smx_proc->host_;
 }
 
 void Host::turn_on()
@@ -117,7 +117,7 @@ void Host::turn_off()
         for (auto& process : host->process_list) {
           SIMIX_process_kill(&process, self);
           XBT_DEBUG("Killing %s@%s on behalf of %s which turned off that host.", process.get_cname(),
-                    process.host->get_cname(), self->get_cname());
+                    process.host_->get_cname(), self->get_cname());
         }
       }
 
@@ -644,5 +644,5 @@ void sg_host_get_actor_list(sg_host_t host, xbt_dynar_t whereto)
 sg_host_t sg_host_self()
 {
   smx_actor_t process = SIMIX_process_self();
-  return (process == nullptr) ? nullptr : process->host;
+  return (process == nullptr) ? nullptr : process->host_;
 }
index fe72f94..943889d 100644 (file)
@@ -54,10 +54,10 @@ int SIMIX_process_has_pending_comms(smx_actor_t process) {
  */
 void SIMIX_process_cleanup(smx_actor_t process)
 {
-  XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->name.c_str(), process,
+  XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p", process->get_cname(), process,
             process->waiting_synchro.get());
 
-  process->finished = true;
+  process->finished_ = true;
   SIMIX_process_on_exit_runall(process);
 
   /* Unregister from the kill timer if any */
@@ -99,16 +99,16 @@ void SIMIX_process_cleanup(smx_actor_t process)
   }
 
   XBT_DEBUG("%p should not be run anymore",process);
-  simix_global->process_list.erase(process->pid);
-  if (process->host && process->host_process_list_hook.is_linked())
-    simgrid::xbt::intrusive_erase(process->host->extension<simgrid::simix::Host>()->process_list, *process);
+  simix_global->process_list.erase(process->pid_);
+  if (process->host_ && process->host_process_list_hook.is_linked())
+    simgrid::xbt::intrusive_erase(process->host_->extension<simgrid::simix::Host>()->process_list, *process);
   if (not process->smx_destroy_list_hook.is_linked()) {
 #if SIMGRID_HAVE_MC
     xbt_dynar_push_as(simix_global->dead_actors_vector, smx_actor_t, process);
 #endif
     simix_global->process_to_destroy.push_back(*process);
   }
-  process->context->iwannadie = 0;
+  process->context_->iwannadie = 0;
 
   xbt_os_mutex_release(simix_global->mutex);
 }
@@ -138,7 +138,7 @@ namespace actor {
 
 ActorImpl::~ActorImpl()
 {
-  delete this->context;
+  delete this->context_;
 }
 
 static void dying_daemon(int /*exit_status*/, void* data)
@@ -156,8 +156,8 @@ static void dying_daemon(int /*exit_status*/, void* data)
 /** This process will be terminated automatically when the last non-daemon process finishes */
 void ActorImpl::daemonize()
 {
-  if (not daemon) {
-    daemon = true;
+  if (not daemon_) {
+    daemon_ = true;
     simix_global->daemons.push_back(this);
     SIMIX_process_on_exit(this, dying_daemon, this);
   }
@@ -165,18 +165,18 @@ void ActorImpl::daemonize()
 
 simgrid::s4u::Actor* ActorImpl::restart()
 {
-  XBT_DEBUG("Restarting process %s on %s", get_cname(), host->get_cname());
+  XBT_DEBUG("Restarting process %s on %s", get_cname(), host_->get_cname());
 
   // retrieve the arguments of the old process
   // FIXME: Factorize this with SIMIX_host_add_auto_restart_process ?
   simgrid::kernel::actor::ProcessArg arg;
-  arg.name         = name;
+  arg.name         = name_;
   arg.code         = code;
-  arg.host         = host;
+  arg.host         = host_;
   arg.kill_time    = SIMIX_timer_get_date(kill_timer);
-  arg.data         = userdata;
+  arg.data         = userdata_;
   arg.properties   = nullptr;
-  arg.auto_restart = auto_restart;
+  arg.auto_restart = auto_restart_;
 
   // kill the old process
   SIMIX_process_kill(this, (this == simix_global->maestro_process) ? this : SIMIX_process_self());
@@ -187,19 +187,19 @@ simgrid::s4u::Actor* ActorImpl::restart()
   if (arg.kill_time >= 0)
     simcall_process_set_kill_time(actor, arg.kill_time);
   if (arg.auto_restart)
-    actor->auto_restart = arg.auto_restart;
+    actor->auto_restart_ = arg.auto_restart;
 
   return actor->ciface();
 }
 
 smx_activity_t ActorImpl::suspend(ActorImpl* issuer)
 {
-  if (suspended) {
-    XBT_DEBUG("Actor '%s' is already suspended", name.c_str());
+  if (suspended_) {
+    XBT_DEBUG("Actor '%s' is already suspended", get_cname());
     return nullptr;
   }
 
-  suspended = 1;
+  suspended_ = 1;
 
   /* If we are suspending another actor that is waiting on a sync, suspend its synchronization. */
   if (this != issuer) {
@@ -209,7 +209,7 @@ smx_activity_t ActorImpl::suspend(ActorImpl* issuer)
 
     return nullptr;
   } else {
-    return SIMIX_execution_start("suspend", 0.0, 1.0, 0.0, this->host);
+    return SIMIX_execution_start("suspend", 0.0, 1.0, 0.0, this->host_);
   }
 }
 
@@ -217,14 +217,14 @@ void ActorImpl::resume()
 {
   XBT_IN("process = %p", this);
 
-  if (context->iwannadie) {
+  if (context_->iwannadie) {
     XBT_VERB("Ignoring request to suspend an actor that is currently dying.");
     return;
   }
 
-  if (not suspended)
+  if (not suspended_)
     return;
-  suspended = 0;
+  suspended_ = 0;
 
   /* resume the synchronization that was blocking the resumed actor. */
   if (waiting_synchro)
@@ -235,12 +235,12 @@ void ActorImpl::resume()
 
 smx_activity_t ActorImpl::sleep(double duration)
 {
-  if (host->is_off())
-    THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host->get_cname());
+  if (host_->is_off())
+    THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host_->get_cname());
 
   simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
-  synchro->host                                 = host;
-  synchro->surf_sleep                           = host->pimpl_cpu->sleep(duration);
+  synchro->host                                 = host_;
+  synchro->surf_sleep                           = host_->pimpl_cpu->sleep(duration);
   synchro->surf_sleep->set_data(synchro);
   XBT_DEBUG("Create sleep synchronization %p", synchro);
 
@@ -252,16 +252,16 @@ void create_maestro(simgrid::simix::ActorCode code)
   smx_actor_t maestro = nullptr;
   /* Create maestro process and initialize it */
   maestro           = new simgrid::kernel::actor::ActorImpl();
-  maestro->pid = simix_process_maxpid++;
-  maestro->name = "";
-  maestro->setUserData(nullptr);
+  maestro->pid_     = simix_process_maxpid++;
+  maestro->name_    = "";
+  maestro->set_user_data(nullptr);
 
   if (not code) {
-    maestro->context = SIMIX_context_new(simgrid::simix::ActorCode(), nullptr, maestro);
+    maestro->context_ = SIMIX_context_new(simgrid::simix::ActorCode(), nullptr, maestro);
   } else {
     if (not simix_global)
       xbt_die("simix is not initialized, please call MSG_init first");
-    maestro->context = simix_global->context_factory->create_maestro(code, maestro);
+    maestro->context_ = simix_global->context_factory->create_maestro(code, maestro);
   }
 
   maestro->simcall.issuer = maestro;
@@ -302,20 +302,20 @@ smx_actor_t SIMIX_process_create(const char* name, simgrid::simix::ActorCode cod
 
   xbt_assert(code && host != nullptr, "Invalid parameters");
   /* Process data */
-  process->pid            = simix_process_maxpid++;
-  process->name           = simgrid::xbt::string(name);
-  process->host           = host;
-  process->setUserData(data);
+  process->pid_           = simix_process_maxpid++;
+  process->name_          = simgrid::xbt::string(name);
+  process->host_          = host;
+  process->set_user_data(data);
   process->simcall.issuer = process;
 
   if (parent_process != nullptr) {
-    process->ppid = parent_process->pid;
+    process->ppid_ = parent_process->pid_;
   }
 
   process->code         = code;
 
-  XBT_VERB("Create context %s", process->name.c_str());
-  process->context = SIMIX_context_new(std::move(code), simix_global->cleanup_process_function, process);
+  XBT_VERB("Create context %s", process->get_cname());
+  process->context_ = SIMIX_context_new(std::move(code), simix_global->cleanup_process_function, process);
 
   /* Add properties */
   if (properties != nullptr)
@@ -329,10 +329,10 @@ smx_actor_t SIMIX_process_create(const char* name, simgrid::simix::ActorCode cod
   /* Add the process to its host's process list */
   host->extension<simgrid::simix::Host>()->process_list.push_back(*process);
 
-  XBT_DEBUG("Start context '%s'", process->name.c_str());
+  XBT_DEBUG("Start context '%s'", process->get_cname());
 
   /* Now insert it in the global process list and in the process to run list */
-  simix_global->process_list[process->pid] = process;
+  simix_global->process_list[process->pid_] = process;
   XBT_DEBUG("Inserting %s(%s) in the to_run list", process->get_cname(), host->get_cname());
   simix_global->process_to_run.push_back(process);
   intrusive_ptr_add_ref(process);
@@ -360,23 +360,23 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
 
   smx_actor_t process = new simgrid::kernel::actor::ActorImpl();
   /* Process data */
-  process->pid = simix_process_maxpid++;
-  process->name = std::string(name);
-  process->host = host;
-  process->setUserData(data);
+  process->pid = simix_process_maxpid++;
+  process->name_ = std::string(name);
+  process->host_ = host;
+  process->set_user_data(data);
   process->simcall.issuer = process;
 
   if (parent_process != nullptr) {
-    process->ppid = parent_process->pid;
+    process->ppid_ = parent_process->pid_;
   }
 
   /* Process data for auto-restart */
   process->code = nullptr;
 
-  XBT_VERB("Create context %s", process->name.c_str());
+  XBT_VERB("Create context %s", process->get_cname());
   if (not simix_global)
     xbt_die("simix is not initialized, please call MSG_init first");
-  process->context = simix_global->context_factory->attach(simix_global->cleanup_process_function, process);
+  process->context_ = simix_global->context_factory->attach(simix_global->cleanup_process_function, process);
 
   /* Add properties */
   if (properties != nullptr)
@@ -387,13 +387,12 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
   host->extension<simgrid::simix::Host>()->process_list.push_back(*process);
 
   /* Now insert it in the global process list and in the process to run list */
-  simix_global->process_list[process->pid] = process;
+  simix_global->process_list[process->pid_] = process;
   XBT_DEBUG("Inserting %s(%s) in the to_run list", process->get_cname(), host->get_cname());
   simix_global->process_to_run.push_back(process);
   intrusive_ptr_add_ref(process);
 
-
-  auto* context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
+  auto* context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context_);
   if (not context)
     xbt_die("Not a suitable context");
 
@@ -445,18 +444,18 @@ void SIMIX_process_runall()
  */
 void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
 
-  if (process->finished) {
+  if (process->finished_) {
     XBT_DEBUG("Ignoring request to kill process %s@%s that is already dead", process->get_cname(),
-              process->host->get_cname());
+              process->host_->get_cname());
     return;
   }
 
-  XBT_DEBUG("Actor '%s'@%s is killing actor '%s'@%s", issuer->get_cname(), issuer->host->get_cname(),
-            process->get_cname(), process->host->get_cname());
+  XBT_DEBUG("Actor '%s'@%s is killing actor '%s'@%s", issuer->get_cname(), issuer->host_->get_cname(),
+            process->get_cname(), process->host_->get_cname());
 
-  process->context->iwannadie = 1;
-  process->blocked = 0;
-  process->suspended = 0;
+  process->context_->iwannadie = 1;
+  process->blocked_           = 0;
+  process->suspended_         = 0;
   process->exception = nullptr;
 
   /* destroy the blocking synchro if any */
@@ -503,7 +502,7 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
   if (std::find(begin(simix_global->process_to_run), end(simix_global->process_to_run), process) ==
           end(simix_global->process_to_run) &&
       process != issuer) {
-    XBT_DEBUG("Inserting %s in the to_run list", process->name.c_str());
+    XBT_DEBUG("Inserting %s in the to_run list", process->get_cname());
     simix_global->process_to_run.push_back(process);
   }
 }
@@ -518,7 +517,7 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
 void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const char *msg) {
   SMX_EXCEPTION(process, cat, value, msg);
 
-  if (process->suspended)
+  if (process->suspended_)
     process->resume();
 
   /* cancel the blocking synchro if any */
@@ -543,7 +542,7 @@ void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const
       if (std::find(begin(simix_global->process_to_run), end(simix_global->process_to_run), process) ==
               end(simix_global->process_to_run) &&
           process != SIMIX_process_self()) {
-        XBT_DEBUG("Inserting %s in the to_run list", process->name.c_str());
+        XBT_DEBUG("Inserting %s in the to_run list", process->get_cname());
         simix_global->process_to_run.push_back(process);
       }
     }
@@ -578,8 +577,8 @@ void SIMIX_process_killall(smx_actor_t issuer)
 void SIMIX_process_change_host(smx_actor_t actor, sg_host_t dest)
 {
   xbt_assert((actor != nullptr), "Invalid parameters");
-  simgrid::xbt::intrusive_erase(actor->host->extension<simgrid::simix::Host>()->process_list, *actor);
-  actor->host = dest;
+  simgrid::xbt::intrusive_erase(actor->host_->extension<simgrid::simix::Host>()->process_list, *actor);
+  actor->host_ = dest;
   dest->extension<simgrid::simix::Host>()->process_list.push_back(*actor);
 }
 
@@ -613,12 +612,12 @@ void* SIMIX_process_self_get_data()
   if (not self) {
     return nullptr;
   }
-  return self->getUserData();
+  return self->get_user_data();
 }
 
 void SIMIX_process_self_set_data(void *data)
 {
-  SIMIX_process_self()->setUserData(data);
+  SIMIX_process_self()->set_user_data(data);
 }
 
 
@@ -630,12 +629,12 @@ const char* SIMIX_process_self_get_name() {
   if (process == nullptr || process == simix_global->maestro_process)
     return "maestro";
 
-  return process->name.c_str();
+  return process->get_cname();
 }
 
 void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, double timeout)
 {
-  if (process->finished) {
+  if (process->finished_) {
     // The joined process is already finished, just wake up the issuer process right away
     simcall_process_sleep__set__result(simcall, SIMIX_DONE);
     SIMIX_simcall_answer(simcall);
@@ -698,30 +697,30 @@ void SIMIX_process_yield(smx_actor_t self)
   XBT_DEBUG("Yield actor '%s'", self->get_cname());
 
   /* Go into sleep and return control to maestro */
-  self->context->suspend();
+  self->context_->suspend();
 
   /* Ok, maestro returned control to us */
-  XBT_DEBUG("Control returned to me: '%s'", self->name.c_str());
+  XBT_DEBUG("Control returned to me: '%s'", self->get_cname());
 
-  if (self->context->iwannadie){
+  if (self->context_->iwannadie) {
     XBT_DEBUG("I wanna die!");
-    self->finished = true;
+    self->finished_ = true;
     /* execute the on_exit functions */
     SIMIX_process_on_exit_runall(self);
     /* Add the process to the list of process to restart, only if the host is down */
-    if (self->auto_restart && self->host->is_off()) {
-      SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->getUserData(),
+    if (self->auto_restart_ && self->host_->is_off()) {
+      SIMIX_host_add_auto_restart_process(self->host_, self->get_cname(), self->code, self->get_user_data(),
                                           SIMIX_timer_get_date(self->kill_timer), self->get_properties(),
-                                          self->auto_restart);
+                                          self->auto_restart_);
     }
-    XBT_DEBUG("Process %s@%s is dead", self->get_cname(), self->host->get_cname());
-    self->context->stop();
+    XBT_DEBUG("Process %s@%s is dead", self->get_cname(), self->host_->get_cname());
+    self->context_->stop();
   }
 
-  if (self->suspended) {
+  if (self->suspended_) {
     XBT_DEBUG("Hey! I'm suspended.");
     xbt_assert(self->exception != nullptr, "Gasp! This exception may be lost by subsequent calls.");
-    self->suspended = 0;
+    self->suspended_ = 0;
     self->suspend(self);
   }
 
@@ -732,7 +731,7 @@ void SIMIX_process_yield(smx_actor_t self)
     std::rethrow_exception(std::move(exception));
   }
 
-  if (SMPI_switch_data_segment && not self->finished) {
+  if (SMPI_switch_data_segment && not self->finished_) {
     SMPI_switch_data_segment(self->iface());
   }
 }
@@ -752,7 +751,7 @@ smx_actor_t SIMIX_process_from_PID(aid_t PID)
 
 void SIMIX_process_on_exit_runall(smx_actor_t process) {
   simgrid::s4u::Actor::on_destruction(process->iface());
-  smx_process_exit_status_t exit_status = (process->context->iwannadie) ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
+  smx_process_exit_status_t exit_status = (process->context_->iwannadie) ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
   while (not process->on_exit.empty()) {
     s_smx_process_exit_fun_t exit_fun = process->on_exit.back();
     process->on_exit.pop_back();
@@ -777,7 +776,7 @@ void SIMIX_process_on_exit(smx_actor_t process, std::function<void(int, void*)>
  * If set to 1, the process will be automatically restarted when its host comes back.
  */
 void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart) {
-  process->auto_restart = auto_restart;
+  process->auto_restart_ = auto_restart;
 }
 
 /** @brief Restart a process, starting it again from the beginning. */
index c650cd2..605e6d8 100644 (file)
@@ -26,14 +26,14 @@ namespace actor {
 class ProcessArg {
 public:
   std::string name;
-  simgrid::simix::ActorCode code;
+  std::function<void()> code;
   void* data            = nullptr;
   s4u::Host* host       = nullptr;
   double kill_time      = 0.0;
   std::shared_ptr<std::unordered_map<std::string, std::string>> properties;
   bool auto_restart     = false;
   ProcessArg()          = default;
-  explicit ProcessArg(std::string name, simgrid::simix::ActorCode code, void* data, s4u::Host* host, double kill_time,
+  explicit ProcessArg(std::string name, std::function<void()> code, void* data, s4u::Host* host, double kill_time,
                       std::shared_ptr<std::unordered_map<std::string, std::string>> properties, bool auto_restart)
       : name(name)
       , code(std::move(code))
@@ -55,30 +55,30 @@ public:
   boost::intrusive::list_member_hook<> smx_destroy_list_hook;  /* simix_global->process_to_destroy */
   boost::intrusive::list_member_hook<> smx_synchro_hook;       /* {mutex,cond,sem}->sleeping */
 
-  aid_t pid  = 0;
-  aid_t ppid = -1;
-  simgrid::xbt::string name;
-  const simgrid::xbt::string& get_name() const { return name; }
-  const char* get_cname() const { return name.c_str(); }
-  s4u::Host* host       = nullptr; /* the host on which the process is running */
-  smx_context_t context = nullptr; /* the context (uctx/raw/thread) that executes the user function */
+  aid_t pid_  = 0;
+  aid_t ppid_ = -1;
+  simgrid::xbt::string name_;
+  const simgrid::xbt::string& get_name() const { return name_; }
+  const char* get_cname() const { return name_.c_str(); }
+  s4u::Host* host_       = nullptr; /* the host on which the process is running */
+  smx_context_t context_ = nullptr; /* the context (uctx/raw/thread) that executes the user function */
 
   std::exception_ptr exception;
-  bool finished     = false;
-  bool blocked      = false;
-  bool suspended    = false;
-  bool auto_restart = false;
+  bool finished_    = false;
+  bool blocked_     = false;
+  bool suspended_   = false;
+  bool auto_restart_ = false;
 
   smx_activity_t waiting_synchro = nullptr; /* the current blocking synchro if any */
   std::list<smx_activity_t> comms;          /* the current non-blocking communication synchros */
   s_smx_simcall simcall;
   std::vector<s_smx_process_exit_fun_t> on_exit; /* list of functions executed when the process dies */
 
-  simgrid::simix::ActorCode code;
+  std::function<void()> code;
   smx_timer_t kill_timer = nullptr;
 
 private:
-  void* userdata = nullptr; /* kept for compatibility, it should be replaced with moddata */
+  void* userdata_ = nullptr; /* kept for compatibility, it should be replaced with moddata */
   /* Refcounting */
   std::atomic_int_fast32_t refcount_{0};
 
@@ -111,17 +111,17 @@ public:
 
   /* Daemon actors are automatically killed when the last non-daemon leaves */
 private:
-  bool daemon = false;
+  bool daemon_ = false;
 public:
   void daemonize();
-  bool isDaemon() const { return daemon; } /** Whether this actor has been daemonized */
-  bool isSuspended() const { return suspended; }
+  bool is_daemon() { return daemon_; } /** Whether this actor has been daemonized */
+  bool is_suspended() { return suspended_; }
   simgrid::s4u::Actor* restart();
   smx_activity_t suspend(ActorImpl* issuer);
   void resume();
   smx_activity_t sleep(double duration);
-  void setUserData(void* data) { userdata = data; }
-  void* getUserData() const { return userdata; }
+  void set_user_data(void* data) { userdata_ = data; }
+  void* get_user_data() { return userdata_; }
 };
 
 /* Used to keep the list of actors blocked on a synchro  */
@@ -129,14 +129,14 @@ typedef boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImp
                                                                         &ActorImpl::smx_synchro_hook>>
     SynchroList;
 
-XBT_PUBLIC void create_maestro(simgrid::simix::ActorCode code);
+XBT_PUBLIC void create_maestro(std::function<void()> code);
 }
 } // namespace kernel
 } // namespace simgrid
 
 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
 
-XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, simgrid::simix::ActorCode code, void* data, sg_host_t host,
+XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
                                              std::unordered_map<std::string, std::string>* properties,
                                              smx_actor_t parent_process);
 
index 41b201c..ed1d0cb 100644 (file)
@@ -193,7 +193,7 @@ void simcall_process_suspend(smx_actor_t process)
  */
 void simcall_process_set_data(smx_actor_t process, void *data)
 {
-  simgrid::simix::simcall([process, data] { process->setUserData(data); });
+  simgrid::simix::simcall([process, data] { process->set_user_data(data); });
 }
 
 /**
@@ -205,7 +205,7 @@ void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
 
   if (kill_time <= SIMIX_get_clock() || simix_global->kill_process_function == nullptr)
     return;
-  XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->get_cname(), process->host->get_cname());
+  XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->get_cname(), process->host_->get_cname());
   process->kill_timer = SIMIX_timer_set(kill_time, [process] {
     simix_global->kill_process_function(process);
     process->kill_timer=nullptr;
index 2fdbeb8..34e4a71 100644 (file)
@@ -22,7 +22,7 @@ void SIMIX_simcall_answer(smx_simcall_t simcall)
 {
   if (simcall->issuer != simix_global->maestro_process){
     XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), (int)simcall->call,
-        simcall->issuer->name.c_str(), simcall->issuer);
+              simcall->issuer->get_cname(), simcall->issuer);
     simcall->issuer->simcall.call = SIMCALL_NONE;
 #if 0
     /* This check should be useless and slows everyone. Reactivate if you see something weird in process scheduling. */
index 9c65c5c..e282a76 100644 (file)
@@ -28,8 +28,8 @@ inline static R simcall(e_smx_simcall_t call, T const&... t)
   smx_actor_t self = SIMIX_process_self();
   simgrid::simix::marshal(&self->simcall, call, t...);
   if (self != simix_global->maestro_process) {
-    XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(),
-              SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
+    XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->get_cname(), SIMIX_simcall_name(self->simcall.call),
+              (int)self->simcall.call);
     SIMIX_process_yield(self);
   } else {
     SIMIX_simcall_handle(&self->simcall, 0);
index 3a7ae42..e8875d3 100644 (file)
@@ -64,7 +64,7 @@ const char* simcall_names[] = {
 void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
   XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));
   SIMCALL_SET_MC_VALUE(simcall, value);
-  if (simcall->issuer->context->iwannadie)
+  if (simcall->issuer->context_->iwannadie)
     return;
   switch (simcall->call) {
 case SIMCALL_PROCESS_SUSPEND:
@@ -184,10 +184,8 @@ case SIMCALL_RUN_BLOCKING:
     case NUM_SIMCALLS:
       break;
     case SIMCALL_NONE:
-      THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
-          simcall->issuer->name.c_str(),
-          sg_host_get_name(simcall->issuer->host)
-          );
+      THROWF(arg_error, 0, "Asked to do the noop syscall on %s@%s", simcall->issuer->get_cname(),
+             sg_host_get_name(simcall->issuer->host_));
       break;
     default:
       THROW_IMPOSSIBLE;
index 500b75e..2a140d4 100755 (executable)
@@ -340,7 +340,7 @@ if __name__ == '__main__':
         '  XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));\n')
     fd.write('  SIMCALL_SET_MC_VALUE(simcall, value);\n')
     fd.write(
-        '  if (simcall->issuer->context->iwannadie)\n')
+        '  if (simcall->issuer->context_->iwannadie)\n')
     fd.write('    return;\n')
     fd.write('  switch (simcall->call) {\n')
 
@@ -350,8 +350,8 @@ if __name__ == '__main__':
     fd.write('      break;\n')
     fd.write('    case SIMCALL_NONE:\n')
     fd.write('      THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",\n')
-    fd.write('          simcall->issuer->name.c_str(),\n')
-    fd.write('          sg_host_get_name(simcall->issuer->host)\n')
+    fd.write('          simcall->issuer->get_cname(),\n')
+    fd.write('          sg_host_get_name(simcall->issuer->host_)\n')
     fd.write('          );\n')
     fd.write('      break;\n')
     fd.write('    default:\n')
@@ -380,7 +380,7 @@ inline static R simcall(e_smx_simcall_t call, T const&... t)
   smx_actor_t self = SIMIX_process_self();
   simgrid::simix::marshal(&self->simcall, call, t...);
   if (self != simix_global->maestro_process) {
-    XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(),
+    XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->get_cname(),
               SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
     SIMIX_process_yield(self);
   } else {
index f0b03ad..f16fa89 100644 (file)
@@ -284,8 +284,8 @@ void SIMIX_clean()
 #endif
 
   /* Let's free maestro now */
-  delete simix_global->maestro_process->context;
-  simix_global->maestro_process->context = nullptr;
+  delete simix_global->maestro_process->context_;
+  simix_global->maestro_process->context_ = nullptr;
   delete simix_global->maestro_process;
   simix_global->maestro_process = nullptr;
 
@@ -648,12 +648,12 @@ void SIMIX_display_process_status()
       if (boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro) != nullptr)
         synchro_description = "I/O";
 
-      XBT_INFO("Process %ld (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid,
-               process->get_cname(), process->host->get_cname(), synchro_description, process->waiting_synchro.get(),
+      XBT_INFO("Process %ld (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid_,
+               process->get_cname(), process->host_->get_cname(), synchro_description, process->waiting_synchro.get(),
                process->waiting_synchro->name_.c_str(), (int)process->waiting_synchro->state_);
     }
     else {
-      XBT_INFO("Process %ld (%s@%s)", process->pid, process->get_cname(), process->host->get_cname());
+      XBT_INFO("Process %ld (%s@%s)", process->pid_, process->get_cname(), process->host_->get_cname());
     }
   }
 }
index ecd8634..afd0d0c 100644 (file)
@@ -55,7 +55,7 @@ namespace simgrid {
         if (arg->kill_time >= 0)
           simcall_process_set_kill_time(actor, arg->kill_time);
         if (arg->auto_restart)
-          actor->auto_restart = arg->auto_restart;
+          actor->auto_restart_ = arg->auto_restart;
       }
     }
 
@@ -107,7 +107,7 @@ void SIMIX_host_autorestart(sg_host_t host)
     if (arg->kill_time >= 0)
       simcall_process_set_kill_time(actor, arg->kill_time);
     if (arg->auto_restart)
-      actor->auto_restart = arg->auto_restart;
+      actor->auto_restart_ = arg->auto_restart;
   }
   process_list.clear();
 }
@@ -213,8 +213,8 @@ void SIMIX_execution_finish(smx_activity_t synchro)
         break;
 
       case SIMIX_FAILED:
-        XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->host->get_cname());
-        simcall->issuer->context->iwannadie = 1;
+        XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->host_->get_cname());
+        simcall->issuer->context_->iwannadie = 1;
         SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
         break;
 
@@ -232,8 +232,8 @@ void SIMIX_execution_finish(smx_activity_t synchro)
         xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d", (int)exec->state_);
     }
     /* Fail the process if the host is down */
-    if (simcall->issuer->host->is_off())
-      simcall->issuer->context->iwannadie = 1;
+    if (simcall->issuer->host_->is_off())
+      simcall->issuer->context_->iwannadie = 1;
 
     simcall->issuer->waiting_synchro = nullptr;
     simcall_execution_wait__set__result(simcall, exec->state_);
index b114804..d2a3118 100644 (file)
@@ -80,8 +80,8 @@ void SIMIX_io_finish(smx_activity_t synchro)
         xbt_die("Internal error in SIMIX_io_finish: unexpected synchro state %d", static_cast<int>(synchro->state_));
     }
 
-    if (simcall->issuer->host->is_off()) {
-      simcall->issuer->context->iwannadie = 1;
+    if (simcall->issuer->host_->is_off()) {
+      simcall->issuer->context_->iwannadie = 1;
     }
 
     simcall->issuer->waiting_synchro = nullptr;
index c95d8b3..b2327ed 100644 (file)
@@ -322,7 +322,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do
     SIMIX_comm_finish(synchro);
   } else { /* we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host
               fails */
-    simgrid::kernel::resource::Action* sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
+    simgrid::kernel::resource::Action* sleep = simcall->issuer->host_->pimpl_cpu->sleep(timeout);
     sleep->set_data(synchro.get());
 
     simgrid::kernel::activity::CommImplPtr comm =
@@ -455,8 +455,8 @@ static inline void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr comm)
   /* If both the sender and the receiver are already there, start the communication */
   if (comm->state_ == SIMIX_READY) {
 
-    simgrid::s4u::Host* sender   = comm->src_proc->host;
-    simgrid::s4u::Host* receiver = comm->dst_proc->host;
+    simgrid::s4u::Host* sender   = comm->src_proc->host_;
+    simgrid::s4u::Host* receiver = comm->dst_proc->host_;
 
     comm->surfAction_ = surf_network_model->communicate(sender, receiver, comm->task_size, comm->rate);
     comm->surfAction_->set_data(comm.get());
@@ -475,15 +475,15 @@ static inline void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr comm)
 
     /* If any of the process is suspended, create the synchro but stop its execution,
        it will be restarted when the sender process resume */
-    if (comm->src_proc->isSuspended() || comm->dst_proc->isSuspended()) {
-      if (comm->src_proc->isSuspended())
+    if (comm->src_proc->is_suspended() || comm->dst_proc->is_suspended()) {
+      if (comm->src_proc->is_suspended())
         XBT_DEBUG("The communication is suspended on startup because src (%s@%s) was suspended since it initiated the "
                   "communication",
-                  comm->src_proc->get_cname(), comm->src_proc->host->get_cname());
+                  comm->src_proc->get_cname(), comm->src_proc->host_->get_cname());
       else
         XBT_DEBUG("The communication is suspended on startup because dst (%s@%s) was suspended since it initiated the "
                   "communication",
-                  comm->dst_proc->get_cname(), comm->dst_proc->host->get_cname());
+                  comm->dst_proc->get_cname(), comm->dst_proc->host_->get_cname());
 
       comm->surfAction_->suspend();
     }
@@ -528,8 +528,8 @@ void SIMIX_comm_finish(smx_activity_t synchro)
 
     /* Check out for errors */
 
-    if (simcall->issuer->host->is_off()) {
-      simcall->issuer->context->iwannadie = 1;
+    if (simcall->issuer->host_->is_off()) {
+      simcall->issuer->context_->iwannadie = 1;
       SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
     } else {
       switch (comm->state_) {
@@ -549,14 +549,14 @@ void SIMIX_comm_finish(smx_activity_t synchro)
 
         case SIMIX_SRC_HOST_FAILURE:
           if (simcall->issuer == comm->src_proc)
-            simcall->issuer->context->iwannadie = 1;
+            simcall->issuer->context_->iwannadie = 1;
           else
             SMX_EXCEPTION(simcall->issuer, network_error, 0, "Remote peer failed");
           break;
 
         case SIMIX_DST_HOST_FAILURE:
           if (simcall->issuer == comm->dst_proc)
-            simcall->issuer->context->iwannadie = 1;
+            simcall->issuer->context_->iwannadie = 1;
           else
             SMX_EXCEPTION(simcall->issuer, network_error, 0, "Remote peer failed");
           break;
@@ -564,8 +564,8 @@ void SIMIX_comm_finish(smx_activity_t synchro)
         case SIMIX_LINK_FAILURE:
           XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) "
                     "detached:%d",
-                    synchro.get(), comm->src_proc ? comm->src_proc->host->get_cname() : nullptr,
-                    comm->dst_proc ? comm->dst_proc->host->get_cname() : nullptr, simcall->issuer->get_cname(),
+                    synchro.get(), comm->src_proc ? comm->src_proc->host_->get_cname() : nullptr,
+                    comm->dst_proc ? comm->dst_proc->host_->get_cname() : nullptr, simcall->issuer->get_cname(),
                     simcall->issuer, comm->detached);
           if (comm->src_proc == simcall->issuer) {
             XBT_DEBUG("I'm source");
@@ -616,8 +616,8 @@ void SIMIX_comm_finish(smx_activity_t synchro)
       }
     }
 
-    if (simcall->issuer->host->is_off()) {
-      simcall->issuer->context->iwannadie = 1;
+    if (simcall->issuer->host_->is_off()) {
+      simcall->issuer->context_->iwannadie = 1;
     }
 
     simcall->issuer->waiting_synchro = nullptr;
@@ -688,8 +688,8 @@ void SIMIX_comm_copy_data(smx_activity_t synchro)
     return;
 
   XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", comm.get(),
-            comm->src_proc ? comm->src_proc->host->get_cname() : "a finished process", comm->src_buff,
-            comm->dst_proc ? comm->dst_proc->host->get_cname() : "a finished process", comm->dst_buff, buff_size);
+            comm->src_proc ? comm->src_proc->host_->get_cname() : "a finished process", comm->src_buff,
+            comm->dst_proc ? comm->dst_proc->host_->get_cname() : "a finished process", comm->dst_buff, buff_size);
 
   /* Copy at most dst_buff_size bytes of the message to receiver's buffer */
   if (comm->dst_buff_size)
index 233f61c..cf91e4a 100644 (file)
@@ -68,7 +68,7 @@ void SIMIX_synchro_finish(smx_activity_t synchro)
 
   if (synchro->state_ != SIMIX_SRC_TIMEOUT) {
     if (synchro->state_ == SIMIX_FAILED)
-      simcall->issuer->context->iwannadie = 1;
+      simcall->issuer->context_->iwannadie = 1;
     else
       THROW_IMPOSSIBLE;
   }
@@ -146,7 +146,7 @@ static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_actor_t issuer,
 
   XBT_DEBUG("Wait semaphore %p (timeout:%f)", sem, timeout);
   if (sem->value <= 0) {
-    synchro = SIMIX_synchro_wait(issuer->host, timeout);
+    synchro = SIMIX_synchro_wait(issuer->host_, timeout);
     synchro->simcalls_.push_front(simcall);
     issuer->waiting_synchro = synchro;
     sem->sleeping.push_back(*issuer);
index d176b7b..9518a17 100644 (file)
@@ -104,7 +104,7 @@ simgrid::smpi::Process* smpi_process()
   ActorPtr me = Actor::self();
   if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...)
     return nullptr;
-  simgrid::msg::ActorExt* msgExt = static_cast<simgrid::msg::ActorExt*>(me->get_impl()->getUserData());
+  simgrid::msg::ActorExt* msgExt = static_cast<simgrid::msg::ActorExt*>(me->get_impl()->get_user_data());
   return static_cast<simgrid::smpi::Process*>(msgExt->data);
 }
 
index 0fd9fd0..d5edd03 100644 (file)
@@ -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));
@@ -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 {
index 58dd774..02b66fb 100644 (file)
@@ -310,7 +310,7 @@ void Comm::init_smp(){
   int intra_comm_size     = 0;
   int min_index           = INT_MAX; // the minimum index will be the leader
   for (auto& actor : process_list) {
-    int index = actor.pid;
+    int index = actor.pid_;
     if (this->group()->rank(actor.iface()) != MPI_UNDEFINED) { // Is this process in the current group?
       intra_comm_size++;
       if (index < min_index)