/[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 2761 by lgao, Thu Nov 19 01:04:57 2009 UTC revision 2762 by lgao, Thu Nov 19 06:24:44 2009 UTC
# Line 3058  std::string Line 3058  std::string
3058  Data::toString() const  Data::toString() const
3059  {  {
3060      int localNeedSummary=0;      int localNeedSummary=0;
3061    #ifdef PASO_MPI
3062      int size = get_MPISize();      int size = get_MPISize();
3063      int* globalNeedSummary = new int[size];      int* globalNeedSummary = new int[size];
3064      int i, flag;  #endif
3065        int i, flag=0;
3066    
3067      if (!m_data->isEmpty() &&      if (!m_data->isEmpty() &&
3068      !m_data->isLazy() &&      !m_data->isLazy() &&
# Line 3068  Data::toString() const Line 3070  Data::toString() const
3070      {      {
3071      localNeedSummary=1;      localNeedSummary=1;
3072      }      }
3073    
3074    #ifdef PASO_MPI
3075      flag = MPI_Gather (&localNeedSummary, 1, MPI_INT, globalNeedSummary, 1, MPI_INT, 0, get_MPIComm() );      flag = MPI_Gather (&localNeedSummary, 1, MPI_INT, globalNeedSummary, 1, MPI_INT, 0, get_MPIComm() );
3076    
3077      if( get_MPIRank()==0 ){      if( get_MPIRank()==0 ){
3078        flag = 0;
3079          for (i=0; i<size; i++)          for (i=0; i<size; i++)
3080          if (globalNeedSummary[i] == 1) break;          if (globalNeedSummary[i] == 1) break;
3081      if (i < size) flag = 1;      if (i < size) flag = 1;
# Line 3079  Data::toString() const Line 3084  Data::toString() const
3084      MPI_Bcast( &flag, 1, MPI_INT, 0, get_MPIComm() );      MPI_Bcast( &flag, 1, MPI_INT, 0, get_MPIComm() );
3085      delete [] globalNeedSummary;      delete [] globalNeedSummary;
3086    
3087    #else
3088    
3089       if (localNeedSummary == 1) flag = 1;
3090    
3091    #endif
3092    
3093      if (flag){      if (flag){
3094      stringstream temp;      stringstream temp;
3095      temp << "Summary: inf="<< inf_const() << " sup=" << sup_const() << " data points=" << getNumDataPoints();      temp << "Summary: inf="<< inf_const() << " sup=" << sup_const() << " data points=" << getNumDataPoints();

Legend:
Removed from v.2761  
changed lines
  Added in v.2762

  ViewVC Help
Powered by ViewVC 1.1.26