typedef struct s_mc_snapshot *mc_snapshot_t;
-/* These are the MC-specific simcalls, that smx_user needs to see */
-mc_snapshot_t simcall_HANDLER_mc_snapshot(smx_simcall_t simcall);
-int simcall_HANDLER_mc_compare_snapshots(smx_simcall_t simcall, mc_snapshot_t s1, mc_snapshot_t s2);
-int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
-
SG_END_DECL()
#endif
static inline void simcall_host_execution_get_state__set__execution(smx_simcall_t simcall, void* arg){
simcall->args[0].dp = arg;
}
-static inline int simcall_host_execution_get_state__get__result(smx_simcall_t simcall){
- return simcall->result.i;
+static inline e_smx_state_t simcall_host_execution_get_state__get__result(smx_simcall_t simcall){
+ return (e_smx_state_t) simcall->result.i;
}
static inline void simcall_host_execution_get_state__set__result(smx_simcall_t simcall, int result){
simcall->result.i = result;
static inline void simcall_vm_create__set__ind_pm(smx_simcall_t simcall, void* arg){
simcall->args[1].dp = arg;
}
-static inline void* simcall_vm_create__get__result(smx_simcall_t simcall){
- return simcall->result.dp;
+static inline smx_host_t simcall_vm_create__get__result(smx_simcall_t simcall){
+ return (smx_host_t) simcall->result.dp;
}
static inline void simcall_vm_create__set__result(smx_simcall_t simcall, void* result){
simcall->result.dp = result;
static inline void simcall_comm_get_state__set__comm(smx_simcall_t simcall, void* arg){
simcall->args[0].dp = arg;
}
-static inline int simcall_comm_get_state__get__result(smx_simcall_t simcall){
- return simcall->result.i;
+static inline e_smx_state_t simcall_comm_get_state__get__result(smx_simcall_t simcall){
+ return (e_smx_state_t) simcall->result.i;
}
static inline void simcall_comm_get_state__set__result(smx_simcall_t simcall, int result){
simcall->result.i = result;
simcall->args[0].dp = arg;
}
-static inline int simcall_sem_init__get__capacity(smx_simcall_t simcall){
- return simcall->args[0].i;
+static inline unsigned int simcall_sem_init__get__capacity(smx_simcall_t simcall){
+ return simcall->args[0].ui;
}
-static inline void simcall_sem_init__set__capacity(smx_simcall_t simcall, int arg){
- simcall->args[0].i = arg;
+static inline void simcall_sem_init__set__capacity(smx_simcall_t simcall, unsigned int arg){
+ simcall->args[0].ui = arg;
}
static inline smx_sem_t simcall_sem_init__get__result(smx_simcall_t simcall){
return (smx_sem_t) simcall->result.dp;
#endif
#ifdef HAVE_MC
-static inline void* simcall_mc_snapshot__get__result(smx_simcall_t simcall){
- return simcall->result.dp;
+static inline mc_snapshot_t simcall_mc_snapshot__get__result(smx_simcall_t simcall){
+ return (mc_snapshot_t) simcall->result.dp;
}
static inline void simcall_mc_snapshot__set__result(smx_simcall_t simcall, void* result){
simcall->result.dp = result;
}
-static inline void* simcall_mc_compare_snapshots__get__s1(smx_simcall_t simcall){
- return simcall->args[0].dp;
+static inline mc_snapshot_t simcall_mc_compare_snapshots__get__s1(smx_simcall_t simcall){
+ return (mc_snapshot_t) simcall->args[0].dp;
}
static inline void simcall_mc_compare_snapshots__set__s1(smx_simcall_t simcall, void* arg){
simcall->args[0].dp = arg;
}
-static inline void* simcall_mc_compare_snapshots__get__s2(smx_simcall_t simcall){
- return simcall->args[1].dp;
+static inline mc_snapshot_t simcall_mc_compare_snapshots__get__s2(smx_simcall_t simcall){
+ return (mc_snapshot_t) simcall->args[1].dp;
}
static inline void simcall_mc_compare_snapshots__set__s2(smx_simcall_t simcall, void* arg){
simcall->result.i = result;
}
#endif
+
+
+/* The prototype of all simcall handlers */
+smx_host_t simcall_HANDLER_host_get_by_name(smx_simcall_t simcall, const char* name);
+const char* simcall_HANDLER_host_get_name(smx_simcall_t simcall, smx_host_t host);
+void simcall_HANDLER_host_on(smx_simcall_t simcall, smx_host_t host);
+void simcall_HANDLER_host_off(smx_simcall_t simcall, smx_host_t host);
+xbt_dict_t simcall_HANDLER_host_get_properties(smx_simcall_t simcall, smx_host_t host);
+int simcall_HANDLER_host_get_core(smx_simcall_t simcall, smx_host_t host);
+xbt_swag_t simcall_HANDLER_host_get_process_list(smx_simcall_t simcall, smx_host_t host);
+double simcall_HANDLER_host_get_speed(smx_simcall_t simcall, smx_host_t host);
+double simcall_HANDLER_host_get_available_speed(smx_simcall_t simcall, smx_host_t host);
+int simcall_HANDLER_host_get_state(smx_simcall_t simcall, smx_host_t host);
+double simcall_HANDLER_host_get_current_power_peak(smx_simcall_t simcall, smx_host_t host);
+double simcall_HANDLER_host_get_power_peak_at(smx_simcall_t simcall, smx_host_t host, int pstate_index);
+int simcall_HANDLER_host_get_nb_pstates(smx_simcall_t simcall, smx_host_t host);
+void simcall_HANDLER_host_set_power_peak_at(smx_simcall_t simcall, smx_host_t host, int pstate_index);
+double simcall_HANDLER_host_get_consumed_energy(smx_simcall_t simcall, smx_host_t host);
+smx_action_t simcall_HANDLER_host_execute(smx_simcall_t simcall, const char* name, smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask);
+smx_action_t simcall_HANDLER_host_parallel_execute(smx_simcall_t simcall, const char* name, int host_nb, smx_host_t* host_list, double* computation_amount, double* communication_amount, double amount, double rate);
+void simcall_HANDLER_host_execution_destroy(smx_simcall_t simcall, smx_action_t execution);
+void simcall_HANDLER_host_execution_cancel(smx_simcall_t simcall, smx_action_t execution);
+double simcall_HANDLER_host_execution_get_remains(smx_simcall_t simcall, smx_action_t execution);
+e_smx_state_t simcall_HANDLER_host_execution_get_state(smx_simcall_t simcall, smx_action_t execution);
+void simcall_HANDLER_host_execution_set_priority(smx_simcall_t simcall, smx_action_t execution, double priority);
+void simcall_HANDLER_host_execution_set_bound(smx_simcall_t simcall, smx_action_t execution, double bound);
+void simcall_HANDLER_host_execution_set_affinity(smx_simcall_t simcall, smx_action_t execution, smx_host_t ws, unsigned long mask);
+void simcall_HANDLER_host_execution_wait(smx_simcall_t simcall, smx_action_t execution);
+xbt_dict_t simcall_HANDLER_host_get_mounted_storage_list(smx_simcall_t simcall, smx_host_t host);
+xbt_dynar_t simcall_HANDLER_host_get_attached_storage_list(smx_simcall_t simcall, smx_host_t host);
+void simcall_HANDLER_host_get_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_params_t params);
+void simcall_HANDLER_host_set_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_params_t params);
+smx_host_t simcall_HANDLER_vm_create(smx_simcall_t simcall, const char* name, smx_host_t ind_pm);
+void simcall_HANDLER_vm_start(smx_simcall_t simcall, smx_host_t ind_vm);
+int simcall_HANDLER_vm_get_state(smx_simcall_t simcall, smx_host_t ind_vm);
+void simcall_HANDLER_vm_migrate(smx_simcall_t simcall, smx_host_t ind_vm, smx_host_t ind_dst_pm);
+void* simcall_HANDLER_vm_get_pm(smx_simcall_t simcall, smx_host_t ind_vm);
+void simcall_HANDLER_vm_set_bound(smx_simcall_t simcall, smx_host_t ind_vm, double bound);
+void simcall_HANDLER_vm_set_affinity(smx_simcall_t simcall, smx_host_t ind_vm, smx_host_t ind_pm, unsigned long mask);
+void simcall_HANDLER_vm_destroy(smx_simcall_t simcall, smx_host_t ind_vm);
+void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, smx_host_t ind_vm);
+void simcall_HANDLER_vm_resume(smx_simcall_t simcall, smx_host_t ind_vm);
+void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, smx_host_t ind_vm);
+void simcall_HANDLER_vm_save(smx_simcall_t simcall, smx_host_t ind_vm);
+void simcall_HANDLER_vm_restore(smx_simcall_t simcall, smx_host_t ind_vm);
+void simcall_HANDLER_process_create(smx_simcall_t simcall, 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);
+void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_process_t process);
+void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid);
+void simcall_HANDLER_process_cleanup(smx_simcall_t simcall, smx_process_t process);
+void simcall_HANDLER_process_change_host(smx_simcall_t simcall, smx_process_t process, smx_host_t dest);
+void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process);
+void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_process_t process);
+int simcall_HANDLER_process_count(smx_simcall_t simcall);
+int simcall_HANDLER_process_get_PID(smx_simcall_t simcall, smx_process_t process);
+int simcall_HANDLER_process_get_PPID(smx_simcall_t simcall, smx_process_t process);
+void* simcall_HANDLER_process_get_data(smx_simcall_t simcall, smx_process_t process);
+void simcall_HANDLER_process_set_data(smx_simcall_t simcall, smx_process_t process, void* data);
+smx_host_t simcall_HANDLER_process_get_host(smx_simcall_t simcall, smx_process_t process);
+const char* simcall_HANDLER_process_get_name(smx_simcall_t simcall, smx_process_t process);
+int simcall_HANDLER_process_is_suspended(smx_simcall_t simcall, smx_process_t process);
+xbt_dict_t simcall_HANDLER_process_get_properties(smx_simcall_t simcall, smx_process_t process);
+void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout);
+void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
+void simcall_HANDLER_process_on_exit(smx_simcall_t simcall, smx_process_t process, int_f_pvoid_pvoid_t fun, void* data);
+void simcall_HANDLER_process_auto_restart_set(smx_simcall_t simcall, smx_process_t process, int auto_restart);
+smx_process_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_process_t process);
+smx_rdv_t simcall_HANDLER_rdv_create(smx_simcall_t simcall, const char* name);
+void simcall_HANDLER_rdv_destroy(smx_simcall_t simcall, smx_rdv_t rdv);
+unsigned int simcall_HANDLER_rdv_comm_count_by_host(smx_simcall_t simcall, smx_rdv_t rdv, smx_host_t host);
+smx_action_t simcall_HANDLER_rdv_get_head(smx_simcall_t simcall, smx_rdv_t rdv);
+void simcall_HANDLER_rdv_set_receiver(smx_simcall_t simcall, smx_rdv_t rdv, smx_process_t receiver);
+smx_process_t simcall_HANDLER_rdv_get_receiver(smx_simcall_t simcall, smx_rdv_t rdv);
+smx_action_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data);
+void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, 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);
+smx_action_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src, 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);
+void simcall_HANDLER_comm_recv(smx_simcall_t simcall, 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);
+smx_action_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, 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);
+void simcall_HANDLER_comm_cancel(smx_simcall_t simcall, smx_action_t comm);
+void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t comms);
+void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_action_t comm, double timeout);
+void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_action_t comm);
+void simcall_HANDLER_comm_testany(smx_simcall_t simcall, xbt_dynar_t comms);
+double simcall_HANDLER_comm_get_remains(smx_simcall_t simcall, smx_action_t comm);
+e_smx_state_t simcall_HANDLER_comm_get_state(smx_simcall_t simcall, smx_action_t comm);
+void* simcall_HANDLER_comm_get_src_data(smx_simcall_t simcall, smx_action_t comm);
+void* simcall_HANDLER_comm_get_dst_data(smx_simcall_t simcall, smx_action_t comm);
+smx_process_t simcall_HANDLER_comm_get_src_proc(smx_simcall_t simcall, smx_action_t comm);
+smx_process_t simcall_HANDLER_comm_get_dst_proc(smx_simcall_t simcall, smx_action_t comm);
+smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall);
+void simcall_HANDLER_mutex_destroy(smx_simcall_t simcall, smx_mutex_t mutex);
+void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex);
+int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex);
+void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex);
+smx_cond_t simcall_HANDLER_cond_init(smx_simcall_t simcall);
+void simcall_HANDLER_cond_destroy(smx_simcall_t simcall, smx_cond_t cond);
+void simcall_HANDLER_cond_signal(smx_simcall_t simcall, smx_cond_t cond);
+void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex);
+void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout);
+void simcall_HANDLER_cond_broadcast(smx_simcall_t simcall, smx_cond_t cond);
+smx_sem_t simcall_HANDLER_sem_init(smx_simcall_t simcall, unsigned int capacity);
+void simcall_HANDLER_sem_destroy(smx_simcall_t simcall, smx_sem_t sem);
+void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem);
+int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t sem);
+void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem);
+void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout);
+int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem);
+void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, smx_host_t host);
+void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, smx_host_t host);
+void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, smx_host_t host);
+void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, smx_host_t host);
+int simcall_HANDLER_file_unlink(smx_simcall_t simcall, smx_file_t fd, smx_host_t host);
+sg_size_t simcall_HANDLER_file_get_size(smx_simcall_t simcall, smx_file_t fd);
+sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd);
+int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin);
+xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd);
+int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
+sg_size_t simcall_HANDLER_storage_get_free_size(smx_simcall_t simcall, smx_storage_t storage);
+sg_size_t simcall_HANDLER_storage_get_used_size(smx_simcall_t simcall, smx_storage_t name);
+xbt_dict_t simcall_HANDLER_storage_get_properties(smx_simcall_t simcall, smx_storage_t storage);
+xbt_dict_t simcall_HANDLER_storage_get_content(smx_simcall_t simcall, smx_storage_t storage);
+xbt_dict_t simcall_HANDLER_asr_get_properties(smx_simcall_t simcall, const char* name);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+int simcall_HANDLER_comm_is_latency_bounded(smx_simcall_t simcall, smx_action_t comm);
+#endif
+
+#ifdef HAVE_TRACING
+void simcall_HANDLER_set_category(smx_simcall_t simcall, smx_action_t action, const char* category);
+#endif
+
+#ifdef HAVE_MC
+mc_snapshot_t simcall_HANDLER_mc_snapshot(smx_simcall_t simcall);
+int simcall_HANDLER_mc_compare_snapshots(smx_simcall_t simcall, mc_snapshot_t s1, mc_snapshot_t s2);
+int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
+#endif
return self->simcall.result.d;
}
-inline static int simcall_BODY_host_execution_get_state(smx_action_t execution) {
+inline static e_smx_state_t simcall_BODY_host_execution_get_state(smx_action_t execution) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
}
-inline static void* simcall_BODY_vm_create(const char* name, smx_host_t ind_pm) {
+inline static smx_host_t simcall_BODY_vm_create(const char* name, smx_host_t ind_pm) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
return self->simcall.result.d;
}
-inline static int simcall_BODY_comm_get_state(smx_action_t comm) {
+inline static e_smx_state_t simcall_BODY_comm_get_state(smx_action_t comm) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
}
-inline static smx_sem_t simcall_BODY_sem_init(int capacity) {
+inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
self->simcall.call = SIMCALL_SEM_INIT;
memset(&self->simcall.result, 0, sizeof(self->simcall.result));
memset(self->simcall.args, 0, sizeof(self->simcall.args));
- self->simcall.args[0].i = (int) capacity;
+ 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,
SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
#ifdef HAVE_MC
-inline static void* simcall_BODY_mc_snapshot() {
+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 */
return self->simcall.result.dp;
}
-inline static int simcall_BODY_mc_compare_snapshots(void* s1, void* s2) {
+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 */
/** @brief Simcalls' names (generated from src/simix/simcalls.in) */
const char* simcall_names[] = {
-[SIMCALL_HOST_GET_BY_NAME] = "SIMCALL_HOST_GET_BY_NAME",
-[SIMCALL_HOST_GET_NAME] = "SIMCALL_HOST_GET_NAME",
-[SIMCALL_HOST_ON] = "SIMCALL_HOST_ON",
-[SIMCALL_HOST_OFF] = "SIMCALL_HOST_OFF",
-[SIMCALL_HOST_GET_PROPERTIES] = "SIMCALL_HOST_GET_PROPERTIES",
-[SIMCALL_HOST_GET_CORE] = "SIMCALL_HOST_GET_CORE",
-[SIMCALL_HOST_GET_PROCESS_LIST] = "SIMCALL_HOST_GET_PROCESS_LIST",
-[SIMCALL_HOST_GET_SPEED] = "SIMCALL_HOST_GET_SPEED",
-[SIMCALL_HOST_GET_AVAILABLE_SPEED] = "SIMCALL_HOST_GET_AVAILABLE_SPEED",
-[SIMCALL_HOST_GET_STATE] = "SIMCALL_HOST_GET_STATE",
-[SIMCALL_HOST_GET_CURRENT_POWER_PEAK] = "SIMCALL_HOST_GET_CURRENT_POWER_PEAK",
-[SIMCALL_HOST_GET_POWER_PEAK_AT] = "SIMCALL_HOST_GET_POWER_PEAK_AT",
-[SIMCALL_HOST_GET_NB_PSTATES] = "SIMCALL_HOST_GET_NB_PSTATES",
-[SIMCALL_HOST_SET_POWER_PEAK_AT] = "SIMCALL_HOST_SET_POWER_PEAK_AT",
-[SIMCALL_HOST_GET_CONSUMED_ENERGY] = "SIMCALL_HOST_GET_CONSUMED_ENERGY",
-[SIMCALL_HOST_EXECUTE] = "SIMCALL_HOST_EXECUTE",
-[SIMCALL_HOST_PARALLEL_EXECUTE] = "SIMCALL_HOST_PARALLEL_EXECUTE",
-[SIMCALL_HOST_EXECUTION_DESTROY] = "SIMCALL_HOST_EXECUTION_DESTROY",
-[SIMCALL_HOST_EXECUTION_CANCEL] = "SIMCALL_HOST_EXECUTION_CANCEL",
-[SIMCALL_HOST_EXECUTION_GET_REMAINS] = "SIMCALL_HOST_EXECUTION_GET_REMAINS",
-[SIMCALL_HOST_EXECUTION_GET_STATE] = "SIMCALL_HOST_EXECUTION_GET_STATE",
-[SIMCALL_HOST_EXECUTION_SET_PRIORITY] = "SIMCALL_HOST_EXECUTION_SET_PRIORITY",
-[SIMCALL_HOST_EXECUTION_SET_BOUND] = "SIMCALL_HOST_EXECUTION_SET_BOUND",
-[SIMCALL_HOST_EXECUTION_SET_AFFINITY] = "SIMCALL_HOST_EXECUTION_SET_AFFINITY",
-[SIMCALL_HOST_EXECUTION_WAIT] = "SIMCALL_HOST_EXECUTION_WAIT",
-[SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST] = "SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST",
-[SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST] = "SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST",
-[SIMCALL_HOST_GET_PARAMS] = "SIMCALL_HOST_GET_PARAMS",
-[SIMCALL_HOST_SET_PARAMS] = "SIMCALL_HOST_SET_PARAMS",
-[SIMCALL_VM_CREATE] = "SIMCALL_VM_CREATE",
-[SIMCALL_VM_START] = "SIMCALL_VM_START",
-[SIMCALL_VM_GET_STATE] = "SIMCALL_VM_GET_STATE",
-[SIMCALL_VM_MIGRATE] = "SIMCALL_VM_MIGRATE",
-[SIMCALL_VM_GET_PM] = "SIMCALL_VM_GET_PM",
-[SIMCALL_VM_SET_BOUND] = "SIMCALL_VM_SET_BOUND",
-[SIMCALL_VM_SET_AFFINITY] = "SIMCALL_VM_SET_AFFINITY",
-[SIMCALL_VM_DESTROY] = "SIMCALL_VM_DESTROY",
-[SIMCALL_VM_SUSPEND] = "SIMCALL_VM_SUSPEND",
-[SIMCALL_VM_RESUME] = "SIMCALL_VM_RESUME",
-[SIMCALL_VM_SHUTDOWN] = "SIMCALL_VM_SHUTDOWN",
-[SIMCALL_VM_SAVE] = "SIMCALL_VM_SAVE",
-[SIMCALL_VM_RESTORE] = "SIMCALL_VM_RESTORE",
-[SIMCALL_PROCESS_CREATE] = "SIMCALL_PROCESS_CREATE",
-[SIMCALL_PROCESS_KILL] = "SIMCALL_PROCESS_KILL",
-[SIMCALL_PROCESS_KILLALL] = "SIMCALL_PROCESS_KILLALL",
-[SIMCALL_PROCESS_CLEANUP] = "SIMCALL_PROCESS_CLEANUP",
-[SIMCALL_PROCESS_CHANGE_HOST] = "SIMCALL_PROCESS_CHANGE_HOST",
-[SIMCALL_PROCESS_SUSPEND] = "SIMCALL_PROCESS_SUSPEND",
-[SIMCALL_PROCESS_RESUME] = "SIMCALL_PROCESS_RESUME",
-[SIMCALL_PROCESS_COUNT] = "SIMCALL_PROCESS_COUNT",
-[SIMCALL_PROCESS_GET_PID] = "SIMCALL_PROCESS_GET_PID",
-[SIMCALL_PROCESS_GET_PPID] = "SIMCALL_PROCESS_GET_PPID",
-[SIMCALL_PROCESS_GET_DATA] = "SIMCALL_PROCESS_GET_DATA",
-[SIMCALL_PROCESS_SET_DATA] = "SIMCALL_PROCESS_SET_DATA",
-[SIMCALL_PROCESS_GET_HOST] = "SIMCALL_PROCESS_GET_HOST",
-[SIMCALL_PROCESS_GET_NAME] = "SIMCALL_PROCESS_GET_NAME",
-[SIMCALL_PROCESS_IS_SUSPENDED] = "SIMCALL_PROCESS_IS_SUSPENDED",
-[SIMCALL_PROCESS_GET_PROPERTIES] = "SIMCALL_PROCESS_GET_PROPERTIES",
-[SIMCALL_PROCESS_JOIN] = "SIMCALL_PROCESS_JOIN",
-[SIMCALL_PROCESS_SLEEP] = "SIMCALL_PROCESS_SLEEP",
-[SIMCALL_PROCESS_ON_EXIT] = "SIMCALL_PROCESS_ON_EXIT",
-[SIMCALL_PROCESS_AUTO_RESTART_SET] = "SIMCALL_PROCESS_AUTO_RESTART_SET",
-[SIMCALL_PROCESS_RESTART] = "SIMCALL_PROCESS_RESTART",
-[SIMCALL_RDV_CREATE] = "SIMCALL_RDV_CREATE",
-[SIMCALL_RDV_DESTROY] = "SIMCALL_RDV_DESTROY",
-[SIMCALL_RDV_COMM_COUNT_BY_HOST] = "SIMCALL_RDV_COMM_COUNT_BY_HOST",
-[SIMCALL_RDV_GET_HEAD] = "SIMCALL_RDV_GET_HEAD",
-[SIMCALL_RDV_SET_RECEIVER] = "SIMCALL_RDV_SET_RECEIVER",
-[SIMCALL_RDV_GET_RECEIVER] = "SIMCALL_RDV_GET_RECEIVER",
-[SIMCALL_COMM_IPROBE] = "SIMCALL_COMM_IPROBE",
-[SIMCALL_COMM_SEND] = "SIMCALL_COMM_SEND",
-[SIMCALL_COMM_ISEND] = "SIMCALL_COMM_ISEND",
-[SIMCALL_COMM_RECV] = "SIMCALL_COMM_RECV",
-[SIMCALL_COMM_IRECV] = "SIMCALL_COMM_IRECV",
-[SIMCALL_COMM_CANCEL] = "SIMCALL_COMM_CANCEL",
-[SIMCALL_COMM_WAITANY] = "SIMCALL_COMM_WAITANY",
-[SIMCALL_COMM_WAIT] = "SIMCALL_COMM_WAIT",
-[SIMCALL_COMM_TEST] = "SIMCALL_COMM_TEST",
-[SIMCALL_COMM_TESTANY] = "SIMCALL_COMM_TESTANY",
-[SIMCALL_COMM_GET_REMAINS] = "SIMCALL_COMM_GET_REMAINS",
-[SIMCALL_COMM_GET_STATE] = "SIMCALL_COMM_GET_STATE",
-[SIMCALL_COMM_GET_SRC_DATA] = "SIMCALL_COMM_GET_SRC_DATA",
-[SIMCALL_COMM_GET_DST_DATA] = "SIMCALL_COMM_GET_DST_DATA",
-[SIMCALL_COMM_GET_SRC_PROC] = "SIMCALL_COMM_GET_SRC_PROC",
-[SIMCALL_COMM_GET_DST_PROC] = "SIMCALL_COMM_GET_DST_PROC",
-[SIMCALL_MUTEX_INIT] = "SIMCALL_MUTEX_INIT",
-[SIMCALL_MUTEX_DESTROY] = "SIMCALL_MUTEX_DESTROY",
-[SIMCALL_MUTEX_LOCK] = "SIMCALL_MUTEX_LOCK",
-[SIMCALL_MUTEX_TRYLOCK] = "SIMCALL_MUTEX_TRYLOCK",
-[SIMCALL_MUTEX_UNLOCK] = "SIMCALL_MUTEX_UNLOCK",
-[SIMCALL_COND_INIT] = "SIMCALL_COND_INIT",
-[SIMCALL_COND_DESTROY] = "SIMCALL_COND_DESTROY",
-[SIMCALL_COND_SIGNAL] = "SIMCALL_COND_SIGNAL",
-[SIMCALL_COND_WAIT] = "SIMCALL_COND_WAIT",
-[SIMCALL_COND_WAIT_TIMEOUT] = "SIMCALL_COND_WAIT_TIMEOUT",
-[SIMCALL_COND_BROADCAST] = "SIMCALL_COND_BROADCAST",
-[SIMCALL_SEM_INIT] = "SIMCALL_SEM_INIT",
-[SIMCALL_SEM_DESTROY] = "SIMCALL_SEM_DESTROY",
-[SIMCALL_SEM_RELEASE] = "SIMCALL_SEM_RELEASE",
-[SIMCALL_SEM_WOULD_BLOCK] = "SIMCALL_SEM_WOULD_BLOCK",
-[SIMCALL_SEM_ACQUIRE] = "SIMCALL_SEM_ACQUIRE",
-[SIMCALL_SEM_ACQUIRE_TIMEOUT] = "SIMCALL_SEM_ACQUIRE_TIMEOUT",
-[SIMCALL_SEM_GET_CAPACITY] = "SIMCALL_SEM_GET_CAPACITY",
-[SIMCALL_FILE_READ] = "SIMCALL_FILE_READ",
-[SIMCALL_FILE_WRITE] = "SIMCALL_FILE_WRITE",
-[SIMCALL_FILE_OPEN] = "SIMCALL_FILE_OPEN",
-[SIMCALL_FILE_CLOSE] = "SIMCALL_FILE_CLOSE",
-[SIMCALL_FILE_UNLINK] = "SIMCALL_FILE_UNLINK",
-[SIMCALL_FILE_GET_SIZE] = "SIMCALL_FILE_GET_SIZE",
-[SIMCALL_FILE_TELL] = "SIMCALL_FILE_TELL",
-[SIMCALL_FILE_SEEK] = "SIMCALL_FILE_SEEK",
-[SIMCALL_FILE_GET_INFO] = "SIMCALL_FILE_GET_INFO",
-[SIMCALL_FILE_MOVE] = "SIMCALL_FILE_MOVE",
-[SIMCALL_STORAGE_GET_FREE_SIZE] = "SIMCALL_STORAGE_GET_FREE_SIZE",
-[SIMCALL_STORAGE_GET_USED_SIZE] = "SIMCALL_STORAGE_GET_USED_SIZE",
-[SIMCALL_STORAGE_GET_PROPERTIES] = "SIMCALL_STORAGE_GET_PROPERTIES",
-[SIMCALL_STORAGE_GET_CONTENT] = "SIMCALL_STORAGE_GET_CONTENT",
-[SIMCALL_ASR_GET_PROPERTIES] = "SIMCALL_ASR_GET_PROPERTIES",
+ [SIMCALL_HOST_GET_BY_NAME] = "SIMCALL_HOST_GET_BY_NAME",
+ [SIMCALL_HOST_GET_NAME] = "SIMCALL_HOST_GET_NAME",
+ [SIMCALL_HOST_ON] = "SIMCALL_HOST_ON",
+ [SIMCALL_HOST_OFF] = "SIMCALL_HOST_OFF",
+ [SIMCALL_HOST_GET_PROPERTIES] = "SIMCALL_HOST_GET_PROPERTIES",
+ [SIMCALL_HOST_GET_CORE] = "SIMCALL_HOST_GET_CORE",
+ [SIMCALL_HOST_GET_PROCESS_LIST] = "SIMCALL_HOST_GET_PROCESS_LIST",
+ [SIMCALL_HOST_GET_SPEED] = "SIMCALL_HOST_GET_SPEED",
+ [SIMCALL_HOST_GET_AVAILABLE_SPEED] = "SIMCALL_HOST_GET_AVAILABLE_SPEED",
+ [SIMCALL_HOST_GET_STATE] = "SIMCALL_HOST_GET_STATE",
+ [SIMCALL_HOST_GET_CURRENT_POWER_PEAK] = "SIMCALL_HOST_GET_CURRENT_POWER_PEAK",
+ [SIMCALL_HOST_GET_POWER_PEAK_AT] = "SIMCALL_HOST_GET_POWER_PEAK_AT",
+ [SIMCALL_HOST_GET_NB_PSTATES] = "SIMCALL_HOST_GET_NB_PSTATES",
+ [SIMCALL_HOST_SET_POWER_PEAK_AT] = "SIMCALL_HOST_SET_POWER_PEAK_AT",
+ [SIMCALL_HOST_GET_CONSUMED_ENERGY] = "SIMCALL_HOST_GET_CONSUMED_ENERGY",
+ [SIMCALL_HOST_EXECUTE] = "SIMCALL_HOST_EXECUTE",
+ [SIMCALL_HOST_PARALLEL_EXECUTE] = "SIMCALL_HOST_PARALLEL_EXECUTE",
+ [SIMCALL_HOST_EXECUTION_DESTROY] = "SIMCALL_HOST_EXECUTION_DESTROY",
+ [SIMCALL_HOST_EXECUTION_CANCEL] = "SIMCALL_HOST_EXECUTION_CANCEL",
+ [SIMCALL_HOST_EXECUTION_GET_REMAINS] = "SIMCALL_HOST_EXECUTION_GET_REMAINS",
+ [SIMCALL_HOST_EXECUTION_GET_STATE] = "SIMCALL_HOST_EXECUTION_GET_STATE",
+ [SIMCALL_HOST_EXECUTION_SET_PRIORITY] = "SIMCALL_HOST_EXECUTION_SET_PRIORITY",
+ [SIMCALL_HOST_EXECUTION_SET_BOUND] = "SIMCALL_HOST_EXECUTION_SET_BOUND",
+ [SIMCALL_HOST_EXECUTION_SET_AFFINITY] = "SIMCALL_HOST_EXECUTION_SET_AFFINITY",
+ [SIMCALL_HOST_EXECUTION_WAIT] = "SIMCALL_HOST_EXECUTION_WAIT",
+ [SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST] = "SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST",
+ [SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST] = "SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST",
+ [SIMCALL_HOST_GET_PARAMS] = "SIMCALL_HOST_GET_PARAMS",
+ [SIMCALL_HOST_SET_PARAMS] = "SIMCALL_HOST_SET_PARAMS",
+ [SIMCALL_VM_CREATE] = "SIMCALL_VM_CREATE",
+ [SIMCALL_VM_START] = "SIMCALL_VM_START",
+ [SIMCALL_VM_GET_STATE] = "SIMCALL_VM_GET_STATE",
+ [SIMCALL_VM_MIGRATE] = "SIMCALL_VM_MIGRATE",
+ [SIMCALL_VM_GET_PM] = "SIMCALL_VM_GET_PM",
+ [SIMCALL_VM_SET_BOUND] = "SIMCALL_VM_SET_BOUND",
+ [SIMCALL_VM_SET_AFFINITY] = "SIMCALL_VM_SET_AFFINITY",
+ [SIMCALL_VM_DESTROY] = "SIMCALL_VM_DESTROY",
+ [SIMCALL_VM_SUSPEND] = "SIMCALL_VM_SUSPEND",
+ [SIMCALL_VM_RESUME] = "SIMCALL_VM_RESUME",
+ [SIMCALL_VM_SHUTDOWN] = "SIMCALL_VM_SHUTDOWN",
+ [SIMCALL_VM_SAVE] = "SIMCALL_VM_SAVE",
+ [SIMCALL_VM_RESTORE] = "SIMCALL_VM_RESTORE",
+ [SIMCALL_PROCESS_CREATE] = "SIMCALL_PROCESS_CREATE",
+ [SIMCALL_PROCESS_KILL] = "SIMCALL_PROCESS_KILL",
+ [SIMCALL_PROCESS_KILLALL] = "SIMCALL_PROCESS_KILLALL",
+ [SIMCALL_PROCESS_CLEANUP] = "SIMCALL_PROCESS_CLEANUP",
+ [SIMCALL_PROCESS_CHANGE_HOST] = "SIMCALL_PROCESS_CHANGE_HOST",
+ [SIMCALL_PROCESS_SUSPEND] = "SIMCALL_PROCESS_SUSPEND",
+ [SIMCALL_PROCESS_RESUME] = "SIMCALL_PROCESS_RESUME",
+ [SIMCALL_PROCESS_COUNT] = "SIMCALL_PROCESS_COUNT",
+ [SIMCALL_PROCESS_GET_PID] = "SIMCALL_PROCESS_GET_PID",
+ [SIMCALL_PROCESS_GET_PPID] = "SIMCALL_PROCESS_GET_PPID",
+ [SIMCALL_PROCESS_GET_DATA] = "SIMCALL_PROCESS_GET_DATA",
+ [SIMCALL_PROCESS_SET_DATA] = "SIMCALL_PROCESS_SET_DATA",
+ [SIMCALL_PROCESS_GET_HOST] = "SIMCALL_PROCESS_GET_HOST",
+ [SIMCALL_PROCESS_GET_NAME] = "SIMCALL_PROCESS_GET_NAME",
+ [SIMCALL_PROCESS_IS_SUSPENDED] = "SIMCALL_PROCESS_IS_SUSPENDED",
+ [SIMCALL_PROCESS_GET_PROPERTIES] = "SIMCALL_PROCESS_GET_PROPERTIES",
+ [SIMCALL_PROCESS_JOIN] = "SIMCALL_PROCESS_JOIN",
+ [SIMCALL_PROCESS_SLEEP] = "SIMCALL_PROCESS_SLEEP",
+ [SIMCALL_PROCESS_ON_EXIT] = "SIMCALL_PROCESS_ON_EXIT",
+ [SIMCALL_PROCESS_AUTO_RESTART_SET] = "SIMCALL_PROCESS_AUTO_RESTART_SET",
+ [SIMCALL_PROCESS_RESTART] = "SIMCALL_PROCESS_RESTART",
+ [SIMCALL_RDV_CREATE] = "SIMCALL_RDV_CREATE",
+ [SIMCALL_RDV_DESTROY] = "SIMCALL_RDV_DESTROY",
+ [SIMCALL_RDV_COMM_COUNT_BY_HOST] = "SIMCALL_RDV_COMM_COUNT_BY_HOST",
+ [SIMCALL_RDV_GET_HEAD] = "SIMCALL_RDV_GET_HEAD",
+ [SIMCALL_RDV_SET_RECEIVER] = "SIMCALL_RDV_SET_RECEIVER",
+ [SIMCALL_RDV_GET_RECEIVER] = "SIMCALL_RDV_GET_RECEIVER",
+ [SIMCALL_COMM_IPROBE] = "SIMCALL_COMM_IPROBE",
+ [SIMCALL_COMM_SEND] = "SIMCALL_COMM_SEND",
+ [SIMCALL_COMM_ISEND] = "SIMCALL_COMM_ISEND",
+ [SIMCALL_COMM_RECV] = "SIMCALL_COMM_RECV",
+ [SIMCALL_COMM_IRECV] = "SIMCALL_COMM_IRECV",
+ [SIMCALL_COMM_CANCEL] = "SIMCALL_COMM_CANCEL",
+ [SIMCALL_COMM_WAITANY] = "SIMCALL_COMM_WAITANY",
+ [SIMCALL_COMM_WAIT] = "SIMCALL_COMM_WAIT",
+ [SIMCALL_COMM_TEST] = "SIMCALL_COMM_TEST",
+ [SIMCALL_COMM_TESTANY] = "SIMCALL_COMM_TESTANY",
+ [SIMCALL_COMM_GET_REMAINS] = "SIMCALL_COMM_GET_REMAINS",
+ [SIMCALL_COMM_GET_STATE] = "SIMCALL_COMM_GET_STATE",
+ [SIMCALL_COMM_GET_SRC_DATA] = "SIMCALL_COMM_GET_SRC_DATA",
+ [SIMCALL_COMM_GET_DST_DATA] = "SIMCALL_COMM_GET_DST_DATA",
+ [SIMCALL_COMM_GET_SRC_PROC] = "SIMCALL_COMM_GET_SRC_PROC",
+ [SIMCALL_COMM_GET_DST_PROC] = "SIMCALL_COMM_GET_DST_PROC",
+ [SIMCALL_MUTEX_INIT] = "SIMCALL_MUTEX_INIT",
+ [SIMCALL_MUTEX_DESTROY] = "SIMCALL_MUTEX_DESTROY",
+ [SIMCALL_MUTEX_LOCK] = "SIMCALL_MUTEX_LOCK",
+ [SIMCALL_MUTEX_TRYLOCK] = "SIMCALL_MUTEX_TRYLOCK",
+ [SIMCALL_MUTEX_UNLOCK] = "SIMCALL_MUTEX_UNLOCK",
+ [SIMCALL_COND_INIT] = "SIMCALL_COND_INIT",
+ [SIMCALL_COND_DESTROY] = "SIMCALL_COND_DESTROY",
+ [SIMCALL_COND_SIGNAL] = "SIMCALL_COND_SIGNAL",
+ [SIMCALL_COND_WAIT] = "SIMCALL_COND_WAIT",
+ [SIMCALL_COND_WAIT_TIMEOUT] = "SIMCALL_COND_WAIT_TIMEOUT",
+ [SIMCALL_COND_BROADCAST] = "SIMCALL_COND_BROADCAST",
+ [SIMCALL_SEM_INIT] = "SIMCALL_SEM_INIT",
+ [SIMCALL_SEM_DESTROY] = "SIMCALL_SEM_DESTROY",
+ [SIMCALL_SEM_RELEASE] = "SIMCALL_SEM_RELEASE",
+ [SIMCALL_SEM_WOULD_BLOCK] = "SIMCALL_SEM_WOULD_BLOCK",
+ [SIMCALL_SEM_ACQUIRE] = "SIMCALL_SEM_ACQUIRE",
+ [SIMCALL_SEM_ACQUIRE_TIMEOUT] = "SIMCALL_SEM_ACQUIRE_TIMEOUT",
+ [SIMCALL_SEM_GET_CAPACITY] = "SIMCALL_SEM_GET_CAPACITY",
+ [SIMCALL_FILE_READ] = "SIMCALL_FILE_READ",
+ [SIMCALL_FILE_WRITE] = "SIMCALL_FILE_WRITE",
+ [SIMCALL_FILE_OPEN] = "SIMCALL_FILE_OPEN",
+ [SIMCALL_FILE_CLOSE] = "SIMCALL_FILE_CLOSE",
+ [SIMCALL_FILE_UNLINK] = "SIMCALL_FILE_UNLINK",
+ [SIMCALL_FILE_GET_SIZE] = "SIMCALL_FILE_GET_SIZE",
+ [SIMCALL_FILE_TELL] = "SIMCALL_FILE_TELL",
+ [SIMCALL_FILE_SEEK] = "SIMCALL_FILE_SEEK",
+ [SIMCALL_FILE_GET_INFO] = "SIMCALL_FILE_GET_INFO",
+ [SIMCALL_FILE_MOVE] = "SIMCALL_FILE_MOVE",
+ [SIMCALL_STORAGE_GET_FREE_SIZE] = "SIMCALL_STORAGE_GET_FREE_SIZE",
+ [SIMCALL_STORAGE_GET_USED_SIZE] = "SIMCALL_STORAGE_GET_USED_SIZE",
+ [SIMCALL_STORAGE_GET_PROPERTIES] = "SIMCALL_STORAGE_GET_PROPERTIES",
+ [SIMCALL_STORAGE_GET_CONTENT] = "SIMCALL_STORAGE_GET_CONTENT",
+ [SIMCALL_ASR_GET_PROPERTIES] = "SIMCALL_ASR_GET_PROPERTIES",
#ifdef HAVE_LATENCY_BOUND_TRACKING
-[SIMCALL_COMM_IS_LATENCY_BOUNDED] = "SIMCALL_COMM_IS_LATENCY_BOUNDED",
+ [SIMCALL_COMM_IS_LATENCY_BOUNDED] = "SIMCALL_COMM_IS_LATENCY_BOUNDED",
#endif
#ifdef HAVE_TRACING
-[SIMCALL_SET_CATEGORY] = "SIMCALL_SET_CATEGORY",
+ [SIMCALL_SET_CATEGORY] = "SIMCALL_SET_CATEGORY",
#endif
#ifdef HAVE_MC
-[SIMCALL_MC_SNAPSHOT] = "SIMCALL_MC_SNAPSHOT",
-[SIMCALL_MC_COMPARE_SNAPSHOTS] = "SIMCALL_MC_COMPARE_SNAPSHOTS",
-[SIMCALL_MC_RANDOM] = "SIMCALL_MC_RANDOM",
+ [SIMCALL_MC_SNAPSHOT] = "SIMCALL_MC_SNAPSHOT",
+ [SIMCALL_MC_COMPARE_SNAPSHOTS] = "SIMCALL_MC_COMPARE_SNAPSHOTS",
+ [SIMCALL_MC_RANDOM] = "SIMCALL_MC_RANDOM",
#endif
[SIMCALL_NONE] = "NONE"
};
break;
case SIMCALL_SEM_INIT:
- simcall->result.dp = simcall_HANDLER_sem_init(simcall , simcall->args[0].i);
+ simcall->result.dp = simcall_HANDLER_sem_init(simcall , simcall->args[0].ui);
SIMIX_simcall_answer(simcall);
break;
break;
case SIMCALL_MC_COMPARE_SNAPSHOTS:
- simcall->result.i = simcall_HANDLER_mc_compare_snapshots(simcall , simcall->args[0].dp, simcall->args[1].dp);
+ simcall->result.i = simcall_HANDLER_mc_compare_snapshots(simcall , (mc_snapshot_t) simcall->args[0].dp, (mc_snapshot_t) simcall->args[1].dp);
SIMIX_simcall_answer(simcall);
break;
XBT_PUBLIC(const char*) simcall_names[]; /* Name of each simcall */
#include "popping_enum.h" /* Definition of e_smx_simcall_t, with one value per simcall */
+#include "mc/mc_interface.h" /* Definition of mc_snapshot_t, used by one simcall */
typedef int (*simix_match_func_t)(void *, void *, smx_action_t);
typedef void (*simix_copy_data_func_t)(smx_action_t, void*, size_t);
void SIMIX_simcall_handle(smx_simcall_t, int);
void SIMIX_simcall_exit(smx_action_t);
const char *SIMIX_simcall_name(e_smx_simcall_t kind);
-//FIXME put it in a better place
-xbt_dict_t simcall_HANDLER_asr_get_properties(smx_simcall_t simcall, const char *name);
SG_END_DECL()
host_execution_destroy True (void) (execution, void*, smx_action_t)
host_execution_cancel True (void) (execution, void*, smx_action_t)
host_execution_get_remains True (double) (execution, void*, smx_action_t)
-host_execution_get_state True (int) (execution, void*, smx_action_t)
+host_execution_get_state True (int, e_smx_state_t) (execution, void*, smx_action_t)
host_execution_set_priority True (void) (execution, void*, smx_action_t) (priority, double)
host_execution_set_bound True (void) (execution, void*, smx_action_t) (bound, double)
host_execution_set_affinity True (void) (execution, void*, smx_action_t) (ws, void*, smx_host_t) (mask, unsigned long)
host_get_attached_storage_list True (void*, xbt_dynar_t) (host, void*, smx_host_t)
host_get_params True (void) (ind_vm, void*, smx_host_t) (params, void*, ws_params_t)
host_set_params True (void) (ind_vm, void*, smx_host_t) (params, void*, ws_params_t)
-vm_create True (void*) (name, const char*) (ind_pm, void*, smx_host_t)
+vm_create True (void*, smx_host_t) (name, const char*) (ind_pm, void*, smx_host_t)
vm_start True (void) (ind_vm, void*, smx_host_t)
vm_get_state True (int) (ind_vm, void*, smx_host_t)
vm_migrate True (void) (ind_vm, void*, smx_host_t) (ind_dst_pm, void*, smx_host_t)
comm_test False (int) (comm, void*, smx_action_t)
comm_testany False (int) (comms, void*, xbt_dynar_t)
comm_get_remains True (double) (comm, void*, smx_action_t)
-comm_get_state True (int) (comm, void*, smx_action_t)
+comm_get_state True (int, e_smx_state_t) (comm, void*, smx_action_t)
comm_get_src_data True (void*) (comm, void*, smx_action_t)
comm_get_dst_data True (void*) (comm, void*, smx_action_t)
comm_get_src_proc True (void*, smx_process_t) (comm, void*, smx_action_t)
cond_wait False (void) (cond, void*, smx_cond_t) (mutex, void*, smx_mutex_t)
cond_wait_timeout False (void) (cond, void*, smx_cond_t) (mutex, void*, smx_mutex_t) (timeout, double)
cond_broadcast True (void) (cond, void*, smx_cond_t)
-sem_init True (void*, smx_sem_t) (capacity, int)
+sem_init True (void*, smx_sem_t) (capacity, unsigned int)
sem_destroy True (void) (sem, void*, smx_sem_t)
sem_release True (void) (sem, void*, smx_sem_t)
sem_would_block True (int) (sem, void*, smx_sem_t)
## HAVE_TRACING
set_category True (void) (action, void*, smx_action_t) (category, const char*)
## HAVE_MC
-mc_snapshot True (void*)
-mc_compare_snapshots True (int) (s1, void*) (s2, void*)
+mc_snapshot True (void*, mc_snapshot_t)
+mc_compare_snapshots True (int) (s1, void*, mc_snapshot_t) (s2, void*, mc_snapshot_t)
mc_random True (int) (min, int) (max, int)
def field(self):
return self.simcall_types[self.type]
- def ret(self):
+ def rettype(self):
return '%s'%self.casted if self.casted else self.type
def cast(self):
if self.name not in self.simcalls_BODY:
print '# ERROR: No function calling simcall_BODY_%s'%self.name
print '# Add something like this to libsmx.c:'
- print '%s simcall_%s(%s) {'%(self.res.ret() ,self.name ,', '.join('%s %s'%(arg.ret(), arg.name) for arg in self.args))
+ print '%s simcall_%s(%s) {'%(self.res.rettype() ,self.name ,', '.join('%s %s'%(arg.rettype(), arg.name) for arg in self.args))
print ' return simcall_BODY_%s(%s);'%(self.name)
print '}'
return False
if self.name not in self.simcalls_PRE:
print '# ERROR: No function called simcall_HANDLER_%s'%self.name
print '# Add something like this to the relevant C file (like smx_io.c if it\'s an IO call):'
- print '%s simcall_HANDLER_%s(smx_simcall_t simcall%s) {'%(self.res.ret()
+ print '%s simcall_HANDLER_%s(smx_simcall_t simcall%s) {'%(self.res.rettype()
,self.name
- ,''.join(', %s %s'%(arg.ret(), arg.name)
+ ,''.join(', %s %s'%(arg.rettype(), arg.name)
for arg in self.args))
print ' // Your code handling the simcall'
print '}'
def accessors(self):
res = []
+ # Arguments getter/setters
for i in range(len(self.args)):
- res.append(self.arg_getter(i))
- res.append(self.arg_setter(i))
+ arg = self.args[i]
+ res.append('')
+ res.append('static inline %s simcall_%s__get__%s(smx_simcall_t simcall){'%(arg.rettype(), self.name, arg.name))
+ res.append(' return %s simcall->args[%i].%s;'%(arg.cast(), i, arg.field()))
+ res.append('}')
+ res.append('')
+ res.append('static inline void simcall_%s__set__%s(smx_simcall_t simcall, %s arg){'%(self.name, arg.name, arg.type))
+ res.append(' simcall->args[%i].%s = arg;'%(i, arg.field()))
+ res.append('}')
+
+ # Return value getter/setters
if self.res.type != 'void':
- res.append('static inline %s simcall_%s__get__result(smx_simcall_t simcall){'%(self.res.ret(), self.name))
+ res.append('static inline %s simcall_%s__get__result(smx_simcall_t simcall){'%(self.res.rettype(), self.name))
res.append(' return %s simcall->result.%s;'%(self.res.cast(), self.res.field()))
res.append('}')
res.append('static inline void simcall_%s__set__result(smx_simcall_t simcall, %s result){'%(self.name, self.res.type,))
res.append('}')
return '\n'.join(res)
- def arg_getter(self, i):
- arg = self.args[i]
- return '''
-static inline %s simcall_%s__get__%s(smx_simcall_t simcall){
- return %s simcall->args[%i].%s;
-}'''%(arg.ret(), self.name, arg.name, arg.cast(), i, arg.field())
-
- def arg_setter(self, i):
- arg = self.args[i]
- return '''
-static inline void simcall_%s__set__%s(smx_simcall_t simcall, %s arg){
- simcall->args[%i].%s = arg;
-}'''%(self.name, arg.name, arg.type, i, arg.field())
-
def case(self):
return '''case SIMCALL_%s:
%ssimcall_HANDLER_%s(simcall %s);
SIMIX_simcall_handle(&self->simcall, 0);
}
%s
- }'''%(self.res.ret()
+ }'''%(self.res.rettype()
,self.name
- ,', '.join('%s %s'%(arg.ret(), arg.name)
+ ,', '.join('%s %s'%(arg.rettype(), arg.name)
for arg in self.args)
,self.name
,', '.join(["&self->simcall"]+ [arg.name for arg in self.args])
,'\n'.join(' self->simcall.args[%d].%s = (%s) %s;'%(i, arg.field(), arg.type, arg.name)
for i, arg in enumerate(self.args))
,'' if self.res.type == 'void' else 'return self->simcall.result.%s;'%self.res.field())
+
+ def handler_prototype(self):
+ return "%s simcall_HANDLER_%s(smx_simcall_t simcall%s);"%(self.res.rettype() if self.has_answer else 'void', self.name, ''.join(', %s %s'%(arg.rettype(), arg.name)
+ for i, arg in enumerate(self.args)))
def parse(fn):
simcalls = []
###
fd = header('popping_accessors.h')
handle(fd, Simcall.accessors, simcalls, simcalls_dict)
+ fd.write("\n\n/* The prototype of all simcall handlers, automatically generated for you */\n\n")
+ handle(fd, Simcall.handler_prototype, simcalls, simcalls_dict)
fd.close()
###
return (process == NULL) ? NULL : SIMIX_process_get_host(process);
}
-const char* simcall_HANDLER_host_self_get_name(smx_simcall_t simcall){
- return SIMIX_host_self_get_name();
-}
/* needs to be public and without simcall because it is called
by exceptions and logging events */
const char* SIMIX_host_self_get_name(void)
void SIMIX_host_execution_set_priority(smx_action_t action, double priority);
void SIMIX_host_execution_set_bound(smx_action_t action, double bound);
void SIMIX_host_execution_set_affinity(smx_action_t action, smx_host_t host, unsigned long mask);
-void simcall_HANDLER_host_execution_wait(smx_simcall_t simcall, smx_action_t action);
xbt_dict_t SIMIX_host_get_mounted_storage_list(smx_host_t host);
xbt_dynar_t SIMIX_host_get_attached_storage_list(smx_host_t host);
-// handlers' prototypes
-smx_host_t simcall_HANDLER_host_get_by_name(smx_simcall_t, const char*);
-const char* simcall_HANDLER_host_self_get_name(smx_simcall_t);
-const char* simcall_HANDLER_host_get_name(smx_simcall_t, smx_host_t);
-void simcall_HANDLER_host_on(smx_simcall_t, smx_host_t host);
-void simcall_HANDLER_host_off(smx_simcall_t, smx_host_t host);
-xbt_dict_t simcall_HANDLER_host_get_properties(smx_simcall_t, smx_host_t);
-int simcall_HANDLER_host_get_core(smx_simcall_t, smx_host_t);
-xbt_swag_t simcall_HANDLER_host_get_process_list(smx_simcall_t, smx_host_t host);
-double simcall_HANDLER_host_get_speed(smx_simcall_t, smx_host_t);
-double simcall_HANDLER_host_get_available_speed(smx_simcall_t, smx_host_t);
-int simcall_HANDLER_host_get_state(smx_simcall_t, smx_host_t);
-double simcall_HANDLER_host_get_current_power_peak(smx_simcall_t, smx_host_t);
-double simcall_HANDLER_host_get_power_peak_at(smx_simcall_t, smx_host_t host, int pstate_index);
-int simcall_HANDLER_host_get_nb_pstates(smx_simcall_t, smx_host_t host);
-void simcall_HANDLER_host_set_power_peak_at(smx_simcall_t, smx_host_t host, int pstate_index);
-double simcall_HANDLER_host_get_consumed_energy(smx_simcall_t, smx_host_t);
-void* simcall_HANDLER_host_self_get_data(smx_simcall_t);
-smx_action_t simcall_HANDLER_host_execute(smx_simcall_t, const char*, smx_host_t, double, double, double, unsigned long);
-smx_action_t simcall_HANDLER_host_parallel_execute(smx_simcall_t, const char*, int, smx_host_t*,
- double*, double*, double, double);
-void simcall_HANDLER_host_execution_destroy(smx_simcall_t, smx_action_t);
-void simcall_HANDLER_host_execution_cancel(smx_simcall_t, smx_action_t);
-double simcall_HANDLER_host_execution_get_remains(smx_simcall_t, smx_action_t);
-e_smx_state_t simcall_HANDLER_host_execution_get_state(smx_simcall_t, smx_action_t);
-void simcall_HANDLER_host_execution_set_priority(smx_simcall_t, smx_action_t, double);
-void simcall_HANDLER_host_execution_set_bound(smx_simcall_t simcall, smx_action_t action, double bound);
-void simcall_HANDLER_host_execution_set_affinity(smx_simcall_t simcall, smx_action_t action, smx_host_t host, unsigned long mask);
void SIMIX_host_execution_suspend(smx_action_t action);
void SIMIX_host_execution_resume(smx_action_t action);
void SIMIX_post_host_execute(smx_action_t action);
-xbt_dict_t simcall_HANDLER_host_get_mounted_storage_list(smx_simcall_t, smx_host_t);
-xbt_dynar_t simcall_HANDLER_host_get_attached_storage_list(smx_simcall_t, smx_host_t);
#ifdef HAVE_TRACING
-void simcall_HANDLER_set_category(smx_simcall_t simcall, smx_action_t action,
- const char *category);
void SIMIX_set_category(smx_action_t action, const char *category);
#endif
/* vm related stuff */
smx_host_t SIMIX_vm_create(const char *name, smx_host_t ind_phys_host);
-smx_host_t simcall_HANDLER_vm_create(smx_simcall_t simcall, const char *name, smx_host_t ind_phys_host);
void SIMIX_vm_destroy(smx_host_t ind_vm);
-void simcall_HANDLER_vm_destroy(smx_simcall_t simcall, smx_host_t ind_vm);
// --
void SIMIX_vm_resume(smx_host_t ind_vm, smx_process_t issuer);
-void simcall_HANDLER_vm_resume(smx_simcall_t simcall, smx_host_t ind_vm);
void SIMIX_vm_suspend(smx_host_t ind_vm, smx_process_t issuer);
-void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, smx_host_t ind_vm);
// --
void SIMIX_vm_save(smx_host_t ind_vm, smx_process_t issuer);
-void simcall_HANDLER_vm_save(smx_simcall_t simcall, smx_host_t ind_vm);
void SIMIX_vm_restore(smx_host_t ind_vm, smx_process_t issuer);
-void simcall_HANDLER_vm_restore(smx_simcall_t simcall, smx_host_t ind_vm);
// --
void SIMIX_vm_start(smx_host_t ind_vm);
-void simcall_HANDLER_vm_start(smx_simcall_t simcall, smx_host_t ind_vm);
void SIMIX_vm_shutdown(smx_host_t ind_vm, smx_process_t issuer);
-void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, smx_host_t ind_vm);
// --
int SIMIX_vm_get_state(smx_host_t ind_vm);
-int simcall_HANDLER_vm_get_state(smx_simcall_t simcall, smx_host_t ind_vm);
// --
void SIMIX_vm_migrate(smx_host_t ind_vm, smx_host_t ind_dst_pm);
-void simcall_HANDLER_vm_migrate(smx_simcall_t simcall, smx_host_t ind_vm, smx_host_t ind_dst_pm);
void *SIMIX_vm_get_pm(smx_host_t ind_vm);
-void *simcall_HANDLER_vm_get_pm(smx_simcall_t simcall, smx_host_t ind_vm);
void SIMIX_vm_set_bound(smx_host_t ind_vm, double bound);
-void simcall_HANDLER_vm_set_bound(smx_simcall_t simcall, smx_host_t ind_vm, double bound);
void SIMIX_vm_set_affinity(smx_host_t ind_vm, smx_host_t ind_pm, unsigned long mask);
-void simcall_HANDLER_vm_set_affinity(smx_simcall_t simcall, smx_host_t ind_vm, smx_host_t ind_pm, unsigned long mask);
void SIMIX_host_get_params(smx_host_t ind_vm, ws_params_t params);
-void simcall_HANDLER_host_get_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_params_t params);
void SIMIX_host_set_params(smx_host_t ind_vm, ws_params_t params);
-void simcall_HANDLER_host_set_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_params_t params);
SG_END_DECL()
return surf_resource_get_properties(surf_storage_resource_priv(storage));
}
-const char* simcall_HANDLER_storage_get_name(smx_simcall_t simcall, smx_storage_t storage){
- return SIMIX_storage_get_name(storage);
-}
-
const char* SIMIX_storage_get_name(smx_storage_t storage){
xbt_assert((storage != NULL), "Invalid parameters");
return sg_storage_name(storage);
return surf_storage_get_content(storage);
}
-const char* simcall_HANDLER_storage_get_host(smx_simcall_t simcall, smx_storage_t storage){
- return SIMIX_storage_get_host(storage);
-}
-
const char* SIMIX_storage_get_host(smx_storage_t storage){
xbt_assert((storage != NULL), "Invalid parameters");
return surf_storage_get_host(storage);
smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data);
void SIMIX_storage_destroy(void *s);
-void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, smx_host_t host);
-void simcall_HANDLER_file_write(smx_simcall_t simcall,smx_file_t fd, sg_size_t size, smx_host_t host);
-void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, smx_host_t host);
-void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, smx_host_t host);
-int simcall_HANDLER_file_unlink(smx_simcall_t simcall, smx_file_t fd, smx_host_t host);
-sg_size_t simcall_HANDLER_file_get_size(smx_simcall_t simcall, smx_file_t fd);
-sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd);
-xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd);
-int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin);
-int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t size, smx_host_t host);
smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t size, smx_host_t host);
smx_action_t SIMIX_file_open(smx_process_t process, const char* fullpath, smx_host_t host);
int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin);
int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath);
-sg_size_t simcall_HANDLER_storage_get_free_size(smx_simcall_t simcall,smx_storage_t storage);
sg_size_t SIMIX_storage_get_free_size(smx_process_t process,smx_storage_t storage);
-
-sg_size_t simcall_HANDLER_storage_get_used_size(smx_simcall_t simcall,smx_storage_t storage);
sg_size_t SIMIX_storage_get_used_size(smx_process_t process,smx_storage_t storage);
xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
-xbt_dict_t simcall_HANDLER_storage_get_properties(smx_simcall_t, smx_storage_t);
-xbt_dict_t simcall_HANDLER_storage_get_content(smx_simcall_t simcall, smx_storage_t storage);
xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage);
-const char* simcall_HANDLER_storage_get_name(smx_simcall_t simcall, smx_storage_t storage);
-const char* simcall_HANDLER_storage_get_host(smx_simcall_t simcall, smx_storage_t storage);
void SIMIX_post_io(smx_action_t action);
void SIMIX_io_destroy(smx_action_t action);
void SIMIX_io_finish(smx_action_t action);
return rdv_points;
}
-smx_rdv_t simcall_HANDLER_rdv_get_by_name(smx_simcall_t simcall, const char *name){
- return SIMIX_rdv_get_by_name(name);
-}
smx_rdv_t SIMIX_rdv_get_by_name(const char *name)
{
return xbt_dict_get_or_null(rdv_points, name);
}
-int simcall_HANDLER_rdv_comm_count_by_host(smx_simcall_t simcall, smx_rdv_t rdv, smx_host_t host){
+unsigned int simcall_HANDLER_rdv_comm_count_by_host(smx_simcall_t simcall, smx_rdv_t rdv, smx_host_t host){
return SIMIX_rdv_comm_count_by_host(rdv, host);
}
int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host)
void SIMIX_comm_destroy_internal_actions(smx_action_t action);
smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int type, int src,
int tag, int (*match_fun)(void *, void *, smx_action_t), void *data);
-void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_action_t action, double timeout);
-void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t actions);
void SIMIX_post_comm(smx_action_t action);
-void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_action_t action);
-void simcall_HANDLER_comm_testany(smx_simcall_t simcall, xbt_dynar_t actions);
void SIMIX_comm_cancel(smx_action_t action);
double SIMIX_comm_get_remains(smx_action_t action);
e_smx_state_t SIMIX_comm_get_state(smx_action_t action);
smx_process_t SIMIX_comm_get_src_proc(smx_action_t action);
smx_process_t SIMIX_comm_get_dst_proc(smx_action_t action);
-// handlers' prototypes
-smx_action_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv,
- int type,int src, int tag,
- int (*match_fun)(void *, void *, smx_action_t),
- void *data);
-smx_rdv_t simcall_HANDLER_rdv_create(smx_simcall_t simcall, const char *name);
-void simcall_HANDLER_rdv_destroy(smx_simcall_t simcall, smx_rdv_t rdv);
-smx_rdv_t simcall_HANDLER_rdv_get_by_name(smx_simcall_t simcall, const char *name);
-int simcall_HANDLER_rdv_comm_count_by_host(smx_simcall_t simcall, smx_rdv_t rdv, smx_host_t host);
-smx_action_t simcall_HANDLER_rdv_get_head(smx_simcall_t simcall, smx_rdv_t rdv);
-smx_process_t simcall_HANDLER_rdv_get_receiver(smx_simcall_t simcall, smx_rdv_t rdv);
-void simcall_HANDLER_rdv_set_receiver(smx_simcall_t simcall, smx_rdv_t rdv,
- smx_process_t process);
-void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_rdv_t rdv,
- double task_size, double rate,
- void *src_buff, size_t src_buff_size,
- int (*match_fun)(void *, void *,smx_action_t),
- void (*copy_data_fun)(smx_action_t, void*, size_t),
- void *data, double timeout);
-smx_action_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src, smx_rdv_t rdv,
- double task_size, double rate,
- void *src_buff, size_t src_buff_size,
- int (*match_fun)(void *, void *,smx_action_t),
- void (*clean_fun)(void *),
- void (*copy_data_fun)(smx_action_t, void*, size_t),
- void *data, int detached);
-void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv,
- void *dst_buff, size_t *dst_buff_size,
- int (*match_fun)(void *, void *, smx_action_t),
- void (*copy_data_fun)(smx_action_t, void*, size_t),
- void *data, double timeout, double rate);
-smx_action_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_rdv_t rdv,
- void *dst_buff, size_t *dst_buff_size,
- int (*match_fun)(void *, void *, smx_action_t),
- void (*copy_data_fun)(smx_action_t, void*, size_t),
- void *data, double rate);
-void simcall_HANDLER_comm_cancel(smx_simcall_t simcall, smx_action_t action);
-double simcall_HANDLER_comm_get_remains(smx_simcall_t simcall, smx_action_t action);
-e_smx_state_t simcall_HANDLER_comm_get_state(smx_simcall_t simcall, smx_action_t action);
-void* simcall_HANDLER_comm_get_src_data(smx_simcall_t simcall, smx_action_t action);
-void* simcall_HANDLER_comm_get_dst_data(smx_simcall_t simcall, smx_action_t action);
-smx_process_t simcall_HANDLER_comm_get_src_proc(smx_simcall_t simcall, smx_action_t action);
-smx_process_t simcall_HANDLER_comm_get_dst_proc(smx_simcall_t simcall, smx_action_t action);
-#ifdef HAVE_LATENCY_BOUND_TRACKING
-int simcall_HANDLER_comm_is_latency_bounded(smx_simcall_t simcall, smx_action_t action);
-#endif
#endif
return self->ppid;
}
-void* simcall_HANDLER_process_self_get_data(smx_simcall_t simcall, smx_process_t self){
- return SIMIX_process_self_get_data(self);
-}
-
void* SIMIX_process_self_get_data(smx_process_t self)
{
xbt_assert(self == SIMIX_process_self(), "This is not the current process");
void SIMIX_process_yield(smx_process_t self);
xbt_running_ctx_t *SIMIX_process_get_running_context(void);
void SIMIX_process_exception_terminate(xbt_ex_t * e);
-void simcall_HANDLER_process_change_host(smx_simcall_t, smx_process_t process,
- smx_host_t dest);
void SIMIX_process_change_host(smx_process_t process,
smx_host_t dest);
-void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process);
smx_action_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer);
void SIMIX_process_resume(smx_process_t process, smx_process_t issuer);
int SIMIX_process_get_PID(smx_process_t self);
smx_process_t SIMIX_process_get_by_name(const char* name);
int SIMIX_process_is_suspended(smx_process_t process);
xbt_dict_t SIMIX_process_get_properties(smx_process_t process);
-void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout);
smx_action_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout);
-void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
smx_action_t SIMIX_process_sleep(smx_process_t process, double duration);
void SIMIX_post_process_sleep(smx_action_t action);
void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart);
smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer);
-// handlers' prototypes
-void simcall_HANDLER_process_create(smx_simcall_t simcall, 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);
-void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_process_t process);
-void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid);
-void simcall_HANDLER_process_cleanup(smx_simcall_t simcall, smx_process_t process);
-void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_process_t process);
-int simcall_HANDLER_process_count(smx_simcall_t simcall);
-void* simcall_HANDLER_process_self_get_data(smx_simcall_t simcall, smx_process_t process);
-int simcall_HANDLER_process_get_PID(smx_simcall_t simcall, smx_process_t self);
-int simcall_HANDLER_process_get_PPID(smx_simcall_t simcall, smx_process_t self);
-void* simcall_HANDLER_process_get_data(smx_simcall_t simcall, smx_process_t process);
-void simcall_HANDLER_process_set_data(smx_simcall_t simcall, smx_process_t process,
- void *data);
-smx_host_t simcall_HANDLER_process_get_host(smx_simcall_t simcall, smx_process_t process);
-const char* simcall_HANDLER_process_get_name(smx_simcall_t simcall, smx_process_t process);
-int simcall_HANDLER_process_is_suspended(smx_simcall_t simcall, smx_process_t process);
-xbt_dict_t simcall_HANDLER_process_get_properties(smx_simcall_t simcall, smx_process_t process);
-void simcall_HANDLER_process_on_exit(smx_simcall_t simcall, smx_process_t process,
- int_f_pvoid_pvoid_t fun, void *data);
-void simcall_HANDLER_process_auto_restart_set(smx_simcall_t simcall, smx_process_t process,
- int auto_restart);
-smx_process_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_process_t process);
-
SG_END_DECL()
#endif
_SIMIX_sem_wait(sem, timeout, simcall->issuer, simcall);
XBT_OUT();
}
+int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t sem) {
+ return SIMIX_sem_would_block(sem);
+}
smx_mutex_t SIMIX_mutex_init(void);
void SIMIX_mutex_destroy(smx_mutex_t mutex);
-void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex);
int SIMIX_mutex_trylock(smx_mutex_t mutex, smx_process_t issuer);
void SIMIX_mutex_unlock(smx_mutex_t mutex, smx_process_t issuer);
smx_cond_t SIMIX_cond_init(void);
void SIMIX_cond_destroy(smx_cond_t cond);
void SIMIX_cond_signal(smx_cond_t cond);
-void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex);
-void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond,
- smx_mutex_t mutex, double timeout);
void SIMIX_cond_broadcast(smx_cond_t cond);
smx_sem_t SIMIX_sem_init(unsigned int value);
void SIMIX_sem_destroy(smx_sem_t sem);
void SIMIX_sem_release(smx_sem_t sem);
int SIMIX_sem_would_block(smx_sem_t sem);
-void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem);
-void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout);
int SIMIX_sem_get_capacity(smx_sem_t sem);
-// handlers prototypes
-smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall);
-void simcall_HANDLER_mutex_destroy(smx_simcall_t simcall, smx_mutex_t mutex);
-int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex);
-void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex);
-smx_cond_t simcall_HANDLER_cond_init(smx_simcall_t simcall);
-void simcall_HANDLER_cond_destroy(smx_simcall_t simcall, smx_cond_t cond);
-void simcall_HANDLER_cond_signal(smx_simcall_t simcall, smx_cond_t cond);
-void simcall_HANDLER_cond_broadcast(smx_simcall_t simcall, smx_cond_t cond);
-smx_sem_t simcall_HANDLER_sem_init(smx_simcall_t simcall, unsigned int value);
-void simcall_HANDLER_sem_destroy(smx_simcall_t simcall, smx_sem_t sem);
-void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem);
-static XBT_INLINE int simcall_HANDLER_sem_would_block(smx_simcall_t simcall,
- smx_sem_t sem)
-{
- return SIMIX_sem_would_block(sem);
-}
-int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem);
#endif