Merge pull request #811 from atgeirr/fix-warnings

Silence multiple warnings.
This commit is contained in:
Atgeirr Flø Rasmussen 2015-05-29 15:39:47 +02:00
commit 901209a723
5 changed files with 19 additions and 7 deletions

View File

@ -28,11 +28,14 @@
#include <exception>
#if HAVE_MPI && HAVE_DUNE_ISTL
#include "mpi.h"
#include <mpi.h>
#include <opm/core/utility/platform_dependent/disable_warnings.h>
#include <dune/istl/owneroverlapcopy.hh>
#include <dune/common/parallel/interface.hh>
#include <dune/common/parallel/communicator.hh>
#include <dune/common/enumset.hh>
#include <opm/core/utility/platform_dependent/reenable_warnings.h>
#include <algorithm>
#include <functional>

View File

@ -101,10 +101,10 @@ namespace Opm
{
const ParallelISTLInformation& info =
boost::any_cast<const ParallelISTLInformation&>(parallel_information_);
std::size_t size_per_component = (end - it) / num_components;
int size_per_component = (end - it) / num_components;
assert((end - it) == num_components * size_per_component);
double component_product = 0.0;
for( std::size_t i = 0; i < num_components; ++i )
for( int i = 0; i < num_components; ++i )
{
auto component_container =
boost::make_iterator_range(it + i * size_per_component,

View File

@ -61,6 +61,11 @@
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wtautological-compare"
#pragma GCC diagnostic ignored "-Wtype-limits"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#endif // COMPATIBLE_COMPILER
#endif // SILENCE_EXTERNAL_WARNINGS

View File

@ -26,6 +26,8 @@
#error "This file needs to compiled with MPI support!"
#endif
#include <opm/core/utility/platform_dependent/disable_warnings.h>
#include <dune/common/version.hh>
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
#include <dune/common/parallel/mpicollectivecommunication.hh>
@ -40,6 +42,8 @@
#include <dune/common/parallel/remoteindices.hh>
#include <dune/istl/owneroverlapcopy.hh>
#include <opm/core/utility/platform_dependent/reenable_warnings.h>
#include <tuple>
struct MPIFixture {

View File

@ -48,8 +48,8 @@ void runSumMaxMinTest(const T offset)
auto mat = create1DLaplacian(*comm.indexSet(), N, start, end, istart, iend);
std::vector<T> x(end-start);
assert(comm.indexSet()->size()==x.size());
for(auto i=comm.indexSet()->begin(), iend=comm.indexSet()->end(); i!=iend; ++i)
x[i->local()]=i->global()+offset;
for(auto it=comm.indexSet()->begin(), itend=comm.indexSet()->end(); it!=itend; ++it)
x[it->local()]=it->global()+offset;
auto containers = std::make_tuple(x, x, x, x);
auto operators = std::make_tuple(Opm::Reduction::makeGlobalSumFunctor<T>(),
Opm::Reduction::makeGlobalMaxFunctor<T>(),
@ -94,8 +94,8 @@ BOOST_AUTO_TEST_CASE(singleContainerReductionTest)
auto mat = create1DLaplacian(*comm.indexSet(), N, start, end, istart, iend);
std::vector<int> x(end-start);
assert(comm.indexSet()->size()==x.size());
for(auto i=comm.indexSet()->begin(), iend=comm.indexSet()->end(); i!=iend; ++i)
x[i->local()]=i->global();
for(auto it=comm.indexSet()->begin(), itend=comm.indexSet()->end(); it!=itend; ++it)
x[it->local()]=it->global();
int value = 1;
int oldvalue = value;
comm.computeReduction(x,Opm::Reduction::makeGlobalSumFunctor<int>(),value);