Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
caf5dbd51e35fc7947127be5b7e90fe459d153d8
[simgrid.git] / src / simix / smx_network_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_NETWORK_PRIVATE_H
8 #define _SIMIX_NETWORK_PRIVATE_H
9
10 #include "simix/datatypes.h"
11 #include "smx_smurf_private.h"
12
13 /** @brief Rendez-vous point datatype */
14 typedef struct s_smx_rvpoint {
15   char *name;
16   xbt_fifo_t comm_fifo;
17   void *data;
18 } s_smx_rvpoint_t;
19
20 void SIMIX_network_init(void);
21 void SIMIX_network_exit(void);
22
23 #ifdef HAVE_LATENCY_BOUND_TRACKING
24 XBT_INLINE XBT_PUBLIC(int) SIMIX_comm_is_latency_bounded(smx_action_t comm);
25 #endif
26
27 smx_rdv_t SIMIX_rdv_create(const char *name);
28 void SIMIX_rdv_destroy(smx_rdv_t rdv);
29 smx_rdv_t SIMIX_rdv_get_by_name(const char *name);
30 XBT_INLINE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_action_t comm);
31 int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host);
32 smx_action_t SIMIX_rdv_get_head(smx_rdv_t rdv);
33 XBT_INLINE void SIMIX_comm_start(smx_action_t action);
34 void SIMIX_comm_send(smx_process_t src_proc, smx_rdv_t rdv,
35                      double task_size, double rate,
36                      void *src_buff, size_t src_buff_size,
37                      int (*)(void *, void *), void *data,
38                      double timeout);
39 smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv,
40                               double task_size, double rate,
41                               void *src_buff, size_t src_buff_size,
42                               int (*)(void *, void *),
43                               void (*clean_fun)(void *), // used to free the action in case of problem after a detached send
44                               void *data,
45                               int detached);
46 void SIMIX_comm_recv(smx_process_t dst_proc, smx_rdv_t rdv,
47                      void *dst_buff, size_t *dst_buff_size,
48                      int (*)(void *, void *), void *data,
49                      double timeout);
50 smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
51                               void *dst_buff, size_t *dst_buff_size,
52                               int (*)(void *, void *), void *data);
53 void SIMIX_comm_destroy(smx_action_t action);
54 void SIMIX_comm_destroy_internal_actions(smx_action_t action);
55 void SIMIX_pre_comm_wait(smx_simcall_t simcall, smx_action_t action, double timeout, int idx);
56 void SIMIX_pre_comm_waitany(smx_simcall_t simcall, int idx);
57 void SIMIX_post_comm(smx_action_t action);
58 void SIMIX_pre_comm_test(smx_simcall_t simcall);
59 void SIMIX_pre_comm_testany(smx_simcall_t simcall, int idx);
60 void SIMIX_comm_cancel(smx_action_t action);
61 double SIMIX_comm_get_remains(smx_action_t action);
62 e_smx_state_t SIMIX_comm_get_state(smx_action_t action);
63 void SIMIX_comm_suspend(smx_action_t action);
64 void SIMIX_comm_resume(smx_action_t action);
65 void* SIMIX_comm_get_src_data(smx_action_t action);
66 void* SIMIX_comm_get_dst_data(smx_action_t action);
67 smx_process_t SIMIX_comm_get_src_proc(smx_action_t action);
68 smx_process_t SIMIX_comm_get_dst_proc(smx_action_t action);
69
70 #endif
71