BUG: IOdictionary: account for communicator in OPstream call

This commit is contained in:
mattijs
2013-05-07 10:58:04 +01:00
parent 9e60647c42
commit 0e7a8770b4
5 changed files with 23 additions and 36 deletions

View File

@ -105,6 +105,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
myComm.above(), myComm.above(),
0, 0,
Pstream::msgType(), Pstream::msgType(),
Pstream::worldComm,
IOstream::ASCII IOstream::ASCII
); );
IOdictionary::readData(fromAbove); IOdictionary::readData(fromAbove);
@ -124,6 +125,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
myComm.below()[belowI], myComm.below()[belowI],
0, 0,
Pstream::msgType(), Pstream::msgType(),
Pstream::worldComm,
IOstream::ASCII IOstream::ASCII
); );
IOdictionary::writeData(toBelow); IOdictionary::writeData(toBelow);

View File

@ -243,6 +243,7 @@ bool Foam::regIOobject::read()
myComm.above(), myComm.above(),
0, 0,
Pstream::msgType(), Pstream::msgType(),
Pstream::worldComm,
IOstream::ASCII IOstream::ASCII
); );
ok = readData(fromAbove); ok = readData(fromAbove);
@ -257,6 +258,7 @@ bool Foam::regIOobject::read()
myComm.below()[belowI], myComm.below()[belowI],
0, 0,
Pstream::msgType(), Pstream::msgType(),
Pstream::worldComm,
IOstream::ASCII IOstream::ASCII
); );
writeData(toBelow); writeData(toBelow);

View File

@ -122,7 +122,8 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
procPatch_.neighbProcNo(), procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()), reinterpret_cast<char*>(receiveBuf_.begin()),
receiveBuf_.byteSize(), receiveBuf_.byteSize(),
procPatch_.tag() procPatch_.tag(),
procPatch_.comm()
); );
} }
OPstream::write OPstream::write
@ -131,7 +132,8 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
procPatch_.neighbProcNo(), procPatch_.neighbProcNo(),
reinterpret_cast<const char*>(pf.begin()), reinterpret_cast<const char*>(pf.begin()),
pf.byteSize(), pf.byteSize(),
procPatch_.tag() procPatch_.tag(),
procPatch_.comm()
); );
} }
} }
@ -156,7 +158,8 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
procPatch_.neighbProcNo(), procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()), reinterpret_cast<char*>(receiveBuf_.begin()),
receiveBuf_.byteSize(), receiveBuf_.byteSize(),
procPatch_.tag() procPatch_.tag(),
procPatch_.comm()
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -134,6 +134,12 @@ public:
return procPolyPatch_.tag(); return procPolyPatch_.tag();
} }
//- Return communicator used for communication
virtual label comm() const
{
return procPolyPatch_.comm();
}
//- Return the constraint type this pointPatch implements. //- Return the constraint type this pointPatch implements.
virtual const word& constraintType() const virtual const word& constraintType() const
{ {

View File

@ -246,14 +246,6 @@ public:
} }
} }
//- Return communicator used for communication
label comm() const
{
//return comm_;
return boundaryMesh().mesh().comm();
}
//- Return processor number //- Return processor number
int myProcNo() const int myProcNo() const
{ {
@ -266,30 +258,6 @@ public:
return neighbProcNo_; 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 ? //- Does the processor own the patch ?
virtual bool owner() const virtual bool owner() const
{ {
@ -332,6 +300,12 @@ public:
return Pstream::msgType(); 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 //- Transform a patch-based position from other side to this side
virtual void transformPosition(pointField& l) const virtual void transformPosition(pointField& l) const
{} {}