/[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

trunk/escript/src/DataLazy.cpp revision 4286 by caltinay, Thu Mar 7 04:28:11 2013 UTC trunk/escriptcore/src/DataLazy.cpp revision 5448 by jfenwick, Fri Feb 6 05:31:37 2015 UTC
# Line 1  Line 1 
1    
2  /*****************************************************************************  /*****************************************************************************
3  *  *
4  * Copyright (c) 2003-2013 by University of Queensland  * Copyright (c) 2003-2015 by University of Queensland
5  * http://www.uq.edu.au  * http://www.uq.edu.au
6  *  *
7  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
# Line 9  Line 9 
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)  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12  * Development since 2012 by School of Earth Sciences  * Development 2012-2013 by School of Earth Sciences
13    * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14  *  *
15  *****************************************************************************/  *****************************************************************************/
16    
# Line 822  DataLazy::~DataLazy() Line 823  DataLazy::~DataLazy()
823    For reasons of efficiency do not call this method on DataExpanded nodes.    For reasons of efficiency do not call this method on DataExpanded nodes.
824  */  */
825  DataReady_ptr  DataReady_ptr
826  DataLazy::collapseToReady()  DataLazy::collapseToReady() const
827  {  {
828    if (m_readytype=='E')    if (m_readytype=='E')
829    { // this is more an efficiency concern than anything else    { // this is more an efficiency concern than anything else
# Line 977  DataLazy::collapseToReady() Line 978  DataLazy::collapseToReady()
978     the purpose of using DataLazy in the first place).     the purpose of using DataLazy in the first place).
979  */  */
980  void  void
981  DataLazy::collapse()  DataLazy::collapse() const
982  {  {
983    if (m_op==IDENTITY)    if (m_op==IDENTITY)
984    {    {
# Line 1016  LAZYDEBUG(cout << " result=      " << re Line 1017  LAZYDEBUG(cout << " result=      " << re
1017  // The result will be stored in m_samples  // The result will be stored in m_samples
1018  // The return value is a pointer to the DataVector, offset is the offset within the return value  // The return value is a pointer to the DataVector, offset is the offset within the return value
1019  const DataTypes::ValueType*  const DataTypes::ValueType*
1020  DataLazy::resolveNodeSample(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeSample(int tid, int sampleNo, size_t& roffset) const
1021  {  {
1022  LAZYDEBUG(cout << "Resolve sample " << toString() << endl;)  LAZYDEBUG(cout << "Resolve sample " << toString() << endl;)
1023      // collapse so we have a 'E' node or an IDENTITY for some other type      // collapse so we have a 'E' node or an IDENTITY for some other type
# Line 1065  if (&x<stackend[omp_get_thread_num()]) Line 1066  if (&x<stackend[omp_get_thread_num()])
1066  }  }
1067    
1068  const DataTypes::ValueType*  const DataTypes::ValueType*
1069  DataLazy::resolveNodeUnary(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeUnary(int tid, int sampleNo, size_t& roffset) const
1070  {  {
1071      // we assume that any collapsing has been done before we get here      // we assume that any collapsing has been done before we get here
1072      // since we only have one argument we don't need to think about only      // since we only have one argument we don't need to think about only
# Line 1197  DataLazy::resolveNodeUnary(int tid, int Line 1198  DataLazy::resolveNodeUnary(int tid, int
1198    
1199    
1200  const DataTypes::ValueType*  const DataTypes::ValueType*
1201  DataLazy::resolveNodeReduction(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeReduction(int tid, int sampleNo, size_t& roffset) const
1202  {  {
1203      // we assume that any collapsing has been done before we get here      // we assume that any collapsing has been done before we get here
1204      // since we only have one argument we don't need to think about only      // since we only have one argument we don't need to think about only
# Line 1249  DataLazy::resolveNodeReduction(int tid, Line 1250  DataLazy::resolveNodeReduction(int tid,
1250  }  }
1251    
1252  const DataTypes::ValueType*  const DataTypes::ValueType*
1253  DataLazy::resolveNodeNP1OUT(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeNP1OUT(int tid, int sampleNo, size_t& roffset) const
1254  {  {
1255      // we assume that any collapsing has been done before we get here      // we assume that any collapsing has been done before we get here
1256      // since we only have one argument we don't need to think about only      // since we only have one argument we don't need to think about only
# Line 1294  DataLazy::resolveNodeNP1OUT(int tid, int Line 1295  DataLazy::resolveNodeNP1OUT(int tid, int
1295  }  }
1296    
1297  const DataTypes::ValueType*  const DataTypes::ValueType*
1298  DataLazy::resolveNodeNP1OUT_P(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeNP1OUT_P(int tid, int sampleNo, size_t& roffset) const
1299  {  {
1300      // we assume that any collapsing has been done before we get here      // we assume that any collapsing has been done before we get here
1301      // since we only have one argument we don't need to think about only      // since we only have one argument we don't need to think about only
# Line 1342  DataLazy::resolveNodeNP1OUT_P(int tid, i Line 1343  DataLazy::resolveNodeNP1OUT_P(int tid, i
1343    
1344    
1345  const DataTypes::ValueType*  const DataTypes::ValueType*
1346  DataLazy::resolveNodeNP1OUT_2P(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeNP1OUT_2P(int tid, int sampleNo, size_t& roffset) const
1347  {  {
1348    if (m_readytype!='E')    if (m_readytype!='E')
1349    {    {
# Line 1378  DataLazy::resolveNodeNP1OUT_2P(int tid, Line 1379  DataLazy::resolveNodeNP1OUT_2P(int tid,
1379  }  }
1380    
1381  const DataTypes::ValueType*  const DataTypes::ValueType*
1382  DataLazy::resolveNodeCondEval(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeCondEval(int tid, int sampleNo, size_t& roffset) const
1383  {  {
1384    if (m_readytype!='E')    if (m_readytype!='E')
1385    {    {
# Line 1422  DataLazy::resolveNodeCondEval(int tid, i Line 1423  DataLazy::resolveNodeCondEval(int tid, i
1423  // For example, 2+Vector.  // For example, 2+Vector.
1424  // In this case each double within the point is treated individually  // In this case each double within the point is treated individually
1425  const DataTypes::ValueType*  const DataTypes::ValueType*
1426  DataLazy::resolveNodeBinary(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeBinary(int tid, int sampleNo, size_t& roffset) const
1427  {  {
1428  LAZYDEBUG(cout << "Resolve binary: " << toString() << endl;)  LAZYDEBUG(cout << "Resolve binary: " << toString() << endl;)
1429    
# Line 1579  LAZYDEBUG(cout << "Result res[" << roffs Line 1580  LAZYDEBUG(cout << "Result res[" << roffs
1580  // have already been collapsed to IDENTITY. So we must have at least one expanded child.  // have already been collapsed to IDENTITY. So we must have at least one expanded child.
1581  // unlike the other resolve helpers, we must treat these datapoints separately.  // unlike the other resolve helpers, we must treat these datapoints separately.
1582  const DataTypes::ValueType*  const DataTypes::ValueType*
1583  DataLazy::resolveNodeTProd(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeTProd(int tid, int sampleNo, size_t& roffset) const
1584  {  {
1585  LAZYDEBUG(cout << "Resolve TensorProduct: " << toString() << endl;)  LAZYDEBUG(cout << "Resolve TensorProduct: " << toString() << endl;)
1586    
# Line 1638  LAZYDEBUG(cout << DataTypes::pointToStri Line 1639  LAZYDEBUG(cout << DataTypes::pointToStri
1639    
1640    
1641  const DataTypes::ValueType*  const DataTypes::ValueType*
1642  DataLazy::resolveSample(int sampleNo, size_t& roffset)  DataLazy::resolveSample(int sampleNo, size_t& roffset) const
1643  {  {
1644  #ifdef _OPENMP  #ifdef _OPENMP
1645      int tid=omp_get_thread_num();      int tid=omp_get_thread_num();
# Line 2094  DataLazy::setToZero() Line 2095  DataLazy::setToZero()
2095  //   m_readytype='C';  //   m_readytype='C';
2096  //   m_buffsRequired=1;  //   m_buffsRequired=1;
2097    
2098    privdebug=privdebug;  // to stop the compiler complaining about unused privdebug    (void)privdebug;  // to stop the compiler complaining about unused privdebug
2099    throw DataException("Programmer error - setToZero not supported for DataLazy (DataLazy objects should be read only).");    throw DataException("Programmer error - setToZero not supported for DataLazy (DataLazy objects should be read only).");
2100  }  }
2101    

Legend:
Removed from v.4286  
changed lines
  Added in v.5448

  ViewVC Help
Powered by ViewVC 1.1.26