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
*
/********************************* 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
/**************************** 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
} // namespace kernel
} // namespace simgrid
-int SIMIX_process_count()
+int SIMIX_process_count() // XBT_ATTRIB_DEPRECATED_v329
{
return simix_global->process_list.size();
}
{
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()
{
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.
{
return simgrid::s4u::Engine::get_clock();
}
+int simgrid_get_actor_count()
+{
+ return simgrid::s4u::Engine::get_instance()->get_actor_count();
+}
}
#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{