Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove defintion of msg_as_t, deprecated a long time ago.
[simgrid.git] / include / simgrid / msg.h
1 /* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_MSG_H
7 #define SIMGRID_MSG_H
8
9 #include <simgrid/actor.h>
10 #include <simgrid/barrier.h>
11 #include <simgrid/engine.h>
12 #include <simgrid/forward.h>
13 #include <simgrid/host.h>
14 #include <simgrid/instr.h>
15 #include <simgrid/mailbox.h>
16 #include <simgrid/mutex.h>
17 #include <simgrid/plugins/live_migration.h>
18 #include <simgrid/semaphore.h>
19 #include <simgrid/storage.h>
20 #include <simgrid/vm.h>
21 #include <simgrid/zone.h>
22 #include <xbt.h>
23
24 #ifndef MIN
25 #define MIN(a, b) ((a) < (b) ? (a) : (b))
26 #endif
27 #ifndef MAX
28 #define MAX(a, b) ((a) > (b) ? (a) : (b))
29 #endif
30
31 #ifdef __cplusplus
32 #include <map>
33 #include <simgrid/simix.h>
34 namespace simgrid {
35 namespace msg {
36 class Comm;
37 class Task;
38 }
39 }
40 typedef simgrid::msg::Comm sg_msg_Comm;
41 /** @brief Task datatype.
42  *
43  *  Since most scheduling algorithms rely on a concept of task  that can be either <em>computed</em> locally or
44  *  <em>transferred</em> on another processor, it seems to be the right level of abstraction for our purposes.
45  *  A <em>task</em> may then be defined by a <em>computing amount</em>, a <em>message size</em> and
46  *  some <em>private data</em>.
47  */
48 typedef simgrid::msg::Task* msg_task_t;
49 #else
50 typedef struct msg_Comm sg_msg_Comm;
51 typedef struct msg_Task* msg_task_t;
52 #endif
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57
58 /** @brief Return code of most MSG functions */
59 /* Keep these code as binary values: java bindings manipulate | of these values */
60 typedef enum {
61   MSG_OK               = 0, /**< @brief Everything is right. Keep on going this way ! */
62   MSG_TIMEOUT          = 1, /**< @brief nothing good happened before the timer you provided elapsed */
63   MSG_TRANSFER_FAILURE = 2, /**< @brief There has been a problem during you task
64     transfer. Either the network is down or the remote host has been
65     shutdown. */
66   MSG_HOST_FAILURE = 4,     /**< @brief System shutdown. The host on which you are
67     running has just been rebooted. Free your datastructures and
68     return now !*/
69   MSG_TASK_CANCELED = 8     /**< @brief Canceled task. This task has been canceled by somebody!*/
70 } msg_error_t;
71
72 /* *************************** Network Zones ******************************** */
73 typedef sg_netzone_t msg_netzone_t;
74
75 XBT_PUBLIC msg_netzone_t MSG_zone_get_root();
76 XBT_PUBLIC const char* MSG_zone_get_name(msg_netzone_t zone);
77 XBT_PUBLIC msg_netzone_t MSG_zone_get_by_name(const char* name);
78 XBT_PUBLIC void MSG_zone_get_sons(msg_netzone_t zone, xbt_dict_t whereto);
79 XBT_PUBLIC const char* MSG_zone_get_property_value(msg_netzone_t zone, const char* name);
80 XBT_PUBLIC void MSG_zone_set_property_value(msg_netzone_t zone, const char* name, char* value);
81 XBT_PUBLIC void MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
82
83 /* ******************************** Hosts ************************************ */
84 /** @brief Host datatype.
85  *
86  * A <em>location</em> (or <em>host</em>) is any possible place where a process may run. Thus it is represented as a
87  * <em>physical resource with computing capabilities</em>, some <em>mailboxes</em> to enable running process to
88  * communicate with remote ones, and some <em>private data</em> that can be only accessed by local process.
89  */
90 typedef sg_host_t msg_host_t;
91
92 /** @brief Finds a msg_host_t using its name. */
93 XBT_PUBLIC sg_host_t MSG_get_host_by_name(const char* name);
94 /** @brief Finds a msg_host_t using its name. */
95 XBT_PUBLIC sg_host_t MSG_host_by_name(const char* name);
96
97 /** @brief Returns the amount of host found in the platform */
98 XBT_PUBLIC size_t MSG_get_host_number();
99 /** @brief Returns a dynar with all existing hosts
100  *
101  * The host order in the returned array is generally different from the host creation/declaration order in the XML
102  * platform (we use a hash table internally).
103  */
104 XBT_PUBLIC xbt_dynar_t MSG_hosts_as_dynar();
105
106 /** @brief Returns the name of this host */
107 XBT_PUBLIC const char* MSG_host_get_name(sg_host_t host);
108 /** @brief Returns the user data of this host */
109 XBT_PUBLIC void* MSG_host_get_data(sg_host_t host);
110 /** @brief Sets the user data of this host */
111 XBT_PUBLIC void MSG_host_set_data(sg_host_t host, void* data);
112 XBT_PUBLIC xbt_dict_t MSG_host_get_mounted_storage_list(sg_host_t host);
113 XBT_PUBLIC xbt_dynar_t MSG_host_get_attached_storage_lists(sg_host_t host);
114 XBT_PUBLIC double MSG_host_get_speed(sg_host_t host);
115 XBT_PUBLIC double MSG_host_get_power_peak_at(sg_host_t host, int pstate_index);
116 XBT_PUBLIC int MSG_host_get_core_number(sg_host_t host);
117 XBT_PUBLIC int MSG_host_get_nb_pstates(sg_host_t host);
118 XBT_PUBLIC int MSG_host_get_pstate(sg_host_t host);
119 XBT_PUBLIC void MSG_host_set_pstate(sg_host_t host, int pstate);
120 /** @brief Start the host if it is off
121  *
122  * See also #MSG_host_is_on() to test the current state of the host and @ref SURF_plugin_energy
123  * for more info on DVFS.
124  */
125 XBT_PUBLIC void MSG_host_on(sg_host_t h);
126 /** @brief Stop the host if it is on
127  *
128  * See also MSG_host_is_on() to test the current state of the host and @ref SURF_plugin_energy
129  * for more info on DVFS.
130  */
131 XBT_PUBLIC void MSG_host_off(sg_host_t h);
132 XBT_PUBLIC int MSG_host_is_on(sg_host_t h);
133 XBT_PUBLIC xbt_dict_t MSG_host_get_properties(sg_host_t host);
134 XBT_PUBLIC const char* MSG_host_get_property_value(sg_host_t host, const char* name);
135 XBT_PUBLIC void MSG_host_set_property_value(sg_host_t host, const char* name, const char* value);
136 XBT_PUBLIC void MSG_host_get_process_list(sg_host_t host, xbt_dynar_t whereto);
137
138 /** @brief Return the location on which the current process is executed */
139 XBT_PUBLIC sg_host_t MSG_host_self();
140 XBT_PUBLIC double MSG_host_get_load(sg_host_t host);
141
142 /* ******************************** VMs ************************************* */
143 typedef sg_vm_t msg_vm_t;
144
145 XBT_PUBLIC msg_vm_t MSG_vm_create_core(msg_host_t pm, const char* name);
146 XBT_PUBLIC msg_vm_t MSG_vm_create_multicore(msg_host_t pm, const char* name, int coreAmount);
147
148 XBT_PUBLIC int MSG_vm_is_created(msg_vm_t vm);
149 XBT_PUBLIC int MSG_vm_is_running(msg_vm_t vm);
150 XBT_PUBLIC int MSG_vm_is_suspended(msg_vm_t vm);
151
152 XBT_PUBLIC const char* MSG_vm_get_name(msg_vm_t vm);
153 XBT_PUBLIC void MSG_vm_set_ramsize(msg_vm_t vm, size_t size);
154 XBT_PUBLIC size_t MSG_vm_get_ramsize(msg_vm_t vm);
155 XBT_PUBLIC msg_host_t MSG_vm_get_pm(msg_vm_t vm);
156 XBT_PUBLIC void MSG_vm_set_bound(msg_vm_t vm, double bound);
157
158 XBT_PUBLIC void MSG_vm_start(msg_vm_t vm);
159 XBT_PUBLIC void MSG_vm_suspend(msg_vm_t vm);
160 XBT_PUBLIC void MSG_vm_resume(msg_vm_t vm);
161 XBT_PUBLIC void MSG_vm_shutdown(msg_vm_t vm);
162 XBT_PUBLIC void MSG_vm_destroy(msg_vm_t vm);
163
164 /* ******************************** Storage ********************************* */
165 typedef sg_storage_t msg_storage_t;
166
167 XBT_PUBLIC const char* MSG_storage_get_name(msg_storage_t storage);
168 XBT_PUBLIC msg_storage_t MSG_storage_get_by_name(const char* name);
169 XBT_PUBLIC xbt_dict_t MSG_storage_get_properties(msg_storage_t storage);
170 XBT_PUBLIC void MSG_storage_set_property_value(msg_storage_t storage, const char* name, const char* value);
171 XBT_PUBLIC const char* MSG_storage_get_property_value(msg_storage_t storage, const char* name);
172 XBT_PUBLIC xbt_dynar_t MSG_storages_as_dynar();
173 XBT_PUBLIC void MSG_storage_set_data(msg_storage_t storage, void* data);
174 XBT_PUBLIC void* MSG_storage_get_data(msg_storage_t storage);
175 XBT_PUBLIC const char* MSG_storage_get_host(msg_storage_t storage);
176 XBT_PUBLIC sg_size_t MSG_storage_read(msg_storage_t storage, sg_size_t size);
177 XBT_PUBLIC sg_size_t MSG_storage_write(msg_storage_t storage, sg_size_t size);
178
179 /* ******************************** Actor/process *************************** */
180 /** Processes are independent agents that can do stuff on their own.
181  *  They are in charge of executing your code interacting with the simulated world.
182  *  A process may be defined as a <em>code</em> with some <em>private data</em>.
183  *  Processes must be located on <em>hosts</em> (#msg_host_t), and they exchange data by sending tasks (#msg_task_t)
184  *  that are similar to envelops containing data.
185  *
186  *  @hideinitializer
187  */
188 typedef sg_actor_t msg_process_t;
189
190 XBT_PUBLIC int MSG_process_get_PID(msg_process_t process);
191 XBT_PUBLIC int MSG_process_get_PPID(msg_process_t process);
192 /** @brief Return a process from its PID (or NULL if not found).
193  *
194  * Note that the PID are unique in the whole simulation, not only on a given host.
195  */
196 XBT_PUBLIC sg_actor_t MSG_process_from_PID(int pid);
197 XBT_PUBLIC const char* MSG_process_get_name(msg_process_t process);
198 XBT_PUBLIC sg_host_t MSG_process_get_host(msg_process_t process);
199
200 /*property handlers*/
201 XBT_PUBLIC xbt_dict_t MSG_process_get_properties(msg_process_t process);
202 XBT_PUBLIC const char* MSG_process_get_property_value(msg_process_t process, const char* name);
203
204 XBT_PUBLIC void MSG_process_suspend(msg_process_t process);
205 XBT_PUBLIC void MSG_process_resume(msg_process_t process);
206 XBT_PUBLIC int MSG_process_is_suspended(msg_process_t process);
207 XBT_PUBLIC void MSG_process_restart(msg_process_t process);
208 /** @brief Sets the "auto-restart" flag of the process.
209  *
210  * If the flag is set, the process will be automatically restarted when its host comes back up.
211  */
212 XBT_PUBLIC void MSG_process_auto_restart_set(msg_process_t process, int auto_restart);
213 /** @brief Indicates that this process should not prevent the simulation from ending
214  *
215  * SimGrid simulations run until all non-daemon processes are stopped.
216  */
217 XBT_PUBLIC void MSG_process_daemonize(msg_process_t process);
218 /** @brief Imediately changes the host on which this process runs */
219 XBT_PUBLIC void MSG_process_migrate(msg_process_t process, msg_host_t host);
220 /** @brief Wait for the completion of a process.
221  *
222  * @param process the process to wait for
223  * @param timeout wait until the process is over, or the timeout occurs
224  */
225 XBT_PUBLIC void MSG_process_join(msg_process_t process, double timeout);
226 /** @brief Kills a process */
227 XBT_PUBLIC void MSG_process_kill(msg_process_t process);
228 /** @brief Kill all running process */
229 XBT_PUBLIC void MSG_process_killall();
230 /** @brief Specifies the time at which the process should be automatically killed */
231 XBT_PUBLIC void MSG_process_set_kill_time(msg_process_t process, double kill_time);
232 /** @brief Yield the current actor; let the other actors execute first */
233 XBT_PUBLIC void MSG_process_yield();
234 /*** @brief Sleep for the specified number of seconds */
235 XBT_PUBLIC msg_error_t MSG_process_sleep(double nb_sec);
236 XBT_PUBLIC msg_process_t MSG_process_self();
237 XBT_PUBLIC aid_t MSG_process_self_PID();
238 XBT_PUBLIC aid_t MSG_process_self_PPID();
239 XBT_PUBLIC const char* MSG_process_self_name();
240 XBT_PUBLIC void MSG_process_ref(msg_process_t process);
241 XBT_PUBLIC void MSG_process_unref(msg_process_t process);
242
243 /** @brief Object representing an ongoing communication between processes.
244  *
245  * \rst
246  * Such beast is usually obtained by using :cpp:func:`MSG_task_isend`, :cpp:func:`MSG_task_irecv` or friends.
247  * \endrst
248  */
249 typedef sg_msg_Comm* msg_comm_t;
250
251 /* ******************************** Task ************************************ */
252
253
254 /** @brief Default value for an uninitialized #msg_task_t. */
255 #define MSG_TASK_UNINITIALIZED NULL
256
257 /************************** Global ******************************************/
258 /** @brief set a configuration variable
259  *
260  * Do --help on any simgrid binary to see the list of currently existing configuration variables, and see Section @ref
261  * options.
262  *
263  * Example:
264  * MSG_config("host/model","ptask_L07");
265  */
266 XBT_PUBLIC void MSG_config(const char* key, const char* value);
267 /** @brief Initialize the MSG internal data.
268  *  @hideinitializer
269  *
270  *  It also checks that the link-time and compile-time versions of SimGrid do
271  *  match, so you should use this version instead of the #MSG_init_nocheck
272  *  function that does the same initializations, but without this check.
273  *
274  *  We allow linking against compiled versions that differ in the patch level.
275  */
276 #define MSG_init(argc, argv)                                                                                           \
277   do {                                                                                                                 \
278     sg_version_check(SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, SIMGRID_VERSION_PATCH);                             \
279     MSG_init_nocheck((argc), (argv));                                                                                  \
280   } while (0)
281
282 XBT_PUBLIC void MSG_init_nocheck(int* argc, char** argv);
283 /** @brief Launch the MSG simulation */
284 XBT_PUBLIC msg_error_t MSG_main();
285 /** @brief Registers the main function of a process in a global table.
286  *
287  * This table is then used by #MSG_launch_application.
288  * @param name the reference name of the function.
289  * @param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char
290  * *argv[]))
291  */
292 XBT_PUBLIC void MSG_function_register(const char* name, xbt_main_func_t code);
293 /** @brief Registers a code function as being the default value.
294  *
295  * This function will get used by MSG_launch_application() when there is no registered function of the requested name
296  * in.
297  *
298  * @param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char
299  * *argv[]))
300  */
301 XBT_PUBLIC void MSG_function_register_default(xbt_main_func_t code);
302 /** @brief Creates a new platform, including hosts, links and the routing_table */
303 XBT_PUBLIC void MSG_create_environment(const char* file);
304 /** @brief Creates the application described in the provided file */
305 XBT_PUBLIC void MSG_launch_application(const char* file);
306 /** @brief register functions bypassing the parser */
307 XBT_PUBLIC void MSG_set_function(const char* host_id, const char* function_name, xbt_dynar_t arguments);
308
309 /** @brief A clock (in second). */
310 XBT_PUBLIC double MSG_get_clock();
311 /** @brief Returns the amount of messages sent since the simulation start */
312 XBT_PUBLIC unsigned long int MSG_get_sent_msg();
313
314 /************************** Process handling *********************************/
315 XBT_PUBLIC void MSG_process_userdata_init();
316 XBT_PUBLIC msg_process_t MSG_process_create(const char* name, xbt_main_func_t code, void* data, msg_host_t host);
317 XBT_PUBLIC msg_process_t MSG_process_create_with_arguments(const char* name, xbt_main_func_t code, void* data,
318                                                            msg_host_t host, int argc, char** argv);
319 XBT_PUBLIC msg_process_t MSG_process_create_with_environment(const char* name, xbt_main_func_t code, void* data,
320                                                              msg_host_t host, int argc, char** argv,
321                                                              xbt_dict_t properties);
322
323 XBT_PUBLIC msg_process_t MSG_process_attach(const char* name, void* data, msg_host_t host, xbt_dict_t properties);
324 XBT_PUBLIC void MSG_process_detach();
325
326 XBT_PUBLIC void MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup);
327 XBT_PUBLIC xbt_dynar_t MSG_processes_as_dynar();
328 XBT_PUBLIC int MSG_process_get_number();
329
330 XBT_PUBLIC void* MSG_process_get_data(msg_process_t process);
331 XBT_PUBLIC msg_error_t MSG_process_set_data(msg_process_t process, void* data);
332
333 XBT_PUBLIC void MSG_process_on_exit(int_f_int_pvoid_t fun, void* data);
334
335 /************************** Task handling ************************************/
336 XBT_PUBLIC msg_task_t MSG_task_create(const char* name, double flops_amount, double bytes_amount, void* data);
337 XBT_PUBLIC msg_task_t MSG_parallel_task_create(const char* name, int host_nb, const msg_host_t* host_list,
338                                                double* flops_amount, double* bytes_amount, void* data);
339 XBT_PUBLIC void* MSG_task_get_data(msg_task_t task);
340 XBT_PUBLIC void MSG_task_set_data(msg_task_t task, void* data);
341 XBT_PUBLIC msg_process_t MSG_task_get_sender(msg_task_t task);
342 XBT_PUBLIC msg_host_t MSG_task_get_source(msg_task_t task);
343 XBT_PUBLIC const char* MSG_task_get_name(msg_task_t task);
344 XBT_PUBLIC void MSG_task_set_name(msg_task_t task, const char* name);
345 XBT_PUBLIC msg_error_t MSG_task_cancel(msg_task_t task);
346 XBT_PUBLIC msg_error_t MSG_task_destroy(msg_task_t task);
347
348 XBT_PUBLIC msg_error_t MSG_task_execute(msg_task_t task);
349 XBT_PUBLIC msg_error_t MSG_parallel_task_execute(msg_task_t task);
350 XBT_PUBLIC msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeout);
351 XBT_PUBLIC void MSG_task_set_priority(msg_task_t task, double priority);
352 XBT_PUBLIC void MSG_task_set_bound(msg_task_t task, double bound);
353
354 XBT_PUBLIC void MSG_task_set_flops_amount(msg_task_t task, double flops_amount);
355 XBT_PUBLIC double MSG_task_get_flops_amount(msg_task_t task);
356 XBT_PUBLIC double MSG_task_get_remaining_work_ratio(msg_task_t task);
357 XBT_PUBLIC void MSG_task_set_bytes_amount(msg_task_t task, double bytes_amount);
358
359 XBT_PUBLIC double MSG_task_get_remaining_communication(msg_task_t task);
360 XBT_PUBLIC double MSG_task_get_bytes_amount(msg_task_t task);
361
362 XBT_PUBLIC msg_error_t MSG_task_receive_with_timeout(msg_task_t* task, const char* alias, double timeout);
363
364 XBT_PUBLIC msg_error_t MSG_task_receive(msg_task_t* task, const char* alias);
365 #define MSG_task_recv(t, a) MSG_task_receive((t), (a))
366
367 XBT_PUBLIC msg_error_t MSG_task_receive_with_timeout_bounded(msg_task_t* task, const char* alias, double timeout,
368                                                              double rate);
369 XBT_PUBLIC msg_error_t MSG_task_receive_bounded(msg_task_t* task, const char* alias, double rate);
370 #define MSG_task_recv_bounded(t, a, r) MSG_task_receive_bounded((t), (a), (r))
371
372 XBT_PUBLIC msg_comm_t MSG_task_isend(msg_task_t task, const char* alias);
373 XBT_PUBLIC msg_comm_t MSG_task_isend_bounded(msg_task_t task, const char* alias, double maxrate);
374
375 XBT_PUBLIC void MSG_task_dsend(msg_task_t task, const char* alias, void_f_pvoid_t cleanup);
376 XBT_PUBLIC void MSG_task_dsend_bounded(msg_task_t task, const char* alias, void_f_pvoid_t cleanup, double maxrate);
377 XBT_PUBLIC msg_comm_t MSG_task_irecv(msg_task_t* task, const char* alias);
378 XBT_PUBLIC msg_comm_t MSG_task_irecv_bounded(msg_task_t* task, const char* alias, double rate);
379 XBT_PUBLIC int MSG_comm_test(msg_comm_t comm);
380 XBT_PUBLIC int MSG_comm_testany(xbt_dynar_t comms);
381 XBT_PUBLIC void MSG_comm_destroy(msg_comm_t comm);
382 XBT_PUBLIC msg_error_t MSG_comm_wait(msg_comm_t comm, double timeout);
383 XBT_PUBLIC void MSG_comm_waitall(msg_comm_t* comm, int nb_elem, double timeout);
384 XBT_PUBLIC int MSG_comm_waitany(xbt_dynar_t comms);
385 XBT_PUBLIC msg_task_t MSG_comm_get_task(msg_comm_t comm);
386 XBT_PUBLIC msg_error_t MSG_comm_get_status(msg_comm_t comm);
387
388 /** @brief Check if there is a communication going on in a mailbox.
389  *
390  * @param alias the name of the mailbox to be considered
391  *
392  * @return Returns 1 if there is a communication, 0 otherwise
393  */
394 XBT_PUBLIC int MSG_task_listen(const char* alias);
395 XBT_PUBLIC msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char* alias, double timeout);
396 XBT_PUBLIC msg_error_t MSG_task_send_with_timeout_bounded(msg_task_t task, const char* alias, double timeout,
397                                                           double maxrate);
398 XBT_PUBLIC msg_error_t MSG_task_send(msg_task_t task, const char* alias);
399 XBT_PUBLIC msg_error_t MSG_task_send_bounded(msg_task_t task, const char* alias, double rate);
400 XBT_PUBLIC int MSG_task_listen_from(const char* alias);
401 XBT_PUBLIC void MSG_task_set_category(msg_task_t task, const char* category);
402 XBT_PUBLIC const char* MSG_task_get_category(msg_task_t task);
403
404 /************************** Mailbox handling ************************************/
405
406 /* @brief set a mailbox in eager mode.
407  * All messages sent to this mailbox will be transferred to the receiver without waiting for the receive call.
408  * The receive call will still be necessary to use the received data.
409  * If there is a need to receive some messages asynchronously, and some not, two different mailboxes should be used.
410  *
411  * This call should be done before issuing any receive, and on the receiver's side only
412  */
413 XBT_PUBLIC void MSG_mailbox_set_async(const char* alias);
414
415 /** @brief Opaque type representing a semaphore */
416 typedef sg_sem_t msg_sem_t;
417 XBT_PUBLIC msg_sem_t MSG_sem_init(int initial_value);
418 XBT_PUBLIC void MSG_sem_acquire(msg_sem_t sem);
419 XBT_PUBLIC int MSG_sem_acquire_timeout(msg_sem_t sem, double timeout);
420 XBT_PUBLIC void MSG_sem_release(msg_sem_t sem);
421 XBT_PUBLIC int MSG_sem_get_capacity(msg_sem_t sem);
422 XBT_PUBLIC void MSG_sem_destroy(msg_sem_t sem);
423 XBT_PUBLIC int MSG_sem_would_block(msg_sem_t sem);
424
425 /** @brief Opaque type representing a barrier identifier */
426 typedef sg_bar_t msg_bar_t;
427 /** @brief Initializes a barier, with count elements */
428 XBT_PUBLIC msg_bar_t MSG_barrier_init(unsigned int count);
429 /** @brief Destroys barrier */
430 XBT_PUBLIC void MSG_barrier_destroy(msg_bar_t bar);
431 /** @brief Performs a barrier already initialized */
432 XBT_PUBLIC int MSG_barrier_wait(msg_bar_t bar);
433
434 /* ****************************************************************************************** */
435 #ifdef __cplusplus
436 }
437 #endif
438
439 #endif