Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Install some kernel header files for the users' plugins and more
[simgrid.git] / src / simdag / sd_task.cpp
index b75326d..8bbfa7f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2017. The SimGrid Team.
+/* Copyright (c) 2006-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -527,13 +527,11 @@ void SD_task_dotty(SD_task_t task, void *out)
  * \a dst will depend on \a src, ie \a dst will not start before \a src is finished.
  * Their \ref e_SD_task_state_t "state" must be #SD_NOT_SCHEDULED, #SD_SCHEDULED or #SD_RUNNABLE.
  *
- * \param name the name of the new dependency (can be \c nullptr)
- * \param data the user data you want to associate with this dependency (can be \c nullptr)
  * \param src the task which must be executed first
  * \param dst the task you want to make depend on \a src
  * \see SD_task_dependency_remove()
  */
-void SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task_t dst)
+void SD_task_dependency_add(SD_task_t src, SD_task_t dst)
 {
   if (src == dst)
     THROWF(arg_error, 0, "Cannot add a dependency between task '%s' and itself", SD_task_get_name(src));
@@ -676,8 +674,8 @@ void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state)
  * \param bytes_amount communication amount between each pair of hosts (i.e., a matrix of host_count*host_count doubles)
  * \see SD_schedule()
  */
-double SD_task_get_execution_time(SD_task_t task, int host_count, const sg_host_t *host_list,
-                                  const double *flops_amount, const double *bytes_amount)
+double SD_task_get_execution_time(SD_task_t /*task*/, int host_count, const sg_host_t* host_list,
+                                  const double* flops_amount, const double* bytes_amount)
 {
   xbt_assert(host_count > 0, "Invalid parameter");
   double max_time = 0.0;
@@ -882,7 +880,8 @@ void SD_task_build_MxN_1D_block_matrix(SD_task_t task, int src_nb, int dst_nb){
       XBT_VERB("(%d->%d): (%.2f, %.2f)-> (%.2f, %.2f)", i, j, src_start, src_end, dst_start, dst_end);
       task->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
       if ((src_end > dst_start) && (dst_end > src_start)) { /* There is something to send */
-        task->bytes_amount[i*(src_nb+dst_nb)+src_nb+j] = MIN(src_end, dst_end)- MAX(src_start, dst_start);
+        task->bytes_amount[i * (src_nb + dst_nb) + src_nb + j] =
+            std::min(src_end, dst_end) - std::max(src_start, dst_start);
         XBT_VERB("==> %.2f", task->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]);
       }
     }
@@ -970,12 +969,12 @@ void SD_task_schedulev(SD_task_t task, int count, const sg_host_t * list)
 void SD_task_schedulel(SD_task_t task, int count, ...)
 {
   va_list ap;
-  sg_host_t *list = xbt_new(sg_host_t, count);
+  sg_host_t* list = new sg_host_t[count];
   va_start(ap, count);
   for (int i=0; i<count; i++)
     list[i] = va_arg(ap, sg_host_t);
 
   va_end(ap);
   SD_task_schedulev(task, count, list);
-  xbt_free(list);
+  delete[] list;
 }