Skip to content
Snippets Groups Projects
Commit 796593c3 authored by Nils Kohl's avatar Nils Kohl :full_moon_with_face:
Browse files

Removed boost::array dependency in mpi::BufferDataTypeExtensions (was already...

Removed boost::array dependency in mpi::BufferDataTypeExtensions (was already partly done as part on #59)
parent 8d96ddd2
No related merge requests found
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "core/DataTypes.h" #include "core/DataTypes.h"
#include "core/Optional.h" #include "core/Optional.h"
#include <boost/array.hpp>
#include <boost/integer.hpp> #include <boost/integer.hpp>
#include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid.hpp>
...@@ -593,37 +592,5 @@ inline RecvBuffer & operator>>( RecvBuffer & buf, boost::uuids::uuid & uuid ) ...@@ -593,37 +592,5 @@ inline RecvBuffer & operator>>( RecvBuffer & buf, boost::uuids::uuid & uuid )
} }
// ---------------------------------------------------------------------------------------------------------------------
// --------------------------------------- Boost array Support ----------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
template<typename T, std::size_t N>
struct BufferSizeTrait< boost::array< T, N > > {
static const bool constantSize = true;
static const uint_t size = N * sizeof(T) + BUFFER_DEBUG_OVERHEAD;
};
template<typename ET, typename G, typename T, std::size_t N>
inline GenericSendBuffer<ET, G> & operator<<( GenericSendBuffer<ET, G> & buf, const boost::array< T, N > & array )
{
buf.addDebugMarker( "ba" );
for( auto it = array.begin(); it != array.end(); ++it )
buf << *it;
return buf;
}
template<typename ET, typename T, std::size_t N>
inline GenericRecvBuffer<ET> & operator>>( GenericRecvBuffer<ET> & buf, boost::array< T, N > & array )
{
buf.readDebugMarker( "ba" );
for( auto it = array.begin(); it != array.end(); ++it )
buf >> *it;
return buf;
}
} //namespace mpi } //namespace mpi
} //namespace walberla } //namespace walberla
...@@ -112,15 +112,6 @@ void initCellContainer( T & container ) ...@@ -112,15 +112,6 @@ void initCellContainer( T & container )
container.insert( container.end(), Cell( dist(rng), dist(rng), dist(rng) ) ); container.insert( container.end(), Cell( dist(rng), dist(rng), dist(rng) ) );
} }
template<typename T, std::size_t N>
void initBoostArray( boost::array< T, N > & array )
{
static std::mt19937 rng;
std::uniform_int_distribution<T> dist;
for( auto it = array.begin(); it != array.end(); ++it )
*it = dist( rng );
}
template<typename T, std::size_t N> template<typename T, std::size_t N>
void initStdArray( std::array< T, N > & array ) void initStdArray( std::array< T, N > & array )
...@@ -162,7 +153,6 @@ void bufferTest() ...@@ -162,7 +153,6 @@ void bufferTest()
std::map <unsigned int, walberla::int64_t> stdMap, stdMapEmpty; std::map <unsigned int, walberla::int64_t> stdMap, stdMapEmpty;
std::multimap<unsigned int, walberla::int64_t> stdMultiMap, stdMultiMapEmpty; std::multimap<unsigned int, walberla::int64_t> stdMultiMap, stdMultiMapEmpty;
boost::array< unsigned int, 19 > boostArray;
std::array < unsigned int, 19 > stdArray; std::array < unsigned int, 19 > stdArray;
initVecBool(boolStdVec); initVecBool(boolStdVec);
...@@ -173,7 +163,6 @@ void bufferTest() ...@@ -173,7 +163,6 @@ void bufferTest()
initIntegerAssocContainer(stdMultiSet); initIntegerAssocContainer(stdMultiSet);
initIntegerMap(stdMap); initIntegerMap(stdMap);
initIntegerMap(stdMultiMap); initIntegerMap(stdMultiMap);
initBoostArray(boostArray);
initStdArray(stdArray); initStdArray(stdArray);
// Create send buffer and put two values in it // Create send buffer and put two values in it
...@@ -190,7 +179,7 @@ void bufferTest() ...@@ -190,7 +179,7 @@ void bufferTest()
sb << stdMultiSet << stdMultiSetEmpty; sb << stdMultiSet << stdMultiSetEmpty;
sb << stdMap << stdMapEmpty; sb << stdMap << stdMapEmpty;
sb << stdMultiMap << stdMultiMapEmpty; sb << stdMultiMap << stdMultiMapEmpty;
sb << boostArray << stdArray; sb << stdArray;
// Copying // Copying
//RecvBuffer<T> rb; //RecvBuffer<T> rb;
...@@ -220,7 +209,6 @@ void bufferTest() ...@@ -220,7 +209,6 @@ void bufferTest()
std::map <unsigned int, walberla::int64_t> recvStdMap, recvStdMapEmpty; std::map <unsigned int, walberla::int64_t> recvStdMap, recvStdMapEmpty;
std::multimap<unsigned int, walberla::int64_t> recvStdMultiMap, recvStdMultiMapEmpty; std::multimap<unsigned int, walberla::int64_t> recvStdMultiMap, recvStdMultiMapEmpty;
boost::array<unsigned int, 19> recvBoostArray;
std::array <unsigned int, 19> recvStdArray; std::array <unsigned int, 19> recvStdArray;
rb >> recvD >> recvI; rb >> recvD >> recvI;
...@@ -235,7 +223,7 @@ void bufferTest() ...@@ -235,7 +223,7 @@ void bufferTest()
rb >> recvStdMultiSet >> recvStdMultiSetEmpty; rb >> recvStdMultiSet >> recvStdMultiSetEmpty;
rb >> recvStdMap >> recvStdMapEmpty; rb >> recvStdMap >> recvStdMapEmpty;
rb >> recvStdMultiMap >> recvStdMultiMapEmpty; rb >> recvStdMultiMap >> recvStdMultiMapEmpty;
rb >> recvBoostArray >> recvStdArray; rb >> recvStdArray;
// Validate // Validate
WALBERLA_CHECK_FLOAT_EQUAL(recvD,testDouble); WALBERLA_CHECK_FLOAT_EQUAL(recvD,testDouble);
...@@ -266,7 +254,6 @@ void bufferTest() ...@@ -266,7 +254,6 @@ void bufferTest()
WALBERLA_CHECK_EQUAL(recvStdMultiMap, stdMultiMap); WALBERLA_CHECK_EQUAL(recvStdMultiMap, stdMultiMap);
WALBERLA_CHECK_EQUAL(recvStdMultiMapEmpty, stdMultiMapEmpty); WALBERLA_CHECK_EQUAL(recvStdMultiMapEmpty, stdMultiMapEmpty);
WALBERLA_CHECK_EQUAL(recvBoostArray, boostArray);
WALBERLA_CHECK_EQUAL(recvStdArray, stdArray); WALBERLA_CHECK_EQUAL(recvStdArray, stdArray);
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment