/[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 5997 by caltinay, Mon Feb 29 07:24:47 2016 UTC revision 6088 by jfenwick, Wed Mar 23 00:44:58 2016 UTC
# Line 14  Line 14 
14  *  *
15  *****************************************************************************/  *****************************************************************************/
16    
 #define ESNEEDPYTHON  
 #include "esysUtils/first.h"  
   
17  #include "DataLazy.h"  #include "DataLazy.h"
18  #include "Data.h"  #include "Data.h"
19  #include "DataTypes.h"  #include "DataTypes.h"
20  #include "EscriptParams.h"  #include "EscriptParams.h"
21  #include "FunctionSpace.h"  #include "FunctionSpace.h"
 #include "UnaryFuncs.h"    // for escript::fsign  
22  #include "Utils.h"  #include "Utils.h"
23    #include "DataVectorOps.h"
24    
25  #ifdef USE_NETCDF  #ifdef USE_NETCDF
26  #include <netcdfcpp.h>  #include <netcdfcpp.h>
# Line 481  DataLazy::DataLazy(DataAbstract_ptr p) Line 478  DataLazy::DataLazy(DataAbstract_ptr p)
478     }     }
479     else     else
480     {     {
         p->makeLazyShared();  
481          DataReady_ptr dr=dynamic_pointer_cast<DataReady>(p);          DataReady_ptr dr=dynamic_pointer_cast<DataReady>(p);
482          makeIdentity(dr);          makeIdentity(dr);
483  LAZYDEBUG(cout << "Wrapping " << dr.get() << " id=" << m_id.get() << endl;)  LAZYDEBUG(cout << "Wrapping " << dr.get() << " id=" << m_id.get() << endl;)
# Line 993  DataLazy::collapse() const Line 989  DataLazy::collapse() const
989    m_op=IDENTITY;    m_op=IDENTITY;
990  }  }
991    
   
   
   
   
   
 #define PROC_OP(TYPE,X)                               \  
         for (int j=0;j<onumsteps;++j)\  
         {\  
           for (int i=0;i<numsteps;++i,resultp+=resultStep) \  
           { \  
 LAZYDEBUG(cout << "[left,right]=[" << lroffset << "," << rroffset << "]" << endl;)\  
 LAZYDEBUG(cout << "{left,right}={" << (*left)[lroffset] << "," << (*right)[rroffset] << "}\n";)\  
              tensor_binary_operation< TYPE >(chunksize, &((*left)[lroffset]), &((*right)[rroffset]), resultp, X); \  
 LAZYDEBUG(cout << " result=      " << resultp[0] << endl;) \  
              lroffset+=leftstep; \  
              rroffset+=rightstep; \  
           }\  
           lroffset+=oleftstep;\  
           rroffset+=orightstep;\  
         }  
   
   
992  // The result will be stored in m_samples  // The result will be stored in m_samples
993  // 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
994  const DataTypes::RealVectorType*  const DataTypes::RealVectorType*
# Line 1028  LAZYDEBUG(cout << "Resolve sample " << t Line 1002  LAZYDEBUG(cout << "Resolve sample " << t
1002    }    }
1003    if (m_op==IDENTITY)      if (m_op==IDENTITY)  
1004    {    {
1005      const ValueType& vec=m_id->getVectorRO();      const RealVectorType& vec=m_id->getVectorRO();
1006      roffset=m_id->getPointOffset(sampleNo, 0);      roffset=m_id->getPointOffset(sampleNo, 0);
1007  #ifdef LAZY_STACK_PROF  #ifdef LAZY_STACK_PROF
1008  int x;  int x;
# Line 1085  DataLazy::resolveNodeUnary(int tid, int Line 1059  DataLazy::resolveNodeUnary(int tid, int
1059    const double* left=&((*leftres)[roffset]);    const double* left=&((*leftres)[roffset]);
1060    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1061    double* result=&(m_samples[roffset]);    double* result=&(m_samples[roffset]);
1062      escript::ESFunction operation=SINF;
1063    switch (m_op)    switch (m_op)
1064    {    {
1065      case SIN:        case SIN:
1066          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::sin);      operation=SINF;
1067          break;      break;
1068      case COS:      case COS:
1069          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::cos);          operation=COSF;
1070          break;      break;
1071      case TAN:      case TAN:
1072          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::tan);          operation=TANF;
1073          break;      break;
1074      case ASIN:      case ASIN:
1075          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::asin);          operation=ASINF;
1076          break;      break;
1077      case ACOS:      case ACOS:
1078          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::acos);          operation=ACOSF;
1079          break;      break;
1080      case ATAN:      case ATAN:
1081          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::atan);          operation=ATANF;
1082          break;      break;
1083      case SINH:      case SINH:
1084          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::sinh);          operation=SINHF;
1085          break;      break;
1086      case COSH:      case COSH:
1087          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::cosh);          operation=COSHF;
1088          break;      break;
1089      case TANH:      case TANH:
1090          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::tanh);          operation=TANHF;
1091          break;      break;
1092      case ERF:      case ERF:
1093  #if defined (_WIN32) && !defined(__INTEL_COMPILER)          operation=ERFF;
1094          throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms.");      break;
 #else  
         tensor_unary_operation(m_samplesize, left, result, ::erf);  
         break;  
 #endif  
1095     case ASINH:     case ASINH:
1096  #if defined (_WIN32) && !defined(__INTEL_COMPILER)          operation=ASINHF;
1097          tensor_unary_operation(m_samplesize, left, result, escript::asinh_substitute);      break;
 #else  
         tensor_unary_operation(m_samplesize, left, result, ::asinh);  
 #endif    
         break;  
1098     case ACOSH:     case ACOSH:
1099  #if defined (_WIN32) && !defined(__INTEL_COMPILER)          operation=ACOSHF;
1100          tensor_unary_operation(m_samplesize, left, result, escript::acosh_substitute);      break;
 #else  
         tensor_unary_operation(m_samplesize, left, result, ::acosh);  
 #endif    
         break;  
1101     case ATANH:     case ATANH:
1102  #if defined (_WIN32) && !defined(__INTEL_COMPILER)          operation=ATANHF;
1103          tensor_unary_operation(m_samplesize, left, result, escript::atanh_substitute);      break;
 #else  
         tensor_unary_operation(m_samplesize, left, result, ::atanh);  
 #endif    
         break;  
1104      case LOG10:      case LOG10:
1105          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::log10);          operation=LOG10F;
1106          break;      break;
1107      case LOG:      case LOG:
1108          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::log);          operation=LOGF;
1109          break;      break;
1110      case SIGN:      case SIGN:
1111          tensor_unary_operation(m_samplesize, left, result, escript::fsign);          operation=SIGNF;
1112          break;      break;
1113      case ABS:      case ABS:
1114          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::fabs);          operation=ABSF;
1115          break;      break;
1116      case NEG:      case NEG:
1117          tensor_unary_operation(m_samplesize, left, result, negate<double>());          operation=NEGF;
1118          break;      break;
1119      case POS:      case POS:
1120          // it doesn't mean anything for delayed.          // it doesn't mean anything for delayed.
1121          // it will just trigger a deep copy of the lazy object          // it will just trigger a deep copy of the lazy object
1122          throw DataException("Programmer error - POS not supported for lazy data.");          throw DataException("Programmer error - POS not supported for lazy data.");
1123          break;          break;
1124      case EXP:      case EXP:
1125          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::exp);          operation=EXPF;
1126          break;      break;
1127      case SQRT:      case SQRT:
1128          tensor_unary_operation<double (*)(double)>(m_samplesize, left, result, ::sqrt);          operation=SQRTF;
1129          break;      break;
1130      case RECIP:      case RECIP:
1131          tensor_unary_operation(m_samplesize, left, result, bind1st(divides<double>(),1.));          operation=INVF;
1132          break;      break;
1133      case GZ:      case GZ:
1134          tensor_unary_operation(m_samplesize, left, result, bind2nd(greater<double>(),0.0));          operation=GTZEROF;
1135          break;      break;
1136      case LZ:      case LZ:
1137          tensor_unary_operation(m_samplesize, left, result, bind2nd(less<double>(),0.0));          operation=LTZEROF;
1138          break;      break;
1139      case GEZ:      case GEZ:
1140          tensor_unary_operation(m_samplesize, left, result, bind2nd(greater_equal<double>(),0.0));          operation=GEZEROF;
1141          break;      break;
1142      case LEZ:      case LEZ:
1143          tensor_unary_operation(m_samplesize, left, result, bind2nd(less_equal<double>(),0.0));          operation=LEZEROF;
1144          break;      break;
1145  // There are actually G_UNARY_P but I don't see a compelling reason to treat them differently  // There are actually G_UNARY_P but I don't see a compelling reason to treat them differently
1146      case NEZ:      case NEZ:
1147          tensor_unary_operation(m_samplesize, left, result, bind2nd(AbsGT(),m_tol));          operation=NEQZEROF;
1148          break;      break;
1149      case EZ:      case EZ:
1150          tensor_unary_operation(m_samplesize, left, result, bind2nd(AbsLTE(),m_tol));          operation=EQZEROF;
1151          break;      break;
   
1152      default:      default:
1153          throw DataException("Programmer error - resolveUnary can not resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - resolveUnary can not resolve operator "+opToString(m_op)+".");
1154    }    }
1155      tensor_unary_array_operation(m_samplesize,
1156                                 left,
1157                                 result,
1158                                 operation,
1159                                 m_tol);  
1160    return &(m_samples);    return &(m_samples);
1161  }  }
1162    
# Line 1227  DataLazy::resolveNodeReduction(int tid, Line 1190  DataLazy::resolveNodeReduction(int tid,
1190            for (unsigned int z=0;z<ndpps;++z)            for (unsigned int z=0;z<ndpps;++z)
1191            {            {
1192              FMin op;              FMin op;
1193              *result=DataMaths::reductionOp(*leftres, m_left->getShape(), loffset, op, numeric_limits<double>::max());              *result=escript::reductionOpVector(*leftres, m_left->getShape(), loffset, op, numeric_limits<double>::max());
1194              loffset+=psize;              loffset+=psize;
1195              result++;              result++;
1196            }            }
# Line 1238  DataLazy::resolveNodeReduction(int tid, Line 1201  DataLazy::resolveNodeReduction(int tid,
1201            for (unsigned int z=0;z<ndpps;++z)            for (unsigned int z=0;z<ndpps;++z)
1202            {            {
1203            FMax op;            FMax op;
1204            *result=DataMaths::reductionOp(*leftres, m_left->getShape(), loffset, op, numeric_limits<double>::max()*-1);            *result=escript::reductionOpVector(*leftres, m_left->getShape(), loffset, op, numeric_limits<double>::max()*-1);
1205            loffset+=psize;            loffset+=psize;
1206            result++;            result++;
1207            }            }
# Line 1265  DataLazy::resolveNodeNP1OUT(int tid, int Line 1228  DataLazy::resolveNodeNP1OUT(int tid, int
1228      throw DataException("Programmer error - resolveNodeNP1OUT should not be called on identity nodes.");      throw DataException("Programmer error - resolveNodeNP1OUT should not be called on identity nodes.");
1229    }    }
1230    size_t subroffset;    size_t subroffset;
1231    const ValueType* leftres=m_left->resolveNodeSample(tid, sampleNo, subroffset);    const RealVectorType* leftres=m_left->resolveNodeSample(tid, sampleNo, subroffset);
1232    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1233    size_t loop=0;    size_t loop=0;
1234    size_t numsteps=(m_readytype=='E')?getNumDPPSample():1;    size_t numsteps=(m_readytype=='E')?getNumDPPSample():1;
# Line 1276  DataLazy::resolveNodeNP1OUT(int tid, int Line 1239  DataLazy::resolveNodeNP1OUT(int tid, int
1239      case SYM:      case SYM:
1240          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1241          {          {
1242              DataMaths::symmetric(*leftres,m_left->getShape(),subroffset, m_samples, getShape(), offset);              escript::symmetric(*leftres,m_left->getShape(),subroffset, m_samples, getShape(), offset);
1243              subroffset+=step;              subroffset+=step;
1244              offset+=step;              offset+=step;
1245          }          }
# Line 1284  DataLazy::resolveNodeNP1OUT(int tid, int Line 1247  DataLazy::resolveNodeNP1OUT(int tid, int
1247      case NSYM:      case NSYM:
1248          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1249          {          {
1250              DataMaths::nonsymmetric(*leftres,m_left->getShape(),subroffset, m_samples, getShape(), offset);              escript::nonsymmetric(*leftres,m_left->getShape(),subroffset, m_samples, getShape(), offset);
1251              subroffset+=step;              subroffset+=step;
1252              offset+=step;              offset+=step;
1253          }          }
# Line 1311  DataLazy::resolveNodeNP1OUT_P(int tid, i Line 1274  DataLazy::resolveNodeNP1OUT_P(int tid, i
1274    }    }
1275    size_t subroffset;    size_t subroffset;
1276    size_t offset;    size_t offset;
1277    const ValueType* leftres=m_left->resolveNodeSample(tid, sampleNo, subroffset);    const RealVectorType* leftres=m_left->resolveNodeSample(tid, sampleNo, subroffset);
1278    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1279    offset=roffset;    offset=roffset;
1280    size_t loop=0;    size_t loop=0;
# Line 1323  DataLazy::resolveNodeNP1OUT_P(int tid, i Line 1286  DataLazy::resolveNodeNP1OUT_P(int tid, i
1286      case TRACE:      case TRACE:
1287          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1288          {          {
1289              DataMaths::trace(*leftres,m_left->getShape(),subroffset, m_samples ,getShape(),offset,m_axis_offset);              escript::trace(*leftres,m_left->getShape(),subroffset, m_samples ,getShape(),offset,m_axis_offset);
1290              subroffset+=instep;              subroffset+=instep;
1291              offset+=outstep;              offset+=outstep;
1292          }          }
# Line 1331  DataLazy::resolveNodeNP1OUT_P(int tid, i Line 1294  DataLazy::resolveNodeNP1OUT_P(int tid, i
1294      case TRANS:      case TRANS:
1295          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1296          {          {
1297              DataMaths::transpose(*leftres,m_left->getShape(),subroffset, m_samples, getShape(),offset,m_axis_offset);              escript::transpose(*leftres,m_left->getShape(),subroffset, m_samples, getShape(),offset,m_axis_offset);
1298              subroffset+=instep;              subroffset+=instep;
1299              offset+=outstep;              offset+=outstep;
1300          }          }
# Line 1356  DataLazy::resolveNodeNP1OUT_2P(int tid, Line 1319  DataLazy::resolveNodeNP1OUT_2P(int tid,
1319    }    }
1320    size_t subroffset;    size_t subroffset;
1321    size_t offset;    size_t offset;
1322    const ValueType* leftres=m_left->resolveNodeSample(tid, sampleNo, subroffset);    const RealVectorType* leftres=m_left->resolveNodeSample(tid, sampleNo, subroffset);
1323    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1324    offset=roffset;    offset=roffset;
1325    size_t loop=0;    size_t loop=0;
# Line 1368  DataLazy::resolveNodeNP1OUT_2P(int tid, Line 1331  DataLazy::resolveNodeNP1OUT_2P(int tid,
1331      case SWAP:      case SWAP:
1332          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1333          {          {
1334              DataMaths::swapaxes(*leftres,m_left->getShape(),subroffset, m_samples, getShape(),offset, m_axis_offset, m_transpose);              escript::swapaxes(*leftres,m_left->getShape(),subroffset, m_samples, getShape(),offset, m_axis_offset, m_transpose);
1335              subroffset+=instep;              subroffset+=instep;
1336              offset+=outstep;              offset+=outstep;
1337          }          }
# Line 1392  DataLazy::resolveNodeCondEval(int tid, i Line 1355  DataLazy::resolveNodeCondEval(int tid, i
1355    }    }
1356    size_t subroffset;    size_t subroffset;
1357    
1358    const ValueType* maskres=m_mask->resolveNodeSample(tid, sampleNo, subroffset);    const RealVectorType* maskres=m_mask->resolveNodeSample(tid, sampleNo, subroffset);
1359    const ValueType* srcres=0;    const RealVectorType* srcres=0;
1360    if ((*maskres)[subroffset]>0)    if ((*maskres)[subroffset]>0)
1361    {    {
1362          srcres=m_left->resolveNodeSample(tid, sampleNo, subroffset);          srcres=m_left->resolveNodeSample(tid, sampleNo, subroffset);
# Line 1536  LAZYDEBUG(cout << "Resolve binary: " << Line 1499  LAZYDEBUG(cout << "Resolve binary: " <<
1499    
1500    int resultStep=max(leftstep,rightstep);       // only one (at most) should be !=0    int resultStep=max(leftstep,rightstep);       // only one (at most) should be !=0
1501          // Get the values of sub-expressions          // Get the values of sub-expressions
1502    const ValueType* left=m_left->resolveNodeSample(tid,sampleNo,lroffset);          const RealVectorType* left=m_left->resolveNodeSample(tid,sampleNo,lroffset);      
1503    const ValueType* right=m_right->resolveNodeSample(tid,sampleNo,rroffset);    const RealVectorType* right=m_right->resolveNodeSample(tid,sampleNo,rroffset);
1504  LAZYDEBUG(cout << "Post sub calls in " << toString() << endl;)  LAZYDEBUG(cout << "Post sub calls in " << toString() << endl;)
1505  LAZYDEBUG(cout << "shapes=" << DataTypes::shapeToString(m_left->getShape()) << "," << DataTypes::shapeToString(m_right->getShape()) << endl;)  LAZYDEBUG(cout << "shapes=" << DataTypes::shapeToString(m_left->getShape()) << "," << DataTypes::shapeToString(m_right->getShape()) << endl;)
1506  LAZYDEBUG(cout << "chunksize=" << chunksize << endl << "leftstep=" << leftstep << " rightstep=" << rightstep;)  LAZYDEBUG(cout << "chunksize=" << chunksize << endl << "leftstep=" << leftstep << " rightstep=" << rightstep;)
# Line 1555  LAZYDEBUG(cout << "Right res["<< rroffse Line 1518  LAZYDEBUG(cout << "Right res["<< rroffse
1518    switch(m_op)    switch(m_op)
1519    {    {
1520      case ADD:      case ADD:
1521          PROC_OP(NO_ARG,plus<double>());          //PROC_OP(NO_ARG,plus<double>());
1522          escript::binaryOpVectorLazyHelper<real_t, real_t, real_t>(resultp,
1523                 &(*left)[0],
1524                 &(*right)[0],
1525                 chunksize,
1526                 onumsteps,
1527                 numsteps,
1528                 resultStep,
1529                 leftstep,
1530                 rightstep,
1531                 oleftstep,
1532                 orightstep,
1533                 lroffset,
1534                 rroffset,
1535                 escript::ESFunction::PLUSF);  
1536          break;          break;
1537      case SUB:      case SUB:
1538          PROC_OP(NO_ARG,minus<double>());        escript::binaryOpVectorLazyHelper<real_t, real_t, real_t>(resultp,
1539                 &(*left)[0],
1540                 &(*right)[0],
1541                 chunksize,
1542                 onumsteps,
1543                 numsteps,
1544                 resultStep,
1545                 leftstep,
1546                 rightstep,
1547                 oleftstep,
1548                 orightstep,
1549                 lroffset,
1550                 rroffset,
1551                 escript::ESFunction::MINUSF);        
1552            //PROC_OP(NO_ARG,minus<double>());
1553          break;          break;
1554      case MUL:      case MUL:
1555          PROC_OP(NO_ARG,multiplies<double>());          //PROC_OP(NO_ARG,multiplies<double>());
1556          escript::binaryOpVectorLazyHelper<real_t, real_t, real_t>(resultp,
1557                 &(*left)[0],
1558                 &(*right)[0],
1559                 chunksize,
1560                 onumsteps,
1561                 numsteps,
1562                 resultStep,
1563                 leftstep,
1564                 rightstep,
1565                 oleftstep,
1566                 orightstep,
1567                 lroffset,
1568                 rroffset,
1569                 escript::ESFunction::MULTIPLIESF);      
1570          break;          break;
1571      case DIV:      case DIV:
1572          PROC_OP(NO_ARG,divides<double>());          //PROC_OP(NO_ARG,divides<double>());
1573          escript::binaryOpVectorLazyHelper<real_t, real_t, real_t>(resultp,
1574                 &(*left)[0],
1575                 &(*right)[0],
1576                 chunksize,
1577                 onumsteps,
1578                 numsteps,
1579                 resultStep,
1580                 leftstep,
1581                 rightstep,
1582                 oleftstep,
1583                 orightstep,
1584                 lroffset,
1585                 rroffset,
1586                 escript::ESFunction::DIVIDESF);          
1587          break;          break;
1588      case POW:      case POW:
1589         PROC_OP(double (double,double),::pow);         //PROC_OP(double (double,double),::pow);
1590          escript::binaryOpVectorLazyHelper<real_t, real_t, real_t>(resultp,
1591                 &(*left)[0],
1592                 &(*right)[0],
1593                 chunksize,
1594                 onumsteps,
1595                 numsteps,
1596                 resultStep,
1597                 leftstep,
1598                 rightstep,
1599                 oleftstep,
1600                 orightstep,
1601                 lroffset,
1602                 rroffset,
1603                 escript::ESFunction::POWF);          
1604          break;          break;
1605      default:      default:
1606          throw DataException("Programmer error - resolveBinary can not resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - resolveBinary can not resolve operator "+opToString(m_op)+".");
# Line 1597  LAZYDEBUG(cout << "Resolve TensorProduct Line 1630  LAZYDEBUG(cout << "Resolve TensorProduct
1630    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1631    size_t offset=roffset;    size_t offset=roffset;
1632    
1633    const ValueType* left=m_left->resolveNodeSample(tid, sampleNo, lroffset);    const RealVectorType* left=m_left->resolveNodeSample(tid, sampleNo, lroffset);
1634    
1635    const ValueType* right=m_right->resolveNodeSample(tid, sampleNo, rroffset);    const RealVectorType* right=m_right->resolveNodeSample(tid, sampleNo, rroffset);
1636    
1637  LAZYDEBUG(cerr << "[Left shape]=" << DataTypes::shapeToString(m_left->getShape()) << "\n[Right shape]=" << DataTypes::shapeToString(m_right->getShape()) << " result=" <<DataTypes::shapeToString(getShape()) <<  endl;  LAZYDEBUG(cerr << "[Left shape]=" << DataTypes::shapeToString(m_left->getShape()) << "\n[Right shape]=" << DataTypes::shapeToString(m_right->getShape()) << " result=" <<DataTypes::shapeToString(getShape()) <<  endl;
1638  cout << getNoValues() << endl;)  cout << getNoValues() << endl;)
# Line 1736  DataLazy::resolveGroupWorker(std::vector Line 1769  DataLazy::resolveGroupWorker(std::vector
1769    {             // it is possible that dats[0] is one of the objects which we discarded and    {             // it is possible that dats[0] is one of the objects which we discarded and
1770                  // all the other functionspaces match.                  // all the other functionspaces match.
1771          vector<DataExpanded*> dep;          vector<DataExpanded*> dep;
1772          vector<ValueType*> vecs;          vector<RealVectorType*> vecs;
1773          for (int i=0;i<work.size();++i)          for (int i=0;i<work.size();++i)
1774          {          {
1775                  dep.push_back(new DataExpanded(fs,work[i]->getShape(), ValueType(work[i]->getNoValues())));                  dep.push_back(new DataExpanded(fs,work[i]->getShape(), RealVectorType(work[i]->getNoValues())));
1776                  vecs.push_back(&(dep[i]->getVectorRW()));                  vecs.push_back(&(dep[i]->getVectorRW()));
1777          }          }
1778          int totalsamples=work[0]->getNumSamples();          int totalsamples=work[0]->getNumSamples();
1779          const ValueType* res=0; // Storage for answer          const RealVectorType* res=0; // Storage for answer
1780          int sample;          int sample;
1781          #pragma omp parallel private(sample, res)          #pragma omp parallel private(sample, res)
1782          {          {
# Line 1795  DataLazy::resolveNodeWorker() Line 1828  DataLazy::resolveNodeWorker()
1828      return m_id;      return m_id;
1829    }    }
1830          // from this point on we must have m_op!=IDENTITY and m_readytype=='E'          // from this point on we must have m_op!=IDENTITY and m_readytype=='E'
1831    DataExpanded* result=new DataExpanded(getFunctionSpace(),getShape(),  ValueType(getNoValues()));    DataExpanded* result=new DataExpanded(getFunctionSpace(),getShape(),  RealVectorType(getNoValues()));
1832    ValueType& resvec=result->getVectorRW();    RealVectorType& resvec=result->getVectorRW();
1833    DataReady_ptr resptr=DataReady_ptr(result);    DataReady_ptr resptr=DataReady_ptr(result);
1834    
1835    int sample;    int sample;
1836    int totalsamples=getNumSamples();    int totalsamples=getNumSamples();
1837    const ValueType* res=0;       // Storage for answer    const RealVectorType* res=0;       // Storage for answer
1838  LAZYDEBUG(cout << "Total number of samples=" <<totalsamples << endl;)  LAZYDEBUG(cout << "Total number of samples=" <<totalsamples << endl;)
1839    #pragma omp parallel private(sample,res)    #pragma omp parallel private(sample,res)
1840    {    {

Legend:
Removed from v.5997  
changed lines
  Added in v.6088

  ViewVC Help
Powered by ViewVC 1.1.26