Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add MSG_task_get_compute_duration() and MSG_task_get_data_size()
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 16 Mar 2005 01:21:27 +0000 (01:21 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 16 Mar 2005 01:21:27 +0000 (01:21 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1173 48e7efb5-ca39-0410-a469-dd3cf9ba447f

ChangeLog
include/msg/msg.h
src/msg/task.c

index 8bd89c2..d282a84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,9 @@ Plutot finaliser ce qui est commenc
 ----
 DONE
 ----
+  [Arnaud]
+  (msg)
+  * Add MSG_task_get_compute_duration() and MSG_task_get_data_size()
 
   [Martin]
   * Cleanups in configury with regard to compile optimization/warning flags.
index 7936aeb..70c4ce9 100644 (file)
@@ -97,6 +97,9 @@ int MSG_task_probe_from(m_channel_t channel);
 MSG_error_t MSG_process_sleep(double nb_sec);
 MSG_error_t MSG_get_errno(void);
 
+double MSG_task_get_compute_duration(m_task_t task);
+double MSG_task_get_data_size(m_task_t task);
+
 /************************** Deprecated ***************************************/
 /* MSG_error_t MSG_routing_table_init(void); */
 /* MSG_error_t MSG_routing_table_set(m_host_t host1, m_host_t host2, */
index ff8b008..ff30951 100644 (file)
@@ -140,6 +140,32 @@ MSG_error_t MSG_task_destroy(m_task_t task)
   return MSG_OK;
 }
 
+/** \ingroup m_task_management
+ * \brief Returns the computation amount needed to process a task #m_task_t.
+ *
+ */
+double MSG_task_get_compute_duration(m_task_t task)
+{
+  simdata_task_t simdata = NULL;
+
+  xbt_assert0((task != NULL) && (task->simdata != NULL), "Invalid parameter");
+
+  return task->simdata->computation_amount;
+}
+
+/** \ingroup m_task_management
+ * \brief Returns the size of the data attached to a task #m_task_t.
+ *
+ */
+double MSG_task_get_data_size(m_task_t task)
+{
+  simdata_task_t simdata = NULL;
+
+  xbt_assert0((task != NULL) && (task->simdata != NULL), "Invalid parameter");
+
+  return task->simdata->message_size;
+}
+
 /* static MSG_error_t __MSG_task_check(m_task_t task) */
 /* { */
 /*   simdata_task_t simdata = NULL; */