/** Labeler function
 * Set all links with the same bandwidth and latency
 * Add a state trace to each link
 */
void labeler_1(context_edge_t edge) {
  s_sg_platf_link_cbarg_t link_parameters;
  link_parameters.id = NULL;
  link_parameters.bandwidth = 100000000;
  link_parameters.bandwidth_trace = NULL;
  link_parameters.latency = 0.01;
  link_parameters.latency_trace = NULL;
  link_parameters.state = SURF_RESOURCE_ON;
  link_parameters.state_trace = NULL;
  link_parameters.policy = SURF_LINK_SHARED;
  link_parameters.properties = NULL;

  char* avail_generator_id = bprintf("avail_link_%ld", edge->id);
  char* unavail_generator_id = bprintf("unavail_link_%ld", edge->id);

  probabilist_event_generator_t avail_generator =
                          tmgr_event_generator_new_exponential(avail_generator_id, 0.0001);
  probabilist_event_generator_t unavail_generator =
                          tmgr_event_generator_new_uniform(unavail_generator_id, 10, 20);

  link_parameters.state_trace =
              tmgr_trace_generator_avail_unavail(bprintf("state_link_%ld", edge->id),
                                                avail_generator,
                                                unavail_generator,
                                                SURF_RESOURCE_ON);


  platf_graph_link_label(edge, &link_parameters);

}
예제 #2
0
/** Labeler function
 * Set all links with the same bandwidth and latency
 */
void labeler_1(context_edge_t edge) {
  s_sg_platf_link_cbarg_t link_parameters;
  link_parameters.id = NULL;
  link_parameters.bandwidth = 1000000;
  link_parameters.bandwidth_trace = NULL;
  link_parameters.latency = 0.01;
  link_parameters.latency_trace = NULL;
  link_parameters.state = SURF_RESOURCE_ON;
  link_parameters.state_trace = NULL;
  link_parameters.policy = SURF_LINK_SHARED;
  link_parameters.properties = NULL;

  platf_graph_link_label(edge, &link_parameters);
}