~vcs-imports/escript-finley/trunk

« back to all changes in this revision

Viewing changes to escript/src/DataConstant.cpp

  • Committer: jfenwick
  • Date: 2010-10-11 01:48:14 UTC
  • Revision ID: svn-v4:77569008-7704-0410-b7a0-a92fef0b09fd:trunk:3259
Merging dudley and scons updates from branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include "DataConstant.h"
17
17
#include "DataException.h"
18
18
#include "esysUtils/EsysAssert.h"
 
19
#include "esysUtils/Esys_MPI.h"
19
20
 
20
21
#include <iostream>
21
22
#include <boost/python/extract.hpp>
 
23
#include <boost/scoped_ptr.hpp>
22
24
#ifdef USE_NETCDF
23
25
#include <netcdfcpp.h>
24
26
#endif
25
 
#ifdef PASO_MPI
26
 
#include <mpi.h>
27
 
#endif
28
27
 
29
 
#include <boost/python/extract.hpp>
30
 
#include <boost/scoped_ptr.hpp>
31
28
#include "DataMaths.h"
32
29
 
33
30
// #define CHECK_FOR_EX_WRITE if (!checkNoSharing()) {throw DataException("Attempt to modify shared object");}
290
287
   DataTypes::ShapeType shape = getShape();
291
288
   int mpi_iam=getFunctionSpace().getDomain()->getMPIRank();
292
289
   int mpi_num=getFunctionSpace().getDomain()->getMPISize();
293
 
#ifdef PASO_MPI
 
290
#ifdef ESYS_MPI
294
291
   MPI_Status status;
295
292
#endif
296
293
 
297
 
#ifdef PASO_MPI
 
294
#ifdef ESYS_MPI
298
295
   /* Serialize NetCDF I/O */
299
296
   if (mpi_iam>0) MPI_Recv(&ndims, 0, MPI_INT, mpi_iam-1, 81802, MPI_COMM_WORLD, &status);
300
297
#endif
345
342
        throw DataException("Error - DataConstant:: appending variable to netCDF file failed.");
346
343
   if (! (var->put(d_ptr,dims)) )
347
344
         throw DataException("Error - DataConstant:: copy data to netCDF buffer failed.");
348
 
#ifdef PASO_MPI
 
345
#ifdef ESYS_MPI
349
346
   if (mpi_iam<mpi_num-1) MPI_Send(&ndims, 0, MPI_INT, mpi_iam+1, 81802, MPI_COMM_WORLD);
350
347
#endif
351
348
   #else