Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
wrapping global variables in structs. not finished so smpi probably won't
[simgrid.git] / src / smpi / include / private.h
1 #include "xbt/mallocator.h"
2 #include "xbt/xbt_os_time.h"
3
4 #define SMPI_DEFAULT_SPEED 100
5 #define SMPI_REQUEST_MALLOCATOR_SIZE 100
6 #define SMPI_MESSAGE_MALLOCATOR_SIZE 100
7
8 typedef struct SMPI_Global {
9
10         // config vars
11         double            reference_speed;
12
13         // state vars
14         int               root_ready:1;
15         int               ready_process_count;
16         smx_mutex_t       start_stop_mutex;
17         smx_cond_t        start_stop_cond;
18
19         xbt_mallocator_t  request_mallocator;
20         xbt_mallocator_t  message_mallocator;
21
22         xbt_fifo_t       *pending_send_request_queues;
23         smx_mutex_t      *pending_send_request_queues_mutexes;
24
25         xbt_fifo_t       *pending_recv_request_queues;
26         smx_mutex_t      *pending_recv_request_queues_mutexes;
27
28         xbt_fifo_t       *received_message_queues;
29         smx_mutex_t      *received_message_queues_mutexes;
30
31         smx_process_t    *sender_processes;
32         smx_process_t    *receiver_processes;
33
34         int               running_hosts_count;
35         smx_mutex_t       running_hosts_count_mutex;
36
37         xbt_os_timer_t   *timers;
38         smx_mutex_t      *timers_mutexes;
39
40         int              *benchmarking_flags;
41         smx_mutex_t      *benchmarking_flags_mutexes;
42
43 } s_SMPI_Global_t, *SMPI_Global_t;
44
45 extern SMPI_Global_t smpi_global;
46
47 // smpi_received_message_t
48 struct smpi_received_message_t {
49         smpi_mpi_communicator_t *comm;
50         int src;
51         int dst;
52         int tag;
53         void *buf;
54 };
55 typedef struct smpi_received_message_t smpi_received_message_t;