From 0e7a8770b46c93d6a709d1f88b18bf739b49f03b Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 7 May 2013 10:58:04 +0100 Subject: [PATCH] BUG: IOdictionary: account for communicator in OPstream call --- .../IOobjects/IOdictionary/IOdictionaryIO.C | 2 + src/OpenFOAM/db/regIOobject/regIOobjectRead.C | 2 + .../processorCyclicPointPatchField.C | 9 +++-- .../processor/processorPointPatch.H | 8 +++- .../constraint/processor/processorPolyPatch.H | 38 +++---------------- 5 files changed, 23 insertions(+), 36 deletions(-) diff --git a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C index bd5c4cc598..d18a0e2934 100644 --- a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C +++ b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C @@ -105,6 +105,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly) myComm.above(), 0, Pstream::msgType(), + Pstream::worldComm, IOstream::ASCII ); IOdictionary::readData(fromAbove); @@ -124,6 +125,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly) myComm.below()[belowI], 0, Pstream::msgType(), + Pstream::worldComm, IOstream::ASCII ); IOdictionary::writeData(toBelow); diff --git a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C index 91827479a4..bc950e518f 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C +++ b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C @@ -243,6 +243,7 @@ bool Foam::regIOobject::read() myComm.above(), 0, Pstream::msgType(), + Pstream::worldComm, IOstream::ASCII ); ok = readData(fromAbove); @@ -257,6 +258,7 @@ bool Foam::regIOobject::read() myComm.below()[belowI], 0, Pstream::msgType(), + Pstream::worldComm, IOstream::ASCII ); writeData(toBelow); diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C index 6bea99a1bc..74707a9a93 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C @@ -122,7 +122,8 @@ void Foam::processorCyclicPointPatchField::initSwapAddSeparated procPatch_.neighbProcNo(), reinterpret_cast(receiveBuf_.begin()), receiveBuf_.byteSize(), - procPatch_.tag() + procPatch_.tag(), + procPatch_.comm() ); } OPstream::write @@ -131,7 +132,8 @@ void Foam::processorCyclicPointPatchField::initSwapAddSeparated procPatch_.neighbProcNo(), reinterpret_cast(pf.begin()), pf.byteSize(), - procPatch_.tag() + procPatch_.tag(), + procPatch_.comm() ); } } @@ -156,7 +158,8 @@ void Foam::processorCyclicPointPatchField::swapAddSeparated procPatch_.neighbProcNo(), reinterpret_cast(receiveBuf_.begin()), receiveBuf_.byteSize(), - procPatch_.tag() + procPatch_.tag(), + procPatch_.comm() ); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.H index 992a5b0c24..da777d683c 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,6 +134,12 @@ public: return procPolyPatch_.tag(); } + //- Return communicator used for communication + virtual label comm() const + { + return procPolyPatch_.comm(); + } + //- Return the constraint type this pointPatch implements. virtual const word& constraintType() const { diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H index 3bd72a7cf2..c5a6226dc8 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H @@ -246,14 +246,6 @@ public: } } - - //- Return communicator used for communication - label comm() const - { - //return comm_; - return boundaryMesh().mesh().comm(); - } - //- Return processor number int myProcNo() const { @@ -266,30 +258,6 @@ public: return neighbProcNo_; } - - // For testing - -// //- Return communicator used for communication -// label& comm() -// { -// return comm_; -// } - - //- Return processor number - int& myProcNo() - { - return myProcNo_; - } - - //- Return neigbour processor number - int& neighbProcNo() - { - return neighbProcNo_; - } - - - - //- Does the processor own the patch ? virtual bool owner() const { @@ -332,6 +300,12 @@ public: return Pstream::msgType(); } + //- Return communicator used for communication + virtual label comm() const + { + return boundaryMesh().mesh().comm(); + } + //- Transform a patch-based position from other side to this side virtual void transformPosition(pointField& l) const {}