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

Diff of /trunk/escriptcore/src/DataLazy.cpp

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

revision 2500 by jfenwick, Tue Jun 30 00:42:38 2009 UTC revision 2501 by jfenwick, Tue Jun 30 04:43:01 2009 UTC
# Line 42  bool privdebug=false; Line 42  bool privdebug=false;
42  #define DISABLEDEBUG privdebug=false;  #define DISABLEDEBUG privdebug=false;
43  }  }
44    
45  // #define SIZELIMIT  // #define SIZELIMIT if ((m_height>escript::escriptParams.getTOO_MANY_LEVELS()) || (m_children>escript::escriptParams.getTOO_MANY_NODES())) {cerr << "\n!!!!!!! SIZE LIMIT EXCEEDED " << m_children << ";" << m_height << endl << toString() << endl;resolveToIdentity();}
 // #define SIZELIMIT if ((m_height>7) || (m_children>127)) {cerr << "\n!!!!!!! SIZE LIMIT EXCEEDED " << m_children << ";" << m_height << endl << toString() << endl; resolveToIdentity();}  
 //#define SIZELIMIT if ((m_height>7) || (m_children>127)) {resolveToIdentity();}  
46    
47  #define SIZELIMIT if ((m_height>escript::escriptParams.getTOO_MANY_LEVELS()) || (m_children>escript::escriptParams.getTOO_MANY_NODES())) {resolveToIdentity();}  #define SIZELIMIT if ((m_height>escript::escriptParams.getTOO_MANY_LEVELS()) || (m_children>escript::escriptParams.getTOO_MANY_NODES())) {resolveToIdentity();}
48    
49    
50  /*  /*
51  How does DataLazy work?  How does DataLazy work?
52  ~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~
# Line 1593  cout << "\nWritten to: " << resultp << " Line 1592  cout << "\nWritten to: " << resultp << "
1592  const DataTypes::ValueType*  const DataTypes::ValueType*
1593  DataLazy::resolveNodeSample(int tid, int sampleNo, size_t& roffset)  DataLazy::resolveNodeSample(int tid, int sampleNo, size_t& roffset)
1594  {  {
 ENABLEDEBUG  
1595  LAZYDEBUG(cout << "Resolve sample " << toString() << endl;)  LAZYDEBUG(cout << "Resolve sample " << toString() << endl;)
1596      // 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
1597    if (m_readytype!='E' && m_op!=IDENTITY)    if (m_readytype!='E' && m_op!=IDENTITY)
# Line 1615  LAZYDEBUG(cout << "Resolve sample " << t Line 1613  LAZYDEBUG(cout << "Resolve sample " << t
1613    {    {
1614      throw DataException("Programmer Error - Collapse did not produce an expanded node.");      throw DataException("Programmer Error - Collapse did not produce an expanded node.");
1615    }    }
1616      if (m_sampleids[tid]==sampleNo)
1617      {
1618        roffset=tid*m_samplesize;
1619        return &(m_samples);        // sample is already resolved
1620      }
1621      m_sampleids[tid]=sampleNo;
1622    switch (getOpgroup(m_op))    switch (getOpgroup(m_op))
1623    {    {
1624    case G_UNARY:    case G_UNARY:
# Line 1644  DataLazy::resolveNodeUnary(int tid, int Line 1648  DataLazy::resolveNodeUnary(int tid, int
1648    {    {
1649      throw DataException("Programmer error - resolveNodeUnary should not be called on identity nodes.");      throw DataException("Programmer error - resolveNodeUnary should not be called on identity nodes.");
1650    }    }
   if (m_sampleids[tid]==sampleNo)  
   {  
     roffset=tid*m_samplesize;  
     return &(m_samples);        // sample is already resolved  
   }  
1651    const DataTypes::ValueType* leftres=m_left->resolveNodeSample(tid, sampleNo, roffset);    const DataTypes::ValueType* leftres=m_left->resolveNodeSample(tid, sampleNo, roffset);
1652    const double* left=&((*leftres)[roffset]);    const double* left=&((*leftres)[roffset]);
1653    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;

Legend:
Removed from v.2500  
changed lines
  Added in v.2501

  ViewVC Help
Powered by ViewVC 1.1.26