From d6fc96fb24bb0006584d44bee70df5f67b37f5fb Mon Sep 17 00:00:00 2001 From: Cristian Rosa Date: Wed, 10 Oct 2012 11:54:56 -0300 Subject: [PATCH] Make SimGrid compile again :) --- src/simix/smx_host.c | 3 ++- src/simix/smx_host_private.h | 2 +- src/simix/smx_smurf.c | 5 +++-- src/simix/smx_smurf_private.h | 2 ++ src/simix/smx_user.c | 6 +++++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/simix/smx_host.c b/src/simix/smx_host.c index 1984381f79..c3c6546fb4 100644 --- a/src/simix/smx_host.c +++ b/src/simix/smx_host.c @@ -419,7 +419,8 @@ void SIMIX_host_execution_set_priority(u_smx_scalar_t *args) void SIMIX_pre_host_execution_wait(u_smx_scalar_t *args) { - smx_action_t action = args[0].p; + smx_simcall_t simcall = args[0].p; + smx_action_t action = args[1].p; XBT_DEBUG("Wait for execution of action %p, state %d", action, (int)action->state); diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 9a0ec79691..1399100115 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -38,7 +38,7 @@ xbt_dict_t SIMIX_host_get_properties(u_smx_scalar_t *args); double SIMIX_host_get_speed(u_smx_scalar_t *args); double SIMIX_host_get_available_speed(u_smx_scalar_t *args); int SIMIX_host_get_state(u_smx_scalar_t *args); -smx_action_t SIMIX_host_execute(smx_process_t issuer, u_smx_scalar_t *args); +smx_action_t SIMIX_host_execute(u_smx_scalar_t *args); smx_action_t SIMIX_host_parallel_execute(u_smx_scalar_t *args); void SIMIX_host_execution_destroy(u_smx_scalar_t *args); void SIMIX_host_execution_cancel(u_smx_scalar_t *args); diff --git a/src/simix/smx_smurf.c b/src/simix/smx_smurf.c index 4471f1622f..366897ab11 100644 --- a/src/simix/smx_smurf.c +++ b/src/simix/smx_smurf.c @@ -267,7 +267,7 @@ void SIMIX_simcall_pre(smx_simcall_t simcall, int value) break; case SIMCALL_HOST_SET_DATA: - SIMIX_host_set_data(simcall->host_set_data.host, simcall->host_set_data.data); + SIMIX_host_set_data(SIMIX_pack_args(PTR(simcall->host_set_data.host), PTR(simcall->host_set_data.data))); SIMIX_simcall_answer(simcall); break; @@ -647,7 +647,8 @@ void __SIMIX_simcall(e_smx_simcall_t simcall_id, u_smx_scalar_t *args) /* New Simcal interface */ /* FIXME: add types for every simcall */ -const char *simcall_types[NUM_SIMCALLS] = { [SIMCALL_HOST_EXECUTE] = "%s%p%f%f%p" }; +const char *simcall_types[NUM_SIMCALLS] = { [SIMCALL_HOST_EXECUTE] = "%s%p%f%f%p", [SIMCALL_HOST_EXECUTION_WAIT] = "%p%p" }; + simcall_handler_t simcall_table[NUM_SIMCALLS] = { #undef SIMCALL_ENUM_ELEMENT diff --git a/src/simix/smx_smurf_private.h b/src/simix/smx_smurf_private.h index 6d3d645c40..61b606c635 100644 --- a/src/simix/smx_smurf_private.h +++ b/src/simix/smx_smurf_private.h @@ -242,7 +242,9 @@ typedef struct s_smx_simcall { struct { smx_action_t execution; + struct s_smx_simcall *simcall; e_smx_state_t result; + } host_execution_wait; struct { diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c index d019078c51..3331b4610b 100644 --- a/src/simix/smx_user.c +++ b/src/simix/smx_user.c @@ -383,9 +383,13 @@ e_smx_state_t simcall_host_execution_wait(smx_action_t execution) simcall->call = SIMCALL_HOST_EXECUTION_WAIT; simcall->host_execution_wait.execution = execution; + simcall->host_execution_wait.simcall = simcall; + + SIMIX_simcall(SIMCALL_HOST_EXECUTION_WAIT, PTR(simcall), PTR(execution)); + if(MC_is_active()) /* Initialize result to a default value for snapshot comparison done during simcall */ simcall->host_execution_wait.result = -1; - SIMIX_simcall_push(simcall->issuer); + return simcall->host_execution_wait.result; } -- 2.20.1