Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
namespacify a global function of SIMIX
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 8 Aug 2019 16:32:13 +0000 (18:32 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 8 Aug 2019 21:21:02 +0000 (23:21 +0200)
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/kernel/context/Context.hpp
src/mc/mc_global.cpp
src/mc/mc_record.cpp
src/mc/mc_smx.cpp

index c8640b4..c943038 100644 (file)
@@ -22,8 +22,6 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix, "Logging specific to SIMIX (process)");
 
-static unsigned long simix_process_maxpid = 0;
-
 /**
  * @brief Returns the current agent.
  *
@@ -53,9 +51,15 @@ namespace simgrid {
 namespace kernel {
 namespace actor {
 
+static unsigned long maxpid = 0;
+int get_maxpid()
+{
+  return maxpid;
+}
+
 ActorImpl::ActorImpl(const simgrid::xbt::string& name, s4u::Host* host) : host_(host), name_(name), piface_(this)
 {
-  pid_           = simix_process_maxpid++;
+  pid_           = maxpid++;
   simcall.issuer = this;
 }
 
@@ -524,14 +528,14 @@ void create_maestro(const std::function<void()>& code)
 } // namespace kernel
 } // namespace simgrid
 
-void SIMIX_process_detach()
+void SIMIX_process_detach() // deprecated v3.25
 {
   simgrid::kernel::actor::ActorImpl::detach();
 }
 
 smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostname,
                                  std::unordered_map<std::string, std::string>* properties,
-                                 smx_actor_t /*parent_process*/)
+                                 smx_actor_t /*parent_process*/) // deprecated 3.25
 {
   return simgrid::kernel::actor::ActorImpl::attach(name, data, sg_host_by_name(hostname), properties).get();
 }
@@ -550,11 +554,6 @@ void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t actor)
   /* If we are suspending ourselves, then just do not finish the simcall now */
 }
 
-int SIMIX_process_get_maxpid()
-{
-  return simix_process_maxpid;
-}
-
 int SIMIX_process_count()
 {
   return simix_global->process_list.size();
index cc97cb3..acf8f24 100644 (file)
@@ -179,6 +179,7 @@ typedef boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImp
     SynchroList;
 
 XBT_PUBLIC void create_maestro(const std::function<void()>& code);
+XBT_PUBLIC int get_maxpid();
 } // namespace actor
 } // namespace kernel
 } // namespace simgrid
index 0d93213..b2fadf0 100644 (file)
@@ -109,8 +109,6 @@ XBT_PRIVATE void SIMIX_context_mod_exit();
 XBT_PUBLIC_DATA unsigned char sigsegv_stack[SIGSTKSZ];
 #endif
 
-XBT_PUBLIC int SIMIX_process_get_maxpid();
-
 XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const std::string& name);
 
 #endif
index 944de52..b63e1c1 100644 (file)
@@ -77,7 +77,7 @@ void MC_init_dot_output()
 
 void MC_run()
 {
-  simgrid::mc::processes_time.resize(SIMIX_process_get_maxpid());
+  simgrid::mc::processes_time.resize(simgrid::kernel::actor::get_maxpid());
   MC_ignore_heap(simgrid::mc::processes_time.data(),
     simgrid::mc::processes_time.size() * sizeof(simgrid::mc::processes_time[0]));
   simgrid::mc::Client::get()->main_loop();
index 50d659c..685c491 100644 (file)
@@ -48,7 +48,7 @@ void replay(RecordTrace const& trace)
 
 void replay(const std::string& path_string)
 {
-  simgrid::mc::processes_time.resize(SIMIX_process_get_maxpid());
+  simgrid::mc::processes_time.resize(simgrid::kernel::actor::get_maxpid());
   simgrid::mc::RecordTrace trace = simgrid::mc::parseRecordTrace(path_string.c_str());
   simgrid::mc::replay(trace);
   simgrid::mc::processes_time.clear();
index 2830def..8421cb7 100644 (file)
@@ -148,7 +148,6 @@ const char* MC_smx_actor_get_name(smx_actor_t actor)
 unsigned long MC_smx_get_maxpid()
 {
   unsigned long maxpid;
-  mc_model_checker->process().read_variable("simix_process_maxpid",
-    &maxpid, sizeof(maxpid));
+  mc_model_checker->process().read_variable("simgrid::kernel::actor::maxpid", &maxpid, sizeof(maxpid));
   return maxpid;
 }