1 /*----------------------------------------------------------------------------*\
3 | ____| _| |_ / __ \ /\ | \/ |
4 | |__ _ __ ___ ___ / \| | | | / \ | \ / |
5 | __| '__/ _ \/ _ ( (| |) ) | | |/ /\ \ | |\/| |
6 | | | | | __/ __/\_ _/| |__| / ____ \| | | |
7 |_| |_| \___|\___| |_| \____/_/ \_\_| |_|
9 FreeFOAM: The Cross-Platform CFD Toolkit
11 Copyright (C) 2008-2012 Michael Wild <themiwi@users.sf.net>
12 Gerber van der Graaf <gerber_graaf@users.sf.net>
13 --------------------------------------------------------------------------------
15 This file is part of FreeFOAM.
17 FreeFOAM is free software: you can redistribute it and/or modify it
18 under the terms of the GNU General Public License as published by the
19 Free Software Foundation, either version 3 of the License, or (at your
20 option) any later version.
22 FreeFOAM is distributed in the hope that it will be useful, but WITHOUT
23 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 You should have received a copy of the GNU General Public License
28 along with FreeFOAM. If not, see <http://www.gnu.org/licenses/>.
34 Abstract base class for IPstream operations that depend on the parallel
35 library used. Foam::IPstreamImpl::New will lookup the entry
36 "PstreamImplementation" in the global controlDict file (i.e. the one
37 found by Foam::dotFoam) and tries to first load a library named
38 lib\<PstreamImplementation\>Pstream.so, and then instantiate the class
39 \<PstreamImplementation\>IPstreamImpl.
45 \*----------------------------------------------------------------------------*/
47 #ifndef IPstreamImpl_H
48 #define IPstreamImpl_H
50 #include <OpenFOAM/PstreamImpl.H>
51 #include <OpenFOAM/autoPtr.H>
52 #include <OpenFOAM/typeInfo.H>
53 #include <OpenFOAM/runTimeSelectionTables.H>
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 /*---------------------------------------------------------------------------*\
61 Class IPstreamImpl Declaration
62 \*---------------------------------------------------------------------------*/
68 //- The singleton instance
69 static autoPtr<IPstreamImpl> instance_;
71 // Private Member Functions
73 //- Disallow default bitwise copy construct
74 IPstreamImpl(const IPstreamImpl&);
76 //- Disallow default bitwise assignment
77 void operator=(const IPstreamImpl&);
81 // Declare name of the class and its debug switch
82 TypeName("IPstreamImpl");
84 // Declare run-time constructor selection table
86 declareRunTimeSelectionTable
102 virtual ~IPstreamImpl() {}
106 //- Return a reference to the selected IPstreamImpl implementation
107 static autoPtr<IPstreamImpl> New();
114 const PstreamImpl::commsTypes commsType,
121 //- Read into given buffer from given processor and return the
125 const PstreamImpl::commsTypes commsType,
126 const int fromProcNo,
128 const std::streamsize bufSize
131 //- Non-blocking receives: wait until all have finished.
132 virtual void waitRequests() = 0;
134 //- Non-blocking receives: has request i finished?
135 virtual bool finishedRequest(const label i) = 0;
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 } // End namespace Foam
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 // ************************ vim: set sw=4 sts=4 et: ************************ //