surf/fair_bottleneck.c surf/lagrange.c surf/trace_mgr.c \
surf/random_mgr.c surf/surf.c surf/surfxml_parse.c surf/cpu.c \
surf/network.c surf/workstation.c surf/surf_timer.c \
- surf/workstation_KCCFLN05.c surf/workstation_ptask_L07.c \
xbt/xbt_sg_stubs.c xbt/xbt_os_thread.c \
xbt/xbt_thread_context.c xbt/xbt_ucontext.c \
surf/gtnets/gtnets_simulator.cc surf/gtnets/gtnets_topology.cc \
@CONTEXT_THREADS_FALSE@am__objects_7 = xbt_ucontext.lo
am__objects_8 = maxmin.lo fair_bottleneck.lo lagrange.lo trace_mgr.lo \
random_mgr.lo surf.lo surfxml_parse.lo cpu.lo network.lo \
- workstation.lo surf_timer.lo workstation_KCCFLN05.lo \
+ workstation.lo surf_timer.lo \
workstation_ptask_L07.lo xbt_sg_stubs.lo $(am__objects_6) \
$(am__objects_7)
am__objects_9 = gtnets_simulator.lo gtnets_topology.lo \
surf/trace_mgr.c surf/random_mgr.c surf/surf.c \
surf/surfxml_parse.c surf/cpu.c surf/network.c \
surf/workstation.c surf/surf_timer.c \
- surf/workstation_KCCFLN05.c surf/workstation_ptask_L07.c \
+ surf/workstation_ptask_L07.c \
xbt/xbt_sg_stubs.c $(am__append_1) $(am__append_2)
GTNETS_SRC = \
surf/gtnets/gtnets_simulator.cc \
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o surf_timer.lo `test -f 'surf/surf_timer.c' || echo '$(srcdir)/'`surf/surf_timer.c
-workstation_KCCFLN05.lo: surf/workstation_KCCFLN05.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT workstation_KCCFLN05.lo -MD -MP -MF $(DEPDIR)/workstation_KCCFLN05.Tpo -c -o workstation_KCCFLN05.lo `test -f 'surf/workstation_KCCFLN05.c' || echo '$(srcdir)/'`surf/workstation_KCCFLN05.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/workstation_KCCFLN05.Tpo $(DEPDIR)/workstation_KCCFLN05.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='surf/workstation_KCCFLN05.c' object='workstation_KCCFLN05.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o workstation_KCCFLN05.lo `test -f 'surf/workstation_KCCFLN05.c' || echo '$(srcdir)/'`surf/workstation_KCCFLN05.c
-
workstation_ptask_L07.lo: surf/workstation_ptask_L07.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT workstation_ptask_L07.lo -MD -MP -MF $(DEPDIR)/workstation_ptask_L07.Tpo -c -o workstation_ptask_L07.lo `test -f 'surf/workstation_ptask_L07.c' || echo '$(srcdir)/'`surf/workstation_ptask_L07.c
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/workstation_ptask_L07.Tpo $(DEPDIR)/workstation_ptask_L07.Plo
const char *name;
surf_model_t model;
void (* model_init) (const char *filename);
+ void (* create_ws) (void);
} s_surf_model_description_t, *surf_model_description_t;
XBT_PUBLIC(void) update_model_description(s_surf_model_description_t *table,
surf_network_model_extension_public_t extension_public;
} s_surf_network_model_t, *surf_network_model_t;
+XBT_PUBLIC(void) create_workstations(void);
+
/** \brief The network model
* \ingroup SURF_models
*
* \see link_set
*/
XBT_PUBLIC_DATA(xbt_dict_t) workstation_set;
-
+XBT_PUBLIC_DATA(xbt_dict_t) cpu_set;
/** \brief List of initialized models
* \ingroup SURF_models
*/
"network_model", xbt_cfgelm_string, 1, 1,
&_simix_cfg_cb__network_model, NULL);
- xbt_cfg_set_string(_simix_cfg_set, "workstation_model", "KCCFLN05");
+ xbt_cfg_set_string(_simix_cfg_set, "workstation_model", "CLM03");
}
void simix_config_finalize(void)
double e ;
double s = xbt_os_time();
parse_platform_file(file);
+ if (surf_workstation_model_description[workstation_id].create_ws != NULL)
+ surf_workstation_model_description[workstation_id].create_ws();
e = xbt_os_time();
- DEBUG1("PARSE TIME: %lg", (e-s));
+ INFO1("PARSE TIME: %lg", (e-s));
}
_simix_init_status = 2; /* inited; don't change settings now */
static int called = 0;
-static void add_traces(void)
+static void add_traces_cpu(void)
{
xbt_dynar_t trace_connect = NULL;
unsigned int cpt;
surf_parse_reset_parser();
surfxml_add_callback(STag_surfxml_host_cb_list, parse_cpu_init);
surfxml_add_callback(STag_surfxml_prop_cb_list, parse_properties);
- surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces);
+// surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces_cpu);
surfxml_add_callback(STag_surfxml_random_cb_list, &init_randomness);
surfxml_add_callback(ETag_surfxml_random_cb_list, &add_randomness);
}
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "network_private.h"
+#include "cpu_private.h"
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
int connect_element, connect_kind;
char *value, *trace_id, *connector_id;
link_CM02_t link;
+ cpu_Cas01_t host = NULL;
tmgr_trace_t trace;
if (called) return;
xbt_assert1((trace = xbt_dict_get_or_null(traces_set_list, trace_id)), "Trace %s undefined", trace_id);
+ if (connect_element == A_surfxml_trace_c_connect_element_HOST) {
+ xbt_assert1((host = xbt_dict_get_or_null(cpu_set, connector_id)), "Host %s undefined", connector_id);
+ switch (connect_kind) {
+ case A_surfxml_trace_c_connect_kind_AVAILABILITY: host->state_event = tmgr_history_add_trace(history, trace, 0.0, 0, host); break;
+ case A_surfxml_trace_c_connect_kind_POWER: host->power_event = tmgr_history_add_trace(history, trace, 0.0, 0, host); break;
+ }
+ }
+
if (connect_element == A_surfxml_trace_c_connect_element_LINK) {
xbt_assert1((link = xbt_dict_get_or_null(link_set, connector_id)), "Link %s undefined", connector_id);
switch (connect_kind) {
surfxml_add_callback(ETag_surfxml_link_c_ctn_cb_list, &parse_route_elem);
surfxml_add_callback(ETag_surfxml_route_cb_list, &parse_route_set_route);
surfxml_add_callback(STag_surfxml_platform_cb_list, &init_data);
+ surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_route);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_loopback);
- surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces);
surfxml_add_callback(STag_surfxml_set_cb_list, &parse_sets);
surfxml_add_callback(STag_surfxml_route_c_multi_cb_list, &parse_route_multi_set_endpoints);
surfxml_add_callback(ETag_surfxml_route_c_multi_cb_list, &parse_route_multi_set_route);
int surf_workstation_model_description_size = 4;
s_surf_model_description_t surf_workstation_model_description[] = {
- {"CLM03", NULL, surf_workstation_model_init_CLM03},
- {"KCCFLN05", NULL, surf_workstation_model_init_KCCFLN05},
- {"compound", NULL, surf_workstation_model_init_compound},
- {"ptask_L07", NULL, surf_workstation_model_init_ptask_L07}
+ {"CLM03", NULL, surf_workstation_model_init_CLM03, create_workstations},
+ {"compound", NULL, surf_workstation_model_init_compound, NULL},
+ {"ptask_L07", NULL, surf_workstation_model_init_ptask_L07, NULL}
};
void update_model_description(s_surf_model_description_t * table,
xbt_dynar_foreach(dst_names, cpt2, dst_host_name) {
/* If dst is $* then set this route to have its dst point to all hosts */
if (strcmp(src_host_name,"$*") != 0 && strcmp(dst_host_name,"$*") == 0){
- xbt_dict_foreach(workstation_set, cursor_w, key_w, data_w) {
+ xbt_dict_foreach(cpu_set, cursor_w, key_w, data_w) {
//int n = xbt_dynar_member(src_names, (char*)key_w);
add_multi_links(src, dst, links, src_host_name, key_w);
}
}
/* If src is $* then set this route to have its dst point to all hosts */
if (strcmp(src_host_name,"$*") == 0 && strcmp(dst_host_name,"$*") != 0){
- xbt_dict_foreach(workstation_set, cursor_w, key_w, data_w) {
+ xbt_dict_foreach(cpu_set, cursor_w, key_w, data_w) {
// if (!symmetric || (symmetric && !contains(dst_names, key_w)))
add_multi_links(src, dst, links, key_w, dst_host_name);
}
random_data_t random = random_new(random_generator, random_min, random_max, random_mean, random_std_deviation);
xbt_dict_set(random_data_list, random_id, (void *)random, NULL);
}
+
#include "cpu_private.h"
#include "network_private.h"
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
+ "Logging specific to the SURF workstation module");
+
surf_workstation_model_t surf_workstation_model = NULL;
xbt_dict_t workstation_set = NULL;
free(workstation);
}
-static void create_workstations(void)
+void create_workstations(void)
{
xbt_dict_cursor_t cursor = NULL;
char *name = NULL;
surf_workstation_model_init_internal();
surf_cpu_model_init_Cas01(filename);
surf_network_model_init_CM02(filename);
- create_workstations();
+// create_workstations();
update_model_description(surf_workstation_model_description,
surf_workstation_model_description_size,
"CLM03",