diff --git a/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/AMRSettlingSphere.cpp b/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/AMRSettlingSphere.cpp index d803a2f8579728b248892c7474f31fa43476bac1..bbba3ba7060a5eafc7ad5c868b8a50e977d6b8d0 100644 --- a/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/AMRSettlingSphere.cpp +++ b/apps/benchmarks/AdaptiveMeshRefinementFluidParticleCoupling/AMRSettlingSphere.cpp @@ -498,13 +498,8 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); } position_ = pos[2]; diff --git a/apps/benchmarks/FluidParticleCoupling/ForcesOnSphereNearPlane.cpp b/apps/benchmarks/FluidParticleCoupling/ForcesOnSphereNearPlane.cpp index 1ef29cf39aa0157493dc4fd63a5a3a39c192c17e..acd0fafe762466de78ea9bc79c024c805b5bac0a 100644 --- a/apps/benchmarks/FluidParticleCoupling/ForcesOnSphereNearPlane.cpp +++ b/apps/benchmarks/FluidParticleCoupling/ForcesOnSphereNearPlane.cpp @@ -216,13 +216,8 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); - - mpi::allReduceInplace( torque[0], mpi::SUM ); - mpi::allReduceInplace( torque[1], mpi::SUM ); - mpi::allReduceInplace( torque[2], mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); + mpi::allReduceInplace( torque, mpi::SUM ); } if( fileIO_ ) diff --git a/apps/benchmarks/FluidParticleCoupling/LubricationForceEvaluation.cpp b/apps/benchmarks/FluidParticleCoupling/LubricationForceEvaluation.cpp index 4d3b151b46ae8ef2556495dbf2a0d343b94ad570..929ff142266d069927889d71a3e132791ab1f8f0 100644 --- a/apps/benchmarks/FluidParticleCoupling/LubricationForceEvaluation.cpp +++ b/apps/benchmarks/FluidParticleCoupling/LubricationForceEvaluation.cpp @@ -705,18 +705,10 @@ int main( int argc, char **argv ) WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( hydForce[0], mpi::SUM ); - mpi::allReduceInplace( hydForce[1], mpi::SUM ); - mpi::allReduceInplace( hydForce[2], mpi::SUM ); - mpi::reduceInplace( lubForce[0], mpi::SUM ); - mpi::reduceInplace( lubForce[1], mpi::SUM ); - mpi::reduceInplace( lubForce[2], mpi::SUM ); - mpi::allReduceInplace( hydTorque[0], mpi::SUM ); - mpi::allReduceInplace( hydTorque[1], mpi::SUM ); - mpi::allReduceInplace( hydTorque[2], mpi::SUM ); - mpi::reduceInplace( lubTorque[0], mpi::SUM ); - mpi::reduceInplace( lubTorque[1], mpi::SUM ); - mpi::reduceInplace( lubTorque[2], mpi::SUM ); + mpi::allReduceInplace( hydForce, mpi::SUM ); + mpi::reduceInplace( lubForce, mpi::SUM ); + mpi::allReduceInplace( hydTorque, mpi::SUM ); + mpi::reduceInplace( lubTorque, mpi::SUM ); } curForceNorm = hydForce.length(); diff --git a/apps/benchmarks/FluidParticleCoupling/MotionSettlingSphere.cpp b/apps/benchmarks/FluidParticleCoupling/MotionSettlingSphere.cpp index a6c85893c0cf5d777caf20ef44ac7b7379502def..6ccaca38682ddf5ab6ccf7221a861760b46bf0ba 100644 --- a/apps/benchmarks/FluidParticleCoupling/MotionSettlingSphere.cpp +++ b/apps/benchmarks/FluidParticleCoupling/MotionSettlingSphere.cpp @@ -313,9 +313,7 @@ private: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); } return force; } @@ -393,41 +391,26 @@ public: // evaluate and write the sphere properties void operator()(const uint_t timestep) { - Vector3<real_t> transVel( real_t(0) ); - Vector3<real_t> angularVel( real_t(0) ); - Vector3<real_t> pos( real_t(0) ); + Vector3<real_t> particleTransVel( real_t(0) ); + Vector3<real_t> particleAngularVel( real_t(0) ); + Vector3<real_t> particlePos( real_t(0) ); - Vector3<real_t> force( real_t(0) ); - Vector3<real_t> torque( real_t(0) ); + Vector3<real_t> particleForce( real_t(0) ); + Vector3<real_t> particleTorque( real_t(0) ); size_t idx = ac_->uidToIdx(sphereUid_); if( idx != ac_->getInvalidIdx()) { if(!mesa_pd::data::particle_flags::isSet( ac_->getFlags(idx), mesa_pd::data::particle_flags::GHOST)) { - pos = ac_->getPosition(idx); - transVel = ac_->getLinearVelocity(idx); - angularVel = ac_->getAngularVelocity(idx); - force = ac_->getHydrodynamicForce(idx); - torque = ac_->getHydrodynamicTorque(idx); + particlePos = ac_->getPosition(idx); + particleTransVel = ac_->getLinearVelocity(idx); + particleAngularVel = ac_->getAngularVelocity(idx); + particleForce = ac_->getHydrodynamicForce(idx); + particleTorque = ac_->getHydrodynamicTorque(idx); } } - std::vector<real_t> particlePos(3); - particlePos[0]=pos[0]; particlePos[1]=pos[1]; particlePos[2]=pos[2]; - - std::vector<real_t> particleTransVel(3); - particleTransVel[0]=transVel[0]; particleTransVel[1]=transVel[1]; particleTransVel[2]=transVel[2]; - - std::vector<real_t> particleAngularVel(3); - particleAngularVel[0]=angularVel[0]; particleAngularVel[1]=angularVel[1]; particleAngularVel[2]=angularVel[2]; - - std::vector<real_t> particleForce(3); - particleForce[0]=force[0]; particleForce[1]=force[1]; particleForce[2]=force[2]; - - std::vector<real_t> particleTorque(3); - particleTorque[0]=torque[0]; particleTorque[1]=torque[1]; particleTorque[2]=torque[2]; - // reduce to root WALBERLA_MPI_SECTION() { @@ -547,10 +530,7 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( u_p[0], mpi::SUM ); - mpi::allReduceInplace( u_p[1], mpi::SUM ); - mpi::allReduceInplace( u_p[2], mpi::SUM ); - + mpi::allReduceInplace( u_p, mpi::SUM ); } Vector3<real_t> u_p_r = u_p - u_infty_; diff --git a/apps/benchmarks/FluidParticleCoupling/ObliqueWetCollision.cpp b/apps/benchmarks/FluidParticleCoupling/ObliqueWetCollision.cpp index 2415cf72dbce81af49ef574b82774623bdbb1513..3ee8fa9e0238b3f48f14498e326c70dad9746e05 100644 --- a/apps/benchmarks/FluidParticleCoupling/ObliqueWetCollision.cpp +++ b/apps/benchmarks/FluidParticleCoupling/ObliqueWetCollision.cpp @@ -268,15 +268,9 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); - mpi::allReduceInplace( angVel[0], mpi::SUM ); - mpi::allReduceInplace( angVel[1], mpi::SUM ); - mpi::allReduceInplace( angVel[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); + mpi::allReduceInplace( angVel, mpi::SUM ); } position_ = pos; @@ -451,9 +445,7 @@ Vector3<real_t> getForce(walberla::id_t uid, ParticleAccessor_T & ac) } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); } return force; } @@ -469,9 +461,7 @@ Vector3<real_t> getTorque(walberla::id_t uid, ParticleAccessor_T & ac) } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( torque[0], mpi::SUM ); - mpi::allReduceInplace( torque[1], mpi::SUM ); - mpi::allReduceInplace( torque[2], mpi::SUM ); + mpi::allReduceInplace( torque, mpi::SUM ); } return torque; } diff --git a/apps/benchmarks/FluidParticleCoupling/SettlingSphereInBox.cpp b/apps/benchmarks/FluidParticleCoupling/SettlingSphereInBox.cpp index 899c27f674d8cdc9bd59914bc7e8c9a99700e287..7d8fe954ef0571305d4d859a993d492f06498465 100644 --- a/apps/benchmarks/FluidParticleCoupling/SettlingSphereInBox.cpp +++ b/apps/benchmarks/FluidParticleCoupling/SettlingSphereInBox.cpp @@ -223,17 +223,9 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); - - mpi::allReduceInplace( hydForce[0], mpi::SUM ); - mpi::allReduceInplace( hydForce[1], mpi::SUM ); - mpi::allReduceInplace( hydForce[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); + mpi::allReduceInplace( hydForce, mpi::SUM ); } position_ = pos[2]; diff --git a/apps/benchmarks/FluidParticleCoupling/SphereMovingWithPrescribedVelocity.cpp b/apps/benchmarks/FluidParticleCoupling/SphereMovingWithPrescribedVelocity.cpp index f7cb9670207a31bc052c0036d8b8aa037a64bb13..aafa7ef462754547b1013b9150baae951598f670 100644 --- a/apps/benchmarks/FluidParticleCoupling/SphereMovingWithPrescribedVelocity.cpp +++ b/apps/benchmarks/FluidParticleCoupling/SphereMovingWithPrescribedVelocity.cpp @@ -361,9 +361,7 @@ Vector3<real_t> getVelocityAtPosition(const shared_ptr<StructuredBlockStorage> & } } - mpi::reduceInplace(vel[0], mpi::SUM); - mpi::reduceInplace(vel[1], mpi::SUM); - mpi::reduceInplace(vel[2], mpi::SUM); + mpi::reduceInplace(vel, mpi::SUM); return vel; } diff --git a/apps/benchmarks/FluidParticleCoupling/SphereWallCollision.cpp b/apps/benchmarks/FluidParticleCoupling/SphereWallCollision.cpp index 13df3b0a875f416360629711ac01fb435ebd4f9c..69f0b8f97fb9af155bcd3ea0227301c08f6bbd0c 100644 --- a/apps/benchmarks/FluidParticleCoupling/SphereWallCollision.cpp +++ b/apps/benchmarks/FluidParticleCoupling/SphereWallCollision.cpp @@ -264,9 +264,7 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); mpi::allReduceInplace( transVel[2], mpi::SUM ); } diff --git a/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp b/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp index a01b5210f10c3dfecc54980e3f7861f0fd278f76..15ccbda0cdb8a5a929f927fd994e4e10f72a0aea 100644 --- a/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp +++ b/apps/benchmarks/ForcesOnSphereNearPlaneInShearFlow/ForcesOnSphereNearPlaneInShearFlow.cpp @@ -291,13 +291,8 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); - - mpi::allReduceInplace( torque[0], mpi::SUM ); - mpi::allReduceInplace( torque[1], mpi::SUM ); - mpi::allReduceInplace( torque[2], mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); + mpi::allReduceInplace( torque, mpi::SUM ); } if( fileIO_ ) diff --git a/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp b/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp index f07496363c82bd456a68200e4e0cecd3ad73a159..11935abb7fe7283e4e98d53f5e51aaad7c9b568f 100644 --- a/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp +++ b/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp @@ -538,9 +538,7 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( u_p[0], mpi::SUM ); - mpi::allReduceInplace( u_p[1], mpi::SUM ); - mpi::allReduceInplace( u_p[2], mpi::SUM ); + mpi::allReduceInplace( u_p, mpi::SUM ); } diff --git a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp index c5ffadeb9fe3cd9e4d2ab14da1fe2abc34521ac7..87802191ac7148e92174cbdeeca2e1013240b096 100644 --- a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp +++ b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp @@ -2050,9 +2050,7 @@ void Evaluation< LatticeModel_T >::evaluate( real_t & cDRealArea, real_t & cLRea // force on obstacle - mpi::reduceInplace( force_[0], mpi::SUM ); - mpi::reduceInplace( force_[1], mpi::SUM ); - mpi::reduceInplace( force_[2], mpi::SUM ); + mpi::reduceInplace( force_, mpi::SUM ); if( setup_.evaluateForceComponents ) { diff --git a/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp b/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp index 415240ca3c82584ea28a7b969d1484ce7debcd08..15a4580f421157b2021f527122a4ae9e74fe1258 100644 --- a/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp +++ b/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp @@ -455,9 +455,7 @@ private: } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( velocity[0], mpi::SUM ); - mpi::allReduceInplace( velocity[1], mpi::SUM ); - mpi::allReduceInplace( velocity[2], mpi::SUM ); + mpi::allReduceInplace( velocity, mpi::SUM ); } return velocity / real_c(numSpheres_); } @@ -474,9 +472,7 @@ private: } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); } return force; } @@ -495,9 +491,7 @@ private: } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( centerOfMass[0], mpi::SUM ); - mpi::allReduceInplace( centerOfMass[1], mpi::SUM ); - mpi::allReduceInplace( centerOfMass[2], mpi::SUM ); + mpi::allReduceInplace( centerOfMass, mpi::SUM ); } return centerOfMass; } diff --git a/apps/showcases/FreeSurface/RisingBubble.cpp b/apps/showcases/FreeSurface/RisingBubble.cpp index 3dabdf5da79d90ede7a87400c858f8230b9ebe47..96c1993a19aac131d408fbe8312e6ecf2fe35c43 100644 --- a/apps/showcases/FreeSurface/RisingBubble.cpp +++ b/apps/showcases/FreeSurface/RisingBubble.cpp @@ -117,9 +117,10 @@ class CenterOfMassComputer } mpi::allReduceInplace< uint_t >(cellCount, mpi::SUM); - mpi::allReduceInplace< cell_idx_t >(cellSum[0], mpi::SUM); - mpi::allReduceInplace< cell_idx_t >(cellSum[1], mpi::SUM); - mpi::allReduceInplace< cell_idx_t >(cellSum[2], mpi::SUM); + + Vector3< cell_idx_t > cellSumVector = + Vector3< cell_idx_t >(cellSum[0], cellSum[1], cellSum[2]); // use Vector3 to limit calls to MPI-reduce to one + mpi::allReduceInplace< cell_idx_t >(cellSumVector, mpi::SUM); (*centerOfMass_)[0] = real_c(cellSum[0]) / real_c(cellCount); (*centerOfMass_)[1] = real_c(cellSum[1]) / real_c(cellCount); diff --git a/apps/showcases/FreeSurface/TaylorBubble.cpp b/apps/showcases/FreeSurface/TaylorBubble.cpp index 3ec4eea3d58f64688d26d6a4d58c439eaeb962f9..04c6977c5410a49e8dab707215bb7ef8902242d8 100644 --- a/apps/showcases/FreeSurface/TaylorBubble.cpp +++ b/apps/showcases/FreeSurface/TaylorBubble.cpp @@ -118,9 +118,10 @@ class CenterOfMassComputer } mpi::allReduceInplace< uint_t >(cellCount, mpi::SUM); - mpi::allReduceInplace< cell_idx_t >(cellSum[0], mpi::SUM); - mpi::allReduceInplace< cell_idx_t >(cellSum[1], mpi::SUM); - mpi::allReduceInplace< cell_idx_t >(cellSum[2], mpi::SUM); + + Vector3< cell_idx_t > cellSumVector = + Vector3< cell_idx_t >(cellSum[0], cellSum[1], cellSum[2]); // use Vector3 to limit calls to MPI-reduce to one + mpi::allReduceInplace< cell_idx_t >(cellSumVector, mpi::SUM); (*centerOfMass_)[0] = real_c(cellSum[0]) / real_c(cellCount); (*centerOfMass_)[1] = real_c(cellSum[1]) / real_c(cellCount); diff --git a/apps/showcases/LightRisingParticleInFluidAMR/LightRisingParticleInFluidAMR.cpp b/apps/showcases/LightRisingParticleInFluidAMR/LightRisingParticleInFluidAMR.cpp index f15b333c99f0c4b0513c369c4ce0c3e95288b865..07df97e31851603d56b89da263f29570dfe91df4 100644 --- a/apps/showcases/LightRisingParticleInFluidAMR/LightRisingParticleInFluidAMR.cpp +++ b/apps/showcases/LightRisingParticleInFluidAMR/LightRisingParticleInFluidAMR.cpp @@ -345,25 +345,11 @@ public: } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace(transVel[0], mpi::SUM); - mpi::allReduceInplace(transVel[1], mpi::SUM); - mpi::allReduceInplace(transVel[2], mpi::SUM); - - mpi::allReduceInplace(angVel[0], mpi::SUM); - mpi::allReduceInplace(angVel[1], mpi::SUM); - mpi::allReduceInplace(angVel[2], mpi::SUM); - - mpi::allReduceInplace(hydForce[0], mpi::SUM); - mpi::allReduceInplace(hydForce[1], mpi::SUM); - mpi::allReduceInplace(hydForce[2], mpi::SUM); - - mpi::allReduceInplace(hydTorque[0], mpi::SUM); - mpi::allReduceInplace(hydTorque[1], mpi::SUM); - mpi::allReduceInplace(hydTorque[2], mpi::SUM); - - mpi::allReduceInplace(eulerRotation[0], mpi::SUM); - mpi::allReduceInplace(eulerRotation[1], mpi::SUM); - mpi::allReduceInplace(eulerRotation[2], mpi::SUM); + mpi::allReduceInplace(transVel, mpi::SUM); + mpi::allReduceInplace(angVel, mpi::SUM); + mpi::allReduceInplace(hydForce, mpi::SUM); + mpi::allReduceInplace(hydTorque, mpi::SUM); + mpi::allReduceInplace(eulerRotation, mpi::SUM); } syncPosition(); @@ -388,9 +374,7 @@ public: } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace(pos[0], mpi::SUM); - mpi::allReduceInplace(pos[1], mpi::SUM); - mpi::allReduceInplace(pos[2], mpi::SUM); + mpi::allReduceInplace(pos, mpi::SUM); } position_ = pos; diff --git a/apps/showcases/PorousMedia/PorousMedia.cpp b/apps/showcases/PorousMedia/PorousMedia.cpp index 5f6f60b8129319186b938eb2578aee80c893051f..823f2914ab4b01ea70d2cb7eb4c3607acc2ecbf2 100644 --- a/apps/showcases/PorousMedia/PorousMedia.cpp +++ b/apps/showcases/PorousMedia/PorousMedia.cpp @@ -313,19 +313,13 @@ class AvgDiffEvaluator // sum values among all processes mpi::allReduceInplace< uint_t >(numFluidCells, mpi::SUM); mpi::allReduceInplace< real_t >(avgDensity, mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocity[0], mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocity[1], mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocity[2], mpi::SUM); + mpi::allReduceInplace< real_t >(avgVelocity, mpi::SUM); mpi::allReduceInplace< real_t >(avgDensitySquared, mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocitySquared[0], mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocitySquared[1], mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocitySquared[2], mpi::SUM); + mpi::allReduceInplace< real_t >(avgVelocitySquared, mpi::SUM); mpi::allReduceInplace< real_t >(avgDensityDiffL2, mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocityDiffL2[0], mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocityDiffL2[1], mpi::SUM); - mpi::allReduceInplace< real_t >(avgVelocityDiffL2[2], mpi::SUM); + mpi::allReduceInplace< real_t >(avgVelocityDiffL2, mpi::SUM); // compute space-average avgDensity /= real_c(numFluidCells); diff --git a/apps/tutorials/lbm/02_BasicLBM_ExemplaryExtensions.cpp b/apps/tutorials/lbm/02_BasicLBM_ExemplaryExtensions.cpp index 120e964545d5007dffc9b5d0c937584025ac3309..b135758cd57b8214c40749b1b63a8c7dd0dc578b 100644 --- a/apps/tutorials/lbm/02_BasicLBM_ExemplaryExtensions.cpp +++ b/apps/tutorials/lbm/02_BasicLBM_ExemplaryExtensions.cpp @@ -380,9 +380,7 @@ public: } // The force is accumulated over all processes. The result is stored only on the root process. - mpi::reduceInplace( force[0], mpi::SUM ); - mpi::reduceInplace( force[1], mpi::SUM ); - mpi::reduceInplace( force[2], mpi::SUM ); + mpi::reduceInplace( force, mpi::SUM ); // The root process writes the accumulated force to file. WALBERLA_ROOT_SECTION() diff --git a/src/core/mpi/Reduce.h b/src/core/mpi/Reduce.h index 8f1b8e0f1e7b3a7d4b881d97654766f14981c3e5..5e9bb8220112ff4bff9c19a02e66cb3c2d801d46 100644 --- a/src/core/mpi/Reduce.h +++ b/src/core/mpi/Reduce.h @@ -1,15 +1,15 @@ //====================================================================================================================== // -// This file is part of waLBerla. waLBerla is free software: you can +// This file is part of waLBerla. waLBerla is free software: you can // redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of +// License as published by the Free Software Foundation, either version 3 of // the License, or (at your option) any later version. -// -// waLBerla is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// +// waLBerla is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License // for more details. -// +// // You should have received a copy of the GNU General Public License along // with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // @@ -29,6 +29,8 @@ #include "core/mpi/MPIManager.h" #include "core/mpi/MPIWrapper.h" +#include "core/math/Vector3.h" + #include <type_traits> #include <vector> @@ -102,7 +104,7 @@ void reduceInplace( T & value, Operation operation, int recvRank = 0, MPI_Comm c //====================================================================================================================== /*! * \brief Reduces a boolean value over all processes in-place - * + * * \param value The boolean value to be reduced * \param operation The operation to be performed (one of LOGICAL_AND, LOGICAL_OR or LOGICAL_XOR) * \param recvRank The rank of the process receiving the reduced value @@ -183,12 +185,12 @@ T reduce( const T value, Operation operation, int recvRank = 0, MPI_Comm comm = //====================================================================================================================== /*! * \brief Reduces a boolean value over all processes - * + * * \param value The boolean value to be reduced * \param operation The operation to be performed (one of LOGICAL_AND, LOGICAL_OR or LOGICAL_XOR) * \param recvRank The rank of the process receiving the reduced value * \param comm The MPI communicator used for communication - * + * * \returns The reduced boolean value on recvRank, false on all other ranks. */ //====================================================================================================================== @@ -238,7 +240,6 @@ template< typename T > void reduceInplace( std::vector<T> & values, Operation operation, int recvRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) { static_assert( std::is_arithmetic<T>::value, "reduceInplace(...) may only by called with integer or floating point types!" ); - static_assert( (!std::is_same<T, bool>::value), "reduceInplace(...) may not be called with std::vector<bool>!" ); WALBERLA_NON_MPI_SECTION() { @@ -263,9 +264,9 @@ void reduceInplace( std::vector<T> & values, Operation operation, int recvRank = //====================================================================================================================== /*! * \brief Reduces boolean values in a std::vector<bool> over all processes in-place - * + * * Specialization of reduceInplace<T> - * + * * \param values The boolean values to be reduced * \param operation The operation to be performed (one of BITWISE_AND, BITWISE_OR or BITWISE_XOR) * \param recvRank The rank of the process receiving the reduced values @@ -279,7 +280,7 @@ inline void reduceInplace( std::vector<bool> & values, Operation operation, int WALBERLA_NON_MPI_SECTION() { WALBERLA_ASSERT_EQUAL( recvRank, 0 ); - return; + return; } int myRank; @@ -303,6 +304,167 @@ inline void reduceInplace( std::vector<bool> & values, Operation operation, int } +/*! + * \brief Reduces values in a math::Vector3<T> over all processes in-place + * + * T has to be an integer or floating point value + * + * \param values The values to be reduced + * \param operation The operation to be performed + * \param recvRank The rank of the process receiving the reduced values + * \param comm The MPI communicator used for communication + */ +//====================================================================================================================== +template< typename T > +void reduceInplace( math::Vector3<T> & values, Operation operation, int recvRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) +{ + static_assert( std::is_arithmetic<T>::value, "reduceInplace(...) may only by called with integer or floating point types!" ); + + WALBERLA_NON_MPI_SECTION() + { + WALBERLA_ASSERT_EQUAL( recvRank, 0 ); + return; + } + + int myRank; + MPI_Comm_rank( comm, &myRank ); + + if( myRank == recvRank ) + { + MPI_Reduce( MPI_IN_PLACE, values.data(), 3, MPITrait<T>::type(), toMPI_Op(operation), recvRank, comm ); + } + else + { + MPI_Reduce( values.data(), nullptr, 3, MPITrait<T>::type(), toMPI_Op(operation), recvRank, comm ); + } +} + +/*! + * \brief Reduces booleans in a math::Vector3 over all processes in-place + * + * T has to be an integer or floating point value + * + * \param values The values to be reduced + * \param operation The operation to be performed + * \param recvRank The rank of the process receiving the reduced values + * \param comm The MPI communicator used for communication + */ +//====================================================================================================================== +inline void reduceInplace( math::Vector3<bool> & values, Operation operation, int recvRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) +{ + WALBERLA_ASSERT( operation == LOGICAL_AND || operation == LOGICAL_OR || operation == LOGICAL_XOR ); + + WALBERLA_NON_MPI_SECTION() + { + WALBERLA_ASSERT_EQUAL( recvRank, 0 ); + return; + } + + int myRank; + MPI_Comm_rank( comm, &myRank ); + + math::Vector3<int> intValues{values[0] ? 1 : 0, values[1] ? 1 : 0, values[2] ? 1 : 0}; + + if( myRank == recvRank ) + { + MPI_Reduce( MPI_IN_PLACE, intValues.data(), 3, MPITrait<int>::type(), toMPI_Op(operation), recvRank, comm ); + } + else + { + MPI_Reduce( intValues.data(), nullptr, 3, MPITrait<int>::type(), toMPI_Op(operation), recvRank, comm ); + } + + for(uint_t i = 0; i < 3; ++i) + values[i] = intValues[i] != 0; +} + + +//====================================================================================================================== +/*! + * \brief Reduces values in a math::Vector3<T> over all processes + * + * T has to be an integer or floating point value + * + * \param value The value to be reduced + * \param operation The operation to be performed + * \param recvRank The rank of the process receiving the reduced value + * \param comm The MPI communicator used for communication + * + * \returns The reduced value on recvRank, 0 on all other ranks. + */ +//====================================================================================================================== +template< typename T > +math::Vector3<T> reduce( const math::Vector3<T> & values, Operation operation, int recvRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) +{ + static_assert( std::is_arithmetic<T>::value, "reduce(...) may only by called with integer or floating point types!" ); + + WALBERLA_NON_MPI_SECTION() + { + WALBERLA_ASSERT_EQUAL( recvRank, 0 ); + return values; + } + + int myRank; + MPI_Comm_rank( comm, &myRank ); + + math::Vector3<T> result{T(0)}; + + if( myRank == recvRank ) + { + MPI_Reduce( const_cast<T*>( values.data() ), result.data(), 3, MPITrait<T>::type(), toMPI_Op(operation), recvRank, comm ); + } + else + { + MPI_Reduce( const_cast<T*>( values.data() ), nullptr, 3, MPITrait<T>::type(), toMPI_Op(operation), recvRank, comm ); + } + + return result; +} + +//====================================================================================================================== +/*! + * \brief Reduces boolean values in a Vector3 over all processes + * + * \param value The boolean value to be reduced + * \param operation The operation to be performed (one of LOGICAL_AND, LOGICAL_OR or LOGICAL_XOR) + * \param recvRank The rank of the process receiving the reduced value + * \param comm The MPI communicator used for communication + * + * \returns The reduced boolean value on recvRank, false on all other ranks. + */ +//====================================================================================================================== +inline math::Vector3<bool> reduce( const math::Vector3<bool> & values, Operation operation, int recvRank = 0, MPI_Comm comm = MPI_COMM_WORLD ) +{ + WALBERLA_ASSERT( operation == LOGICAL_AND || operation == LOGICAL_OR || operation == LOGICAL_XOR ); + + WALBERLA_NON_MPI_SECTION() + { + WALBERLA_ASSERT_EQUAL( recvRank, 0 ); + return values; + } + + int myRank; + MPI_Comm_rank( comm, &myRank ); + + math::Vector3<int> intValues{values[0] ? 1 : 0, values[1] ? 1 : 0, values[2] ? 1 : 0}; + + math::Vector3<bool> results(false); + + if( myRank == recvRank ) + { + MPI_Reduce( MPI_IN_PLACE, intValues.data(), 3, MPITrait<int>::type(), toMPI_Op(operation), recvRank, comm ); + + for(uint_t i = 0; i < 3; ++i) + results[i] = intValues[i] != 0; + } + else + { + MPI_Reduce( intValues.data(), nullptr, 3, MPITrait<int>::type(), toMPI_Op(operation), recvRank, comm ); + } + + return results; +} + //====================================================================================================================== /*! @@ -334,13 +496,13 @@ T allReduce( const T & value, Operation operation, MPI_Comm comm = MPI_COMM_WORL //====================================================================================================================== /*! * \brief Reduces a boolean value over all processes - * + * * T has to be a boolean value - * + * * \param value The boolean value to be reduced * \param operation The operation to be performed * \param comm The MPI communicator used for communication - * + * * \returns The reduced value on recvRank, 0 on all other ranks. */ //====================================================================================================================== @@ -384,9 +546,9 @@ void allReduceInplace( T & value, Operation operation, MPI_Comm comm = MPI_COMM_ //====================================================================================================================== /*! * \brief Reduces a boolean value over all processes in-place - * + * * T has to be a boolean value - * + * * \param value The boolean value to be reduced * \param operation The operation to be performed (one of LOGICAL_AND, LOGICAL_OR or LOGICAL_XOR) * \param comm The MPI communicator used for communication @@ -422,7 +584,6 @@ template< typename T > void allReduceInplace( std::vector<T> & values, Operation operation, MPI_Comm comm = MPI_COMM_WORLD ) { static_assert( std::is_arithmetic<T>::value, "allReduceInplace(...) may only by called with integer or floating point types!" ); - static_assert( (!std::is_same<T, bool>::value), "allReduceInplace(...) may not be called with std::vector<bool>!" ); WALBERLA_NON_MPI_SECTION() { return; } @@ -458,6 +619,57 @@ inline void allReduceInplace( std::vector<bool> & bools, Operation operation, MP } +//====================================================================================================================== +/*! + * \brief Reduces values in math::Vector3<T> over all processes in-place + * + * T has to be an integer or floating point value + * + * \param values The values to be reduced + * \param operation The operation to be performed + * \param comm The MPI communicator used for communication + */ +//====================================================================================================================== +template< typename T > +void allReduceInplace( math::Vector3<T> & values, Operation operation, MPI_Comm comm = MPI_COMM_WORLD ) +{ + static_assert( std::is_arithmetic<T>::value, "allReduceInplace(...) may only by called with integer or floating point types!" ); + + WALBERLA_NON_MPI_SECTION() { return; } + + MPI_Allreduce( MPI_IN_PLACE, values.data(), 3, MPITrait<T>::type(), toMPI_Op(operation), comm ); +} + + +//====================================================================================================================== +/*! + * \brief Reduces boolean values in math::Vector3 over all processes in-place + * + * T has to be an integer or floating point value + * + * \param values The values to be reduced + * \param operation The operation to be performed + * \param comm The MPI communicator used for communication + */ +//====================================================================================================================== +inline void allReduceInplace( math::Vector3<bool> & bools, Operation operation, MPI_Comm comm = MPI_COMM_WORLD ) +{ + WALBERLA_ASSERT( operation == LOGICAL_AND || operation == LOGICAL_OR || operation == LOGICAL_XOR ); + + WALBERLA_NON_MPI_SECTION() + { + return; + } + + math::Vector3<int> intValues{bools[0] ? 1 : 0, bools[1] ? 1 : 0, bools[2] ? 1 : 0}; + + MPI_Allreduce( MPI_IN_PLACE, intValues.data(), 3, MPITrait<int>::type(), toMPI_Op(operation), comm ); + + for(uint_t i = 0; i < 3; ++i) + { + bools[i] = intValues[i] != 0; + } +} } // namespace mpi } // namespace walberla diff --git a/src/lbm/free_surface/MaxVelocityComputer.h b/src/lbm/free_surface/MaxVelocityComputer.h index a3e2b0cb287e1a9ad427869047a0404eafd89ce1..7a5387e7e64c37c12a145550d523758f54888448 100644 --- a/src/lbm/free_surface/MaxVelocityComputer.h +++ b/src/lbm/free_surface/MaxVelocityComputer.h @@ -87,9 +87,7 @@ class MaxVelocityComputer }) // WALBERLA_FOR_ALL_CELLS_OMP } - mpi::allReduceInplace< real_t >(maxVelocity[0], mpi::MAX); - mpi::allReduceInplace< real_t >(maxVelocity[1], mpi::MAX); - mpi::allReduceInplace< real_t >(maxVelocity[2], mpi::MAX); + mpi::allReduceInplace< real_t >(maxVelocity, mpi::MAX); *maxVelocity_ = maxVelocity; }; diff --git a/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h b/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h index 38f62011908bc4c71049ed42377264509724df50..254293cffaaa33686d50767dad850db9be710c67 100644 --- a/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h +++ b/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h @@ -498,9 +498,7 @@ Vector3< bool > }) // WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ_OMP } - mpi::allReduceInplace(isObstacleInGlobalGhostLayer[0], mpi::LOGICAL_OR); - mpi::allReduceInplace(isObstacleInGlobalGhostLayer[1], mpi::LOGICAL_OR); - mpi::allReduceInplace(isObstacleInGlobalGhostLayer[2], mpi::LOGICAL_OR); + mpi::allReduceInplace(isObstacleInGlobalGhostLayer, mpi::LOGICAL_OR); return isObstacleInGlobalGhostLayer; } diff --git a/tests/core/mpi/ReduceTest.cpp b/tests/core/mpi/ReduceTest.cpp index 9093d63f36bf8a9880537ba5253655b94c439423..c7e7fed66ce2de4a3958b4deab5538011f975689 100644 --- a/tests/core/mpi/ReduceTest.cpp +++ b/tests/core/mpi/ReduceTest.cpp @@ -1,15 +1,15 @@ //====================================================================================================================== // -// This file is part of waLBerla. waLBerla is free software: you can +// This file is part of waLBerla. waLBerla is free software: you can // redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of +// License as published by the Free Software Foundation, either version 3 of // the License, or (at your option) any later version. -// -// waLBerla is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// +// waLBerla is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License // for more details. -// +// // You should have received a copy of the GNU General Public License along // with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // @@ -24,6 +24,7 @@ #include "core/mpi/MPIManager.h" #include "core/mpi/Reduce.h" #include "core/logging/Logging.h" +#include "core/math/Vector3.h" #include <limits> #include <vector> @@ -69,6 +70,36 @@ void runTestReduce( int recvRank ) WALBERLA_CHECK_EQUAL( value, rank ); } + + Vector3<int> intVec3{rank-1, rank, rank+1}; + auto resultIntVec3 = walberla::mpi::reduce( intVec3, walberla::mpi::SUM, recvRank ); + walberla::mpi::reduceInplace( intVec3, walberla::mpi::SUM, recvRank ); + if( rank == recvRank ) + { + int sum = 0; + for( int i = 0; i < numProcesses; ++i ) + sum += i; + + math::Vector3<int> refResultIntVec3 {sum - numProcesses, sum, sum + numProcesses}; + + for(uint_t i = 0; i < 3; ++i) + { + WALBERLA_CHECK_EQUAL( intVec3[i], refResultIntVec3[i], "Reduce Vector3, component " << i); + WALBERLA_CHECK_EQUAL( resultIntVec3[i], refResultIntVec3[i], "ReduceInPlace Vector3, component " << i); + } + + } + else + { + Vector3<int> refResultIntVec3{rank-1, rank, rank+1}; + for(uint_t i = 0; i < 3; ++i) + { + WALBERLA_CHECK_EQUAL( intVec3[i], refResultIntVec3[i], "Reduce Vector3, component " << i); + WALBERLA_CHECK_EQUAL( resultIntVec3[i], 0, "ReduceInPlace Vector3, component " << i); + } + } + + std::vector<int> some_ints( 100 ); for( int i = 0; i < 100; ++i ) some_ints[ uint_c(i) ] = rank + i; @@ -116,6 +147,16 @@ void runTestAllReduce() WALBERLA_CHECK_EQUAL( value, 0 ); + Vector3<int> intVec3{rank-1, rank, rank+1}; + walberla::mpi::allReduceInplace( intVec3, walberla::mpi::SUM ); + math::Vector3<int> refResultIntVec3 {sum - numProcesses, sum, sum + numProcesses}; + + for(uint_t i = 0; i < 3; ++i) + { + WALBERLA_CHECK_EQUAL( intVec3[i], refResultIntVec3[i], "AllReduce Vector3, component " << i); + } + + std::vector<int> some_ints( 100 ); for( int i = 0; i < 100; ++i ) some_ints[ uint_c(i) ] = rank + i; @@ -179,7 +220,7 @@ void runTestAllReduceBool() bool copyAllTrue = allTrue; bool copyAllFalse = allFalse; bool copyOneTrue = oneTrue; - bool copyMixed = mixed; + bool copyMixed = mixed; mpi::allReduceInplace( copyAllTrue, mpi::LOGICAL_OR ); mpi::allReduceInplace( copyAllFalse, mpi::LOGICAL_OR ); @@ -196,7 +237,7 @@ void runTestAllReduceBool() bool copyAllTrue = allTrue; bool copyAllFalse = allFalse; bool copyOneTrue = oneTrue; - bool copyMixed = mixed; + bool copyMixed = mixed; mpi::allReduceInplace( copyAllTrue, mpi::LOGICAL_XOR ); mpi::allReduceInplace( copyAllFalse, mpi::LOGICAL_XOR ); @@ -209,6 +250,35 @@ void runTestAllReduceBool() WALBERLA_CHECK_EQUAL( copyMixed, numProcesses == 2 ); } + + math::Vector3<bool> boolVec; + boolVec[0] = true; + boolVec[1] = false; + boolVec[2] = rank == 0; + + { + math::Vector3<bool> result( boolVec ); + mpi::allReduceInplace( result, mpi::LOGICAL_AND ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[0] ), true ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[1] ), false ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[2] ), numProcesses == 1 ); + } + { + math::Vector3<bool> result( boolVec ); + mpi::allReduceInplace( result, mpi::LOGICAL_OR ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[0] ), true ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[1] ), false ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[2] ), true ); + } + { + math::Vector3<bool> result( boolVec ); + mpi::allReduceInplace( result, mpi::LOGICAL_XOR ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[0] ), numProcesses == 1 ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[1] ), false ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[2] ), true ); + } + + std::vector<bool> bools( 4u ); bools[0] = true; bools[1] = false; @@ -348,7 +418,7 @@ void runTestReduceBool( int recvRank ) bool copyAllTrue = allTrue; bool copyAllFalse = allFalse; bool copyOneTrue = oneTrue; - bool copyMixed = mixed; + bool copyMixed = mixed; mpi::reduceInplace( copyAllTrue, mpi::LOGICAL_OR, recvRank ); mpi::reduceInplace( copyAllFalse, mpi::LOGICAL_OR, recvRank ); @@ -368,7 +438,7 @@ void runTestReduceBool( int recvRank ) bool copyAllTrue = allTrue; bool copyAllFalse = allFalse; bool copyOneTrue = oneTrue; - bool copyMixed = mixed; + bool copyMixed = mixed; mpi::reduceInplace( copyAllTrue, mpi::LOGICAL_XOR, recvRank ); mpi::reduceInplace( copyAllFalse, mpi::LOGICAL_XOR, recvRank ); @@ -384,6 +454,81 @@ void runTestReduceBool( int recvRank ) } } + math::Vector3<bool> boolVec; + boolVec[0] = true; + boolVec[1] = false; + boolVec[2] = rank == 0; + + { + math::Vector3<bool> result = mpi::reduce( boolVec, mpi::LOGICAL_AND, recvRank ); + if( rank == recvRank ) + { + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[0] ), true ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[1] ), false ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[2] ), numProcesses == 1 ); + } else + { + for(uint_t i = 0; i < 3; ++i) WALBERLA_CHECK_EQUAL( static_cast<bool>( result[i] ), false ); + } + } + { + math::Vector3<bool> result = mpi::reduce( boolVec, mpi::LOGICAL_OR, recvRank ); + if( rank == recvRank ) + { + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[0] ), true ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[1] ), false ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[2] ), true ); + } else + { + for(uint_t i = 0; i < 3; ++i) WALBERLA_CHECK_EQUAL( static_cast<bool>( result[i] ), false ); + } + } + { + math::Vector3< bool > result = mpi::reduce(boolVec, mpi::LOGICAL_XOR, recvRank); + if (rank == recvRank) + { + WALBERLA_CHECK_EQUAL(static_cast< bool >(result[0]), numProcesses == 1); + WALBERLA_CHECK_EQUAL(static_cast< bool >(result[1]), false); + WALBERLA_CHECK_EQUAL(static_cast< bool >(result[2]), true); + } else + { + for(uint_t i = 0; i < 3; ++i) WALBERLA_CHECK_EQUAL( static_cast<bool>( result[i] ), false ); + } + } + + { + math::Vector3<bool> result( boolVec ); + mpi::reduceInplace( result, mpi::LOGICAL_AND, recvRank ); + if( rank == recvRank ) + { + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[0] ), true ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[1] ), false ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[2] ), numProcesses == 1 ); + } + } + { + math::Vector3<bool> result( boolVec ); + mpi::reduceInplace( result, mpi::LOGICAL_OR, recvRank ); + + if( rank == recvRank ) + { + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[0] ), true ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[1] ), false ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[2] ), true ); + } + } + { + math::Vector3<bool> result( boolVec ); + mpi::reduceInplace( result, mpi::LOGICAL_XOR, recvRank ); + if( rank == recvRank ) + { + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[0] ), numProcesses == 1 ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[1] ), false ); + WALBERLA_CHECK_EQUAL( static_cast<bool>( result[2] ), true ); + } + } + + std::vector<bool> bools( 4u ); bools[0] = true; bools[1] = false; diff --git a/tests/lbm/boundary/BoundaryForce.cpp b/tests/lbm/boundary/BoundaryForce.cpp index 2182030d08dfc5d370949e680a4105cf782e9efe..430deec3522ffb66375ce552f2a9cd1e87846807 100644 --- a/tests/lbm/boundary/BoundaryForce.cpp +++ b/tests/lbm/boundary/BoundaryForce.cpp @@ -206,9 +206,7 @@ int main( int argc, char ** argv ) } Vector3<real_t> force(fx, fy, fz); - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); real_t visc = lbm::collision_model::viscosityFromOmega( omega ); Vector3<real_t> stokes = 6 * math::pi * visc * R * velocity; diff --git a/tests/lbm_mesapd_coupling/momentum_exchange_method/SettlingSphere.cpp b/tests/lbm_mesapd_coupling/momentum_exchange_method/SettlingSphere.cpp index 202601669557a91b5b8e2b2f26c8d0e36ffbccc3..602011cefdf119b4fa7d2505e30a6b10f6d23c96 100644 --- a/tests/lbm_mesapd_coupling/momentum_exchange_method/SettlingSphere.cpp +++ b/tests/lbm_mesapd_coupling/momentum_exchange_method/SettlingSphere.cpp @@ -213,17 +213,9 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); - - mpi::allReduceInplace( hydForce[0], mpi::SUM ); - mpi::allReduceInplace( hydForce[1], mpi::SUM ); - mpi::allReduceInplace( hydForce[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); + mpi::allReduceInplace( hydForce, mpi::SUM ); } position_ = pos[2]; diff --git a/tests/lbm_mesapd_coupling/partially_saturated_cells_method/SettlingSphere.cpp b/tests/lbm_mesapd_coupling/partially_saturated_cells_method/SettlingSphere.cpp index 7fb9d96b4e6ba220f6c5710eeaa7fd6d86a0b648..0964325f3cc154ccdf754348e9eac24c32789aa4 100644 --- a/tests/lbm_mesapd_coupling/partially_saturated_cells_method/SettlingSphere.cpp +++ b/tests/lbm_mesapd_coupling/partially_saturated_cells_method/SettlingSphere.cpp @@ -204,17 +204,9 @@ class SpherePropertyLogger WALBERLA_MPI_SECTION() { - mpi::allReduceInplace(pos[0], mpi::SUM); - mpi::allReduceInplace(pos[1], mpi::SUM); - mpi::allReduceInplace(pos[2], mpi::SUM); - - mpi::allReduceInplace(transVel[0], mpi::SUM); - mpi::allReduceInplace(transVel[1], mpi::SUM); - mpi::allReduceInplace(transVel[2], mpi::SUM); - - mpi::allReduceInplace(hydForce[0], mpi::SUM); - mpi::allReduceInplace(hydForce[1], mpi::SUM); - mpi::allReduceInplace(hydForce[2], mpi::SUM); + mpi::allReduceInplace(pos, mpi::SUM); + mpi::allReduceInplace(transVel, mpi::SUM); + mpi::allReduceInplace(hydForce, mpi::SUM); } position_ = pos[2]; diff --git a/tests/lbm_mesapd_coupling/utility/HydrodynamicForceOnMultipleBlocks.cpp b/tests/lbm_mesapd_coupling/utility/HydrodynamicForceOnMultipleBlocks.cpp index 7f0622dbb2650826d0d6b713c39bc2954a14e15a..a5a7888cc20da318c2cf3373aa345ce16b54eea7 100644 --- a/tests/lbm_mesapd_coupling/utility/HydrodynamicForceOnMultipleBlocks.cpp +++ b/tests/lbm_mesapd_coupling/utility/HydrodynamicForceOnMultipleBlocks.cpp @@ -85,25 +85,11 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); - - mpi::allReduceInplace( angularVel[0], mpi::SUM ); - mpi::allReduceInplace( angularVel[1], mpi::SUM ); - mpi::allReduceInplace( angularVel[2], mpi::SUM ); - - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); - - mpi::allReduceInplace( torque[0], mpi::SUM ); - mpi::allReduceInplace( torque[1], mpi::SUM ); - mpi::allReduceInplace( torque[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); + mpi::allReduceInplace( angularVel, mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); + mpi::allReduceInplace( torque, mpi::SUM ); } position_ = pos; diff --git a/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp b/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp index fb5fb03cdbf0c56352de123a5b4596ae31805d08..539cf5ed93b7b08a5a2743117c9d5ea875c81fbb 100644 --- a/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp +++ b/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp @@ -402,9 +402,7 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( velocity[0], mpi::SUM ); - mpi::allReduceInplace( velocity[1], mpi::SUM ); - mpi::allReduceInplace( velocity[2], mpi::SUM ); + mpi::allReduceInplace( velocity, mpi::SUM ); mpi::allReduceInplace( counter, mpi::SUM ); } @@ -433,9 +431,7 @@ private: } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); } return force; } @@ -452,9 +448,7 @@ private: } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); } return force; } @@ -504,9 +498,7 @@ Vector3<real_t> getGNSMeanFluidVelocity( const shared_ptr<StructuredBlockStorage } WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( velocity[0], mpi::SUM ); - mpi::allReduceInplace( velocity[1], mpi::SUM ); - mpi::allReduceInplace( velocity[2], mpi::SUM ); + mpi::allReduceInplace( velocity, mpi::SUM ); } return velocity / domainVolume; } diff --git a/tests/pe_coupling/discrete_particle_methods/SphereWallCollisionBehaviorDPM.cpp b/tests/pe_coupling/discrete_particle_methods/SphereWallCollisionBehaviorDPM.cpp index b6b545bef04cdc72d1f3b2bf7c1b910b3df79904..c86d7f1b8fb6b230a622b3c93b452b3d4ede7eda 100644 --- a/tests/pe_coupling/discrete_particle_methods/SphereWallCollisionBehaviorDPM.cpp +++ b/tests/pe_coupling/discrete_particle_methods/SphereWallCollisionBehaviorDPM.cpp @@ -353,10 +353,7 @@ private: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); - + mpi::allReduceInplace( force, mpi::SUM ); } return force; } @@ -374,10 +371,7 @@ private: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( velocity[0], mpi::SUM ); - mpi::allReduceInplace( velocity[1], mpi::SUM ); - mpi::allReduceInplace( velocity[2], mpi::SUM ); - + mpi::allReduceInplace( velocity, mpi::SUM ); } return velocity; @@ -398,9 +392,7 @@ private: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( position[0], mpi::SUM ); - mpi::allReduceInplace( position[1], mpi::SUM ); - mpi::allReduceInplace( position[2], mpi::SUM ); + mpi::allReduceInplace( position, mpi::SUM ); mpi::allReduceInplace( counter, mpi::SUM ); } diff --git a/tests/pe_coupling/momentum_exchange_method/LubricationCorrectionMEM.cpp b/tests/pe_coupling/momentum_exchange_method/LubricationCorrectionMEM.cpp index be0d9c4d369d0105fab22a2f2e2df053ed5d5b87..657eae0b75e24e80872f90862ce41949e00728e6 100644 --- a/tests/pe_coupling/momentum_exchange_method/LubricationCorrectionMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/LubricationCorrectionMEM.cpp @@ -218,12 +218,8 @@ private: // MPI reduction of pe forces over all processes WALBERLA_MPI_SECTION() { - mpi::reduceInplace( forceSphr1[0], mpi::SUM ); - mpi::reduceInplace( forceSphr1[1], mpi::SUM ); - mpi::reduceInplace( forceSphr1[2], mpi::SUM ); - mpi::reduceInplace( forceSphr2[0], mpi::SUM ); - mpi::reduceInplace( forceSphr2[1], mpi::SUM ); - mpi::reduceInplace( forceSphr2[2], mpi::SUM ); + mpi::reduceInplace( forceSphr1, mpi::SUM ); + mpi::reduceInplace( forceSphr2, mpi::SUM ); } WALBERLA_LOG_INFO_ON_ROOT("Total force on sphere " << id1_ << " : " << forceSphr1); WALBERLA_LOG_INFO_ON_ROOT("Total force on sphere " << id2_ << " : " << forceSphr2); @@ -330,9 +326,7 @@ private: // MPI reduction of pe forces over all processes WALBERLA_MPI_SECTION() { - mpi::reduceInplace( forceSphr1[0], mpi::SUM ); - mpi::reduceInplace( forceSphr1[1], mpi::SUM ); - mpi::reduceInplace( forceSphr1[2], mpi::SUM ); + mpi::reduceInplace( forceSphr1, mpi::SUM ); } WALBERLA_LOG_INFO_ON_ROOT("Total force on sphere " << id1_ << " : " << forceSphr1); diff --git a/tests/pe_coupling/momentum_exchange_method/SegreSilberbergMEM.cpp b/tests/pe_coupling/momentum_exchange_method/SegreSilberbergMEM.cpp index 9fb1b7c8db61bf27ef1dfb754987f55701be70f1..91d0dbc0132ee6f227e9a6b21d85056a76095225 100644 --- a/tests/pe_coupling/momentum_exchange_method/SegreSilberbergMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SegreSilberbergMEM.cpp @@ -320,13 +320,8 @@ class SteadyStateCheck WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); } // update position values diff --git a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEM.cpp b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEM.cpp index 6b2d0c5517f533c0be3b47c03b1129f90fe42c4b..706422bc5c2f1ad9650e38f03e7fbd7b867efa17 100644 --- a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEM.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEM.cpp @@ -211,21 +211,10 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); - - mpi::allReduceInplace( force[0], mpi::SUM ); - mpi::allReduceInplace( force[1], mpi::SUM ); - mpi::allReduceInplace( force[2], mpi::SUM ); - - mpi::allReduceInplace( fluidMomentum[0], mpi::SUM ); - mpi::allReduceInplace( fluidMomentum[1], mpi::SUM ); - mpi::allReduceInplace( fluidMomentum[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); + mpi::allReduceInplace( force, mpi::SUM ); + mpi::allReduceInplace( fluidMomentum, mpi::SUM ); } position_ = pos[2]; diff --git a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp index 5bcb1a9efe4e9e39156c2546e03682d4e79e89dc..47ccab5830f68c84dd98ee3f63685b61f7a5ea1f 100644 --- a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp @@ -300,13 +300,8 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); } position_ = pos[2]; diff --git a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMStaticRefinement.cpp b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMStaticRefinement.cpp index 84fcc93be0798cfd92cd3726161ccd76e73b76fe..d3952bab9e975d3584c40acfeeba394af28bb07f 100644 --- a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMStaticRefinement.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMStaticRefinement.cpp @@ -286,13 +286,8 @@ public: WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); } position_ = pos[2]; diff --git a/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp b/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp index e94410757e8c5e6a82cd7a9ab51d96da9c43d31a..5b256da44a5294bb473cb0b3f092d7e8725359af 100644 --- a/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp +++ b/tests/pe_coupling/partially_saturated_cells_method/SegreSilberbergPSM.cpp @@ -292,13 +292,8 @@ class SteadyStateCheck WALBERLA_MPI_SECTION() { - mpi::allReduceInplace( pos[0], mpi::SUM ); - mpi::allReduceInplace( pos[1], mpi::SUM ); - mpi::allReduceInplace( pos[2], mpi::SUM ); - - mpi::allReduceInplace( transVel[0], mpi::SUM ); - mpi::allReduceInplace( transVel[1], mpi::SUM ); - mpi::allReduceInplace( transVel[2], mpi::SUM ); + mpi::allReduceInplace( pos, mpi::SUM ); + mpi::allReduceInplace( transVel, mpi::SUM ); } // update position values diff --git a/tests/pe_coupling/utility/BodiesForceTorqueContainerTest.cpp b/tests/pe_coupling/utility/BodiesForceTorqueContainerTest.cpp index 528bd5e54f82d2cac99f5b28423c9694f54b3705..67ff74279476b1854114df6ba5b94a5e5e33f081 100644 --- a/tests/pe_coupling/utility/BodiesForceTorqueContainerTest.cpp +++ b/tests/pe_coupling/utility/BodiesForceTorqueContainerTest.cpp @@ -159,13 +159,8 @@ int main( int argc, char **argv ) } } - mpi::allReduceInplace(actingForce[0], mpi::SUM); - mpi::allReduceInplace(actingForce[1], mpi::SUM); - mpi::allReduceInplace(actingForce[2], mpi::SUM); - - mpi::allReduceInplace(actingTorque[0], mpi::SUM); - mpi::allReduceInplace(actingTorque[1], mpi::SUM); - mpi::allReduceInplace(actingTorque[2], mpi::SUM); + mpi::allReduceInplace(actingForce, mpi::SUM); + mpi::allReduceInplace(actingTorque, mpi::SUM); WALBERLA_ROOT_SECTION() { @@ -244,13 +239,8 @@ int main( int argc, char **argv ) } } - mpi::allReduceInplace(actingForce[0], mpi::SUM); - mpi::allReduceInplace(actingForce[1], mpi::SUM); - mpi::allReduceInplace(actingForce[2], mpi::SUM); - - mpi::allReduceInplace(actingTorque[0], mpi::SUM); - mpi::allReduceInplace(actingTorque[1], mpi::SUM); - mpi::allReduceInplace(actingTorque[2], mpi::SUM); + mpi::allReduceInplace(actingForce, mpi::SUM); + mpi::allReduceInplace(actingTorque, mpi::SUM); WALBERLA_ROOT_SECTION() { @@ -336,13 +326,8 @@ int main( int argc, char **argv ) } } - mpi::allReduceInplace(actingForce[0], mpi::SUM); - mpi::allReduceInplace(actingForce[1], mpi::SUM); - mpi::allReduceInplace(actingForce[2], mpi::SUM); - - mpi::allReduceInplace(actingTorque[0], mpi::SUM); - mpi::allReduceInplace(actingTorque[1], mpi::SUM); - mpi::allReduceInplace(actingTorque[2], mpi::SUM); + mpi::allReduceInplace(actingForce, mpi::SUM); + mpi::allReduceInplace(actingTorque, mpi::SUM); WALBERLA_ROOT_SECTION() { @@ -440,13 +425,8 @@ int main( int argc, char **argv ) } } - mpi::allReduceInplace(actingForce[0], mpi::SUM); - mpi::allReduceInplace(actingForce[1], mpi::SUM); - mpi::allReduceInplace(actingForce[2], mpi::SUM); - - mpi::allReduceInplace(actingTorque[0], mpi::SUM); - mpi::allReduceInplace(actingTorque[1], mpi::SUM); - mpi::allReduceInplace(actingTorque[2], mpi::SUM); + mpi::allReduceInplace(actingForce, mpi::SUM); + mpi::allReduceInplace(actingTorque, mpi::SUM); WALBERLA_ROOT_SECTION() { diff --git a/tests/pe_coupling/utility/PeSubCyclingTest.cpp b/tests/pe_coupling/utility/PeSubCyclingTest.cpp index 4e6a9f9c621a9e9512be8ab7d77b6b3522ce4285..6bd7dcfe364ff58f1d57d573b6350a068fd4a19b 100644 --- a/tests/pe_coupling/utility/PeSubCyclingTest.cpp +++ b/tests/pe_coupling/utility/PeSubCyclingTest.cpp @@ -152,15 +152,9 @@ int main( int argc, char **argv ) } } - mpi::allReduceInplace(expectedPosOffset[0], mpi::SUM); - mpi::allReduceInplace(expectedPosOffset[1], mpi::SUM); - mpi::allReduceInplace(expectedPosOffset[2], mpi::SUM); - mpi::allReduceInplace(expectedLinearVel[0], mpi::SUM); - mpi::allReduceInplace(expectedLinearVel[1], mpi::SUM); - mpi::allReduceInplace(expectedLinearVel[2], mpi::SUM); - mpi::allReduceInplace(expectedAngularVel[0], mpi::SUM); - mpi::allReduceInplace(expectedAngularVel[1], mpi::SUM); - mpi::allReduceInplace(expectedAngularVel[2], mpi::SUM); + mpi::allReduceInplace(expectedPosOffset, mpi::SUM); + mpi::allReduceInplace(expectedLinearVel, mpi::SUM); + mpi::allReduceInplace(expectedAngularVel, mpi::SUM); WALBERLA_LOG_DEVEL_ON_ROOT(" - expecting position offset: " << expectedPosOffset); WALBERLA_LOG_DEVEL_ON_ROOT(" - expecting linear vel: " << expectedLinearVel);