Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge doc of platform mgmt functions into simulation control ones
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 4 Apr 2012 03:12:24 +0000 (17:12 -1000)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 4 Apr 2012 03:12:24 +0000 (17:12 -1000)
This allows to have a single page about the basics of running a
simulation, with a nice workflow on it.

It's still no "SimGrid 101", but that's the direction to go.

doc/module-msg.doc
doc/platform.doc
src/msg/msg_deployment.c
src/msg/msg_environment.c
src/msg/msg_global.c
src/msg/msg_host.c

index 4f7e211..8085ffe 100644 (file)
@@ -21,7 +21,6 @@
    - \ref msg_actions_functions
    - \ref msg_gos_functions
    - \ref msg_deprecated_functions
-   - \ref msg_easier_life
    - \ref msg_simulation
 
   Also make sure to visit the page @ref MSG_examples.
@@ -39,13 +38,25 @@ example from which you can learn what you want to.
 
 */
 
-/** @defgroup msg_simulation   Main MSG simulation Functions
-*      @ingroup MSG_API
-*      @brief This section describes the functions you need to know to
-*       set up a simulation. You should have a look at \ref MSG_examples
-*       to have an overview of their usage.
-*
-*      @htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Simulation control" --> @endhtmlonly
+/** 
+@defgroup msg_simulation   Main MSG simulation Functions
+@ingroup MSG_API
+@brief Describes how to setup and control your simulation.
+
+The basic workflow is the following (check the \ref MSG_examples for
+details).
+
+ -# Initialize the library with #MSG_global_init
+ -# Create a platform (usually by parsing a file with
+    #MSG_create_environment)
+ -# Register the functions that your processes are supposed to run with
+    #MSG_function_register (and maybe #MSG_function_register_default)
+ -# Launch your processes from a deployment file with #MSG_launch_application
+ -# Run the simulation with #MSG_main
+ -# Cleanup the library with #MSG_clean before ending your program
+    (optional).
+
+@htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Simulation control" --> @endhtmlonly
 */
 
 
@@ -91,12 +102,6 @@ example from which you can learn what you want to.
  *         by a process for handling some task.
  */
  
-/** @defgroup msg_easier_life      Platform and Application management
- *  @ingroup MSG_API
- *  @brief This section describes functions to manage the platform creation
- *         and the application deployment. Please check @ref
- *         MSG_examples for an overview of their usage. 
- */
  
 /**
 @defgroup MSG_LUA      Lua bindings
index 9e09a04..3f83990 100644 (file)
@@ -8,7 +8,7 @@ application, and finally it needs something to know where to deploy what.
 
 For the latest 2 entries, you have basically 2 ways to give it as an input :
 \li You can program it, either using the Lua console (\ref MSG_Lua_funct) or if you're using MSG some 
-of its platform and deployments functions(\ref msg_easier_life). If you want to use it, please refer 
+of its platform and deployments functions(\ref msg_simulation). If you want to use it, please refer 
 to its doc. (you can also  check the section  \ref pf_flexml_bypassing but this is strongly deprecated, as there is a new way to do it properly, but not yet documented).
 \li You can use two XML files: a platform description file and a deployment 
 description one.
index ac9c576..ec21889 100644 (file)
@@ -8,7 +8,7 @@
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 
-/** \ingroup msg_easier_life
+/** \ingroup msg_simulation
  * \brief An application deployer.
  *
  * Creates the process described in \a file.
@@ -34,7 +34,7 @@ void MSG_launch_application(const char *file)
   return;
 }
 
-/** \ingroup msg_easier_life
+/** \ingroup msg_simulation
  * \brief Registers the main function of a process in a global table.
  *
  * Registers a code function in a global table. 
@@ -48,7 +48,7 @@ void MSG_function_register(const char *name, xbt_main_func_t code)
   return;
 }
 
-/** \ingroup msg_easier_life
+/** \ingroup msg_simulation
  * \brief Registers a function as the default main function of processes.
  *
  * Registers a code function as being the default value. This function will get used by MSG_launch_application() when there is no registered function of the requested name in.
@@ -59,7 +59,7 @@ void MSG_function_register_default(xbt_main_func_t code)
   SIMIX_function_register_default(code);
 }
 
-/** \ingroup msg_easier_life
+/** \ingroup msg_simulation
  * \brief Retrieves a registered main function
  *
  * Registers a code function in a global table. 
index d4786a7..c263080 100644 (file)
 #include <lualib.h>
 #endif
 
-/** @addtogroup msg_easier_life
- *    \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Platforms and Applications" --> \endhtmlonly
- * 
- */
-
 /********************************* MSG **************************************/
 
-/** \ingroup msg_easier_life
- * \brief A name directory service...
- *
- * Finds a m_host_t using its name.
- * \param name the name of an host.
- * \return the corresponding host
- */
-m_host_t MSG_get_host_by_name(const char *name)
-{
-  smx_host_t simix_h = NULL;
-  simix_h = simcall_host_get_by_name(name);
-
-  if (simix_h == NULL)
-    return NULL;
-
-  return (m_host_t) simcall_host_get_data(simix_h);
-}
-
-/** \ingroup msg_easier_life
+/** \ingroup msg_simulation
  * \brief A platform constructor.
  *
  * Creates a new platform, including hosts, links and the
index 127a8db..cb06f1d 100644 (file)
@@ -200,7 +200,7 @@ MSG_error_t MSG_clean(void)
 }
 
 
-/** \ingroup msg_easier_life
+/** \ingroup msg_simulation
  * \brief A clock (in second).
  */
 XBT_INLINE double MSG_get_clock(void)
index 6b518af..ce32fdf 100644 (file)
@@ -59,6 +59,25 @@ m_host_t __MSG_host_create(smx_host_t workstation, void *data)
   return host;
 }
 
+/** \ingroup msg_host_management
+ * \brief Finds a m_host_t using its name.
+ *
+ * This is a name directory service
+ * \param name the name of an host.
+ * \return the corresponding host
+ */
+m_host_t MSG_get_host_by_name(const char *name)
+{
+  smx_host_t simix_h = NULL;
+  simix_h = simcall_host_get_by_name(name);
+
+  if (simix_h == NULL)
+    return NULL;
+
+  return (m_host_t) simcall_host_get_data(simix_h);
+}
+
+
 /** \ingroup m_host_management
  *
  * \brief Set the user data of a #m_host_t.