A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #280 from mpoquet/replay-steroid-example
[simgrid.git]
/
src
/
surf
/
xml
/
surfxml_parseplatf.cpp
diff --git
a/src/surf/xml/surfxml_parseplatf.cpp
b/src/surf/xml/surfxml_parseplatf.cpp
index
d287f06
..
4794750
100644
(file)
--- a/
src/surf/xml/surfxml_parseplatf.cpp
+++ b/
src/surf/xml/surfxml_parseplatf.cpp
@@
-3,14
+3,14
@@
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "s
rc/instr/instr_private.hpp" // TRACE_start(). FIXME: remove by subscribing tracing to the surf signals
+#include "s
urf/surf.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
-#include "xbt/log.h"
-#include "xbt/misc.h"
+#include "src/surf/surf_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
+
#include <vector>
#include <vector>
-#include "src/surf/xml/platf_private.hpp"
#if SIMGRID_HAVE_LUA
#include "src/bindings/lua/simgrid_lua.hpp"
#if SIMGRID_HAVE_LUA
#include "src/bindings/lua/simgrid_lua.hpp"
@@
-59,24
+59,13
@@
void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs*
}
}
}
}
-static int after_config_done;
-void parse_after_config() {
- if (not after_config_done) {
- TRACE_start();
-
- /* Register classical callbacks */
- storage_register_callbacks();
-
- after_config_done = 1;
- }
-}
-
/* This function acts as a main in the parsing area. */
/* This function acts as a main in the parsing area. */
-void parse_platform_file(
const char *
file)
+void parse_platform_file(
std::string
file)
{
#if SIMGRID_HAVE_LUA
{
#if SIMGRID_HAVE_LUA
- int len = (file == nullptr ? 0 : strlen(file));
- int is_lua = (file != nullptr && len > 3 && file[len - 3] == 'l' && file[len - 2] == 'u' && file[len - 1] == 'a');
+ const char* cfile = file.c_str();
+ int len = strlen(cfile);
+ int is_lua = len > 3 && file[len - 3] == 'l' && file[len - 2] == 'u' && file[len - 1] == 'a';
#endif
sg_platf_init();
#endif
sg_platf_init();
@@
-90,7
+79,7
@@
void parse_platform_file(const char *file)
lua_State* L = luaL_newstate();
luaL_openlibs(L);
lua_State* L = luaL_newstate();
luaL_openlibs(L);
- luaL_loadfile(L, file); // This loads the file without executing it.
+ luaL_loadfile(L,
c
file); // This loads the file without executing it.
/* Run the script */
if (lua_pcall(L, 0, 0, 0)) {
/* Run the script */
if (lua_pcall(L, 0, 0, 0)) {
@@
-107,7
+96,6
@@
void parse_platform_file(const char *file)
int parse_status;
/* init the flex parser */
int parse_status;
/* init the flex parser */
- after_config_done = 0;
surf_parse_open(file);
/* Do the actual parsing */
surf_parse_open(file);
/* Do the actual parsing */
@@
-122,7
+110,7
@@
void parse_platform_file(const char *file)
xbt_assert(host, "Host %s undefined", elm.second.c_str());
simgrid::surf::Cpu* cpu = host->pimpl_cpu;
xbt_assert(host, "Host %s undefined", elm.second.c_str());
simgrid::surf::Cpu* cpu = host->pimpl_cpu;
- cpu->set
StateT
race(trace);
+ cpu->set
_state_t
race(trace);
}
for (auto const& elm : trace_connect_list_host_speed) {
}
for (auto const& elm : trace_connect_list_host_speed) {
@@
-133,32
+121,32
@@
void parse_platform_file(const char *file)
xbt_assert(host, "Host %s undefined", elm.second.c_str());
simgrid::surf::Cpu* cpu = host->pimpl_cpu;
xbt_assert(host, "Host %s undefined", elm.second.c_str());
simgrid::surf::Cpu* cpu = host->pimpl_cpu;
- cpu->set
SpeedT
race(trace);
+ cpu->set
_speed_t
race(trace);
}
for (auto const& elm : trace_connect_list_link_avail) {
xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
tmgr_trace_t trace = traces_set_list.at(elm.first);
}
for (auto const& elm : trace_connect_list_link_avail) {
xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
tmgr_trace_t trace = traces_set_list.at(elm.first);
- sg_link_t link = simgrid::s4u::Link::by
N
ame(elm.second.c_str());
+ sg_link_t link = simgrid::s4u::Link::by
_n
ame(elm.second.c_str());
xbt_assert(link, "Link %s undefined", elm.second.c_str());
xbt_assert(link, "Link %s undefined", elm.second.c_str());
- link->set
StateT
race(trace);
+ link->set
_state_t
race(trace);
}
for (auto const& elm : trace_connect_list_link_bw) {
xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
tmgr_trace_t trace = traces_set_list.at(elm.first);
}
for (auto const& elm : trace_connect_list_link_bw) {
xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
tmgr_trace_t trace = traces_set_list.at(elm.first);
- sg_link_t link = simgrid::s4u::Link::by
N
ame(elm.second.c_str());
+ sg_link_t link = simgrid::s4u::Link::by
_n
ame(elm.second.c_str());
xbt_assert(link, "Link %s undefined", elm.second.c_str());
xbt_assert(link, "Link %s undefined", elm.second.c_str());
- link->set
BandwidthT
race(trace);
+ link->set
_bandwidth_t
race(trace);
}
for (auto const& elm : trace_connect_list_link_lat) {
xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
tmgr_trace_t trace = traces_set_list.at(elm.first);
}
for (auto const& elm : trace_connect_list_link_lat) {
xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
tmgr_trace_t trace = traces_set_list.at(elm.first);
- sg_link_t link = simgrid::s4u::Link::by
N
ame(elm.second.c_str());
+ sg_link_t link = simgrid::s4u::Link::by
_n
ame(elm.second.c_str());
xbt_assert(link, "Link %s undefined", elm.second.c_str());
xbt_assert(link, "Link %s undefined", elm.second.c_str());
- link->set
LatencyT
race(trace);
+ link->set
_latency_t
race(trace);
}
surf_parse_close();
}
surf_parse_close();