/[escript]/branches/domexper/dudley/src/CPPAdapter/MeshAdapter.cpp
ViewVC logotype

Diff of /branches/domexper/dudley/src/CPPAdapter/MeshAdapter.cpp

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

revision 3227 by jfenwick, Thu Sep 30 06:07:08 2010 UTC revision 3231 by jfenwick, Fri Oct 1 01:53:46 2010 UTC
# Line 18  Line 18 
18  #ifdef USE_NETCDF  #ifdef USE_NETCDF
19  #include <netcdfcpp.h>  #include <netcdfcpp.h>
20  #endif  #endif
21  #ifdef PASO_MPI  #ifdef ESYS_MPI
22  #include <mpi.h>  #include "esysUtils/Esys_MPI.h"
 #include "paso/Paso_MPI.h"  
23  #endif  #endif
24  extern "C" {  extern "C" {
25  #include "esysUtils/blocktimer.h"  #include "esysUtils/blocktimer.h"
# Line 81  int MeshAdapter::getMPIRank() const Line 80  int MeshAdapter::getMPIRank() const
80  }  }
81  void MeshAdapter::MPIBarrier() const  void MeshAdapter::MPIBarrier() const
82  {  {
83  #ifdef PASO_MPI  #ifdef ESYS_MPI
84     MPI_Barrier(m_dudleyMesh.get()->MPIInfo->comm);     MPI_Barrier(m_dudleyMesh.get()->MPIInfo->comm);
85  #endif  #endif
86     return;     return;
# Line 92  bool MeshAdapter::onMasterProcessor() co Line 91  bool MeshAdapter::onMasterProcessor() co
91  }  }
92    
93    
94  #ifdef PASO_MPI  #ifdef ESYS_MPI
95    MPI_Comm    MPI_Comm
96  #else  #else
97    unsigned int    unsigned int
98  #endif  #endif
99  MeshAdapter::getMPIComm() const  MeshAdapter::getMPIComm() const
100  {  {
101  #ifdef PASO_MPI  #ifdef ESYS_MPI
102      return m_dudleyMesh->MPIInfo->comm;      return m_dudleyMesh->MPIInfo->comm;
103  #else  #else
104      return 0;      return 0;
# Line 143  void MeshAdapter::dump(const string& fil Line 142  void MeshAdapter::dump(const string& fil
142     int num_Points           = mesh->Points->numElements;     int num_Points           = mesh->Points->numElements;
143     int num_Elements_numNodes        = mesh->Elements->numNodes;     int num_Elements_numNodes        = mesh->Elements->numNodes;
144     int num_FaceElements_numNodes    = mesh->FaceElements->numNodes;     int num_FaceElements_numNodes    = mesh->FaceElements->numNodes;
145  #ifdef PASO_MPI  #ifdef ESYS_MPI
146     MPI_Status status;     MPI_Status status;
147  #endif  #endif
148    
149  /* Incoming token indicates it's my turn to write */  /* Incoming token indicates it's my turn to write */
150  #ifdef PASO_MPI  #ifdef ESYS_MPI
151     if (mpi_rank>0) MPI_Recv(&num_Tags, 0, MPI_INT, mpi_rank-1, 81800, mesh->MPIInfo->comm, &status);     if (mpi_rank>0) MPI_Recv(&num_Tags, 0, MPI_INT, mpi_rank-1, 81800, mesh->MPIInfo->comm, &status);
152  #endif  #endif
153    
154     char *newFileName = Paso_MPI_appendRankToFileName(fileName.c_str(),     char *newFileName = Esys_MPI_appendRankToFileName(fileName.c_str(),
155                                                       mpi_size, mpi_rank);                                                       mpi_size, mpi_rank);
156    
157     /* Figure out how much storage is required for tags */     /* Figure out how much storage is required for tags */
# Line 224  void MeshAdapter::dump(const string& fil Line 223  void MeshAdapter::dump(const string& fil
223        throw DataException(msgPrefix+"add_att(num_Elements_numNodes)");        throw DataException(msgPrefix+"add_att(num_Elements_numNodes)");
224     if (!dataFile.add_att("num_FaceElements_numNodes",num_FaceElements_numNodes) )     if (!dataFile.add_att("num_FaceElements_numNodes",num_FaceElements_numNodes) )
225        throw DataException(msgPrefix+"add_att(num_FaceElements_numNodes)");        throw DataException(msgPrefix+"add_att(num_FaceElements_numNodes)");
226     if (!dataFile.add_att("Elements_TypeId", mesh->Elements->referenceElementSet->referenceElement->Type->TypeId) )     if (!dataFile.add_att("Elements_TypeId", mesh->Elements->etype) )
227        throw DataException(msgPrefix+"add_att(Elements_TypeId)");        throw DataException(msgPrefix+"add_att(Elements_TypeId)");
228     if (!dataFile.add_att("FaceElements_TypeId", mesh->FaceElements->referenceElementSet->referenceElement->Type->TypeId) )     if (!dataFile.add_att("FaceElements_TypeId", mesh->FaceElements->etype) )
229        throw DataException(msgPrefix+"add_att(FaceElements_TypeId)");        throw DataException(msgPrefix+"add_att(FaceElements_TypeId)");
230     if (!dataFile.add_att("Points_TypeId", mesh->Points->referenceElementSet->referenceElement->Type->TypeId) )     if (!dataFile.add_att("Points_TypeId", mesh->Points->etype) )
231        throw DataException(msgPrefix+"add_att(Points_TypeId)");        throw DataException(msgPrefix+"add_att(Points_TypeId)");
232     if (!dataFile.add_att("num_Tags", num_Tags) )     if (!dataFile.add_att("num_Tags", num_Tags) )
233        throw DataException(msgPrefix+"add_att(num_Tags)");        throw DataException(msgPrefix+"add_att(num_Tags)");
# Line 471  void MeshAdapter::dump(const string& fil Line 470  void MeshAdapter::dump(const string& fil
470     }     }
471    
472  /* Send token to next MPI process so he can take his turn */  /* Send token to next MPI process so he can take his turn */
473  #ifdef PASO_MPI  #ifdef ESYS_MPI
474     if (mpi_rank<mpi_size-1) MPI_Send(&num_Tags, 0, MPI_INT, mpi_rank+1, 81800, mesh->MPIInfo->comm);     if (mpi_rank<mpi_size-1) MPI_Send(&num_Tags, 0, MPI_INT, mpi_rank+1, 81800, mesh->MPIInfo->comm);
475  #endif  #endif
476    
# Line 1368  void MeshAdapter::saveVTK(const string& Line 1367  void MeshAdapter::saveVTK(const string&
1367    
1368  bool MeshAdapter::ownSample(int fs_code, index_t id) const  bool MeshAdapter::ownSample(int fs_code, index_t id) const
1369  {  {
1370  #ifdef PASO_MPI  #ifdef ESYS_MPI
1371      index_t myFirstNode=0, myLastNode=0, k=0;      index_t myFirstNode=0, myLastNode=0, k=0;
1372      index_t* globalNodeIndex=0;      index_t* globalNodeIndex=0;
1373      Dudley_Mesh* mesh_p=m_dudleyMesh.get();      Dudley_Mesh* mesh_p=m_dudleyMesh.get();

Legend:
Removed from v.3227  
changed lines
  Added in v.3231

  ViewVC Help
Powered by ViewVC 1.1.26