Block-Structured AMR Software Framework
amrex::ParallelDescriptor Namespace Reference

Parallel frontend that abstracts functionalities needed to spawn processes and handle communication. More...

Namespaces

 detail
 

Classes

struct  Mpi_typemap
 Communication datatype (note: this structure also works without MPI) More...
 
class  Message
 Hold the description and status of communication data. More...
 
struct  ProcessTeam
 Provide functionalities needed to construct a team of processes to perform a particular job. More...
 
struct  Mpi_typemap< GpuComplex< T > >
 
struct  Mpi_typemap< ValLocPair< TV, TI > >
 

Functions

void StartParallel (int *argc=nullptr, char ***argv=nullptr, MPI_Comm mpi_comm=MPI_COMM_WORLD)
 Perform any needed parallel initialization. This MUST be the first routine in this class called from within a program. More...
 
void Gather (Real const *sendbuf, int nsend, Real *recvbuf, int root)
 Parallel gather. More...
 
void EndParallel ()
 Perform any needed parallel finalization. This MUST be the last routine in this class called from within a program. More...
 
void Abort (int errorcode=SIGABRT, bool backtrace=true)
 Abort with specified error code. More...
 
const char * ErrorString (int errorcode)
 ErrorString return string associated with error internal error condition. More...
 
void Barrier (const std::string &)
 
void Barrier (const MPI_Comm &, const std::string &)
 
Message Abarrier ()
 
Message Abarrier (const MPI_Comm &)
 
void Test (MPI_Request &, int &, MPI_Status &)
 
void Test (Vector< MPI_Request > &, int &, Vector< MPI_Status > &)
 
void IProbe (int, int, int &, MPI_Status &)
 
void IProbe (int, int, MPI_Comm, int &, MPI_Status &)
 
void Comm_dup (MPI_Comm, MPI_Comm &)
 
void ReduceRealSum (Vector< std::reference_wrapper< Real > > const &)
 
void ReduceRealMax (Vector< std::reference_wrapper< Real > > const &)
 
void ReduceRealMin (Vector< std::reference_wrapper< Real > > const &)
 
void ReduceRealSum (Vector< std::reference_wrapper< Real > > const &, int)
 
void ReduceRealMax (Vector< std::reference_wrapper< Real > > const &, int)
 
void ReduceRealMin (Vector< std::reference_wrapper< Real > > const &, int)
 
void ReduceLongAnd (Long &rvar)
 Long and-wise reduction. More...
 
void ReduceLongSum (Long &rvar)
 Long sum reduction. More...
 
void ReduceLongMax (Long &rvar)
 Long max reduction. More...
 
void ReduceLongMin (Long &rvar)
 Long min reduction. More...
 
void ReduceLongAnd (Long &rvar, int cpu)
 Long and-wise reduction to specified cpu. More...
 
void ReduceLongSum (Long &rvar, int cpu)
 Long sum reduction to specified cpu. More...
 
void ReduceLongMax (Long &rvar, int cpu)
 Long max reduction to specified cpu. More...
 
void ReduceLongMin (Long &rvar, int cpu)
 Long min reduction to specified cpu. More...
 
void ReduceLongAnd (Long *, int)
 
void ReduceLongSum (Long *, int)
 
void ReduceLongMax (Long *, int)
 
void ReduceLongMin (Long *, int)
 
void ReduceLongAnd (Long *, int, int)
 
void ReduceLongSum (Long *, int, int)
 
void ReduceLongMax (Long *, int, int)
 
void ReduceLongMin (Long *, int, int)
 
void ReduceLongAnd (Vector< std::reference_wrapper< Long > > const &)
 
void ReduceLongSum (Vector< std::reference_wrapper< Long > > const &)
 
void ReduceLongMax (Vector< std::reference_wrapper< Long > > const &)
 
void ReduceLongMin (Vector< std::reference_wrapper< Long > > const &)
 
void ReduceLongAnd (Vector< std::reference_wrapper< Long > > const &, int)
 
void ReduceLongSum (Vector< std::reference_wrapper< Long > > const &, int)
 
void ReduceLongMax (Vector< std::reference_wrapper< Long > > const &, int)
 
void ReduceLongMin (Vector< std::reference_wrapper< Long > > const &, int)
 
void ReduceIntSum (int &rvar)
 Integer sum reduction. More...
 
void ReduceIntMax (int &rvar)
 Integer max reduction. More...
 
void ReduceIntMin (int &rvar)
 Integer min reduction. More...
 
void ReduceIntSum (int &rvar, int cpu)
 Integer sum reduction to specified cpu. More...
 
void ReduceIntMax (int &rvar, int cpu)
 Integer max reduction to specified cpu. More...
 
void ReduceIntMin (int &rvar, int cpu)
 Integer min reduction to specified cpu. More...
 
void ReduceIntSum (int *, int)
 
void ReduceIntMax (int *, int)
 
void ReduceIntMin (int *, int)
 
void ReduceIntSum (int *, int, int)
 
void ReduceIntMax (int *, int, int)
 
void ReduceIntMin (int *, int, int)
 
void ReduceIntSum (Vector< std::reference_wrapper< int > > const &)
 
void ReduceIntMax (Vector< std::reference_wrapper< int > > const &)
 
void ReduceIntMin (Vector< std::reference_wrapper< int > > const &)
 
void ReduceIntSum (Vector< std::reference_wrapper< int > > const &, int)
 
void ReduceIntMax (Vector< std::reference_wrapper< int > > const &, int)
 
void ReduceIntMin (Vector< std::reference_wrapper< int > > const &, int)
 
void ReduceBoolAnd (bool &rvar)
 And-wise boolean reduction. More...
 
void ReduceBoolOr (bool &rvar)
 Or-wise boolean reduction. More...
 
void ReduceBoolAnd (bool &rvar, int cpu)
 And-wise boolean reduction to specified cpu. More...
 
void ReduceBoolOr (bool &rvar, int cpu)
 Or-wise boolean reduction to specified cpu. More...
 
void Bcast (void *, int, MPI_Datatype, int, MPI_Comm)
 
double second () noexcept
 Returns wall-clock seconds since start of execution. More...
 
void Wait (MPI_Request &, MPI_Status &)
 
void Waitall (Vector< MPI_Request > &, Vector< MPI_Status > &)
 
void Waitany (Vector< MPI_Request > &, int &, MPI_Status &)
 
void Waitsome (Vector< MPI_Request > &, int &, Vector< int > &, Vector< MPI_Status > &)
 
 BL_FORT_PROC_DECL (BL_PD_BARRIER, bl_pd_barrier)()
 
 BL_FORT_PROC_DECL (BL_PD_COMMUNICATOR, bl_pd_communicator)(void *vcomm)
 
 BL_FORT_PROC_DECL (BL_PD_MYPROC, bl_pd_myproc)(int *myproc)
 
 BL_FORT_PROC_DECL (BL_PD_NPROCS, bl_pd_nprocs)(int *nprocs)
 
 BL_FORT_PROC_DECL (BL_PD_IOPROC, bl_pd_ioproc)(int *ioproc)
 
 BL_FORT_PROC_DECL (BL_PD_IS_IOPROC, bl_pd_is_ioproc)(int *ioproc)
 
 BL_FORT_PROC_DECL (BL_PD_SECOND, bl_pd_second)(double *r)
 
 BL_FORT_PROC_DECL (BL_PD_REDUCE_REAL_MAX_TO_IOPROC, bl_pd_reduce_real_max_to_ioproc)(double *r)
 
 BL_FORT_PROC_DECL (BL_PD_REDUCE_REAL_SUM_TO_IOPROC, bl_pd_reduce_real_sum_to_ioproc)(double *r)
 
 BL_FORT_PROC_DECL (BL_PD_ABORT, bl_pd_abort)()
 
void ReadAndBcastFile (const std::string &filename, Vector< char > &charBuf, bool bExitOnError, const MPI_Comm &comm)
 
void Initialize ()
 
void Finalize ()
 
void StartTeams ()
 Split the process pool into teams. More...
 
void EndTeams ()
 
std::string mpi_level_to_string (int mtlev)
 
const std::string Unnamed ("Unnamed")
 Used as default argument to ParallelDescriptor::Barrier(). More...
 
bool UseGpuAwareMpi ()
 
int MyProc () noexcept
 return the rank number local to the current Parallel Context More...
 
int MyProc (MPI_Comm comm) noexcept
 
int MinTag () noexcept
 
int MaxTag () noexcept
 
MPI_Comm Communicator () noexcept
 
int NProcsPerNode () noexcept
 
int MyRankInNode () noexcept
 
int NProcsPerProcessor () noexcept
 
int MyRankInProcessor () noexcept
 
int NProcs () noexcept
 return the number of MPI ranks local to the current Parallel Context More...
 
int NProcs (MPI_Comm comm) noexcept
 
int IOProcessorNumber () noexcept
 
bool IOProcessor () noexcept
 Is this CPU the I/O Processor? To get the rank number, call IOProcessorNumber() More...
 
int IOProcessorNumber (MPI_Comm comm) noexcept
 
bool IOProcessor (MPI_Comm comm) noexcept
 
int TeamSize () noexcept
 
int NTeams () noexcept
 
int MyTeamColor () noexcept
 
int MyTeamLead () noexcept
 
int MyRankInTeam () noexcept
 
int TeamLead (int rank) noexcept
 
bool isTeamLead () noexcept
 
bool sameTeam (int rank) noexcept
 
bool sameTeam (int rankA, int rankB) noexcept
 
int RankInLeadComm (int rank) noexcept
 
bool doTeamReduce () noexcept
 
const ProcessTeamMyTeam () noexcept
 
std::pair< int, intteam_range (int begin, int end, int rit=-1, int nworkers=0) noexcept
 
template<typename F >
void team_for (int begin, int end, const F &f)
 
template<typename F >
void team_for (int begin, int end, int rit, const F &f)
 
template<typename F >
void team_for (int begin, int end, int rit, int nworkers, const F &f)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealSum (T &rvar)
 Real sum reduction. More...
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealSum (T *rvar, int cnt)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealSum (Vector< std::reference_wrapper< T > > const &rvar)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealSum (T &rvar, int cpu)
 Real sum reduction to specified cpu. More...
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealSum (T *rvar, int cnt, int cpu)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealSum (Vector< std::reference_wrapper< T > > const &rvar, int cpu)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMax (T &rvar)
 Real max reduction. More...
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMax (T *rvar, int cnt)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMax (Vector< std::reference_wrapper< T > > const &rvar)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMax (T &rvar, int cpu)
 Real max reduction to specified cpu. More...
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMax (T *rvar, int cnt, int cpu)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMax (Vector< std::reference_wrapper< T > > const &rvar, int cpu)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMin (T &rvar)
 Real min reduction. More...
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMin (T *rvar, int cnt)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMin (Vector< std::reference_wrapper< T > > const &rvar)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMin (T &rvar, int cpu)
 Real min reduction to specified cpu. More...
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMin (T *rvar, int cnt, int cpu)
 
template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > ReduceRealMin (Vector< std::reference_wrapper< T > > const &rvar, int cpu)
 
int SeqNum () noexcept
 Returns sequential message sequence numbers, usually used as tags for send/recv. More...
 
template<class T >
Message Asend (const T *, size_t n, int pid, int tag)
 
template<class T >
Message Asend (const T *, size_t n, int pid, int tag, MPI_Comm comm)
 
template<class T >
Message Asend (const std::vector< T > &buf, int pid, int tag)
 
template<class T >
Message Arecv (T *, size_t n, int pid, int tag)
 
template<class T >
Message Arecv (T *, size_t n, int pid, int tag, MPI_Comm comm)
 
template<class T >
Message Arecv (std::vector< T > &buf, int pid, int tag)
 
template<class T >
Message Send (const T *buf, size_t n, int dst_pid, int tag)
 
template<class T >
Message Send (const T *buf, size_t n, int dst_pid, int tag, MPI_Comm comm)
 
template<class T >
Message Send (const std::vector< T > &buf, int dst_pid, int tag)
 
template<class T >
Message Recv (T *, size_t n, int pid, int tag)
 
template<class T >
Message Recv (T *, size_t n, int pid, int tag, MPI_Comm comm)
 
template<class T >
Message Recv (std::vector< T > &buf, int pid, int tag)
 
template<class T >
void Bcast (T *, size_t n, int root=0)
 
template<class T >
void Bcast (T *, size_t n, int root, const MPI_Comm &comm)
 
template<class T , class T1 >
void Scatter (T *, size_t n, const T1 *, size_t n1, int root)
 
template<class T , class T1 >
void Gather (const T *, size_t n, T1 *, size_t n1, int root)
 
template<class T >
std::vector< T > Gather (const T &, int root)
 
template<class T >
void Gatherv (const T *send, int sc, T *recv, const std::vector< int > &rc, const std::vector< int > &disp, int root)
 
template<class T >
void GatherLayoutDataToVector (const LayoutData< T > &sendbuf, Vector< T > &recvbuf, int root)
 Gather LayoutData values to a vector on root. More...
 
template<typename T , typename F >
MPI_Op Mpi_op ()
 
template<>
void Bcast (Box *b, size_t n, int root)
 

Variables

bool use_gpu_aware_mpi = false
 
ProcessTeam m_Team
 
MPI_Comm m_comm = MPI_COMM_NULL
 
int m_nprocs_per_node = 1
 
int m_rank_in_node = 0
 
int m_nprocs_per_processor = 1
 
int m_rank_in_processor = 0
 
Vector< MPI_Datatype * > m_mpi_types
 
Vector< MPI_Op * > m_mpi_ops
 
int m_MinTag = 1000
 
int m_MaxTag = -1
 
const int ioProcessor = 0
 The MPI rank number of the I/O Processor (probably rank 0). This rank is usually used to write to stdout. More...
 

Detailed Description

Parallel frontend that abstracts functionalities needed to spawn processes and handle communication.

Function Documentation

◆ Abarrier() [1/2]

Message amrex::ParallelDescriptor::Abarrier ( )

◆ Abarrier() [2/2]

Message amrex::ParallelDescriptor::Abarrier ( const MPI_Comm )

◆ Abort()

void amrex::ParallelDescriptor::Abort ( int  errorcode,
bool  backtrace 
)

Abort with specified error code.

◆ Arecv() [1/3]

template<class T >
Message amrex::ParallelDescriptor::Arecv ( std::vector< T > &  buf,
int  pid,
int  tag 
)

◆ Arecv() [2/3]

template<class T >
Message amrex::ParallelDescriptor::Arecv ( T *  ,
size_t  n,
int  pid,
int  tag 
)

◆ Arecv() [3/3]

template<class T >
Message amrex::ParallelDescriptor::Arecv ( T *  ,
size_t  n,
int  pid,
int  tag,
MPI_Comm  comm 
)

◆ Asend() [1/3]

template<class T >
Message amrex::ParallelDescriptor::Asend ( const std::vector< T > &  buf,
int  pid,
int  tag 
)

◆ Asend() [2/3]

template<class T >
Message amrex::ParallelDescriptor::Asend ( const T *  ,
size_t  n,
int  pid,
int  tag 
)

◆ Asend() [3/3]

template<class T >
Message amrex::ParallelDescriptor::Asend ( const T *  ,
size_t  n,
int  pid,
int  tag,
MPI_Comm  comm 
)

◆ Barrier() [1/2]

void amrex::ParallelDescriptor::Barrier ( const MPI_Comm ,
const std::string &   
)

◆ Barrier() [2/2]

void amrex::ParallelDescriptor::Barrier ( const std::string &  )

◆ Bcast() [1/4]

template<>
void amrex::ParallelDescriptor::Bcast ( Box b,
size_t  n,
int  root 
)

◆ Bcast() [2/4]

template<class T >
void amrex::ParallelDescriptor::Bcast ( T *  ,
size_t  n,
int  root,
const MPI_Comm comm 
)

◆ Bcast() [3/4]

template<class T >
void amrex::ParallelDescriptor::Bcast ( T *  ,
size_t  n,
int  root = 0 
)

◆ Bcast() [4/4]

void amrex::ParallelDescriptor::Bcast ( void *  ,
int  ,
MPI_Datatype  ,
int  ,
MPI_Comm   
)

◆ BL_FORT_PROC_DECL() [1/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_ABORT  ,
bl_pd_abort   
)

◆ BL_FORT_PROC_DECL() [2/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_BARRIER  ,
bl_pd_barrier   
)

◆ BL_FORT_PROC_DECL() [3/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_COMMUNICATOR  ,
bl_pd_communicator   
)

◆ BL_FORT_PROC_DECL() [4/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_IOPROC  ,
bl_pd_ioproc   
)

◆ BL_FORT_PROC_DECL() [5/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_IS_IOPROC  ,
bl_pd_is_ioproc   
)

◆ BL_FORT_PROC_DECL() [6/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_MYPROC  ,
bl_pd_myproc   
)

◆ BL_FORT_PROC_DECL() [7/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_NPROCS  ,
bl_pd_nprocs   
)

◆ BL_FORT_PROC_DECL() [8/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_REDUCE_REAL_MAX_TO_IOPROC  ,
bl_pd_reduce_real_max_to_ioproc   
)

◆ BL_FORT_PROC_DECL() [9/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_REDUCE_REAL_SUM_TO_IOPROC  ,
bl_pd_reduce_real_sum_to_ioproc   
)

◆ BL_FORT_PROC_DECL() [10/10]

amrex::ParallelDescriptor::BL_FORT_PROC_DECL ( BL_PD_SECOND  ,
bl_pd_second   
)

◆ Comm_dup()

void amrex::ParallelDescriptor::Comm_dup ( MPI_Comm  ,
MPI_Comm  
)

◆ Communicator()

MPI_Comm amrex::ParallelDescriptor::Communicator ( )
inlinenoexcept

◆ doTeamReduce()

bool amrex::ParallelDescriptor::doTeamReduce ( )
inlinenoexcept

◆ EndParallel()

void amrex::ParallelDescriptor::EndParallel ( )

Perform any needed parallel finalization. This MUST be the last routine in this class called from within a program.

◆ EndTeams()

void amrex::ParallelDescriptor::EndTeams ( )

◆ ErrorString()

const char * amrex::ParallelDescriptor::ErrorString ( int  )

ErrorString return string associated with error internal error condition.

◆ Finalize()

void amrex::ParallelDescriptor::Finalize ( )

◆ Gather() [1/3]

template<class T >
std::vector< T > amrex::ParallelDescriptor::Gather ( const T &  t,
int  root 
)

◆ Gather() [2/3]

template<class T , class T1 >
void amrex::ParallelDescriptor::Gather ( const T *  t,
size_t  n,
T1 *  t1,
size_t  n1,
int  root 
)

◆ Gather() [3/3]

void amrex::ParallelDescriptor::Gather ( Real const *  sendbuf,
int  nsend,
Real *  recvbuf,
int  root 
)

Parallel gather.

◆ GatherLayoutDataToVector()

template<class T >
void amrex::ParallelDescriptor::GatherLayoutDataToVector ( const LayoutData< T > &  sendbuf,
Vector< T > &  recvbuf,
int  root 
)

Gather LayoutData values to a vector on root.

◆ Gatherv()

template<class T >
void amrex::ParallelDescriptor::Gatherv ( const T *  send,
int  sc,
T *  recv,
const std::vector< int > &  rc,
const std::vector< int > &  disp,
int  root 
)

◆ Initialize()

void amrex::ParallelDescriptor::Initialize ( )

◆ IOProcessor() [1/2]

bool amrex::ParallelDescriptor::IOProcessor ( )
inlinenoexcept

Is this CPU the I/O Processor? To get the rank number, call IOProcessorNumber()

◆ IOProcessor() [2/2]

bool amrex::ParallelDescriptor::IOProcessor ( MPI_Comm  comm)
inlinenoexcept

◆ IOProcessorNumber() [1/2]

int amrex::ParallelDescriptor::IOProcessorNumber ( )
inlinenoexcept

◆ IOProcessorNumber() [2/2]

int amrex::ParallelDescriptor::IOProcessorNumber ( MPI_Comm  comm)
inlinenoexcept

◆ IProbe() [1/2]

void amrex::ParallelDescriptor::IProbe ( int  ,
int  ,
int ,
MPI_Status  
)

◆ IProbe() [2/2]

void amrex::ParallelDescriptor::IProbe ( int  ,
int  ,
MPI_Comm  ,
int ,
MPI_Status  
)

◆ isTeamLead()

bool amrex::ParallelDescriptor::isTeamLead ( )
inlinenoexcept

◆ MaxTag()

int amrex::ParallelDescriptor::MaxTag ( )
inlinenoexcept

◆ MinTag()

int amrex::ParallelDescriptor::MinTag ( )
inlinenoexcept

◆ mpi_level_to_string()

std::string amrex::ParallelDescriptor::mpi_level_to_string ( int  mtlev)

Convert an MPI_THREAD_<X> level to string

Parameters
mtlevMPI_THREAD_<X> level
Returns
string representation of the equivalent MPI macro name

◆ Mpi_op()

template<typename T , typename F >
MPI_Op amrex::ParallelDescriptor::Mpi_op ( )

◆ MyProc() [1/2]

int amrex::ParallelDescriptor::MyProc ( )
inlinenoexcept

return the rank number local to the current Parallel Context

◆ MyProc() [2/2]

int amrex::ParallelDescriptor::MyProc ( MPI_Comm  comm)
inlinenoexcept

◆ MyRankInNode()

int amrex::ParallelDescriptor::MyRankInNode ( )
inlinenoexcept

Return the rank in a node defined by MPI_COMM_TYPE_SHARED. This might be the same or different from MyRankInProcessor based on MPI_Get_processor_name.

◆ MyRankInProcessor()

int amrex::ParallelDescriptor::MyRankInProcessor ( )
inlinenoexcept

Return the rank in a node defined by MPI_Get_processor_name. This might be the same or different from MyRankInNode based on MPI_COMM_TYPE_SHARED.

◆ MyRankInTeam()

int amrex::ParallelDescriptor::MyRankInTeam ( )
inlinenoexcept

◆ MyTeam()

const ProcessTeam& amrex::ParallelDescriptor::MyTeam ( )
inlinenoexcept

◆ MyTeamColor()

int amrex::ParallelDescriptor::MyTeamColor ( )
inlinenoexcept

◆ MyTeamLead()

int amrex::ParallelDescriptor::MyTeamLead ( )
inlinenoexcept

◆ NProcs() [1/2]

int amrex::ParallelDescriptor::NProcs ( )
inlinenoexcept

return the number of MPI ranks local to the current Parallel Context

◆ NProcs() [2/2]

int amrex::ParallelDescriptor::NProcs ( MPI_Comm  comm)
inlinenoexcept

◆ NProcsPerNode()

int amrex::ParallelDescriptor::NProcsPerNode ( )
inlinenoexcept

Return the number of MPI ranks per node as defined by MPI_COMM_TYPE_SHARED. This might be the same or different from NProcsPerProcessor based on MPI_Get_processor_name.

◆ NProcsPerProcessor()

int amrex::ParallelDescriptor::NProcsPerProcessor ( )
inlinenoexcept

Return the number of MPI ranks per node as defined by MPI_Get_processor_name. This might be the same or different from NProcsPerNode based on MPI_COMM_TYPE_SHARED.

◆ NTeams()

int amrex::ParallelDescriptor::NTeams ( )
inlinenoexcept

◆ RankInLeadComm()

int amrex::ParallelDescriptor::RankInLeadComm ( int  rank)
inlinenoexcept

◆ ReadAndBcastFile()

void amrex::ParallelDescriptor::ReadAndBcastFile ( const std::string &  filename,
Vector< char > &  charBuf,
bool  bExitOnError,
const MPI_Comm comm 
)

◆ Recv() [1/3]

template<class T >
Message amrex::ParallelDescriptor::Recv ( std::vector< T > &  buf,
int  pid,
int  tag 
)

◆ Recv() [2/3]

template<class T >
Message amrex::ParallelDescriptor::Recv ( T *  ,
size_t  n,
int  pid,
int  tag 
)

◆ Recv() [3/3]

template<class T >
Message amrex::ParallelDescriptor::Recv ( T *  ,
size_t  n,
int  pid,
int  tag,
MPI_Comm  comm 
)

◆ ReduceBoolAnd() [1/2]

void amrex::ParallelDescriptor::ReduceBoolAnd ( bool &  )

And-wise boolean reduction.

◆ ReduceBoolAnd() [2/2]

void amrex::ParallelDescriptor::ReduceBoolAnd ( bool &  ,
int   
)

And-wise boolean reduction to specified cpu.

◆ ReduceBoolOr() [1/2]

void amrex::ParallelDescriptor::ReduceBoolOr ( bool &  )

Or-wise boolean reduction.

◆ ReduceBoolOr() [2/2]

void amrex::ParallelDescriptor::ReduceBoolOr ( bool &  ,
int   
)

Or-wise boolean reduction to specified cpu.

◆ ReduceIntMax() [1/6]

void amrex::ParallelDescriptor::ReduceIntMax ( int )

Integer max reduction.

◆ ReduceIntMax() [2/6]

void amrex::ParallelDescriptor::ReduceIntMax ( int ,
int   
)

Integer max reduction to specified cpu.

◆ ReduceIntMax() [3/6]

void amrex::ParallelDescriptor::ReduceIntMax ( int ,
int   
)

◆ ReduceIntMax() [4/6]

void amrex::ParallelDescriptor::ReduceIntMax ( int ,
int  ,
int   
)

◆ ReduceIntMax() [5/6]

void amrex::ParallelDescriptor::ReduceIntMax ( Vector< std::reference_wrapper< int > > const &  )

◆ ReduceIntMax() [6/6]

void amrex::ParallelDescriptor::ReduceIntMax ( Vector< std::reference_wrapper< int > > const &  ,
int   
)

◆ ReduceIntMin() [1/6]

void amrex::ParallelDescriptor::ReduceIntMin ( int )

Integer min reduction.

◆ ReduceIntMin() [2/6]

void amrex::ParallelDescriptor::ReduceIntMin ( int ,
int   
)

Integer min reduction to specified cpu.

◆ ReduceIntMin() [3/6]

void amrex::ParallelDescriptor::ReduceIntMin ( int ,
int   
)

◆ ReduceIntMin() [4/6]

void amrex::ParallelDescriptor::ReduceIntMin ( int ,
int  ,
int   
)

◆ ReduceIntMin() [5/6]

void amrex::ParallelDescriptor::ReduceIntMin ( Vector< std::reference_wrapper< int > > const &  )

◆ ReduceIntMin() [6/6]

void amrex::ParallelDescriptor::ReduceIntMin ( Vector< std::reference_wrapper< int > > const &  ,
int   
)

◆ ReduceIntSum() [1/6]

void amrex::ParallelDescriptor::ReduceIntSum ( int )

Integer sum reduction.

◆ ReduceIntSum() [2/6]

void amrex::ParallelDescriptor::ReduceIntSum ( int ,
int   
)

Integer sum reduction to specified cpu.

◆ ReduceIntSum() [3/6]

void amrex::ParallelDescriptor::ReduceIntSum ( int ,
int   
)

◆ ReduceIntSum() [4/6]

void amrex::ParallelDescriptor::ReduceIntSum ( int ,
int  ,
int   
)

◆ ReduceIntSum() [5/6]

void amrex::ParallelDescriptor::ReduceIntSum ( Vector< std::reference_wrapper< int > > const &  )

◆ ReduceIntSum() [6/6]

void amrex::ParallelDescriptor::ReduceIntSum ( Vector< std::reference_wrapper< int > > const &  ,
int   
)

◆ ReduceLongAnd() [1/6]

void amrex::ParallelDescriptor::ReduceLongAnd ( Long &  )

Long and-wise reduction.

◆ ReduceLongAnd() [2/6]

void amrex::ParallelDescriptor::ReduceLongAnd ( Long &  ,
int   
)

Long and-wise reduction to specified cpu.

◆ ReduceLongAnd() [3/6]

void amrex::ParallelDescriptor::ReduceLongAnd ( Long *  ,
int   
)

◆ ReduceLongAnd() [4/6]

void amrex::ParallelDescriptor::ReduceLongAnd ( Long *  ,
int  ,
int   
)

◆ ReduceLongAnd() [5/6]

void amrex::ParallelDescriptor::ReduceLongAnd ( Vector< std::reference_wrapper< Long > > const &  )

◆ ReduceLongAnd() [6/6]

void amrex::ParallelDescriptor::ReduceLongAnd ( Vector< std::reference_wrapper< Long > > const &  ,
int   
)

◆ ReduceLongMax() [1/6]

void amrex::ParallelDescriptor::ReduceLongMax ( Long &  )

Long max reduction.

◆ ReduceLongMax() [2/6]

void amrex::ParallelDescriptor::ReduceLongMax ( Long &  ,
int   
)

Long max reduction to specified cpu.

◆ ReduceLongMax() [3/6]

void amrex::ParallelDescriptor::ReduceLongMax ( Long *  ,
int   
)

◆ ReduceLongMax() [4/6]

void amrex::ParallelDescriptor::ReduceLongMax ( Long *  ,
int  ,
int   
)

◆ ReduceLongMax() [5/6]

void amrex::ParallelDescriptor::ReduceLongMax ( Vector< std::reference_wrapper< Long > > const &  )

◆ ReduceLongMax() [6/6]

void amrex::ParallelDescriptor::ReduceLongMax ( Vector< std::reference_wrapper< Long > > const &  ,
int   
)

◆ ReduceLongMin() [1/6]

void amrex::ParallelDescriptor::ReduceLongMin ( Long &  )

Long min reduction.

◆ ReduceLongMin() [2/6]

void amrex::ParallelDescriptor::ReduceLongMin ( Long &  ,
int   
)

Long min reduction to specified cpu.

◆ ReduceLongMin() [3/6]

void amrex::ParallelDescriptor::ReduceLongMin ( Long *  ,
int   
)

◆ ReduceLongMin() [4/6]

void amrex::ParallelDescriptor::ReduceLongMin ( Long *  ,
int  ,
int   
)

◆ ReduceLongMin() [5/6]

void amrex::ParallelDescriptor::ReduceLongMin ( Vector< std::reference_wrapper< Long > > const &  )

◆ ReduceLongMin() [6/6]

void amrex::ParallelDescriptor::ReduceLongMin ( Vector< std::reference_wrapper< Long > > const &  ,
int   
)

◆ ReduceLongSum() [1/6]

void amrex::ParallelDescriptor::ReduceLongSum ( Long &  )

Long sum reduction.

◆ ReduceLongSum() [2/6]

void amrex::ParallelDescriptor::ReduceLongSum ( Long &  ,
int   
)

Long sum reduction to specified cpu.

◆ ReduceLongSum() [3/6]

void amrex::ParallelDescriptor::ReduceLongSum ( Long *  ,
int   
)

◆ ReduceLongSum() [4/6]

void amrex::ParallelDescriptor::ReduceLongSum ( Long *  ,
int  ,
int   
)

◆ ReduceLongSum() [5/6]

void amrex::ParallelDescriptor::ReduceLongSum ( Vector< std::reference_wrapper< Long > > const &  )

◆ ReduceLongSum() [6/6]

void amrex::ParallelDescriptor::ReduceLongSum ( Vector< std::reference_wrapper< Long > > const &  ,
int   
)

◆ ReduceRealMax() [1/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMax ( T &  rvar)

Real max reduction.

◆ ReduceRealMax() [2/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMax ( T &  rvar,
int  cpu 
)

Real max reduction to specified cpu.

◆ ReduceRealMax() [3/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMax ( T *  rvar,
int  cnt 
)

◆ ReduceRealMax() [4/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMax ( T *  rvar,
int  cnt,
int  cpu 
)

◆ ReduceRealMax() [5/8]

void amrex::ParallelDescriptor::ReduceRealMax ( Vector< std::reference_wrapper< Real > > const &  )

◆ ReduceRealMax() [6/8]

void amrex::ParallelDescriptor::ReduceRealMax ( Vector< std::reference_wrapper< Real > > const &  ,
int   
)

◆ ReduceRealMax() [7/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMax ( Vector< std::reference_wrapper< T > > const &  rvar)

◆ ReduceRealMax() [8/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMax ( Vector< std::reference_wrapper< T > > const &  rvar,
int  cpu 
)

◆ ReduceRealMin() [1/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMin ( T &  rvar)

Real min reduction.

◆ ReduceRealMin() [2/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMin ( T &  rvar,
int  cpu 
)

Real min reduction to specified cpu.

◆ ReduceRealMin() [3/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMin ( T *  rvar,
int  cnt 
)

◆ ReduceRealMin() [4/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMin ( T *  rvar,
int  cnt,
int  cpu 
)

◆ ReduceRealMin() [5/8]

void amrex::ParallelDescriptor::ReduceRealMin ( Vector< std::reference_wrapper< Real > > const &  )

◆ ReduceRealMin() [6/8]

void amrex::ParallelDescriptor::ReduceRealMin ( Vector< std::reference_wrapper< Real > > const &  ,
int   
)

◆ ReduceRealMin() [7/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMin ( Vector< std::reference_wrapper< T > > const &  rvar)

◆ ReduceRealMin() [8/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealMin ( Vector< std::reference_wrapper< T > > const &  rvar,
int  cpu 
)

◆ ReduceRealSum() [1/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealSum ( T &  rvar)

Real sum reduction.

◆ ReduceRealSum() [2/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealSum ( T &  rvar,
int  cpu 
)

Real sum reduction to specified cpu.

◆ ReduceRealSum() [3/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealSum ( T *  rvar,
int  cnt 
)

◆ ReduceRealSum() [4/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealSum ( T *  rvar,
int  cnt,
int  cpu 
)

◆ ReduceRealSum() [5/8]

void amrex::ParallelDescriptor::ReduceRealSum ( Vector< std::reference_wrapper< Real > > const &  )

◆ ReduceRealSum() [6/8]

void amrex::ParallelDescriptor::ReduceRealSum ( Vector< std::reference_wrapper< Real > > const &  ,
int   
)

◆ ReduceRealSum() [7/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealSum ( Vector< std::reference_wrapper< T > > const &  rvar)

◆ ReduceRealSum() [8/8]

template<typename T >
std::enable_if_t< std::is_floating_point_v< T > > amrex::ParallelDescriptor::ReduceRealSum ( Vector< std::reference_wrapper< T > > const &  rvar,
int  cpu 
)

◆ sameTeam() [1/2]

bool amrex::ParallelDescriptor::sameTeam ( int  rank)
inlinenoexcept

◆ sameTeam() [2/2]

bool amrex::ParallelDescriptor::sameTeam ( int  rankA,
int  rankB 
)
inlinenoexcept

◆ Scatter()

template<class T , class T1 >
void amrex::ParallelDescriptor::Scatter ( T *  ,
size_t  n,
const T1 *  ,
size_t  n1,
int  root 
)

◆ second()

double amrex::ParallelDescriptor::second ( )
noexcept

Returns wall-clock seconds since start of execution.

◆ Send() [1/3]

template<class T >
Message amrex::ParallelDescriptor::Send ( const std::vector< T > &  buf,
int  dst_pid,
int  tag 
)

◆ Send() [2/3]

template<class T >
Message amrex::ParallelDescriptor::Send ( const T *  buf,
size_t  n,
int  dst_pid,
int  tag 
)

◆ Send() [3/3]

template<class T >
Message amrex::ParallelDescriptor::Send ( const T *  buf,
size_t  n,
int  dst_pid,
int  tag,
MPI_Comm  comm 
)

◆ SeqNum()

int amrex::ParallelDescriptor::SeqNum ( )
inlinenoexcept

Returns sequential message sequence numbers, usually used as tags for send/recv.

◆ StartParallel()

void amrex::ParallelDescriptor::StartParallel ( int ,
char ***  ,
MPI_Comm   
)

Perform any needed parallel initialization. This MUST be the first routine in this class called from within a program.

BL_USE_MPI

◆ StartTeams()

void amrex::ParallelDescriptor::StartTeams ( )

Split the process pool into teams.

◆ team_for() [1/3]

template<typename F >
void amrex::ParallelDescriptor::team_for ( int  begin,
int  end,
const F &  f 
)

◆ team_for() [2/3]

template<typename F >
void amrex::ParallelDescriptor::team_for ( int  begin,
int  end,
int  rit,
const F &  f 
)

◆ team_for() [3/3]

template<typename F >
void amrex::ParallelDescriptor::team_for ( int  begin,
int  end,
int  rit,
int  nworkers,
const F &  f 
)

◆ team_range()

std::pair<int,int> amrex::ParallelDescriptor::team_range ( int  begin,
int  end,
int  rit = -1,
int  nworkers = 0 
)
inlinenoexcept

◆ TeamLead()

int amrex::ParallelDescriptor::TeamLead ( int  rank)
inlinenoexcept

◆ TeamSize()

int amrex::ParallelDescriptor::TeamSize ( )
inlinenoexcept

◆ Test() [1/2]

void amrex::ParallelDescriptor::Test ( MPI_Request ,
int ,
MPI_Status  
)

◆ Test() [2/2]

void amrex::ParallelDescriptor::Test ( Vector< MPI_Request > &  ,
int ,
Vector< MPI_Status > &   
)

◆ Unnamed()

const std::string amrex::ParallelDescriptor::Unnamed ( "Unnamed"  )

Used as default argument to ParallelDescriptor::Barrier().

◆ UseGpuAwareMpi()

bool amrex::ParallelDescriptor::UseGpuAwareMpi ( )
inline

◆ Wait()

void amrex::ParallelDescriptor::Wait ( MPI_Request ,
MPI_Status  
)

◆ Waitall()

void amrex::ParallelDescriptor::Waitall ( Vector< MPI_Request > &  ,
Vector< MPI_Status > &   
)

◆ Waitany()

void amrex::ParallelDescriptor::Waitany ( Vector< MPI_Request > &  ,
int ,
MPI_Status  
)

◆ Waitsome()

void amrex::ParallelDescriptor::Waitsome ( Vector< MPI_Request > &  ,
int ,
Vector< int > &  ,
Vector< MPI_Status > &   
)

Variable Documentation

◆ ioProcessor

AMREX_EXPORT const int amrex::ParallelDescriptor::ioProcessor = 0

The MPI rank number of the I/O Processor (probably rank 0). This rank is usually used to write to stdout.

◆ m_comm

AMREX_EXPORT MPI_Comm amrex::ParallelDescriptor::m_comm = MPI_COMM_NULL

◆ m_MaxTag

AMREX_EXPORT int amrex::ParallelDescriptor::m_MaxTag = -1

◆ m_MinTag

AMREX_EXPORT int amrex::ParallelDescriptor::m_MinTag = 1000

◆ m_mpi_ops

Vector< MPI_Op * > amrex::ParallelDescriptor::m_mpi_ops

◆ m_mpi_types

Vector< MPI_Datatype * > amrex::ParallelDescriptor::m_mpi_types

◆ m_nprocs_per_node

AMREX_EXPORT int amrex::ParallelDescriptor::m_nprocs_per_node = 1

◆ m_nprocs_per_processor

AMREX_EXPORT int amrex::ParallelDescriptor::m_nprocs_per_processor = 1

◆ m_rank_in_node

AMREX_EXPORT int amrex::ParallelDescriptor::m_rank_in_node = 0

◆ m_rank_in_processor

AMREX_EXPORT int amrex::ParallelDescriptor::m_rank_in_processor = 0

◆ m_Team

AMREX_EXPORT ProcessTeam amrex::ParallelDescriptor::m_Team

◆ use_gpu_aware_mpi

AMREX_EXPORT bool amrex::ParallelDescriptor::use_gpu_aware_mpi = false