/[escript]/trunk/escript/src/Data.cpp
ViewVC logotype

Diff of /trunk/escript/src/Data.cpp

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

revision 3602 by jfenwick, Fri Sep 2 07:19:31 2011 UTC revision 3603 by caltinay, Mon Sep 19 03:42:53 2011 UTC
# Line 1699  Data::lazyAlgWorker(double init) Line 1699  Data::lazyAlgWorker(double init)
1699     const size_t numsamples=getNumSamples();     const size_t numsamples=getNumSamples();
1700     const size_t samplesize=getNoValues()*getNumDataPointsPerSample();     const size_t samplesize=getNoValues()*getNumDataPointsPerSample();
1701     BinaryOp operation;     BinaryOp operation;
1702     bool foundnan=false;     double localValue=0, globalValue;
    double localval=0;  
1703     #pragma omp parallel private(i)     #pragma omp parallel private(i)
1704     {     {
1705      double localtot=init;      double localtot=init;
# Line 1718  Data::lazyAlgWorker(double init) Line 1717  Data::lazyAlgWorker(double init)
1717          {          {
1718          #pragma omp critical          #pragma omp critical
1719          {          {
1720              foundnan=true;              localValue=1.0;
             localval=1.0;  
1721          }          }
1722          }          }
1723      }      }
# Line 1727  Data::lazyAlgWorker(double init) Line 1725  Data::lazyAlgWorker(double init)
1725      val=operation(val,localtot);      val=operation(val,localtot);
1726     }     }
1727  #ifdef ESYS_MPI  #ifdef ESYS_MPI
1728     double globalValue;     MPI_Allreduce( &localValue, &globalValue, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
1729     MPI_Allreduce( &localval, &globalValue, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );  #else
1730     if (globalValue!=0)     globalValue=localValue;
    {  
     foundnan=true;  
    }  
1731  #endif  #endif
1732     if (foundnan)     if (globalValue!=0)
1733     {     {
1734      return makeNaN();      return makeNaN();
1735     }     }

Legend:
Removed from v.3602  
changed lines
  Added in v.3603

  ViewVC Help
Powered by ViewVC 1.1.26