/[escript]/trunk/dudley/src/NodeFile_gather.c
ViewVC logotype

Diff of /trunk/dudley/src/NodeFile_gather.c

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

revision 3602 by jfenwick, Mon Oct 11 01:48:14 2010 UTC revision 3603 by caltinay, Mon Sep 19 03:42:53 2011 UTC
# Line 62  void Dudley_NodeFile_gather(index_t * in Line 62  void Dudley_NodeFile_gather(index_t * in
62  void Dudley_NodeFile_gather_global(index_t * index, Dudley_NodeFile * in, Dudley_NodeFile * out)  void Dudley_NodeFile_gather_global(index_t * index, Dudley_NodeFile * in, Dudley_NodeFile * out)
63  {  {
64      index_t min_id, max_id, undefined_node;      index_t min_id, max_id, undefined_node;
65      Esys_MPI_rank buffer_rank, dest, source, *distribution = NULL;      Esys_MPI_rank buffer_rank, *distribution = NULL;
66      index_t *Id_buffer = NULL, *Tag_buffer = NULL, *globalDegreesOfFreedom_buffer = NULL;      index_t *Id_buffer = NULL, *Tag_buffer = NULL, *globalDegreesOfFreedom_buffer = NULL;
67      double *Coordinates_buffer = NULL;      double *Coordinates_buffer = NULL;
68      dim_t p, buffer_len, n;      dim_t p, buffer_len, n;
69      char error_msg[100];      char error_msg[100];
70  #ifdef ESYS_MPI  #ifdef ESYS_MPI
71        Esys_MPI_rank dest, source;
72      MPI_Status status;      MPI_Status status;
73  #endif  #endif
74    
# Line 95  void Dudley_NodeFile_gather_global(index Line 96  void Dudley_NodeFile_gather_global(index
96          Id_buffer[n] = undefined_node;          Id_buffer[n] = undefined_node;
97    
98          /* fill the buffer by sending portions around in a circle */          /* fill the buffer by sending portions around in a circle */
99    #ifdef ESYS_MPI
100          dest = Esys_MPIInfo_mod(in->MPIInfo->size, in->MPIInfo->rank + 1);          dest = Esys_MPIInfo_mod(in->MPIInfo->size, in->MPIInfo->rank + 1);
101          source = Esys_MPIInfo_mod(in->MPIInfo->size, in->MPIInfo->rank - 1);          source = Esys_MPIInfo_mod(in->MPIInfo->size, in->MPIInfo->rank - 1);
102    #endif
103          buffer_rank = in->MPIInfo->rank;          buffer_rank = in->MPIInfo->rank;
104          for (p = 0; p < in->MPIInfo->size; ++p)          for (p = 0; p < in->MPIInfo->size; ++p)
105          {          {
# Line 127  void Dudley_NodeFile_gather_global(index Line 130  void Dudley_NodeFile_gather_global(index
130                             out->numDim, Coordinates_buffer, in->Coordinates);                             out->numDim, Coordinates_buffer, in->Coordinates);
131          }          }
132          /* now entries are collected from the buffer again by sending the entries around in a circle */          /* now entries are collected from the buffer again by sending the entries around in a circle */
133    #ifdef ESYS_MPI
134          dest = Esys_MPIInfo_mod(in->MPIInfo->size, in->MPIInfo->rank + 1);          dest = Esys_MPIInfo_mod(in->MPIInfo->size, in->MPIInfo->rank + 1);
135          source = Esys_MPIInfo_mod(in->MPIInfo->size, in->MPIInfo->rank - 1);          source = Esys_MPIInfo_mod(in->MPIInfo->size, in->MPIInfo->rank - 1);
136    #endif
137          buffer_rank = in->MPIInfo->rank;          buffer_rank = in->MPIInfo->rank;
138          for (p = 0; p < in->MPIInfo->size; ++p)          for (p = 0; p < in->MPIInfo->size; ++p)
139          {          {

Legend:
Removed from v.3602  
changed lines
  Added in v.3603

  ViewVC Help
Powered by ViewVC 1.1.26