Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fixed the pthread context implementation, now it compiles and runs
[simgrid.git] / src / simix / smx_environment.c
1 /*      $Id$     */
2
3 /* Copyright (c) 2007 Arnaud Legrand, Bruno Donnassolo.
4    All rights reserved.                                          */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #include "private.h"
10 #include "xbt/sysdep.h"
11 #include "xbt/log.h"
12 #include "xbt/xbt_os_time.h"
13 #include "xbt/config.h"
14
15 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix,
16                                 "Logging specific to SIMIX (environment)");
17
18 /********************************* SIMIX **************************************/
19
20 /**
21  * \brief A platform constructor.
22  *
23  * Creates a new platform, including hosts, links and the
24  * routing_table.
25  * \param file a filename of a xml description of a platform. This file
26  * follows this DTD :
27  *
28  *     \include surfxml.dtd
29  *
30  * Here is a small example of such a platform
31  *
32  *     \include small_platform.xml
33  *
34  */
35 void SIMIX_create_environment(const char *file)
36 {
37   xbt_dict_cursor_t cursor = NULL;
38   char *name = NULL;
39   void *workstation = NULL;
40
41   double start, end;
42
43   surf_config_models_setup(file);
44   parse_platform_file(file);
45   surf_config_models_create_elms();
46   start = xbt_os_time();
47
48   end = xbt_os_time();
49   DEBUG1("PARSE TIME: %lg", (end - start));
50
51   xbt_dict_foreach(surf_model_resource_set(surf_workstation_model), cursor,
52                    name, workstation) {
53     __SIMIX_host_create(name, workstation, NULL);
54   }
55 }