1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Determines the order in which a set of processors should communicate
31 The communication order should
32 - have maximum overlap
33 - allow blocking communication without deadlock
35 Does a very simple scheduling which assumes same time for all operations.
38 - schedule() gives the order in which the input communication should occur
39 - procSchedule()[procI] gives per procI
41 Does not care whether 'talking' is first send, second receive or maybe
42 full swap. This is all responsability of caller. See ProcessorTopology
43 class for use in scheduling processor boundary swaps.
48 \*---------------------------------------------------------------------------*/
50 #ifndef commSchedule_H
51 #define commSchedule_H
53 #include "dynamicLabelList.H"
54 #include "labelPair.H"
55 #include "labelList.H"
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 /*---------------------------------------------------------------------------*\
63 Class commSchedule Declaration
64 \*---------------------------------------------------------------------------*/
70 //- Order in which input communication has been scheduled
73 //- Per processor the order in which communication has been scheduled
74 labelListList procSchedule_;
76 // Private Member Functions
78 //- Count the number of outstanding communications for a single
80 label outstandingComms(const labelList&, dynamicLabelList&) const;
85 ClassName("commSchedule");
89 //- Construct from wanted communication. Wanted communication is between
90 // two processors. Can be a one-way communication or
91 // two-way communication, that is up to the caller. This class just
92 // determines an order for it such that any processor is only talking
93 // to one other at a time. After construction:
94 // - schedule is the order in which comms is done.
95 // - procSchedule[procI] is for procI the order in which comms is done.
96 commSchedule(const label nProcs, const List<labelPair>& comms);
101 //- order in which comms is scheduled
102 const labelList& schedule() const
107 //- Per processor the order in which communication has been scheduled
108 const labelListList& procSchedule() const
110 return procSchedule_;
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 } // End namespace Foam
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 // ************************************************************************* //