summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5d0e923)
This avoids a call to SIMIX_req_host_execution_get_state right afterwards.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9519
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
XBT_PUBLIC(double) SIMIX_req_host_execution_get_remains(smx_action_t execution);
XBT_PUBLIC(e_smx_state_t) SIMIX_req_host_execution_get_state(smx_action_t execution);
XBT_PUBLIC(void) SIMIX_req_host_execution_set_priority(smx_action_t execution, double priority);
XBT_PUBLIC(double) SIMIX_req_host_execution_get_remains(smx_action_t execution);
XBT_PUBLIC(e_smx_state_t) SIMIX_req_host_execution_get_state(smx_action_t execution);
XBT_PUBLIC(void) SIMIX_req_host_execution_set_priority(smx_action_t execution, double priority);
-XBT_PUBLIC(void) SIMIX_req_host_execution_wait(smx_action_t execution);
+XBT_PUBLIC(e_smx_state_t) SIMIX_req_host_execution_wait(smx_action_t execution);
/**************************** Process Requests ********************************/
/**************************** Process Requests ********************************/
{
simdata_task_t simdata = NULL;
m_process_t self = MSG_process_self();
{
simdata_task_t simdata = NULL;
m_process_t self = MSG_process_self();
+ e_smx_state_t comp_state;
CHECK_HOST();
simdata = task->simdata;
CHECK_HOST();
simdata = task->simdata;
#endif
self->simdata->waiting_action = simdata->compute;
#endif
self->simdata->waiting_action = simdata->compute;
- SIMIX_req_host_execution_wait(simdata->compute);
+ comp_state = SIMIX_req_host_execution_wait(simdata->compute);
self->simdata->waiting_action = NULL;
simdata->isused=0;
self->simdata->waiting_action = NULL;
simdata->isused=0;
- DEBUG2("Execution task '%s' finished in state %d", task->name, SIMIX_req_host_execution_get_state(task->simdata->compute));
- if (SIMIX_req_host_execution_get_state(task->simdata->compute) == SIMIX_DONE) {
+ DEBUG2("Execution task '%s' finished in state %d", task->name, comp_state);
+ if (comp_state == SIMIX_DONE) {
/* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
SIMIX_req_host_execution_destroy(task->simdata->compute);
simdata->computation_amount = 0.0;
/* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
SIMIX_req_host_execution_destroy(task->simdata->compute);
simdata->computation_amount = 0.0;
struct {
smx_action_t execution;
struct {
smx_action_t execution;
} host_execution_wait;
struct {
} host_execution_wait;
struct {
THROW_IMPOSSIBLE;
}
req->issuer->waiting_action = NULL;
THROW_IMPOSSIBLE;
}
req->issuer->waiting_action = NULL;
+ req->host_execution_wait.result = action->state;
SIMIX_request_answer(req);
}
}
SIMIX_request_answer(req);
}
}
*
* \param execution The execution action
*/
*
* \param execution The execution action
*/
-void SIMIX_req_host_execution_wait(smx_action_t execution)
+e_smx_state_t SIMIX_req_host_execution_wait(smx_action_t execution)
{
smx_req_t req = SIMIX_req_mine();
req->call = REQ_HOST_EXECUTION_WAIT;
req->host_execution_wait.execution = execution;
SIMIX_request_push();
{
smx_req_t req = SIMIX_req_mine();
req->call = REQ_HOST_EXECUTION_WAIT;
req->host_execution_wait.execution = execution;
SIMIX_request_push();
+ return req->host_execution_wait.result;