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

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

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

revision 1225 by gross, Fri Aug 3 05:46:30 2007 UTC revision 1226 by gross, Fri Aug 3 08:00:07 2007 UTC
# Line 25  Line 25 
25    
26  /**************************************************************/  /**************************************************************/
27    
28  void Finley_Mesh_prepare(Finley_Mesh* in) {  void Finley_Mesh_prepare(Finley_Mesh* in, bool_t optimize) {
29    
30       dim_t newGlobalNumDOFs=0;       dim_t newGlobalNumDOFs=0;
31       Paso_MPI_rank* mpiRankOfDOF=NULL;       Paso_MPI_rank* mpiRankOfDOF=NULL;
# Line 51  void Finley_Mesh_prepare(Finley_Mesh* in Line 51  void Finley_Mesh_prepare(Finley_Mesh* in
51          if (Finley_noError()) Finley_Mesh_distributeByRankOfDOF(in,mpiRankOfDOF);          if (Finley_noError()) Finley_Mesh_distributeByRankOfDOF(in,mpiRankOfDOF);
52       }       }
53       TMPMEMFREE(mpiRankOfDOF);       TMPMEMFREE(mpiRankOfDOF);
      TMPMEMFREE(distribution);  
      if (!Finley_noError()) return;  
54    
55       /* at this stage we are able to start an optimization of the DOF distribution using ParaMetis */       /* at this stage we are able to start an optimization of the DOF distribution using ParaMetis */
56             /* on return mpiRankOfDOF has been assigns a new rank to each node/DOF. It needs to include   */
57         /* the overlap                                                                                */
58         if (Finley_noError() && optimize && in->MPIInfo->size>1) {
59             mpiRankOfDOF=TMPMEMALLOC(in->Nodes->numNodes,Paso_MPI_rank);
60             if (!Finley_checkPtr(mpiRankOfDOF)) {
61    
62                 Finley_Mesh_optimizeDOFDistribution(in,distribution,mpiRankOfDOF);
63    
64                 if (Finley_noError()) Finley_Mesh_distributeByRankOfDOF(in,mpiRankOfDOF);
65             }
66             TMPMEMFREE(mpiRankOfDOF);
67         }
68         TMPMEMFREE(distribution);
69       /* now a local labeling of the DOF is introduced */       /* now a local labeling of the DOF is introduced */
70         if (Finley_noError() && optimize) {
71           printf("Warning: no local node labeling optimization implemented yet.\n");
72         }
73  return;  return;
74    
75        /* set the labeling vectors in node files: */        /* set the labeling vectors in node files: */

Legend:
Removed from v.1225  
changed lines
  Added in v.1226

  ViewVC Help
Powered by ViewVC 1.1.26