/[escript]/trunk-mpi-branch/finley/src/NodeFile_scatter.c
ViewVC logotype

Diff of /trunk-mpi-branch/finley/src/NodeFile_scatter.c

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

revision 1222 by ksteube, Tue Feb 13 22:56:57 2007 UTC revision 1223 by gross, Fri Aug 3 02:40:39 2007 UTC
# Line 29  Line 29 
29    
30  /**************************************************************/  /**************************************************************/
31    
32  void Finley_NodeFile_scatter(index_t* index, Finley_NodeFile* in, Finley_NodeFile* out) {  void Finley_NodeFile_scatterEntries(dim_t n, index_t* index, index_t min_index, index_t max_index,
33     dim_t i,j;                                     index_t* Id_out, index_t* Id_in,
34     index_t k;                                     index_t* Tag_out, index_t* Tag_in,
35     if (in->Id!=NULL) {                                     index_t* globalDegreesOfFreedom_out, index_t* globalDegreesOfFreedom_in,
36       #pragma omp parallel for private(i,j,k) schedule(static)                                     dim_t numDim, double* Coordinates_out, double* Coordinates_in)
37       for (i=0;i<in->numNodes;i++) {  {
38          k=index[i];     dim_t i;
39  #ifdef PASO_MPI     register index_t k;
40          out->Dom[k]=in->Dom[i];     register const index_t range=max_index-min_index;
41  #endif     const  size_t numDim_size=(size_t)numDim*sizeof(double);
42          out->Id[k]=in->Id[i];  
43          out->Tag[k]=in->Tag[i];     #pragma omp parallel for private(i,k) schedule(static)
44          out->degreeOfFreedom[k]=in->degreeOfFreedom[i];     for (i=0;i<n;i++) {
45          for(j=0;j<in->numDim;j++) out->Coordinates[INDEX2(j,k,in->numDim)]=in->Coordinates[INDEX2(j,i,in->numDim)];        k=index[i]-min_index;
46       }        if ((k>=0) && (k <range)) {
47       out->isPrepared=FINLEY_UNPREPARED;           Id_out[k]=Id_in[i];
48             Tag_out[k]=Tag_in[i];
49             globalDegreesOfFreedom_out[k]=globalDegreesOfFreedom_in[i];
50             memcpy(&(Coordinates_out[INDEX2(0,k,numDim)]), &(Coordinates_in[INDEX2(0,i,numDim)]), numDim_size);
51          }
52     }     }
53  }  }
54    
55    void Finley_NodeFile_scatter(index_t* index, Finley_NodeFile* in, Finley_NodeFile* out)
56    {
57       Finley_NodeFile_scatterEntries(out->numNodes, index, 0, in->numNodes,
58                                      out->Id, in->Id,
59                                      out->Tag, in->Tag,
60                                      out->globalDegreesOfFreedom, in->globalDegreesOfFreedom,
61                                      out->numDim, out->Coordinates, in->Coordinates);
62       out->isPrepared=FINLEY_UNPREPARED;
63    }

Legend:
Removed from v.1222  
changed lines
  Added in v.1223

  ViewVC Help
Powered by ViewVC 1.1.26