/[escript]/branches/doubleplusgood/dudley/src/NodeFile_gather.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/dudley/src/NodeFile_gather.cpp

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

revision 4331 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4332 by jfenwick, Thu Mar 21 04:21:14 2013 UTC
# Line 78  void Dudley_NodeFile_gather_global(index Line 78  void Dudley_NodeFile_gather_global(index
78      Dudley_NodeFile_setGlobalIdRange(&min_id, &max_id, in);      Dudley_NodeFile_setGlobalIdRange(&min_id, &max_id, in);
79      undefined_node = min_id - 1;      undefined_node = min_id - 1;
80    
81      distribution = TMPMEMALLOC(in->MPIInfo->size + 1, index_t);      distribution = new  index_t[in->MPIInfo->size + 1];
82    
83      if (!Dudley_checkPtr(distribution))      if (!Dudley_checkPtr(distribution))
84      {      {
85      /* distribute the range of node ids */      /* distribute the range of node ids */
86      buffer_len = Esys_MPIInfo_setDistribution(in->MPIInfo, min_id, max_id, distribution);      buffer_len = Esys_MPIInfo_setDistribution(in->MPIInfo, min_id, max_id, distribution);
87      /* allocate buffers */      /* allocate buffers */
88      Id_buffer = TMPMEMALLOC(buffer_len, index_t);      Id_buffer = new  index_t[buffer_len];
89      Tag_buffer = TMPMEMALLOC(buffer_len, index_t);      Tag_buffer = new  index_t[buffer_len];
90      globalDegreesOfFreedom_buffer = TMPMEMALLOC(buffer_len, index_t);      globalDegreesOfFreedom_buffer = new  index_t[buffer_len];
91      Coordinates_buffer = TMPMEMALLOC(buffer_len * out->numDim, double);      Coordinates_buffer = new  double[buffer_len * out->numDim];
92      if (!(Dudley_checkPtr(Id_buffer) || Dudley_checkPtr(Tag_buffer) ||      if (!(Dudley_checkPtr(Id_buffer) || Dudley_checkPtr(Tag_buffer) ||
93            Dudley_checkPtr(globalDegreesOfFreedom_buffer) || Dudley_checkPtr(Coordinates_buffer)))            Dudley_checkPtr(globalDegreesOfFreedom_buffer) || Dudley_checkPtr(Coordinates_buffer)))
94      {      {
# Line 179  void Dudley_NodeFile_gather_global(index Line 179  void Dudley_NodeFile_gather_global(index
179          }          }
180    
181      }      }
182      TMPMEMFREE(Id_buffer);      delete[] Id_buffer;
183      TMPMEMFREE(Tag_buffer);      delete[] Tag_buffer;
184      TMPMEMFREE(globalDegreesOfFreedom_buffer);      delete[] globalDegreesOfFreedom_buffer;
185      TMPMEMFREE(Coordinates_buffer);      delete[] Coordinates_buffer;
186      }      }
187      TMPMEMFREE(distribution);      delete[] distribution;
188      /* make sure that the error is global */      /* make sure that the error is global */
189      Esys_MPIInfo_noError(in->MPIInfo);      Esys_MPIInfo_noError(in->MPIInfo);
190  }  }

Legend:
Removed from v.4331  
changed lines
  Added in v.4332

  ViewVC Help
Powered by ViewVC 1.1.26