Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
can be interesting to get the value of the alpha parameter for parallel
authorsuter <frederic.suter@cc.in2p3.fr>
Sun, 20 Jan 2013 15:29:47 +0000 (16:29 +0100)
committersuter <frederic.suter@cc.in2p3.fr>
Sun, 20 Jan 2013 15:29:47 +0000 (16:29 +0100)
typed tasks

include/simdag/simdag.h
src/simdag/sd_task.c

index c00264d..ece3c59 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(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,
                                               int workstation_nb,
index 3b97116..ba64864 100644 (file)
@@ -451,6 +451,20 @@ double SD_task_get_amount(SD_task_t task)
   return task->amount;
 }
 
+/**
+ * \brief Returns the alpha parameter of a SD_TASK_COMP_PAR_AMDAH 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
+ */
+double SD_task_get_alpha(SD_task_t task)
+{
+  xbt_assert(SD_task_get_kind(task) == SD_TASK_COMP_PAR_AMDAHL,
+     "Alpha parameter is not defined for this kink of task");
+  return task->alpha;
+}
+
+
 /**
  * \brief Returns the remaining amount work to do till the completion of a task
  *