diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01eeb0b047703a9fc2fdde032875a76db977ce71..a8240570639564873b359a38dba63b6bd503fc22 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,7 +28,7 @@ stages: - mkdir $CI_PROJECT_DIR/build - cd $CI_PROJECT_DIR/build - if dpkg --compare-versions `ompi_info | head -2 | tail -1 | sed 's/[^0-9.]*\([0-9.]*\).*/\1/'` ge 1.10; then export MPIEXEC_PREFLAGS="--allow-run-as-root" ; fi - - cmake .. -DWALBERLA_BUFFER_DEBUG=$WALBERLA_BUFFER_DEBUG -DWALBERLA_BUILD_TESTS=ON -DWALBERLA_BUILD_BENCHMARKS=ON -DWALBERLA_BUILD_TUTORIALS=ON -DWALBERLA_BUILD_WITH_MPI=$WALBERLA_BUILD_WITH_MPI -DWALBERLA_BUILD_WITH_CUDA=$WALBERLA_BUILD_WITH_CUDA -DWALBERLA_BUILD_WITH_PYTHON=$WALBERLA_BUILD_WITH_PYTHON -DWALBERLA_BUILD_WITH_OPENMP=$WALBERLA_BUILD_WITH_OPENMP -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DMPIEXEC_PREFLAGS=$MPIEXEC_PREFLAGS -DWALBERLA_DOUBLE_ACCURACY=$WALBERLA_DOUBLE_ACCURACY -DWARNING_ERROR=ON + - cmake .. -DWALBERLA_BUFFER_DEBUG=$WALBERLA_BUFFER_DEBUG -DWALBERLA_BUILD_TESTS=ON -DWALBERLA_BUILD_BENCHMARKS=ON -DWALBERLA_BUILD_TUTORIALS=ON -DWALBERLA_BUILD_TOOLS=ON -DWALBERLA_BUILD_WITH_MPI=$WALBERLA_BUILD_WITH_MPI -DWALBERLA_BUILD_WITH_CUDA=$WALBERLA_BUILD_WITH_CUDA -DWALBERLA_BUILD_WITH_PYTHON=$WALBERLA_BUILD_WITH_PYTHON -DWALBERLA_BUILD_WITH_OPENMP=$WALBERLA_BUILD_WITH_OPENMP -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DMPIEXEC_PREFLAGS=$MPIEXEC_PREFLAGS -DWALBERLA_DOUBLE_ACCURACY=$WALBERLA_DOUBLE_ACCURACY -DWARNING_ERROR=ON - cmake . -LAH - make -j $NUM_BUILD_CORES -l $NUM_CORES - ctest -LE $CTEST_EXCLUDE_LABELS -C $CMAKE_BUILD_TYPE --output-on-failure -j $NUM_CORES @@ -553,30 +553,86 @@ gcc_6_mpionly: gcc_6_hybrid: <<: *build_hybrid_definition image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:6 + only: + - triggers tags: - docker gcc_6_serial_dbg: <<: *build_serial_dbg_definition image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:6 + only: + - triggers tags: - docker gcc_6_mpionly_dbg: <<: *build_mpionly_dbg_definition image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:6 + only: + - triggers tags: - docker gcc_6_hybrid_dbg: <<: *build_hybrid_dbg_definition image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:6 + only: + - triggers tags: - docker gcc_6_hybrid_dbg_sp: <<: *build_hybrid_dbg_sp_definition image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:6 + only: + - triggers + tags: + - docker + +gcc_7_serial: + <<: *build_serial_definition + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:7 + only: + - triggers + tags: + - docker + +gcc_7_mpionly: + <<: *build_mpionly_definition + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:7 + only: + - triggers + tags: + - docker + +gcc_7_hybrid: + <<: *build_hybrid_definition + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:7 + tags: + - docker + +gcc_7_serial_dbg: + <<: *build_serial_dbg_definition + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:7 + tags: + - docker + +gcc_7_mpionly_dbg: + <<: *build_mpionly_dbg_definition + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:7 + tags: + - docker + +gcc_7_hybrid_dbg: + <<: *build_hybrid_dbg_definition + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:7 + tags: + - docker + +gcc_7_hybrid_dbg_sp: + <<: *build_hybrid_dbg_sp_definition + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:7 tags: - docker diff --git a/CMakeLists.txt b/CMakeLists.txt index 43a8138c846d60548890f416504215162c6e3b21..acfc2e964a4b4f88a2eab85c5488c8d4ef5e32ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -815,7 +815,7 @@ endif ( ) # OpenMPI 3.0 and higher checks the number of processes against the number of CPUs execute_process(COMMAND ${MPIEXEC} --version RESULT_VARIABLE mpi_version_result OUTPUT_VARIABLE mpi_version_output) if (mpi_version_result EQUAL 0 AND mpi_version_output MATCHES "\\(Open(RTE| MPI)\\) ([3-9]\\.|1[0-9])") - set ( MPIEXEC_PREFLAGS "${MPIEXEC_PREFLAGS} -oversubscribe" ) + list ( APPEND MPIEXEC_PREFLAGS "-oversubscribe" ) endif() ############################################################################################################################ diff --git a/src/core/mpi/RecvBuffer.h b/src/core/mpi/RecvBuffer.h index cf8e327437fad21157cee9d7441e8c196fa1f23e..5015f9bf52c8373cf70c0eb72286027cd5498971 100644 --- a/src/core/mpi/RecvBuffer.h +++ b/src/core/mpi/RecvBuffer.h @@ -38,7 +38,7 @@ #include <boost/utility/enable_if.hpp> #include <algorithm> - +#include <cstring> namespace walberla { namespace mpi { @@ -389,7 +389,6 @@ inline bool GenericRecvBuffer<T>::isEmpty() const */ template< typename T > // Element type template< typename V > // Type of the built-in data value -ATTRIBUTE_NO_SANITIZE_UNDEFINED typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, GenericRecvBuffer<T> & >::type GenericRecvBuffer<T>::get( V& value ) @@ -408,9 +407,8 @@ GenericRecvBuffer<T>::get( V& value ) WALBERLA_ASSERT_LESS_EQUAL( cur_ + (sizeof(V) / sizeof(T)), end_ ); // Extracting the data value - V* tmp = reinterpret_cast<V*>( cur_ ); - value = *tmp; - cur_ = reinterpret_cast<T*>( ++tmp ); + std::memcpy( &value, cur_, sizeof(V) ); + cur_ += sizeof(V) / sizeof(T); // Invariants check WALBERLA_ASSERT_LESS_EQUAL( cur_, end_); diff --git a/src/core/mpi/SendBuffer.h b/src/core/mpi/SendBuffer.h index 448c94af1809115b79fa4fc91896879c2bba83c1..2b1e11c17409a630b4723483b3dd486f23a4302a 100644 --- a/src/core/mpi/SendBuffer.h +++ b/src/core/mpi/SendBuffer.h @@ -42,7 +42,7 @@ #include <algorithm> #include <typeinfo> - +#include <cstring> namespace walberla { namespace mpi { @@ -443,7 +443,6 @@ inline bool GenericSendBuffer<T,G>::isEmpty() const template< typename T // Element type , typename G > // Growth policy template< typename V > // Type of the built-in data value -ATTRIBUTE_NO_SANITIZE_UNDEFINED typename boost::enable_if< boost::mpl::or_< boost::is_arithmetic<V>, boost::is_enum<V> >, GenericSendBuffer<T,G>& >::type GenericSendBuffer<T,G>::put( V value ) @@ -464,8 +463,7 @@ GenericSendBuffer<T,G>::put( V value ) } // Adding the data value - V* const tmp( reinterpret_cast<V*>( cur_ ) ); - *tmp = value; + std::memcpy( cur_, &value, sizeof(V) ); cur_ += count; // Invariants check diff --git a/src/mesh/DistanceComputations.h b/src/mesh/DistanceComputations.h index c8ec8a7693b4ff82b8c70d216c4ee9bc194f6afb..6df23c07839cc6a5b842b07350349d0be6883052 100644 --- a/src/mesh/DistanceComputations.h +++ b/src/mesh/DistanceComputations.h @@ -42,6 +42,14 @@ struct DistanceProperties typedef typename MeshType::Scalar Scalar; typedef math::Matrix3<Scalar> Matrix; + // Dummy constructor to suppress GCC 7 warnings + DistanceProperties() : e0(real_t(0)), e1(real_t(0)), e2(real_t(0)), + e1_normal(real_t(0)), e2_normal(real_t(0)), + e1_normalized(real_t(0)), e2_normalized(real_t(0)), e0_normalized(real_t(0)), + e0l(real_t(0)), e1l(real_t(0)), e2l(real_t(0)), + translation(real_t(0)) + {} + Vec2 e0, e1, e2; Vec2 e1_normal, e2_normal; Vec2 e1_normalized, e2_normalized, e0_normalized; @@ -978,4 +986,4 @@ void TriangleDistance<MeshType>::filterTrianglesForAABB( const BoundingBox & aab } } // namespace mesh -} // namespace walberla \ No newline at end of file +} // namespace walberla diff --git a/tests/mesh/NumericIntegrationTest.cpp b/tests/mesh/NumericIntegrationTest.cpp index 8d8122172bf9b2742e7c56677c3b3ca039144ea6..7bbbc6f0beb992756425e638106c3dce49bf5e26 100644 --- a/tests/mesh/NumericIntegrationTest.cpp +++ b/tests/mesh/NumericIntegrationTest.cpp @@ -93,9 +93,10 @@ Matrix3<real_t> inertiaTensorNumeric( const ContainmentT & body, const AABB & aa { if(body.contains( ContainmentT::toPoint( *it ) )) { - const real_t & x = (*it)[0]; - const real_t & y = (*it)[1]; - const real_t & z = (*it)[2]; + const Vector3<real_t> p = *it; + const real_t & x = p[0]; + const real_t & y = p[1]; + const real_t & z = p[2]; intertiaTensor[0] += y*y + z*z; intertiaTensor[1] += -x*y; @@ -193,4 +194,4 @@ int main( int argc, char * argv[] ) int main( int argc, char * argv[] ) { return walberla::mesh::main( argc, argv ); -} \ No newline at end of file +}