Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
comm Namespace Reference

Classes

struct  Received
 What an exchange() received: the part from rank r is data[offsets[r], offsets[r + 1]). More...
 
class  Session
 Initializes MPI on construction (unless it already is) and finalizes it on destruction if this session initialized it. Create one in main() before Kokkos is initialized, so Kokkos can map ranks to devices. More...
 

Enumerations

enum class  Op { SUM , MIN , MAX }
 

Functions

int rank ()
 Rank of this process in the world communicator.
 
int size ()
 Number of processes in the world communicator.
 
void barrier ()
 Block until all ranks arrive.
 
void abort (int code)
 Ends every rank with the given exit code (MPI_Abort in parallel runs).
 
template<typename T >
void allreduce (std::span< T > data, Op op)
 In-place all-reduce over all ranks of the values in data.
 
template<typename T >
std::vector< T > allgatherv (const std::vector< T > &local)
 Concatenation of every rank's local vector, in rank order.
 
template<typename T >
std::vector< std::vector< T > > alltoallv (const std::vector< std::vector< T > > &send)
 Personalized all-to-all: send[r] goes to rank r; returns what each rank sent to this one, indexed by source rank.
 
template<typename T >
Received< T > exchange (std::vector< std::vector< T > > &&send)
 Personalized all-to-all like alltoallv, for large setup-time messages: frees each send list once packed, and returns what it received in one buffer, in rank order.
 
template void allreduce< double > (std::span< double >, Op)
 
template void allreduce< float > (std::span< float >, Op)
 
template void allreduce< int32_t > (std::span< int32_t >, Op)
 
template void allreduce< int64_t > (std::span< int64_t >, Op)
 
template void allreduce< uint32_t > (std::span< uint32_t >, Op)
 
template void allreduce< uint64_t > (std::span< uint64_t >, Op)
 
template std::vector< std::vector< uint64_t > > alltoallv (const std::vector< std::vector< uint64_t > > &)
 
template std::vector< int32_t > allgatherv (const std::vector< int32_t > &)
 
template std::vector< uint64_t > allgatherv (const std::vector< uint64_t > &)
 
template std::vector< double > allgatherv (const std::vector< double > &)
 
template std::vector< float > allgatherv (const std::vector< float > &)
 
template std::vector< std::vector< double > > alltoallv (const std::vector< std::vector< double > > &)
 
template std::vector< std::vector< float > > alltoallv (const std::vector< std::vector< float > > &)
 
template Received< uint64_t > exchange (std::vector< std::vector< uint64_t > > &&)
 
template Received< double > exchange (std::vector< std::vector< double > > &&)
 
template Received< float > exchange (std::vector< std::vector< float > > &&)
 
bool is_root ()
 Whether this is rank 0, which does all logging.
 
template<typename T >
T allreduce (T value, Op op)
 
template<typename T , std::size_t N>
std::array< T, N > allreduce (std::array< T, N > values, Op op)
 
void enqueue_wait (const Kokkos::DefaultExecutionSpace &waiter, const Kokkos::DefaultExecutionSpace &done)
 Make the work enqueued later on waiter wait for the work enqueued so far on done, without blocking the host where the backend allows it (CUDA); a fence of done otherwise.
 
constexpr bool nccl_available ()
 Whether this build can exchange device buffers with NCCL.
 

Enumeration Type Documentation

◆ Op

Enumerator
SUM 
MIN 
MAX 

Function Documentation

◆ abort()

void comm::abort ( int  code)

Ends every rank with the given exit code (MPI_Abort in parallel runs).

◆ allgatherv() [1/5]

template std::vector< double > comm::allgatherv ( const std::vector< double > &  )

◆ allgatherv() [2/5]

template std::vector< float > comm::allgatherv ( const std::vector< float > &  )

◆ allgatherv() [3/5]

template std::vector< int32_t > comm::allgatherv ( const std::vector< int32_t > &  )

◆ allgatherv() [4/5]

template<typename T >
std::vector< T > comm::allgatherv ( const std::vector< T > &  local)

Concatenation of every rank's local vector, in rank order.

◆ allgatherv() [5/5]

template std::vector< uint64_t > comm::allgatherv ( const std::vector< uint64_t > &  )

◆ allreduce() [1/3]

template<typename T , std::size_t N>
std::array< T, N > comm::allreduce ( std::array< T, N >  values,
Op  op 
)

◆ allreduce() [2/3]

template<typename T >
void comm::allreduce ( std::span< T >  ,
Op   
)

In-place all-reduce over all ranks of the values in data.

◆ allreduce() [3/3]

template<typename T >
T comm::allreduce ( T  value,
Op  op 
)

◆ allreduce< double >()

template void comm::allreduce< double > ( std::span< double >  ,
Op   
)

◆ allreduce< float >()

template void comm::allreduce< float > ( std::span< float >  ,
Op   
)

◆ allreduce< int32_t >()

template void comm::allreduce< int32_t > ( std::span< int32_t >  ,
Op   
)

◆ allreduce< int64_t >()

template void comm::allreduce< int64_t > ( std::span< int64_t >  ,
Op   
)

◆ allreduce< uint32_t >()

template void comm::allreduce< uint32_t > ( std::span< uint32_t >  ,
Op   
)

◆ allreduce< uint64_t >()

template void comm::allreduce< uint64_t > ( std::span< uint64_t >  ,
Op   
)

◆ alltoallv() [1/4]

template std::vector< std::vector< double > > comm::alltoallv ( const std::vector< std::vector< double > > &  )

◆ alltoallv() [2/4]

template std::vector< std::vector< float > > comm::alltoallv ( const std::vector< std::vector< float > > &  )

◆ alltoallv() [3/4]

template<typename T >
std::vector< std::vector< T > > comm::alltoallv ( const std::vector< std::vector< T > > &  send)

Personalized all-to-all: send[r] goes to rank r; returns what each rank sent to this one, indexed by source rank.

◆ alltoallv() [4/4]

template std::vector< std::vector< uint64_t > > comm::alltoallv ( const std::vector< std::vector< uint64_t > > &  )

◆ barrier()

void comm::barrier ( )

Block until all ranks arrive.

◆ enqueue_wait()

void comm::enqueue_wait ( const Kokkos::DefaultExecutionSpace &  waiter,
const Kokkos::DefaultExecutionSpace &  done 
)

Make the work enqueued later on waiter wait for the work enqueued so far on done, without blocking the host where the backend allows it (CUDA); a fence of done otherwise.

◆ exchange() [1/4]

template Received< double > comm::exchange ( std::vector< std::vector< double > > &&  )

◆ exchange() [2/4]

template Received< float > comm::exchange ( std::vector< std::vector< float > > &&  )

◆ exchange() [3/4]

template<typename T >
Received< T > comm::exchange ( std::vector< std::vector< T > > &&  send)

Personalized all-to-all like alltoallv, for large setup-time messages: frees each send list once packed, and returns what it received in one buffer, in rank order.

◆ exchange() [4/4]

template Received< uint64_t > comm::exchange ( std::vector< std::vector< uint64_t > > &&  )

◆ is_root()

bool comm::is_root ( )
inline

Whether this is rank 0, which does all logging.

◆ nccl_available()

constexpr bool comm::nccl_available ( )
constexpr

Whether this build can exchange device buffers with NCCL.

◆ rank()

int comm::rank ( )

Rank of this process in the world communicator.

◆ size()

int comm::size ( )

Number of processes in the world communicator.