From a2180b7a17788e22bb386c2ce415a1aecabc4954 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 11 Oct 2016 10:03:50 +0100 Subject: [PATCH] Improved checking on optimised reduce with comms --- .../db/IOstreams/Pstreams/PstreamReduceOps.C | 333 +++++++++++++++--- 1 file changed, 291 insertions(+), 42 deletions(-) diff --git a/src/foam/db/IOstreams/Pstreams/PstreamReduceOps.C b/src/foam/db/IOstreams/Pstreams/PstreamReduceOps.C index f78bd0b38..28d93e559 100644 --- a/src/foam/db/IOstreams/Pstreams/PstreamReduceOps.C +++ b/src/foam/db/IOstreams/Pstreams/PstreamReduceOps.C @@ -68,6 +68,25 @@ void Foam::reduce error::printStack(Pout); } +# ifdef FULLDEBUG + // Check for processors that are not in the communicator + if (Pstream::myProcNo(comm) == -1) + { + FatalErrorIn + ( + "void Foam::reduce\n" + "(\n" + " bool& Value,\n" + " const andOp& bop,\n" + " const int tag,\n" + " const label comm\n" + ")" + ) << "Reduce called on the processor which is not a member " + << "of comm. This is not allowed" + << abort(FatalError); + } +# endif + // Note: C++ bool is a type separate from C and cannot be cast // For safety and compatibility with compilers, convert bool to int // to comply with MPI types. HJ, 23/Sep/2016 @@ -108,6 +127,25 @@ void Foam::reduce error::printStack(Pout); } +# ifdef FULLDEBUG + // Check for processors that are not in the communicator + if (Pstream::myProcNo(comm) == -1) + { + FatalErrorIn + ( + "void Foam::reduce\n" + "(\n" + " bool& Value,\n" + " const orOp& bop,\n" + " const int tag,\n" + " const label comm\n" + ")" + ) << "Reduce called on the processor which is not a member " + << "of comm. This is not allowed" + << abort(FatalError); + } +# endif + // Note: C++ bool is a type separate from C and cannot be cast // For safety and compatibility with compilers, convert bool to int // to comply with MPI types. HJ, 23/Sep/2016 @@ -148,6 +186,25 @@ void Foam::reduce error::printStack(Pout); } +# ifdef FULLDEBUG + // Check for processors that are not in the communicator + if (Pstream::myProcNo(comm) == -1) + { + FatalErrorIn + ( + "void Foam::reduce\n" + "(\n" + " label& Value,\n" + " const minOp