*/
#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) {
return self->simcall.result.i;
}
-inline static void simcall_BODY_host_set_power_peak_at(smx_host_t host, int pstate_index) {
+inline static void simcall_BODY_host_set_pstate(smx_host_t host, int pstate_index) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_set_power_peak_at(host, pstate_index);
+ if (0) SIMIX_host_set_pstate(host, pstate_index);
/* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
- self->simcall.call = SIMCALL_HOST_SET_POWER_PEAK_AT;
+ self->simcall.call = SIMCALL_HOST_SET_PSTATE;
memset(&self->simcall.result, 0, sizeof(self->simcall.result));
memset(self->simcall.args, 0, sizeof(self->simcall.args));
self->simcall.args[0].dp = (void*) host;
}
+inline static int simcall_BODY_host_get_pstate(smx_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_host_get_pstate(host);
+ /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
+
+ self->simcall.call = SIMCALL_HOST_GET_PSTATE;
+ memset(&self->simcall.result, 0, sizeof(self->simcall.result));
+ memset(self->simcall.args, 0, sizeof(self->simcall.args));
+ self->simcall.args[0].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 self->simcall.result.i;
+ }
+
inline static double simcall_BODY_host_get_consumed_energy(smx_host_t host) {
smx_process_t self = SIMIX_process_self();
return self->simcall.result.d;
}
-inline static smx_synchro_t simcall_BODY_host_execute(const char* name, smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask) {
+inline static smx_synchro_t simcall_BODY_host_execute(const char* name, smx_host_t host, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_execute(name, host, computation_amount, priority, bound, affinity_mask);
+ if (0) SIMIX_host_execute(name, host, flops_amount, priority, bound, affinity_mask);
/* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
self->simcall.call = SIMCALL_HOST_EXECUTE;
memset(self->simcall.args, 0, sizeof(self->simcall.args));
self->simcall.args[0].cc = (const char*) name;
self->simcall.args[1].dp = (void*) host;
- self->simcall.args[2].d = (double) computation_amount;
+ self->simcall.args[2].d = (double) flops_amount;
self->simcall.args[3].d = (double) priority;
self->simcall.args[4].d = (double) bound;
self->simcall.args[5].ul = (unsigned long) affinity_mask;
return self->simcall.result.dp;
}
-inline static smx_synchro_t simcall_BODY_host_parallel_execute(const char* name, int host_nb, smx_host_t* host_list, double* computation_amount, double* communication_amount, double amount, double rate) {
+inline static smx_synchro_t simcall_BODY_host_parallel_execute(const char* name, int host_nb, smx_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_parallel_execute(name, host_nb, host_list, computation_amount, communication_amount, amount, rate);
+ if (0) SIMIX_host_parallel_execute(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
/* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
self->simcall.call = SIMCALL_HOST_PARALLEL_EXECUTE;
self->simcall.args[0].cc = (const char*) name;
self->simcall.args[1].i = (int) host_nb;
self->simcall.args[2].dp = (void*) host_list;
- self->simcall.args[3].dp = (void*) computation_amount;
- self->simcall.args[4].dp = (void*) communication_amount;
+ self->simcall.args[3].dp = (void*) flops_amount;
+ self->simcall.args[4].dp = (void*) bytes_amount;
self->simcall.args[5].d = (double) amount;
self->simcall.args[6].d = (double) rate;
if (self != simix_global->maestro_process) {
}
+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();
}
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);
} 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);
} else {
SIMIX_simcall_handle(&self->simcall, 0);
}
-
+ return self->simcall.result.i;
}
#endif