X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4f4cb779caf18adeed31e284cfc8ac45198b816a..d155fd69fa99c97b3a9c86bb7f2e472c2e7332df:/src/simix/smx_user.c?ds=sidebyside diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c index b3bcde9216..06c52c9cb8 100644 --- a/src/simix/smx_user.c +++ b/src/simix/smx_user.c @@ -295,9 +295,10 @@ void* simcall_vm_create(const char *name, smx_host_t phys_host){ * * \param vm VM */ -void simcall_vm_start(smx_host_t vm) { - /* will jump to SIMIX_pre_vm_get_state in src/simix/smx_smurf_private.h */ - simcall_BODY_vm_set_state(vm, msg_vm_state_running); +void simcall_vm_start(smx_host_t vm) +{ + /* will jump to SIMIX_pre_vm_start in src/simix/smx_smurf_private.h */ + simcall_BODY_vm_start(vm); } /** @@ -320,10 +321,22 @@ int simcall_vm_get_state(smx_host_t vm) * \param vm VM * \return The name of the physical host */ -const char *simcall_vm_get_phys_host(smx_host_t vm) +void *simcall_vm_get_pm(smx_host_t vm) { /* will jump to SIMIX_pre_vm_migrate in src/simix/smx_smurf_private.h */ - simcall_BODY_vm_get_phys_host(vm); + return simcall_BODY_vm_get_pm(vm); +} + +void simcall_host_get_params(smx_host_t vm, ws_params_t params) +{ + /* will jump to SIMIX_pre_host_get_params in src/simix/smx_smurf_private.h */ + simcall_BODY_host_get_params(vm, params); +} + +void simcall_host_set_params(smx_host_t vm, ws_params_t params) +{ + /* will jump to SIMIX_pre_host_set_params in src/simix/smx_smurf_private.h */ + simcall_BODY_host_set_params(vm, params); } /** @@ -745,7 +758,7 @@ smx_rdv_t simcall_rdv_get_by_name(const char *name) { xbt_assert(name != NULL, "Invalid parameter for simcall_rdv_get_by_name (name is NULL)"); - /* FIXME: this is a horrible lost of performance, so we hack it out by + /* FIXME: this is a horrible loss of performance, so we hack it out by * skipping the simcall (for now). It works in parallel, it won't work on * distributed but probably we will change MSG for that. */ @@ -873,6 +886,39 @@ smx_action_t simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_ } +/** + * \ingroup simix_comm_management + */ +void simcall_comm_recv_bounded(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size, + int (*match_fun)(void *, void *, smx_action_t), void *data, double timeout, double rate) +{ + xbt_assert(isfinite(timeout), "timeout is not finite!"); + xbt_assert(rdv, "No rendez-vous point defined for recv"); + + if (MC_is_active()) { + /* the model-checker wants two separate simcalls */ + smx_action_t comm = simcall_comm_irecv_bounded(rdv, dst_buff, dst_buff_size, + match_fun, data, rate); + simcall_comm_wait(comm, timeout); + } + else { + simcall_BODY_comm_recv_bounded(rdv, dst_buff, dst_buff_size, + match_fun, data, timeout, rate); + } +} +/** + * \ingroup simix_comm_management + */ +smx_action_t simcall_comm_irecv_bounded(smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, + int (*match_fun)(void *, void *, smx_action_t), void *data, double rate) +{ + xbt_assert(rdv, "No rendez-vous point defined for irecv"); + + return simcall_BODY_comm_irecv_bounded(rdv, dst_buff, dst_buff_size, + match_fun, data, rate); +} + + /** * \ingroup simix_comm_management */ @@ -1266,6 +1312,12 @@ int simcall_mc_compare_snapshots(void *s1, void *s2){ return simcall_BODY_mc_compare_snapshots(s1, s2); } +int simcall_mc_random(void) +{ + return simcall_BODY_mc_random(); +} + + #endif /* HAVE_MC */ /* ****************************************************************************************** */