29inline constexpr Ranks operator""_ranks(
unsigned long long value)
31 return (value <= 1) ?
throw std::runtime_error{
"Cannot create a single rank with _ranks()! Use _rank() instead!"} :
Ranks{
static_cast<int>(value)};
29inline constexpr Ranks operator""_ranks(
unsigned long long value) {
…}
40inline constexpr Ranks operator""_rank(
unsigned long long value)
42 return (value == 1) ?
Ranks{1} :
throw std::runtime_error{
"Cannot create multiple ranks with _rank()! Use _ranks() instead!"};
40inline constexpr Ranks operator""_rank(
unsigned long long value) {
…}
91static_assert(
std::is_same<ParticipantState &,
decltype(
""_on(1_rank))>::value,
"");
92static_assert(
std::is_same<ParticipantState &,
decltype(
""_on(2_ranks))>::value,
"");
118 template <
class... T>
bool isRank(Rank rank) const
Check whether this context has a given rank inside the Participant.
void initialize(const Participants &participants)
Main entrypoint.
bool _initIntraComm
whether this context needs to initialize the intracomm
TestContext(TestSetup setup)
void initializePetsc()
Initialize PETSc if required.
bool invalid
whether this context is valid or not
m2n::PtrM2N connectPrimaryRanks(const std::string &acceptor, const std::string &connector, const ConnectionOptions &options=ConnectionOptions{}) const
std::set< std::string > _names
contains the name of every known Participant
void initializeMPI(const Participants &participants)
bool isNamed(const std::string &name) const
Check whether this context has a given name.
int size
the size of the Communicator of the current participant
std::string describe() const
Provides a user- and log-friendly description of the current context.
bool hasSize(int size) const
Check whether this context has a given size.
utils::Parallel::CommStatePtr _contextComm
the MPI communicator of the context
void initializeIntraComm()
Initialize the intra-participant communication connection if requested.
void initializeGinkgo()
Initialize Ginkgo if required.
void initializeEvents()
Initialize Events if required.
Rank rank
the rank of the current participant
auto comm()
Returns a pointer to the MPI communicator of this context.
std::string name
the name of the current participant
void setContextFrom(const ParticipantState &p)
std::string config() const
contains the testing framework.
@ PETSc
Require to initialize PETSc. This implies the initialization of Events.
@ Events
Require to initialize Event.
@ Ginkgo
Ginkgo initialization.
ConnectionOptions()=default
Represents a ParticipantState in a test.
int size
the amount of ranks this participant runs on
constexpr ParticipantState & setupIntraComm()
constexpr ParticipantState(std::string_view n)
Constructs a serial participant with a given name.
bool initIntraComm
whether to initialize an intra-participant communication for this participant
constexpr ParticipantState & operator()(Ranks rsize)
std::string_view name
the name of the participant
Contains the setup description of a test including participants and requirements.
int totalRanks() const
total amount of ranks required by this setup
std::vector< ParticipantState > participants
All known participants.
bool events
whether to initialize events
bool ginkgo
whether to initialize Ginkgo (the device)
void handleOption(ParticipantState participants)