/[escript]/trunk/paso/src/Paso_MPI.h
ViewVC logotype

Contents of /trunk/paso/src/Paso_MPI.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 790 - (show annotations)
Wed Jul 26 23:12:34 2006 UTC (12 years, 11 months ago) by bcumming
File MIME type: text/plain
File size: 785 byte(s)
changes to escript/py_src/pdetools.py and /escript/src/Data.h/.cpp to
make the Locator work in MPI. escript::Data::mindp now returns a 3 tuple,
with the MPI rank of the process on which the minimum value occurs
included. escript::Data::convertToNumArrayFromDPNo also takes the ProcNo
to perform the MPI reduction.

This had to be implemented in both the MPI and non-MPI versions to allow
the necesary changes to the Python code in pdetools.py. In the non-MPI
version ProcNo is set to 0. This works for the explicit scripts tested
thus far, however if it causes problems in your scripts contact Ben or
Lutz, or revert the three files (pdetools.py, Data.h and Data.cpp) to
the previous version.  


1 #ifndef INC_MPI
2 #define INC_MPI
3
4 #include "Common.h"
5
6 #ifdef PASO_MPI
7
8 #include "mpi_C.h"
9
10 #define PASO_MPI_TODO { fprintf( stdout, "\nTODO : %s:%d\n", __FILE__, __LINE__); MPI_Finalize(); exit(1); }
11 #define PASO_INFO_ERRORMSG( err, msg ) { char _msg__[256]; sprintf( _msg__, "%s : %s:%d\n", msg, __FILE__, __LINE__ ); Paso_setError( err, _msg__ ); }
12
13 /* Datatypes */
14 struct Paso_MPIInfo{
15 dim_t reference_counter;
16 int size;
17 int rank;
18 MPI_Comm comm;
19 };
20
21 typedef struct Paso_MPIInfo Paso_MPIInfo;
22
23 /* Function prototypes */
24 Paso_MPIInfo* Paso_MPIInfo_alloc( MPI_Comm comm );
25 void Paso_MPIInfo_dealloc( Paso_MPIInfo* );
26 Paso_MPIInfo *Paso_MPIInfo_getReference( Paso_MPIInfo* in );
27 int Paso_MPI_initialized( void );
28
29 #endif // INC_PASO_MPI
30
31 #endif // PASO_MPI

  ViewVC Help
Powered by ViewVC 1.1.26