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

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

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

revision 1006 by ksteube, Wed Feb 21 00:26:26 2007 UTC revision 1007 by gross, Mon Mar 5 01:00:53 2007 UTC
# Line 26  Line 26 
26  /* Translate from distributed/local array indices to global indices */  /* Translate from distributed/local array indices to global indices */
27    
28  #ifdef PASO_MPI  #ifdef PASO_MPI
29  int Finley_IndexList_localToGlobal(Finley_NodeDistribution *dofDistribution, int my_CPU, int localIndex) {  int Finley_IndexList_localToGlobal(Finley_NodeDistribution *dofDistribution, int localIndex) {
30    /*    /*
31      get global id of icol      get global id of icol
32      if icol is internal node (on this CPU): use icol+vtxdist[my_CPU]      if icol is internal node (on this CPU): use icol+vtxdist[my_CPU]
33      else use indexExternal[icol-numLocal] to get global index of node      else use indexExternal[icol-numLocal] to get global index of node
34      (actually DOF...the NodeDistribution structure should have been called DofDistribution)      (actually DOF...the NodeDistribution structure should have been called DofDistribution)
35    */    */
36      index_t my_CPU=dofDistribution->MPIInfo->rank;
37    if (localIndex < dofDistribution->numLocal) {    if (localIndex < dofDistribution->numLocal) {
38      localIndex = localIndex + dofDistribution->vtxdist[my_CPU];      localIndex = localIndex + dofDistribution->vtxdist[my_CPU];
39    }    }
# Line 120  void Finley_IndexList_insertElements(Fin Line 121  void Finley_IndexList_insertElements(Fin
121                 /* Get the local col ID */                 /* Get the local col ID */
122                         icol=col_Label[elements->Nodes[INDEX2(col_node[kc],e,NN)]];                         icol=col_Label[elements->Nodes[INDEX2(col_node[kc],e,NN)]];
123                 /* Convert to global col ID (row ID is saved as local value) */                 /* Convert to global col ID (row ID is saved as local value) */
124                 icol = Finley_IndexList_localToGlobal(col_degreeOfFreedomDistribution, my_CPU, icol);                 icol = Finley_IndexList_localToGlobal(col_degreeOfFreedomDistribution, icol);
125                         Finley_IndexList_insertIndex(&(index_list[irow]),icol);                         Finley_IndexList_insertIndex(&(index_list[irow]),icol);
                printf("ksteube Finley_IndexList_insertIndex cpu= %d irow= %d icol= %d\n", my_CPU, irow, icol);  
126                      }                      }
127            }            }
128                  }                  }

Legend:
Removed from v.1006  
changed lines
  Added in v.1007

  ViewVC Help
Powered by ViewVC 1.1.26