Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Finish SimDag documentation
authorthiery <thiery@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 28 Jun 2006 13:26:42 +0000 (13:26 +0000)
committerthiery <thiery@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 28 Jun 2006 13:26:42 +0000 (13:26 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2460 48e7efb5-ca39-0410-a469-dd3cf9ba447f

doc/module-sd.doc
include/simdag/datatypes.h
include/simdag/simdag.h
src/simdag/private.h
src/simdag/sd_global.c
src/simdag/sd_link.c
src/simdag/sd_task.c
src/simdag/sd_workstation.c

index 8de5406..ca19b63 100644 (file)
@@ -5,8 +5,7 @@
    - \ref SD_workstation_management
    - \ref SD_link_management
    - \ref SD_task_management
    - \ref SD_workstation_management
    - \ref SD_link_management
    - \ref SD_task_management
-   - \ref SD_dependency_management
-   - \ref SD_platform_management
+   - \ref SD_task_dependency_management
    - \ref SD_simulation
 
 */
    - \ref SD_simulation
 
 */
@@ -22,9 +21,7 @@
         \ingroup SD_API  */
 /**     \addtogroup SD_task_management
         \ingroup SD_API  */
         \ingroup SD_API  */
 /**     \addtogroup SD_task_management
         \ingroup SD_API  */
-/**     \addtogroup SD_dependency_management
-        \ingroup SD_API  */
-/**     \addtogroup SD_platform_management
+/**     \addtogroup SD_task_dependency_management
         \ingroup SD_API  */
 /**     \addtogroup SD_simulation
         \ingroup SD_API  */
         \ingroup SD_API  */
 /**     \addtogroup SD_simulation
         \ingroup SD_API  */
index 9056035..391f469 100644 (file)
@@ -27,7 +27,8 @@ typedef struct SD_link *SD_link_t;
     A task is some <em>computing amount</em> that can be executed
     in parallel on several workstations. A task may depend on other
     tasks, this means that the task cannot start until the other tasks are done.
     A task is some <em>computing amount</em> that can be executed
     in parallel on several workstations. A task may depend on other
     tasks, this means that the task cannot start until the other tasks are done.
-    Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether the task is scheduled, running, done, etc.
+    Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether 
+    the task is scheduled, running, done, etc.
 
     @see SD_task_management */
 typedef struct SD_task *SD_task_t;
 
     @see SD_task_management */
 typedef struct SD_task *SD_task_t;
index 6efe56b..9690a03 100644 (file)
@@ -8,18 +8,24 @@ SG_BEGIN_DECL()
 
 /************************** Link handling ***********************************/
 
 
 /************************** Link handling ***********************************/
 
-/* private (called by SD_environment_create)
-SD_link_t    SD_link_create(void *data, const char *name,
-double bandwidth, double latency);*/
+/** @defgroup SD_link_management Links
+ *  @brief Functions for managing the network links
+ * 
+ *  This section describes the functions for managing the network links.
+ *  
+ *  A link is a network node represented as a <em>name</em>, a <em>current
+ *  bandwidth</em> and a <em>current latency</em>. The links are created
+ *  when you call the function SD_create_environment.
+ *
+ *  @see SD_link_t
+ *  @{
+ */
 void*        SD_link_get_data(SD_link_t link);
 void         SD_link_set_data(SD_link_t link, void *data);
 const char*  SD_link_get_name(SD_link_t link);
 void*        SD_link_get_data(SD_link_t link);
 void         SD_link_set_data(SD_link_t link, void *data);
 const char*  SD_link_get_name(SD_link_t link);
-double       SD_link_get_capacity(SD_link_t link);
 double       SD_link_get_current_bandwidth(SD_link_t link);
 double       SD_link_get_current_latency(SD_link_t link);
 double       SD_link_get_current_bandwidth(SD_link_t link);
 double       SD_link_get_current_latency(SD_link_t link);
-/* private (called by SD_clean)
-void         SD_link_destroy(SD_link_t link);
-*/
+/** @} */
 
 /************************** Workstation handling ****************************/
 
 
 /************************** Workstation handling ****************************/
 
@@ -32,8 +38,9 @@ void         SD_link_destroy(SD_link_t link);
  *  A workstation is represented as a <em>physical
  *  resource with computing capabilities</em> and has a <em>name</em>.
  *
  *  A workstation is represented as a <em>physical
  *  resource with computing capabilities</em> and has a <em>name</em>.
  *
- *  @see SD_workstation_t
+ *  The workstations are created when you call the function SD_create_environment.
  *
  *
+ *  @see SD_workstation_t
  *  @{
  */
 SD_workstation_t   SD_workstation_get_by_name(const char *name);
  *  @{
  */
 SD_workstation_t   SD_workstation_get_by_name(const char *name);
@@ -46,41 +53,69 @@ SD_link_t*         SD_workstation_route_get_list(SD_workstation_t src, SD_workst
 int                SD_workstation_route_get_size(SD_workstation_t src, SD_workstation_t dst);
 double             SD_workstation_get_power(SD_workstation_t workstation);
 double             SD_workstation_get_available_power(SD_workstation_t workstation);
 int                SD_workstation_route_get_size(SD_workstation_t src, SD_workstation_t dst);
 double             SD_workstation_get_power(SD_workstation_t workstation);
 double             SD_workstation_get_available_power(SD_workstation_t workstation);
-
 /** @} */
 
 /************************** Task handling ************************************/
 
 /** @} */
 
 /************************** Task handling ************************************/
 
+/** @defgroup SD_task_management Tasks
+ *  @brief Functions for managing the tasks
+ * 
+ *  This section describes the functions for managing the tasks.
+ *  
+ *  A task is some <em>computing amount</em> that can be executed
+ *  in parallel on several workstations. A task may depend on other
+ *  tasks, this means that the task cannot start until the other tasks are done.
+ *  Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether
+ *  the task is scheduled, running, done, etc.
+ *  
+ *  @see SD_task_t, SD_task_dependency_management
+ *  @{
+ */
 SD_task_t         SD_task_create(const char *name, void *data, double amount);
 SD_task_t         SD_task_create(const char *name, void *data, double amount);
-void              SD_task_schedule(SD_task_t task, int workstation_nb,
-                                  const SD_workstation_t *workstation_list, double *computation_amount,
-                                  double *communication_amount, double rate);
-void              SD_task_reset(SD_task_t task);
 void*             SD_task_get_data(SD_task_t task);
 void              SD_task_set_data(SD_task_t task, void *data);
 void*             SD_task_get_data(SD_task_t task);
 void              SD_task_set_data(SD_task_t task, void *data);
+e_SD_task_state_t SD_task_get_state(SD_task_t task);
 const char*       SD_task_get_name(SD_task_t task);
 double            SD_task_get_amount(SD_task_t task);
 double            SD_task_get_remaining_amount(SD_task_t task);
 const char*       SD_task_get_name(SD_task_t task);
 double            SD_task_get_amount(SD_task_t task);
 double            SD_task_get_remaining_amount(SD_task_t task);
-void              SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task_t dst);
-void              SD_task_dependency_remove(SD_task_t src, SD_task_t dst);
-void*             SD_task_dependency_get_data(SD_task_t src, SD_task_t dst);
-e_SD_task_state_t SD_task_get_state(SD_task_t task);
-/* e_SD_task_state_t can be either SD_SCHEDULED, SD_RUNNING, SD_DONE, or SD_FAILED */
-
 void              SD_task_watch(SD_task_t task, e_SD_task_state_t state);
 void              SD_task_watch(SD_task_t task, e_SD_task_state_t state);
-/* SD_simulate will stop as soon as the state of this task is the one given in argument.
-   Watch-point is then automatically removed */
-
 void              SD_task_unwatch(SD_task_t task, e_SD_task_state_t state);
 void              SD_task_unwatch(SD_task_t task, e_SD_task_state_t state);
-void              SD_task_unschedule(SD_task_t task); /* change state and rerun */
+void              SD_task_schedule(SD_task_t task, int workstation_nb,
+                                  const SD_workstation_t *workstation_list, double *computation_amount,
+                                  double *communication_amount, double rate);
+void              SD_task_unschedule(SD_task_t task);
 void              SD_task_destroy(SD_task_t task);
 void              SD_task_destroy(SD_task_t task);
+/** @} */
+
+
+/** @defgroup SD_task_dependency_management Tasks dependencies
+ *  @brief Functions for managing the task dependencies
+ *
+ *  This section describes the functions for managing the dependencies between the tasks.
+ *
+ *  @see SD_task_management
+ *  @{
+ */
+void              SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task_t dst);
+void              SD_task_dependency_remove(SD_task_t src, SD_task_t dst);
+void*             SD_task_dependency_get_data(SD_task_t src, SD_task_t dst);
+/** @} */
 
 /************************** Global *******************************************/
 
 
 /************************** Global *******************************************/
 
+/** @defgroup SD_simulation Simulation
+ *  @brief Functions for creating the environment and launching the simulation
+ * 
+ *  This section describes the functions for initialising SimDag, launching
+ *  the simulation and exiting SimDag.
+ *  
+ *  @{
+ */
 void              SD_init(int *argc, char **argv);
 void              SD_create_environment(const char *platform_file);
 void              SD_init(int *argc, char **argv);
 void              SD_create_environment(const char *platform_file);
-SD_task_t*        SD_simulate(double how_long); /* returns a NULL-terminated array of SD_task_t whose state has changed */
-void              SD_exit(void); /* cleans everything */
+SD_task_t*        SD_simulate(double how_long);
+void              SD_exit(void);
+/** @} */
 
 SG_END_DECL()
 
 
 SG_END_DECL()
 
index d826d3a..06fe339 100644 (file)
@@ -115,5 +115,4 @@ static _XBT_INLINE int __SD_task_is_running(SD_task_t task) {
   return task->state_set == sd_global->running_task_set;
 }
 
   return task->state_set == sd_global->running_task_set;
 }
 
-
 #endif
 #endif
index 576c163..2e5f3f3 100644 (file)
@@ -9,7 +9,15 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_kernel,sd,
 
 SD_global_t sd_global = NULL;
 
 
 SD_global_t sd_global = NULL;
 
-/* Initialises SD internal data. This function should be called before any other SD function.
+/**
+ * \brief Initialises SD internal data
+ *
+ * This function must be called before any other SD function. Then you
+ * should call SD_create_environment().
+ *
+ * \param argc argument number
+ * \param argv argument list
+ * \see SD_create_environment(), SD_exit()
  */
 void SD_init(int *argc, char **argv) {
   xbt_assert0(sd_global == NULL, "SD_init already called");
  */
 void SD_init(int *argc, char **argv) {
   xbt_assert0(sd_global == NULL, "SD_init already called");
@@ -31,7 +39,23 @@ void SD_init(int *argc, char **argv) {
   surf_init(argc, argv);
 }
 
   surf_init(argc, argv);
 }
 
-/* Creates the environnement described in a xml file of a platform description.
+/**
+ * \brief Creates the environment
+ *
+ * The environment (i.e. the \ref SD_workstation_management "workstations" and the
+ * \ref SD_link_management "links") is created with the data stored in the given XML
+ * platform file.
+ *
+ * \param platform_file name of an XML file describing the environment to create
+ * \see SD_workstation_management, SD_link_management
+ *
+ * The XML file follows this DTD:
+ *
+ *     \include surfxml.dtd
+ *
+ * Here is a small example of such a platform: 
+ *
+ *     \include small_platform.xml
  */
 void SD_create_environment(const char *platform_file) {
   xbt_dict_cursor_t cursor = NULL;
  */
 void SD_create_environment(const char *platform_file) {
   xbt_dict_cursor_t cursor = NULL;
@@ -64,7 +88,17 @@ void SD_create_environment(const char *platform_file) {
   }
 }
 
   }
 }
 
-/* Launches the simulation. Returns a NULL-terminated array of SD_task_t whose state has changed.
+/**
+ * \brief Launches the simulation.
+ *
+ * The function will execute the \ref SD_READY ready tasks.
+ * The simulation will be stopped when its time reaches \a how_long,
+ * when a watch point is reached, or when no more task can be executed.
+ * Then you can call SD_simulate() again.
+ * 
+ * \param how_long maximum duration of the simulation
+ * \return a NULL-terminated array of \ref SD_task_t whose state has changed.
+ * \see SD_task_schedule(), SD_task_watch()
  */
 SD_task_t* SD_simulate(double how_long)
 {
  */
 SD_task_t* SD_simulate(double how_long)
 {
@@ -137,8 +171,13 @@ SD_task_t* SD_simulate(double how_long)
   return changed_tasks;
 }
 
   return changed_tasks;
 }
 
-/* Destroys all SD internal data. This function should be called when the simulation is over.
- * The tasks should have been destroyed first.
+/**
+ * \brief Destroys all SD internal data.
+ *
+ * This function should be called when the simulation is over. Don't forget also to destroy
+ * the tasks.
+ *
+ * \see SD_init(), SD_task_destroy()
  */
 void SD_exit(void) {
   if (sd_global != NULL) {
  */
 void SD_exit(void) {
   if (sd_global != NULL) {
index 637a6e2..0edd95e 100644 (file)
@@ -4,7 +4,7 @@
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
 
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
 
-/* Creates a link.
+/* Creates a link and registers it in SD.
  */
 SD_link_t __SD_link_create(void *surf_link, void *data) {
   SD_CHECK_INIT_DONE();
  */
 SD_link_t __SD_link_create(void *surf_link, void *data) {
   SD_CHECK_INIT_DONE();
@@ -16,12 +16,17 @@ SD_link_t __SD_link_create(void *surf_link, void *data) {
   link->data = data; /* user data */
 
   const char *name = SD_link_get_name(link);
   link->data = data; /* user data */
 
   const char *name = SD_link_get_name(link);
-  xbt_dict_set(sd_global->links, name, link, __SD_link_destroy); /* add the workstation to the dictionary */
+  xbt_dict_set(sd_global->links, name, link, __SD_link_destroy); /* add the link to the dictionary */
 
   return link;
 }
 
 
   return link;
 }
 
-/* Returns the user data of a link. The user data can be NULL.
+/**
+ * \brief Returns the user data of a link
+ *
+ * \param link a link
+ * \return the user data associated with this link (can be \c NULL)
+ * \see SD_link_set_data()
  */
 void* SD_link_get_data(SD_link_t link) {
   SD_CHECK_INIT_DONE();
  */
 void* SD_link_get_data(SD_link_t link) {
   SD_CHECK_INIT_DONE();
@@ -29,7 +34,15 @@ void* SD_link_get_data(SD_link_t link) {
   return link->data;
 }
 
   return link->data;
 }
 
-/* Sets the user data of a link. The new data can be NULL. The old data should have been freed first if it was not NULL.
+/**
+ * \brief Sets the user data of a link
+ *
+ * The new data can be \c NULL. The old data should have been freed first
+ * if it was not \c NULL.
+ *
+ * \param link a link
+ * \param data the new data you want to associate with this link
+ * \see SD_link_get_data()
  */
 void SD_link_set_data(SD_link_t link, void *data) {
   SD_CHECK_INIT_DONE();
  */
 void SD_link_set_data(SD_link_t link, void *data) {
   SD_CHECK_INIT_DONE();
@@ -37,7 +50,11 @@ void SD_link_set_data(SD_link_t link, void *data) {
   link->data = data;
 }
 
   link->data = data;
 }
 
-/* Returns the name of a link. The name cannot be NULL.
+/**
+ * \brief Returns the name of a link
+ *
+ * \param link a link
+ * \return the name of this link (cannot be \c NULL)
  */
 const char* SD_link_get_name(SD_link_t link) {
   SD_CHECK_INIT_DONE();
  */
 const char* SD_link_get_name(SD_link_t link) {
   SD_CHECK_INIT_DONE();
@@ -45,15 +62,11 @@ const char* SD_link_get_name(SD_link_t link) {
   return surf_workstation_resource->extension_public->get_link_name(link->surf_link);
 }
 
   return surf_workstation_resource->extension_public->get_link_name(link->surf_link);
 }
 
-/* Returns the capacity of a link.
- */
-/*
-double SD_link_get_capacity(SD_link_t link) {
-  xbt_assert0(link, "Invalid parameter");
-  return link->capacity;
-}*/
-
-/* Return the current bandwidth of a link.
+/**
+ * \brief Returns the current bandwidth of a link
+ *
+ * \param link a link
+ * \return the current bandwidth of this link, in Flops
  */
 double SD_link_get_current_bandwidth(SD_link_t link) {
   SD_CHECK_INIT_DONE();
  */
 double SD_link_get_current_bandwidth(SD_link_t link) {
   SD_CHECK_INIT_DONE();
@@ -61,7 +74,11 @@ double SD_link_get_current_bandwidth(SD_link_t link) {
   return surf_workstation_resource->extension_public->get_link_bandwidth(link->surf_link);
 }
 
   return surf_workstation_resource->extension_public->get_link_bandwidth(link->surf_link);
 }
 
-/* Return the current latency of a link.
+/**
+ * \brief Returns the current latency of a link
+ *
+ * \param link a link
+ * \return the current latency of this link, in seconds
  */
 double SD_link_get_current_latency(SD_link_t link) {
   SD_CHECK_INIT_DONE();
  */
 double SD_link_get_current_latency(SD_link_t link) {
   SD_CHECK_INIT_DONE();
@@ -69,7 +86,7 @@ double SD_link_get_current_latency(SD_link_t link) {
   return surf_workstation_resource->extension_public->get_link_latency(link->surf_link);
 }
 
   return surf_workstation_resource->extension_public->get_link_latency(link->surf_link);
 }
 
-/* Destroys a link. The user data (if any) should have been destroyed first.
+/* Destroys a link.
  */
 void __SD_link_destroy(void *link) {
   SD_CHECK_INIT_DONE();
  */
 void __SD_link_destroy(void *link) {
   SD_CHECK_INIT_DONE();
index 59530d8..4a046fa 100644 (file)
@@ -3,7 +3,14 @@
 #include "xbt/sysdep.h"
 #include "xbt/dynar.h"
 
 #include "xbt/sysdep.h"
 #include "xbt/dynar.h"
 
-/* Creates a task.
+/**
+ * \brief Creates a new task.
+ *
+ * \param name the name of the task (can be \c NULL)
+ * \param data the user data you want to associate with the task (can be \c NULL)
+ * \param amount the computing amount necessary to do this task
+ * \return the new task
+ * \see SD_task_destroy()
  */
 SD_task_t SD_task_create(const char *name, void *data, double amount) {
   SD_CHECK_INIT_DONE();
  */
 SD_task_t SD_task_create(const char *name, void *data, double amount) {
   SD_CHECK_INIT_DONE();
@@ -40,7 +47,12 @@ SD_task_t SD_task_create(const char *name, void *data, double amount) {
   return task;
 }
 
   return task;
 }
 
-/* Returns the data of a task.
+/**
+ * \brief Returns the user data of a task
+ *
+ * \param task a task
+ * \return the user data associated with this task (can be \c NULL)
+ * \see SD_task_set_data()
  */
 void* SD_task_get_data(SD_task_t task) {
   SD_CHECK_INIT_DONE();
  */
 void* SD_task_get_data(SD_task_t task) {
   SD_CHECK_INIT_DONE();
@@ -48,7 +60,29 @@ void* SD_task_get_data(SD_task_t task) {
   return task->data;
 }
 
   return task->data;
 }
 
-/* Returns the state of a task: SD_NOT_SCHEDULED, SD_SCHEDULED, SD_READY, SD_RUNNING, SD_DONE or SD_FAILED.
+/**
+ * \brief Sets the user data of a task
+ *
+ * The new data can be \c NULL. The old data should have been freed first
+ * if it was not \c NULL.
+ *
+ * \param task a task
+ * \param data the new data you want to associate with this task
+ * \see SD_task_get_data()
+ */
+void SD_task_set_data(SD_task_t task, void *data) {
+  SD_CHECK_INIT_DONE();
+  xbt_assert0(task != NULL, "Invalid parameter");
+  task->data = data;
+}
+
+/**
+ * \brief Returns the state of a task
+ *
+ * \param task a task
+ * \return the current \ref e_SD_task_state_t "state" of this task:
+ * #SD_NOT_SCHEDULED, #SD_SCHEDULED, #SD_READY, #SD_RUNNING, #SD_DONE or #SD_FAILED
+ * \see e_SD_task_state_t
  */
 e_SD_task_state_t SD_task_get_state(SD_task_t task) {
   SD_CHECK_INIT_DONE();
  */
 e_SD_task_state_t SD_task_get_state(SD_task_t task) {
   SD_CHECK_INIT_DONE();
@@ -93,23 +127,20 @@ void __SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state) {
   default:
     xbt_assert0(0, "Invalid state");
   }
   default:
     xbt_assert0(0, "Invalid state");
   }
-  xbt_swag_insert(task,task->state_set);
+  xbt_swag_insert(task, task->state_set);
 
   if (task->watch_points & new_state) {
     printf("Watch point reached with task '%s' in state %d!\n", SD_task_get_name(task), new_state);
     sd_global->watch_point_reached = 1;
 
   if (task->watch_points & new_state) {
     printf("Watch point reached with task '%s' in state %d!\n", SD_task_get_name(task), new_state);
     sd_global->watch_point_reached = 1;
+    SD_task_unwatch(task, new_state); /* remove the watch point */
   }
 }
 
   }
 }
 
-/* Sets the data of a task.
- */
-void SD_task_set_data(SD_task_t task, void *data) {
-  SD_CHECK_INIT_DONE();
-  xbt_assert0(task != NULL, "Invalid parameter");
-  task->data = data;
-}
-
-/* Returns the name of a task. The name can be NULL.
+/**
+ * \brief Returns the name of a task
+ *
+ * \param task a task
+ * \return the name of this task (can be \c NULL)
  */
 const char* SD_task_get_name(SD_task_t task) {
   SD_CHECK_INIT_DONE();
  */
 const char* SD_task_get_name(SD_task_t task) {
   SD_CHECK_INIT_DONE();
@@ -117,7 +148,12 @@ const char* SD_task_get_name(SD_task_t task) {
   return task->name;
 }
 
   return task->name;
 }
 
-/* Returns the computing amount of a task.
+/**
+ * \brief Returns the computing amount of a task
+ *
+ * \param task a task
+ * \return the total computing amount of this task
+ * \see SD_task_get_remaining_amount()
  */
 double SD_task_get_amount(SD_task_t task) {
   SD_CHECK_INIT_DONE();
  */
 double SD_task_get_amount(SD_task_t task) {
   SD_CHECK_INIT_DONE();
@@ -125,7 +161,12 @@ double SD_task_get_amount(SD_task_t task) {
   return task->amount;
 }
 
   return task->amount;
 }
 
-/* Returns the remaining computing amount of a task.
+/**
+ * \brief Returns the remaining computing amount of a task
+ *
+ * \param task a task
+ * \return the remaining computing amount of this task
+ * \see SD_task_get_amount()
  */
 double SD_task_get_remaining_amount(SD_task_t task) {
   SD_CHECK_INIT_DONE();
  */
 double SD_task_get_remaining_amount(SD_task_t task) {
   SD_CHECK_INIT_DONE();
@@ -168,8 +209,17 @@ static void __SD_task_dependency_destroy(void *dependency) {
   xbt_free(dependency);
 }
 
   xbt_free(dependency);
 }
 
-/* Adds a dependency between two tasks. Their state must be SD_NOT_SCHEDULED, SD_SCHEDULED
- * or SD_READY.
+/**
+ * \brief Adds a dependency between two tasks
+ *
+ * \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_READY.
+ *
+ * \param name the name of the new dependency (can be \c NULL)
+ * \param data the user data you want to associate with this dependency (can be \c NULL)
+ * \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) {
   SD_CHECK_INIT_DONE();
  */
 void SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task_t dst) {
   SD_CHECK_INIT_DONE();
@@ -215,7 +265,12 @@ void SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task
       __SD_print_dependencies(dst); */
 }
 
       __SD_print_dependencies(dst); */
 }
 
-/* Removes a dependency between two tasks.
+/**
+ * \brief Remove a dependency between two tasks
+ *
+ * \param src a task
+ * \param dst a task depending on \a src
+ * \see SD_task_dependency_add()
  */
 void SD_task_dependency_remove(SD_task_t src, SD_task_t dst) {
   SD_CHECK_INIT_DONE();
  */
 void SD_task_dependency_remove(SD_task_t src, SD_task_t dst) {
   SD_CHECK_INIT_DONE();
@@ -261,7 +316,13 @@ void SD_task_dependency_remove(SD_task_t src, SD_task_t dst) {
       __SD_print_dependencies(dst);*/
 }
 
       __SD_print_dependencies(dst);*/
 }
 
-/* Returns the data associated to a dependency between two tasks. This data can be NULL.
+/**
+ * \brief Returns the user data associated with a dependency between two tasks
+ *
+ * \param src a task
+ * \param dst a task depending on \a src
+ * \return the user data associated with this dependency (can be \c NULL)
+ * \see SD_task_dependency_add()
  */
 void *SD_task_dependency_get_data(SD_task_t src, SD_task_t dst) {
   SD_CHECK_INIT_DONE();
  */
 void *SD_task_dependency_get_data(SD_task_t src, SD_task_t dst) {
   SD_CHECK_INIT_DONE();
@@ -295,10 +356,15 @@ static void __SD_print_watch_points(SD_task_t task) {
   printf("\n");
 }
 
   printf("\n");
 }
 
-/* Adds a watch point to a task.
-   SD_simulate will stop as soon as the state of this task is the one given in argument.
-   Watch point is then automatically removed.
-   The given state must be SD_SCHEDULED, SD_READY, SD_RUNNING, SD_DONE or SD_FAILED.
+/**
+ * \brief Adds a watch point to a task
+ *
+ * SD_simulate() will stop as soon as the \ref e_SD_task_state_t "state" of this task becomes the one given in argument. The
+ * watch point is then automatically removed.
+ * 
+ * \param task a task
+ * \param state the \ref e_SD_task_state_t "state" you want to watch (cannot be #SD_NOT_SCHEDULED)
+ * \see SD_task_unwatch()
  */
 void SD_task_watch(SD_task_t task, e_SD_task_state_t state) {
   SD_CHECK_INIT_DONE();
  */
 void SD_task_watch(SD_task_t task, e_SD_task_state_t state) {
   SD_CHECK_INIT_DONE();
@@ -306,11 +372,15 @@ void SD_task_watch(SD_task_t task, e_SD_task_state_t state) {
   xbt_assert0(state != SD_NOT_SCHEDULED, "Cannot add a watch point for state SD_NOT_SCHEDULED");
 
   task->watch_points = task->watch_points | state;
   xbt_assert0(state != SD_NOT_SCHEDULED, "Cannot add a watch point for state SD_NOT_SCHEDULED");
 
   task->watch_points = task->watch_points | state;
-  __SD_print_watch_points(task);
+  /*  __SD_print_watch_points(task);*/
 }
 
 }
 
-/* Removes a watch point from a task.
-   The given state must be SD_SCHEDULED, SD_READY, SD_RUNNING, SD_DONE or SD_FAILED.
+/**
+ * \brief Removes a watch point from a task
+ * 
+ * \param task a task
+ * \param state the \ref e_SD_task_state_t "state" you no longer want to watch
+ * \see SD_task_watch()
  */
 void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state) {
   SD_CHECK_INIT_DONE();
  */
 void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state) {
   SD_CHECK_INIT_DONE();
@@ -318,7 +388,7 @@ void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state) {
   xbt_assert0(state != SD_NOT_SCHEDULED, "Cannot have a watch point for state SD_NOT_SCHEDULED");
   
   task->watch_points = task->watch_points & ~state;
   xbt_assert0(state != SD_NOT_SCHEDULED, "Cannot have a watch point for state SD_NOT_SCHEDULED");
   
   task->watch_points = task->watch_points & ~state;
-  __SD_print_watch_points(task);
+  /*  __SD_print_watch_points(task);*/
 }
 
 /* Destroys the data memorised by SD_task_schedule. Task state must be SD_SCHEDULED or SD_READY.
 }
 
 /* Destroys the data memorised by SD_task_schedule. Task state must be SD_SCHEDULED or SD_READY.
@@ -332,13 +402,20 @@ static void __SD_task_destroy_scheduling_data(SD_task_t task) {
   xbt_free(task->communication_amount);
 }
 
   xbt_free(task->communication_amount);
 }
 
-/* Schedules a task.
- * task: the task to schedule
- * workstation_nb: number of workstations where the task will be executed
- * workstation_list: workstations where the task will be executed
- * computation_amount: computation amount for each workstation
- * communication_amount: communication amount between each pair of workstations
- * rate: task execution speed rate
+/**
+ * \brief Schedules a task
+ *
+ * The task state must be #SD_NOT_SCHEDULED.
+ * Once scheduled, a task will be executed as soon as possible in SD_simulate(),
+ * i.e. when its dependencies are satisfied.
+ * 
+ * \param task the task you want to schedule
+ * \param workstation_nb number of workstations on which the task will be executed
+ * \param workstation_list the workstations on which the task will be executed
+ * \param computation_amount computation amount for each workstation
+ * \param communication_amount communication amount between each pair of workstations
+ * \param rate task execution speed rate
+ * \see SD_task_unschedule()
  */
 void SD_task_schedule(SD_task_t task, int workstation_nb,
                     const SD_workstation_t *workstation_list, double *computation_amount,
  */
 void SD_task_schedule(SD_task_t task, int workstation_nb,
                     const SD_workstation_t *workstation_list, double *computation_amount,
@@ -372,9 +449,15 @@ void SD_task_schedule(SD_task_t task, int workstation_nb,
     __SD_task_set_state(task, SD_SCHEDULED);
 }
 
     __SD_task_set_state(task, SD_SCHEDULED);
 }
 
-/* Unschedules a task. The state must be SD_SCHEDULED, SD_READY, SD_RUNNING or SD_FAILED.
- * The task is reinitialised and its state becomes SD_NOT_SCHEDULED.
- * Call SD_task_schedule to schedule it again.
+/**
+ * \brief Unschedules a task
+ *
+ * The task state must be #SD_SCHEDULED, #SD_READY, #SD_RUNNING or #SD_FAILED.
+ * If you call this function, the task state becomes #SD_NOT_SCHEDULED.
+ * Call SD_task_schedule() to schedule it again.
+ *
+ * \param task the task you want to unschedule
+ * \see SD_task_schedule()
  */
 void SD_task_unschedule(SD_task_t task) {
   SD_CHECK_INIT_DONE();
  */
 void SD_task_unschedule(SD_task_t task) {
   SD_CHECK_INIT_DONE();
@@ -435,7 +518,13 @@ void __SD_task_remove_dependencies(SD_task_t task) {
   }
 }
 
   }
 }
 
-/* Destroys a task. The user data (if any) should have been destroyed first.
+/**
+ * \brief Destroys a task.
+ *
+ * The user data (if any) should have been destroyed first.
+ *
+ * \param task the task you want to destroy
+ * \see SD_task_create()
  */
 void SD_task_destroy(SD_task_t task) {
   SD_CHECK_INIT_DONE();
  */
 void SD_task_destroy(SD_task_t task) {
   SD_CHECK_INIT_DONE();
index 05bf3d3..05dab14 100644 (file)
@@ -21,13 +21,13 @@ SD_workstation_t __SD_workstation_create(void *surf_workstation, void *data) {
   return workstation;
 }
 
   return workstation;
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns a workstation given its name
+/**
+ * \brief Returns a workstation given its name
  *
  *
- * If there is no such workstation, the function returns NULL.
+ * If there is no such workstation, the function returns \c NULL.
  *
  *
- * @param name workstation name
- * @return the workstation, or NULL if there is no such workstation
+ * \param name workstation name
+ * \return the workstation, or \c NULL if there is no such workstation
  */
 SD_workstation_t SD_workstation_get_by_name(const char *name) {
   SD_CHECK_INIT_DONE();
  */
 SD_workstation_t SD_workstation_get_by_name(const char *name) {
   SD_CHECK_INIT_DONE();
@@ -37,13 +37,13 @@ SD_workstation_t SD_workstation_get_by_name(const char *name) {
   return xbt_dict_get_or_null(sd_global->workstations, name);
 }
 
   return xbt_dict_get_or_null(sd_global->workstations, name);
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns the workstations list
+/**
+ * \brief Returns the workstations list
  *
  *
- * Use SD_workstation_get_number to known the array size.
+ * Use SD_workstation_get_number() to know the array size.
  *
  *
- * @return an array of SD_workstation_t containing all workstations
- * @see SD_workstation_get_number
+ * \return an array of \ref SD_workstation_t containing all workstations
+ * \see SD_workstation_get_number()
  */
 SD_workstation_t*  SD_workstation_get_list(void) {
   SD_CHECK_INIT_DONE();
  */
 SD_workstation_t*  SD_workstation_get_list(void) {
   SD_CHECK_INIT_DONE();
@@ -63,51 +63,51 @@ SD_workstation_t*  SD_workstation_get_list(void) {
   return array;
 }
 
   return array;
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns the number of workstations
+/**
+ * \brief Returns the number of workstations
  *
  *
- * @return the number of existing workstations
- * @see SD_workstation_get_list
+ * \return the number of existing workstations
+ * \see SD_workstation_get_list()
  */
 int SD_workstation_get_number(void) {
   SD_CHECK_INIT_DONE();
   return sd_global->workstation_count;
 }
 
  */
 int SD_workstation_get_number(void) {
   SD_CHECK_INIT_DONE();
   return sd_global->workstation_count;
 }
 
-/** @ingroup SD_workstation_management
- * @brief Sets the user data of a workstation
+/**
+ * \brief Returns the user data of a workstation
  *
  *
- * The new data can be NULL. The old data should have been freed first
- * if it was not NULL.
- *
- * @param workstation a workstation
- * @param data the new data you want to associate with this workstation
- * @see SD_workstation_get_data
+ * \param workstation a workstation
+ * \return the user data associated with this workstation (can be \c NULL)
+ * \see SD_workstation_set_data()
  */
  */
-void SD_workstation_set_data(SD_workstation_t workstation, void *data) {
+void* SD_workstation_get_data(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
-  workstation->data = data;
+  return workstation->data;
 }
 
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns the user data of a workstation
+/**
+ * \brief Sets the user data of a workstation
  *
  *
- * @param workstation a workstation
- * @return the user data associated with this workstation (can be NULL)
- * @see SD_workstation_set_data
+ * The new data can be \c NULL. The old data should have been freed first
+ * if it was not \c NULL.
+ *
+ * \param workstation a workstation
+ * \param data the new data you want to associate with this workstation
+ * \see SD_workstation_get_data()
  */
  */
-void* SD_workstation_get_data(SD_workstation_t workstation) {
+void SD_workstation_set_data(SD_workstation_t workstation, void *data) {
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
-  return workstation->data;
+  workstation->data = data;
 }
 
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns the name of a workstation
+/**
+ * \brief Returns the name of a workstation
  *
  *
- * @param workstation a workstation
- * @return the name of this workstation (cannot be NULL)
+ * \param workstation a workstation
+ * \return the name of this workstation (cannot be \c NULL)
  */
 const char* SD_workstation_get_name(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
  */
 const char* SD_workstation_get_name(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
@@ -115,15 +115,15 @@ const char* SD_workstation_get_name(SD_workstation_t workstation) {
   return surf_workstation_resource->common_public->get_resource_name(workstation->surf_workstation);
 }
 
   return surf_workstation_resource->common_public->get_resource_name(workstation->surf_workstation);
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns the route between two workstations
+/**
+ * \brief Returns the route between two workstations
  *
  *
- * Use SD_workstation_route_get_size to known the array size.
+ * Use SD_workstation_route_get_size() to know the array size.
  *
  *
- * @param src a workstation
- * @param dst another workstation
- * @return a new array of SD_link_t representating the route between these two workstations
- * @see SD_workstation_route_get_size
+ * \param src a workstation
+ * \param dst another workstation
+ * \return a new array of \ref SD_link_t representating the route between these two workstations
+ * \see SD_workstation_route_get_size(), SD_link_t
  */
 SD_link_t* SD_workstation_route_get_list(SD_workstation_t src, SD_workstation_t dst) {
   SD_CHECK_INIT_DONE();
  */
 SD_link_t* SD_workstation_route_get_list(SD_workstation_t src, SD_workstation_t dst) {
   SD_CHECK_INIT_DONE();
@@ -145,13 +145,13 @@ SD_link_t* SD_workstation_route_get_list(SD_workstation_t src, SD_workstation_t
   return route;
 }
 
   return route;
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns the number of links on the route between two workstations
+/**
+ * \brief Returns the number of links on the route between two workstations
  *
  *
- * @param src a workstation
- * @param dst another workstation
- * @return the number of links on the route between these two workstations
- * @see SD_workstation_route_get_list
+ * \param src a workstation
+ * \param dst another workstation
+ * \return the number of links on the route between these two workstations
+ * \see SD_workstation_route_get_list()
  */
 int SD_workstation_route_get_size(SD_workstation_t src, SD_workstation_t dst) {
   SD_CHECK_INIT_DONE();
  */
 int SD_workstation_route_get_size(SD_workstation_t src, SD_workstation_t dst) {
   SD_CHECK_INIT_DONE();
@@ -159,12 +159,12 @@ int SD_workstation_route_get_size(SD_workstation_t src, SD_workstation_t dst) {
     get_route_size(src->surf_workstation, dst->surf_workstation);
 }
 
     get_route_size(src->surf_workstation, dst->surf_workstation);
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns the total power of a workstation
+/**
+ * \brief Returns the total power of a workstation
  *
  *
- * @param workstation a workstation
- * @return the total power of this workstation
- * @see SD_workstation_get_available_power
+ * \param workstation a workstation
+ * \return the total power of this workstation
+ * \see SD_workstation_get_available_power()
  */
 double SD_workstation_get_power(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
  */
 double SD_workstation_get_power(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
@@ -172,12 +172,12 @@ double SD_workstation_get_power(SD_workstation_t workstation) {
   return surf_workstation_resource->extension_public->get_speed(workstation->surf_workstation, 1.0);
 }
 
   return surf_workstation_resource->extension_public->get_speed(workstation->surf_workstation, 1.0);
 }
 
-/** @ingroup SD_workstation_management
- * @brief Returns the proportion of available power in a workstation
+/**
+ * \brief Returns the proportion of available power in a workstation
  *
  *
- * @param workstation a workstation
- * @return the proportion of power currently available in this workstation (normally a number between 0 and 1)
- * @see SD_workstation_get_power
+ * \param workstation a workstation
+ * \return the proportion of power currently available in this workstation (normally a number between 0 and 1)
+ * \see SD_workstation_get_power()
  */
 double SD_workstation_get_available_power(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
  */
 double SD_workstation_get_available_power(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();