Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill kill simcall
[simgrid.git] / src / simix / popping_generated.cpp
1 /**********************************************************************/
2 /* File generated by src/simix/simcalls.py from src/simix/simcalls.in */
3 /*                                                                    */
4 /*                    DO NOT EVER CHANGE THIS FILE                    */
5 /*                                                                    */
6 /* change simcalls specification in src/simix/simcalls.in             */
7 /* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved.    */
8 /**********************************************************************/
9
10 /*
11  * Note that the name comes from http://en.wikipedia.org/wiki/Popping
12  * Indeed, the control flow is doing a strange dance in there.
13  *
14  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
15  */
16
17 #include <xbt/base.h>
18 #include "smx_private.h"
19 #if SIMGRID_HAVE_MC
20 #include "src/mc/mc_forward.hpp"
21 #endif
22
23 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
24
25 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
26 const char* simcall_names[] = {
27     "SIMCALL_NONE",
28     "SIMCALL_PROCESS_KILLALL",
29     "SIMCALL_PROCESS_CLEANUP",
30     "SIMCALL_PROCESS_SUSPEND",
31     "SIMCALL_PROCESS_JOIN",
32     "SIMCALL_PROCESS_SLEEP",
33     "SIMCALL_EXECUTION_START",
34     "SIMCALL_EXECUTION_PARALLEL_START",
35     "SIMCALL_EXECUTION_CANCEL",
36     "SIMCALL_EXECUTION_SET_PRIORITY",
37     "SIMCALL_EXECUTION_SET_BOUND",
38     "SIMCALL_EXECUTION_WAIT",
39     "SIMCALL_PROCESS_ON_EXIT",
40     "SIMCALL_COMM_IPROBE",
41     "SIMCALL_COMM_SEND",
42     "SIMCALL_COMM_ISEND",
43     "SIMCALL_COMM_RECV",
44     "SIMCALL_COMM_IRECV",
45     "SIMCALL_COMM_WAITANY",
46     "SIMCALL_COMM_WAIT",
47     "SIMCALL_COMM_TEST",
48     "SIMCALL_COMM_TESTANY",
49     "SIMCALL_MUTEX_LOCK",
50     "SIMCALL_MUTEX_TRYLOCK",
51     "SIMCALL_MUTEX_UNLOCK",
52     "SIMCALL_COND_INIT",
53     "SIMCALL_COND_SIGNAL",
54     "SIMCALL_COND_WAIT",
55     "SIMCALL_COND_WAIT_TIMEOUT",
56     "SIMCALL_COND_BROADCAST",
57     "SIMCALL_SEM_ACQUIRE",
58     "SIMCALL_SEM_ACQUIRE_TIMEOUT",
59     "SIMCALL_FILE_READ",
60     "SIMCALL_FILE_WRITE",
61     "SIMCALL_MC_RANDOM",
62     "SIMCALL_SET_CATEGORY",
63     "SIMCALL_RUN_KERNEL",
64     "SIMCALL_RUN_BLOCKING",
65 };
66
67 /** @private
68  * @brief (in kernel mode) unpack the simcall and activate the handler
69  *
70  * This function is generated from src/simix/simcalls.in
71  */
72 void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
73   XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));
74   SIMCALL_SET_MC_VALUE(simcall, value);
75   if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
76     return;
77   switch (simcall->call) {
78 case SIMCALL_PROCESS_KILLALL:
79       simcall_HANDLER_process_killall(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]));
80       SIMIX_simcall_answer(simcall);
81       break;
82
83 case SIMCALL_PROCESS_CLEANUP:
84       SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
85       SIMIX_simcall_answer(simcall);
86       break;
87
88 case SIMCALL_PROCESS_SUSPEND:
89       simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
90       break;
91
92 case SIMCALL_PROCESS_JOIN:
93       simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
94       break;
95
96 case SIMCALL_PROCESS_SLEEP:
97       simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal<double>(simcall->args[0]));
98       break;
99
100 case SIMCALL_EXECUTION_START:
101   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(
102       simcall->result,
103       simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]),
104                                       simgrid::simix::unmarshal<double>(simcall->args[1]),
105                                       simgrid::simix::unmarshal<double>(simcall->args[2]),
106                                       simgrid::simix::unmarshal<double>(simcall->args[3])));
107   SIMIX_simcall_answer(simcall);
108   break;
109
110 case SIMCALL_EXECUTION_PARALLEL_START:
111   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(
112       simcall->result,
113       SIMIX_execution_parallel_start(
114           simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]),
115           simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]),
116           simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]),
117           simgrid::simix::unmarshal<double>(simcall->args[6])));
118   SIMIX_simcall_answer(simcall);
119   break;
120
121 case SIMCALL_EXECUTION_CANCEL:
122   SIMIX_execution_cancel(
123       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
124   SIMIX_simcall_answer(simcall);
125   break;
126
127 case SIMCALL_EXECUTION_SET_PRIORITY:
128   SIMIX_execution_set_priority(
129       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
130       simgrid::simix::unmarshal<double>(simcall->args[1]));
131   SIMIX_simcall_answer(simcall);
132   break;
133
134 case SIMCALL_EXECUTION_SET_BOUND:
135   SIMIX_execution_set_bound(
136       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
137       simgrid::simix::unmarshal<double>(simcall->args[1]));
138   SIMIX_simcall_answer(simcall);
139   break;
140
141 case SIMCALL_EXECUTION_WAIT:
142   simcall_HANDLER_execution_wait(
143       simcall,
144       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
145   break;
146
147 case SIMCALL_PROCESS_ON_EXIT:
148       SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
149       SIMIX_simcall_answer(simcall);
150       break;
151
152 case SIMCALL_COMM_IPROBE:
153   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
154       simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]),
155                                                    simgrid::simix::unmarshal<int>(simcall->args[1]),
156                                                    simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[2]),
157                                                    simgrid::simix::unmarshal<void*>(simcall->args[3])));
158   SIMIX_simcall_answer(simcall);
159   break;
160
161 case SIMCALL_COMM_SEND:
162       simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]), simgrid::simix::unmarshal<void*>(simcall->args[8]), simgrid::simix::unmarshal<double>(simcall->args[9]));
163       break;
164
165 case SIMCALL_COMM_ISEND:
166   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
167       simcall->result,
168       simcall_HANDLER_comm_isend(
169           simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
170           simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
171           simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]),
172           simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]),
173           simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]),
174           simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]),
175           simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]),
176           simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
177   SIMIX_simcall_answer(simcall);
178   break;
179
180 case SIMCALL_COMM_RECV:
181       simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7]), simgrid::simix::unmarshal<double>(simcall->args[8]));
182       break;
183
184 case SIMCALL_COMM_IRECV:
185   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
186       simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
187                                                   simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
188                                                   simgrid::simix::unmarshal<void*>(simcall->args[2]),
189                                                   simgrid::simix::unmarshal<size_t*>(simcall->args[3]),
190                                                   simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]),
191                                                   simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]),
192                                                   simgrid::simix::unmarshal<void*>(simcall->args[6]),
193                                                   simgrid::simix::unmarshal<double>(simcall->args[7])));
194   SIMIX_simcall_answer(simcall);
195   break;
196
197 case SIMCALL_COMM_WAITANY:
198       simcall_HANDLER_comm_waitany(simcall, simgrid::simix::unmarshal<xbt_dynar_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
199       break;
200
201 case SIMCALL_COMM_WAIT:
202   simcall_HANDLER_comm_wait(
203       simcall,
204       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
205       simgrid::simix::unmarshal<double>(simcall->args[1]));
206   break;
207
208 case SIMCALL_COMM_TEST:
209   simcall_HANDLER_comm_test(
210       simcall,
211       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
212   break;
213
214 case SIMCALL_COMM_TESTANY:
215   simcall_HANDLER_comm_testany(
216       simcall,
217       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]),
218       simgrid::simix::unmarshal<size_t>(simcall->args[1]));
219   break;
220
221 case SIMCALL_MUTEX_LOCK:
222       simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
223       break;
224
225 case SIMCALL_MUTEX_TRYLOCK:
226       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mutex_trylock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0])));
227       SIMIX_simcall_answer(simcall);
228       break;
229
230 case SIMCALL_MUTEX_UNLOCK:
231       simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
232       SIMIX_simcall_answer(simcall);
233       break;
234
235 case SIMCALL_COND_INIT:
236       simgrid::simix::marshal<smx_cond_t>(simcall->result, SIMIX_cond_init());
237       SIMIX_simcall_answer(simcall);
238       break;
239
240 case SIMCALL_COND_SIGNAL:
241       SIMIX_cond_signal(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
242       SIMIX_simcall_answer(simcall);
243       break;
244
245 case SIMCALL_COND_WAIT:
246       simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]));
247       break;
248
249 case SIMCALL_COND_WAIT_TIMEOUT:
250       simcall_HANDLER_cond_wait_timeout(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]));
251       break;
252
253 case SIMCALL_COND_BROADCAST:
254       SIMIX_cond_broadcast(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
255       SIMIX_simcall_answer(simcall);
256       break;
257
258 case SIMCALL_SEM_ACQUIRE:
259       simcall_HANDLER_sem_acquire(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
260       break;
261
262 case SIMCALL_SEM_ACQUIRE_TIMEOUT:
263       simcall_HANDLER_sem_acquire_timeout(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
264       break;
265
266 case SIMCALL_FILE_READ:
267   simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
268                             simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
269   break;
270
271 case SIMCALL_FILE_WRITE:
272   simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
273                              simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
274   break;
275
276 case SIMCALL_MC_RANDOM:
277       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1])));
278       SIMIX_simcall_answer(simcall);
279       break;
280
281 case SIMCALL_SET_CATEGORY:
282   SIMIX_set_category(
283       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
284       simgrid::simix::unmarshal<const char*>(simcall->args[1]));
285   SIMIX_simcall_answer(simcall);
286   break;
287
288 case SIMCALL_RUN_KERNEL:
289       SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
290       SIMIX_simcall_answer(simcall);
291       break;
292
293 case SIMCALL_RUN_BLOCKING:
294       SIMIX_run_blocking(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
295       break;
296     case NUM_SIMCALLS:
297       break;
298     case SIMCALL_NONE:
299       THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
300           simcall->issuer->name.c_str(),
301           sg_host_get_name(simcall->issuer->host)
302           );
303       break;
304
305   }
306 }