3 /* Copyright (c) 2002-2007 Arnaud Legrand. */
4 /* Copyright (c) 2007 Bruno Donassolo. */
5 /* All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include "msg/private.h"
11 #include "xbt/sysdep.h"
15 /** \defgroup msg_easier_life Platform and Application management
16 * \brief This section describes functions to manage the platform creation
17 * and the application deployment. You should also have a look at
18 * \ref MSG_examples to have an overview of their usage.
20 /** @addtogroup msg_easier_life
21 * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Platforms and Applications" --> \endhtmlonly
25 /********************************* MSG **************************************/
27 /** \ingroup msg_easier_life
28 * \brief A name directory service...
30 * Finds a m_host_t using its name.
31 * \param name the name of an host.
32 * \return the corresponding host
34 m_host_t MSG_get_host_by_name(const char *name)
36 smx_host_t simix_h = NULL;
37 simix_h = SIMIX_host_get_by_name(name);
42 return (m_host_t)SIMIX_host_get_data(simix_h);
45 /** \ingroup msg_easier_life
46 * \brief A platform constructor.
48 * Creates a new platform, including hosts, links and the
50 * \param file a filename of a xml description of a platform. This file
53 * \include simgrid.dtd
55 * Here is a small example of such a platform
57 * \include small_platform.xml
59 * Have a look in the directory examples/msg/ to have a big example.
61 void MSG_create_environment(const char *file)
67 SIMIX_create_environment(file);
70 /* Initialize MSG hosts */
71 xbt_dict_foreach(SIMIX_host_get_dict(), c, name, h) {
72 __MSG_host_create(h, NULL);