smx_action_t act;
/* check if the host is active */
- if (surf_workstation_model->extension.
- workstation.get_state(sender->host) != SURF_RESOURCE_ON) {
+ if (surf_workstation_model->extension.workstation.get_state(sender->host) !=
+ SURF_RESOURCE_ON) {
THROW1(network_error, 0, "Host %s failed, you cannot call this function",
sender->name);
}
- if (surf_workstation_model->extension.
- workstation.get_state(receiver->host) != SURF_RESOURCE_ON) {
+ if (surf_workstation_model->extension.workstation.
+ get_state(receiver->host) != SURF_RESOURCE_ON) {
THROW1(network_error, 0, "Host %s failed, you cannot call this function",
receiver->name);
}
act->surf_action =
- surf_workstation_model->extension.workstation.
- communicate(sender->host, receiver->host, size, rate);
+ surf_workstation_model->extension.workstation.communicate(sender->host,
+ receiver->host,
+ size, rate);
surf_workstation_model->action_data_set(act->surf_action, act);
DEBUG1("Create communicate action %p", act);
smx_action_t act;
/* check if the host is active */
- if (surf_workstation_model->extension.
- workstation.get_state(host->host) != SURF_RESOURCE_ON) {
+ if (surf_workstation_model->extension.workstation.get_state(host->host) !=
+ SURF_RESOURCE_ON) {
THROW1(host_error, 0, "Host %s failed, you cannot call this function",
host->name);
}
/* set communication */
act->surf_action =
- surf_workstation_model->extension.workstation.execute(host->host,
- amount);
+ surf_workstation_model->extension.workstation.execute(host->host, amount);
surf_workstation_model->action_data_set(act->surf_action, act);
smx_action_t act;
/* check if the host is active */
- if (surf_workstation_model->extension.
- workstation.get_state(host->host) != SURF_RESOURCE_ON) {
+ if (surf_workstation_model->extension.workstation.get_state(host->host) !=
+ SURF_RESOURCE_ON) {
THROW1(host_error, 0, "Host %s failed, you cannot call this function",
host->name);
}
act->name = xbt_strdup(name);
act->surf_action =
- surf_workstation_model->extension.workstation.sleep(host->host,
- duration);
+ surf_workstation_model->extension.workstation.sleep(host->host, duration);
surf_workstation_model->action_data_set(act->surf_action, act);
{
xbt_assert0((action != NULL), "Invalid parameter");
- surf_workstation_model->set_priority(action->surf_action,
- priority);
+ surf_workstation_model->set_priority(action->surf_action, priority);
return;
}
* \param action SIMIX action
* \param cond SIMIX cond
*/
-void SIMIX_unregister_action_to_condition(smx_action_t action, smx_cond_t cond)
+void SIMIX_unregister_action_to_condition(smx_action_t action,
+ smx_cond_t cond)
{
xbt_assert0((action != NULL) && (cond != NULL), "Invalid parameters");
double SIMIX_action_get_remains(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
- return action->surf_action->remains;
+ return surf_workstation_model->get_remains(action->surf_action);
}
smx_action_t SIMIX_action_parallel_execute(char *name, int host_nb,
workstation_list[i] = host_list[i]->host;
act->surf_action =
- surf_workstation_model->extension.
- workstation.execute_parallel_task(host_nb, workstation_list,
- computation_amount,
- communication_amount, amount, rate);
+ surf_workstation_model->extension.workstation.
+ execute_parallel_task(host_nb, workstation_list, computation_amount,
+ communication_amount, amount, rate);
surf_workstation_model->action_data_set(act->surf_action, act);
e_surf_action_state_t SIMIX_action_get_state(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
- return surf_workstation_model->action_state_get(action->
- surf_action);
+ return surf_workstation_model->action_state_get(action->surf_action);
}
void __SIMIX_cond_display_actions(smx_cond_t cond)
DEBUG1("\t %p", cond);
}
-char * SIMIX_action_get_name(smx_action_t action)
+char *SIMIX_action_get_name(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
return action->name;
{
smx_cond_t cond;
- while((cond = xbt_fifo_pop(action->cond_list)))
+ while ((cond = xbt_fifo_pop(action->cond_list)))
SIMIX_cond_broadcast(cond);
return;