/[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 2851 by jfenwick, Fri Dec 18 03:41:09 2009 UTC revision 2852 by jfenwick, Mon Jan 18 00:22:23 2010 UTC
# Line 3151  Data::borrowReadyPtr() const Line 3151  Data::borrowReadyPtr() const
3151  std::string  std::string
3152  Data::toString() const  Data::toString() const
3153  {  {
3154    
3155      int localNeedSummary=0;      int localNeedSummary=0;
3156  #ifdef PASO_MPI  #ifdef PASO_MPI
     int size = get_MPISize();  
     int* globalNeedSummary = new int[size];  
3157      int i;      int i;
3158        int globalNeedSummary=0;
3159  #endif  #endif
     int flag=0;  
   
3160      if (!m_data->isEmpty() &&      if (!m_data->isEmpty() &&
3161      !m_data->isLazy() &&      !m_data->isLazy() &&
3162      getLength()>escriptParams.getInt("TOO_MANY_LINES"))      getLength()>escriptParams.getInt("TOO_MANY_LINES"))
# Line 3167  Data::toString() const Line 3165  Data::toString() const
3165      }      }
3166    
3167  #ifdef PASO_MPI  #ifdef PASO_MPI
3168      flag = MPI_Gather (&localNeedSummary, 1, MPI_INT, globalNeedSummary, 1, MPI_INT, 0, get_MPIComm() );      MPI_Allreduce( &localNeedSummary, &globalNeedSummary, 1, MPI_INT, MPI_MAX, get_MPIComm() );
3169        localNeedSummary=globalNeedSummary;
     if( get_MPIRank()==0 ){  
     flag = 0;  
         for (i=0; i<size; i++)  
         if (globalNeedSummary[i] == 1) break;  
     if (i < size) flag = 1;  
     }  
 #else  
   
    if (localNeedSummary == 1) flag = 1;  
   
3170  #endif  #endif
3171    
3172      if (flag){      if (localNeedSummary){
3173      stringstream temp;      stringstream temp;
3174      temp << "Summary: inf="<< inf_const() << " sup=" << sup_const() << " data points=" << getNumDataPoints();      temp << "Summary: inf="<< inf_const() << " sup=" << sup_const() << " data points=" << getNumDataPoints();
3175      return  temp.str();      return  temp.str();

Legend:
Removed from v.2851  
changed lines
  Added in v.2852

  ViewVC Help
Powered by ViewVC 1.1.26