diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake index 0b81eda108..eb51ef379e 100755 --- a/src/Pstream/Allwmake +++ b/src/Pstream/Allwmake @@ -6,6 +6,10 @@ wmake libso dummy case "$WM_MPLIB" in LAM | OPENMPI | MPI | MPICH | MPICH-GM | MPIGAMMA ) export WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB + set +x + echo + echo "Note: ignore spurious warnings about missing mpicxx.h headers" + set -x wmake libso mpi ;; diff --git a/src/Pstream/dummy/IPread.C b/src/Pstream/dummy/IPread.C index dd28fd7fef..fd4ed46e0f 100644 --- a/src/Pstream/dummy/IPread.C +++ b/src/Pstream/dummy/IPread.C @@ -32,12 +32,9 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // -IPstream::IPstream +Foam::IPstream::IPstream ( const commsTypes commsType, const int fromProcNo, @@ -53,13 +50,12 @@ IPstream::IPstream { notImplemented ( - "IPstream::IPstream" + "IPsream::IPstream" "(" - "const commsTypes commsType," - "const int fromProcNo," + "const commsTypes," + "const int fromProcNo," "const label bufSize," - "streamFormat format," - "versionNumber version" + "streamFormat, versionNumber" ")" ); } @@ -67,7 +63,7 @@ IPstream::IPstream // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -int IPstream::read +int Foam::IPstream::read ( const commsTypes commsType, const int fromProcNo, @@ -75,33 +71,32 @@ int IPstream::read const std::streamsize bufSize ) { - notImplemented - ( - "IPstream::read" - "(" - "const commsTypes commsType," - "const int fromProcNo," - "char* buf," - "const label bufSize" - ")" + notImplemented + ( + "IPstream::read" + "(" + "const commsTypes," + "const int fromProcNo," + "char* buf," + "const label bufSize" + ")" ); return 0; } -void IPstream::waitRequests() +void Foam::IPstream::waitRequests() {} -bool IPstream::finishedRequest(const label) +bool Foam::IPstream::finishedRequest(const label) { - notImplemented("IPstream::finishedRequest()"); + notImplemented("IPstream::finishedRequest()"); + return false; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam - // ************************************************************************* // diff --git a/src/Pstream/dummy/OPwrite.C b/src/Pstream/dummy/OPwrite.C index 7166a1ad45..d87f22d769 100644 --- a/src/Pstream/dummy/OPwrite.C +++ b/src/Pstream/dummy/OPwrite.C @@ -32,12 +32,9 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -OPstream::~OPstream() +Foam::OPstream::~OPstream() { notImplemented("OPstream::~OPstream()"); } @@ -45,7 +42,7 @@ OPstream::~OPstream() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool OPstream::write +bool Foam::OPstream::write ( const commsTypes commsType, const int toProcNo, @@ -68,11 +65,11 @@ bool OPstream::write } -void OPstream::waitRequests() +void Foam::OPstream::waitRequests() {} -bool OPstream::finishedRequest(const label) +bool Foam::OPstream::finishedRequest(const label) { notImplemented("OPstream::finishedRequest()"); return false; @@ -81,6 +78,4 @@ bool OPstream::finishedRequest(const label) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam - // ************************************************************************* // diff --git a/src/Pstream/dummy/Pstream.C b/src/Pstream/dummy/Pstream.C index 22adbe6cf2..3b1e9752f5 100644 --- a/src/Pstream/dummy/Pstream.C +++ b/src/Pstream/dummy/Pstream.C @@ -29,16 +29,13 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void Pstream::addValidParOptions(HashTable& validParOptions) +void Foam::Pstream::addValidParOptions(HashTable& validParOptions) {} -bool Pstream::init(int& argc, char**& argv) +bool Foam::Pstream::init(int& argc, char**& argv) { FatalErrorIn("Pstream::init(int& argc, char**& argv)") << "Trying to use the dummy Pstream library." << nl @@ -49,24 +46,21 @@ bool Pstream::init(int& argc, char**& argv) } -void Pstream::exit(int errnum) +void Foam::Pstream::exit(int errnum) { notImplemented("Pstream::exit(int errnum)"); } -void Pstream::abort() +void Foam::Pstream::abort() { notImplemented("Pstream::abort()"); } -void reduce(scalar&, const sumOp&) +void Foam::reduce(scalar&, const sumOp&) {} - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam - // ************************************************************************* // diff --git a/src/Pstream/gamma/OPwrite.C b/src/Pstream/gamma/OPwrite.C index ca96d1a172..3d1529e4bf 100644 --- a/src/Pstream/gamma/OPwrite.C +++ b/src/Pstream/gamma/OPwrite.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Write primitive and binary block from OPstream + Write primitive and binary block from OPstream gamma-mpi \*---------------------------------------------------------------------------*/ @@ -46,8 +46,10 @@ namespace Foam // Largest message sent so far. This tracks the size of the receive // buffer on the receiving end. Done so we only send out resize messages -// if nessecary +// if necessary +//! @cond fileScope labelList maxSendSize; +//! @endcond fileScope // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // diff --git a/src/Pstream/gamma/PstreamGlobals.H b/src/Pstream/gamma/PstreamGlobals.H index 9d0807a9b1..58941c80be 100644 --- a/src/Pstream/gamma/PstreamGlobals.H +++ b/src/Pstream/gamma/PstreamGlobals.H @@ -26,7 +26,8 @@ Namespace Foam::PstreamGlobals Description - Global functions and variables for working with parallel streams. + Global functions and variables for working with parallel streams, + but principally for gamma/mpi SourceFiles PstreamGlobals.C diff --git a/src/Pstream/mpi/IPread.C b/src/Pstream/mpi/IPread.C index 7423dd6b43..f00f322bab 100644 --- a/src/Pstream/mpi/IPread.C +++ b/src/Pstream/mpi/IPread.C @@ -33,18 +33,16 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // Outstanding non-blocking operations. -DynamicList IPstream_outstandingRequests_; - +//! @cond fileScope +Foam::DynamicList IPstream_outstandingRequests_; +//! @endcond fileScope // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // -IPstream::IPstream +Foam::IPstream::IPstream ( const commsTypes commsType, const int fromProcNo, @@ -89,7 +87,7 @@ IPstream::IPstream // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -label IPstream::read +Foam::label Foam::IPstream::read ( const commsTypes commsType, const int fromProcNo, @@ -192,7 +190,7 @@ label IPstream::read } -void IPstream::waitRequests() +void Foam::IPstream::waitRequests() { if (IPstream_outstandingRequests_.size() > 0) { @@ -219,7 +217,7 @@ void IPstream::waitRequests() } -bool IPstream::finishedRequest(const label i) +bool Foam::IPstream::finishedRequest(const label i) { if (i >= IPstream_outstandingRequests_.size()) { @@ -244,6 +242,4 @@ bool IPstream::finishedRequest(const label i) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam - // ************************************************************************* // diff --git a/src/Pstream/mpi/OPwrite.C b/src/Pstream/mpi/OPwrite.C index 2a09427b7c..4f69ef3f75 100644 --- a/src/Pstream/mpi/OPwrite.C +++ b/src/Pstream/mpi/OPwrite.C @@ -31,20 +31,16 @@ Description #include "OPstream.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // Outstanding non-blocking operations. -DynamicList OPstream_outstandingRequests_; - +//! @cond fileScope +Foam::DynamicList OPstream_outstandingRequests_; +//! @endcond fileScope // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -OPstream::~OPstream() +Foam::OPstream::~OPstream() { if ( @@ -66,7 +62,7 @@ OPstream::~OPstream() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool OPstream::write +bool Foam::OPstream::write ( const commsTypes commsType, const int toProcNo, @@ -80,7 +76,7 @@ bool OPstream::write { transferFailed = MPI_Bsend ( - (char*)buf, + const_cast(buf), bufSize, MPI_PACKED, procID(toProcNo), @@ -92,7 +88,7 @@ bool OPstream::write { transferFailed = MPI_Send ( - (char*)buf, + const_cast(buf), bufSize, MPI_PACKED, procID(toProcNo), @@ -106,7 +102,7 @@ bool OPstream::write transferFailed = MPI_Isend ( - (char*)buf, + const_cast(buf), bufSize, MPI_PACKED, procID(toProcNo), @@ -132,7 +128,7 @@ bool OPstream::write } -void OPstream::waitRequests() +void Foam::OPstream::waitRequests() { if (OPstream_outstandingRequests_.size() > 0) { @@ -159,7 +155,7 @@ void OPstream::waitRequests() } -bool OPstream::finishedRequest(const label i) +bool Foam::OPstream::finishedRequest(const label i) { if (i >= OPstream_outstandingRequests_.size()) { @@ -184,6 +180,4 @@ bool OPstream::finishedRequest(const label i) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam - // ************************************************************************* // diff --git a/src/Pstream/mpi/Pstream.C b/src/Pstream/mpi/Pstream.C index a456341317..ce42db4ea6 100644 --- a/src/Pstream/mpi/Pstream.C +++ b/src/Pstream/mpi/Pstream.C @@ -42,12 +42,14 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void Pstream::addValidParOptions(HashTable& validParOptions) +// NOTE: +// valid parallel options vary between implementations, but flag common ones. +// if they are not removed by MPI_Init(), the subsequent argument processing +// will notice that they are wrong +void Foam::Pstream::addValidParOptions(HashTable& validParOptions) { validParOptions.insert("np", ""); validParOptions.insert("p4pg", "PI file"); @@ -59,7 +61,7 @@ void Pstream::addValidParOptions(HashTable& validParOptions) } -bool Pstream::init(int& argc, char**& argv) +bool Foam::Pstream::init(int& argc, char**& argv) { MPI_Init(&argc, &argv); @@ -119,7 +121,7 @@ bool Pstream::init(int& argc, char**& argv) } -void Pstream::exit(int errnum) +void Foam::Pstream::exit(int errnum) { # ifndef SGIMPI int size; @@ -140,13 +142,13 @@ void Pstream::exit(int errnum) } -void Pstream::abort() +void Foam::Pstream::abort() { MPI_Abort(MPI_COMM_WORLD, 1); } -void reduce(scalar& Value, const sumOp& bop) +void Foam::reduce(scalar& Value, const sumOp& bop) { if (!Pstream::parRun()) { @@ -426,6 +428,4 @@ void reduce(scalar& Value, const sumOp& bop) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam - // ************************************************************************* //