X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2c69087d11c54eee924f6870373883d6aa9ff228..47fd440ad6382d295645c81ca4c5c09bd5d51cc6:/src/simix/popping_bodies.c diff --git a/src/simix/popping_bodies.c b/src/simix/popping_bodies.c index a5c3240d31..a5fa70d259 100644 --- a/src/simix/popping_bodies.c +++ b/src/simix/popping_bodies.c @@ -14,7 +14,7 @@ */ #include "smx_private.h" -#include "mc/mc_interface.h" +#include "mc/mc_forward.h" #include "xbt/ex.h" inline static smx_host_t simcall_BODY_host_get_by_name(const char* name) { @@ -923,6 +923,29 @@ inline static void simcall_BODY_vm_restore(smx_host_t ind_vm) { } +inline static void simcall_BODY_vm_migratefrom_resumeto(smx_host_t vm, smx_host_t src_pm, smx_host_t dst_pm) { + smx_process_t self = SIMIX_process_self(); + + /* Go to that function to follow the code flow through the simcall barrier */ + if (0) SIMIX_vm_migratefrom_resumeto(vm, src_pm, dst_pm); + /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ + + self->simcall.call = SIMCALL_VM_MIGRATEFROM_RESUMETO; + memset(&self->simcall.result, 0, sizeof(self->simcall.result)); + memset(self->simcall.args, 0, sizeof(self->simcall.args)); + self->simcall.args[0].dp = (void*) vm; + self->simcall.args[1].dp = (void*) src_pm; + self->simcall.args[2].dp = (void*) dst_pm; + if (self != simix_global->maestro_process) { + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); + SIMIX_process_yield(self); + } else { + SIMIX_simcall_handle(&self->simcall, 0); + } + + } + inline static void simcall_BODY_process_create(smx_process_t* process, const char* name, xbt_main_func_t code, void* data, const char* hostname, double kill_time, int argc, char** argv, xbt_dict_t properties, int auto_restart) { smx_process_t self = SIMIX_process_self(); @@ -2609,19 +2632,19 @@ inline static int simcall_BODY_mc_random(int min, int max) { } return self->simcall.result.i; } -#ifdef HAVE_LATENCY_BOUND_TRACKING -inline static int simcall_BODY_comm_is_latency_bounded(smx_synchro_t comm) { +inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* category) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_comm_is_latency_bounded(comm); + if (0) SIMIX_set_category(synchro, category); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_COMM_IS_LATENCY_BOUNDED; + self->simcall.call = SIMCALL_SET_CATEGORY; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) comm; + self->simcall.args[0].dp = (void*) synchro; + self->simcall.args[1].cc = (const char*) category; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -2629,24 +2652,21 @@ inline static int simcall_BODY_comm_is_latency_bounded(smx_synchro_t comm) { } else { SIMIX_simcall_handle(&self->simcall, 0); } - return self->simcall.result.i; + } -#endif - -#ifdef HAVE_TRACING +#ifdef HAVE_LATENCY_BOUND_TRACKING -inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* category) { +inline static int simcall_BODY_comm_is_latency_bounded(smx_synchro_t comm) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_set_category(synchro, category); + if (0) SIMIX_comm_is_latency_bounded(comm); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_SET_CATEGORY; + self->simcall.call = SIMCALL_COMM_IS_LATENCY_BOUNDED; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) synchro; - self->simcall.args[1].cc = (const char*) category; + self->simcall.args[0].dp = (void*) comm; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -2654,7 +2674,7 @@ inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* } else { SIMIX_simcall_handle(&self->simcall, 0); } - + return self->simcall.result.i; } #endif