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

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

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

revision 1722 by gross, Fri Aug 22 04:20:30 2008 UTC revision 1763 by gross, Mon Sep 8 02:47:55 2008 UTC
# Line 118  void Finley_Mesh_optimizeDOFDistribution Line 118  void Finley_Mesh_optimizeDOFDistribution
118                #pragma omp parallel for private(i)                #pragma omp parallel for private(i)
119                for(i=0;i<myNumVertices;++i) Finley_IndexList_free(index_list[i].extension);                for(i=0;i<myNumVertices;++i) Finley_IndexList_free(index_list[i].extension);
120             }             }
 {  
 int s=0, s0;  
 for (i=0;i<myNumVertices;++i) {  
     s0=s;  
     for (j=pattern->ptr[i];j<pattern->ptr[i+1];++j) {  
         if (pattern->index[j] != myFirstVertex+i) {  
             pattern->index[s]=pattern->index[j];  
             s++;  
         }  
      }  
      pattern->ptr[i]=s0;  
 }  
 pattern->ptr[myNumVertices]=s;  
 }  
   
121    
122             if (Finley_noError()) {             if (Finley_noError()) {
123    
# Line 151  pattern->ptr[myNumVertices]=s; Line 136  pattern->ptr[myNumVertices]=s;
136           for (i=0; i<ncon; i++) ubvec[i] = 1.05;           for (i=0; i<ncon; i++) ubvec[i] = 1.05;
137           options[0] = 3;           options[0] = 3;
138           options[1] = 15;           options[1] = 15;
139    
140    {
141    int k=distribution[in->MPIInfo->rank+1]-distribution[in->MPIInfo->rank];
142    int min_i,max_i;
143    printf("INPUT PARMETIS: %d\n",k);
144    for(i=0;i<in->MPIInfo->size+1;++i) printf("%d ",distribution[i]);
145    printf("\n");
146    min_i=pattern->index[0];
147    max_i=pattern->index[0];
148    for(i=0;i<pattern->ptr[k];++i) {
149    min_i=MIN(min_i,pattern->index[i]);
150    max_i=MAX(max_i,pattern->index[i]);
151    }
152    printf("index range = %d : %d\n",min_i,max_i);
153    
154    for(i=0;i<k+1;++i) printf("%d ",pattern->ptr[i]);
155    printf("\n");
156    /*
157    for(i=0;i<pattern->ptr[k];++i) printf("%d ",pattern->index[i]);
158    printf("\n");
159    */
160    }
161    
162           ParMETIS_V3_PartGeomKway(distribution,           ParMETIS_V3_PartGeomKway(distribution,
163                                   pattern->ptr,                                   pattern->ptr,
164                                   pattern->index,                                   pattern->index,
# Line 168  pattern->ptr[myNumVertices]=s; Line 176  pattern->ptr[myNumVertices]=s;
176                                   &edgecut,                                   &edgecut,
177                                   partition,             /* new CPU ownership of elements */                                   partition,             /* new CPU ownership of elements */
178                                   &(in->MPIInfo->comm));                                   &(in->MPIInfo->comm));
179           printf("ParMETIS number of edges cut by partitioning: %d\n", edgecut);           printf("ParMETIS number of edges cut by partitioning per processor: %d\n", edgecut/MAX(in->MPIInfo->size,1));
180                   TMPMEMFREE(ubvec);                   TMPMEMFREE(ubvec);
181                   TMPMEMFREE(tpwgts);                   TMPMEMFREE(tpwgts);
182            } else {            } else {
# Line 250  pattern->ptr[myNumVertices]=s; Line 258  pattern->ptr[myNumVertices]=s;
258                }                }
259             }             }
260             for (i=0;i<mpiSize+1;++i) distribution[i]=new_distribution[i];             for (i=0;i<mpiSize+1;++i) distribution[i]=new_distribution[i];
   
             
261           }           }
262           TMPMEMFREE(index_list);           TMPMEMFREE(index_list);
263       }       }

Legend:
Removed from v.1722  
changed lines
  Added in v.1763

  ViewVC Help
Powered by ViewVC 1.1.26