QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Functions | Variables
comm_common.cpp File Reference
#include <unistd.h>
#include <assert.h>
#include <quda_internal.h>
#include <comm_quda.h>
Include dependency graph for comm_common.cpp:

Go to the source code of this file.

Classes

struct  Topology_s
 

Functions

static int index (int ndim, const int *dims, const int *x)
 
static bool advance_coords (int ndim, const int *dims, int *x)
 
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_gpuid (void)
 
void comm_peer2peer_init (const char *hostname_recv_buf)
 
bool comm_peer2peer_present ()
 Returns true if any peer-to-peer capability is present on this system (regardless of whether it has been disabled or not. We use this, for example, to determine if we need to allocate pinned device memory or not. More...
 
bool comm_peer2peer_enabled (int dir, int dim)
 
int comm_peer2peer_enabled_global ()
 
void comm_enable_peer2peer (bool enable)
 Enable / disable peer-to-peer communication: used for dslash policies that do not presently support peer-to-peer communication. More...
 
bool comm_intranode_enabled (int dir, int dim)
 
void comm_enable_intranode (bool enable)
 Enable / disable intra-node (non-peer-to-peer) communication. More...
 
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)
 
static int mod (int a, int b)
 
int comm_rank_displaced (const Topology *topo, const int displacement[])
 
void comm_set_default_topology (Topology *topo)
 
Topologycomm_default_topology (void)
 
void comm_set_neighbor_ranks (Topology *topo)
 
int comm_neighbor_rank (int dir, int dim)
 
int comm_dim (int dim)
 
int comm_coord (int dim)
 
bool isHost (const void *buffer)
 
MsgHandlecomm_declare_send_relative_ (const char *func, const char *file, int line, void *buffer, int dim, int dir, size_t nbytes)
 
MsgHandlecomm_declare_receive_relative_ (const char *func, const char *file, int line, void *buffer, int dim, int dir, size_t nbytes)
 
MsgHandlecomm_declare_strided_send_relative_ (const char *func, const char *file, int line, void *buffer, int dim, int dir, size_t blksize, int nblocks, size_t stride)
 
MsgHandlecomm_declare_strided_receive_relative_ (const char *func, const char *file, int line, 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)
 
void comm_dim_partitioned_reset ()
 
int comm_dim_partitioned (int dim)
 
int comm_partitioned ()
 Loop over comm_dim_partitioned(dim) for all comms dimensions. More...
 
bool comm_gdr_enabled ()
 Query if GPU Direct RDMA communication is enabled (global setting) More...
 
bool comm_gdr_blacklist ()
 Query if GPU Direct RDMA communication is blacklisted for this GPU. More...
 
void comm_init_common (int ndim, const int *dims, QudaCommsMap rank_from_coords, void *map_data)
 Initialize the communications common to all communications abstractions. More...
 
const char * comm_config_string ()
 Return a string that defines the P2P/GDR environment variable configuration (for use as a tuneKey to enable unique policies). More...
 
const char * comm_dim_partitioned_string (const int *comm_dim_override)
 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...
 
bool comm_deterministic_reduce ()
 
void reduceMaxDouble (double &max)
 
void reduceDouble (double &sum)
 
void reduceDoubleArray (double *sum, const int len)
 
int commDim (int dir)
 
int commCoords (int dir)
 
int commDimPartitioned (int dir)
 
void commDimPartitionedSet (int dir)
 
void commDimPartitionedReset ()
 Reset the comm dim partioned array to zero,. More...
 
bool commGlobalReduction ()
 
void commGlobalReductionSet (bool global_reduction)
 
bool commAsyncReduction ()
 
void commAsyncReductionSet (bool async_reduction)
 

Variables

static unsigned long int rand_seed = 137
 
static int gpuid = -1
 
static bool peer2peer_enabled [2][4]
 
static bool peer2peer_init = false
 
static bool intranode_enabled [2][4]
 
static bool peer2peer_present = false
 
static int enable_peer_to_peer = 3
 
static bool enable_p2p = true
 
static bool enable_intranode = true
 
Topologydefault_topo = NULL
 
static int neighbor_rank [2][4]
 
static bool neighbors_cached = false
 
static char partition_string [16]
 
static char topology_string [128]
 
static char partition_override_string [16]
 
static int manual_set_partition [QUDA_MAX_DIM] = {0}
 
static bool deterministic_reduce = false
 
static bool globalReduce = true
 
static bool asyncReduce = false
 

Function Documentation

◆ advance_coords()

static bool advance_coords ( int  ndim,
const int *  dims,
int *  x 
)
inlinestatic

Definition at line 42 of file comm_common.cpp.

Referenced by comm_create_topology().

Here is the caller graph for this function:

◆ comm_config_string()

const char* comm_config_string ( )

Return a string that defines the P2P/GDR environment variable configuration (for use as a tuneKey to enable unique policies).

Returns
String specifying comm config

Definition at line 766 of file comm_common.cpp.

References comm_gdr_enabled(), and comm_peer2peer_enabled_global().

Referenced by quda::DslashCoarsePolicyTune::DslashCoarsePolicyTune(), and quda::dslash::DslashPolicyTune< Dslash >::tuneKey().

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

◆ comm_coord()

int comm_coord ( int  dim)

Return the coording of this process in the dimension dim

Parameters
dimDimension which we are querying
Returns
Coordinate of this process

Definition at line 431 of file comm_common.cpp.

References comm_coords(), and comm_default_topology().

Referenced by commCoords(), DslashCuda::DslashCuda(), and quda::rngArg::rngArg().

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

◆ comm_coords()

const int* comm_coords ( const Topology topo)

Definition at line 334 of file comm_common.cpp.

References Topology_s::my_coords.

Referenced by comm_coord(), and comm_rank_displaced().

Here is the caller graph for this function:

◆ comm_coords_from_rank()

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

Definition at line 340 of file comm_common.cpp.

References Topology_s::coords, and rank.

◆ comm_create_topology()

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

Definition at line 94 of file comm_common.cpp.

References advance_coords(), comm_rank(), Topology_s::coords, Topology_s::dims, errorQuda, index(), Topology_s::my_coords, Topology_s::my_rank, Topology_s::ndim, QUDA_MAX_DIM, rand_seed, rank, Topology_s::ranks, and safe_malloc.

Referenced by comm_init_common().

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

◆ comm_declare_receive_relative_()

MsgHandle* comm_declare_receive_relative_ ( const char *  func,
const char *  file,
int  line,
void *  buffer,
int  dim,
int  dir,
size_t  nbytes 
)

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

Definition at line 499 of file comm_common.cpp.

References checkCudaError, comm_declare_receive_displaced(), errorQuda, isHost(), printfQuda, and QUDA_MAX_DIM.

Here is the call graph for this function:

◆ comm_declare_send_relative_()

MsgHandle* comm_declare_send_relative_ ( const char *  func,
const char *  file,
int  line,
void *  buffer,
int  dim,
int  dir,
size_t  nbytes 
)

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

Definition at line 462 of file comm_common.cpp.

References checkCudaError, comm_declare_send_displaced(), quda::blas::copy(), device_free, device_malloc, errorQuda, host_free, isHost(), printfQuda, QUDA_MAX_DIM, safe_malloc, and tmp.

Here is the call graph for this function:

◆ comm_declare_strided_receive_relative_()

MsgHandle* comm_declare_strided_receive_relative_ ( const char *  func,
const char *  file,
int  line,
void *  buffer,
int  dim,
int  dir,
size_t  blksize,
int  nblocks,
size_t  stride 
)

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

Definition at line 573 of file comm_common.cpp.

References checkCudaError, comm_declare_strided_receive_displaced(), errorQuda, isHost(), printfQuda, and QUDA_MAX_DIM.

Here is the call graph for this function:

◆ comm_declare_strided_send_relative_()

MsgHandle* comm_declare_strided_send_relative_ ( const char *  func,
const char *  file,
int  line,
void *  buffer,
int  dim,
int  dir,
size_t  blksize,
int  nblocks,
size_t  stride 
)

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

Definition at line 532 of file comm_common.cpp.

References checkCudaError, comm_declare_strided_send_displaced(), quda::blas::copy(), device_free, device_malloc, errorQuda, host_free, isHost(), printfQuda, QUDA_MAX_DIM, safe_malloc, and tmp.

Here is the call graph for this function:

◆ comm_default_topology()

Topology* comm_default_topology ( void  )

◆ comm_destroy_topology()

void comm_destroy_topology ( Topology topo)

Definition at line 137 of file comm_common.cpp.

References Topology_s::coords, host_free, and Topology_s::ranks.

Referenced by comm_finalize().

Here is the caller graph for this function:

◆ comm_deterministic_reduce()

bool comm_deterministic_reduce ( )
Returns
Whether are doing determinisitic multi-process reductions or not

Definition at line 799 of file comm_common.cpp.

References deterministic_reduce.

Referenced by comm_allreduce(), and comm_allreduce_array().

Here is the caller graph for this function:

◆ comm_dim()

int comm_dim ( int  dim)

Return the number of processes in the dimension dim

Parameters
dimDimension which we are querying
Returns
Length of process dimensions

Definition at line 424 of file comm_common.cpp.

References comm_default_topology(), and comm_dims().

Referenced by comm_dim_partitioned(), comm_init_common(), comm_peer2peer_init(), commDim(), quda::LatticeField::createIPCComms(), quda::LatticeField::destroyIPCComms(), quda::GaugeLaplace::Dslash(), quda::GaugeCovDev::DslashCD(), DslashCuda::DslashCuda(), quda::GaugeLaplace::DslashXpay(), packGhostAllLinks(), packGhostAllStaples(), quda::rngArg::rngArg(), and set_layout().

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

◆ comm_dim_partitioned()

int comm_dim_partitioned ( int  dim)

Definition at line 635 of file comm_common.cpp.

References comm_dim(), and manual_set_partition.

Referenced by quda::ApplyImprovedStaggered(), quda::GenericPackGhostLauncher< Float, block_float, Ns, Ms, Nc, Mc, Arg >::bytes(), quda::CalculateYArg< Float, fineSpin, coarseSpin, fineColor, coarseColor, coarseGauge, coarseGaugeAtomic, fineGauge, fineSpinor, fineSpinorTmp, fineSpinorV, fineClover >::CalculateYArg(), GaugeAlgTest::checkDimsPartitioned(), comm_dim_partitioned_reset(), comm_dim_partitioned_set(), comm_dim_partitioned_string(), comm_init_common(), comm_partitioned(), commDimPartitioned(), quda::cudaGaugeField::commsComplete(), computeHISQForceQuda(), quda::GaugeField::createGhostZone(), quda::ColorSpinorField::createGhostZone(), quda::GaugeLaplace::Dslash(), quda::DslashArg< Float >::DslashArg(), quda::GaugeCovDev::DslashCD(), quda::DslashCoarseArg< Float, yFloat, ghostFloat, coarseSpin, coarseColor, csOrder, gOrder >::DslashCoarseArg(), DslashCuda::DslashCuda(), quda::GaugeLaplace::DslashXpay(), quda::GaugeField::exchange(), quda::ColorSpinorField::exchange(), quda::cudaGaugeField::exchangeExtendedGhost(), quda::cpuGaugeField::exchangeExtendedGhost(), quda::cudaGaugeField::exchangeGhost(), quda::cudaColorSpinorField::exchangeGhost(), quda::ExtractGhostArg< Float, nColor_, Order, nDim >::ExtractGhostArg(), quda::gaugefixingFFT(), gaugeLink_mgpu(), quda::GenericPackGhostLauncher< Float, block_float, Ns, Ms, Nc, Mc, Arg >::GenericPackGhostLauncher(), hisq_force_init(), hisq_force_test(), quda::cudaGaugeField::injectGhost(), main(), neighborIndex_mg(), quda::PackGhostArg< Field >::PackGhostArg(), quda::PGaugeExchange(), quda::cudaGaugeField::recvStart(), quda::colorspinor::FloatNOrder< Float, Ns, Nc, N, spin_project, huge_alloc >::resetGhost(), quda::cudaGaugeField::sendStart(), GaugeAlgTest::SetUp(), spinorNeighbor_5d(), quda::WuppertalSmearingArg< Float, Ns, Nc, gRecon >::WuppertalSmearingArg(), and quda::XSD::XSD().

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

◆ comm_dim_partitioned_reset()

void comm_dim_partitioned_reset ( )

Definition at line 628 of file comm_common.cpp.

References comm_dim_partitioned(), manual_set_partition, partition_string, and QUDA_MAX_DIM.

Referenced by commDimPartitionedReset().

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

◆ comm_dim_partitioned_set()

void comm_dim_partitioned_set ( int  dim)

Definition at line 618 of file comm_common.cpp.

References comm_dim_partitioned(), manual_set_partition, and partition_string.

Referenced by commDimPartitionedSet().

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

◆ comm_dim_partitioned_string()

const char* comm_dim_partitioned_string ( const int *  comm_dim_override = 0)

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

Parameters
comm_dim_overrideOptional override for partitioning
Returns
String specifying comm partitioning

Definition at line 782 of file comm_common.cpp.

References comm_dim_partitioned(), partition_override_string, and partition_string.

Referenced by quda::CalculateY< from_coarse, Float, fineSpin, fineColor, coarseSpin, coarseColor, Arg >::CalculateY(), quda::DslashCoarsePolicyTune::DslashCoarsePolicyTune(), quda::Dslash< Float >::fillAux(), quda::GenericPackGhostLauncher< Float, block_float, Ns, Ms, Nc, Mc, Arg >::GenericPackGhostLauncher(), and quda::WuppertalSmearing< Float, Ns, Nc, Arg >::WuppertalSmearing().

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

◆ 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 797 of file comm_common.cpp.

References topology_string.

Referenced by quda::DslashCoarsePolicyTune::DslashCoarsePolicyTune(), quda::Pack< Float, nColor, spin_project >::fillAux(), quda::GenericPackGhostLauncher< Float, block_float, Ns, Ms, Nc, Mc, Arg >::GenericPackGhostLauncher(), and quda::dslash::DslashPolicyTune< Dslash >::tuneKey().

Here is the caller graph for this function:

◆ comm_dims()

const int* comm_dims ( const Topology topo)

Definition at line 328 of file comm_common.cpp.

References Topology_s::dims.

Referenced by comm_dim(), and comm_rank_displaced().

Here is the caller graph for this function:

◆ comm_drand()

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 82 of file comm_common.cpp.

References rand_seed.

Referenced by insertNoise(), and quda::random().

Here is the caller graph for this function:

◆ comm_enable_intranode()

void comm_enable_intranode ( bool  enable)

Enable / disable intra-node (non-peer-to-peer) communication.

Parameters
[in]enableBoolean flag to enable / disable intra-node (non peer-to-peer) communication

Definition at line 318 of file comm_common.cpp.

References enable_intranode.

◆ comm_enable_peer2peer()

void comm_enable_peer2peer ( bool  enable)

Enable / disable peer-to-peer communication: used for dslash policies that do not presently support peer-to-peer communication.

Parameters
[in]enableBoolean flag to enable / disable peer-to-peer communication

Definition at line 308 of file comm_common.cpp.

References enable_p2p.

Referenced by quda::dslash::DslashPolicyTune< Dslash >::apply(), quda::dslash::DslashPolicyTune< Dslash >::DslashPolicyTune(), and quda::DslashCoarseLaunch::operator()().

Here is the caller graph for this function:

◆ comm_finalize()

void comm_finalize ( void  )

Definition at line 606 of file comm_common.cpp.

References comm_default_topology(), comm_destroy_topology(), and comm_set_default_topology().

Referenced by endQuda().

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

◆ comm_gdr_blacklist()

bool comm_gdr_blacklist ( )

Query if GPU Direct RDMA communication is blacklisted for this GPU.

Definition at line 665 of file comm_common.cpp.

References comm_barrier(), comm_gpuid(), comm_rank(), errorQuda, getVerbosity(), and QUDA_SILENT.

Referenced by comm_peer2peer_init(), and quda::dslash::DslashFactory< Dslash >::create().

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

◆ comm_gdr_enabled()

bool comm_gdr_enabled ( )

◆ comm_gpuid()

int comm_gpuid ( void  )
Returns
GPU id associated with this process

Definition at line 146 of file comm_common.cpp.

References gpuid.

Referenced by comm_gather_gpuid(), comm_gdr_blacklist(), comm_peer2peer_init(), quda::dslash::DslashPolicyTune< Dslash >::DslashPolicyTune(), and initQudaDevice().

Here is the caller graph for this function:

◆ comm_hostname()

char* comm_hostname ( void  )

Definition at line 58 of file comm_common.cpp.

Referenced by comm_gather_hostname(), comm_init_common(), and comm_peer2peer_init().

Here is the caller graph for this function:

◆ comm_init_common()

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

Initialize the communications common to all communications abstractions.

Definition at line 700 of file comm_common.cpp.

References comm_broadcast(), comm_create_topology(), comm_dim(), comm_dim_partitioned(), comm_gather_hostname(), comm_hostname(), comm_peer2peer_init(), comm_rank(), comm_set_default_topology(), comm_size(), deterministic_reduce, device, errorQuda, gpuid, host_free, partition_string, safe_malloc, and topology_string.

Referenced by comm_init().

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

◆ comm_intranode_enabled()

bool comm_intranode_enabled ( int  dir,
int  dim 
)

Query if intra-node (non-peer-to-peer) communication is enabled in a given dimension and direction

Parameters
dirDirection (0 - backwards, 1 forwards)
dimDimension (0-3)
Returns
Whether intra-node communication is enabled

Definition at line 314 of file comm_common.cpp.

References enable_intranode, and intranode_enabled.

◆ comm_ndim()

int comm_ndim ( const Topology topo)

◆ comm_neighbor_rank()

int comm_neighbor_rank ( int  dir,
int  dim 
)

Definition at line 416 of file comm_common.cpp.

References comm_set_neighbor_ranks(), neighbor_rank, and neighbors_cached.

Referenced by comm_peer2peer_init().

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

◆ comm_partitioned()

int comm_partitioned ( )

Loop over comm_dim_partitioned(dim) for all comms dimensions.

Returns
Whether any communications dimensions are partitioned

Definition at line 640 of file comm_common.cpp.

References comm_dim_partitioned().

Referenced by quda::DslashCoarseLaunch::operator()().

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

◆ comm_peer2peer_enabled()

bool comm_peer2peer_enabled ( int  dir,
int  dim 
)

Query if peer-to-peer communication is enabled

Parameters
dirDirection (0 - backwards, 1 forwards)
dimDimension (0-3)
Returns
Whether peer-to-peer is enabled

Definition at line 285 of file comm_common.cpp.

References enable_p2p, and peer2peer_enabled.

Referenced by comm_peer2peer_enabled_global(), quda::dslash::commsComplete(), quda::cudaGaugeField::commsComplete(), quda::cudaColorSpinorField::commsQuery(), quda::cudaColorSpinorField::commsWait(), quda::dslash::completeDslash(), quda::LatticeField::createIPCComms(), quda::LatticeField::destroyIPCComms(), quda::cudaGaugeField::exchangeExtendedGhost(), quda::cudaGaugeField::exchangeGhost(), quda::cudaColorSpinorField::exchangeGhost(), quda::cudaColorSpinorField::gather(), quda::dslash::getStreamIndex(), quda::cudaGaugeField::injectGhost(), quda::dslash::issueGather(), quda::dslash::issuePack(), quda::dslash::DslashBasic< Dslash >::operator()(), quda::dslash::DslashFusedExterior< Dslash >::operator()(), quda::dslash::DslashGDR< Dslash >::operator()(), quda::dslash::DslashFusedGDR< Dslash >::operator()(), quda::dslash::DslashGDRRecv< Dslash >::operator()(), quda::dslash::DslashFusedGDRRecv< Dslash >::operator()(), quda::dslash::DslashZeroCopyPack< Dslash >::operator()(), quda::dslash::DslashFusedZeroCopyPack< Dslash >::operator()(), quda::dslash::DslashZeroCopyPackGDRRecv< Dslash >::operator()(), quda::dslash::DslashFusedZeroCopyPackGDRRecv< Dslash >::operator()(), quda::dslash::DslashZeroCopy< Dslash >::operator()(), quda::dslash::DslashFusedZeroCopy< Dslash >::operator()(), quda::cudaGaugeField::recvStart(), quda::cudaColorSpinorField::recvStart(), quda::cudaColorSpinorField::scatter(), quda::cudaGaugeField::sendStart(), quda::cudaColorSpinorField::sendStart(), quda::Dslash< Float >::setParam(), and DslashCuda::setParam().

Here is the caller graph for this function:

◆ comm_peer2peer_enabled_global()

int comm_peer2peer_enabled_global ( )

Query what peer-to-peer communication is enabled globally

Returns
2-bit number reporting 1 for copy engine, 2 for remote writes

Definition at line 289 of file comm_common.cpp.

References comm_allreduce_int(), comm_peer2peer_enabled(), enable_p2p, enable_peer_to_peer, and quda::cublas::init().

Referenced by quda::dslash::DslashPolicyTune< Dslash >::apply(), comm_config_string(), comm_peer2peer_init(), quda::dslash::DslashPolicyTune< Dslash >::DslashPolicyTune(), quda::cudaColorSpinorField::exchangeGhost(), quda::Pack< Float, nColor, spin_project >::fillAux(), and quda::dslash::setMappedGhost().

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

◆ comm_peer2peer_init()

void comm_peer2peer_init ( const char *  hostname_recv_buf)

Enabled peer-to-peer communication.

Parameters
hostname_bufArray that holds all process hostnames

Definition at line 163 of file comm_common.cpp.

References quda::abs(), checkCudaErrorNoSync, comm_barrier(), comm_dim(), comm_gather_gpuid(), comm_gdr_blacklist(), comm_gdr_enabled(), comm_gpuid(), comm_hostname(), comm_neighbor_rank(), comm_peer2peer_enabled_global(), comm_rank(), comm_set_neighbor_ranks(), comm_size(), enable_peer_to_peer, errorQuda, getVerbosity(), gpuid, host_free, intranode_enabled, neighbor_rank, peer2peer_enabled, peer2peer_init, peer2peer_present, printfQuda, QUDA_SILENT, and safe_malloc.

Referenced by comm_init_common().

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

◆ comm_peer2peer_present()

bool comm_peer2peer_present ( )

Returns true if any peer-to-peer capability is present on this system (regardless of whether it has been disabled or not. We use this, for example, to determine if we need to allocate pinned device memory or not.

Definition at line 281 of file comm_common.cpp.

References peer2peer_present.

Referenced by quda::device_pinned_free_(), and quda::device_pinned_malloc_().

Here is the caller graph for this function:

◆ comm_rank_displaced()

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

◆ comm_rank_from_coords()

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

Definition at line 346 of file comm_common.cpp.

References Topology_s::dims, index(), Topology_s::ndim, and Topology_s::ranks.

Referenced by comm_rank_displaced().

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

◆ comm_set_default_topology()

void comm_set_default_topology ( Topology topo)

Definition at line 375 of file comm_common.cpp.

Referenced by comm_finalize(), and comm_init_common().

Here is the caller graph for this function:

◆ comm_set_neighbor_ranks()

void comm_set_neighbor_ranks ( Topology topo)

Definition at line 394 of file comm_common.cpp.

References comm_rank_displaced(), default_topo, errorQuda, neighbor_rank, neighbors_cached, and QUDA_MAX_DIM.

Referenced by comm_neighbor_rank(), and comm_peer2peer_init().

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

◆ commAsyncReduction()

bool commAsyncReduction ( )

◆ commAsyncReductionSet()

void commAsyncReductionSet ( bool  async_reduction)

Definition at line 827 of file comm_common.cpp.

References asyncReduce.

Referenced by quda::MR::operator()().

Here is the caller graph for this function:

◆ commCoords()

int commCoords ( int  dir)

Definition at line 813 of file comm_common.cpp.

References comm_coord().

Referenced by last_node_in_t(), and quda::Solver::Solver().

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

◆ commDim()

int commDim ( int  dir)

Definition at line 811 of file comm_common.cpp.

References comm_dim().

Here is the call graph for this function:

◆ commDimPartitioned()

int commDimPartitioned ( int  dir)

◆ commDimPartitionedReset()

void commDimPartitionedReset ( )

Reset the comm dim partioned array to zero,.

This should only be needed for automated testing when different partitioning is applied within a single run.

Definition at line 819 of file comm_common.cpp.

References comm_dim_partitioned_reset().

Referenced by end().

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

◆ commDimPartitionedSet()

void commDimPartitionedSet ( int  dir)

Definition at line 817 of file comm_common.cpp.

References comm_dim_partitioned_set().

Referenced by process_command_line_option(), StaggeredDslashTest::SetUp(), and DslashTest::SetUp().

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

◆ commGlobalReduction()

bool commGlobalReduction ( )

Definition at line 821 of file comm_common.cpp.

References globalReduce.

Referenced by quda::tuneLaunch().

Here is the caller graph for this function:

◆ commGlobalReductionSet()

void commGlobalReductionSet ( bool  global_reduction)

Definition at line 823 of file comm_common.cpp.

References globalReduce.

Referenced by quda::IncEigCG::eigCGsolve(), quda::PreconCG::operator()(), quda::MR::operator()(), and quda::SD::operator()().

Here is the caller graph for this function:

◆ index()

static int index ( int  ndim,
const int *  dims,
const int *  x 
)
inlinestatic

◆ isHost()

bool isHost ( const void *  buffer)
inline

Definition at line 437 of file comm_common.cpp.

References errorQuda.

Referenced by comm_declare_receive_relative_(), comm_declare_send_relative_(), comm_declare_strided_receive_relative_(), and comm_declare_strided_send_relative_().

Here is the caller graph for this function:

◆ mod()

static int mod ( int  a,
int  b 
)
inlinestatic

Definition at line 352 of file comm_common.cpp.

Referenced by comm_rank_displaced(), and quda::polarSu3().

Here is the caller graph for this function:

◆ reduceDouble()

void reduceDouble ( double &  sum)

Definition at line 806 of file comm_common.cpp.

References comm_allreduce(), and globalReduce.

Referenced by quda::SolverParam::updateInvertParam().

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

◆ reduceDoubleArray()

void reduceDoubleArray ( double *  sum,
const int  len 
)

Definition at line 808 of file comm_common.cpp.

References comm_allreduce_array(), and globalReduce.

Referenced by quda::blas::cDotProduct(), quda::blas::cDotProductCopy(), quda::blas::hDotProduct(), quda::blas::hDotProduct_Anorm(), quda::blas::mixed_reduce(), quda::blas::reDotProduct(), and quda::blas::uni_reduce().

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

◆ reduceMaxDouble()

void reduceMaxDouble ( double &  max)

Definition at line 804 of file comm_common.cpp.

References comm_allreduce_max().

Here is the call graph for this function:

Variable Documentation

◆ asyncReduce

bool asyncReduce = false
static

Definition at line 802 of file comm_common.cpp.

Referenced by commAsyncReduction(), and commAsyncReductionSet().

◆ default_topo

Topology* default_topo = NULL

Definition at line 373 of file comm_common.cpp.

Referenced by comm_default_topology(), and comm_set_neighbor_ranks().

◆ deterministic_reduce

bool deterministic_reduce = false
static

Definition at line 698 of file comm_common.cpp.

Referenced by comm_deterministic_reduce(), and comm_init_common().

◆ enable_intranode

bool enable_intranode = true
static

Definition at line 312 of file comm_common.cpp.

Referenced by comm_enable_intranode(), and comm_intranode_enabled().

◆ enable_p2p

bool enable_p2p = true
static

◆ enable_peer_to_peer

int enable_peer_to_peer = 3
static

by default enable both copy engines and load/store access

Definition at line 160 of file comm_common.cpp.

Referenced by comm_peer2peer_enabled_global(), and comm_peer2peer_init().

◆ globalReduce

bool globalReduce = true
static

◆ gpuid

int gpuid = -1
static

◆ intranode_enabled

bool intranode_enabled[2][4]
static
Initial value:
= { {false,false,false,false},
{false,false,false,false} }

Definition at line 152 of file comm_common.cpp.

Referenced by comm_intranode_enabled(), and comm_peer2peer_init().

◆ manual_set_partition

int manual_set_partition[QUDA_MAX_DIM] = {0}
static

string that contains any overridden partitioning

Definition at line 616 of file comm_common.cpp.

Referenced by comm_dim_partitioned(), comm_dim_partitioned_reset(), and comm_dim_partitioned_set().

◆ neighbor_rank

int neighbor_rank[2][4]
static
Initial value:
= { {-1,-1,-1,-1},
{-1,-1,-1,-1} }

Definition at line 389 of file comm_common.cpp.

Referenced by comm_neighbor_rank(), comm_peer2peer_init(), and comm_set_neighbor_ranks().

◆ neighbors_cached

bool neighbors_cached = false
static

Definition at line 392 of file comm_common.cpp.

Referenced by comm_neighbor_rank(), and comm_set_neighbor_ranks().

◆ partition_override_string

char partition_override_string[16]
static

string that contains the job topology

Definition at line 615 of file comm_common.cpp.

Referenced by comm_dim_partitioned_string().

◆ partition_string

char partition_string[16]
static

◆ peer2peer_enabled

bool peer2peer_enabled[2][4]
static
Initial value:
= { {false,false,false,false},
{false,false,false,false} }

Definition at line 148 of file comm_common.cpp.

Referenced by comm_peer2peer_enabled(), and comm_peer2peer_init().

◆ peer2peer_init

bool peer2peer_init = false
static

Definition at line 150 of file comm_common.cpp.

Referenced by comm_peer2peer_init().

◆ peer2peer_present

bool peer2peer_present = false
static

this records whether there is any peer-2-peer capability (regardless whether it is enabled or not)

Definition at line 157 of file comm_common.cpp.

Referenced by comm_peer2peer_init(), and comm_peer2peer_present().

◆ rand_seed

unsigned long int rand_seed = 137
static

Definition at line 73 of file comm_common.cpp.

Referenced by comm_create_topology(), and comm_drand().

◆ topology_string

char topology_string[128]
static

string that contains the job partitioning

Definition at line 614 of file comm_common.cpp.

Referenced by comm_dim_topology_string(), and comm_init_common().