1 /* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "msg/private.h"
8 #include "xbt/sysdep.h"
12 /** \defgroup msg_easier_life Platform and Application management
13 * \brief This section describes functions to manage the platform creation
14 * and the application deployment. You should also have a look at
15 * \ref MSG_examples to have an overview of their usage.
17 /** @addtogroup msg_easier_life
18 * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Platforms and Applications" --> \endhtmlonly
22 /********************************* MSG **************************************/
24 /** \ingroup msg_easier_life
25 * \brief A name directory service...
27 * Finds a m_host_t using its name.
28 * \param name the name of an host.
29 * \return the corresponding host
31 m_host_t MSG_get_host_by_name(const char *name)
33 smx_host_t simix_h = NULL;
34 simix_h = SIMIX_host_get_by_name(name);
39 return (m_host_t)SIMIX_host_get_data(simix_h);
42 /** \ingroup msg_easier_life
43 * \brief A platform constructor.
45 * Creates a new platform, including hosts, links and the
47 * \param file a filename of a xml description of a platform. This file
50 * \include simgrid.dtd
52 * Here is a small example of such a platform
54 * \include small_platform.xml
56 * Have a look in the directory examples/msg/ to have a big example.
58 void MSG_create_environment(const char *file)
64 SIMIX_create_environment(file);
67 /* Initialize MSG hosts */
68 xbt_dict_foreach(SIMIX_host_get_dict(), c, name, h) {
69 __MSG_host_create(h, NULL);