12#include <unordered_map>
13#include <unordered_set>
18#define TIMPI_UNIT_ASSERT(expr) \
39template <
typename Container>
42 std::vector<typename Container::value_type>
temp(size);
43 std::iota(
temp.begin(),
temp.end(), 0);
53template <
typename Container>
58 for (std::size_t
i = 0;
i != size; ++
i)
59 c.insert(std::make_pair(
i*10,
i*50));
66 template <
typename Container>
69 std::vector<Container>
vals;
84 for (std::size_t
n = 0;
n !=
i+1; ++
n)
93 template <
typename Container>
96 std::vector<Container>
vals;
111 for (std::size_t
n = 0;
n !=
i+1; ++
n)
122 std::set<std::vector<std::tuple<int,int>>>
data;
127 std::vector<std::tuple<int,int>>
datum(1);
128 std::get<0>(
datum[0]) =
i;
129 std::get<1>(
datum[0]) = 2*
i;
135 std::vector<std::tuple<int,int>>
datum(1);
136 std::get<0>(
datum[0]) =
i;
137 std::get<1>(
datum[0]) = 2*
i;
149 for (
int p=0;
p<
N; ++
p)
158 std::vector<std::set<unsigned int>>
vals(1);
172 unsigned int value = 0;
180 std::vector<std::array<std::set<unsigned int>, 2>>
vals;
183 std::array<std::set<unsigned int>, 2>
vals_out
197 unsigned int value = 0;
210 std::vector<std::tuple<std::set<unsigned int>,
unsigned int,
unsigned int>>
vals;
224 unsigned int value = 0;
234 std::vector<std::pair<std::set<unsigned int>,
unsigned int>>
vals;
248 unsigned int value = 0;
257 std::set<unsigned int> val;
271 std::vector<std::set<unsigned int>>
vals;
279 for (
auto & val :
vals)
310 for (
int d=0;
d !=
M; ++
d)
327 "three",
"four",
"five",
"six",
"seven",
"eight",
"nine"};
340 for (
int d=0;
d !=
M; ++
d)
347 data[
d].push_back(std::set<std::string>());
348 for (
int j=0;
j!=
d+1; ++
j)
359 std::map<processor_id_type, std::vector<std::set<unsigned int>>>
data,
received_data;
390 const std::vector<std::set<unsigned int>> &
datum =
map_it->second;
408 std::map<processor_id_type, std::vector<std::set<unsigned int>> >
data,
received_data;
415 const std::vector<std::set<unsigned int>> &
query,
416 std::vector<std::set<unsigned int>> &
response)
432 const std::vector<std::set<unsigned int>> &
query,
433 const std::vector<std::set<unsigned int>> &
response)
453 std::set<unsigned int> *
ex =
nullptr;
458 for (
int p=0;
p != size; ++
p)
461 for (std::size_t
i = 0;
i !=
data[
p].size(); ++
i)
480 std::map<processor_id_type, std::vector<std::set<std::string>> >
data,
received_data;
487 const std::vector<std::set<std::string>> &
query,
488 std::vector<std::set<std::string>> &
response)
504 const std::vector<std::set<std::string>> &
query,
505 const std::vector<std::set<std::string>> &
response)
525 std::set<std::string> *
ex =
nullptr;
530 for (
int p=0;
p != size; ++
p)
533 for (std::size_t
i = 0;
i !=
data[
p].size(); ++
i)
Encapsulates the MPI_Comm object.
processor_id_type size() const
processor_id_type rank() const
void set_union(T &data, const unsigned int root_id) const
Take a container (set, map, unordered_set, multimap, etc) of local variables on each processor,...
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
Take a local value and broadcast it to all processors.
void sync_type(const SyncType st)
Explicitly sets the SyncType used for sync operations.
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
Take a vector of length this->size(), and fill in recv[processor_id] = the value of send on that proc...
StandardType<T>'s which do not define a way to MPI_Type T should inherit from this class.
StandardType(const std::set< T > *)
Templated class to provide the appropriate MPI datatype for use with built-in C types or simple C++ c...
The TIMPIInit class, when constructed, initializes any dependent libraries (e.g.
void testPairContainerAllGather()
Communicator * TestCommWorld
void testMapContainerAllGather()
void testTupleContainerAllGather()
void testPackedSetUnion()
Container createContainer(std::size_t size)
void fill_data(std::map< processor_id_type, std::vector< std::set< unsigned int > > > &data, int M)
std::set< T > createSet(std::size_t size)
void testVectorOfContainersAllGather()
void testContainerBroadcast()
void testVectorOfContainersBroadcast()
void testContainerAllGather()
void testArrayContainerAllGather()
Container createMapContainer(std::size_t size)
void pull_parallel_vector_data(const Communicator &comm, const MapToVectors &queries, GatherFunctor &gather_data, const ActionFunctor &act_on_data, const datum *example)
Send query vectors, receive and answer them with vectors of data, then act on those answers.
uint8_t processor_id_type
void push_parallel_vector_data(const Communicator &comm, MapToVectors &&data, const ActionFunctor &act_on_data)
Send and receive and act on vectors of data.
Tnew cast_int(Told oldvar)
std::string stringy_number(int number)