/** Promoter function
 * Just promote each node into a host, with fixed power
 */
void promoter_1(context_node_t node) {

  s_sg_platf_host_cbarg_t host_parameters;

  host_parameters.id = NULL;
  host_parameters.power_peak = xbt_dynar_new(sizeof(double), NULL);
  xbt_dynar_push_as(host_parameters.power_peak, double, 1000000.0);
  host_parameters.core_amount = 1;
  host_parameters.power_scale = 1;
  host_parameters.power_trace = NULL;
  host_parameters.initial_state = SURF_RESOURCE_ON;
  host_parameters.state_trace = NULL;
  host_parameters.coord = NULL;
  host_parameters.properties = NULL;

  platf_graph_promote_to_host(node, &host_parameters);

}
/** Promoter function
 * Just promote each node into a host, with fixed power
 * Set one node as master
 * Add a state trace on other nodes
 */
void promoter_1(context_node_t node) {

  s_sg_platf_host_cbarg_t host_parameters;
  static int master_choosen = FALSE;

  host_parameters.id = NULL;
  host_parameters.power_peak = xbt_dynar_new(sizeof(double), NULL);
  xbt_dynar_push_as(host_parameters.power_peak, double, 25000000.0);
  host_parameters.core_amount = 1;
  host_parameters.power_scale = 1;
  host_parameters.power_trace = NULL;
  host_parameters.initial_state = SURF_RESOURCE_ON;
  host_parameters.state_trace = NULL;
  host_parameters.coord = NULL;
  host_parameters.properties = NULL;

  if(!master_choosen) {
    master_choosen = TRUE;
    host_parameters.id = "host_master";
  } else {
    //Set a power trace
    char* pw_date_generator_id = bprintf("pw_date_host_%ld", node->id);
    char* pw_value_generator_id = bprintf("pw_value_host_%ld", node->id);
    probabilist_event_generator_t pw_date_generator =
                          tmgr_event_generator_new_uniform(pw_date_generator_id, 5, 10);
    probabilist_event_generator_t pw_value_generator =
                          tmgr_event_generator_new_uniform(pw_value_generator_id, 0.6, 1.0);
    host_parameters.power_trace =
              tmgr_trace_generator_value(bprintf("pw_host_%ld", node->id),
                                                pw_date_generator,
                                                pw_value_generator);
  }

  platf_graph_promote_to_host(node, &host_parameters);

}