const char *name;
const char *description;
void (*model_init_preparse) (void);
- void (*model_init_postparse) (void);
} s_surf_model_description_t, *surf_model_description_t;
XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table,
*/
XBT_PUBLIC(void) surf_init(int *argc, char **argv); /* initialize common structures */
-/** \brief create the elements of the models
- *
- * Must be called after parsing the platform file and before using any elements
- */
-XBT_PUBLIC(void) surf_config_models_create_elms(void);
-
/** \brief Finish simulation initialization
* \ingroup SURF_simulation
*
{"Vegas",
"Model using lagrange_solve instead of lmm_solve (experts only)",
surf_network_model_init_Vegas},
- {NULL, NULL, NULL, NULL} /* this array must be NULL terminated */
+ {NULL, NULL, NULL} /* this array must be NULL terminated */
};
s_surf_model_description_t surf_cpu_model_description[] = {
{"CpuTI",
"Variation of Cas01 with also trace integration. Should produce the same values, only faster if you use availability traces",
surf_cpu_model_init_ti},
- {NULL, NULL, NULL, NULL} /* this array must be NULL terminated */
+ {NULL, NULL, NULL} /* this array must be NULL terminated */
};
s_surf_model_description_t surf_workstation_model_description[] = {
{"CLM03",
"Default workstation model, using LV08 and CM02 as network and CPU",
- surf_workstation_model_init_CLM03, create_workstations},
+ surf_workstation_model_init_CLM03},
{"compound",
"Workstation model allowing you to use other network and CPU models",
- surf_workstation_model_init_compound, create_workstations},
+ surf_workstation_model_init_compound},
{"ptask_L07", "Workstation model with better parallel task modeling",
- surf_workstation_model_init_ptask_L07, NULL},
+ surf_workstation_model_init_ptask_L07},
{NULL, NULL, NULL} /* this array must be NULL terminated */
};
XBT_DEBUG("Call workstation_model_init");
surf_workstation_model_description[workstation_id].model_init_preparse();
}
-
-void surf_config_models_create_elms(void)
-{
- char *workstation_model_name =
- xbt_cfg_get_string(_surf_cfg_set, "workstation/model");
- int workstation_id =
- find_model_description(surf_workstation_model_description,
- workstation_model_name);
- if (surf_workstation_model_description
- [workstation_id].model_init_postparse != NULL)
- surf_workstation_model_description[workstation_id].model_init_postparse
- ();
-}
surf_cpu_model_init_Cas01_im();
surf_network_model_init_LegrandVelho();
xbt_dynar_push(model_list, &surf_workstation_model);
+ sg_platf_postparse_add_cb(create_workstations);
}
void surf_workstation_model_init_compound()
xbt_assert(surf_network_model, "No network model defined yet!");
surf_workstation_model_init_internal();
xbt_dynar_push(model_list, &surf_workstation_model);
+ sg_platf_postparse_add_cb(create_workstations);
}