/[escript]/branches/doubleplusgood/dudley/src/ElementFile_gather.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/dudley/src/ElementFile_gather.cpp

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

revision 3086 by jfenwick, Thu Aug 5 05:07:58 2010 UTC revision 3224 by jfenwick, Wed Sep 29 05:19:37 2010 UTC
# Line 11  Line 11 
11  *  *
12  *******************************************************/  *******************************************************/
13    
   
14  /**************************************************************/  /**************************************************************/
15    
16  /*   Dudley: ElementFile */  /*   Dudley: ElementFile */
# Line 26  Line 25 
25    
26  /**************************************************************/  /**************************************************************/
27    
28  void Dudley_ElementFile_gather(index_t* index, Dudley_ElementFile* in, Dudley_ElementFile* out) {  void Dudley_ElementFile_gather(index_t * index, Dudley_ElementFile * in, Dudley_ElementFile * out)
29     index_t k;  {
30     dim_t e,j;      index_t k;
31     dim_t NN_in=in->numNodes;      dim_t e, j;
32     dim_t NN_out=out->numNodes;      dim_t NN_in = in->numNodes;
33     if (in!=NULL) {      dim_t NN_out = out->numNodes;
34       /*OMP */      if (in != NULL)
35       #pragma omp parallel for private(e,k,j) schedule(static)      {
36       for (e=0;e<out->numElements;e++) {      /*OMP */
37          k=index[e];  #pragma omp parallel for private(e,k,j) schedule(static)
38          out->Id[e]=in->Id[k];      for (e = 0; e < out->numElements; e++)
39          out->Tag[e]=in->Tag[k];      {
40          out->Owner[e]=in->Owner[k];          k = index[e];
41          out->Color[e]=in->Color[k]+out->maxColor+1;          out->Id[e] = in->Id[k];
42          for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,e,NN_out)]=in->Nodes[INDEX2(j,k,NN_in)];          out->Tag[e] = in->Tag[k];
43       }          out->Owner[e] = in->Owner[k];
44       out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);          out->Color[e] = in->Color[k] + out->maxColor + 1;
45       out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);          for (j = 0; j < MIN(NN_out, NN_in); j++)
46     }          out->Nodes[INDEX2(j, e, NN_out)] = in->Nodes[INDEX2(j, k, NN_in)];
47        }
48        out->minColor = MIN(out->minColor, in->minColor + out->maxColor + 1);
49        out->maxColor = MAX(out->maxColor, in->maxColor + out->maxColor + 1);
50        }
51  }  }

Legend:
Removed from v.3086  
changed lines
  Added in v.3224

  ViewVC Help
Powered by ViewVC 1.1.26