Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[smpi,simix-network] remove a useless function
[simgrid.git] / src / simix / smx_user.c
index 225df8d..76e288c 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
  */
@@ -651,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;
@@ -667,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;
@@ -676,6 +680,21 @@ 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(smx_process_t) 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);
+
+  return simcall->process_restart.result;
+}
 /**
  * \ingroup simix_process_management
  * \brief Creates a new sleep SIMIX action.
@@ -721,7 +740,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)
 {
@@ -790,6 +809,29 @@ smx_action_t simcall_rdv_get_head(smx_rdv_t rdv)
   SIMIX_simcall_push(simcall->issuer);
   return simcall->rdv_get_head.result;
 }
+
+void simcall_rdv_set_receiver(smx_rdv_t rdv , smx_process_t process)
+{
+  smx_simcall_t simcall = SIMIX_simcall_mine();
+
+  simcall->call = SIMCALL_RDV_SET_RECV;
+  simcall->rdv_set_rcv_proc.rdv = rdv;
+  simcall->rdv_set_rcv_proc.receiver = process;
+
+  SIMIX_simcall_push(simcall->issuer);
+}
+
+smx_process_t simcall_rdv_get_receiver(smx_rdv_t rdv)
+{
+  smx_simcall_t simcall = SIMIX_simcall_mine();
+
+  simcall->call = SIMCALL_RDV_GET_RECV;
+  simcall->rdv_get_rcv_proc.rdv = rdv;
+
+  SIMIX_simcall_push(simcall->issuer);
+  return simcall->rdv_get_rcv_proc.result;
+}
+
 /**
  * \ingroup simix_comm_management
  */
@@ -1446,6 +1488,21 @@ int simcall_file_stat(smx_file_t fd, s_file_stat_t *buf)
   return simcall->file_stat.result;
 }
 
+/**
+ * \ingroup simix_file_management
+ *
+ */
+int simcall_file_unlink(smx_file_t fd)
+{
+  smx_simcall_t simcall = SIMIX_simcall_mine();
+  simcall->call = SIMCALL_FILE_UNLINK;
+  simcall->file_unlink.fd = fd;
+
+  SIMIX_simcall_push(simcall->issuer);
+
+  return simcall->file_unlink.result;
+}
+
 /* ************************************************************************** */
 
 /** @brief returns a printable string representing a simcall */