1 /* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "smx_private.hpp"
7 #include "src/include/surf/surf.hpp"
8 #include "xbt/xbt_os_time.h"
10 #include <simgrid/engine.h>
13 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix, "Logging specific to SIMIX (environment)");
15 /********************************* SIMIX **************************************/
18 * @brief A platform constructor.
20 * Creates a new platform, including hosts, links and the
22 * @param file a filename of a xml description of a platform. This file
25 * @include surfxml.dtd
27 * Here is a small example of such a platform
29 * @include small_platform.xml
32 void SIMIX_create_environment(std::string file)
36 if(XBT_LOG_ISENABLED(simix_environment, xbt_log_priority_debug))
37 start = xbt_os_time();
39 parse_platform_file(file);
42 xbt_die("Error while loading %s: %s", file.c_str(), e.what());
44 if(XBT_LOG_ISENABLED(simix_environment, xbt_log_priority_debug))
46 XBT_DEBUG("PARSE TIME: %g", (end - start));
49 void SIMIX_create_environment(const char* file) // deprecated
51 simgrid_load_platform(file);
54 void SIMIX_post_create_environment()