/[escript]/trunk/escriptcore/src/MPIDataReducer.h
ViewVC logotype

Contents of /trunk/escriptcore/src/MPIDataReducer.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5593 - (show annotations)
Fri Apr 24 01:36:26 2015 UTC (4 years, 3 months ago) by jfenwick
File MIME type: text/plain
File size: 2600 byte(s)
Fixing institution name to comply with policy
1 /*****************************************************************************
2 *
3 * Copyright (c) 2014-2015 by The University of Queensland
4 * http://www.uq.edu.au
5 *
6 * Primary Business: Queensland, Australia
7 * Licensed under the Open Software License version 3.0
8 * http://www.opensource.org/licenses/osl-3.0.php
9 *
10 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 * Development 2012-2013 by School of Earth Sciences
12 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
13 *
14 *****************************************************************************/
15
16 #ifndef __ESCRIPT_DATAREDUCER_H__
17 #define __ESCRIPT_DATAREDUCER_H__
18
19 #include "esysUtils/Esys_MPI.h"
20 #include "escript/Data.h"
21 #include <boost/shared_ptr.hpp>
22 #include "AbstractReducer.h"
23 namespace escript
24 {
25
26 // Reduces using pointwise MPI operations
27 class MPIDataReducer : public AbstractReducer
28 {
29 public:
30 MPIDataReducer(MPI_Op op);
31 ~MPIDataReducer(){};
32
33 // This is not a constructor parameter because
34 // if these are created outside the subworld, they won't have
35 // access to a domain yet.
36 // I also want SplitWorld to be able to set this
37 void setDomain(escript::Domain_ptr d);
38 bool valueCompatible(boost::python::object v);
39 bool reduceLocalValue(boost::python::object v, std::string& errstring);
40 void reset();
41 bool checkRemoteCompatibility(esysUtils::JMPI& mpi_info, std::string& errstring);
42
43 void getCompatibilityInfo(std::vector<unsigned>& params);
44
45 // talk to corresponding processes in other subworlds
46 bool reduceRemoteValues(esysUtils::JMPI& mpi_info, bool active);
47
48 // human readable description
49 std::string description();
50
51 // Get a value for this variable from another process
52 // This is not a reduction and will replace any existing value
53 bool recvFrom(Esys_MPI_rank localid, Esys_MPI_rank source, esysUtils::JMPI& mpiinfo);
54
55 // Send a value to this variable to another process
56 // This is not a reduction and will replace any existing value
57 bool sendTo(Esys_MPI_rank localid, Esys_MPI_rank target, esysUtils::JMPI& mpiinfo);
58 virtual boost::python::object getPyObj();
59
60 // send from proc 0 in the communicator to all others
61 bool groupSend(MPI_Comm& com);
62
63 // reduction with some procs submitting identity values
64 bool groupReduce(MPI_Comm& com, char mystate);
65
66 private:
67 escript::Data value;
68 escript::const_Domain_ptr dom;
69 MPI_Op reduceop;
70 };
71
72 Reducer_ptr makeDataReducer(std::string type);
73
74 }
75
76 #endif // __ESCRIPT_DATAREDUCER_H__
77

  ViewVC Help
Powered by ViewVC 1.1.26