Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add new simdag function upon user request.
authorsuter <frederic.suter@cc.in2p3.fr>
Fri, 9 Aug 2013 08:16:51 +0000 (10:16 +0200)
committersuter <frederic.suter@cc.in2p3.fr>
Fri, 9 Aug 2013 08:16:51 +0000 (10:16 +0200)
ChangeLog
include/simdag/simdag.h
src/simdag/sd_task.c

index a1d55ad..d3a01e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,9 +44,11 @@ SimGrid (3.10) NOT RELEASED; urgency=low
  * Add all missing Fortran bindings, SMPI should work with Fortran 90
    (no privatization of global variables yet)
 
+ SimDag:
+ * Add a new function SD_task_set_amount() upon user request.
 
  PLATFORM:
- * Handle units for values (10ms, 10kiloflops, 10Bps, ...)
+ * Handle units for values (10ms, 10kiloflops, 10Bps, 1GB, ...)
  * Remove rule based routing (no more pcre dependency)
  * Add a limiter_link option to cluster tag, to specify a maximum reachable
   bandwidth in fullduplex mode when it is < 2*nominal bw
index 9afe61d..bd9ee4e 100644 (file)
@@ -135,6 +135,7 @@ XBT_PUBLIC(void) SD_task_set_rate(SD_task_t task, double rate);
 XBT_PUBLIC(void) SD_task_watch(SD_task_t task, e_SD_task_state_t state);
 XBT_PUBLIC(void) SD_task_unwatch(SD_task_t task, e_SD_task_state_t state);
 XBT_PUBLIC(double) SD_task_get_amount(SD_task_t task);
+XBT_PUBLIC(void) SD_task_set_amount(SD_task_t task, double amount);
 XBT_PUBLIC(double) SD_task_get_alpha(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_remaining_amount(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task,
index af052fb..733febc 100644 (file)
@@ -476,7 +476,27 @@ double SD_task_get_amount(SD_task_t task)
 }
 
 /**
- * \brief Returns the alpha parameter of a SD_TASK_COMP_PAR_AMDAH task
+ * \brief Sets the total amount of work of a task
+ * For sequential typed tasks (COMP_SEQ and COMM_E2E), it also sets the
+ * appropriate values in the computation_amount and communication_amount arrays
+ * respectively. Nothing more than modifying task->amount is done for paralle
+ * typed tasks (COMP_PAR_AMDAHL and COMM_PAR_MXN_1D_BLOCK) as the distribution
+ * of the amount of work is done at scheduling time.
+ *
+ * \param task a task
+ * \param amount the new amount of work to execute
+ */
+void SD_task_set_amount(SD_task_t task, double amount)
+{
+  task->amount = amount;
+  if (task->kind == SD_TASK_COMP_SEQ)
+    task->computation_amount[0] = amount;
+  if (task->kind == SD_TASK_COMM_E2E)
+    task->communication_amount[2] = amount;
+}
+
+/**
+ * \brief Returns the alpha parameter of a SD_TASK_COMP_PAR_AMDAHL task
  *
  * \param task a parallel task assuming Amdahl's law as speedup model
  * \return the alpha parameter (serial part of a task in percent) for this task