-
-
-
-
-
-
-
-
-
-static void ptask_finalize(void)
-{
- xbt_dict_free(&ptask_parallel_task_link_set);
-
- delete surf_workstation_model;
- surf_workstation_model = NULL;
- delete surf_network_model;
- surf_network_model = NULL;
-
- ptask_host_count = 0;
-
- if (ptask_maxmin_system) {
- lmm_system_free(ptask_maxmin_system);
- ptask_maxmin_system = NULL;
- }
-}
-
-/**************************************/
-/******* Resource Private **********/
-/**************************************/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/**************************************/
-/*** Resource Creation & Destruction **/
-/**************************************/
-
-
-
-static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
-{
- ((WorkstationL07ModelPtr)surf_workstation_model)->createCpuResource(
- host->id,
- host->power_peak,
- host->power_scale,
- host->power_trace,
- host->initial_state,
- host->state_trace,
- host->properties);
-}
-
-
-
-static void ptask_parse_link_init(sg_platf_link_cbarg_t link)
-{
- if (link->policy == SURF_LINK_FULLDUPLEX) {
- char *link_id;
- link_id = bprintf("%s_UP", link->id);
- ((WorkstationL07ModelPtr)surf_workstation_model)->createLinkResource(link_id,
- link->bandwidth,
- link->bandwidth_trace,
- link->latency,
- link->latency_trace,
- link->state,
- link->state_trace,
- link->policy,
- link->properties);
- xbt_free(link_id);
- link_id = bprintf("%s_DOWN", link->id);
- ((WorkstationL07ModelPtr)surf_workstation_model)->createLinkResource(link_id,
- link->bandwidth,
- link->bandwidth_trace,
- link->latency,
- link->latency_trace,
- link->state,
- link->state_trace,
- link->policy,
- NULL); /* FIXME: We need to deep copy the
- * properties or we won't be able to free
- * it */
- xbt_free(link_id);
- } else {
- ((WorkstationL07ModelPtr)surf_workstation_model)->createLinkResource(link->id,
- link->bandwidth,
- link->bandwidth_trace,
- link->latency,
- link->latency_trace,
- link->state,
- link->state_trace,
- link->policy,
- link->properties);
- }
-
- current_property_set = NULL;
-}
-
-
-
-static void ptask_define_callbacks()
-{
- sg_platf_host_add_cb(ptask_parse_cpu_init);
- sg_platf_link_add_cb(ptask_parse_link_init);
- //FIXME:sg_platf_postparse_add_cb(ptask_add_traces);
-}
-
-/**************************************/
-/*************** Generic **************/
-/**************************************/
-void surf_workstation_model_init_ptask_L07(void)
-{
- XBT_INFO("surf_workstation_model_init_ptask_L07");
- xbt_assert(!surf_cpu_model, "CPU model type already defined");
- xbt_assert(!surf_network_model, "network model type already defined");
- ptask_define_callbacks();
- new WorkstationL07Model();
- xbt_dynar_push(model_list, &surf_workstation_model);
-}