Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update pipol files
[simgrid.git] / src / simix / smurf_private.h
1 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SIMIX_SMURF_PRIVATE_H
8 #define _SIMIX_SMURF_PRIVATE_H
9
10 /********************************* Requests ***********************************/
11 typedef enum {
12 #include "smx_req_enum.h"
13 } e_smx_req_t;
14
15 typedef struct s_smx_req {
16   s_xbt_swag_hookup_t state_hookup;
17   e_smx_req_t call;
18   smx_process_t issuer;
19
20   union {
21
22     struct {
23       const char *name;
24       smx_host_t result;
25     } host_get_by_name;
26
27     struct {
28       smx_host_t host;
29       const char* result;
30     } host_get_name;
31
32     struct {
33       smx_host_t host;
34       xbt_dict_t result;
35     } host_get_properties;
36
37     struct {
38       smx_host_t host;
39       double result;
40     } host_get_speed;
41
42     struct {
43       smx_host_t host;
44       double result;
45     } host_get_available_speed;
46
47     struct {
48       smx_host_t host;
49       int result;
50     } host_get_state;
51
52     struct {
53       smx_host_t host;
54       void* result;
55     } host_get_data;
56
57     struct {
58       smx_host_t host;
59       void* data;
60     } host_set_data;
61
62     struct {
63       const char* name;
64       smx_host_t host;
65       double computation_amount;
66       smx_action_t result;
67     } host_execute;
68
69     struct {
70       const char *name;
71       int host_nb;
72       smx_host_t *host_list;
73       double *computation_amount;
74       double *communication_amount;
75       double amount;
76       double rate;
77       smx_action_t result;
78     } host_parallel_execute;
79
80     struct {
81       smx_action_t execution;
82     } host_execution_destroy;
83
84     struct {
85       smx_action_t execution;
86     } host_execution_cancel;
87
88     struct {
89       smx_action_t execution;
90       double result;
91     } host_execution_get_remains;
92
93     struct {
94       smx_action_t execution;
95       e_smx_state_t result;
96     } host_execution_get_state;
97
98     struct {
99       smx_action_t execution;
100       double priority;
101     } host_execution_set_priority;
102
103     struct {
104       smx_action_t execution;
105     } host_execution_wait;
106
107     struct {
108       const char *name;
109       xbt_main_func_t code;
110       void *data;
111       const char *hostname;
112       int argc;
113       char **argv;
114       xbt_dict_t properties;
115       smx_process_t result;
116     } process_create;
117
118     struct {
119       smx_process_t process;
120     } process_kill;
121
122     struct {
123       smx_process_t process;
124       const char *source;
125       const char *dest;
126     } process_change_host;
127
128     struct {
129       smx_process_t process;
130     } process_suspend;
131
132     struct {
133       smx_process_t process;
134     } process_resume;
135
136     struct {
137       int result;
138     } process_count;
139
140     struct {
141       smx_process_t process;
142       void* result;
143     } process_get_data;
144
145     struct {
146       smx_process_t process;
147       void* data;
148     } process_set_data;
149
150     struct {
151       smx_process_t process;
152       smx_host_t result;
153     } process_get_host;
154
155     struct {
156       smx_process_t process;
157       const char *result;
158     } process_get_name;
159
160     struct {
161       smx_process_t process;
162       int result;
163     } process_is_suspended;
164
165     struct {
166       smx_process_t process;
167       xbt_dict_t result;
168     } process_get_properties;
169
170     struct {
171       double duration;
172       e_smx_state_t result;
173     } process_sleep;
174
175     struct {
176       const char *name;
177       smx_rdv_t result;
178     } rdv_create;
179
180     struct {
181       smx_rdv_t rdv;
182     } rdv_destroy;
183
184     struct {
185       const char* name;
186       smx_rdv_t result;
187     } rdv_get_by_name;
188
189     struct {
190       smx_rdv_t rdv;
191       smx_host_t host;
192       unsigned int result; 
193     } rdv_comm_count_by_host;
194
195     struct {
196       smx_rdv_t rdv;
197       smx_action_t result;
198     } rdv_get_head;
199
200     struct {
201       smx_rdv_t rdv;
202       double task_size;
203       double rate;
204       void *src_buff;
205       size_t src_buff_size;
206       int (*match_fun)(void *, void *);
207       void *data;
208       smx_action_t result;
209     } comm_isend;
210
211     struct {
212       smx_rdv_t rdv;
213       void *dst_buff;
214       size_t *dst_buff_size;
215       int (*match_fun)(void *, void *);
216           void *data;
217       smx_action_t result;
218     } comm_irecv;
219
220     struct {
221       smx_action_t comm;
222     } comm_destroy;
223
224     struct {
225       smx_action_t comm;
226     } comm_cancel;
227
228     struct {
229       xbt_dynar_t comms;
230       unsigned int result;
231     } comm_waitany;
232
233     struct {
234       smx_action_t comm;
235       double timeout;
236     } comm_wait;
237
238     struct {
239       smx_action_t comm;
240       int result;
241     } comm_test;
242
243     struct {
244       xbt_dynar_t comms;
245       int result;
246     } comm_testany;
247
248     struct {
249       smx_action_t comm;
250       double result;
251     } comm_get_remains;
252
253     struct {
254       smx_action_t comm;
255       e_smx_state_t result;
256     } comm_get_state;
257
258     struct {
259       smx_action_t comm;
260       void *result;
261     } comm_get_src_data;
262
263     struct {
264       smx_action_t comm;
265       void *result;
266     } comm_get_dst_data;
267
268     struct {
269       smx_action_t comm;
270       void *result;
271     } comm_get_src_buff;
272
273     struct {
274       smx_action_t comm;
275       void *result;
276     } comm_get_dst_buff;
277
278     struct {
279       smx_action_t comm;
280       size_t result;
281     } comm_get_src_buff_size;
282
283     struct {
284       smx_action_t comm;
285       size_t result;
286     } comm_get_dst_buff_size;
287
288     struct {
289       smx_action_t comm;
290       smx_process_t result;
291     } comm_get_src_proc;
292
293     struct {
294       smx_action_t comm;
295       smx_process_t result;
296     } comm_get_dst_proc;
297
298 #ifdef HAVE_LATENCY_BOUND_TRACKING
299     struct {
300       smx_action_t comm;
301       int result;
302     } comm_is_latency_bounded;
303 #endif
304
305 #ifdef HAVE_TRACING
306     struct {
307       smx_action_t action;
308       const char *category;
309     } set_category;
310 #endif
311
312     struct {
313       smx_mutex_t result;
314     } mutex_init;
315
316     struct {
317       smx_mutex_t mutex;
318     } mutex_lock;
319
320     struct {
321       smx_mutex_t mutex;
322       int result;
323     } mutex_trylock;
324
325     struct {
326       smx_mutex_t mutex;
327     } mutex_unlock;
328
329     struct {
330       smx_mutex_t mutex;
331     } mutex_destroy;
332
333     struct {
334       smx_cond_t result;
335     } cond_init;
336
337     struct {
338       smx_cond_t cond;
339     } cond_destroy;
340
341     struct {
342       smx_cond_t cond;
343     } cond_signal;
344
345     struct {
346       smx_cond_t cond;
347       smx_mutex_t mutex;
348     } cond_wait;
349
350     struct {
351       smx_cond_t cond;
352       smx_mutex_t mutex;
353       double timeout;
354     } cond_wait_timeout;
355
356     struct {
357       smx_cond_t cond;
358     } cond_broadcast;
359
360     struct {
361       int capacity;
362       smx_sem_t result;
363     } sem_init;
364
365     struct {
366       smx_sem_t sem;
367     } sem_destroy;
368
369     struct {
370       smx_sem_t sem;
371     } sem_release;
372
373     struct {
374       smx_sem_t sem;
375       int result;
376     } sem_would_block;
377
378     struct {
379       smx_sem_t sem;
380     } sem_acquire;
381
382     struct {
383       smx_sem_t sem;
384       double timeout;
385     } sem_acquire_timeout;
386
387     struct {
388       smx_sem_t sem;
389       int result;
390     } sem_get_capacity;
391   };
392 } s_smx_req_t, *smx_req_t;
393
394 /******************************** General *************************************/
395
396 void SIMIX_request_init(void);
397 void SIMIX_request_destroy(void);
398 void SIMIX_request_push(void);
399 smx_req_t SIMIX_request_pop(void);
400 void SIMIX_request_answer(smx_req_t);
401 void SIMIX_request_pre(smx_req_t, int);
402 void SIMIX_request_post(smx_action_t);
403 XBT_INLINE smx_req_t SIMIX_req_mine(void);
404
405 #endif
406