Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
massive rename of simcalls: execution is related to a process, not to an host
[simgrid.git] / src / msg / msg_task.c
index aa71c5e..56b3d09 100644 (file)
@@ -72,9 +72,7 @@ msg_task_t MSG_task_create(const char *name, double flop_amount,
   simdata->host_list = NULL;
   simdata->flops_parallel_amount = NULL;
   simdata->bytes_parallel_amount = NULL;
-#ifdef HAVE_TRACING
   TRACE_msg_task_create(task);
-#endif
 
   return task;
 }
@@ -109,7 +107,7 @@ MSG_parallel_task_create(const char *name, int host_nb,
 
   /* Simulator Data specific to parallel tasks */
   simdata->host_nb = host_nb;
-  simdata->host_list = xbt_new0(smx_host_t, host_nb);
+  simdata->host_list = xbt_new0(sg_host_t, host_nb);
   simdata->flops_parallel_amount = flops_amount;
   simdata->bytes_parallel_amount = bytes_amount;
 
@@ -155,10 +153,7 @@ msg_gpu_task_t MSG_gpu_task_create(const char *name, double flops_amount,
   simdata->dispatch_latency   = dispatch_latency;
   simdata->collect_latency    = collect_latency;
 
-#ifdef HAVE_TRACING
-  //FIXME
-  /* TRACE_msg_gpu_task_create(task); */
-#endif
+  /* TRACE_msg_gpu_task_create(task); FIXME*/
 
   return task;
 }
@@ -272,15 +267,13 @@ msg_error_t MSG_task_destroy(msg_task_t task)
     /* the task is being sent or executed: cancel it first */
     MSG_task_cancel(task);
   }
-#ifdef HAVE_TRACING
   TRACE_msg_task_destroy(task);
-#endif
 
   xbt_free(task->name);
 
   action = task->simdata->compute;
   if (action)
-    simcall_host_execution_destroy(action);
+    simcall_process_execution_destroy(action);
 
   /* parallel tasks only */
   xbt_free(task->simdata->host_list);
@@ -305,7 +298,7 @@ msg_error_t MSG_task_cancel(msg_task_t task)
   xbt_assert((task != NULL), "Cannot cancel a NULL task");
 
   if (task->simdata->compute) {
-    simcall_host_execution_cancel(task->simdata->compute);
+    simcall_process_execution_cancel(task->simdata->compute);
   }
   else if (task->simdata->comm) {
     simdata_task_t simdata = task->simdata;
@@ -318,17 +311,18 @@ msg_error_t MSG_task_cancel(msg_task_t task)
 }
 
 /** \ingroup m_task_management
- * \brief Returns the computation amount needed to process a task #msg_task_t.
+ * \brief Returns the remaining amount of flops needed to execute a task #msg_task_t.
  *
  * Once a task has been processed, this amount is set to 0. If you want, you
- * can reset this value with #MSG_task_set_compute_duration before restarting the task.
+ * can reset this value with #MSG_task_set_flops_amount before restarting the task.
  */
-double MSG_task_get_compute_duration(msg_task_t task)
-{
-  xbt_assert((task != NULL)
-              && (task->simdata != NULL), "Invalid parameter");
+double MSG_task_get_flops_amount(msg_task_t task) {
 
-  return task->simdata->flops_amount;
+       if (task->simdata->compute) {
+               return simcall_process_execution_get_remains(task->simdata->compute);
+       } else {
+               return task->simdata->flops_amount;
+       }
 }
 
 
@@ -359,26 +353,6 @@ void MSG_task_set_bytes_amount(msg_task_t task, double 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.
- * If it is not ongoing, it returns the total amount of work that will be
- * executed when the task starts.
- */
-double MSG_task_get_remaining_computation(msg_task_t task)
-{
-  xbt_assert((task != NULL)
-              && (task->simdata != NULL), "Invalid parameter");
-
-  if (task->simdata->compute) {
-    return simcall_host_execution_get_remains(task->simdata->compute);
-  } else {
-    return task->simdata->flops_amount;
-  }
-}
-
 /** \ingroup m_task_management
  * \brief Returns the total amount received by a task #msg_task_t.
  *        If the communication does not exist it will return 0.
@@ -436,7 +410,7 @@ void MSG_task_set_priority(msg_task_t task, double priority)
 
   task->simdata->priority = 1 / priority;
   if (task->simdata->compute)
-    simcall_host_execution_set_priority(task->simdata->compute,
+    simcall_process_execution_set_priority(task->simdata->compute,
                                       task->simdata->priority);
 }
 
@@ -457,7 +431,7 @@ void MSG_task_set_bound(msg_task_t task, double bound)
 
   task->simdata->bound = bound;
   if (task->simdata->compute)
-    simcall_host_execution_set_bound(task->simdata->compute,
+    simcall_process_execution_set_bound(task->simdata->compute,
                                       task->simdata->bound);
 }
 
@@ -543,6 +517,6 @@ void MSG_task_set_affinity(msg_task_t task, msg_host_t host, unsigned long mask)
     }
 
     XBT_INFO("set affinity(0x%04lx@%s) for %s", mask, MSG_host_get_name(host), MSG_task_get_name(task));
-    simcall_host_execution_set_affinity(task->simdata->compute, host, mask);
+    simcall_process_execution_set_affinity(task->simdata->compute, host, mask);
   }
 }