QUDA  v0.5.0
A library for QCD on GPUs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
comm_quda.h
Go to the documentation of this file.
1 #ifndef _COMM_QUDA_H
2 #define _COMM_QUDA_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8  typedef struct MsgHandle_s MsgHandle;
9  typedef struct Topology_s Topology;
10 
11  /* defined in quda.h; redefining here to avoid circular references */
12  typedef int (*QudaCommsMap)(const int *coords, void *fdata);
13 
14  /* implemented in comm_common.cpp */
15 
16  char *comm_hostname(void);
17  double comm_drand(void);
18  Topology *comm_create_topology(int ndim, const int *dims, QudaCommsMap rank_from_coords, void *map_data);
19  void comm_destroy_topology(Topology *topo);
20  int comm_ndim(const Topology *topo);
21  const int *comm_dims(const Topology *topo);
22  const int *comm_coords(const Topology *topo);
23  const int *comm_coords_from_rank(const Topology *topo, int rank);
24  int comm_rank_from_coords(const Topology *topo, const int *coords);
25  int comm_rank_displaced(const Topology *topo, const int displacement[]);
28  int comm_dim(int dim);
29  int comm_coord(int dim);
30  MsgHandle *comm_declare_send_relative(void *buffer, int dim, int dir, size_t nbytes);
31  MsgHandle *comm_declare_receive_relative(void *buffer, int dim, int dir, size_t nbytes);
32  void comm_finalize(void);
33  void comm_dim_partitioned_set(int dim);
34  int comm_dim_partitioned(int dim);
35 
36 
37  /* implemented in comm_single.cpp, comm_qmp.cpp, and comm_mpi.cpp */
38 
39  void comm_init(int ndim, const int *dims, QudaCommsMap rank_from_coords, void *map_data);
40  int comm_rank(void);
41  int comm_size(void);
42  int comm_gpuid(void);
43  MsgHandle *comm_declare_send_displaced(void *buffer, const int displacement[], size_t nbytes);
44  MsgHandle *comm_declare_receive_displaced(void *buffer, const int displacement[], size_t nbytes);
45  void comm_free(MsgHandle *mh);
46  void comm_start(MsgHandle *mh);
47  void comm_wait(MsgHandle *mh);
48  int comm_query(MsgHandle *mh);
49  void comm_allreduce(double* data);
50  void comm_allreduce_max(double* data);
51  void comm_allreduce_array(double* data, size_t size);
52  void comm_allreduce_int(int* data);
53  void comm_broadcast(void *data, size_t nbytes);
54  void comm_barrier(void);
55  void comm_abort(int status);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif /* _COMM_QUDA_H */