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

Diff of /trunk/finley/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 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16    
# Line 118  void Finley_Mesh_optimizeDOFDistribution Line 117  void Finley_Mesh_optimizeDOFDistribution
117                #pragma omp parallel for private(i)                #pragma omp parallel for private(i)
118                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);
119             }             }
 {  
 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;  
 }  
   
120    
121             if (Finley_noError()) {             if (Finley_noError()) {
122    
# Line 151  pattern->ptr[myNumVertices]=s; Line 135  pattern->ptr[myNumVertices]=s;
135           for (i=0; i<ncon; i++) ubvec[i] = 1.05;           for (i=0; i<ncon; i++) ubvec[i] = 1.05;
136           options[0] = 3;           options[0] = 3;
137           options[1] = 15;           options[1] = 15;
138    
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    for(i=0;i<pattern->ptr[k];++i) printf("%d ",pattern->index[i]);
157    printf("\n");
158    }
159    */
160           ParMETIS_V3_PartGeomKway(distribution,           ParMETIS_V3_PartGeomKway(distribution,
161                                   pattern->ptr,                                   pattern->ptr,
162                                   pattern->index,                                   pattern->index,
# Line 168  pattern->ptr[myNumVertices]=s; Line 174  pattern->ptr[myNumVertices]=s;
174                                   &edgecut,                                   &edgecut,
175                                   partition,             /* new CPU ownership of elements */                                   partition,             /* new CPU ownership of elements */
176                                   &(in->MPIInfo->comm));                                   &(in->MPIInfo->comm));
177           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));
178                   TMPMEMFREE(ubvec);                   TMPMEMFREE(ubvec);
179                   TMPMEMFREE(tpwgts);                   TMPMEMFREE(tpwgts);
180            } else {            } else {
# Line 250  pattern->ptr[myNumVertices]=s; Line 256  pattern->ptr[myNumVertices]=s;
256                }                }
257             }             }
258             for (i=0;i<mpiSize+1;++i) distribution[i]=new_distribution[i];             for (i=0;i<mpiSize+1;++i) distribution[i]=new_distribution[i];
   
             
259           }           }
260           TMPMEMFREE(index_list);           TMPMEMFREE(index_list);
261       }       }

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

  ViewVC Help
Powered by ViewVC 1.1.26