From 2194187dcd3ff8ea092675772f278ed2c9504b44 Mon Sep 17 00:00:00 2001
From: Martin Bauer <martin.bauer@fau.de>
Date: Tue, 28 May 2019 10:03:37 +0200
Subject: [PATCH] Added option to disable local communication to buffered
 communication scheme

option is intended for benchmarking, for production runs leave the
local communication optimization switched on
---
 src/blockforest/communication/LocalCommunicationMode.h | 2 +-
 src/blockforest/communication/UniformBufferedScheme.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/blockforest/communication/LocalCommunicationMode.h b/src/blockforest/communication/LocalCommunicationMode.h
index e4e259452..0d943452b 100644
--- a/src/blockforest/communication/LocalCommunicationMode.h
+++ b/src/blockforest/communication/LocalCommunicationMode.h
@@ -25,7 +25,7 @@ namespace walberla {
 namespace blockforest {
 
 
-enum LocalCommunicationMode { START = 0, WAIT = 1, BUFFER = 2 };
+enum LocalCommunicationMode { START = 0, WAIT = 1, BUFFER = 2, NO_OPTIMIZATION = 3 };
 
 
 } // namespace blockforest
diff --git a/src/blockforest/communication/UniformBufferedScheme.h b/src/blockforest/communication/UniformBufferedScheme.h
index c16a9146d..93216ef8c 100644
--- a/src/blockforest/communication/UniformBufferedScheme.h
+++ b/src/blockforest/communication/UniformBufferedScheme.h
@@ -306,7 +306,7 @@ void UniformBufferedScheme<Stencil>::startCommunication()
             if( !selectable::isSetSelected( block->getNeighborState( neighborIdx, uint_t(0) ), requiredBlockSelectors_, incompatibleBlockSelectors_ ) )
                continue;
 
-            if( block->neighborExistsLocally( neighborIdx, uint_t(0) ) )
+            if( block->neighborExistsLocally( neighborIdx, uint_t(0) ) && localMode_ != NO_OPTIMIZATION )
             {
                auto neighbor = dynamic_cast< Block * >( forest->getBlock(nBlockId) );
                WALBERLA_ASSERT_EQUAL( neighbor->getProcess(), block->getProcess() );
-- 
GitLab