1 /* Copyright (c) 2007-2014. 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 "smx_private.h"
8 #include "xbt/sysdep.h"
10 #include "xbt/xbt_os_time.h"
11 #include "xbt/config.h"
12 #include "surf/surfxml_parse.h"
14 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix,
15 "Logging specific to SIMIX (environment)");
17 /********************************* SIMIX **************************************/
20 * \brief A platform constructor.
22 * Creates a new platform, including hosts, links and the
24 * \param file a filename of a xml description of a platform. This file
27 * \include surfxml.dtd
29 * Here is a small example of such a platform
31 * \include small_platform.xml
34 void SIMIX_create_environment(const char *file)
38 start = xbt_os_time();
39 parse_platform_file(file);
41 XBT_DEBUG("PARSE TIME: %g", (end - start));
45 void SIMIX_post_create_environment(void) {
47 void **workstation = NULL;
48 void **storage = NULL;
49 xbt_lib_cursor_t cursor = NULL;
52 /* Create host at SIMIX level */
53 xbt_lib_foreach(host_lib, cursor, name, workstation) {
54 if(workstation[SURF_WKS_LEVEL])
55 SIMIX_host_create(name, workstation[SURF_WKS_LEVEL], NULL);
58 /* Create storage at SIMIX level */
59 xbt_lib_foreach(storage_lib, cursor, name, storage) {
60 if(storage[SURF_STORAGE_LEVEL])
61 SIMIX_storage_create(name, storage[SURF_STORAGE_LEVEL], NULL);