Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'v3_9_x' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid into v3_9_x
[simgrid.git] / src / msg / msg_process.c
index ba3943d..cf7ce52 100644 (file)
@@ -179,10 +179,10 @@ msg_process_t MSG_process_create_with_environment(const char *name,
 
 #ifdef HAVE_TRACING
   TRACE_msg_process_create(name, simdata->PID, simdata->m_host);
 
 #ifdef HAVE_TRACING
   TRACE_msg_process_create(name, simdata->PID, simdata->m_host);
-  #endif
+#endif
   /* Let's create the process: SIMIX may decide to start it right now,
    * even before returning the flow control to us */
   /* Let's create the process: SIMIX may decide to start it right now,
    * even before returning the flow control to us */
 simcall_process_create(&process, name, code, simdata, SIMIX_host_get_name(host->smx_host), -1,
simcall_process_create(&process, name, code, simdata, sg_host_name(host), -1,
                            argc, argv, properties,0);
 
   if (!process) {
                            argc, argv, properties,0);
 
   if (!process) {
@@ -231,7 +231,7 @@ msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
   msg_host_t now = simdata->m_host;
   TRACE_msg_process_change_host(process, now, host);
 #endif
   msg_host_t now = simdata->m_host;
   TRACE_msg_process_change_host(process, now, host);
 #endif
-  simcall_process_change_host(process, host->smx_host);
+  simcall_process_change_host(process, host);
   return MSG_OK;
 }
 
   return MSG_OK;
 }
 
@@ -312,6 +312,12 @@ msg_process_t MSG_process_from_PID(int PID)
 xbt_dynar_t MSG_processes_as_dynar(void) {
   return SIMIX_processes_as_dynar();
 }
 xbt_dynar_t MSG_processes_as_dynar(void) {
   return SIMIX_processes_as_dynar();
 }
+/** @brief Return the current number MSG processes.
+ */
+int MSG_process_get_number(void)
+{
+  return SIMIX_process_count();
+}
 
 /** \ingroup m_process_management
  * \brief Set the kill time of a process.
 
 /** \ingroup m_process_management
  * \brief Set the kill time of a process.
@@ -503,6 +509,6 @@ XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_re
  * \ingroup m_process_management
  * \brief Restarts a process from the beginning.
  */
  * \ingroup m_process_management
  * \brief Restarts a process from the beginning.
  */
-XBT_PUBLIC(void) MSG_process_restart(msg_process_t process) {
-  simcall_process_restart(process);
+XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process) {
+  return simcall_process_restart(process);
 }
 }