Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
replace SIMIX_process_count by simgrid_get_actor_count
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 4 Nov 2019 09:44:11 +0000 (10:44 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 4 Nov 2019 09:44:11 +0000 (10:44 +0100)
include/simgrid/engine.h
include/simgrid/simix.h
src/kernel/actor/ActorImpl.cpp
src/msg/msg_legacy.cpp
src/msg/msg_process.cpp
src/s4u/s4u_Engine.cpp
src/simix/smx_global.cpp

index 2add055..4a2247e 100644 (file)
@@ -38,6 +38,8 @@ XBT_PUBLIC void simgrid_register_function(const char* name, int (*code)(int, cha
 XBT_PUBLIC void simgrid_register_default(int (*code)(int, char**));
 /** Retrieve the simulation time (in seconds) */
 XBT_PUBLIC double simgrid_get_clock();
+/** Retrieve the number of actors in the simulation */
+XBT_PUBLIC int simgrid_get_actor_count();
 
 /** @brief Allow other libraries to react to the --help flag, too
  *
index f2d5e43..8899662 100644 (file)
@@ -106,7 +106,7 @@ XBT_PUBLIC void SIMIX_launch_application(const std::string& file);
 
 /********************************* Process ************************************/
 SG_BEGIN_DECL
-XBT_PUBLIC int SIMIX_process_count();
+XBT_ATTRIB_DEPRECATED_v329("Please use simgrid_get_actor_count()") XBT_PUBLIC int SIMIX_process_count();
 XBT_PUBLIC smx_actor_t SIMIX_process_self();
 XBT_PUBLIC const char* SIMIX_process_self_get_name();
 XBT_ATTRIB_DEPRECATED_v329("This function will be removed in 3.29") XBT_PUBLIC
@@ -145,7 +145,8 @@ XBT_PUBLIC bool simcall_execution_test(const smx_activity_t& execution);
 
 /**************************** Process simcalls ********************************/
 SG_BEGIN_DECL
-void simcall_process_set_data(smx_actor_t process, void* data);
+XBT_ATTRIB_DEPRECATED_v329("This function will be removed in 3.29") void simcall_process_set_data(smx_actor_t process,
+                                                                                                  void* data);
 XBT_ATTRIB_DEPRECATED_v328("Please use Actor::suspend()") XBT_PUBLIC void simcall_process_suspend(smx_actor_t process);
 
 XBT_ATTRIB_DEPRECATED_v328("Please use Actor::join()") XBT_PUBLIC
index b428cf6..6cea03b 100644 (file)
@@ -529,7 +529,7 @@ void create_maestro(const std::function<void()>& code)
 } // namespace kernel
 } // namespace simgrid
 
-int SIMIX_process_count()
+int SIMIX_process_count() // XBT_ATTRIB_DEPRECATED_v329
 {
   return simix_global->process_list.size();
 }
index 105105f..6240acd 100644 (file)
@@ -206,7 +206,11 @@ void MSG_process_unref(msg_process_t process)
 {
   sg_actor_unref(process);
 }
-
+/** @brief Return the current number MSG processes. */
+int MSG_process_get_number()
+{
+  return simgrid_get_actor_count();
+}
 /* ************************** NetZones *************************** */
 sg_netzone_t MSG_zone_get_root()
 {
index 7ecfd44..e790079 100644 (file)
@@ -110,12 +110,6 @@ xbt_dynar_t MSG_processes_as_dynar() {
   return res;
 }
 
-/** @brief Return the current number MSG processes. */
-int MSG_process_get_number()
-{
-  return SIMIX_process_count();
-}
-
 /** @brief Add a function to the list of "on_exit" functions for the current process.
  *  The on_exit functions are the functions executed when your process is killed.
  *  You should use them to free the data used by your process.
index 8b05e04..ba96fac 100644 (file)
@@ -415,3 +415,7 @@ double simgrid_get_clock()
 {
   return simgrid::s4u::Engine::get_clock();
 }
+int simgrid_get_actor_count()
+{
+  return simgrid::s4u::Engine::get_instance()->get_actor_count();
+}
index 1af8b5b..83c6f92 100644 (file)
@@ -276,7 +276,7 @@ void SIMIX_clean()
   }
 
 #if HAVE_SMPI
-  if (SIMIX_process_count()>0){
+  if (simix_global->process_list.size() > 0) {
     if(smpi_process()->initialized()){
       xbt_die("Process exited without calling MPI_Finalize - Killing simulation");
     }else{