-
- while(MSG_process_is_suspended(t_simdata->sender)) {
- DEBUG1("Oooups, the sender (%s) has been suspended in the meantime. Let's wait for him",
- t_simdata->sender->name);
- m_task_t task_to_wait_for = t_simdata->sender->simdata->waiting_task;
- if(__MSG_process_isBlocked(t_simdata->sender)) {
- DEBUG0("He's blocked. Let's wait for him to go in the suspended state");
- __MSG_process_unblock(t_simdata->sender);
- task_to_wait_for->simdata->using++;
- __MSG_task_wait_event(process, task_to_wait_for);
- MSG_task_destroy(task_to_wait_for);
- } else {
- DEBUG0("He's suspended. Let's wait for him to go in the resumed state");
- task_to_wait_for->simdata->using++;
- __MSG_task_wait_event(process, task_to_wait_for);
- MSG_task_destroy(task_to_wait_for);
- DEBUG0("He's resumed. He should block again. So let's free him.");
- __MSG_process_unblock(t_simdata->sender);
- break;
- }
- }
- DEBUG0("Calling SURF for communication creation");
- t_simdata->comm = surf_workstation_resource->extension_public->
- communicate(MSG_process_get_host(t_simdata->sender)->simdata->host,
- h->simdata->host, t_simdata->message_size,t_simdata->rate);
-
- surf_workstation_resource->common_public->action_set_data(t_simdata->comm,t);
-
- if(__MSG_process_isBlocked(t_simdata->sender)) {
- DEBUG1("Unblocking %s",t_simdata->sender->name);
- __MSG_process_unblock(t_simdata->sender);
+ /* create SIMIX action to the communication */
+ t_simdata->comm =
+ SIMIX_action_communicate(t_simdata->sender->simdata->m_host->
+ simdata->s_host,
+ process->simdata->m_host->simdata->s_host,
+ t->name, t_simdata->message_size,
+ t_simdata->rate);
+ /* if the process is suspend, create the action but stop its execution, it will be restart when the sender process resume */
+ if (MSG_process_is_suspended(t_simdata->sender)) {
+ DEBUG1("Process sender (%s) suspended", t_simdata->sender->name);
+ SIMIX_action_set_priority(t_simdata->comm, 0);