Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] function now longer exist
[simgrid.git] / src / msg / msg_task.c
index 0aabc18..609dc7b 100644 (file)
@@ -104,6 +104,23 @@ void MSG_task_set_data(m_task_t task, void *data)
   task->data = data;
 }
 
+/** \ingroup m_task_management
+ * \brief Sets a function to be called when a task has just been copied.
+ * \param callback a callback function
+ */
+void MSG_task_set_copy_callback(void (*callback)
+    (m_task_t task, m_process_t sender, m_process_t receiver)) {
+
+  msg_global->task_copy_callback = callback;
+
+  if (callback) {
+    SIMIX_comm_set_copy_data_callback(MSG_comm_copy_data_from_SIMIX);
+  }
+  else {
+    SIMIX_comm_set_copy_data_callback(SIMIX_comm_copy_pointer_callback);
+  }
+}
+
 /** \ingroup m_task_management
  * \brief Return the sender of a #m_task_t.
  *