Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
start to fill the NEWS file
[simgrid.git] / src / msg / msg_task.c
index b280a7c..f104387 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -112,7 +112,7 @@ MSG_parallel_task_create(const char *name, int host_nb,
   simdata->comm_amount = communication_amount;
 
   for (i = 0; i < host_nb; i++)
-    simdata->host_list[i] = host_list[i]->smx_host;
+    simdata->host_list[i] = host_list[i];
 
   return task;
 }
@@ -298,7 +298,7 @@ msg_error_t MSG_task_destroy(msg_task_t task)
  */
 msg_error_t MSG_task_cancel(msg_task_t task)
 {
-  xbt_assert((task != NULL), "Invalid parameter");
+  xbt_assert((task != NULL), "Cannot cancel a NULL task");
 
   if (task->simdata->compute) {
     simcall_host_execution_cancel(task->simdata->compute);
@@ -342,6 +342,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.
  *