1 /**********************************************************************/
2 /* File generated by src/simix/simcalls.py from src/simix/simcalls.in */
4 /* DO NOT EVER CHANGE THIS FILE */
6 /* change simcalls specification in src/simix/simcalls.in */
7 /**********************************************************************/
10 * Note that the name comes from http://en.wikipedia.org/wiki/Popping
11 * Indeed, the control flow is doing a strange dance in there.
13 * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
17 #include "smx_private.h"
18 #include "src/mc/mc_forward.hpp"
20 #include <simgrid/simix.hpp>
21 /** @cond */ // Please Doxygen, don't look at this
23 template<class R, class... T>
24 inline static R simcall(e_smx_simcall_t call, T const&... t)
26 smx_actor_t self = SIMIX_process_self();
27 simgrid::simix::marshal(&self->simcall, call, t...);
28 if (self != simix_global->maestro_process) {
29 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(),
30 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
31 SIMIX_process_yield(self);
33 SIMIX_simcall_handle(&self->simcall, 0);
35 return simgrid::simix::unmarshal<R>(self->simcall.result);
38 inline static void simcall_BODY_process_kill(smx_actor_t process) {
39 /* Go to that function to follow the code flow through the simcall barrier */
40 if (0) simcall_HANDLER_process_kill(&SIMIX_process_self()->simcall, process);
41 return simcall<void, smx_actor_t>(SIMCALL_PROCESS_KILL, process);
44 inline static void simcall_BODY_process_killall(int reset_pid) {
45 /* Go to that function to follow the code flow through the simcall barrier */
46 if (0) simcall_HANDLER_process_killall(&SIMIX_process_self()->simcall, reset_pid);
47 return simcall<void, int>(SIMCALL_PROCESS_KILLALL, reset_pid);
50 inline static void simcall_BODY_process_cleanup(smx_actor_t process) {
51 /* Go to that function to follow the code flow through the simcall barrier */
52 if (0) SIMIX_process_cleanup(process);
53 return simcall<void, smx_actor_t>(SIMCALL_PROCESS_CLEANUP, process);
56 inline static void simcall_BODY_process_suspend(smx_actor_t process) {
57 /* Go to that function to follow the code flow through the simcall barrier */
58 if (0) simcall_HANDLER_process_suspend(&SIMIX_process_self()->simcall, process);
59 return simcall<void, smx_actor_t>(SIMCALL_PROCESS_SUSPEND, process);
62 inline static void simcall_BODY_process_resume(smx_actor_t process) {
63 /* Go to that function to follow the code flow through the simcall barrier */
64 if (0) SIMIX_process_resume(process);
65 return simcall<void, smx_actor_t>(SIMCALL_PROCESS_RESUME, process);
68 inline static void simcall_BODY_process_set_host(smx_actor_t process, sg_host_t dest) {
69 /* Go to that function to follow the code flow through the simcall barrier */
70 if (0) simcall_HANDLER_process_set_host(&SIMIX_process_self()->simcall, process, dest);
71 return simcall<void, smx_actor_t, sg_host_t>(SIMCALL_PROCESS_SET_HOST, process, dest);
74 inline static int simcall_BODY_process_is_suspended(smx_actor_t process) {
75 /* Go to that function to follow the code flow through the simcall barrier */
76 if (0) SIMIX_process_is_suspended(process);
77 return simcall<int, smx_actor_t>(SIMCALL_PROCESS_IS_SUSPENDED, process);
80 inline static int simcall_BODY_process_join(smx_actor_t process, double timeout) {
81 /* Go to that function to follow the code flow through the simcall barrier */
82 if (0) simcall_HANDLER_process_join(&SIMIX_process_self()->simcall, process, timeout);
83 return simcall<int, smx_actor_t, double>(SIMCALL_PROCESS_JOIN, process, timeout);
86 inline static int simcall_BODY_process_sleep(double duration) {
87 /* Go to that function to follow the code flow through the simcall barrier */
88 if (0) simcall_HANDLER_process_sleep(&SIMIX_process_self()->simcall, duration);
89 return simcall<int, double>(SIMCALL_PROCESS_SLEEP, duration);
92 inline static smx_activity_t simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound) {
93 /* Go to that function to follow the code flow through the simcall barrier */
94 if (0) simcall_HANDLER_execution_start(&SIMIX_process_self()->simcall, name, flops_amount, priority, bound);
95 return simcall<smx_activity_t, const char*, double, double, double>(SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
98 inline static smx_activity_t simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) {
99 /* Go to that function to follow the code flow through the simcall barrier */
100 if (0) SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate, timeout);
101 return simcall<smx_activity_t, const char*, int, sg_host_t*, double*, double*, double, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount, bytes_amount, amount, rate, timeout);
104 inline static void simcall_BODY_execution_cancel(smx_activity_t execution) {
105 /* Go to that function to follow the code flow through the simcall barrier */
106 if (0) SIMIX_execution_cancel(execution);
107 return simcall<void, smx_activity_t>(SIMCALL_EXECUTION_CANCEL, execution);
110 inline static void simcall_BODY_execution_set_priority(smx_activity_t execution, double priority) {
111 /* Go to that function to follow the code flow through the simcall barrier */
112 if (0) SIMIX_execution_set_priority(execution, priority);
113 return simcall<void, smx_activity_t, double>(SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
116 inline static void simcall_BODY_execution_set_bound(smx_activity_t execution, double bound) {
117 /* Go to that function to follow the code flow through the simcall barrier */
118 if (0) SIMIX_execution_set_bound(execution, bound);
119 return simcall<void, smx_activity_t, double>(SIMCALL_EXECUTION_SET_BOUND, execution, bound);
122 inline static int simcall_BODY_execution_wait(smx_activity_t execution) {
123 /* Go to that function to follow the code flow through the simcall barrier */
124 if (0) simcall_HANDLER_execution_wait(&SIMIX_process_self()->simcall, execution);
125 return simcall<int, smx_activity_t>(SIMCALL_EXECUTION_WAIT, execution);
128 inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) {
129 /* Go to that function to follow the code flow through the simcall barrier */
130 if (0) SIMIX_process_on_exit(process, fun, data);
131 return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
134 inline static void simcall_BODY_process_auto_restart_set(smx_actor_t process, int auto_restart) {
135 /* Go to that function to follow the code flow through the simcall barrier */
136 if (0) SIMIX_process_auto_restart_set(process, auto_restart);
137 return simcall<void, smx_actor_t, int>(SIMCALL_PROCESS_AUTO_RESTART_SET, process, auto_restart);
140 inline static smx_actor_t simcall_BODY_process_restart(smx_actor_t process) {
141 /* Go to that function to follow the code flow through the simcall barrier */
142 if (0) simcall_HANDLER_process_restart(&SIMIX_process_self()->simcall, process);
143 return simcall<smx_actor_t, smx_actor_t>(SIMCALL_PROCESS_RESTART, process);
146 inline static smx_activity_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
147 /* Go to that function to follow the code flow through the simcall barrier */
148 if (0) simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, src, tag, match_fun, data);
149 return simcall<smx_activity_t, smx_mailbox_t, int, int, int, simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data);
152 inline static void simcall_BODY_comm_send(smx_actor_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) {
153 /* Go to that function to follow the code flow through the simcall barrier */
154 if (0) simcall_HANDLER_comm_send(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
155 return simcall<void, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
158 inline static smx_activity_t simcall_BODY_comm_isend(smx_actor_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) {
159 /* Go to that function to follow the code flow through the simcall barrier */
160 if (0) simcall_HANDLER_comm_isend(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
161 return simcall<smx_activity_t, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
164 inline static void simcall_BODY_comm_recv(smx_actor_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) {
165 /* Go to that function to follow the code flow through the simcall barrier */
166 if (0) simcall_HANDLER_comm_recv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
167 return simcall<void, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
170 inline static smx_activity_t simcall_BODY_comm_irecv(smx_actor_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) {
171 /* Go to that function to follow the code flow through the simcall barrier */
172 if (0) simcall_HANDLER_comm_irecv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
173 return simcall<smx_activity_t, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
176 inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) {
177 /* Go to that function to follow the code flow through the simcall barrier */
178 if (0) simcall_HANDLER_comm_waitany(&SIMIX_process_self()->simcall, comms, timeout);
179 return simcall<int, xbt_dynar_t, double>(SIMCALL_COMM_WAITANY, comms, timeout);
182 inline static void simcall_BODY_comm_wait(smx_activity_t comm, double timeout) {
183 /* Go to that function to follow the code flow through the simcall barrier */
184 if (0) simcall_HANDLER_comm_wait(&SIMIX_process_self()->simcall, comm, timeout);
185 return simcall<void, smx_activity_t, double>(SIMCALL_COMM_WAIT, comm, timeout);
188 inline static int simcall_BODY_comm_test(smx_activity_t comm) {
189 /* Go to that function to follow the code flow through the simcall barrier */
190 if (0) simcall_HANDLER_comm_test(&SIMIX_process_self()->simcall, comm);
191 return simcall<int, smx_activity_t>(SIMCALL_COMM_TEST, comm);
194 inline static int simcall_BODY_comm_testany(smx_activity_t* comms, size_t count) {
195 /* Go to that function to follow the code flow through the simcall barrier */
196 if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count);
197 return simcall<int, smx_activity_t*, size_t>(SIMCALL_COMM_TESTANY, comms, count);
200 inline static smx_mutex_t simcall_BODY_mutex_init() {
201 /* Go to that function to follow the code flow through the simcall barrier */
202 if (0) simcall_HANDLER_mutex_init(&SIMIX_process_self()->simcall);
203 return simcall<smx_mutex_t>(SIMCALL_MUTEX_INIT);
206 inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
207 /* Go to that function to follow the code flow through the simcall barrier */
208 if (0) simcall_HANDLER_mutex_lock(&SIMIX_process_self()->simcall, mutex);
209 return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_LOCK, mutex);
212 inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
213 /* Go to that function to follow the code flow through the simcall barrier */
214 if (0) simcall_HANDLER_mutex_trylock(&SIMIX_process_self()->simcall, mutex);
215 return simcall<int, smx_mutex_t>(SIMCALL_MUTEX_TRYLOCK, mutex);
218 inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
219 /* Go to that function to follow the code flow through the simcall barrier */
220 if (0) simcall_HANDLER_mutex_unlock(&SIMIX_process_self()->simcall, mutex);
221 return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_UNLOCK, mutex);
224 inline static smx_cond_t simcall_BODY_cond_init() {
225 /* Go to that function to follow the code flow through the simcall barrier */
226 if (0) SIMIX_cond_init();
227 return simcall<smx_cond_t>(SIMCALL_COND_INIT);
230 inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
231 /* Go to that function to follow the code flow through the simcall barrier */
232 if (0) SIMIX_cond_signal(cond);
233 return simcall<void, smx_cond_t>(SIMCALL_COND_SIGNAL, cond);
236 inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
237 /* Go to that function to follow the code flow through the simcall barrier */
238 if (0) simcall_HANDLER_cond_wait(&SIMIX_process_self()->simcall, cond, mutex);
239 return simcall<void, smx_cond_t, smx_mutex_t>(SIMCALL_COND_WAIT, cond, mutex);
242 inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
243 /* Go to that function to follow the code flow through the simcall barrier */
244 if (0) simcall_HANDLER_cond_wait_timeout(&SIMIX_process_self()->simcall, cond, mutex, timeout);
245 return simcall<void, smx_cond_t, smx_mutex_t, double>(SIMCALL_COND_WAIT_TIMEOUT, cond, mutex, timeout);
248 inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
249 /* Go to that function to follow the code flow through the simcall barrier */
250 if (0) SIMIX_cond_broadcast(cond);
251 return simcall<void, smx_cond_t>(SIMCALL_COND_BROADCAST, cond);
254 inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
255 /* Go to that function to follow the code flow through the simcall barrier */
256 if (0) SIMIX_sem_init(capacity);
257 return simcall<smx_sem_t, unsigned int>(SIMCALL_SEM_INIT, capacity);
260 inline static void simcall_BODY_sem_release(smx_sem_t sem) {
261 /* Go to that function to follow the code flow through the simcall barrier */
262 if (0) simcall_HANDLER_sem_release(&SIMIX_process_self()->simcall, sem);
263 return simcall<void, smx_sem_t>(SIMCALL_SEM_RELEASE, sem);
266 inline static int simcall_BODY_sem_would_block(smx_sem_t sem) {
267 /* Go to that function to follow the code flow through the simcall barrier */
268 if (0) simcall_HANDLER_sem_would_block(&SIMIX_process_self()->simcall, sem);
269 return simcall<int, smx_sem_t>(SIMCALL_SEM_WOULD_BLOCK, sem);
272 inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
273 /* Go to that function to follow the code flow through the simcall barrier */
274 if (0) simcall_HANDLER_sem_acquire(&SIMIX_process_self()->simcall, sem);
275 return simcall<void, smx_sem_t>(SIMCALL_SEM_ACQUIRE, sem);
278 inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
279 /* Go to that function to follow the code flow through the simcall barrier */
280 if (0) simcall_HANDLER_sem_acquire_timeout(&SIMIX_process_self()->simcall, sem, timeout);
281 return simcall<void, smx_sem_t, double>(SIMCALL_SEM_ACQUIRE_TIMEOUT, sem, timeout);
284 inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
285 /* Go to that function to follow the code flow through the simcall barrier */
286 if (0) simcall_HANDLER_sem_get_capacity(&SIMIX_process_self()->simcall, sem);
287 return simcall<int, smx_sem_t>(SIMCALL_SEM_GET_CAPACITY, sem);
290 inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size, sg_host_t host) {
291 /* Go to that function to follow the code flow through the simcall barrier */
292 if (0) simcall_HANDLER_file_read(&SIMIX_process_self()->simcall, fd, size, host);
293 return simcall<sg_size_t, smx_file_t, sg_size_t, sg_host_t>(SIMCALL_FILE_READ, fd, size, host);
296 inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size, sg_host_t host) {
297 /* Go to that function to follow the code flow through the simcall barrier */
298 if (0) simcall_HANDLER_file_write(&SIMIX_process_self()->simcall, fd, size, host);
299 return simcall<sg_size_t, smx_file_t, sg_size_t, sg_host_t>(SIMCALL_FILE_WRITE, fd, size, host);
302 inline static smx_file_t simcall_BODY_file_open(const char* fullpath, sg_host_t host) {
303 /* Go to that function to follow the code flow through the simcall barrier */
304 if (0) simcall_HANDLER_file_open(&SIMIX_process_self()->simcall, fullpath, host);
305 return simcall<smx_file_t, const char*, sg_host_t>(SIMCALL_FILE_OPEN, fullpath, host);
308 inline static int simcall_BODY_file_close(smx_file_t fd, sg_host_t host) {
309 /* Go to that function to follow the code flow through the simcall barrier */
310 if (0) simcall_HANDLER_file_close(&SIMIX_process_self()->simcall, fd, host);
311 return simcall<int, smx_file_t, sg_host_t>(SIMCALL_FILE_CLOSE, fd, host);
314 inline static int simcall_BODY_file_unlink(smx_file_t fd, sg_host_t host) {
315 /* Go to that function to follow the code flow through the simcall barrier */
316 if (0) SIMIX_file_unlink(fd, host);
317 return simcall<int, smx_file_t, sg_host_t>(SIMCALL_FILE_UNLINK, fd, host);
320 inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
321 /* Go to that function to follow the code flow through the simcall barrier */
322 if (0) simcall_HANDLER_file_get_size(&SIMIX_process_self()->simcall, fd);
323 return simcall<sg_size_t, smx_file_t>(SIMCALL_FILE_GET_SIZE, fd);
326 inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) {
327 /* Go to that function to follow the code flow through the simcall barrier */
328 if (0) simcall_HANDLER_file_tell(&SIMIX_process_self()->simcall, fd);
329 return simcall<sg_size_t, smx_file_t>(SIMCALL_FILE_TELL, fd);
332 inline static int simcall_BODY_file_seek(smx_file_t fd, sg_offset_t offset, int origin) {
333 /* Go to that function to follow the code flow through the simcall barrier */
334 if (0) simcall_HANDLER_file_seek(&SIMIX_process_self()->simcall, fd, offset, origin);
335 return simcall<int, smx_file_t, sg_offset_t, int>(SIMCALL_FILE_SEEK, fd, offset, origin);
338 inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) {
339 /* Go to that function to follow the code flow through the simcall barrier */
340 if (0) simcall_HANDLER_file_get_info(&SIMIX_process_self()->simcall, fd);
341 return simcall<xbt_dynar_t, smx_file_t>(SIMCALL_FILE_GET_INFO, fd);
344 inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
345 /* Go to that function to follow the code flow through the simcall barrier */
346 if (0) simcall_HANDLER_file_move(&SIMIX_process_self()->simcall, fd, fullpath);
347 return simcall<int, smx_file_t, const char*>(SIMCALL_FILE_MOVE, fd, fullpath);
350 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
351 /* Go to that function to follow the code flow through the simcall barrier */
352 if (0) SIMIX_storage_get_properties(storage);
353 return simcall<xbt_dict_t, smx_storage_t>(SIMCALL_STORAGE_GET_PROPERTIES, storage);
356 inline static int simcall_BODY_mc_random(int min, int max) {
357 /* Go to that function to follow the code flow through the simcall barrier */
358 if (0) simcall_HANDLER_mc_random(&SIMIX_process_self()->simcall, min, max);
359 return simcall<int, int, int>(SIMCALL_MC_RANDOM, min, max);
362 inline static void simcall_BODY_set_category(smx_activity_t synchro, const char* category) {
363 /* Go to that function to follow the code flow through the simcall barrier */
364 if (0) SIMIX_set_category(synchro, category);
365 return simcall<void, smx_activity_t, const char*>(SIMCALL_SET_CATEGORY, synchro, category);
368 inline static void simcall_BODY_run_kernel(std::function<void()> const* code) {
369 /* Go to that function to follow the code flow through the simcall barrier */
370 if (0) SIMIX_run_kernel(code);
371 return simcall<void, std::function<void()> const*>(SIMCALL_RUN_KERNEL, code);
374 inline static void simcall_BODY_run_blocking(std::function<void()> const* code) {
375 /* Go to that function to follow the code flow through the simcall barrier */
376 if (0) SIMIX_run_blocking(code);
377 return simcall<void, std::function<void()> const*>(SIMCALL_RUN_BLOCKING, code);