- if (_sg_init_status == 0) { /* Only create stuff if not already inited */
- sprintf(description,
- "The model to use for the CPU. Possible values: ");
- p = description;
- while (*(++p) != '\0');
- for (i = 0; surf_cpu_model_description[i].name; i++)
- p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
- surf_cpu_model_description[i].name);
- sprintf(p,
- ".\n (use 'help' as a value to see the long description of each model)");
- default_value = xbt_strdup("Cas01");
- xbt_cfg_register(&_sg_cfg_set, "cpu/model", description, xbt_cfgelm_string,
- &default_value, 1, 1, &_sg_cfg_cb__cpu_model, NULL);
-
- sprintf(description,
- "The optimization modes to use for the CPU. Possible values: ");
- p = description;
- while (*(++p) != '\0');
- for (i = 0; surf_optimization_mode_description[i].name; i++)
- p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
- surf_optimization_mode_description[i].name);
- sprintf(p,
- ".\n (use 'help' as a value to see the long description of each optimization mode)");
- default_value = xbt_strdup("Lazy");
- xbt_cfg_register(&_sg_cfg_set, "cpu/optim", description, xbt_cfgelm_string,
- &default_value, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
-
- sprintf(description,
- "The model to use for the storage. Possible values: ");
- p = description;
- while (*(++p) != '\0');
- for (i = 0; surf_storage_model_description[i].name; i++)
- p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
- surf_storage_model_description[i].name);
- sprintf(p,
- ".\n (use 'help' as a value to see the long description of each model)");
- default_value = xbt_strdup("default");
- xbt_cfg_register(&_sg_cfg_set, "storage/model", description, xbt_cfgelm_string,
- &default_value, 1, 1, &_sg_cfg_cb__storage_mode,
- NULL);
-
- /* ********************************************************************* */
- /* TUTORIAL: New model */
- sprintf(description,
- "The model to use for the New model. Possible values: ");
- p = description;
- while (*(++p) != '\0');
- for (i = 0; surf_new_model_description[i].name; i++)
- p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
- surf_new_model_description[i].name);
- sprintf(p,
- ".\n (use 'help' as a value to see the long description of each model)");
- default_value = xbt_strdup("default");
- xbt_cfg_register(&_sg_cfg_set, "new_model/model", description, xbt_cfgelm_string,
- &default_value, 1, 1, &_sg_cfg_cb__storage_mode,
- NULL);
- /* ********************************************************************* */
-
- sprintf(description,
- "The model to use for the network. Possible values: ");
- p = description;
- while (*(++p) != '\0');
- for (i = 0; surf_network_model_description[i].name; i++)
- p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
- surf_network_model_description[i].name);
- sprintf(p,
- ".\n (use 'help' as a value to see the long description of each model)");
- default_value = xbt_strdup("LV08");
- xbt_cfg_register(&_sg_cfg_set, "network/model", description, xbt_cfgelm_string,
- &default_value, 1, 1, &_sg_cfg_cb__network_model,
- NULL);
-
- sprintf(description,
- "The optimization modes to use for the network. Possible values: ");
- p = description;
- while (*(++p) != '\0');
- for (i = 0; surf_optimization_mode_description[i].name; i++)
- p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
- surf_optimization_mode_description[i].name);
- sprintf(p,
- ".\n (use 'help' as a value to see the long description of each optimization mode)");
- default_value = xbt_strdup("Lazy");
- xbt_cfg_register(&_sg_cfg_set, "network/optim", description, xbt_cfgelm_string,
- &default_value, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
-
- sprintf(description,
- "The model to use for the workstation. Possible values: ");
- p = description;
- while (*(++p) != '\0');
- for (i = 0; surf_workstation_model_description[i].name; i++)
- p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
- surf_workstation_model_description[i].name);
- sprintf(p,
- ".\n (use 'help' as a value to see the long description of each model)");
- default_value = xbt_strdup("default");
- xbt_cfg_register(&_sg_cfg_set, "workstation/model", description, xbt_cfgelm_string,
- &default_value, 1, 1,
- &_sg_cfg_cb__workstation_model, NULL);
-
- xbt_free(description);
+ if (_sg_cfg_init_status == 0) { /* Only create stuff if not already inited */
+
+ /* Plugins configuration */
+ describe_model(description, surf_plugin_description,
+ "plugin", "The plugins");
+ xbt_cfg_register(&_sg_cfg_set, "plugin", description,
+ xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__plugin, NULL);
+
+ describe_model(description, surf_cpu_model_description,
+ "model", "The model to use for the CPU");
+ xbt_cfg_register(&_sg_cfg_set, "cpu/model", description,
+ xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__cpu_model, NULL);
+ xbt_cfg_setdefault_string(_sg_cfg_set, "cpu/model", "Cas01");
+
+ describe_model(description, surf_optimization_mode_description,
+ "optimization mode",
+ "The optimization modes to use for the CPU");
+ xbt_cfg_register(&_sg_cfg_set, "cpu/optim", description,
+ xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+ xbt_cfg_setdefault_string(_sg_cfg_set, "cpu/optim", "Lazy");
+
+ describe_model(description, surf_storage_model_description,
+ "model", "The model to use for the storage");
+ xbt_cfg_register(&_sg_cfg_set, "storage/model", description,
+ xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__storage_mode, NULL);
+ xbt_cfg_setdefault_string(_sg_cfg_set, "storage/model", "default");
+
+ describe_model(description, surf_network_model_description,
+ "model", "The model to use for the network");
+ xbt_cfg_register(&_sg_cfg_set, "network/model", description,
+ xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__network_model, NULL);
+ xbt_cfg_setdefault_string(_sg_cfg_set, "network/model", "LV08");
+
+ describe_model(description, surf_optimization_mode_description,
+ "optimization mode",
+ "The optimization modes to use for the network");
+ xbt_cfg_register(&_sg_cfg_set, "network/optim", description,
+ xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+ xbt_cfg_setdefault_string(_sg_cfg_set, "network/optim", "Lazy");
+
+ describe_model(description, surf_workstation_model_description,
+ "model", "The model to use for the workstation");
+ xbt_cfg_register(&_sg_cfg_set, "workstation/model", description,
+ xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__workstation_model, NULL);
+ xbt_cfg_setdefault_string(_sg_cfg_set, "workstation/model", "default");
+
+ describe_model(description, surf_vm_workstation_model_description,
+ "model", "The model to use for the vm workstation");
+ xbt_cfg_register(&_sg_cfg_set, "vm_workstation/model", description,
+ xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__vm_workstation_model, NULL);
+ xbt_cfg_setdefault_string(_sg_cfg_set, "vm_workstation/model", "default");