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

Diff of /trunk/finley/src/Mesh_createNodeFileMappings.c

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

revision 1315 by ksteube, Tue Sep 25 02:41:13 2007 UTC revision 1326 by ksteube, Mon Oct 1 08:10:41 2007 UTC
# Line 84  void Mesh_createDOFMappingAndCoupling(Fi Line 84  void Mesh_createDOFMappingAndCoupling(Fi
84      for (i=0;i<numNodes;++i) {      for (i=0;i<numNodes;++i) {
85         k=globalDOFIndex[i];         k=globalDOFIndex[i];
86  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
87         if ((k-min_DOF) >= len_loc_dof) { printf("BOUNDS_CHECK %s %i i=%i k=%i min_DOF=%i\n", __FILE__, __LINE__, i, k, min_DOF); exit(1); }         if ((k-min_DOF) >= len_loc_dof) { printf("BOUNDS_CHECK %s %d i=%d k=%d min_DOF=%d\n", __FILE__, __LINE__, i, k, min_DOF); exit(1); }
88  #endif  #endif
89         if (k>-1) locDOFMask[k-min_DOF]=UNUSED-1;         if (k>-1) locDOFMask[k-min_DOF]=UNUSED-1;
90      }      }
# Line 92  void Mesh_createDOFMappingAndCoupling(Fi Line 92  void Mesh_createDOFMappingAndCoupling(Fi
92      for (i=myFirstDOF-min_DOF;i<myLastDOF-min_DOF;++i) {      for (i=myFirstDOF-min_DOF;i<myLastDOF-min_DOF;++i) {
93        locDOFMask[i]=i-myFirstDOF+min_DOF;        locDOFMask[i]=i-myFirstDOF+min_DOF;
94  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
95        if (i < 0 || i >= len_loc_dof) { printf("BOUNDS_CHECK %s %i i=%i\n", __FILE__, __LINE__, i); exit(1); }        if (i < 0 || i >= len_loc_dof) { printf("BOUNDS_CHECK %s %d i=%d\n", __FILE__, __LINE__, i); exit(1); }
96  #endif  #endif
97      }      }
98    
# Line 105  void Mesh_createDOFMappingAndCoupling(Fi Line 105  void Mesh_createDOFMappingAndCoupling(Fi
105         if (p != myRank) {         if (p != myRank) {
106             for (i=firstDOF-min_DOF;i<lastDOF-min_DOF;++i) {             for (i=firstDOF-min_DOF;i<lastDOF-min_DOF;++i) {
107  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
108                     if (i < 0 || i >= len_loc_dof) { printf("BOUNDS_CHECK %s %i p=%i i=%i\n", __FILE__, __LINE__, p, i); exit(1); }                     if (i < 0 || i >= len_loc_dof) { printf("BOUNDS_CHECK %s %d p=%d i=%d\n", __FILE__, __LINE__, p, i); exit(1); }
109  #endif  #endif
110                  if (locDOFMask[i] == UNUSED-1) {                  if (locDOFMask[i] == UNUSED-1) {
111                     locDOFMask[i]=myLastDOF-myFirstDOF+n;                     locDOFMask[i]=myLastDOF-myFirstDOF+n;
# Line 115  void Mesh_createDOFMappingAndCoupling(Fi Line 115  void Mesh_createDOFMappingAndCoupling(Fi
115             if (n>lastn) {             if (n>lastn) {
116                neighbor[numNeighbors]=p;                neighbor[numNeighbors]=p;
117  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
118                if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %i p=%i numNeighbors=%i n=%i\n", __FILE__, __LINE__, p, numNeighbors, n); exit(1); }                if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d p=%d numNeighbors=%d n=%d\n", __FILE__, __LINE__, p, numNeighbors, n); exit(1); }
119  #endif  #endif
120                offsetInShared[numNeighbors]=lastn;                offsetInShared[numNeighbors]=lastn;
121                numNeighbors++;                numNeighbors++;
# Line 124  void Mesh_createDOFMappingAndCoupling(Fi Line 124  void Mesh_createDOFMappingAndCoupling(Fi
124          }          }
125      }      }
126  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
127      if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %i numNeighbors=%i\n", __FILE__, __LINE__, numNeighbors); exit(1); }      if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d numNeighbors=%d\n", __FILE__, __LINE__, numNeighbors); exit(1); }
128  #endif  #endif
129      offsetInShared[numNeighbors]=lastn;      offsetInShared[numNeighbors]=lastn;
130    
# Line 140  void Mesh_createDOFMappingAndCoupling(Fi Line 140  void Mesh_createDOFMappingAndCoupling(Fi
140      /* define how to get DOF values for controlled bu other processors */      /* define how to get DOF values for controlled bu other processors */
141  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
142      for (i=0;i<offsetInShared[numNeighbors];++i) {      for (i=0;i<offsetInShared[numNeighbors];++i) {
143        if (i < 0 || i >= numNodes*(p_max-p_min+1)) { printf("BOUNDS_CHECK %s %i i=%i\n", __FILE__, __LINE__, i); exit(1); }        if (i < 0 || i >= numNodes*(p_max-p_min+1)) { printf("BOUNDS_CHECK %s %d i=%d\n", __FILE__, __LINE__, i); exit(1); }
144      }      }
145  #endif  #endif
146      #pragma omp parallel for private(i) schedule(static)      #pragma omp parallel for private(i) schedule(static)
# Line 164  void Mesh_createDOFMappingAndCoupling(Fi Line 164  void Mesh_createDOFMappingAndCoupling(Fi
164             for (i=myFirstDOF-min_DOF;i<myLastDOF-min_DOF;++i) {             for (i=myFirstDOF-min_DOF;i<myLastDOF-min_DOF;++i) {
165                  if (locDOFMask[i] == p) {                  if (locDOFMask[i] == p) {
166  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
167             if (n < 0 || n >= numNodes*(p_max-p_min+1)) { printf("BOUNDS_CHECK %s %i p=%i i=%i n=%i\n", __FILE__, __LINE__, p, i, n); exit(1); }             if (n < 0 || n >= numNodes*(p_max-p_min+1)) { printf("BOUNDS_CHECK %s %d p=%d i=%d n=%d\n", __FILE__, __LINE__, p, i, n); exit(1); }
168  #endif  #endif
169                     shared[n]=i-myFirstDOF+min_DOF;                     shared[n]=i-myFirstDOF+min_DOF;
170                     ++n;                     ++n;
# Line 173  void Mesh_createDOFMappingAndCoupling(Fi Line 173  void Mesh_createDOFMappingAndCoupling(Fi
173             if (n>lastn) {             if (n>lastn) {
174                neighbor[numNeighbors]=p;                neighbor[numNeighbors]=p;
175  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
176                if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %i p=%i n=%i numNeighbors=%i\n", __FILE__, __LINE__, p, n, numNeighbors); exit(1); }                if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d p=%d n=%d numNeighbors=%d\n", __FILE__, __LINE__, p, n, numNeighbors); exit(1); }
177  #endif  #endif
178                offsetInShared[numNeighbors]=lastn;                offsetInShared[numNeighbors]=lastn;
179                numNeighbors++;                numNeighbors++;
# Line 182  void Mesh_createDOFMappingAndCoupling(Fi Line 182  void Mesh_createDOFMappingAndCoupling(Fi
182          }          }
183      }      }
184  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
185      if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %i numNeighbors=%i\n", __FILE__, __LINE__, numNeighbors); exit(1); }      if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d numNeighbors=%d\n", __FILE__, __LINE__, numNeighbors); exit(1); }
186  #endif  #endif
187      offsetInShared[numNeighbors]=lastn;      offsetInShared[numNeighbors]=lastn;
188      snd_shcomp=Paso_SharedComponents_alloc(numNeighbors,neighbor,shared,offsetInShared,1,0,dof_distribution->mpi_info);      snd_shcomp=Paso_SharedComponents_alloc(numNeighbors,neighbor,shared,offsetInShared,1,0,dof_distribution->mpi_info);

Legend:
Removed from v.1315  
changed lines
  Added in v.1326

  ViewVC Help
Powered by ViewVC 1.1.26