Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove wrong copy past
[simgrid.git] / src / simix / smx_user.c
index 2663088..0438918 100644 (file)
@@ -521,6 +521,24 @@ void simcall_process_set_data(smx_process_t process, void *data)
   }
 }
 
+/**
+ * \brief Set the kill time of a process.
+ *
+ * \param process a process
+ * \param kill_time a double
+ */
+void simcall_process_set_kill_time(smx_process_t process, double kill_time)
+{
+
+  if (kill_time > SIMIX_get_clock()) {
+    if (simix_global->kill_process_function) {
+      XBT_DEBUG("Set kill time %f for process %s(%s)",kill_time, process->name,
+          process->smx_host->name);
+      SIMIX_timer_set(kill_time, simix_global->kill_process_function, process);
+    }
+  }
+}
+
 /**
  * \brief Return the location on which an agent is running.
  *
@@ -700,7 +718,7 @@ smx_action_t simcall_rdv_get_head(smx_rdv_t rdv)
 
 void simcall_comm_send(smx_rdv_t rdv, double task_size, double rate,
                          void *src_buff, size_t src_buff_size,
-                         int (*match_fun)(void *, void *), void *data,
+                         int (*match_fun)(void *, void *, smx_action_t), void *data,
                          double timeout)
 {
   /* checking for infinite values */
@@ -735,7 +753,7 @@ void simcall_comm_send(smx_rdv_t rdv, double task_size, double rate,
 
 smx_action_t simcall_comm_isend(smx_rdv_t rdv, double task_size, double rate,
                               void *src_buff, size_t src_buff_size,
-                              int (*match_fun)(void *, void *),
+                              int (*match_fun)(void *, void *, smx_action_t),
                               void (*clean_fun)(void *),
                               void *data,
                               int detached)
@@ -764,7 +782,7 @@ smx_action_t simcall_comm_isend(smx_rdv_t rdv, double task_size, double rate,
 }
 
 void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
-                         int (*match_fun)(void *, void *), void *data, double timeout)
+                         int (*match_fun)(void *, void *, smx_action_t), void *data, double timeout)
 {
   xbt_assert(isfinite(timeout), "timeout is not finite!");
   xbt_assert(rdv, "No rendez-vous point defined for recv");
@@ -791,7 +809,7 @@ void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
 }
 
 smx_action_t simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
-                                  int (*match_fun)(void *, void *), void *data)
+                                  int (*match_fun)(void *, void *, smx_action_t), void *data)
 {
   xbt_assert(rdv, "No rendez-vous point defined for irecv");