git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6425
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
14 files changed:
use the model field of their ancestor.
But hell, we wont fight for 8 bytes per host, will we?
TODO: integrate the properties into that ancestor
use the model field of their ancestor.
But hell, we wont fight for 8 bytes per host, will we?
TODO: integrate the properties into that ancestor
+ * Rename model methods:
+ action_free -> action_unref
+ action_use -> action_ref
+ action_change_state -> action_state_set
+ action_get_state -> action_state_get
XBT:
* Add xbt_set_get_by_name_or_null() [Silas De Munck]
XBT:
* Add xbt_set_get_by_name_or_null() [Silas De Munck]
double (*action_get_start_time) (surf_action_t action);/**< Return the start time of an action */
double (*action_get_finish_time) (surf_action_t action);/**< Return the finish time of an action */
double (*action_get_start_time) (surf_action_t action);/**< Return the start time of an action */
double (*action_get_finish_time) (surf_action_t action);/**< Return the finish time of an action */
- void (*action_use) (surf_action_t action);/**< Set an action used */
- int (*action_free) (surf_action_t action);/**< Free an action */
+ void (*action_ref) (surf_action_t action);/**< Specify that we use that action */
+ int (*action_unref) (surf_action_t action);/**< Specify that we don't use that action anymore */
void (*action_cancel) (surf_action_t action);/**< Cancel a running action */
void (*action_recycle) (surf_action_t action);/**< Recycle an action */
void (*action_data_set) (surf_action_t action, void *data);/**< Set the user data of an action */
void (*action_cancel) (surf_action_t action);/**< Cancel a running action */
void (*action_recycle) (surf_action_t action);/**< Recycle an action */
void (*action_data_set) (surf_action_t action, void *data);/**< Set the user data of an action */
task = action->data;
INFO1("Task '%s' failed", SD_task_get_name(task));
__SD_task_set_state(task, SD_FAILED);
task = action->data;
INFO1("Task '%s' failed", SD_task_get_name(task));
__SD_task_set_state(task, SD_FAILED);
- surf_workstation_model->action_free(action);
+ surf_workstation_model->action_unref(action);
task->surf_action = NULL;
if (!xbt_dynar_member(changed_tasks, &task))
task->surf_action = NULL;
if (!xbt_dynar_member(changed_tasks, &task))
candidates = xbt_new(SD_task_t, 8);
__SD_task_set_state(task, SD_DONE);
candidates = xbt_new(SD_task_t, 8);
__SD_task_set_state(task, SD_DONE);
- surf_workstation_model->action_free(task->surf_action);
+ surf_workstation_model->action_unref(task->surf_action);
task->surf_action = NULL;
DEBUG0("Looking for candidates");
task->surf_action = NULL;
DEBUG0("Looking for candidates");
xbt_free(task->name);
if (task->surf_action != NULL)
xbt_free(task->name);
if (task->surf_action != NULL)
- surf_workstation_model->action_free(task->surf_action);
+ surf_workstation_model->action_unref(task->surf_action);
if (task->workstation_list != NULL)
xbt_free(task->workstation_list);
if (task->workstation_list != NULL)
xbt_free(task->workstation_list);
xbt_fifo_free(action->cond_list);
if (action->simdata->surf_action)
xbt_fifo_free(action->cond_list);
if (action->simdata->surf_action)
- action->simdata->surf_action->model_type->action_free(action->
+ action->simdata->surf_action->model_type->action_unref(action->
simdata->surf_action);
xbt_free(action->simdata);
simdata->surf_action);
xbt_free(action->simdata);
((cpu_Cas01_t) resource_id)->constraint);
}
((cpu_Cas01_t) resource_id)->constraint);
}
-static int action_free(surf_action_t action)
+static int action_unref(surf_action_t action)
{
action->refcount--;
if (!action->refcount) {
{
action->refcount--;
if (!action->refcount) {
-static void action_use(surf_action_t action)
+static void action_ref(surf_action_t action)
surf_cpu_model->name = "CPU";
surf_cpu_model->name = "CPU";
- surf_cpu_model->action_free = action_free;
- surf_cpu_model->action_use = action_use;
+ surf_cpu_model->action_unref = action_unref;
+ surf_cpu_model->action_ref = action_ref;
surf_cpu_model->action_cancel = action_cancel;
surf_cpu_model->action_state_set = cpu_action_state_set;
surf_cpu_model->action_cancel = action_cancel;
surf_cpu_model->action_state_set = cpu_action_state_set;
((link_CM02_t) resource_id)->constraint);
}
((link_CM02_t) resource_id)->constraint);
}
-static int action_free(surf_action_t action)
+static int action_unref(surf_action_t action)
{
action->refcount--;
if (!action->refcount) {
{
action->refcount--;
if (!action->refcount) {
-static void action_use(surf_action_t action)
+static void action_ref(surf_action_t action)
surf_network_model = surf_model_init();
surf_network_model->name = "network";
surf_network_model = surf_model_init();
surf_network_model->name = "network";
- surf_network_model->action_free = action_free;
- surf_network_model->action_use = action_use;
+ surf_network_model->action_unref = action_unref;
+ surf_network_model->action_ref = action_ref;
surf_network_model->action_cancel = action_cancel;
surf_network_model->action_recycle = action_recycle;
surf_network_model->action_cancel = action_cancel;
surf_network_model->action_recycle = action_recycle;
-static int action_free(surf_action_t action)
+static int action_unref(surf_action_t action)
{
action->refcount--;
if (!action->refcount) {
{
action->refcount--;
if (!action->refcount) {
-static void action_use(surf_action_t action)
+static void action_ref(surf_action_t action)
surf_network_model = surf_model_init();
surf_network_model->name = "network constant";
surf_network_model = surf_model_init();
surf_network_model->name = "network constant";
- surf_network_model->action_free = action_free;
- surf_network_model->action_use = action_use;
+ surf_network_model->action_unref = action_unref;
+ surf_network_model->action_ref = action_ref;
surf_network_model->action_cancel = action_cancel;
surf_network_model->action_recycle = action_recycle;
surf_network_model->action_cancel = action_cancel;
surf_network_model->action_recycle = action_recycle;
return 0; /* We don't care */
}
return 0; /* We don't care */
}
-static int action_free(surf_action_t action)
+static int action_unref(surf_action_t action)
{
action->refcount--;
if (!action->refcount) {
{
action->refcount--;
if (!action->refcount) {
-static void action_use(surf_action_t action)
+static void action_ref(surf_action_t action)
surf_network_model = surf_model_init();
surf_network_model->name = "network GTNetS";
surf_network_model = surf_model_init();
surf_network_model->name = "network GTNetS";
- surf_network_model->action_use = action_use;
- surf_network_model->action_free = action_free;
+ surf_network_model->action_ref = action_ref;
+ surf_network_model->action_unref = action_unref;
surf_network_model->action_cancel = action_cancel;
surf_network_model->action_recycle = action_recycle;
surf_network_model->action_change_state = action_change_state;
surf_network_model->action_cancel = action_cancel;
surf_network_model->action_recycle = action_recycle;
surf_network_model->action_change_state = action_change_state;
xbt_swag_new(xbt_swag_offset(action, state_hookup));
model->resource_set = xbt_dict_new();
xbt_swag_new(xbt_swag_offset(action, state_hookup));
model->resource_set = xbt_dict_new();
- model->action_free = int_die_impossible_paction;
+ model->action_unref = int_die_impossible_paction;
model->action_cancel = void_die_impossible_paction;
model->action_recycle = void_die_impossible_paction;
model->action_cancel = void_die_impossible_paction;
model->action_recycle = void_die_impossible_paction;
THROW_UNIMPLEMENTED; /* This model does not implement parallel tasks */
}
THROW_UNIMPLEMENTED; /* This model does not implement parallel tasks */
}
-static int action_free(surf_action_t action)
+static int action_unref(surf_action_t action)
{
if (action->model_type == surf_network_model)
{
if (action->model_type == surf_network_model)
- return surf_network_model->action_free(action);
+ return surf_network_model->action_unref(action);
else if (action->model_type == surf_cpu_model)
else if (action->model_type == surf_cpu_model)
- return surf_cpu_model->action_free(action);
+ return surf_cpu_model->action_unref(action);
else if (action->model_type == surf_workstation_model)
return parallel_action_free(action);
else
else if (action->model_type == surf_workstation_model)
return parallel_action_free(action);
else
-static void action_use(surf_action_t action)
+static void action_ref(surf_action_t action)
{
if (action->model_type == surf_network_model)
{
if (action->model_type == surf_network_model)
- surf_network_model->action_use(action);
+ surf_network_model->action_ref(action);
else if (action->model_type == surf_cpu_model)
else if (action->model_type == surf_cpu_model)
- surf_cpu_model->action_use(action);
+ surf_cpu_model->action_ref(action);
else if (action->model_type == surf_workstation_model)
parallel_action_use(action);
else
else if (action->model_type == surf_workstation_model)
parallel_action_use(action);
else
surf_workstation_model = surf_model_init();
surf_workstation_model->name = "Workstation";
surf_workstation_model = surf_model_init();
surf_workstation_model->name = "Workstation";
- surf_workstation_model->action_free = action_free;
- surf_workstation_model->action_use = action_use;
+ surf_workstation_model->action_unref = action_unref;
+ surf_workstation_model->action_ref = action_ref;
surf_workstation_model->action_cancel = action_cancel;
surf_workstation_model->action_state_set = ws_action_state_set;
surf_workstation_model->action_cancel = action_cancel;
surf_workstation_model->action_state_set = ws_action_state_set;
/* action_get_state is inherited from the surf module */
/* action_get_state is inherited from the surf module */
-static void action_use(surf_action_t action)
+static void action_ref(surf_action_t action)
{
action->refcount++;
return;
}
{
action->refcount++;
return;
}
-static int action_free(surf_action_t action)
+static int action_unref(surf_action_t action)
{
surf_workstation_model = surf_model_init();
{
surf_workstation_model = surf_model_init();
- surf_workstation_model->action_use = action_use;
- surf_workstation_model->action_free = action_free;
+ surf_workstation_model->action_ref = action_ref;
+ surf_workstation_model->action_unref = action_unref;
surf_workstation_model->action_cancel = action_cancel;
surf_workstation_model->action_state_set = surf_action_state_set;
surf_workstation_model->suspend = action_suspend;
surf_workstation_model->action_cancel = action_cancel;
surf_workstation_model->action_state_set = surf_action_state_set;
surf_workstation_model->suspend = action_suspend;
xbt_swag_extract(surf_cpu_model->common_public->
states.failed_action_set))) {
DEBUG1("\t * Failed : %p", action);
xbt_swag_extract(surf_cpu_model->common_public->
states.failed_action_set))) {
DEBUG1("\t * Failed : %p", action);
- action->model_type->common_public->action_free(action);
+ action->model_type->common_public->action_unref(action);
}
while ((action =
xbt_swag_extract(surf_cpu_model->common_public->
states.done_action_set))) {
DEBUG1("\t * Done : %p", action);
}
while ((action =
xbt_swag_extract(surf_cpu_model->common_public->
states.done_action_set))) {
DEBUG1("\t * Done : %p", action);
- action->model_type->common_public->action_free(action);
+ action->model_type->common_public->action_unref(action);
}
DEBUG0("\t Network actions");
while ((action =
xbt_swag_extract(surf_network_model->common_public->
states.failed_action_set))) {
DEBUG1("\t * Failed : %p", action);
}
DEBUG0("\t Network actions");
while ((action =
xbt_swag_extract(surf_network_model->common_public->
states.failed_action_set))) {
DEBUG1("\t * Failed : %p", action);
- action->model_type->common_public->action_free(action);
+ action->model_type->common_public->action_unref(action);
}
while ((action =
xbt_swag_extract(surf_network_model->common_public->
states.done_action_set))) {
DEBUG1("\t * Done : %p", action);
}
while ((action =
xbt_swag_extract(surf_network_model->common_public->
states.done_action_set))) {
DEBUG1("\t * Done : %p", action);
- action->model_type->common_public->action_free(action);
+ action->model_type->common_public->action_unref(action);
}
} while (surf_solve() >= 0.0);
}
} while (surf_solve() >= 0.0);
xbt_swag_extract(model->common_public->
states.failed_action_set))) {
DEBUG1("\t * Failed : %p", action);
xbt_swag_extract(model->common_public->
states.failed_action_set))) {
DEBUG1("\t * Failed : %p", action);
- model->common_public->action_free(action);
+ model->common_public->action_unref(action);
}
while ((action =
xbt_swag_extract(model->common_public->
states.done_action_set))) {
DEBUG1("\t * Done : %p", action);
}
while ((action =
xbt_swag_extract(model->common_public->
states.done_action_set))) {
DEBUG1("\t * Done : %p", action);
- model->common_public->action_free(action);
+ model->common_public->action_unref(action);
}
}
} while (surf_solve() >= 0.0);
}
}
} while (surf_solve() >= 0.0);