1 inline static smx_host_t simcall_BODY_host_get_by_name(const char* name) {
2 smx_process_t self = SIMIX_process_self();
3 self->simcall.call = SIMCALL_HOST_GET_BY_NAME;
4 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
5 memset(self->simcall.args, 0, sizeof(self->simcall.args));
6 self->simcall.args[0].cc = (const char*) name;
7 if (self != simix_global->maestro_process) {
8 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
9 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
10 SIMIX_process_yield(self);
12 SIMIX_simcall_pre(&self->simcall, 0);
14 return self->simcall.result.dp;
16 inline static const char* simcall_BODY_host_get_name(smx_host_t host) {
17 smx_process_t self = SIMIX_process_self();
18 self->simcall.call = SIMCALL_HOST_GET_NAME;
19 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
20 memset(self->simcall.args, 0, sizeof(self->simcall.args));
21 self->simcall.args[0].dp = (void*) host;
22 if (self != simix_global->maestro_process) {
23 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
24 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
25 SIMIX_process_yield(self);
27 SIMIX_simcall_pre(&self->simcall, 0);
29 return self->simcall.result.cc;
31 inline static void simcall_BODY_host_on(smx_host_t host) {
32 smx_process_t self = SIMIX_process_self();
33 self->simcall.call = SIMCALL_HOST_ON;
34 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
35 memset(self->simcall.args, 0, sizeof(self->simcall.args));
36 self->simcall.args[0].dp = (void*) host;
37 if (self != simix_global->maestro_process) {
38 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
39 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
40 SIMIX_process_yield(self);
42 SIMIX_simcall_pre(&self->simcall, 0);
46 inline static void simcall_BODY_host_off(smx_host_t host) {
47 smx_process_t self = SIMIX_process_self();
48 self->simcall.call = SIMCALL_HOST_OFF;
49 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
50 memset(self->simcall.args, 0, sizeof(self->simcall.args));
51 self->simcall.args[0].dp = (void*) host;
52 if (self != simix_global->maestro_process) {
53 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
54 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
55 SIMIX_process_yield(self);
57 SIMIX_simcall_pre(&self->simcall, 0);
61 inline static xbt_dict_t simcall_BODY_host_get_properties(smx_host_t host) {
62 smx_process_t self = SIMIX_process_self();
63 self->simcall.call = SIMCALL_HOST_GET_PROPERTIES;
64 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
65 memset(self->simcall.args, 0, sizeof(self->simcall.args));
66 self->simcall.args[0].dp = (void*) host;
67 if (self != simix_global->maestro_process) {
68 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
69 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
70 SIMIX_process_yield(self);
72 SIMIX_simcall_pre(&self->simcall, 0);
74 return self->simcall.result.dp;
76 inline static int simcall_BODY_host_get_core(smx_host_t host) {
77 smx_process_t self = SIMIX_process_self();
78 self->simcall.call = SIMCALL_HOST_GET_CORE;
79 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
80 memset(self->simcall.args, 0, sizeof(self->simcall.args));
81 self->simcall.args[0].dp = (void*) host;
82 if (self != simix_global->maestro_process) {
83 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
84 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
85 SIMIX_process_yield(self);
87 SIMIX_simcall_pre(&self->simcall, 0);
89 return self->simcall.result.i;
91 inline static xbt_swag_t simcall_BODY_host_get_process_list(smx_host_t host) {
92 smx_process_t self = SIMIX_process_self();
93 self->simcall.call = SIMCALL_HOST_GET_PROCESS_LIST;
94 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
95 memset(self->simcall.args, 0, sizeof(self->simcall.args));
96 self->simcall.args[0].dp = (void*) host;
97 if (self != simix_global->maestro_process) {
98 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
99 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
100 SIMIX_process_yield(self);
102 SIMIX_simcall_pre(&self->simcall, 0);
104 return self->simcall.result.dp;
106 inline static double simcall_BODY_host_get_speed(smx_host_t host) {
107 smx_process_t self = SIMIX_process_self();
108 self->simcall.call = SIMCALL_HOST_GET_SPEED;
109 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
110 memset(self->simcall.args, 0, sizeof(self->simcall.args));
111 self->simcall.args[0].dp = (void*) host;
112 if (self != simix_global->maestro_process) {
113 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
114 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
115 SIMIX_process_yield(self);
117 SIMIX_simcall_pre(&self->simcall, 0);
119 return self->simcall.result.d;
121 inline static double simcall_BODY_host_get_available_speed(smx_host_t host) {
122 smx_process_t self = SIMIX_process_self();
123 self->simcall.call = SIMCALL_HOST_GET_AVAILABLE_SPEED;
124 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
125 memset(self->simcall.args, 0, sizeof(self->simcall.args));
126 self->simcall.args[0].dp = (void*) host;
127 if (self != simix_global->maestro_process) {
128 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
129 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
130 SIMIX_process_yield(self);
132 SIMIX_simcall_pre(&self->simcall, 0);
134 return self->simcall.result.d;
136 inline static int simcall_BODY_host_get_state(smx_host_t host) {
137 smx_process_t self = SIMIX_process_self();
138 self->simcall.call = SIMCALL_HOST_GET_STATE;
139 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
140 memset(self->simcall.args, 0, sizeof(self->simcall.args));
141 self->simcall.args[0].dp = (void*) host;
142 if (self != simix_global->maestro_process) {
143 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
144 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
145 SIMIX_process_yield(self);
147 SIMIX_simcall_pre(&self->simcall, 0);
149 return self->simcall.result.i;
151 inline static void* simcall_BODY_host_get_data(smx_host_t host) {
152 smx_process_t self = SIMIX_process_self();
153 self->simcall.call = SIMCALL_HOST_GET_DATA;
154 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
155 memset(self->simcall.args, 0, sizeof(self->simcall.args));
156 self->simcall.args[0].dp = (void*) host;
157 if (self != simix_global->maestro_process) {
158 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
159 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
160 SIMIX_process_yield(self);
162 SIMIX_simcall_pre(&self->simcall, 0);
164 return self->simcall.result.dp;
166 inline static void simcall_BODY_host_set_data(smx_host_t host, void* data) {
167 smx_process_t self = SIMIX_process_self();
168 self->simcall.call = SIMCALL_HOST_SET_DATA;
169 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
170 memset(self->simcall.args, 0, sizeof(self->simcall.args));
171 self->simcall.args[0].dp = (void*) host;
172 self->simcall.args[1].dp = (void*) data;
173 if (self != simix_global->maestro_process) {
174 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
175 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
176 SIMIX_process_yield(self);
178 SIMIX_simcall_pre(&self->simcall, 0);
182 inline static double simcall_BODY_host_get_current_power_peak(smx_host_t host) {
183 smx_process_t self = SIMIX_process_self();
184 self->simcall.call = SIMCALL_HOST_GET_CURRENT_POWER_PEAK;
185 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
186 memset(self->simcall.args, 0, sizeof(self->simcall.args));
187 self->simcall.args[0].dp = (void*) host;
188 if (self != simix_global->maestro_process) {
189 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
190 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
191 SIMIX_process_yield(self);
193 SIMIX_simcall_pre(&self->simcall, 0);
195 return self->simcall.result.d;
197 inline static double simcall_BODY_host_get_power_peak_at(smx_host_t host, int pstate_index) {
198 smx_process_t self = SIMIX_process_self();
199 self->simcall.call = SIMCALL_HOST_GET_POWER_PEAK_AT;
200 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
201 memset(self->simcall.args, 0, sizeof(self->simcall.args));
202 self->simcall.args[0].dp = (void*) host;
203 self->simcall.args[1].i = (int) pstate_index;
204 if (self != simix_global->maestro_process) {
205 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
206 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
207 SIMIX_process_yield(self);
209 SIMIX_simcall_pre(&self->simcall, 0);
211 return self->simcall.result.d;
213 inline static int simcall_BODY_host_get_nb_pstates(smx_host_t host) {
214 smx_process_t self = SIMIX_process_self();
215 self->simcall.call = SIMCALL_HOST_GET_NB_PSTATES;
216 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
217 memset(self->simcall.args, 0, sizeof(self->simcall.args));
218 self->simcall.args[0].dp = (void*) host;
219 if (self != simix_global->maestro_process) {
220 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
221 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
222 SIMIX_process_yield(self);
224 SIMIX_simcall_pre(&self->simcall, 0);
226 return self->simcall.result.i;
228 inline static void simcall_BODY_host_set_power_peak_at(smx_host_t host, int pstate_index) {
229 smx_process_t self = SIMIX_process_self();
230 self->simcall.call = SIMCALL_HOST_SET_POWER_PEAK_AT;
231 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
232 memset(self->simcall.args, 0, sizeof(self->simcall.args));
233 self->simcall.args[0].dp = (void*) host;
234 self->simcall.args[1].i = (int) pstate_index;
235 if (self != simix_global->maestro_process) {
236 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
237 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
238 SIMIX_process_yield(self);
240 SIMIX_simcall_pre(&self->simcall, 0);
244 inline static double simcall_BODY_host_get_consumed_energy(smx_host_t host) {
245 smx_process_t self = SIMIX_process_self();
246 self->simcall.call = SIMCALL_HOST_GET_CONSUMED_ENERGY;
247 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
248 memset(self->simcall.args, 0, sizeof(self->simcall.args));
249 self->simcall.args[0].dp = (void*) host;
250 if (self != simix_global->maestro_process) {
251 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
252 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
253 SIMIX_process_yield(self);
255 SIMIX_simcall_pre(&self->simcall, 0);
257 return self->simcall.result.d;
259 inline static smx_action_t simcall_BODY_host_execute(const char* name, smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask) {
260 smx_process_t self = SIMIX_process_self();
261 self->simcall.call = SIMCALL_HOST_EXECUTE;
262 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
263 memset(self->simcall.args, 0, sizeof(self->simcall.args));
264 self->simcall.args[0].cc = (const char*) name;
265 self->simcall.args[1].dp = (void*) host;
266 self->simcall.args[2].d = (double) computation_amount;
267 self->simcall.args[3].d = (double) priority;
268 self->simcall.args[4].d = (double) bound;
269 self->simcall.args[5].ul = (unsigned long) affinity_mask;
270 if (self != simix_global->maestro_process) {
271 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
272 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
273 SIMIX_process_yield(self);
275 SIMIX_simcall_pre(&self->simcall, 0);
277 return self->simcall.result.dp;
279 inline static smx_action_t simcall_BODY_host_parallel_execute(const char* name, int host_nb, smx_host_t* host_list, double* computation_amount, double* communication_amount, double amount, double rate) {
280 smx_process_t self = SIMIX_process_self();
281 self->simcall.call = SIMCALL_HOST_PARALLEL_EXECUTE;
282 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
283 memset(self->simcall.args, 0, sizeof(self->simcall.args));
284 self->simcall.args[0].cc = (const char*) name;
285 self->simcall.args[1].i = (int) host_nb;
286 self->simcall.args[2].dp = (void*) host_list;
287 self->simcall.args[3].dp = (void*) computation_amount;
288 self->simcall.args[4].dp = (void*) communication_amount;
289 self->simcall.args[5].d = (double) amount;
290 self->simcall.args[6].d = (double) rate;
291 if (self != simix_global->maestro_process) {
292 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
293 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
294 SIMIX_process_yield(self);
296 SIMIX_simcall_pre(&self->simcall, 0);
298 return self->simcall.result.dp;
300 inline static void simcall_BODY_host_execution_destroy(smx_action_t execution) {
301 smx_process_t self = SIMIX_process_self();
302 self->simcall.call = SIMCALL_HOST_EXECUTION_DESTROY;
303 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
304 memset(self->simcall.args, 0, sizeof(self->simcall.args));
305 self->simcall.args[0].dp = (void*) execution;
306 if (self != simix_global->maestro_process) {
307 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
308 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
309 SIMIX_process_yield(self);
311 SIMIX_simcall_pre(&self->simcall, 0);
315 inline static void simcall_BODY_host_execution_cancel(smx_action_t execution) {
316 smx_process_t self = SIMIX_process_self();
317 self->simcall.call = SIMCALL_HOST_EXECUTION_CANCEL;
318 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
319 memset(self->simcall.args, 0, sizeof(self->simcall.args));
320 self->simcall.args[0].dp = (void*) execution;
321 if (self != simix_global->maestro_process) {
322 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
323 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
324 SIMIX_process_yield(self);
326 SIMIX_simcall_pre(&self->simcall, 0);
330 inline static double simcall_BODY_host_execution_get_remains(smx_action_t execution) {
331 smx_process_t self = SIMIX_process_self();
332 self->simcall.call = SIMCALL_HOST_EXECUTION_GET_REMAINS;
333 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
334 memset(self->simcall.args, 0, sizeof(self->simcall.args));
335 self->simcall.args[0].dp = (void*) execution;
336 if (self != simix_global->maestro_process) {
337 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
338 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
339 SIMIX_process_yield(self);
341 SIMIX_simcall_pre(&self->simcall, 0);
343 return self->simcall.result.d;
345 inline static int simcall_BODY_host_execution_get_state(smx_action_t execution) {
346 smx_process_t self = SIMIX_process_self();
347 self->simcall.call = SIMCALL_HOST_EXECUTION_GET_STATE;
348 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
349 memset(self->simcall.args, 0, sizeof(self->simcall.args));
350 self->simcall.args[0].dp = (void*) execution;
351 if (self != simix_global->maestro_process) {
352 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
353 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
354 SIMIX_process_yield(self);
356 SIMIX_simcall_pre(&self->simcall, 0);
358 return self->simcall.result.i;
360 inline static void simcall_BODY_host_execution_set_priority(smx_action_t execution, double priority) {
361 smx_process_t self = SIMIX_process_self();
362 self->simcall.call = SIMCALL_HOST_EXECUTION_SET_PRIORITY;
363 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
364 memset(self->simcall.args, 0, sizeof(self->simcall.args));
365 self->simcall.args[0].dp = (void*) execution;
366 self->simcall.args[1].d = (double) priority;
367 if (self != simix_global->maestro_process) {
368 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
369 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
370 SIMIX_process_yield(self);
372 SIMIX_simcall_pre(&self->simcall, 0);
376 inline static void simcall_BODY_host_execution_set_bound(smx_action_t execution, double bound) {
377 smx_process_t self = SIMIX_process_self();
378 self->simcall.call = SIMCALL_HOST_EXECUTION_SET_BOUND;
379 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
380 memset(self->simcall.args, 0, sizeof(self->simcall.args));
381 self->simcall.args[0].dp = (void*) execution;
382 self->simcall.args[1].d = (double) bound;
383 if (self != simix_global->maestro_process) {
384 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
385 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
386 SIMIX_process_yield(self);
388 SIMIX_simcall_pre(&self->simcall, 0);
392 inline static void simcall_BODY_host_execution_set_affinity(smx_action_t execution, smx_host_t ws, unsigned long mask) {
393 smx_process_t self = SIMIX_process_self();
394 self->simcall.call = SIMCALL_HOST_EXECUTION_SET_AFFINITY;
395 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
396 memset(self->simcall.args, 0, sizeof(self->simcall.args));
397 self->simcall.args[0].dp = (void*) execution;
398 self->simcall.args[1].dp = (void*) ws;
399 self->simcall.args[2].ul = (unsigned long) mask;
400 if (self != simix_global->maestro_process) {
401 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
402 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
403 SIMIX_process_yield(self);
405 SIMIX_simcall_pre(&self->simcall, 0);
409 inline static int simcall_BODY_host_execution_wait(smx_action_t execution) {
410 smx_process_t self = SIMIX_process_self();
411 self->simcall.call = SIMCALL_HOST_EXECUTION_WAIT;
412 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
413 memset(self->simcall.args, 0, sizeof(self->simcall.args));
414 self->simcall.args[0].dp = (void*) execution;
415 if (self != simix_global->maestro_process) {
416 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
417 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
418 SIMIX_process_yield(self);
420 SIMIX_simcall_pre(&self->simcall, 0);
422 return self->simcall.result.i;
424 inline static xbt_dict_t simcall_BODY_host_get_storage_list(smx_host_t host) {
425 smx_process_t self = SIMIX_process_self();
426 self->simcall.call = SIMCALL_HOST_GET_STORAGE_LIST;
427 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
428 memset(self->simcall.args, 0, sizeof(self->simcall.args));
429 self->simcall.args[0].dp = (void*) host;
430 if (self != simix_global->maestro_process) {
431 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
432 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
433 SIMIX_process_yield(self);
435 SIMIX_simcall_pre(&self->simcall, 0);
437 return self->simcall.result.dp;
439 inline static void simcall_BODY_host_get_params(smx_host_t ind_vm, ws_params_t params) {
440 smx_process_t self = SIMIX_process_self();
441 self->simcall.call = SIMCALL_HOST_GET_PARAMS;
442 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
443 memset(self->simcall.args, 0, sizeof(self->simcall.args));
444 self->simcall.args[0].dp = (void*) ind_vm;
445 self->simcall.args[1].dp = (void*) params;
446 if (self != simix_global->maestro_process) {
447 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
448 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
449 SIMIX_process_yield(self);
451 SIMIX_simcall_pre(&self->simcall, 0);
455 inline static void simcall_BODY_host_set_params(smx_host_t ind_vm, ws_params_t params) {
456 smx_process_t self = SIMIX_process_self();
457 self->simcall.call = SIMCALL_HOST_SET_PARAMS;
458 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
459 memset(self->simcall.args, 0, sizeof(self->simcall.args));
460 self->simcall.args[0].dp = (void*) ind_vm;
461 self->simcall.args[1].dp = (void*) params;
462 if (self != simix_global->maestro_process) {
463 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
464 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
465 SIMIX_process_yield(self);
467 SIMIX_simcall_pre(&self->simcall, 0);
471 inline static void* simcall_BODY_vm_create(const char* name, smx_host_t ind_pm) {
472 smx_process_t self = SIMIX_process_self();
473 self->simcall.call = SIMCALL_VM_CREATE;
474 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
475 memset(self->simcall.args, 0, sizeof(self->simcall.args));
476 self->simcall.args[0].cc = (const char*) name;
477 self->simcall.args[1].dp = (void*) ind_pm;
478 if (self != simix_global->maestro_process) {
479 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
480 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
481 SIMIX_process_yield(self);
483 SIMIX_simcall_pre(&self->simcall, 0);
485 return self->simcall.result.dp;
487 inline static void simcall_BODY_vm_start(smx_host_t ind_vm) {
488 smx_process_t self = SIMIX_process_self();
489 self->simcall.call = SIMCALL_VM_START;
490 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
491 memset(self->simcall.args, 0, sizeof(self->simcall.args));
492 self->simcall.args[0].dp = (void*) ind_vm;
493 if (self != simix_global->maestro_process) {
494 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
495 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
496 SIMIX_process_yield(self);
498 SIMIX_simcall_pre(&self->simcall, 0);
502 inline static void simcall_BODY_vm_set_state(smx_host_t ind_vm, int state) {
503 smx_process_t self = SIMIX_process_self();
504 self->simcall.call = SIMCALL_VM_SET_STATE;
505 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
506 memset(self->simcall.args, 0, sizeof(self->simcall.args));
507 self->simcall.args[0].dp = (void*) ind_vm;
508 self->simcall.args[1].i = (int) state;
509 if (self != simix_global->maestro_process) {
510 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
511 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
512 SIMIX_process_yield(self);
514 SIMIX_simcall_pre(&self->simcall, 0);
518 inline static int simcall_BODY_vm_get_state(smx_host_t ind_vm) {
519 smx_process_t self = SIMIX_process_self();
520 self->simcall.call = SIMCALL_VM_GET_STATE;
521 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
522 memset(self->simcall.args, 0, sizeof(self->simcall.args));
523 self->simcall.args[0].dp = (void*) ind_vm;
524 if (self != simix_global->maestro_process) {
525 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
526 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
527 SIMIX_process_yield(self);
529 SIMIX_simcall_pre(&self->simcall, 0);
531 return self->simcall.result.i;
533 inline static void simcall_BODY_vm_migrate(smx_host_t ind_vm, smx_host_t ind_dst_pm) {
534 smx_process_t self = SIMIX_process_self();
535 self->simcall.call = SIMCALL_VM_MIGRATE;
536 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
537 memset(self->simcall.args, 0, sizeof(self->simcall.args));
538 self->simcall.args[0].dp = (void*) ind_vm;
539 self->simcall.args[1].dp = (void*) ind_dst_pm;
540 if (self != simix_global->maestro_process) {
541 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
542 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
543 SIMIX_process_yield(self);
545 SIMIX_simcall_pre(&self->simcall, 0);
549 inline static void* simcall_BODY_vm_get_pm(smx_host_t ind_vm) {
550 smx_process_t self = SIMIX_process_self();
551 self->simcall.call = SIMCALL_VM_GET_PM;
552 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
553 memset(self->simcall.args, 0, sizeof(self->simcall.args));
554 self->simcall.args[0].dp = (void*) ind_vm;
555 if (self != simix_global->maestro_process) {
556 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
557 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
558 SIMIX_process_yield(self);
560 SIMIX_simcall_pre(&self->simcall, 0);
562 return self->simcall.result.dp;
564 inline static void simcall_BODY_vm_set_bound(smx_host_t ind_vm, double bound) {
565 smx_process_t self = SIMIX_process_self();
566 self->simcall.call = SIMCALL_VM_SET_BOUND;
567 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
568 memset(self->simcall.args, 0, sizeof(self->simcall.args));
569 self->simcall.args[0].dp = (void*) ind_vm;
570 self->simcall.args[1].d = (double) bound;
571 if (self != simix_global->maestro_process) {
572 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
573 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
574 SIMIX_process_yield(self);
576 SIMIX_simcall_pre(&self->simcall, 0);
580 inline static void simcall_BODY_vm_set_affinity(smx_host_t ind_vm, smx_host_t ind_pm, unsigned long mask) {
581 smx_process_t self = SIMIX_process_self();
582 self->simcall.call = SIMCALL_VM_SET_AFFINITY;
583 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
584 memset(self->simcall.args, 0, sizeof(self->simcall.args));
585 self->simcall.args[0].dp = (void*) ind_vm;
586 self->simcall.args[1].dp = (void*) ind_pm;
587 self->simcall.args[2].ul = (unsigned long) mask;
588 if (self != simix_global->maestro_process) {
589 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
590 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
591 SIMIX_process_yield(self);
593 SIMIX_simcall_pre(&self->simcall, 0);
597 inline static void simcall_BODY_vm_destroy(smx_host_t ind_vm) {
598 smx_process_t self = SIMIX_process_self();
599 self->simcall.call = SIMCALL_VM_DESTROY;
600 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
601 memset(self->simcall.args, 0, sizeof(self->simcall.args));
602 self->simcall.args[0].dp = (void*) ind_vm;
603 if (self != simix_global->maestro_process) {
604 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
605 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
606 SIMIX_process_yield(self);
608 SIMIX_simcall_pre(&self->simcall, 0);
612 inline static void simcall_BODY_vm_suspend(smx_host_t ind_vm) {
613 smx_process_t self = SIMIX_process_self();
614 self->simcall.call = SIMCALL_VM_SUSPEND;
615 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
616 memset(self->simcall.args, 0, sizeof(self->simcall.args));
617 self->simcall.args[0].dp = (void*) ind_vm;
618 if (self != simix_global->maestro_process) {
619 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
620 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
621 SIMIX_process_yield(self);
623 SIMIX_simcall_pre(&self->simcall, 0);
627 inline static void simcall_BODY_vm_resume(smx_host_t ind_vm) {
628 smx_process_t self = SIMIX_process_self();
629 self->simcall.call = SIMCALL_VM_RESUME;
630 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
631 memset(self->simcall.args, 0, sizeof(self->simcall.args));
632 self->simcall.args[0].dp = (void*) ind_vm;
633 if (self != simix_global->maestro_process) {
634 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
635 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
636 SIMIX_process_yield(self);
638 SIMIX_simcall_pre(&self->simcall, 0);
642 inline static void simcall_BODY_vm_shutdown(smx_host_t ind_vm) {
643 smx_process_t self = SIMIX_process_self();
644 self->simcall.call = SIMCALL_VM_SHUTDOWN;
645 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
646 memset(self->simcall.args, 0, sizeof(self->simcall.args));
647 self->simcall.args[0].dp = (void*) ind_vm;
648 if (self != simix_global->maestro_process) {
649 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
650 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
651 SIMIX_process_yield(self);
653 SIMIX_simcall_pre(&self->simcall, 0);
657 inline static void simcall_BODY_vm_save(smx_host_t ind_vm) {
658 smx_process_t self = SIMIX_process_self();
659 self->simcall.call = SIMCALL_VM_SAVE;
660 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
661 memset(self->simcall.args, 0, sizeof(self->simcall.args));
662 self->simcall.args[0].dp = (void*) ind_vm;
663 if (self != simix_global->maestro_process) {
664 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
665 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
666 SIMIX_process_yield(self);
668 SIMIX_simcall_pre(&self->simcall, 0);
672 inline static void simcall_BODY_vm_restore(smx_host_t ind_vm) {
673 smx_process_t self = SIMIX_process_self();
674 self->simcall.call = SIMCALL_VM_RESTORE;
675 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
676 memset(self->simcall.args, 0, sizeof(self->simcall.args));
677 self->simcall.args[0].dp = (void*) ind_vm;
678 if (self != simix_global->maestro_process) {
679 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
680 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
681 SIMIX_process_yield(self);
683 SIMIX_simcall_pre(&self->simcall, 0);
687 inline static void simcall_BODY_process_create(smx_process_t* process, const char* name, xbt_main_func_t code, void* data, const char* hostname, double kill_time, int argc, char** argv, xbt_dict_t properties, int auto_restart) {
688 smx_process_t self = SIMIX_process_self();
689 self->simcall.call = SIMCALL_PROCESS_CREATE;
690 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
691 memset(self->simcall.args, 0, sizeof(self->simcall.args));
692 self->simcall.args[0].dp = (void*) process;
693 self->simcall.args[1].cc = (const char*) name;
694 self->simcall.args[2].fp = (FPtr) code;
695 self->simcall.args[3].dp = (void*) data;
696 self->simcall.args[4].cc = (const char*) hostname;
697 self->simcall.args[5].d = (double) kill_time;
698 self->simcall.args[6].i = (int) argc;
699 self->simcall.args[7].dp = (void*) argv;
700 self->simcall.args[8].dp = (void*) properties;
701 self->simcall.args[9].i = (int) auto_restart;
702 if (self != simix_global->maestro_process) {
703 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
704 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
705 SIMIX_process_yield(self);
707 SIMIX_simcall_pre(&self->simcall, 0);
711 inline static void simcall_BODY_process_kill(smx_process_t process) {
712 smx_process_t self = SIMIX_process_self();
713 self->simcall.call = SIMCALL_PROCESS_KILL;
714 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
715 memset(self->simcall.args, 0, sizeof(self->simcall.args));
716 self->simcall.args[0].dp = (void*) process;
717 if (self != simix_global->maestro_process) {
718 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
719 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
720 SIMIX_process_yield(self);
722 SIMIX_simcall_pre(&self->simcall, 0);
726 inline static void simcall_BODY_process_killall(int reset_pid) {
727 smx_process_t self = SIMIX_process_self();
728 self->simcall.call = SIMCALL_PROCESS_KILLALL;
729 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
730 memset(self->simcall.args, 0, sizeof(self->simcall.args));
731 self->simcall.args[0].i = (int) reset_pid;
732 if (self != simix_global->maestro_process) {
733 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
734 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
735 SIMIX_process_yield(self);
737 SIMIX_simcall_pre(&self->simcall, 0);
741 inline static void simcall_BODY_process_cleanup(smx_process_t process) {
742 smx_process_t self = SIMIX_process_self();
743 self->simcall.call = SIMCALL_PROCESS_CLEANUP;
744 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
745 memset(self->simcall.args, 0, sizeof(self->simcall.args));
746 self->simcall.args[0].dp = (void*) process;
747 if (self != simix_global->maestro_process) {
748 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
749 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
750 SIMIX_process_yield(self);
752 SIMIX_simcall_pre(&self->simcall, 0);
756 inline static void simcall_BODY_process_change_host(smx_process_t process, smx_host_t dest) {
757 smx_process_t self = SIMIX_process_self();
758 self->simcall.call = SIMCALL_PROCESS_CHANGE_HOST;
759 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
760 memset(self->simcall.args, 0, sizeof(self->simcall.args));
761 self->simcall.args[0].dp = (void*) process;
762 self->simcall.args[1].dp = (void*) dest;
763 if (self != simix_global->maestro_process) {
764 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
765 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
766 SIMIX_process_yield(self);
768 SIMIX_simcall_pre(&self->simcall, 0);
772 inline static void simcall_BODY_process_suspend(smx_process_t process) {
773 smx_process_t self = SIMIX_process_self();
774 self->simcall.call = SIMCALL_PROCESS_SUSPEND;
775 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
776 memset(self->simcall.args, 0, sizeof(self->simcall.args));
777 self->simcall.args[0].dp = (void*) process;
778 if (self != simix_global->maestro_process) {
779 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
780 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
781 SIMIX_process_yield(self);
783 SIMIX_simcall_pre(&self->simcall, 0);
787 inline static void simcall_BODY_process_resume(smx_process_t process) {
788 smx_process_t self = SIMIX_process_self();
789 self->simcall.call = SIMCALL_PROCESS_RESUME;
790 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
791 memset(self->simcall.args, 0, sizeof(self->simcall.args));
792 self->simcall.args[0].dp = (void*) process;
793 if (self != simix_global->maestro_process) {
794 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
795 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
796 SIMIX_process_yield(self);
798 SIMIX_simcall_pre(&self->simcall, 0);
802 inline static int simcall_BODY_process_count() {
803 smx_process_t self = SIMIX_process_self();
804 self->simcall.call = SIMCALL_PROCESS_COUNT;
805 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
806 memset(self->simcall.args, 0, sizeof(self->simcall.args));
808 if (self != simix_global->maestro_process) {
809 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
810 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
811 SIMIX_process_yield(self);
813 SIMIX_simcall_pre(&self->simcall, 0);
815 return self->simcall.result.i;
817 inline static int simcall_BODY_process_get_PID(smx_process_t process) {
818 smx_process_t self = SIMIX_process_self();
819 self->simcall.call = SIMCALL_PROCESS_GET_PID;
820 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
821 memset(self->simcall.args, 0, sizeof(self->simcall.args));
822 self->simcall.args[0].dp = (void*) process;
823 if (self != simix_global->maestro_process) {
824 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
825 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
826 SIMIX_process_yield(self);
828 SIMIX_simcall_pre(&self->simcall, 0);
830 return self->simcall.result.i;
832 inline static int simcall_BODY_process_get_PPID(smx_process_t process) {
833 smx_process_t self = SIMIX_process_self();
834 self->simcall.call = SIMCALL_PROCESS_GET_PPID;
835 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
836 memset(self->simcall.args, 0, sizeof(self->simcall.args));
837 self->simcall.args[0].dp = (void*) process;
838 if (self != simix_global->maestro_process) {
839 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
840 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
841 SIMIX_process_yield(self);
843 SIMIX_simcall_pre(&self->simcall, 0);
845 return self->simcall.result.i;
847 inline static void* simcall_BODY_process_get_data(smx_process_t process) {
848 smx_process_t self = SIMIX_process_self();
849 self->simcall.call = SIMCALL_PROCESS_GET_DATA;
850 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
851 memset(self->simcall.args, 0, sizeof(self->simcall.args));
852 self->simcall.args[0].dp = (void*) process;
853 if (self != simix_global->maestro_process) {
854 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
855 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
856 SIMIX_process_yield(self);
858 SIMIX_simcall_pre(&self->simcall, 0);
860 return self->simcall.result.dp;
862 inline static void simcall_BODY_process_set_data(smx_process_t process, void* data) {
863 smx_process_t self = SIMIX_process_self();
864 self->simcall.call = SIMCALL_PROCESS_SET_DATA;
865 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
866 memset(self->simcall.args, 0, sizeof(self->simcall.args));
867 self->simcall.args[0].dp = (void*) process;
868 self->simcall.args[1].dp = (void*) data;
869 if (self != simix_global->maestro_process) {
870 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
871 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
872 SIMIX_process_yield(self);
874 SIMIX_simcall_pre(&self->simcall, 0);
878 inline static smx_host_t simcall_BODY_process_get_host(smx_process_t process) {
879 smx_process_t self = SIMIX_process_self();
880 self->simcall.call = SIMCALL_PROCESS_GET_HOST;
881 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
882 memset(self->simcall.args, 0, sizeof(self->simcall.args));
883 self->simcall.args[0].dp = (void*) process;
884 if (self != simix_global->maestro_process) {
885 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
886 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
887 SIMIX_process_yield(self);
889 SIMIX_simcall_pre(&self->simcall, 0);
891 return self->simcall.result.dp;
893 inline static const char* simcall_BODY_process_get_name(smx_process_t process) {
894 smx_process_t self = SIMIX_process_self();
895 self->simcall.call = SIMCALL_PROCESS_GET_NAME;
896 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
897 memset(self->simcall.args, 0, sizeof(self->simcall.args));
898 self->simcall.args[0].dp = (void*) process;
899 if (self != simix_global->maestro_process) {
900 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
901 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
902 SIMIX_process_yield(self);
904 SIMIX_simcall_pre(&self->simcall, 0);
906 return self->simcall.result.cc;
908 inline static int simcall_BODY_process_is_suspended(smx_process_t process) {
909 smx_process_t self = SIMIX_process_self();
910 self->simcall.call = SIMCALL_PROCESS_IS_SUSPENDED;
911 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
912 memset(self->simcall.args, 0, sizeof(self->simcall.args));
913 self->simcall.args[0].dp = (void*) process;
914 if (self != simix_global->maestro_process) {
915 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
916 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
917 SIMIX_process_yield(self);
919 SIMIX_simcall_pre(&self->simcall, 0);
921 return self->simcall.result.i;
923 inline static xbt_dict_t simcall_BODY_process_get_properties(smx_process_t process) {
924 smx_process_t self = SIMIX_process_self();
925 self->simcall.call = SIMCALL_PROCESS_GET_PROPERTIES;
926 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
927 memset(self->simcall.args, 0, sizeof(self->simcall.args));
928 self->simcall.args[0].dp = (void*) process;
929 if (self != simix_global->maestro_process) {
930 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
931 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
932 SIMIX_process_yield(self);
934 SIMIX_simcall_pre(&self->simcall, 0);
936 return self->simcall.result.dp;
938 inline static int simcall_BODY_process_sleep(double duration) {
939 smx_process_t self = SIMIX_process_self();
940 self->simcall.call = SIMCALL_PROCESS_SLEEP;
941 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
942 memset(self->simcall.args, 0, sizeof(self->simcall.args));
943 self->simcall.args[0].d = (double) duration;
944 if (self != simix_global->maestro_process) {
945 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
946 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
947 SIMIX_process_yield(self);
949 SIMIX_simcall_pre(&self->simcall, 0);
951 return self->simcall.result.i;
953 inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void* data) {
954 smx_process_t self = SIMIX_process_self();
955 self->simcall.call = SIMCALL_PROCESS_ON_EXIT;
956 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
957 memset(self->simcall.args, 0, sizeof(self->simcall.args));
958 self->simcall.args[0].dp = (void*) process;
959 self->simcall.args[1].fp = (FPtr) fun;
960 self->simcall.args[2].dp = (void*) data;
961 if (self != simix_global->maestro_process) {
962 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
963 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
964 SIMIX_process_yield(self);
966 SIMIX_simcall_pre(&self->simcall, 0);
970 inline static void simcall_BODY_process_auto_restart_set(smx_process_t process, int auto_restart) {
971 smx_process_t self = SIMIX_process_self();
972 self->simcall.call = SIMCALL_PROCESS_AUTO_RESTART_SET;
973 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
974 memset(self->simcall.args, 0, sizeof(self->simcall.args));
975 self->simcall.args[0].dp = (void*) process;
976 self->simcall.args[1].i = (int) auto_restart;
977 if (self != simix_global->maestro_process) {
978 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
979 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
980 SIMIX_process_yield(self);
982 SIMIX_simcall_pre(&self->simcall, 0);
986 inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) {
987 smx_process_t self = SIMIX_process_self();
988 self->simcall.call = SIMCALL_PROCESS_RESTART;
989 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
990 memset(self->simcall.args, 0, sizeof(self->simcall.args));
991 self->simcall.args[0].dp = (void*) process;
992 if (self != simix_global->maestro_process) {
993 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
994 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
995 SIMIX_process_yield(self);
997 SIMIX_simcall_pre(&self->simcall, 0);
999 return self->simcall.result.dp;
1001 inline static smx_rdv_t simcall_BODY_rdv_create(const char* name) {
1002 smx_process_t self = SIMIX_process_self();
1003 self->simcall.call = SIMCALL_RDV_CREATE;
1004 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1005 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1006 self->simcall.args[0].cc = (const char*) name;
1007 if (self != simix_global->maestro_process) {
1008 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1009 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1010 SIMIX_process_yield(self);
1012 SIMIX_simcall_pre(&self->simcall, 0);
1014 return self->simcall.result.dp;
1016 inline static void simcall_BODY_rdv_destroy(smx_rdv_t rdv) {
1017 smx_process_t self = SIMIX_process_self();
1018 self->simcall.call = SIMCALL_RDV_DESTROY;
1019 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1020 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1021 self->simcall.args[0].dp = (void*) rdv;
1022 if (self != simix_global->maestro_process) {
1023 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1024 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1025 SIMIX_process_yield(self);
1027 SIMIX_simcall_pre(&self->simcall, 0);
1031 inline static smx_host_t simcall_BODY_rdv_get_by_name(const char* name) {
1032 smx_process_t self = SIMIX_process_self();
1033 self->simcall.call = SIMCALL_RDV_GET_BY_NAME;
1034 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1035 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1036 self->simcall.args[0].cc = (const char*) name;
1037 if (self != simix_global->maestro_process) {
1038 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1039 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1040 SIMIX_process_yield(self);
1042 SIMIX_simcall_pre(&self->simcall, 0);
1044 return self->simcall.result.dp;
1046 inline static unsigned int simcall_BODY_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host) {
1047 smx_process_t self = SIMIX_process_self();
1048 self->simcall.call = SIMCALL_RDV_COMM_COUNT_BY_HOST;
1049 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1050 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1051 self->simcall.args[0].dp = (void*) rdv;
1052 self->simcall.args[1].dp = (void*) host;
1053 if (self != simix_global->maestro_process) {
1054 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1055 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1056 SIMIX_process_yield(self);
1058 SIMIX_simcall_pre(&self->simcall, 0);
1060 return self->simcall.result.ui;
1062 inline static smx_action_t simcall_BODY_rdv_get_head(smx_rdv_t rdv) {
1063 smx_process_t self = SIMIX_process_self();
1064 self->simcall.call = SIMCALL_RDV_GET_HEAD;
1065 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1066 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1067 self->simcall.args[0].dp = (void*) rdv;
1068 if (self != simix_global->maestro_process) {
1069 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1070 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1071 SIMIX_process_yield(self);
1073 SIMIX_simcall_pre(&self->simcall, 0);
1075 return self->simcall.result.dp;
1077 inline static void simcall_BODY_rdv_set_receiver(smx_rdv_t rdv, smx_process_t receiver) {
1078 smx_process_t self = SIMIX_process_self();
1079 self->simcall.call = SIMCALL_RDV_SET_RECEIVER;
1080 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1081 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1082 self->simcall.args[0].dp = (void*) rdv;
1083 self->simcall.args[1].dp = (void*) receiver;
1084 if (self != simix_global->maestro_process) {
1085 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1086 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1087 SIMIX_process_yield(self);
1089 SIMIX_simcall_pre(&self->simcall, 0);
1093 inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_rdv_t rdv) {
1094 smx_process_t self = SIMIX_process_self();
1095 self->simcall.call = SIMCALL_RDV_GET_RECEIVER;
1096 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1097 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1098 self->simcall.args[0].dp = (void*) rdv;
1099 if (self != simix_global->maestro_process) {
1100 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1101 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1102 SIMIX_process_yield(self);
1104 SIMIX_simcall_pre(&self->simcall, 0);
1106 return self->simcall.result.dp;
1108 inline static smx_action_t simcall_BODY_comm_iprobe(smx_rdv_t rdv, int src, int tag, simix_match_func_t match_fun, void* data) {
1109 smx_process_t self = SIMIX_process_self();
1110 self->simcall.call = SIMCALL_COMM_IPROBE;
1111 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1112 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1113 self->simcall.args[0].dp = (void*) rdv;
1114 self->simcall.args[1].i = (int) src;
1115 self->simcall.args[2].i = (int) tag;
1116 self->simcall.args[3].fp = (FPtr) match_fun;
1117 self->simcall.args[4].dp = (void*) data;
1118 if (self != simix_global->maestro_process) {
1119 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1120 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1121 SIMIX_process_yield(self);
1123 SIMIX_simcall_pre(&self->simcall, 0);
1125 return self->simcall.result.dp;
1127 inline static void simcall_BODY_comm_send(smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, void* data, double timeout) {
1128 smx_process_t self = SIMIX_process_self();
1129 self->simcall.call = SIMCALL_COMM_SEND;
1130 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1131 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1132 self->simcall.args[0].dp = (void*) rdv;
1133 self->simcall.args[1].d = (double) task_size;
1134 self->simcall.args[2].d = (double) rate;
1135 self->simcall.args[3].dp = (void*) src_buff;
1136 self->simcall.args[4].sz = (size_t) src_buff_size;
1137 self->simcall.args[5].fp = (FPtr) match_fun;
1138 self->simcall.args[6].dp = (void*) data;
1139 self->simcall.args[7].d = (double) timeout;
1140 if (self != simix_global->maestro_process) {
1141 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1142 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1143 SIMIX_process_yield(self);
1145 SIMIX_simcall_pre(&self->simcall, 0);
1149 inline static smx_action_t simcall_BODY_comm_isend(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, void* data, int detached) {
1150 smx_process_t self = SIMIX_process_self();
1151 self->simcall.call = SIMCALL_COMM_ISEND;
1152 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1153 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1154 self->simcall.args[0].dp = (void*) rdv;
1155 self->simcall.args[1].d = (double) task_size;
1156 self->simcall.args[2].d = (double) rate;
1157 self->simcall.args[3].dp = (void*) src_buff;
1158 self->simcall.args[4].sz = (size_t) src_buff_size;
1159 self->simcall.args[5].fp = (FPtr) match_fun;
1160 self->simcall.args[6].fp = (FPtr) clean_fun;
1161 self->simcall.args[7].dp = (void*) data;
1162 self->simcall.args[8].i = (int) detached;
1163 if (self != simix_global->maestro_process) {
1164 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1165 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1166 SIMIX_process_yield(self);
1168 SIMIX_simcall_pre(&self->simcall, 0);
1170 return self->simcall.result.dp;
1172 inline static void simcall_BODY_comm_recv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double timeout) {
1173 smx_process_t self = SIMIX_process_self();
1174 self->simcall.call = SIMCALL_COMM_RECV;
1175 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1176 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1177 self->simcall.args[0].dp = (void*) rdv;
1178 self->simcall.args[1].dp = (void*) dst_buff;
1179 self->simcall.args[2].dp = (void*) dst_buff_size;
1180 self->simcall.args[3].fp = (FPtr) match_fun;
1181 self->simcall.args[4].dp = (void*) data;
1182 self->simcall.args[5].d = (double) timeout;
1183 if (self != simix_global->maestro_process) {
1184 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1185 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1186 SIMIX_process_yield(self);
1188 SIMIX_simcall_pre(&self->simcall, 0);
1192 inline static smx_action_t simcall_BODY_comm_irecv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data) {
1193 smx_process_t self = SIMIX_process_self();
1194 self->simcall.call = SIMCALL_COMM_IRECV;
1195 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1196 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1197 self->simcall.args[0].dp = (void*) rdv;
1198 self->simcall.args[1].dp = (void*) dst_buff;
1199 self->simcall.args[2].dp = (void*) dst_buff_size;
1200 self->simcall.args[3].fp = (FPtr) match_fun;
1201 self->simcall.args[4].dp = (void*) data;
1202 if (self != simix_global->maestro_process) {
1203 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1204 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1205 SIMIX_process_yield(self);
1207 SIMIX_simcall_pre(&self->simcall, 0);
1209 return self->simcall.result.dp;
1211 inline static void simcall_BODY_comm_recv_bounded(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double timeout, double rate) {
1212 smx_process_t self = SIMIX_process_self();
1213 self->simcall.call = SIMCALL_COMM_RECV_BOUNDED;
1214 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1215 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1216 self->simcall.args[0].dp = (void*) rdv;
1217 self->simcall.args[1].dp = (void*) dst_buff;
1218 self->simcall.args[2].dp = (void*) dst_buff_size;
1219 self->simcall.args[3].fp = (FPtr) match_fun;
1220 self->simcall.args[4].dp = (void*) data;
1221 self->simcall.args[5].d = (double) timeout;
1222 self->simcall.args[6].d = (double) rate;
1223 if (self != simix_global->maestro_process) {
1224 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1225 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1226 SIMIX_process_yield(self);
1228 SIMIX_simcall_pre(&self->simcall, 0);
1232 inline static smx_action_t simcall_BODY_comm_irecv_bounded(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double rate) {
1233 smx_process_t self = SIMIX_process_self();
1234 self->simcall.call = SIMCALL_COMM_IRECV_BOUNDED;
1235 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1236 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1237 self->simcall.args[0].dp = (void*) rdv;
1238 self->simcall.args[1].dp = (void*) dst_buff;
1239 self->simcall.args[2].dp = (void*) dst_buff_size;
1240 self->simcall.args[3].fp = (FPtr) match_fun;
1241 self->simcall.args[4].dp = (void*) data;
1242 self->simcall.args[5].d = (double) rate;
1243 if (self != simix_global->maestro_process) {
1244 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1245 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1246 SIMIX_process_yield(self);
1248 SIMIX_simcall_pre(&self->simcall, 0);
1250 return self->simcall.result.dp;
1252 inline static void simcall_BODY_comm_destroy(smx_action_t comm) {
1253 smx_process_t self = SIMIX_process_self();
1254 self->simcall.call = SIMCALL_COMM_DESTROY;
1255 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1256 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1257 self->simcall.args[0].dp = (void*) comm;
1258 if (self != simix_global->maestro_process) {
1259 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1260 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1261 SIMIX_process_yield(self);
1263 SIMIX_simcall_pre(&self->simcall, 0);
1267 inline static void simcall_BODY_comm_cancel(smx_action_t comm) {
1268 smx_process_t self = SIMIX_process_self();
1269 self->simcall.call = SIMCALL_COMM_CANCEL;
1270 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1271 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1272 self->simcall.args[0].dp = (void*) comm;
1273 if (self != simix_global->maestro_process) {
1274 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1275 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1276 SIMIX_process_yield(self);
1278 SIMIX_simcall_pre(&self->simcall, 0);
1282 inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms) {
1283 smx_process_t self = SIMIX_process_self();
1284 self->simcall.call = SIMCALL_COMM_WAITANY;
1285 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1286 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1287 self->simcall.args[0].dp = (void*) comms;
1288 if (self != simix_global->maestro_process) {
1289 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1290 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1291 SIMIX_process_yield(self);
1293 SIMIX_simcall_pre(&self->simcall, 0);
1295 return self->simcall.result.i;
1297 inline static void simcall_BODY_comm_wait(smx_action_t comm, double timeout) {
1298 smx_process_t self = SIMIX_process_self();
1299 self->simcall.call = SIMCALL_COMM_WAIT;
1300 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1301 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1302 self->simcall.args[0].dp = (void*) comm;
1303 self->simcall.args[1].d = (double) timeout;
1304 if (self != simix_global->maestro_process) {
1305 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1306 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1307 SIMIX_process_yield(self);
1309 SIMIX_simcall_pre(&self->simcall, 0);
1313 inline static int simcall_BODY_comm_test(smx_action_t comm) {
1314 smx_process_t self = SIMIX_process_self();
1315 self->simcall.call = SIMCALL_COMM_TEST;
1316 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1317 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1318 self->simcall.args[0].dp = (void*) comm;
1319 if (self != simix_global->maestro_process) {
1320 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1321 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1322 SIMIX_process_yield(self);
1324 SIMIX_simcall_pre(&self->simcall, 0);
1326 return self->simcall.result.i;
1328 inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) {
1329 smx_process_t self = SIMIX_process_self();
1330 self->simcall.call = SIMCALL_COMM_TESTANY;
1331 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1332 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1333 self->simcall.args[0].dp = (void*) comms;
1334 if (self != simix_global->maestro_process) {
1335 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1336 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1337 SIMIX_process_yield(self);
1339 SIMIX_simcall_pre(&self->simcall, 0);
1341 return self->simcall.result.i;
1343 inline static double simcall_BODY_comm_get_remains(smx_action_t comm) {
1344 smx_process_t self = SIMIX_process_self();
1345 self->simcall.call = SIMCALL_COMM_GET_REMAINS;
1346 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1347 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1348 self->simcall.args[0].dp = (void*) comm;
1349 if (self != simix_global->maestro_process) {
1350 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1351 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1352 SIMIX_process_yield(self);
1354 SIMIX_simcall_pre(&self->simcall, 0);
1356 return self->simcall.result.d;
1358 inline static int simcall_BODY_comm_get_state(smx_action_t comm) {
1359 smx_process_t self = SIMIX_process_self();
1360 self->simcall.call = SIMCALL_COMM_GET_STATE;
1361 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1362 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1363 self->simcall.args[0].dp = (void*) comm;
1364 if (self != simix_global->maestro_process) {
1365 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1366 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1367 SIMIX_process_yield(self);
1369 SIMIX_simcall_pre(&self->simcall, 0);
1371 return self->simcall.result.i;
1373 inline static void* simcall_BODY_comm_get_src_data(smx_action_t comm) {
1374 smx_process_t self = SIMIX_process_self();
1375 self->simcall.call = SIMCALL_COMM_GET_SRC_DATA;
1376 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1377 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1378 self->simcall.args[0].dp = (void*) comm;
1379 if (self != simix_global->maestro_process) {
1380 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1381 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1382 SIMIX_process_yield(self);
1384 SIMIX_simcall_pre(&self->simcall, 0);
1386 return self->simcall.result.dp;
1388 inline static void* simcall_BODY_comm_get_dst_data(smx_action_t comm) {
1389 smx_process_t self = SIMIX_process_self();
1390 self->simcall.call = SIMCALL_COMM_GET_DST_DATA;
1391 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1392 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1393 self->simcall.args[0].dp = (void*) comm;
1394 if (self != simix_global->maestro_process) {
1395 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1396 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1397 SIMIX_process_yield(self);
1399 SIMIX_simcall_pre(&self->simcall, 0);
1401 return self->simcall.result.dp;
1403 inline static smx_process_t simcall_BODY_comm_get_src_proc(smx_action_t comm) {
1404 smx_process_t self = SIMIX_process_self();
1405 self->simcall.call = SIMCALL_COMM_GET_SRC_PROC;
1406 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1407 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1408 self->simcall.args[0].dp = (void*) comm;
1409 if (self != simix_global->maestro_process) {
1410 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1411 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1412 SIMIX_process_yield(self);
1414 SIMIX_simcall_pre(&self->simcall, 0);
1416 return self->simcall.result.dp;
1418 inline static smx_process_t simcall_BODY_comm_get_dst_proc(smx_action_t comm) {
1419 smx_process_t self = SIMIX_process_self();
1420 self->simcall.call = SIMCALL_COMM_GET_DST_PROC;
1421 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1422 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1423 self->simcall.args[0].dp = (void*) comm;
1424 if (self != simix_global->maestro_process) {
1425 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1426 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1427 SIMIX_process_yield(self);
1429 SIMIX_simcall_pre(&self->simcall, 0);
1431 return self->simcall.result.dp;
1433 inline static smx_mutex_t simcall_BODY_mutex_init() {
1434 smx_process_t self = SIMIX_process_self();
1435 self->simcall.call = SIMCALL_MUTEX_INIT;
1436 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1437 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1439 if (self != simix_global->maestro_process) {
1440 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1441 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1442 SIMIX_process_yield(self);
1444 SIMIX_simcall_pre(&self->simcall, 0);
1446 return self->simcall.result.dp;
1448 inline static void simcall_BODY_mutex_destroy(smx_mutex_t mutex) {
1449 smx_process_t self = SIMIX_process_self();
1450 self->simcall.call = SIMCALL_MUTEX_DESTROY;
1451 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1452 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1453 self->simcall.args[0].dp = (void*) mutex;
1454 if (self != simix_global->maestro_process) {
1455 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1456 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1457 SIMIX_process_yield(self);
1459 SIMIX_simcall_pre(&self->simcall, 0);
1463 inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
1464 smx_process_t self = SIMIX_process_self();
1465 self->simcall.call = SIMCALL_MUTEX_LOCK;
1466 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1467 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1468 self->simcall.args[0].dp = (void*) mutex;
1469 if (self != simix_global->maestro_process) {
1470 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1471 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1472 SIMIX_process_yield(self);
1474 SIMIX_simcall_pre(&self->simcall, 0);
1478 inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
1479 smx_process_t self = SIMIX_process_self();
1480 self->simcall.call = SIMCALL_MUTEX_TRYLOCK;
1481 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1482 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1483 self->simcall.args[0].dp = (void*) mutex;
1484 if (self != simix_global->maestro_process) {
1485 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1486 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1487 SIMIX_process_yield(self);
1489 SIMIX_simcall_pre(&self->simcall, 0);
1491 return self->simcall.result.i;
1493 inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
1494 smx_process_t self = SIMIX_process_self();
1495 self->simcall.call = SIMCALL_MUTEX_UNLOCK;
1496 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1497 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1498 self->simcall.args[0].dp = (void*) mutex;
1499 if (self != simix_global->maestro_process) {
1500 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1501 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1502 SIMIX_process_yield(self);
1504 SIMIX_simcall_pre(&self->simcall, 0);
1508 inline static smx_cond_t simcall_BODY_cond_init() {
1509 smx_process_t self = SIMIX_process_self();
1510 self->simcall.call = SIMCALL_COND_INIT;
1511 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1512 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1514 if (self != simix_global->maestro_process) {
1515 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1516 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1517 SIMIX_process_yield(self);
1519 SIMIX_simcall_pre(&self->simcall, 0);
1521 return self->simcall.result.dp;
1523 inline static void simcall_BODY_cond_destroy(smx_cond_t cond) {
1524 smx_process_t self = SIMIX_process_self();
1525 self->simcall.call = SIMCALL_COND_DESTROY;
1526 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1527 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1528 self->simcall.args[0].dp = (void*) cond;
1529 if (self != simix_global->maestro_process) {
1530 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1531 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1532 SIMIX_process_yield(self);
1534 SIMIX_simcall_pre(&self->simcall, 0);
1538 inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
1539 smx_process_t self = SIMIX_process_self();
1540 self->simcall.call = SIMCALL_COND_SIGNAL;
1541 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1542 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1543 self->simcall.args[0].dp = (void*) cond;
1544 if (self != simix_global->maestro_process) {
1545 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1546 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1547 SIMIX_process_yield(self);
1549 SIMIX_simcall_pre(&self->simcall, 0);
1553 inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
1554 smx_process_t self = SIMIX_process_self();
1555 self->simcall.call = SIMCALL_COND_WAIT;
1556 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1557 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1558 self->simcall.args[0].dp = (void*) cond;
1559 self->simcall.args[1].dp = (void*) mutex;
1560 if (self != simix_global->maestro_process) {
1561 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1562 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1563 SIMIX_process_yield(self);
1565 SIMIX_simcall_pre(&self->simcall, 0);
1569 inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
1570 smx_process_t self = SIMIX_process_self();
1571 self->simcall.call = SIMCALL_COND_WAIT_TIMEOUT;
1572 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1573 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1574 self->simcall.args[0].dp = (void*) cond;
1575 self->simcall.args[1].dp = (void*) mutex;
1576 self->simcall.args[2].d = (double) timeout;
1577 if (self != simix_global->maestro_process) {
1578 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1579 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1580 SIMIX_process_yield(self);
1582 SIMIX_simcall_pre(&self->simcall, 0);
1586 inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
1587 smx_process_t self = SIMIX_process_self();
1588 self->simcall.call = SIMCALL_COND_BROADCAST;
1589 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1590 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1591 self->simcall.args[0].dp = (void*) cond;
1592 if (self != simix_global->maestro_process) {
1593 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1594 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1595 SIMIX_process_yield(self);
1597 SIMIX_simcall_pre(&self->simcall, 0);
1601 inline static smx_sem_t simcall_BODY_sem_init(int capacity) {
1602 smx_process_t self = SIMIX_process_self();
1603 self->simcall.call = SIMCALL_SEM_INIT;
1604 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1605 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1606 self->simcall.args[0].i = (int) capacity;
1607 if (self != simix_global->maestro_process) {
1608 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1609 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1610 SIMIX_process_yield(self);
1612 SIMIX_simcall_pre(&self->simcall, 0);
1614 return self->simcall.result.dp;
1616 inline static void simcall_BODY_sem_destroy(smx_sem_t sem) {
1617 smx_process_t self = SIMIX_process_self();
1618 self->simcall.call = SIMCALL_SEM_DESTROY;
1619 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1620 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1621 self->simcall.args[0].dp = (void*) sem;
1622 if (self != simix_global->maestro_process) {
1623 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1624 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1625 SIMIX_process_yield(self);
1627 SIMIX_simcall_pre(&self->simcall, 0);
1631 inline static void simcall_BODY_sem_release(smx_sem_t sem) {
1632 smx_process_t self = SIMIX_process_self();
1633 self->simcall.call = SIMCALL_SEM_RELEASE;
1634 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1635 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1636 self->simcall.args[0].dp = (void*) sem;
1637 if (self != simix_global->maestro_process) {
1638 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1639 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1640 SIMIX_process_yield(self);
1642 SIMIX_simcall_pre(&self->simcall, 0);
1646 inline static int simcall_BODY_sem_would_block(smx_sem_t sem) {
1647 smx_process_t self = SIMIX_process_self();
1648 self->simcall.call = SIMCALL_SEM_WOULD_BLOCK;
1649 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1650 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1651 self->simcall.args[0].dp = (void*) sem;
1652 if (self != simix_global->maestro_process) {
1653 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1654 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1655 SIMIX_process_yield(self);
1657 SIMIX_simcall_pre(&self->simcall, 0);
1659 return self->simcall.result.i;
1661 inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
1662 smx_process_t self = SIMIX_process_self();
1663 self->simcall.call = SIMCALL_SEM_ACQUIRE;
1664 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1665 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1666 self->simcall.args[0].dp = (void*) sem;
1667 if (self != simix_global->maestro_process) {
1668 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1669 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1670 SIMIX_process_yield(self);
1672 SIMIX_simcall_pre(&self->simcall, 0);
1676 inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
1677 smx_process_t self = SIMIX_process_self();
1678 self->simcall.call = SIMCALL_SEM_ACQUIRE_TIMEOUT;
1679 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1680 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1681 self->simcall.args[0].dp = (void*) sem;
1682 self->simcall.args[1].d = (double) timeout;
1683 if (self != simix_global->maestro_process) {
1684 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1685 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1686 SIMIX_process_yield(self);
1688 SIMIX_simcall_pre(&self->simcall, 0);
1692 inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
1693 smx_process_t self = SIMIX_process_self();
1694 self->simcall.call = SIMCALL_SEM_GET_CAPACITY;
1695 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1696 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1697 self->simcall.args[0].dp = (void*) sem;
1698 if (self != simix_global->maestro_process) {
1699 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1700 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1701 SIMIX_process_yield(self);
1703 SIMIX_simcall_pre(&self->simcall, 0);
1705 return self->simcall.result.i;
1707 inline static void* simcall_BODY_file_get_data(smx_file_t fd) {
1708 smx_process_t self = SIMIX_process_self();
1709 self->simcall.call = SIMCALL_FILE_GET_DATA;
1710 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1711 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1712 self->simcall.args[0].dp = (void*) fd;
1713 if (self != simix_global->maestro_process) {
1714 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1715 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1716 SIMIX_process_yield(self);
1718 SIMIX_simcall_pre(&self->simcall, 0);
1720 return self->simcall.result.dp;
1722 inline static void simcall_BODY_file_set_data(smx_file_t fd, void* data) {
1723 smx_process_t self = SIMIX_process_self();
1724 self->simcall.call = SIMCALL_FILE_SET_DATA;
1725 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1726 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1727 self->simcall.args[0].dp = (void*) fd;
1728 self->simcall.args[1].dp = (void*) data;
1729 if (self != simix_global->maestro_process) {
1730 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1731 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1732 SIMIX_process_yield(self);
1734 SIMIX_simcall_pre(&self->simcall, 0);
1738 inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size) {
1739 smx_process_t self = SIMIX_process_self();
1740 self->simcall.call = SIMCALL_FILE_READ;
1741 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1742 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1743 self->simcall.args[0].dp = (void*) fd;
1744 self->simcall.args[1].sgsz = (sg_size_t) size;
1745 if (self != simix_global->maestro_process) {
1746 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1747 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1748 SIMIX_process_yield(self);
1750 SIMIX_simcall_pre(&self->simcall, 0);
1752 return self->simcall.result.sgsz;
1754 inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size) {
1755 smx_process_t self = SIMIX_process_self();
1756 self->simcall.call = SIMCALL_FILE_WRITE;
1757 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1758 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1759 self->simcall.args[0].dp = (void*) fd;
1760 self->simcall.args[1].sgsz = (sg_size_t) size;
1761 if (self != simix_global->maestro_process) {
1762 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1763 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1764 SIMIX_process_yield(self);
1766 SIMIX_simcall_pre(&self->simcall, 0);
1768 return self->simcall.result.sgsz;
1770 inline static smx_file_t simcall_BODY_file_open(const char* mount, const char* path) {
1771 smx_process_t self = SIMIX_process_self();
1772 self->simcall.call = SIMCALL_FILE_OPEN;
1773 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1774 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1775 self->simcall.args[0].cc = (const char*) mount;
1776 self->simcall.args[1].cc = (const char*) path;
1777 if (self != simix_global->maestro_process) {
1778 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1779 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1780 SIMIX_process_yield(self);
1782 SIMIX_simcall_pre(&self->simcall, 0);
1784 return self->simcall.result.dp;
1786 inline static int simcall_BODY_file_close(smx_file_t fd) {
1787 smx_process_t self = SIMIX_process_self();
1788 self->simcall.call = SIMCALL_FILE_CLOSE;
1789 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1790 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1791 self->simcall.args[0].dp = (void*) fd;
1792 if (self != simix_global->maestro_process) {
1793 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1794 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1795 SIMIX_process_yield(self);
1797 SIMIX_simcall_pre(&self->simcall, 0);
1799 return self->simcall.result.i;
1801 inline static int simcall_BODY_file_unlink(smx_file_t fd) {
1802 smx_process_t self = SIMIX_process_self();
1803 self->simcall.call = SIMCALL_FILE_UNLINK;
1804 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1805 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1806 self->simcall.args[0].dp = (void*) fd;
1807 if (self != simix_global->maestro_process) {
1808 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1809 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1810 SIMIX_process_yield(self);
1812 SIMIX_simcall_pre(&self->simcall, 0);
1814 return self->simcall.result.i;
1816 inline static xbt_dict_t simcall_BODY_file_ls(const char* mount, const char* path) {
1817 smx_process_t self = SIMIX_process_self();
1818 self->simcall.call = SIMCALL_FILE_LS;
1819 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1820 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1821 self->simcall.args[0].cc = (const char*) mount;
1822 self->simcall.args[1].cc = (const char*) path;
1823 if (self != simix_global->maestro_process) {
1824 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1825 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1826 SIMIX_process_yield(self);
1828 SIMIX_simcall_pre(&self->simcall, 0);
1830 return self->simcall.result.dp;
1832 inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
1833 smx_process_t self = SIMIX_process_self();
1834 self->simcall.call = SIMCALL_FILE_GET_SIZE;
1835 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1836 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1837 self->simcall.args[0].dp = (void*) fd;
1838 if (self != simix_global->maestro_process) {
1839 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1840 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1841 SIMIX_process_yield(self);
1843 SIMIX_simcall_pre(&self->simcall, 0);
1845 return self->simcall.result.sgsz;
1847 inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) {
1848 smx_process_t self = SIMIX_process_self();
1849 self->simcall.call = SIMCALL_FILE_TELL;
1850 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1851 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1852 self->simcall.args[0].dp = (void*) fd;
1853 if (self != simix_global->maestro_process) {
1854 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1855 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1856 SIMIX_process_yield(self);
1858 SIMIX_simcall_pre(&self->simcall, 0);
1860 return self->simcall.result.sgsz;
1862 inline static int simcall_BODY_file_seek(smx_file_t fd, sg_size_t offset, int origin) {
1863 smx_process_t self = SIMIX_process_self();
1864 self->simcall.call = SIMCALL_FILE_SEEK;
1865 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1866 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1867 self->simcall.args[0].dp = (void*) fd;
1868 self->simcall.args[1].sgsz = (sg_size_t) offset;
1869 self->simcall.args[2].i = (int) origin;
1870 if (self != simix_global->maestro_process) {
1871 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1872 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1873 SIMIX_process_yield(self);
1875 SIMIX_simcall_pre(&self->simcall, 0);
1877 return self->simcall.result.i;
1879 inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) {
1880 smx_process_t self = SIMIX_process_self();
1881 self->simcall.call = SIMCALL_FILE_GET_INFO;
1882 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1883 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1884 self->simcall.args[0].dp = (void*) fd;
1885 if (self != simix_global->maestro_process) {
1886 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1887 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1888 SIMIX_process_yield(self);
1890 SIMIX_simcall_pre(&self->simcall, 0);
1892 return self->simcall.result.dp;
1894 inline static void simcall_BODY_storage_file_rename(smx_storage_t storage, const char* src, const char* dest) {
1895 smx_process_t self = SIMIX_process_self();
1896 self->simcall.call = SIMCALL_STORAGE_FILE_RENAME;
1897 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1898 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1899 self->simcall.args[0].dp = (void*) storage;
1900 self->simcall.args[1].cc = (const char*) src;
1901 self->simcall.args[2].cc = (const char*) dest;
1902 if (self != simix_global->maestro_process) {
1903 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1904 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1905 SIMIX_process_yield(self);
1907 SIMIX_simcall_pre(&self->simcall, 0);
1911 inline static sg_size_t simcall_BODY_storage_get_free_size(const char* name) {
1912 smx_process_t self = SIMIX_process_self();
1913 self->simcall.call = SIMCALL_STORAGE_GET_FREE_SIZE;
1914 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1915 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1916 self->simcall.args[0].cc = (const char*) name;
1917 if (self != simix_global->maestro_process) {
1918 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1919 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1920 SIMIX_process_yield(self);
1922 SIMIX_simcall_pre(&self->simcall, 0);
1924 return self->simcall.result.sgsz;
1926 inline static sg_size_t simcall_BODY_storage_get_used_size(const char* name) {
1927 smx_process_t self = SIMIX_process_self();
1928 self->simcall.call = SIMCALL_STORAGE_GET_USED_SIZE;
1929 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1930 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1931 self->simcall.args[0].cc = (const char*) name;
1932 if (self != simix_global->maestro_process) {
1933 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1934 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1935 SIMIX_process_yield(self);
1937 SIMIX_simcall_pre(&self->simcall, 0);
1939 return self->simcall.result.sgsz;
1941 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
1942 smx_process_t self = SIMIX_process_self();
1943 self->simcall.call = SIMCALL_STORAGE_GET_PROPERTIES;
1944 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1945 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1946 self->simcall.args[0].dp = (void*) storage;
1947 if (self != simix_global->maestro_process) {
1948 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1949 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1950 SIMIX_process_yield(self);
1952 SIMIX_simcall_pre(&self->simcall, 0);
1954 return self->simcall.result.dp;
1956 inline static xbt_dict_t simcall_BODY_storage_get_content(smx_storage_t storage) {
1957 smx_process_t self = SIMIX_process_self();
1958 self->simcall.call = SIMCALL_STORAGE_GET_CONTENT;
1959 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1960 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1961 self->simcall.args[0].dp = (void*) storage;
1962 if (self != simix_global->maestro_process) {
1963 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1964 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1965 SIMIX_process_yield(self);
1967 SIMIX_simcall_pre(&self->simcall, 0);
1969 return self->simcall.result.dp;
1971 inline static xbt_dict_t simcall_BODY_asr_get_properties(const char* name) {
1972 smx_process_t self = SIMIX_process_self();
1973 self->simcall.call = SIMCALL_ASR_GET_PROPERTIES;
1974 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1975 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1976 self->simcall.args[0].cc = (const char*) name;
1977 if (self != simix_global->maestro_process) {
1978 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1979 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1980 SIMIX_process_yield(self);
1982 SIMIX_simcall_pre(&self->simcall, 0);
1984 return self->simcall.result.dp;
1986 #ifdef HAVE_LATENCY_BOUND_TRACKING
1987 inline static int simcall_BODY_comm_is_latency_bounded(smx_action_t comm) {
1988 smx_process_t self = SIMIX_process_self();
1989 self->simcall.call = SIMCALL_COMM_IS_LATENCY_BOUNDED;
1990 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1991 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1992 self->simcall.args[0].dp = (void*) comm;
1993 if (self != simix_global->maestro_process) {
1994 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1995 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1996 SIMIX_process_yield(self);
1998 SIMIX_simcall_pre(&self->simcall, 0);
2000 return self->simcall.result.i;
2005 inline static void simcall_BODY_set_category(smx_action_t action, const char* category) {
2006 smx_process_t self = SIMIX_process_self();
2007 self->simcall.call = SIMCALL_SET_CATEGORY;
2008 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2009 memset(self->simcall.args, 0, sizeof(self->simcall.args));
2010 self->simcall.args[0].dp = (void*) action;
2011 self->simcall.args[1].cc = (const char*) category;
2012 if (self != simix_global->maestro_process) {
2013 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2014 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2015 SIMIX_process_yield(self);
2017 SIMIX_simcall_pre(&self->simcall, 0);
2024 inline static void* simcall_BODY_mc_snapshot() {
2025 smx_process_t self = SIMIX_process_self();
2026 self->simcall.call = SIMCALL_MC_SNAPSHOT;
2027 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2028 memset(self->simcall.args, 0, sizeof(self->simcall.args));
2030 if (self != simix_global->maestro_process) {
2031 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2032 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2033 SIMIX_process_yield(self);
2035 SIMIX_simcall_pre(&self->simcall, 0);
2037 return self->simcall.result.dp;
2039 inline static int simcall_BODY_mc_compare_snapshots(void* s1, void* s2) {
2040 smx_process_t self = SIMIX_process_self();
2041 self->simcall.call = SIMCALL_MC_COMPARE_SNAPSHOTS;
2042 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2043 memset(self->simcall.args, 0, sizeof(self->simcall.args));
2044 self->simcall.args[0].dp = (void*) s1;
2045 self->simcall.args[1].dp = (void*) s2;
2046 if (self != simix_global->maestro_process) {
2047 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2048 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2049 SIMIX_process_yield(self);
2051 SIMIX_simcall_pre(&self->simcall, 0);
2053 return self->simcall.result.i;
2055 inline static int simcall_BODY_mc_random(int min, int max) {
2056 smx_process_t self = SIMIX_process_self();
2057 self->simcall.call = SIMCALL_MC_RANDOM;
2058 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2059 memset(self->simcall.args, 0, sizeof(self->simcall.args));
2060 self->simcall.args[0].i = (int) min;
2061 self->simcall.args[1].i = (int) max;
2062 if (self != simix_global->maestro_process) {
2063 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2064 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2065 SIMIX_process_yield(self);
2067 SIMIX_simcall_pre(&self->simcall, 0);
2069 return self->simcall.result.i;