Redefine the default boolean type to gmx_bool.
[alexxy/gromacs.git] / src / gmxlib / thread_mpi / impl.h
index 4f74db23fd8135165cbdf49c58687f02472feafc..0ae59008631390026ab0acd4e5c1897502108e36 100644 (file)
@@ -79,7 +79,7 @@ files.
 
 
 #ifndef __cplusplus
-typedef int bool;
+typedef int gmx_bool;
 #define TRUE 1
 #define FALSE 0
 #else
@@ -190,7 +190,7 @@ struct envelope
     size_t bufsize; /* the size of the data to be transmitted */
     tMPI_Datatype datatype; /* the data type */
 
-    bool nonblock; /* whether the receiver is non-blocking */
+    gmx_bool nonblock; /* whether the receiver is non-blocking */
 
     /* state, values from enum_envelope_state .  
        (there's a few busy-waits relying on this flag). 
@@ -206,10 +206,10 @@ struct envelope
     /* prev and next envelopes in the send/recv_envelope_list linked list  */
     struct envelope *prev,*next;
 
-    bool send; /* whether this is a send envelope (if TRUE), or a receive 
+    gmx_bool send; /* whether this is a send envelope (if TRUE), or a receive 
                   envelope (if FALSE) */
 #ifdef USE_SEND_RECV_COPY_BUFFER
-    bool using_cb; /* whether a copy buffer is (going to be) used */
+    gmx_bool using_cb; /* whether a copy buffer is (going to be) used */
     void* cb;/* the allocated copy buffer pointer */
 #endif
     /* the next and previous envelopes in the request list */
@@ -272,7 +272,7 @@ struct recv_envelope_list
 /* the request object for asynchronious operations. */
 struct tmpi_req_
 {
-    bool finished; /* whether it's finished */
+    gmx_bool finished; /* whether it's finished */
     struct envelope *ev; /* the envelope */
 
     struct tmpi_thread *source; /* the message source (for receives) */
@@ -280,7 +280,7 @@ struct tmpi_req_
     int tag; /* the tag */
     int error; /* error code */
     size_t transferred; /* the number of transferred bytes */
-    bool cancelled; /* whether the transmission was canceled */
+    gmx_bool cancelled; /* whether the transmission was canceled */
 
     struct tmpi_req_ *next,*prev; /* next,prev request in linked list,
                                      used in the req_list, but also in 
@@ -346,7 +346,7 @@ struct coll_env_thread
     size_t *bufsize; /* array of number of bytes to send/recv */
 
 #ifdef USE_COLLECTIVE_COPY_BUFFER
-    bool using_cb; /* whether a copy buffer is (going to be) used */
+    gmx_bool using_cb; /* whether a copy buffer is (going to be) used */
     tMPI_Atomic_t buf_readcount; /* Number of threads reading from buf
                                     while using_cpbuf is true, but cpbuf 
                                     is still NULL.  */
@@ -359,7 +359,7 @@ struct coll_env_thread
                            and the coll_env_thread is ready for re-use. */
     tMPI_Event recv_ev; /* event associated with being a receiving thread. */
 
-    bool *read_data; /* whether we read data from a specific thread. */
+    gmx_bool *read_data; /* whether we read data from a specific thread. */
 };
 
 /* Collective communications once sync. These run in parallel with
@@ -608,7 +608,7 @@ struct tmpi_split
 { 
     volatile int Ncol_init;
     volatile int Ncol_destroy;
-    volatile bool can_finish;
+    volatile gmx_bool can_finish;
     volatile int *colors;
     volatile int *keys;
 };
@@ -655,7 +655,7 @@ struct tmpi_datatype_
     tMPI_Op_fn *op_functions; /* array of op functions for this datatype */
     int N_comp; /* number of components */
     struct tmpi_datatype_component *comps; /* the components */
-    bool committed; /* whether the data type is committed */
+    gmx_bool committed; /* whether the data type is committed */
 };
 /* just as a shorthand:  */
 typedef struct tmpi_datatype_ tmpi_dt;
@@ -736,9 +736,9 @@ int tMPI_Error(tMPI_Comm comm, int tmpi_errno);
 
 
 /* check whether we're the main thread */
-bool tMPI_Is_master(void);
+gmx_bool tMPI_Is_master(void);
 /* check whether the current process is in a group */
-bool tMPI_In_group(tMPI_Group group);
+gmx_bool tMPI_In_group(tMPI_Group group);
 
 /* find the rank of a thread in a comm */
 int tMPI_Comm_seek_rank(tMPI_Comm comm, struct tmpi_thread *th);