Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add MSG_task_set_data_size function
authorJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Wed, 30 Jan 2013 11:29:58 +0000 (12:29 +0100)
committerJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Wed, 30 Jan 2013 11:29:58 +0000 (12:29 +0100)
include/msg/msg.h
src/msg/msg_task.c

index 5f0077e..330ed56 100644 (file)
@@ -205,6 +205,9 @@ XBT_PUBLIC(msg_error_t) MSG_process_sleep(double nb_sec);
 XBT_PUBLIC(double) MSG_task_get_compute_duration(msg_task_t task);
 XBT_PUBLIC(void) MSG_task_set_compute_duration(msg_task_t task,
                                                double compute_duration);
+XBT_PUBLIC(void) MSG_task_set_data_size(msg_task_t task,
+                                              double data_size);
+
 XBT_PUBLIC(double) MSG_task_get_remaining_computation(msg_task_t task);
 XBT_PUBLIC(double) MSG_task_get_remaining_communication(msg_task_t task);
 XBT_PUBLIC(int) MSG_task_is_latency_bounded(msg_task_t task);
index 101689c..a32e0d8 100644 (file)
@@ -343,6 +343,23 @@ void MSG_task_set_compute_duration(msg_task_t task,
 }
 
 /** \ingroup m_task_management
+ * \brief set the amount data attached with a task #msg_task_t.
+ *
+ * \warning If the transfer is ongoing (already started and not finished),
+ * it is not modified by this call. 
+ */
+
+void MSG_task_set_data_size(msg_task_t task,
+                                   double data_size)
+{
+  xbt_assert(task, "Invalid parameter");
+  task->simdata->message_size = data_size;
+
+}
+
+
+
+/** \ingroup m_task_management
  * \brief Returns the remaining computation amount of a task #msg_task_t.
  *
  * If the task is ongoing, this call retrieves the remaining amount of work.