state_initial, state_trace,
bw_initial, bw_trace);
- xbt_assert1(!xbt_dict_get_or_null
- (surf_network_model->resource_set, name),
+ xbt_assert1(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
"Link '%s' declared several times in the platform file.",
name);
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(nw_link->lmm_resource.constraint);
- xbt_dict_set(surf_network_model->resource_set, name, nw_link,
- surf_resource_free);
+ xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, nw_link);
return nw_link;
}
xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_CM02_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_CM02_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_CM02_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
static int link_count = -1;
network_link_GTNETS_t gtnets_link;
- if (xbt_dict_get_or_null(surf_network_model->resource_set, name)) {
+ if (xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL)) {
return;
}
}
gtnets_link->id = link_count;
- xbt_dict_set(surf_network_model->resource_set, name, gtnets_link,
- surf_resource_free);
+ xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, gtnets_link);
}
static void route_new(int src_id, int dst_id, xbt_dynar_t links,
state_initial, state_trace,
bw_initial, bw_trace);
- xbt_assert1(!xbt_dict_get_or_null
- (surf_network_model->resource_set, name),
+ xbt_assert1(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
"Link '%s' declared several times in the platform file.",
name);
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(nw_link->lmm_resource.constraint);
- xbt_dict_set(surf_network_model->resource_set, name, nw_link,
- surf_resource_free);
+ xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, nw_link);
return nw_link;
xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_CM02_im_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_CM02_im_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_CM02_im_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
xbt_swag_new(xbt_swag_offset(action, state_hookup));
model->states.done_action_set =
xbt_swag_new(xbt_swag_offset(action, state_hookup));
- model->resource_set = xbt_dict_new();
model->action_unref = int_die_impossible_paction;
model->action_cancel = void_die_impossible_paction;
xbt_dynar_t link_route_to_test = xbt_dynar_new(global_routing->size_of_link, NULL);
xbt_dynar_foreach(route->generic_route.link_list,i,link_name)
{
- void *link = xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
+ void *link = xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
xbt_assert1(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
for(i=xbt_dynar_length(route->generic_route.link_list) ;i>0 ;i--)
{
link_name = xbt_dynar_get_as(route->generic_route.link_list,i-1,void *);
- void *link = xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
+ void *link = xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
xbt_assert1(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
xbt_dynar_t link_route_to_test = xbt_dynar_new(global_routing->size_of_link, NULL);
xbt_dynar_foreach(route->generic_route.link_list,cpt,link_name)
{
- void *link = xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
+ void *link = xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
xbt_assert1(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
for(i=xbt_dynar_length(route->generic_route.link_list) ;i>0 ;i--)
{
link_name = xbt_dynar_get_as(route->generic_route.link_list,i-1,void *);
- void *link = xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
+ void *link = xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
xbt_assert1(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
char *new_link_name =
remplace(link_name, list_src, rc_src, list_dst, rc_dst);
void *link =
- xbt_dict_get_or_null(surf_network_model->resource_set,
- new_link_name);
+ xbt_lib_get_or_null(link_lib, new_link_name, SURF_LINK_LEVEL);
if (link)
xbt_dynar_push(links_list, &link);
else
xbt_dynar_foreach(links, cpt, link_name) {
void *link =
- xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
+ xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
if (link) {
if (order)
xbt_dynar_push(links_id, &link);
xbt_dynar_foreach(links, cpt, link_name) {
void *link =
- xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
+ xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
if (link) {
if (order)
xbt_dynar_push(links_id, &link);
policy, xbt_dict_t properties)
{
link_L07_t nw_link = xbt_new0(s_link_L07_t, 1);
- xbt_assert1(!xbt_dict_get_or_null
- (surf_network_model->resource_set, name),
+ xbt_assert1(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
"Link '%s' declared several times in the platform file.",
name);
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(nw_link->constraint);
- xbt_dict_set(surf_network_model->resource_set, name, nw_link,
- surf_resource_free);
-
-
+ xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, nw_link);
return nw_link;
}
xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_L07_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert1(link, "Link %s undefined", elm);
xbt_assert1(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_L07_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert1(link, "Link %s undefined", elm);
xbt_assert1(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_L07_t link =
- xbt_dict_get_or_null(surf_network_model->resource_set, elm);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert1(link, "Link %s undefined", elm);
xbt_assert1(trace, "Trace %s undefined", trace_name);