/[escript]/trunk/finley/src/NodeDistribution_calculateIndexExternal.c
ViewVC logotype

Contents of /trunk/finley/src/NodeDistribution_calculateIndexExternal.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 751 - (show annotations)
Mon Jun 26 01:46:34 2006 UTC (13 years, 3 months ago) by bcumming
File MIME type: text/plain
File size: 1535 byte(s)
Changes relating to the MPI version of escript
The standard OpenMP version of escript is unchanged

- updated data types (Finley_Mesh, Finley_NodeFile, etc) to store meshes
  over multiple MPI processes.
- added CommBuffer code in Paso for communication of Data associated
  with distributed meshes
- updates in Finley and Escript to support distributed data and operations
  on distributed data (such as interpolation).
- construction of RHS in MPI, so that simple explicit schemes (such as
  /docs/examples/wave.py without IO and the Locator) can run in MPI.
- updated mesh generation for first order line, rectangle and brick
  meshes and second order line meshes in MPI.        
- small changes to trunk/SConstruct and trunk/scons/ess_options.py to
  build the MPI version, these changes are turned off by default.

1 #include "Distribution.h"
2
3 #ifdef PASO_MPI
4 void Finley_NodeDistribution_calculateIndexExternal( Finley_NodeDistribution *Distribution, Paso_CommBuffer *CommBuffer )
5 {
6 index_t i, n, thisDom=Distribution->MPIInfo->rank;
7 index_t *buffer=NULL;
8 dim_t bufferLength=0;
9
10 for( n=0; n<Distribution->numNeighbours; n++ )
11 if( Distribution->edges[n]->numForward>bufferLength )
12 bufferLength = Distribution->edges[n]->numForward;
13 else if( Distribution->edges[n]->numBackward>bufferLength )
14 bufferLength = Distribution->edges[n]->numBackward;
15
16 buffer = TMPMEMALLOC( bufferLength, index_t );
17
18 /* send updated global indices for local DOF that are to neighbours for whom they are external */
19 for( n=0; n<Distribution->numNeighbours; n++ ){
20 for( i=0; i<Distribution->edges[n]->numForward; i++ )
21 buffer[i] = Distribution->vtxdist[thisDom] + Distribution->edges[n]->indexForward[i];
22 Paso_CommBuffer_pack( CommBuffer, Distribution->neighbours[n], NULL, buffer, sizeof(index_t), 0 );
23 Paso_CommBuffer_send( CommBuffer, Distribution->neighbours[n], sizeof(index_t) );
24 }
25
26 /* receive updated global indices for external DOF from neighbours */
27 for( n=0; n<Distribution->numNeighbours; n++ ){
28 Paso_CommBuffer_recv( CommBuffer, Distribution->neighbours[n], sizeof(index_t) );
29 Paso_CommBuffer_unpack( CommBuffer, Distribution->neighbours[n], Distribution->edges[n]->indexBackward, Distribution->indexExternal, sizeof(index_t), -Distribution->numLocal );
30 }
31
32 TMPMEMFREE( buffer );
33 }
34 #endif
35

  ViewVC Help
Powered by ViewVC 1.1.26