The goal is to remove this layer of callbacks.
Moreover the order of execution of those callbacks is important.
Currently, it breaks the ability to have platform and deployment data
in the same XML however.
13 files changed:
surf_cpu_model_pm = new CpuPlopModel();
surf_cpu_model_pm = new CpuPlopModel();
- sg_platf_host_add_cb(cpu_parse_init);
sg_platf_postparse_add_cb(cpu_add_traces);
xbt_dynar_push(model_list, &surf_cpu_model_pm);
sg_platf_postparse_add_cb(cpu_add_traces);
xbt_dynar_push(model_list, &surf_cpu_model_pm);
void routing_AS_begin(sg_platf_AS_cbarg_t AS);
void routing_AS_end(sg_platf_AS_cbarg_t AS);
void routing_AS_begin(sg_platf_AS_cbarg_t AS);
void routing_AS_end(sg_platf_AS_cbarg_t AS);
+void routing_parse_init(sg_platf_host_cbarg_t host);
void routing_cluster_add_backbone(void* bb);
SG_END_DECL()
void routing_cluster_add_backbone(void* bb);
SG_END_DECL()
static void java_cpu_model_init_preparse() {
surf_cpu_model_pm = java_cpu_model;
xbt_dynar_push(all_existing_models, &java_cpu_model);
static void java_cpu_model_init_preparse() {
surf_cpu_model_pm = java_cpu_model;
xbt_dynar_push(all_existing_models, &java_cpu_model);
- sg_platf_host_add_cb(cpu_parse_init);
}
void setCpuModel(CpuModel *cpuModel){
}
void setCpuModel(CpuModel *cpuModel){
surf_cpu_model_pm = new CpuCas01Model();
surf_cpu_model_vm = new CpuCas01Model();
surf_cpu_model_pm = new CpuCas01Model();
surf_cpu_model_vm = new CpuCas01Model();
- sg_platf_host_add_cb(cpu_parse_init);
sg_platf_postparse_add_cb(cpu_add_traces);
Model *model_pm = surf_cpu_model_pm;
sg_platf_postparse_add_cb(cpu_add_traces);
Model *model_pm = surf_cpu_model_pm;
static void cpu_ti_define_callbacks()
{
static void cpu_ti_define_callbacks()
{
- sg_platf_host_add_cb(cpu_parse_init);
sg_platf_postparse_add_cb(cpu_add_traces);
}
sg_platf_postparse_add_cb(cpu_add_traces);
}
Model *model = surf_host_model;
xbt_dynar_push(all_existing_models, &model);
Model *model = surf_host_model;
xbt_dynar_push(all_existing_models, &model);
- sg_platf_host_add_cb(host_parse_init);
}
void surf_host_model_init_compound()
}
void surf_host_model_init_compound()
Model *model = surf_host_model;
xbt_dynar_push(all_existing_models, &model);
Model *model = surf_host_model;
xbt_dynar_push(all_existing_models, &model);
- sg_platf_host_add_cb(host_parse_init);
}
Host *HostCLM03Model::createHost(const char *name){
}
Host *HostCLM03Model::createHost(const char *name){
xbt_assert(!surf_network_model, "network model type already defined");
// Define the callbacks to parse the XML
xbt_assert(!surf_network_model, "network model type already defined");
// Define the callbacks to parse the XML
- sg_platf_host_add_cb(cpu_parse_init);
- sg_platf_host_add_cb(host_parse_init);
sg_platf_link_add_cb(ptask_netlink_parse_init);
sg_platf_postparse_add_cb(host_add_traces);
sg_platf_link_add_cb(ptask_netlink_parse_init);
sg_platf_postparse_add_cb(host_add_traces);
#include "xbt/dict.h"
#include "xbt/RngStream.h"
#include "simgrid/platf_interface.h"
#include "xbt/dict.h"
#include "xbt/RngStream.h"
#include "simgrid/platf_interface.h"
+#include "surf/surf_routing.h"
-extern "C" {
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
-}
+#include "cpu_interface.hpp"
+#include "host_interface.hpp"
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
xbt_dynar_t sg_platf_host_cb_list = NULL; // of sg_platf_host_cb_t
xbt_dynar_t sg_platf_host_link_cb_list = NULL; // of sg_platf_host_link_cb_t
xbt_dynar_t sg_platf_link_cb_list = NULL; // of sg_platf_link_cb_t
xbt_dynar_t sg_platf_host_cb_list = NULL; // of sg_platf_host_cb_t
xbt_dynar_t sg_platf_host_link_cb_list = NULL; // of sg_platf_host_link_cb_t
xbt_dynar_t sg_platf_link_cb_list = NULL; // of sg_platf_link_cb_t
}
void sg_platf_new_host(sg_platf_host_cbarg_t h){
}
void sg_platf_new_host(sg_platf_host_cbarg_t h){
+ routing_parse_init(h);
+ cpu_parse_init(h);
+ host_parse_init(h);
+
unsigned int iterator;
sg_platf_host_cb_t fun;
xbt_dynar_foreach(sg_platf_host_cb_list, iterator, fun) {
unsigned int iterator;
sg_platf_host_cb_t fun;
xbt_dynar_foreach(sg_platf_host_cb_list, iterator, fun) {
/**
* \brief Add a "host_link" to the network element list
*/
/**
* \brief Add a "host_link" to the network element list
*/
-static void parse_S_host_link(sg_platf_host_link_cbarg_t host)
+static void parse_S_host(sg_platf_host_link_cbarg_t host)
{
RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
xbt_assert(info, "Host '%s' not found!", host->id);
{
RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
xbt_assert(info, "Host '%s' not found!", host->id);
/**
* \brief Add a "host" to the network element list
*/
/**
* \brief Add a "host" to the network element list
*/
-static void parse_S_host(sg_platf_host_cbarg_t host)
+void routing_parse_init(sg_platf_host_cbarg_t host)
+ if (! current_routing)
+ return;
+
if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
current_routing->p_hierarchy = SURF_ROUTING_BASE;
xbt_assert(!sg_host_by_name(host->id),
if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
current_routing->p_hierarchy = SURF_ROUTING_BASE;
xbt_assert(!sg_host_by_name(host->id),
void routing_register_callbacks()
{
void routing_register_callbacks()
{
- sg_platf_host_add_cb(parse_S_host);
sg_platf_router_add_cb(parse_S_router);
sg_platf_router_add_cb(parse_S_router);
- sg_platf_host_link_add_cb(parse_S_host_link);
+ sg_platf_host_link_add_cb(parse_S_host);
sg_platf_route_add_cb(parse_E_route);
sg_platf_ASroute_add_cb(parse_E_ASroute);
sg_platf_bypassRoute_add_cb(parse_E_bypassRoute);
sg_platf_route_add_cb(parse_E_route);
sg_platf_ASroute_add_cb(parse_E_ASroute);
sg_platf_bypassRoute_add_cb(parse_E_bypassRoute);
{
SIMIX_global_init(&argc, argv);
{
SIMIX_global_init(&argc, argv);
- if (argc != 2) {
- printf("Usage: %s platform_and_deployment.xml\n", argv[0]);
+ if (argc != 3) {
+ printf("Usage: %s platform.xml deployment.xml\n", argv[0]);
exit(EXIT_FAILURE);
}
SIMIX_function_register("master", master);
SIMIX_create_environment(argv[1]);
exit(EXIT_FAILURE);
}
SIMIX_function_register("master", master);
SIMIX_create_environment(argv[1]);
- SIMIX_launch_application(argv[1]);
+ SIMIX_launch_application(argv[2]);
-$ ${bindir:=.}/stack_overflow --cfg=contexts/stack_size:96 stack_overflow.xml
+$ ${bindir:=.}/stack_overflow --cfg=contexts/stack_size:96 stack_overflow_platform.xml stack_overflow.xml
> [Tremblay:master:(0) 0.000000] [test/INFO] Launching our nice bugged recursive function...
> Access violation detected.
> This can result from a programming error in your code or, although less likely,
> [Tremblay:master:(0) 0.000000] [test/INFO] Launching our nice bugged recursive function...
> Access violation detected.
> This can result from a programming error in your code or, although less likely,
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
- <!-- The hosts -->
- <AS id="AS0" routing="Full">
- <host id="Tremblay" power="98.095Mf"/>
- </AS>
-
<!-- The master process (with some arguments) -->
<process host="Tremblay" function="master">
</process>
<!-- The master process (with some arguments) -->
<process host="Tremblay" function="master">
</process>
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+
+ <!-- The hosts -->
+ <AS id="AS0" routing="Full">
+ <host id="Tremblay" power="98.095Mf"/>
+ </AS>
+
+</platform>