From 7b74d029bcc89aeac3c896eda1166434aa3f0ca0 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 15 Jul 2009 13:28:24 +0200 Subject: [PATCH] dropped pvm --- src/Pstream/Allwmake | 2 +- src/Pstream/pvm/IPread.C | 114 ---------- src/Pstream/pvm/Make/files | 5 - src/Pstream/pvm/Make/options | 4 - src/Pstream/pvm/OPwrite.C | 68 ------ src/Pstream/pvm/Pstream.C | 393 ----------------------------------- 6 files changed, 1 insertion(+), 585 deletions(-) delete mode 100644 src/Pstream/pvm/IPread.C delete mode 100644 src/Pstream/pvm/Make/files delete mode 100644 src/Pstream/pvm/Make/options delete mode 100644 src/Pstream/pvm/OPwrite.C delete mode 100644 src/Pstream/pvm/Pstream.C diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake index a24dd16a5d..a01538cc38 100755 --- a/src/Pstream/Allwmake +++ b/src/Pstream/Allwmake @@ -5,7 +5,7 @@ set -x wmake libso dummy case "$WM_MPLIB" in -LAM | *MPI* ) +*MPI*) set +x echo echo "Note: ignore spurious warnings about missing mpicxx.h headers" diff --git a/src/Pstream/pvm/IPread.C b/src/Pstream/pvm/IPread.C deleted file mode 100644 index 5a035bf388..0000000000 --- a/src/Pstream/pvm/IPread.C +++ /dev/null @@ -1,114 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - Read token and binary block from IPstream using pvm. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "IPstream.H" - -#include - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // - -IPstream::IPstream -( - const int fromProcNo, - const label bufSize, - streamFormat format, - versionNumber version -) -: - Pstream(bufSize), - Istream(format, version), - fromProcNo_(fromProcNo), - messageSize_(0) -{ - setOpened(); - setGood(); - - int bufid, tag, tid; - - // If the buffer size is not specified then probe the incomming message - - if (!bufSize) - { - // Probe read buffer until message arrives. - while (!(bufid = pvm_probe(procID(fromProcNo_), msgType()))); - - // When the message arrives find its size - pvm_bufinfo(bufid, &messageSize_, &tag, &tid); - - // Resize buffer to message size - buf_.setSize(messageSize_); - } - - - // Read message into buffer - - if - ( - pvm_precv - ( - procID(fromProcNo_), - msgType(), - buf_.begin(), - buf_.size(), - PVM_BYTE, - &tid, &tag, &messageSize_ - ) != PvmOk - ) - { - FatalErrorIn("IPstream::IPstream(const int fromProcNo)") - << "pvm_precv cannot receive incomming message" - << ::abort; - } - - - // Check size of message read - - if (messageSize_ > buf_.size()) - { - FatalErrorIn("IPstream::IPstream(const int fromProcNo)") - << "buffer (" << buf_.size() - << ") not large enough for incomming message (" - << messageSize_ << ')' - << ::abort; - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/Pstream/pvm/Make/files b/src/Pstream/pvm/Make/files deleted file mode 100644 index 8a94fb2f05..0000000000 --- a/src/Pstream/pvm/Make/files +++ /dev/null @@ -1,5 +0,0 @@ -OPwrite.C -IPread.C -Pstream.C - -LIB = $(FOAM_LIBBIN)/pvm-$(LAM_VERSION)/libPstream diff --git a/src/Pstream/pvm/Make/options b/src/Pstream/pvm/Make/options deleted file mode 100644 index 90632e801e..0000000000 --- a/src/Pstream/pvm/Make/options +++ /dev/null @@ -1,4 +0,0 @@ -include $(RULES)/mplib$(WM_MPLIB) - -EXE_INC = $(PFLAGS) $(PINC) -LIB_LIBS = $(PLIBS) diff --git a/src/Pstream/pvm/OPwrite.C b/src/Pstream/pvm/OPwrite.C deleted file mode 100644 index 454f6d1eb8..0000000000 --- a/src/Pstream/pvm/OPwrite.C +++ /dev/null @@ -1,68 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - Write primitive and binary block from OPstream using pvm. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "OPstream.H" - -#include - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -OPstream::~OPstream() -{ - if - ( - pvm_psend - ( - procID(toProcNo_), - msgType(), - buf_.begin(), - bufPosition_, - PVM_BYTE - ) != PvmOk - ) - { - FatalErrorIn("OPstream::~OPstream()") - << "pvm_psend cannot send outgoing message" - << ::abort; - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/Pstream/pvm/Pstream.C b/src/Pstream/pvm/Pstream.C deleted file mode 100644 index c76e2df115..0000000000 --- a/src/Pstream/pvm/Pstream.C +++ /dev/null @@ -1,393 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "Pstream.H" -#include "PstreamReduceOps.H" - -#include -#include -#include - -#include - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -void Pstream::addValidParOptions(HashTable& validParOptions) -{ - validParOptions.insert("np", ""); - validParOptions.insert("p4pg", "PI file"); - validParOptions.insert("p4wd", "directory"); - validParOptions.insert("p4amslave", ""); - validParOptions.insert("p4yourname", "hostname"); -} - - -bool Pstream::init(int& argc, char**& argv) -{ - // Set the comunications options - pvm_setopt(PvmRoute, PvmRouteDirect); - - // Get the ID of this processor - int mytid = pvm_mytid(); - -#ifdef USECRAYSHMEM - - // Get the size of the NULL group - procIDs_.setSize(pvm_gsize(NULL)); - - // For each processor of the NULL group get its ID - for (int proci=0; proci& bop) -{ - if (Pstream::parRun()) - { -# ifdef PVM_REDUCE - if - ( - pvm_reduce - ( - PvmSum, - &Value, - 1, - PVM_DOUBLE, - Pstream::msgType(), - "foam", - 0 - ) != PvmOk - ) - { - FatalErrorIn - ( - "reduce(scalar& Value, const sumOp& sumOp)" - ) << "pvm_reduce failed" - << abort(FatalError); - } -# endif - - if (Pstream::master()) - { - for - ( - int slave=Pstream::firstSlave(); - slave<=Pstream::lastSlave(); - slave++ - ) - { - scalar value; - int atid, atag, alen; - - if - ( - pvm_precv - ( - Pstream::procID(slave), - Pstream::msgType(), - &value, - 1, - PVM_DOUBLE, - &atid, &atag, &alen - ) != PvmOk - ) - { - FatalErrorIn - ( - "reduce(scalar& Value, const sumOp& sumOp)" - ) << "pvm_precv failed" - << abort(FatalError); - } - - Value = bop(Value, value); - } - } - else - { - if - ( - pvm_psend - ( - Pstream::procID(Pstream::masterNo()), - Pstream::msgType(), - &Value, - 1, - PVM_DOUBLE - ) != PvmOk - ) - { - FatalErrorIn - ( - "reduce(scalar& Value, const sumOp& sumOp)" - ) << "pvm_psend failed" - << abort(FatalError); - } - } - - - if (Pstream::master()) - { - pvm_initsend(PvmDataDefault); - pvm_pkdouble(&Value, 1, 1); - - if - ( - pvm_mcast - ( - (int*)Pstream::procIDs().begin(), - Pstream::nProcs(), - Pstream::msgType() - ) != PvmOk - ) - { - FatalErrorIn - ( - "reduce(scalar& Value, const sumOp& sumOp)" - ) << "pvm_mcast failed" - << abort(FatalError); - } - } - else - { - if - ( - pvm_recv - ( - Pstream::procID(Pstream::masterNo()), - Pstream::msgType() - ) <= 0 - ) - { - FatalErrorIn - ( - "reduce(scalar& Value, const sumOp& sumOp)" - ) << "pvm_psend failed" - << abort(FatalError); - } - - pvm_upkdouble(&Value, 1, 1); - } - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* //