X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/83eac0d2fba299311b07779b4de686124ce0905b..d17f206ea75d3cccc5f1b83b67f58d4fe87781d1:/src/simix/popping_bodies.cpp diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index 8f7a88037f..8f88cb1dbe 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -14,9 +14,10 @@ */ #include "smx_private.h" -#include "src/mc/mc_forward.h" +#include "src/mc/mc_forward.hpp" #include "xbt/ex.h" #include +/** @cond */ // Please Doxygen, don't look at this inline static void simcall_BODY_vm_suspend(sg_host_t ind_vm) { smx_process_t self = SIMIX_process_self(); @@ -30,7 +31,7 @@ inline static void simcall_BODY_vm_suspend(sg_host_t ind_vm) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) ind_vm; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -51,7 +52,7 @@ inline static void simcall_BODY_vm_resume(sg_host_t ind_vm) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) ind_vm; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -72,7 +73,7 @@ inline static void simcall_BODY_vm_shutdown(sg_host_t ind_vm) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) ind_vm; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -93,7 +94,7 @@ inline static void simcall_BODY_vm_save(sg_host_t ind_vm) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) ind_vm; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -114,7 +115,7 @@ inline static void simcall_BODY_vm_restore(sg_host_t ind_vm) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) ind_vm; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -143,7 +144,7 @@ inline static void* simcall_BODY_process_create(const char* name, xbt_main_func_ self->simcall.args[7].dp = (void*) properties; self->simcall.args[8].i = (int) auto_restart; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -164,7 +165,7 @@ inline static void simcall_BODY_process_kill(smx_process_t process) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) process; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -185,7 +186,7 @@ inline static void simcall_BODY_process_killall(int reset_pid) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].i = (int) reset_pid; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -206,7 +207,7 @@ inline static void simcall_BODY_process_cleanup(smx_process_t process) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) process; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -227,7 +228,7 @@ inline static void simcall_BODY_process_suspend(smx_process_t process) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) process; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -248,7 +249,7 @@ inline static void simcall_BODY_process_resume(smx_process_t process) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) process; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -270,7 +271,7 @@ inline static void simcall_BODY_process_set_host(smx_process_t process, sg_host_ self->simcall.args[0].dp = (void*) process; self->simcall.args[1].dp = (void*) dest; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -291,7 +292,7 @@ inline static int simcall_BODY_process_is_suspended(smx_process_t process) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) process; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -313,7 +314,7 @@ inline static int simcall_BODY_process_join(smx_process_t process, double timeou self->simcall.args[0].dp = (void*) process; self->simcall.args[1].d = (double) timeout; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -334,7 +335,7 @@ inline static int simcall_BODY_process_sleep(double duration) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].d = (double) duration; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -359,7 +360,7 @@ inline static smx_synchro_t simcall_BODY_execution_start(const char* name, doubl self->simcall.args[3].d = (double) bound; self->simcall.args[4].ul = (unsigned long) affinity_mask; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -386,7 +387,7 @@ inline static smx_synchro_t simcall_BODY_execution_parallel_start(const char* na self->simcall.args[5].d = (double) amount; self->simcall.args[6].d = (double) rate; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -395,27 +396,6 @@ inline static smx_synchro_t simcall_BODY_execution_parallel_start(const char* na return (smx_synchro_t) self->simcall.result.dp; } -inline static void simcall_BODY_execution_destroy(smx_synchro_t execution) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_execution_destroy(execution); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_EXECUTION_DESTROY; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) execution; - 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_execution_cancel(smx_synchro_t execution) { smx_process_t self = SIMIX_process_self(); @@ -428,7 +408,7 @@ inline static void simcall_BODY_execution_cancel(smx_synchro_t execution) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) execution; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -437,48 +417,6 @@ inline static void simcall_BODY_execution_cancel(smx_synchro_t execution) { } -inline static double simcall_BODY_execution_get_remains(smx_synchro_t execution) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_execution_get_remains(execution); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_EXECUTION_GET_REMAINS; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) execution; - 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); - } - return (double) self->simcall.result.d; - } - -inline static e_smx_state_t simcall_BODY_execution_get_state(smx_synchro_t execution) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_execution_get_state(execution); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_EXECUTION_GET_STATE; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) execution; - 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); - } - return (e_smx_state_t) self->simcall.result.i; - } - inline static void simcall_BODY_execution_set_priority(smx_synchro_t execution, double priority) { smx_process_t self = SIMIX_process_self(); @@ -492,7 +430,7 @@ inline static void simcall_BODY_execution_set_priority(smx_synchro_t execution, self->simcall.args[0].dp = (void*) execution; self->simcall.args[1].d = (double) priority; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -514,7 +452,7 @@ inline static void simcall_BODY_execution_set_bound(smx_synchro_t execution, dou self->simcall.args[0].dp = (void*) execution; self->simcall.args[1].d = (double) bound; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -537,7 +475,7 @@ inline static void simcall_BODY_execution_set_affinity(smx_synchro_t execution, self->simcall.args[1].dp = (void*) ws; self->simcall.args[2].ul = (unsigned long) mask; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -558,7 +496,7 @@ inline static int simcall_BODY_execution_wait(smx_synchro_t execution) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) execution; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -581,7 +519,7 @@ inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvo self->simcall.args[1].fp = (FPtr) fun; self->simcall.args[2].dp = (void*) data; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -603,7 +541,7 @@ inline static void simcall_BODY_process_auto_restart_set(smx_process_t process, self->simcall.args[0].dp = (void*) process; self->simcall.args[1].i = (int) auto_restart; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -624,7 +562,7 @@ inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) process; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -633,105 +571,41 @@ inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) return (smx_process_t) self->simcall.result.dp; } -inline static smx_rdv_t simcall_BODY_rdv_create(const char* name) { +inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_create(name); + if (0) SIMIX_mbox_create(name); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_RDV_CREATE; + self->simcall.call = SIMCALL_MBOX_CREATE; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].cc = (const char*) name; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { SIMIX_simcall_handle(&self->simcall, 0); } - return (smx_rdv_t) self->simcall.result.dp; + return (smx_mailbox_t) self->simcall.result.dp; } -inline static void simcall_BODY_rdv_destroy(smx_rdv_t rdv) { +inline static void simcall_BODY_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t receiver) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_destroy(rdv); + if (0) SIMIX_mbox_set_receiver(mbox, receiver); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_RDV_DESTROY; + self->simcall.call = SIMCALL_MBOX_SET_RECEIVER; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; - 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 unsigned int simcall_BODY_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_comm_count_by_host(rdv, host); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_RDV_COMM_COUNT_BY_HOST; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; - self->simcall.args[1].dp = (void*) host; - 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); - } - return (unsigned int) self->simcall.result.ui; - } - -inline static smx_synchro_t simcall_BODY_rdv_get_head(smx_rdv_t rdv) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_get_head(rdv); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_RDV_GET_HEAD; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; - 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); - } - return (smx_synchro_t) self->simcall.result.dp; - } - -inline static void simcall_BODY_rdv_set_receiver(smx_rdv_t rdv, smx_process_t receiver) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_set_receiver(rdv, receiver); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_RDV_SET_RECEIVER; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; + self->simcall.args[0].dp = (void*) mbox; self->simcall.args[1].dp = (void*) receiver; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -740,45 +614,24 @@ inline static void simcall_BODY_rdv_set_receiver(smx_rdv_t rdv, smx_process_t re } -inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_rdv_t rdv) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_get_receiver(rdv); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_RDV_GET_RECEIVER; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; - 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); - } - return (smx_process_t) self->simcall.result.dp; - } - -inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_rdv_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data) { +inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_iprobe(&self->simcall, rdv, type, src, tag, match_fun, data); + if (0) simcall_HANDLER_comm_iprobe(&self->simcall, mbox, type, src, tag, match_fun, data); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_IPROBE; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; + self->simcall.args[0].dp = (void*) mbox; self->simcall.args[1].i = (int) type; self->simcall.args[2].i = (int) src; self->simcall.args[3].i = (int) tag; self->simcall.args[4].fp = (FPtr) match_fun; self->simcall.args[5].dp = (void*) data; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -787,18 +640,18 @@ inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_rdv_t rdv, int type, in return (smx_synchro_t) self->simcall.result.dp; } -inline static void simcall_BODY_comm_send(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) { +inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_send(&self->simcall, sender, rdv, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout); + if (0) simcall_HANDLER_comm_send(&self->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_SEND; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) sender; - self->simcall.args[1].dp = (void*) rdv; + self->simcall.args[1].dp = (void*) mbox; self->simcall.args[2].d = (double) task_size; self->simcall.args[3].d = (double) rate; self->simcall.args[4].dp = (void*) src_buff; @@ -808,7 +661,7 @@ inline static void simcall_BODY_comm_send(smx_process_t sender, smx_rdv_t rdv, d self->simcall.args[8].dp = (void*) data; self->simcall.args[9].d = (double) timeout; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -817,18 +670,18 @@ inline static void simcall_BODY_comm_send(smx_process_t sender, smx_rdv_t rdv, d } -inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) { +inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_isend(&self->simcall, sender, rdv, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); + if (0) simcall_HANDLER_comm_isend(&self->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_ISEND; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) sender; - self->simcall.args[1].dp = (void*) rdv; + self->simcall.args[1].dp = (void*) mbox; self->simcall.args[2].d = (double) task_size; self->simcall.args[3].d = (double) rate; self->simcall.args[4].dp = (void*) src_buff; @@ -839,7 +692,7 @@ inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_rd self->simcall.args[9].dp = (void*) data; self->simcall.args[10].i = (int) detached; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -848,18 +701,18 @@ inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_rd return (smx_synchro_t) self->simcall.result.dp; } -inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) { +inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_recv(&self->simcall, receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate); + if (0) simcall_HANDLER_comm_recv(&self->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_RECV; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) receiver; - self->simcall.args[1].dp = (void*) rdv; + self->simcall.args[1].dp = (void*) mbox; self->simcall.args[2].dp = (void*) dst_buff; self->simcall.args[3].dp = (void*) dst_buff_size; self->simcall.args[4].fp = (FPtr) match_fun; @@ -868,7 +721,7 @@ inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_rdv_t rdv, self->simcall.args[7].d = (double) timeout; self->simcall.args[8].d = (double) rate; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -877,18 +730,18 @@ inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_rdv_t rdv, } -inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) { +inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_irecv(&self->simcall, receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); + if (0) simcall_HANDLER_comm_irecv(&self->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_IRECV; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) receiver; - self->simcall.args[1].dp = (void*) rdv; + self->simcall.args[1].dp = (void*) mbox; self->simcall.args[2].dp = (void*) dst_buff; self->simcall.args[3].dp = (void*) dst_buff_size; self->simcall.args[4].fp = (FPtr) match_fun; @@ -896,7 +749,7 @@ inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_ self->simcall.args[6].dp = (void*) data; self->simcall.args[7].d = (double) rate; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -905,27 +758,6 @@ inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_ return (smx_synchro_t) self->simcall.result.dp; } -inline static void simcall_BODY_comm_cancel(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_comm_cancel(comm); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_COMM_CANCEL; - 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; - 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 int simcall_BODY_comm_waitany(xbt_dynar_t comms) { smx_process_t self = SIMIX_process_self(); @@ -938,7 +770,7 @@ inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) comms; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -960,7 +792,7 @@ inline static void simcall_BODY_comm_wait(smx_synchro_t comm, double timeout) { self->simcall.args[0].dp = (void*) comm; self->simcall.args[1].d = (double) timeout; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -981,7 +813,7 @@ inline static int simcall_BODY_comm_test(smx_synchro_t comm) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) comm; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1002,7 +834,7 @@ inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) comms; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1011,132 +843,6 @@ inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) { return (int) self->simcall.result.i; } -inline static double simcall_BODY_comm_get_remains(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_comm_get_remains(comm); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_COMM_GET_REMAINS; - 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; - 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); - } - return (double) self->simcall.result.d; - } - -inline static e_smx_state_t simcall_BODY_comm_get_state(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_comm_get_state(comm); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_COMM_GET_STATE; - 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; - 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); - } - return (e_smx_state_t) self->simcall.result.i; - } - -inline static void* simcall_BODY_comm_get_src_data(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_comm_get_src_data(comm); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_COMM_GET_SRC_DATA; - 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; - 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); - } - return (void*) self->simcall.result.dp; - } - -inline static void* simcall_BODY_comm_get_dst_data(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_comm_get_dst_data(comm); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_COMM_GET_DST_DATA; - 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; - 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); - } - return (void*) self->simcall.result.dp; - } - -inline static smx_process_t simcall_BODY_comm_get_src_proc(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_comm_get_src_proc(comm); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_COMM_GET_SRC_PROC; - 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; - 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); - } - return (smx_process_t) self->simcall.result.dp; - } - -inline static smx_process_t simcall_BODY_comm_get_dst_proc(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_comm_get_dst_proc(comm); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_COMM_GET_DST_PROC; - 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; - 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); - } - return (smx_process_t) self->simcall.result.dp; - } - inline static smx_mutex_t simcall_BODY_mutex_init() { smx_process_t self = SIMIX_process_self(); @@ -1149,7 +855,7 @@ inline static smx_mutex_t simcall_BODY_mutex_init() { memset(self->simcall.args, 0, sizeof(self->simcall.args)); if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1170,7 +876,7 @@ inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) mutex; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1191,7 +897,7 @@ inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) mutex; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1212,7 +918,7 @@ inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) mutex; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1233,7 +939,7 @@ inline static smx_cond_t simcall_BODY_cond_init() { memset(self->simcall.args, 0, sizeof(self->simcall.args)); if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1254,7 +960,7 @@ inline static void simcall_BODY_cond_signal(smx_cond_t cond) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) cond; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1276,7 +982,7 @@ inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) { self->simcall.args[0].dp = (void*) cond; self->simcall.args[1].dp = (void*) mutex; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1299,7 +1005,7 @@ inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t m self->simcall.args[1].dp = (void*) mutex; self->simcall.args[2].d = (double) timeout; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1320,7 +1026,7 @@ inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) cond; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1341,7 +1047,7 @@ inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].ui = (unsigned int) capacity; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1362,7 +1068,7 @@ inline static void simcall_BODY_sem_release(smx_sem_t sem) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) sem; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1383,7 +1089,7 @@ inline static int simcall_BODY_sem_would_block(smx_sem_t sem) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) sem; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1404,7 +1110,7 @@ inline static void simcall_BODY_sem_acquire(smx_sem_t sem) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) sem; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1426,7 +1132,7 @@ inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeou self->simcall.args[0].dp = (void*) sem; self->simcall.args[1].d = (double) timeout; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1447,7 +1153,7 @@ inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) sem; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1470,7 +1176,7 @@ inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size, sg self->simcall.args[1].sgsz = (sg_size_t) size; self->simcall.args[2].dp = (void*) host; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1493,7 +1199,7 @@ inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size, s self->simcall.args[1].sgsz = (sg_size_t) size; self->simcall.args[2].dp = (void*) host; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1515,7 +1221,7 @@ inline static smx_file_t simcall_BODY_file_open(const char* fullpath, sg_host_t self->simcall.args[0].cc = (const char*) fullpath; self->simcall.args[1].dp = (void*) host; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1537,7 +1243,7 @@ inline static int simcall_BODY_file_close(smx_file_t fd, sg_host_t host) { self->simcall.args[0].dp = (void*) fd; self->simcall.args[1].dp = (void*) host; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1559,7 +1265,7 @@ inline static int simcall_BODY_file_unlink(smx_file_t fd, sg_host_t host) { self->simcall.args[0].dp = (void*) fd; self->simcall.args[1].dp = (void*) host; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1580,7 +1286,7 @@ inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) fd; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1601,7 +1307,7 @@ inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) fd; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1624,7 +1330,7 @@ inline static int simcall_BODY_file_seek(smx_file_t fd, sg_offset_t offset, int self->simcall.args[1].sgoff = (sg_offset_t) offset; self->simcall.args[2].i = (int) origin; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1645,7 +1351,7 @@ inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) fd; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1667,7 +1373,7 @@ inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) { self->simcall.args[0].dp = (void*) fd; self->simcall.args[1].cc = (const char*) fullpath; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1688,7 +1394,7 @@ inline static sg_size_t simcall_BODY_storage_get_free_size(smx_storage_t storage memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) storage; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1709,7 +1415,7 @@ inline static sg_size_t simcall_BODY_storage_get_used_size(smx_storage_t name) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) name; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1730,7 +1436,7 @@ inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t stora memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) storage; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1751,7 +1457,7 @@ inline static xbt_dict_t simcall_BODY_storage_get_content(smx_storage_t storage) memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) storage; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1772,7 +1478,7 @@ inline static xbt_dict_t simcall_BODY_asr_get_properties(const char* name) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].cc = (const char*) name; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1794,7 +1500,7 @@ inline static int simcall_BODY_mc_random(int min, int max) { self->simcall.args[0].i = (int) min; self->simcall.args[1].i = (int) max; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1816,7 +1522,7 @@ inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* 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, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { @@ -1837,80 +1543,11 @@ inline static void simcall_BODY_run_kernel(void* code) { memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) code; if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(), SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); SIMIX_process_yield(self); } else { SIMIX_simcall_handle(&self->simcall, 0); } - } -#ifdef HAVE_LATENCY_BOUND_TRACKING - -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_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_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*) 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); - SIMIX_process_yield(self); - } else { - SIMIX_simcall_handle(&self->simcall, 0); - } - return (int) self->simcall.result.i; - } -#endif - -#ifdef HAVE_MC - -inline static mc_snapshot_t simcall_BODY_mc_snapshot() { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_mc_snapshot(&self->simcall); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_MC_SNAPSHOT; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - - 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); - } - return (mc_snapshot_t) self->simcall.result.dp; - } - -inline static int simcall_BODY_mc_compare_snapshots(mc_snapshot_t s1, mc_snapshot_t s2) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_mc_compare_snapshots(&self->simcall, s1, s2); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_MC_COMPARE_SNAPSHOTS; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) s1; - self->simcall.args[1].dp = (void*) s2; - 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); - } - return (int) self->simcall.result.i; - } -#endif + }/** @endcond */