From 096fd72ff6f38627c09615e3e4a94bf6104cccb9 Mon Sep 17 00:00:00 2001
From: Christoph Rettinger <christoph.rettinger@fau.de>
Date: Thu, 4 Jun 2020 14:01:01 +0200
Subject: [PATCH] Some fixes in the MSHS benchmark case for parallel execution

---
 .../MotionSingleHeavySphere/MotionSingleHeavySphere.cpp    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp b/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp
index bdc421e6d..efeb8186e 100644
--- a/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp
+++ b/apps/benchmarks/MotionSingleHeavySphere/MotionSingleHeavySphere.cpp
@@ -786,26 +786,27 @@ int main( int argc, char **argv )
    ///////////////////////////
    const int numProcs = MPIManager::instance()->numProcesses();
 
-   WALBERLA_CHECK(numProcs % 16 != 0, "An integer multiple of 16 MPI ranks has to be used due to horizontal periodicity and domain decomposition requirements!");
 
    uint_t XBlocks;
    uint_t YBlocks;
    uint_t ZBlocks;
-   if( numProcs >= 192 )
+   if( numProcs > 192 )
    {
       XBlocks = uint_t(6);
       YBlocks = uint_t(6);
       ZBlocks = uint_c(numProcs) / ( XBlocks * YBlocks );
+      WALBERLA_CHECK(numProcs % 36 == 0, "An integer multiple of 36 MPI ranks has to be used due to horizontal periodicity and domain partitioning requirements!");
    } else {
       XBlocks = uint_t(4);
       YBlocks = uint_t(4);
       ZBlocks = uint_c(MPIManager::instance()->numProcesses()) / ( XBlocks * YBlocks );
+      WALBERLA_CHECK(numProcs % 16 == 0, "An integer multiple of 16 MPI ranks has to be used due to horizontal periodicity and domain partitioning requirements!");
    }
    const uint_t XCells = xlength / XBlocks;
    const uint_t YCells = ylength / YBlocks;
    const uint_t ZCells = zlength / ZBlocks;
 
-   if( (xlength != XCells * XBlocks) && (ylength != YCells * YBlocks) && (zlength != ZCells * ZBlocks) )
+   if( (xlength != XCells * XBlocks) || (ylength != YCells * YBlocks) || (zlength != ZCells * ZBlocks) )
    {
       WALBERLA_ABORT("Domain decomposition does not fit to total domain size!");
    }
-- 
GitLab