CpuModel *java_cpu_model;
static void java_cpu_model_init_preparse() {
surf_cpu_model_pm = java_cpu_model;
- xbt_dynar_push(model_list, &java_cpu_model);
+ xbt_dynar_push(all_existing_models, &java_cpu_model);
xbt_dynar_push(model_list_invoke, &java_cpu_model);
sg_platf_host_add_cb(cpu_parse_init);
}
/** \ingroup SURF_models
* \brief List of initialized models
*/
-XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
+XBT_PUBLIC_DATA(xbt_dynar_t) all_existing_models;
XBT_PUBLIC_DATA(xbt_dynar_t) model_list_invoke;
/** \ingroup SURF_simulation
if (elapsed_time > 0.0)
total_time += elapsed_time;
- /* FIXME: shoud look at model_list or model_list_invoke? */
/* let's see which tasks are done */
- xbt_dynar_foreach(model_list, iter, model) {
+ xbt_dynar_foreach(all_existing_models, iter, model) {
while ((action = surf_model_extract_done_action_set(model))) {
task = surf_action_get_data(action);
task->start_time = surf_action_get_start_time(task->surf_action);
}
}
/* Wake up all processes waiting for a Surf action to finish */
- xbt_dynar_foreach(model_list, iter, model) {
+ xbt_dynar_foreach(all_existing_models, iter, model) {
XBT_DEBUG("Handling process whose action failed");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
}
/* Wake up all processes waiting for a Surf action to finish */
- xbt_dynar_foreach(model_list, iter, model) {
+ xbt_dynar_foreach(all_existing_models, iter, model) {
XBT_DEBUG("Handling process whose action failed");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
Model *model_pm = surf_cpu_model_pm;
Model *model_vm = surf_cpu_model_vm;
- xbt_dynar_push(model_list, &model_pm);
- xbt_dynar_push(model_list, &model_vm);
+ xbt_dynar_push(all_existing_models, &model_pm);
+ xbt_dynar_push(all_existing_models, &model_vm);
}
CpuCas01Model::CpuCas01Model() : CpuModel()
cpu_ti_define_callbacks();
Model *model_pm = static_cast<Model*>(surf_cpu_model_pm);
Model *model_vm = static_cast<Model*>(surf_cpu_model_vm);
- xbt_dynar_push(model_list, &model_pm);
- xbt_dynar_push(model_list, &model_vm);
+ xbt_dynar_push(all_existing_models, &model_pm);
+ xbt_dynar_push(all_existing_models, &model_vm);
}
CpuTiModel::CpuTiModel() : CpuModel()
surf_network_model_init_LegrandVelho();
Model *model = surf_host_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
xbt_dynar_push(model_list_invoke, &model);
sg_platf_host_add_cb(host_parse_init);
}
surf_host_model = new HostCLM03Model();
Model *model = surf_host_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
xbt_dynar_push(model_list_invoke, &model);
sg_platf_host_add_cb(host_parse_init);
}
surf_host_model = new HostL07Model();
Model *model = surf_host_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
xbt_dynar_push(model_list_invoke, &model);
}
surf_network_model = new NetworkCm02Model();
net_define_callbacks();
Model *model = surf_network_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor",
13.01);
surf_network_model = new NetworkCm02Model();
net_define_callbacks();
Model *model = surf_network_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor",
surf_network_model = new NetworkCm02Model();
net_define_callbacks();
Model *model = surf_network_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
func_reno_fpi);
surf_network_model->f_networkSolve = lagrange_solve;
surf_network_model = new NetworkCm02Model();
net_define_callbacks();
Model *model = surf_network_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
func_reno2_fpi);
surf_network_model->f_networkSolve = lagrange_solve;
surf_network_model = new NetworkCm02Model();
net_define_callbacks();
Model *model = surf_network_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
func_vegas_fpi);
surf_network_model->f_networkSolve = lagrange_solve;
sg_platf_link_add_cb(netcste_parse_nolink);
Model *model = surf_network_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
}
double NetworkConstantModel::shareResources(double /*now*/)
return;
surf_network_model = new NetworkIBModel();
net_define_callbacks();
- xbt_dynar_push(model_list, &surf_network_model);
+ xbt_dynar_push(all_existing_models, &surf_network_model);
surf_callback_connect(networkActionStateChangedCallbacks, IB_action_state_changed_callback);
surf_callback_connect(networkCommunicateCallbacks, IB_action_init_callback);
surf_network_model = new NetworkNS3Model();
- xbt_dynar_push(model_list, &surf_network_model);
+ xbt_dynar_push(all_existing_models, &surf_network_model);
}
NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
return;
surf_network_model = new NetworkSmpiModel();
net_define_callbacks();
- xbt_dynar_push(model_list, &surf_network_model);
+ xbt_dynar_push(all_existing_models, &surf_network_model);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", 10e-6);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
{
surf_storage_model = new StorageN11Model();
storage_define_callbacks();
- xbt_dynar_push(model_list, &surf_storage_model);
+ xbt_dynar_push(all_existing_models, &surf_storage_model);
}
StorageN11Model::StorageN11Model() : StorageModel() {
}
}
}
- xbt_dynar_foreach(model_list, iter, model)
+ xbt_dynar_foreach(all_existing_models, iter, model)
model->updateActionsState(NOW, 0.0);
}
NOW = NOW + surf_min;
/* FIXME: model_list or model_list_invoke? revisit here later */
/* sequential version */
- xbt_dynar_foreach(model_list, iter, model) {
+ xbt_dynar_foreach(all_existing_models, iter, model) {
model->updateActionsState(NOW, surf_min);
}
/* model_list_invoke contains only surf_host and surf_vm.
* The callback functions of cpu_model and network_model will be called from
* those of these host models. */
-xbt_dynar_t model_list = NULL; /* for destroying all models correctly */
+xbt_dynar_t all_existing_models = NULL; /* to destroy models correctly */
xbt_dynar_t model_list_invoke = NULL; /* for invoking callbacks */
tmgr_history_t history = NULL;
SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free);
xbt_init(argc, argv);
- if (!model_list)
- model_list = xbt_dynar_new(sizeof(Model*), NULL);
+ if (!all_existing_models)
+ all_existing_models = xbt_dynar_new(sizeof(Model*), NULL);
if (!model_list_invoke)
model_list_invoke = xbt_dynar_new(sizeof(Model*), NULL);
if (!history)
xbt_lib_free(&file_lib);
xbt_dict_free(&watched_hosts_lib);
- xbt_dynar_foreach(model_list, iter, model)
+ xbt_dynar_foreach(all_existing_models, iter, model)
delete model;
- xbt_dynar_free(&model_list);
+ xbt_dynar_free(&all_existing_models);
xbt_dynar_free(&model_list_invoke);
routing_exit();
/*********
* Model *
*********/
-XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
+XBT_PUBLIC_DATA(xbt_dynar_t) all_existing_models;
/** @ingroup SURF_interface
* @brief SURF model interface class
surf_vm_model = new VMHL13Model();
Model *model = surf_vm_model;
- xbt_dynar_push(model_list, &model);
+ xbt_dynar_push(all_existing_models, &model);
xbt_dynar_push(model_list_invoke, &model);
}
}
now = surf_get_clock();
XBT_DEBUG("Next Event : %g", now);
- xbt_dynar_foreach(model_list, iter, model) {
+ xbt_dynar_foreach(all_existing_models, iter, model) {
XBT_DEBUG("\t Actions");
while ((action = surf_model_extract_failed_action_set((surf_model_t)model))) {
XBT_DEBUG("\t * Failed : %p", action);