FreeFOAM The Cross-Platform CFD Toolkit
mpiIPstreamImpl.H
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*\
2  ______ _ ____ __ __
3  | ____| _| |_ / __ \ /\ | \/ |
4  | |__ _ __ ___ ___ / \| | | | / \ | \ / |
5  | __| '__/ _ \/ _ ( (| |) ) | | |/ /\ \ | |\/| |
6  | | | | | __/ __/\_ _/| |__| / ____ \| | | |
7  |_| |_| \___|\___| |_| \____/_/ \_\_| |_|
8 
9  FreeFOAM: The Cross-Platform CFD Toolkit
10 
11  Copyright (C) 2008-2012 Michael Wild <themiwi@users.sf.net>
12  Gerber van der Graaf <gerber_graaf@users.sf.net>
13 --------------------------------------------------------------------------------
14 License
15  This file is part of FreeFOAM.
16 
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.
21 
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
25  for more details.
26 
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/>.
29 
30 Class
31  Foam::mpiIPstreamImpl
32 
33 Description
34  MPI implementation of the IPstreamImpl abstract base class.
35 
36 SourceFiles
37  mpiIPstreamImpl.C
38 
39 \*----------------------------------------------------------------------------*/
40 
41 #ifndef mpiIPstreamImpl_H
42 #define mpiIPstreamImpl_H
43 
44 #include <OpenFOAM/IPstreamImpl.H>
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class mpiIPstreamImpl Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public IPstreamImpl
58 {
59  // Private Member Functions
60 
61  //- Disallow default bitwise copy construct
63 
64  //- Disallow default bitwise assignment
65  void operator=(const mpiIPstreamImpl&);
66 
67 public:
68 
69  // Declare name of the class and its debug switch
70  TypeName("mpiIPstreamImpl");
71 
72  // Constructors
73 
74  //- Construct null
76 
77  // Member Functions
78 
79  //- Initialization
80  virtual void init(
81  const PstreamImpl::commsTypes commsType,
82  const label bufSize,
83  int& fromProcNo,
84  label& messageSize,
85  List<char>& buf
86  );
87 
88  //- Read into given buffer from given processor and return the
89  // message size
90  virtual label read
91  (
92  const PstreamImpl::commsTypes commsType,
93  const int fromProcNo,
94  char* buf,
95  const std::streamsize bufSize
96  );
97 
98  //- Non-blocking receives: wait until all have finished.
99  virtual void waitRequests();
100 
101  //- Non-blocking receives: has request i finished?
102  virtual bool finishedRequest(const label i);
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************ vim: set sw=4 sts=4 et: ************************ //