5 #define TIMPI_UNIT_ASSERT(expr) \ 23 const int n_vals_in_scope = 3;
24 std::vector<int> vals(n_vals);
27 std::vector<TIMPI::MessageTag> tags(n_vals_in_scope);
28 for (
int i=0; i != n_vals_in_scope; ++i)
31 vals[i] = tags[i].
value();
32 for (
int j=0; j != i; ++j)
34 TIMPI_UNIT_ASSERT(vals[i] != vals[j]);
40 for (
int i=n_vals_in_scope; i != n_vals; ++i)
43 vals[i] = another_tag.
value();
44 for (
int j=0; j != i; ++j)
46 TIMPI_UNIT_ASSERT(vals[i] != vals[j]);
59 const int requests[] = {2, 4, 6, 8, 8, 6, 8, 123, 3141, 3142};
61 for (
const int i : requests)
65 TIMPI_UNIT_ASSERT(i == manual_tag.
value());
68 TIMPI_UNIT_ASSERT(i == tag_copy.value());
71 TIMPI_UNIT_ASSERT(i == tag_move.value());
74 TIMPI_UNIT_ASSERT(i == stupidly_manual_tag.value());
84 const int requests[] = {2, 4, 6, 8, 8, 6, 8, 123, 3141, 3142};
86 for (
const int i : requests)
90 TIMPI_UNIT_ASSERT(i == manual_tag.
value());
94 TIMPI_UNIT_ASSERT(i != dup_manual_tag.value());
97 TIMPI_UNIT_ASSERT(i == tag_copy.value());
100 TIMPI_UNIT_ASSERT(i == tag_move.value());
104 int main(
int argc,
const char *
const * argv)
int main(int argc, const char *const *argv)
MessageTag get_unique_tag(int tagvalue=MessageTag::invalid_tag) const
Get a tag that is unique to this Communicator.
The TIMPIInit class, when constructed, initializes any dependent libraries (e.g.
Communicator * TestCommWorld
Encapsulates the MPI_Comm object.
Encapsulates the MPI tag integers.
void testGetUniqueTagManual()
void testGetUniqueTagOverlap()
const Communicator & comm() const
Returns the Communicator created by this object, which will be a compatibility shim if MPI is not ena...
void duplicate(const Communicator &comm)
void testGetUniqueTagAuto()