- if (!strcmp(workstation_model_name,"KCCFLN05")) {
- surf_workstation_resource_init_KCCFLN05(file);
- } else if (!strcmp(workstation_model_name,"KCCFLN05_proportional")) {
- surf_workstation_resource_init_KCCFLN05_proportional(file);
- } else if (!strcmp(workstation_model_name,"KCCFLN05_Vegas")) {
- surf_workstation_resource_init_KCCFLN05_Vegas(file);
- } else if (!strcmp(workstation_model_name,"KCCFLN05_Reno")) {
- surf_workstation_resource_init_KCCFLN05_Reno(file);
- } else if (!strcmp(workstation_model_name,"CLM03")) {
- surf_workstation_resource_init_CLM03(file);
- } else {
- xbt_assert0(0,"The impossible happened (once again)");
+ workstation_id =
+ find_model_description(surf_workstation_model_description,
+ surf_workstation_model_description_size,
+ workstation_model_name);
+ if (!strcmp(workstation_model_name, "compound")) {
+ xbt_ex_t e;
+ char *network_model_name = NULL;
+ char *cpu_model_name = NULL;
+ int network_id = -1;
+ int cpu_id = -1;
+
+ TRY {
+ cpu_model_name = xbt_cfg_get_string(_simix_cfg_set, "cpu_model");
+ } CATCH(e) {
+ if (e.category == bound_error) {
+ xbt_assert0(0,
+ "Set a cpu model to use with the 'compound' workstation model");
+ xbt_ex_free(e);
+ } else {
+ RETHROW;
+ }
+ }
+
+ TRY {
+ network_model_name =
+ xbt_cfg_get_string(_simix_cfg_set, "network_model");
+ }
+ CATCH(e) {
+ if (e.category == bound_error) {
+ xbt_assert0(0,
+ "Set a network model to use with the 'compound' workstation model");
+ xbt_ex_free(e);
+ } else {
+ RETHROW;
+ }
+ }
+
+ network_id =
+ find_model_description(surf_network_model_description,
+ surf_network_model_description_size,
+ network_model_name);
+ cpu_id =
+ find_model_description(surf_cpu_model_description,
+ surf_cpu_model_description_size,
+ cpu_model_name);
+
+ surf_cpu_model_description[cpu_id].model_init(file);
+ surf_network_model_description[network_id].model_init(file);
+