Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix SIMIX_process_kill(SIMIX_process_self()); issue: The killed processes mustn't...
[simgrid.git] / src / simix / smx_user.c
index dc4fb54..004954f 100644 (file)
@@ -153,7 +153,7 @@ void* simcall_host_get_data(smx_host_t host)
  * \brief Sets the user data associated to a host.
  *
  * The host must not have previous user data associated to it.
- * \param A host SIMIX host
+ * \param host A SIMIX host
  * \param data The user data to set
  */
 void simcall_host_set_data(smx_host_t host, void *data)
@@ -175,7 +175,8 @@ void simcall_host_set_data(smx_host_t host, void *data)
  *
  * \param name Name of the execution action to create
  * \param host SIMIX host where the action will be executed
- * \param amount Computation amount (in bytes)
+ * \param computation_amount amount Computation amount (in bytes)
+ * \param priority computation priority
  * \return A new SIMIX execution action
  */
 smx_action_t simcall_host_execute(const char *name, smx_host_t host,
@@ -252,7 +253,7 @@ smx_action_t simcall_host_parallel_execute(const char *name,
  * \brief Destroys an execution action.
  *
  * Destroys an action, freing its memory. This function cannot be called if there are a conditional waiting for it.
- * \param action The execution action to destroy
+ * \param execution The execution action to destroy
  */
 void simcall_host_execution_destroy(smx_action_t execution)
 {
@@ -268,7 +269,7 @@ void simcall_host_execution_destroy(smx_action_t execution)
  * \brief Cancels an execution action.
  *
  * This functions stops the execution. It calls a surf function.
- * \param action The execution action to cancel
+ * \param execution The execution action to cancel
  */
 void simcall_host_execution_cancel(smx_action_t execution)
 {
@@ -283,7 +284,7 @@ void simcall_host_execution_cancel(smx_action_t execution)
  * \ingroup simix_host_management
  * \brief Returns how much of an execution action remains to be done.
  *
- * \param Action The execution action
+ * \param execution The execution action
  * \return The remaining amount
  */
 double simcall_host_execution_get_remains(smx_action_t execution)
@@ -366,6 +367,7 @@ e_smx_state_t simcall_host_execution_wait(smx_action_t execution)
  * \param argc first argument passed to \a code
  * \param argv second argument passed to \a code
  * \param properties the properties of the process
+ * \param auto_restart either it is autorestarting or not.
  */
 void simcall_process_create(smx_process_t *process, const char *name,
                               xbt_main_func_t code,
@@ -442,7 +444,6 @@ void simcall_process_cleanup(smx_process_t process)
  * This function changes the value of the host on which \a process is running.
  *
  * \param process the process to migrate
- * \param source name of the previous host
  * \param dest name of the new host
  */
 void simcall_process_change_host(smx_process_t process, smx_host_t dest)
@@ -533,7 +534,7 @@ void* simcall_process_get_data(smx_process_t process)
  * \ingroup simix_process_management
  * \brief Set the user data of a #smx_process_t.
  *
- * This functions checks whether \a process is a valid pointer or not and set the user data associated to \a process if it is possible.
+ * This functions sets the user data associated to \a process.
  * \param process SIMIX process
  * \param data User data
  */
@@ -576,7 +577,8 @@ void simcall_process_set_kill_time(smx_process_t process, double kill_time)
  * \ingroup simix_process_management
  * \brief Return the location on which an agent is running.
  *
- * This functions checks whether \a process is a valid pointer or not and return the m_host_t corresponding to the location on which \a process is running.
+ * This functions returns the smx_host_t corresponding to the location on which
+ * \a process is running.
  * \param process SIMIX process
  * \return SIMIX host
  */
@@ -633,7 +635,6 @@ int simcall_process_is_suspended(smx_process_t process)
 
 /**
  * \ingroup simix_process_management
- * \ingroup m_process_management
  * \brief Return the properties
  *
  * This functions returns the properties associated with this process
@@ -652,7 +653,8 @@ xbt_dict_t simcall_process_get_properties(smx_process_t process)
  * \brief Add an on_exit function
  * Add an on_exit function which will be executed when the process exits/is killed.
  */
-XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data) {
+XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data)
+{
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
   simcall->call = SIMCALL_PROCESS_ON_EXIT;
@@ -668,7 +670,8 @@ XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fu
  * Will restart the process when the host comes back up if auto_restart is set to 1.
  */
 
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart) {
+XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart)
+{
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
   simcall->call = SIMCALL_PROCESS_AUTO_RESTART_SET;
@@ -677,6 +680,19 @@ XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int aut
 
   SIMIX_simcall_push(simcall->issuer);
 }
+/**
+ * \ingroup simix_process_management
+ * \brief Restarts the process, killing it and starting it again from scratch.
+ */
+XBT_PUBLIC(void) simcall_process_restart(smx_process_t process)
+{
+  smx_simcall_t simcall = SIMIX_simcall_mine();
+
+  simcall->call = SIMCALL_PROCESS_RESTART;
+  simcall->process_restart.process = process;
+
+  SIMIX_simcall_push(simcall->issuer);
+}
 /**
  * \ingroup simix_process_management
  * \brief Creates a new sleep SIMIX action.
@@ -722,7 +738,7 @@ smx_rdv_t simcall_rdv_create(const char *name)
 /**
  *  \ingroup simix_rdv_management
  *  \brief Destroy a rendez-vous point
- *  \param name The rendez-vous point to destroy
+ *  \param rdv The rendez-vous point to destroy
  */
 void simcall_rdv_destroy(smx_rdv_t rdv)
 {
@@ -793,7 +809,6 @@ smx_action_t simcall_rdv_get_head(smx_rdv_t rdv)
 }
 /**
  * \ingroup simix_comm_management
- *
  */
 void simcall_comm_send(smx_rdv_t rdv, double task_size, double rate,
                          void *src_buff, size_t src_buff_size,
@@ -1403,7 +1418,7 @@ size_t simcall_file_write(const void* ptr, size_t size, size_t nmemb, smx_file_t
 }
 /**
  * \ingroup simix_file_management
- *
+ * \brief
  */
 smx_file_t simcall_file_open(const char* mount, const char* path, const char* mode)
 {