QUDA  0.9.0
Classes | Macros | Functions | Variables
comm_qmp.cpp File Reference
#include <qmp.h>
#include <csignal>
#include <quda_internal.h>
#include <comm_quda.h>
#include <mpi.h>
Include dependency graph for comm_qmp.cpp:

Go to the source code of this file.

Classes

struct  MsgHandle_s
 

Macros

#define QMP_CHECK(qmp_call)
 
#define USE_MPI_GATHER
 

Functions

void comm_gather_hostname (char *hostname_recv_buf)
 Gather all hostnames. More...
 
void comm_gather_gpuid (int *gpuid_recv_buf)
 Gather all GPU ids. More...
 
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_allreduce_xor (uint64_t *data)
 
void comm_broadcast (void *data, size_t nbytes)
 
void comm_barrier (void)
 
void comm_abort (int status)
 
const char * comm_dim_partitioned_string ()
 Return a string that defines the comm partitioning (used as a tuneKey) More...
 
const char * comm_dim_topology_string ()
 Return a string that defines the comm topology (for use as a tuneKey) More...
 

Variables

static int gpuid = -1
 
static char partition_string [16]
 
static char topology_string [16]
 

Macro Definition Documentation

◆ QMP_CHECK

#define QMP_CHECK (   qmp_call)
Value:
do { \
QMP_status_t status = qmp_call; \
if (status != QMP_SUCCESS) \
errorQuda("(QMP) %s", QMP_error_string(status)); \
} while (0)

Definition at line 6 of file comm_qmp.cpp.

Referenced by comm_allreduce(), comm_allreduce_array(), comm_allreduce_int(), comm_allreduce_max(), comm_allreduce_xor(), comm_barrier(), comm_broadcast(), comm_start(), and comm_wait().

◆ USE_MPI_GATHER

#define USE_MPI_GATHER

Definition at line 25 of file comm_qmp.cpp.

Function Documentation

◆ comm_abort()

void comm_abort ( int  status)

Definition at line 295 of file comm_qmp.cpp.

◆ comm_allreduce()

void comm_allreduce ( double data)

Definition at line 254 of file comm_qmp.cpp.

References QMP_CHECK.

◆ comm_allreduce_array()

void comm_allreduce_array ( double data,
size_t  size 
)

Definition at line 266 of file comm_qmp.cpp.

References QMP_CHECK, and size.

◆ comm_allreduce_int()

void comm_allreduce_int ( int data)

Definition at line 272 of file comm_qmp.cpp.

References QMP_CHECK.

◆ comm_allreduce_max()

void comm_allreduce_max ( double data)

Definition at line 260 of file comm_qmp.cpp.

References QMP_CHECK.

◆ comm_allreduce_xor()

void comm_allreduce_xor ( uint64_t data)

Definition at line 277 of file comm_qmp.cpp.

References errorQuda, and QMP_CHECK.

◆ comm_barrier()

void comm_barrier ( void  )

Definition at line 289 of file comm_qmp.cpp.

References QMP_CHECK.

◆ comm_broadcast()

void comm_broadcast ( void *  data,
size_t  nbytes 
)

broadcast from rank 0

Definition at line 283 of file comm_qmp.cpp.

References QMP_CHECK.

◆ comm_declare_receive_displaced()

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

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

Definition at line 168 of file comm_qmp.cpp.

References comm_default_topology(), comm_rank_displaced(), errorQuda, MsgHandle_s::handle, MsgHandle_s::mem, rank, and safe_malloc.

Here is the call graph for this function:

◆ comm_declare_send_displaced()

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

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

Definition at line 149 of file comm_qmp.cpp.

References comm_default_topology(), comm_rank_displaced(), errorQuda, MsgHandle_s::handle, MsgHandle_s::mem, rank, and safe_malloc.

Here is the call graph for this function:

◆ comm_declare_strided_receive_displaced()

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

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

Definition at line 210 of file comm_qmp.cpp.

References comm_default_topology(), comm_rank_displaced(), errorQuda, MsgHandle_s::handle, MsgHandle_s::mem, rank, and safe_malloc.

Here is the call graph for this function:

◆ comm_declare_strided_send_displaced()

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

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

Definition at line 189 of file comm_qmp.cpp.

References comm_default_topology(), comm_rank_displaced(), errorQuda, MsgHandle_s::handle, MsgHandle_s::mem, rank, and safe_malloc.

Here is the call graph for this function:

◆ comm_dim_partitioned_string()

const char* comm_dim_partitioned_string ( )

Return a string that defines the comm partitioning (used as a tuneKey)

Returns
String specifying comm partitioning

Definition at line 303 of file comm_qmp.cpp.

References partition_string.

◆ comm_dim_topology_string()

const char* comm_dim_topology_string ( )

Return a string that defines the comm topology (for use as a tuneKey)

Returns
String specifying comm topology

Definition at line 307 of file comm_qmp.cpp.

References topology_string.

◆ comm_free()

void comm_free ( MsgHandle mh)

Definition at line 228 of file comm_qmp.cpp.

References MsgHandle_s::handle, host_free, and MsgHandle_s::mem.

◆ comm_gather_gpuid()

void comm_gather_gpuid ( int gpuid_recv_buf)

Gather all GPU ids.

Parameters
[out]gpuid_recv_bufint array of length comm_size() that will be filled in GPU ids for all processes (in rank order).

Definition at line 60 of file comm_qmp.cpp.

References comm_rank(), comm_size(), gpuid, fused_exterior_ndeg_tm_dslash_cuda_gen::i, and MPI_Allgather().

Here is the call graph for this function:

◆ comm_gather_hostname()

void comm_gather_hostname ( char *  hostname_recv_buf)

Gather all hostnames.

Parameters
[out]hostname_recv_bufchar array of length 128*comm_size() that will be filled in GPU ids for all processes. Each hostname is in rank order, with 128 bytes for each.

Definition at line 34 of file comm_qmp.cpp.

References comm_hostname(), comm_rank(), comm_size(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, and MPI_Allgather().

Referenced by comm_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ comm_gpuid()

int comm_gpuid ( void  )

Definition at line 140 of file comm_qmp.cpp.

References gpuid.

◆ comm_init()

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

◆ comm_query()

int comm_query ( MsgHandle mh)

Definition at line 248 of file comm_qmp.cpp.

References MsgHandle_s::handle.

◆ comm_rank()

int comm_rank ( void  )

Definition at line 128 of file comm_qmp.cpp.

Referenced by comm_gather_gpuid(), comm_gather_hostname(), and comm_init().

Here is the caller graph for this function:

◆ comm_size()

int comm_size ( void  )

Definition at line 134 of file comm_qmp.cpp.

Referenced by comm_gather_gpuid(), comm_gather_hostname(), and comm_init().

Here is the caller graph for this function:

◆ comm_start()

void comm_start ( MsgHandle mh)

Definition at line 236 of file comm_qmp.cpp.

References MsgHandle_s::handle, and QMP_CHECK.

◆ comm_wait()

void comm_wait ( MsgHandle mh)

Definition at line 242 of file comm_qmp.cpp.

References MsgHandle_s::handle, and QMP_CHECK.

Variable Documentation

◆ gpuid

int gpuid = -1
static

Definition at line 17 of file comm_qmp.cpp.

Referenced by comm_gather_gpuid(), comm_gpuid(), and comm_init().

◆ partition_string

char partition_string[16]
static

Definition at line 19 of file comm_qmp.cpp.

Referenced by comm_dim_partitioned_string(), and comm_init().

◆ topology_string

char topology_string[16]
static

Definition at line 20 of file comm_qmp.cpp.

Referenced by comm_dim_topology_string(), and comm_init().