/[escript]/trunk/escriptcore/src/NonReducedVariable.cpp
ViewVC logotype

Contents of /trunk/escriptcore/src/NonReducedVariable.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5593 - (show annotations)
Fri Apr 24 01:36:26 2015 UTC (4 years, 2 months ago) by jfenwick
File size: 2636 byte(s)
Fixing institution name to comply with policy
1 /*****************************************************************************
2 *
3 * Copyright (c) 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 #define ESNEEDPYTHON
17 #include "esysUtils/first.h"
18
19
20 #include "NonReducedVariable.h"
21 #include "SplitWorldException.h"
22
23 using namespace escript;
24
25 NonReducedVariable::NonReducedVariable()
26 {
27 valueadded=false;
28 }
29
30 NonReducedVariable::~NonReducedVariable()
31 {
32 }
33
34 void NonReducedVariable::setDomain(escript::Domain_ptr d)
35 {
36
37 }
38
39
40 // SInce there is no remote transfer, we don't need to check this
41 bool NonReducedVariable::valueCompatible(boost::python::object v)
42 {
43 return true;
44 }
45
46 // Any new export, replaces the old value
47 bool NonReducedVariable::reduceLocalValue(boost::python::object v, std::string& errstring)
48 {
49 value=v;
50 valueadded=true;
51 return true;
52 }
53
54 void NonReducedVariable::reset()
55 {
56 value=boost::python::object();
57 valueadded=false;
58 }
59
60 // Since we aren't actually don't a check here, this call won't function
61 // as a barrier like other implementations of this method
62 bool NonReducedVariable::checkRemoteCompatibility(esysUtils::JMPI& mpi_info, std::string& errstring)
63 {
64 return true;
65 }
66
67 void NonReducedVariable::getCompatibilityInfo(std::vector<unsigned>& params)
68 {
69 // empty
70 }
71
72 bool NonReducedVariable::reduceRemoteValues(esysUtils::JMPI& mpi_info, bool active)
73 {
74 return true;
75 }
76
77 std::string NonReducedVariable::description()
78 {
79 return "Non-Reduced Variable.";
80 }
81
82 bool NonReducedVariable::recvFrom(Esys_MPI_rank localid, Esys_MPI_rank source, esysUtils::JMPI& mpiinfo)
83 {
84 return true;
85 }
86
87 bool NonReducedVariable::sendTo(Esys_MPI_rank localid, Esys_MPI_rank source, esysUtils::JMPI& mpiinfo)
88 {
89 return true;
90 }
91
92 double NonReducedVariable::getDouble()
93 {
94 throw SplitWorldException("No double value from this type.");
95 }
96
97 boost::python::object NonReducedVariable::getPyObj()
98 {
99 return value;
100 }
101
102 bool NonReducedVariable::groupSend(MPI_Comm& com)
103 {
104 return true;
105 }
106
107 bool NonReducedVariable::groupReduce(MPI_Comm& com, char mystate)
108 {
109 return true;
110 }
111
112 namespace escript
113 {
114 Reducer_ptr makeNonReducedVariable()
115 {
116 NonReducedVariable* m=new NonReducedVariable();
117 return Reducer_ptr(m);
118
119 }
120
121 }

  ViewVC Help
Powered by ViewVC 1.1.26