/[escript]/branches/arrayview_from_1695_trunk/escript/src/DataFactory.cpp
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/escript/src/DataFactory.cpp

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

revision 1780 by jfenwick, Wed Sep 3 04:56:50 2008 UTC revision 1781 by jfenwick, Thu Sep 11 05:03:14 2008 UTC
# Line 22  Line 22 
22  #ifdef USE_NETCDF  #ifdef USE_NETCDF
23  #include <netcdfcpp.h>  #include <netcdfcpp.h>
24  #endif  #endif
25    #ifdef PASO_MPI
26    #include <mpi.h>
27    #endif
28    
29  using namespace boost::python;  using namespace boost::python;
30    
# Line 78  Data Line 81  Data
81  load(const std::string fileName,  load(const std::string fileName,
82       const AbstractDomain& domain)       const AbstractDomain& domain)
83  {  {
    #ifdef PASO_MPI  
    throw DataException("Error - load :: not implemented for MPI yet.");  
    #endif  
   
84     #ifdef USE_NETCDF     #ifdef USE_NETCDF
85     NcAtt *type_att, *rank_att, *function_space_type_att;     NcAtt *type_att, *rank_att, *function_space_type_att;
86     // netCDF error handler     // netCDF error handler
87     NcError err(NcError::silent_nonfatal);     NcError err(NcError::silent_nonfatal);
88       int mpi_iam=0, mpi_num=1;
89     // Create the file.     // Create the file.
90     NcFile dataFile(fileName.c_str(), NcFile::ReadOnly);  #ifdef PASO_MPI
91       MPI_Comm_rank(MPI_COMM_WORLD, &mpi_iam);
92       MPI_Comm_size(MPI_COMM_WORLD, &mpi_num);
93    #endif
94       char *newFileName = Escript_MPI_appendRankToFileName(fileName.c_str(), mpi_num, mpi_iam);
95       NcFile dataFile(newFileName, NcFile::ReadOnly);
96     if (!dataFile.is_valid())     if (!dataFile.is_valid())
97          throw DataException("Error - load:: opening of netCDF file for input failed.");          throw DataException("Error - load:: opening of netCDF file for input failed.");
98     /* recover function space */     /* recover function space */

Legend:
Removed from v.1780  
changed lines
  Added in v.1781

  ViewVC Help
Powered by ViewVC 1.1.26