From: Martin Quinson Date: Wed, 4 Apr 2012 03:12:24 +0000 (-1000) Subject: Merge doc of platform mgmt functions into simulation control ones X-Git-Tag: v3_7~120 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/164535529e5d19976ed96a2ee265d5945d27a660 Merge doc of platform mgmt functions into simulation control ones 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. --- diff --git a/doc/module-msg.doc b/doc/module-msg.doc index 4f7e211113..8085ffecf7 100644 --- a/doc/module-msg.doc +++ b/doc/module-msg.doc @@ -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 @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 @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 diff --git a/doc/platform.doc b/doc/platform.doc index 9e09a04636..3f83990f1c 100644 --- a/doc/platform.doc +++ b/doc/platform.doc @@ -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. diff --git a/src/msg/msg_deployment.c b/src/msg/msg_deployment.c index ac9c5768e4..ec21889334 100644 --- a/src/msg/msg_deployment.c +++ b/src/msg/msg_deployment.c @@ -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. diff --git a/src/msg/msg_environment.c b/src/msg/msg_environment.c index d4786a7585..c263080a62 100644 --- a/src/msg/msg_environment.c +++ b/src/msg/msg_environment.c @@ -14,32 +14,9 @@ #include #endif -/** @addtogroup msg_easier_life - * \htmlonly \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 diff --git a/src/msg/msg_global.c b/src/msg/msg_global.c index 127a8dbd82..cb06f1d970 100644 --- a/src/msg/msg_global.c +++ b/src/msg/msg_global.c @@ -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) diff --git a/src/msg/msg_host.c b/src/msg/msg_host.c index 6b518afd76..ce32fdf887 100644 --- a/src/msg/msg_host.c +++ b/src/msg/msg_host.c @@ -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.