/[escript]/branches/domexper/dudley/src/Mesh_distributeByRankOfDOF.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/Mesh_distributeByRankOfDOF.c

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

revision 3080 by jfenwick, Tue Aug 3 04:28:03 2010 UTC revision 3086 by jfenwick, Thu Aug 5 05:07:58 2010 UTC
# Line 14  Line 14 
14    
15  /**************************************************************/  /**************************************************************/
16    
17  /*   Finley: Mesh: this will redistribute the Nodes and Elements including overlap */  /*   Dudley: Mesh: this will redistribute the Nodes and Elements including overlap */
18  /*   according to the dof_distribiution. It will create an element coloring but will not create any mappings. */  /*   according to the dof_distribiution. It will create an element coloring but will not create any mappings. */
19    
20  /**************************************************************/  /**************************************************************/
# Line 23  Line 23 
23    
24  /**************************************************************/  /**************************************************************/
25    
26  void Finley_Mesh_distributeByRankOfDOF(Finley_Mesh* self, index_t *dof_distribution) {  void Dudley_Mesh_distributeByRankOfDOF(Dudley_Mesh* self, index_t *dof_distribution) {
27    
28       index_t min_dof_id, max_dof_id, *tmp_node_localDOF_map=NULL, *tmp_node_localDOF_mask=NULL;       index_t min_dof_id, max_dof_id, *tmp_node_localDOF_map=NULL, *tmp_node_localDOF_mask=NULL;
29       Paso_MPI_rank* mpiRankOfDOF=NULL;       Paso_MPI_rank* mpiRankOfDOF=NULL;
# Line 32  void Finley_Mesh_distributeByRankOfDOF(F Line 32  void Finley_Mesh_distributeByRankOfDOF(F
32    
33       if (self==NULL) return;       if (self==NULL) return;
34       mpiRankOfDOF=TMPMEMALLOC(self->Nodes->numNodes,Paso_MPI_rank);       mpiRankOfDOF=TMPMEMALLOC(self->Nodes->numNodes,Paso_MPI_rank);
35       if (!Finley_checkPtr(mpiRankOfDOF)) {       if (!Dudley_checkPtr(mpiRankOfDOF)) {
36    
37    
38          Finley_NodeFile_assignMPIRankToDOFs(self->Nodes,mpiRankOfDOF,dof_distribution);          Dudley_NodeFile_assignMPIRankToDOFs(self->Nodes,mpiRankOfDOF,dof_distribution);
39    
40          /* first the elements are redistributed according to mpiRankOfDOF */          /* first the elements are redistributed according to mpiRankOfDOF */
41          /* at the input the Node tables refering to a the local labeling of the nodes */          /* at the input the Node tables refering to a the local labeling of the nodes */
42          /* while at the output they refer to the global labeling which is rectified in the next step */          /* while at the output they refer to the global labeling which is rectified in the next step */
43          if (Finley_noError()) Finley_ElementFile_distributeByRankOfDOF(self->Elements,mpiRankOfDOF, self->Nodes->Id);          if (Dudley_noError()) Dudley_ElementFile_distributeByRankOfDOF(self->Elements,mpiRankOfDOF, self->Nodes->Id);
44          if (Finley_noError()) Finley_ElementFile_distributeByRankOfDOF(self->FaceElements,mpiRankOfDOF, self->Nodes->Id);          if (Dudley_noError()) Dudley_ElementFile_distributeByRankOfDOF(self->FaceElements,mpiRankOfDOF, self->Nodes->Id);
45          if (Finley_noError()) Finley_ElementFile_distributeByRankOfDOF(self->ContactElements,mpiRankOfDOF, self->Nodes->Id);          if (Dudley_noError()) Dudley_ElementFile_distributeByRankOfDOF(self->ContactElements,mpiRankOfDOF, self->Nodes->Id);
46          if (Finley_noError()) Finley_ElementFile_distributeByRankOfDOF(self->Points,mpiRankOfDOF, self->Nodes->Id);          if (Dudley_noError()) Dudley_ElementFile_distributeByRankOfDOF(self->Points,mpiRankOfDOF, self->Nodes->Id);
47        
48          /* resolve the node ids */          /* resolve the node ids */
49          if (Finley_noError()) Finley_Mesh_resolveNodeIds(self);          if (Dudley_noError()) Dudley_Mesh_resolveNodeIds(self);
50        
51          /* create a local labeling of the DOFs */          /* create a local labeling of the DOFs */
52          Finley_NodeFile_setDOFRange(&min_dof_id,&max_dof_id,self->Nodes);          Dudley_NodeFile_setDOFRange(&min_dof_id,&max_dof_id,self->Nodes);
53          len=max_dof_id-min_dof_id+1;          len=max_dof_id-min_dof_id+1;
54          tmp_node_localDOF_mask=TMPMEMALLOC(len,index_t); /* local mask for used nodes */          tmp_node_localDOF_mask=TMPMEMALLOC(len,index_t); /* local mask for used nodes */
55          tmp_node_localDOF_map=TMPMEMALLOC(self->Nodes->numNodes,index_t);          tmp_node_localDOF_map=TMPMEMALLOC(self->Nodes->numNodes,index_t);
56          if (! ( (Finley_checkPtr(tmp_node_localDOF_mask) && Finley_checkPtr(tmp_node_localDOF_map) ) ) ) {          if (! ( (Dudley_checkPtr(tmp_node_localDOF_mask) && Dudley_checkPtr(tmp_node_localDOF_map) ) ) ) {
57        
58            #pragma omp parallel for private(n) schedule(static)            #pragma omp parallel for private(n) schedule(static)
59            for (n=0;n<len;n++) tmp_node_localDOF_mask[n]=-1;            for (n=0;n<len;n++) tmp_node_localDOF_mask[n]=-1;
# Line 83  void Finley_Mesh_distributeByRankOfDOF(F Line 83  void Finley_Mesh_distributeByRankOfDOF(F
83                tmp_node_localDOF_map[n]=k;                tmp_node_localDOF_map[n]=k;
84            }            }
85            /* create element coloring */            /* create element coloring */
86            if (Finley_noError()) Finley_Mesh_createColoring(self,tmp_node_localDOF_map);            if (Dudley_noError()) Dudley_Mesh_createColoring(self,tmp_node_localDOF_map);
87            
88          }          }
89          TMPMEMFREE(tmp_node_localDOF_mask);          TMPMEMFREE(tmp_node_localDOF_mask);

Legend:
Removed from v.3080  
changed lines
  Added in v.3086

  ViewVC Help
Powered by ViewVC 1.1.26