/[escript]/trunk/finley/src/CPPAdapter/MeshAdapter.cpp
ViewVC logotype

Diff of /trunk/finley/src/CPPAdapter/MeshAdapter.cpp

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

revision 1796 by jfenwick, Wed Sep 17 01:45:46 2008 UTC revision 1801 by ksteube, Fri Sep 19 01:37:09 2008 UTC
# Line 19  Line 19 
19  #ifdef USE_NETCDF  #ifdef USE_NETCDF
20  #include <netcdfcpp.h>  #include <netcdfcpp.h>
21  #endif  #endif
22    #ifdef PASO_MPI
23    #include <mpi.h>
24    #include "paso/Paso_MPI.h"
25    #endif
26  extern "C" {  extern "C" {
27  #include "escript/blocktimer.h"  #include "escript/blocktimer.h"
28  }  }
# Line 123  void MeshAdapter::dump(const std::string Line 127  void MeshAdapter::dump(const std::string
127     int num_Elements_numNodes        = mesh->Elements->numNodes;     int num_Elements_numNodes        = mesh->Elements->numNodes;
128     int num_FaceElements_numNodes    = mesh->FaceElements->numNodes;     int num_FaceElements_numNodes    = mesh->FaceElements->numNodes;
129     int num_ContactElements_numNodes = mesh->ContactElements->numNodes;     int num_ContactElements_numNodes = mesh->ContactElements->numNodes;
130    #ifdef PASO_MPI
131       MPI_Status status;
132    #endif
133    
134    /* Incoming token indicates it's my turn to write */
135    #ifdef PASO_MPI
136       if (mpi_rank>0) MPI_Recv(&num_Tags, 0, MPI_INT, mpi_rank-1, 81800, mesh->MPIInfo->comm, &status);
137    #endif
138    
139     char *newFileName = Paso_MPI_appendRankToFileName(fileName.c_str(),     char *newFileName = Paso_MPI_appendRankToFileName(fileName.c_str(),
140                                                       mpi_size, mpi_rank);                                                       mpi_size, mpi_rank);
141    
142     /* Figure out how much storage is required for tags */     /* Figure out how much storage is required for tags */
143     tag_map = mesh->TagMap;     tag_map = mesh->TagMap;
144       num_Tags = 0;
145     if (tag_map) {     if (tag_map) {
146        while (tag_map) {        while (tag_map) {
147           num_Tags++;           num_Tags++;
# Line 492  void MeshAdapter::dump(const std::string Line 505  void MeshAdapter::dump(const std::string
505    
506     }     }
507    
508    /* Send token to next MPI process so he can take his turn */
509    #ifdef PASO_MPI
510       if (mpi_rank<mpi_size-1) MPI_Send(&num_Tags, 0, MPI_INT, mpi_rank+1, 81800, mesh->MPIInfo->comm);
511    #endif
512    
513     // NetCDF file is closed by destructor of NcFile object     // NetCDF file is closed by destructor of NcFile object
514    
515  #else  #else
516     Finley_setError(IO_ERROR, "MeshAdapter::dump: not configured with NetCDF. Please contact your installation manager.");     Finley_setError(IO_ERROR, "MeshAdapter::dump: not configured with NetCDF. Please contact your installation manager.");
517  #endif  /* USE_NETCDF */  #endif  /* USE_NETCDF */

Legend:
Removed from v.1796  
changed lines
  Added in v.1801

  ViewVC Help
Powered by ViewVC 1.1.26