QUDA  v0.7.0
A library for QCD on GPUs
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Typedefs | Functions
comm_quda.h File Reference

Go to the source code of this file.

Typedefs

typedef struct MsgHandle_s MsgHandle
 
typedef struct Topology_s Topology
 
typedef int(* QudaCommsMap )(const int *coords, void *fdata)
 

Functions

char * comm_hostname (void)
 
double comm_drand (void)
 
Topologycomm_create_topology (int ndim, const int *dims, QudaCommsMap rank_from_coords, void *map_data)
 
void comm_destroy_topology (Topology *topo)
 
int comm_ndim (const Topology *topo)
 
const int * comm_dims (const Topology *topo)
 
const int * comm_coords (const Topology *topo)
 
const int * comm_coords_from_rank (const Topology *topo, int rank)
 
int comm_rank_from_coords (const Topology *topo, const int *coords)
 
int comm_rank_displaced (const Topology *topo, const int displacement[])
 
void comm_set_default_topology (Topology *topo)
 
Topologycomm_default_topology (void)
 
int comm_dim (int dim)
 
int comm_coord (int dim)
 
MsgHandlecomm_declare_send_relative (void *buffer, int dim, int dir, size_t nbytes)
 
MsgHandlecomm_declare_receive_relative (void *buffer, int dim, int dir, size_t nbytes)
 
MsgHandlecomm_declare_strided_send_relative (void *buffer, int dim, int dir, size_t blksize, int nblocks, size_t stride)
 
MsgHandlecomm_declare_strided_receive_relative (void *buffer, int dim, int dir, size_t blksize, int nblocks, size_t stride)
 
void comm_finalize (void)
 
void comm_dim_partitioned_set (int dim)
 
int comm_dim_partitioned (int dim)
 
void comm_init (int ndim, const int *dims, QudaCommsMap rank_from_coords, void *map_data)
 
int comm_rank (void)
 
int comm_size (void)
 
int comm_gpuid (void)
 
MsgHandlecomm_declare_send_displaced (void *buffer, const int displacement[], size_t nbytes)
 
MsgHandlecomm_declare_receive_displaced (void *buffer, const int displacement[], size_t nbytes)
 
MsgHandlecomm_declare_strided_send_displaced (void *buffer, const int displacement[], size_t blksize, int nblocks, size_t stride)
 
MsgHandlecomm_declare_strided_receive_displaced (void *buffer, const int displacement[], size_t blksize, int nblocks, size_t stride)
 
void comm_free (MsgHandle *mh)
 
void comm_start (MsgHandle *mh)
 
void comm_wait (MsgHandle *mh)
 
int comm_query (MsgHandle *mh)
 
void comm_allreduce (double *data)
 
void comm_allreduce_max (double *data)
 
void comm_allreduce_array (double *data, size_t size)
 
void comm_allreduce_int (int *data)
 
void comm_broadcast (void *data, size_t nbytes)
 
void comm_barrier (void)
 
void comm_abort (int status)
 

Typedef Documentation

typedef struct MsgHandle_s MsgHandle

Definition at line 8 of file comm_quda.h.

typedef int(* QudaCommsMap)(const int *coords, void *fdata)

Definition at line 12 of file comm_quda.h.

typedef struct Topology_s Topology

Definition at line 9 of file comm_quda.h.

Function Documentation

void comm_abort ( int  status)

Definition at line 246 of file comm_mpi.cpp.

void comm_allreduce ( double *  data)

Definition at line 201 of file comm_mpi.cpp.

void comm_allreduce_array ( double *  data,
size_t  size 
)

Definition at line 216 of file comm_mpi.cpp.

void comm_allreduce_int ( int *  data)

Definition at line 225 of file comm_mpi.cpp.

void comm_allreduce_max ( double *  data)

Definition at line 209 of file comm_mpi.cpp.

void comm_barrier ( void  )

Definition at line 240 of file comm_mpi.cpp.

void comm_broadcast ( void *  data,
size_t  nbytes 
)

broadcast from rank 0

Definition at line 234 of file comm_mpi.cpp.

int comm_coord ( int  dim)

Definition at line 219 of file comm_common.cpp.

const int* comm_coords ( const Topology topo)

Definition at line 156 of file comm_common.cpp.

const int* comm_coords_from_rank ( const Topology topo,
int  rank 
)

Definition at line 162 of file comm_common.cpp.

Topology* comm_create_topology ( int  ndim,
const int *  dims,
QudaCommsMap  rank_from_coords,
void *  map_data 
)

Definition at line 93 of file comm_common.cpp.

MsgHandle* comm_declare_receive_displaced ( void *  buffer,
const int  displacement[],
size_t  nbytes 
)

Create a persistent message handler for a relative receive

Parameters
bufferBuffer into which message will be received
dimDimension from message will be received
dirDirection from messaged with be recived (0 - backwards, 1 forwards)
nbytesSize of message in bytes

Declare a message handle for receiving from a node displaced in (x,y,z,t) according to "displacement"

Definition at line 117 of file comm_mpi.cpp.

MsgHandle* comm_declare_receive_relative ( void *  buffer,
int  dim,
int  dir,
size_t  nbytes 
)

Create a persistent message handler for a relative receive

Parameters
bufferBuffer into which message will be received
dimDimension from message will be received
dirDirection from messaged with be recived (0 - backwards, 1 forwards)
nbytesSize of message in bytes

Receive from the "dir" direction in the "dim" dimension

Definition at line 241 of file comm_common.cpp.

MsgHandle* comm_declare_send_displaced ( void *  buffer,
const int  displacement[],
size_t  nbytes 
)

Create a persistent message handler for a relative send

Parameters
bufferBuffer from which message will be sent
dimDimension in which message will be sent
dirDirection in which messaged with be sent (0 - backwards, 1 forwards)
nbytesSize of message in bytes

Declare a message handle for sending to a node displaced in (x,y,z,t) according to "displacement"

Definition at line 101 of file comm_mpi.cpp.

MsgHandle* comm_declare_send_relative ( void *  buffer,
int  dim,
int  dir,
size_t  nbytes 
)

Create a persistent message handler for a relative send

Parameters
bufferBuffer from which message will be sent
dimDimension in which message will be sent
dirDirection in which messaged with be sent (0 - backwards, 1 forwards)
nbytesSize of message in bytes

Send to the "dir" direction in the "dim" dimension

Definition at line 229 of file comm_common.cpp.

MsgHandle* comm_declare_strided_receive_displaced ( void *  buffer,
const int  displacement[],
size_t  blksize,
int  nblocks,
size_t  stride 
)

Create a persistent strided message handler for a displaced receive

Parameters
bufferBuffer into which message will be received
displacementArray of offsets specifying the relative node from which we are receiving
blksizeSize of block in bytes
nblocksNumber of blocks
strideStride between blocks in bytes

Declare a message handle for receiving from a node displaced in (x,y,z,t) according to "displacement"

Declare a message handle for strided receiving from a node displaced in (x,y,z,t) according to "displacement"

Definition at line 155 of file comm_mpi.cpp.

MsgHandle* comm_declare_strided_receive_relative ( void *  buffer,
int  dim,
int  dir,
size_t  blksize,
int  nblocks,
size_t  stride 
)

Create a persistent strided message handler for a relative receive

Parameters
bufferBuffer into which message will be received
dimDimension from message will be received
dirDirection from messaged with be recived (0 - backwards, 1 forwards)
blksizeSize of block in bytes
nblocksNumber of blocks
strideStride between blocks in bytes

Strided receive from the "dir" direction in the "dim" dimension

Definition at line 265 of file comm_common.cpp.

MsgHandle* comm_declare_strided_send_displaced ( void *  buffer,
const int  displacement[],
size_t  blksize,
int  nblocks,
size_t  stride 
)

Create a persistent strided message handler for a displaced send

Parameters
bufferBuffer from which message will be sent
displacementArray of offsets specifying the relative node to which we are sending
blksizeSize of block in bytes
nblocksNumber of blocks
strideStride between blocks in bytes

Declare a message handle for sending to a node displaced in (x,y,z,t) according to "displacement"

Declare a message handle for strided sending to a node displaced in (x,y,z,t) according to "displacement"

Definition at line 133 of file comm_mpi.cpp.

MsgHandle* comm_declare_strided_send_relative ( void *  buffer,
int  dim,
int  dir,
size_t  blksize,
int  nblocks,
size_t  stride 
)

Create a persistent strided message handler for a relative send

Parameters
bufferBuffer from which message will be sent
dimDimension in which message will be sent
dirDirection in which messaged with be sent (0 - backwards, 1 forwards)
blksizeSize of block in bytes
nblocksNumber of blocks
strideStride between blocks in bytes

Strided send to the "dir" direction in the "dim" dimension

Definition at line 252 of file comm_common.cpp.

Topology* comm_default_topology ( void  )

Definition at line 203 of file comm_common.cpp.

void comm_destroy_topology ( Topology topo)

Definition at line 136 of file comm_common.cpp.

int comm_dim ( int  dim)

Definition at line 212 of file comm_common.cpp.

int comm_dim_partitioned ( int  dim)

Definition at line 290 of file comm_common.cpp.

void comm_dim_partitioned_set ( int  dim)

Definition at line 284 of file comm_common.cpp.

const int* comm_dims ( const Topology topo)

Definition at line 150 of file comm_common.cpp.

double comm_drand ( void  )

We provide our own random number generator to avoid re-seeding rand(), which might also be used by the calling application. This is a clone of rand48(), provided by stdlib.h on UNIX.

Returns
a random double in the interval [0,1)

Definition at line 81 of file comm_common.cpp.

void comm_finalize ( void  )

Definition at line 274 of file comm_common.cpp.

void comm_free ( MsgHandle mh)

Definition at line 174 of file comm_mpi.cpp.

int comm_gpuid ( void  )

Definition at line 92 of file comm_mpi.cpp.

char* comm_hostname ( void  )

Definition at line 57 of file comm_common.cpp.

void comm_init ( int  ndim,
const int *  dims,
QudaCommsMap  rank_from_coords,
void *  map_data 
)

Dummy communications layer for single-GPU backend.

Definition at line 31 of file comm_mpi.cpp.

int comm_ndim ( const Topology topo)

Definition at line 144 of file comm_common.cpp.

int comm_query ( MsgHandle mh)

Definition at line 192 of file comm_mpi.cpp.

int comm_rank ( void  )

Definition at line 80 of file comm_mpi.cpp.

int comm_rank_displaced ( const Topology topo,
const int  displacement[] 
)

Definition at line 179 of file comm_common.cpp.

int comm_rank_from_coords ( const Topology topo,
const int *  coords 
)

Definition at line 168 of file comm_common.cpp.

void comm_set_default_topology ( Topology topo)

Definition at line 197 of file comm_common.cpp.

int comm_size ( void  )

Definition at line 86 of file comm_mpi.cpp.

void comm_start ( MsgHandle mh)

Definition at line 180 of file comm_mpi.cpp.

void comm_wait ( MsgHandle mh)

Definition at line 186 of file comm_mpi.cpp.