/[escript]/branches/clazy/escriptcore/src/DataLazy.cpp
ViewVC logotype

Diff of /branches/clazy/escriptcore/src/DataLazy.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC revision 4264 by jfenwick, Thu Feb 28 11:32:57 2013 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*****************************************************************************
3  *  *
4  * Copyright (c) 2003-2010 by University of Queensland  * Copyright (c) 2003-2013 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * http://www.uq.edu.au
 * http://www.uq.edu.au/esscc  
6  *  *
7  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
8  * Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
9  * http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
10  *  *
11  *******************************************************/  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12    * Development since 2012 by School of Earth Sciences
13    *
14    *****************************************************************************/
15    
16    
17  #include "DataLazy.h"  #include "DataLazy.h"
18  #ifdef USE_NETCDF  #include "esysUtils/Esys_MPI.h"
 #include <netcdfcpp.h>  
 #endif  
 #ifdef ESYS_MPI  
 #include <mpi.h>  
 #endif  
19  #ifdef _OPENMP  #ifdef _OPENMP
20  #include <omp.h>  #include <omp.h>
21  #endif  #endif
# Line 30  Line 27 
27    
28  #include "EscriptParams.h"  #include "EscriptParams.h"
29    
30    #ifdef USE_NETCDF
31    #include <netcdfcpp.h>
32    #endif
33    
34  #include <iomanip>      // for some fancy formatting in debug  #include <iomanip>      // for some fancy formatting in debug
35    
36  // #define LAZYDEBUG(X) if (privdebug){X;}  // #define LAZYDEBUG(X) if (privdebug){X;}
# Line 194  resultFS(DataAbstract_ptr left, DataAbst Line 195  resultFS(DataAbstract_ptr left, DataAbst
195    FunctionSpace r=right->getFunctionSpace();    FunctionSpace r=right->getFunctionSpace();
196    if (l!=r)    if (l!=r)
197    {    {
198      if (r.probeInterpolation(l))      signed char res=r.getDomain()->preferredInterpolationOnDomain(r.getTypeCode(), l.getTypeCode());
199        if (res==1)
200      {      {
201      return l;      return l;
202      }      }
203      if (l.probeInterpolation(r))      if (res==-1)
204      {      {
205      return r;      return r;
206      }      }
# Line 1214  DataLazy::resolveNodeReduction(int tid, Line 1216  DataLazy::resolveNodeReduction(int tid,
1216    
1217    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1218    unsigned int ndpps=getNumDPPSample();    unsigned int ndpps=getNumDPPSample();
1219    unsigned int psize=DataTypes::noValues(getShape());    unsigned int psize=DataTypes::noValues(m_left->getShape());
1220    double* result=&(m_samples[roffset]);    double* result=&(m_samples[roffset]);
1221    switch (m_op)    switch (m_op)
1222    {    {
# Line 1387  DataLazy::resolveNodeCondEval(int tid, i Line 1389  DataLazy::resolveNodeCondEval(int tid, i
1389      throw DataException("Programmer error - resolveNodeCondEval should only be called on CONDEVAL nodes.");      throw DataException("Programmer error - resolveNodeCondEval should only be called on CONDEVAL nodes.");
1390    }    }
1391    size_t subroffset;    size_t subroffset;
   size_t offset;  
   
1392    
1393    const ValueType* maskres=m_mask->resolveNodeSample(tid, sampleNo, subroffset);    const ValueType* maskres=m_mask->resolveNodeSample(tid, sampleNo, subroffset);
1394    const ValueType* srcres=0;    const ValueType* srcres=0;
# Line 1404  DataLazy::resolveNodeCondEval(int tid, i Line 1404  DataLazy::resolveNodeCondEval(int tid, i
1404    // Now we need to copy the result    // Now we need to copy the result
1405    
1406    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
   offset=roffset;  
1407    for (int i=0;i<m_samplesize;++i)    for (int i=0;i<m_samplesize;++i)
1408    {    {
1409      m_samples[roffset+i]=(*srcres)[subroffset+i];        m_samples[roffset+i]=(*srcres)[subroffset+i];  

Legend:
Removed from v.3259  
changed lines
  Added in v.4264

  ViewVC Help
Powered by ViewVC 1.1.26