Skip to content
Snippets Groups Projects
Commit 5367af3f authored by Dmitriy Morozov's avatar Dmitriy Morozov Committed by Kitware Robot
Browse files

Merge topic 'new-test'


554a037a MSVC-2017/2019 fixes
e0a48bdb rexchange: update test to reproduce MSVC issues.

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !43
parents 3ed802ae 554a037a
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ namespace diy
template<class T>
void enqueue(const BlockID& to, //!< target block (gid,proc)
const T& x, //!< data (eg. STL vector)
void (*save)(BinaryBuffer&, const T&) = &::diy::save<T> //!< optional serialization function
void (*save)(BinaryBuffer&, const T&) = &::diy::save //!< optional serialization function
) const
{
OutgoingQueues& out = *outgoing_; save(out[to], x);
......@@ -42,7 +42,7 @@ namespace diy
void enqueue(const BlockID& to, //!< target block (gid,proc)
const T* x, //!< pointer to the data (eg. address of start of vector)
size_t n, //!< size in data elements (eg. ints)
void (*save)(BinaryBuffer&, const T&) = &::diy::save<T> //!< optional serialization function
void (*save)(BinaryBuffer&, const T&) = &::diy::save //!< optional serialization function
) const;
//! Dequeue data whose size can be determined automatically (e.g., STL vector) and that was
......@@ -51,7 +51,7 @@ namespace diy
template<class T>
void dequeue(int from, //!< target block gid
T& x, //!< data (eg. STL vector)
void (*load)(BinaryBuffer&, T&) = &::diy::load<T> //!< optional serialization function
void (*load)(BinaryBuffer&, T&) = &::diy::load //!< optional serialization function
) const
{ IncomingQueues& in = *incoming_; load(in[from], x); }
......@@ -61,7 +61,7 @@ namespace diy
void dequeue(int from, //!< target block gid
T* x, //!< pointer to the data (eg. address of start of vector)
size_t n, //!< size in data elements (eg. ints)
void (*load)(BinaryBuffer&, T&) = &::diy::load<T> //!< optional serialization function
void (*load)(BinaryBuffer&, T&) = &::diy::load //!< optional serialization function
) const;
//! Dequeue data whose size can be determined automatically (e.g., STL vector) and that was
......@@ -70,7 +70,7 @@ namespace diy
template<class T>
void dequeue(const BlockID& from, //!< target block (gid,proc)
T& x, //!< data (eg. STL vector)
void (*load)(BinaryBuffer&, T&) = &::diy::load<T> //!< optional serialization function
void (*load)(BinaryBuffer&, T&) = &::diy::load //!< optional serialization function
) const { dequeue(from.gid, x, load); }
//! Dequeue an array of data whose size is given explicitly by the user.
......@@ -79,12 +79,12 @@ namespace diy
void dequeue(const BlockID& from, //!< target block (gid,proc)
T* x, //!< pointer to the data (eg. address of start of vector)
size_t n, //!< size in data elements (eg. ints)
void (*load)(BinaryBuffer&, T&) = &::diy::load<T> //!< optional serialization function
void (*load)(BinaryBuffer&, T&) = &::diy::load //!< optional serialization function
) const { dequeue(from.gid, x, n, load); }
template<class T>
EnqueueIterator<T> enqueuer(const T& x,
void (*save)(BinaryBuffer&, const T&) = &::diy::save<T>) const
void (*save)(BinaryBuffer&, const T&) = &::diy::save ) const
{ return EnqueueIterator<T>(this, x, save); }
IncomingQueues* incoming() const { return incoming_; }
......
......@@ -68,7 +68,9 @@ void remote_enq(
int dest_gid = (my_gid + 2) % assigner.nblocks();
int dest_proc = assigner.rank(dest_gid);
diy::BlockID dest_block = {dest_gid, dest_proc};
cp.enqueue(dest_block, my_gid);
// same as cp.enqueue(dest_proc, my_gid), but using this variant for
// testing coverage.
cp.enqueue(dest_block, &my_gid, 1);
}
// dequeue remote data
......@@ -85,7 +87,9 @@ void remote_deq(Block* b,
{
++received;
int recvd_data;
cp.dequeue(incoming_gids[i], recvd_data);
// same as cp.dequeue(incoming_gids[i], recvd_data), but using this variant for
// testing coverage.
cp.dequeue(incoming_gids[i], &recvd_data, 1);
fmt::print(stderr, "Remote dequeue: gid {} received value {} from gid {}\n",
cp.gid(), recvd_data, incoming_gids[i]);
CHECK(recvd_data == incoming_gids[i]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment