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

Diff of /trunk/finley/src/Mesh_getPattern.c

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

revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC
# Line 20  Line 20 
20    
21  /* returns a reference to the matrix pattern                  */  /* returns a reference to the matrix pattern                  */
22    
23  Finley_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,int reduce_row_order, int reduce_col_order) {  Finley_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order) {
24     Finley_SystemMatrixPattern *out=NULL;     Finley_SystemMatrixPattern *out=NULL;
25     Finley_ErrorCode=NO_ERROR;     Finley_ErrorCode=NO_ERROR;
26     /* make sure that the requested pattern is available */     /* make sure that the requested pattern is available */
# Line 54  Finley_SystemMatrixPattern* Finley_getPa Line 54  Finley_SystemMatrixPattern* Finley_getPa
54     }       }  
55     return out;     return out;
56  }  }
57  Finley_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,int reduce_row_order, int reduce_col_order) {  Finley_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order) {
58    double time0;    double time0;
59    maybelong i,n,s,itmp;    dim_t i,n;
60    maybelong *rowLabel=NULL,*colLabel=NULL, *ptr=NULL, *index=NULL;    index_t s,itmp,*rowLabel=NULL,*colLabel=NULL, *ptr=NULL, *index=NULL;
61    Finley_IndexList* index_list=NULL;    Finley_IndexList* index_list=NULL;
62    Finley_ErrorCode=NO_ERROR;    Finley_ErrorCode=NO_ERROR;
63        
# Line 79  Finley_SystemMatrixPattern* Finley_makeP Line 79  Finley_SystemMatrixPattern* Finley_makeP
79    }    }
80    
81    index_list=TMPMEMALLOC(n,Finley_IndexList);    index_list=TMPMEMALLOC(n,Finley_IndexList);
82    ptr=MEMALLOC(n+1,maybelong);    ptr=MEMALLOC(n+1,index_t);
83    if (! (Finley_checkPtr(index_list) || Finley_checkPtr(ptr)) ) {    if (! (Finley_checkPtr(index_list) || Finley_checkPtr(ptr)) ) {
84        #pragma omp parallel private(i,s,itmp)        #pragma omp parallel private(i,s,itmp)
85        {        {
# Line 99  Finley_SystemMatrixPattern* Finley_makeP Line 99  Finley_SystemMatrixPattern* Finley_makeP
99                                          reduce_row_order,rowLabel,reduce_col_order,colLabel);                                          reduce_row_order,rowLabel,reduce_col_order,colLabel);
100          /* get the number of connections per row */          /* get the number of connections per row */
101          #pragma omp for schedule(static)          #pragma omp for schedule(static)
102          for(i=0;i<n;++i) ptr[i]=Finley_IndexList_count(&index_list[i]);          for(i=0;i<n;++i) {
103                ptr[i]=Finley_IndexList_count(&index_list[i]);
104            }
105          /* accumalate ptr */          /* accumalate ptr */
106          /* OMP */          /* OMP */
107          #pragma omp master          #pragma omp master
# Line 112  Finley_SystemMatrixPattern* Finley_makeP Line 114  Finley_SystemMatrixPattern* Finley_makeP
114              }              }
115              ptr[n]=s;              ptr[n]=s;
116              /* fill index */              /* fill index */
117              index=MEMALLOC(ptr[n],maybelong);              index=MEMALLOC(ptr[n],index_t);
118          }          }
119          #pragma omp barrier          #pragma omp barrier
120          if (! Finley_checkPtr(index)) {          if (! Finley_checkPtr(index)) {
# Line 139  Finley_SystemMatrixPattern* Finley_makeP Line 141  Finley_SystemMatrixPattern* Finley_makeP
141  }  }
142  /*  /*
143   * $Log$   * $Log$
144     * Revision 1.3  2005/07/08 04:07:52  jgs
145     * Merge of development branch back to main trunk on 2005-07-08
146     *
147   * Revision 1.2  2004/12/15 07:08:33  jgs   * Revision 1.2  2004/12/15 07:08:33  jgs
148   * *** empty log message ***   * *** empty log message ***
149   *   *
150     * Revision 1.1.2.5  2005/06/30 01:53:55  gross
151     * a bug in coloring fixed
152     *
153     * Revision 1.1.2.4  2005/06/29 02:34:51  gross
154     * some changes towards 64 integers in finley
155     *
156   * Revision 1.1.2.3  2004/11/24 01:37:14  gross   * Revision 1.1.2.3  2004/11/24 01:37:14  gross
157   * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now   * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
158   *   *

Legend:
Removed from v.102  
changed lines
  Added in v.123

  ViewVC Help
Powered by ViewVC 1.1.26