/[escript]/trunk/paso/src/Pattern_getSubpattern.c
ViewVC logotype

Diff of /trunk/paso/src/Pattern_getSubpattern.c

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

revision 3641 by gross, Tue Oct 26 07:54:58 2010 UTC revision 3642 by caltinay, Thu Oct 27 03:41:51 2011 UTC
# Line 14  Line 14 
14    
15  /**************************************************************/  /**************************************************************/
16    
17  /* Paso: PatternPattern */  /* Paso: Pattern */
18    
19  /**************************************************************/  /**************************************************************/
20    
# Line 46  Paso_Pattern* Paso_Pattern_getSubpattern Line 46  Paso_Pattern* Paso_Pattern_getSubpattern
46          #pragma omp for private(i) schedule(static)          #pragma omp for private(i) schedule(static)
47          for (i=0;i<newNumRows+1;++i) ptr[i]=0;          for (i=0;i<newNumRows+1;++i) ptr[i]=0;
48                    
49          /* find the number column entries in each row */          /* find the number of column entries in each row */
50          #pragma omp for private(i,k,j,subpattern_row) schedule(static)          #pragma omp for private(i,k,j,subpattern_row) schedule(static)
51          for (i=0;i<newNumRows;++i) {          for (i=0;i<newNumRows;++i) {
52              j=0;              j=0;
# Line 57  Paso_Pattern* Paso_Pattern_getSubpattern Line 57  Paso_Pattern* Paso_Pattern_getSubpattern
57              ptr[i]=j;              ptr[i]=j;
58          }          }
59       }       }
60       /* accummulate ptr */       /* accumulate ptr */
61       ptr[newNumRows]=Paso_Util_cumsum(newNumRows,ptr);       ptr[newNumRows]=Paso_Util_cumsum(newNumRows,ptr);
62       index=MEMALLOC(ptr[newNumRows],index_t);       index=MEMALLOC(ptr[newNumRows],index_t);
63       if (Esys_checkPtr(index))  {       if (Esys_checkPtr(index))  {
64          MEMFREE(ptr);          MEMFREE(ptr);
65       } else {       } else {
66          /* find the number column entries in each row */          /* find the number of column entries in each row */
67          #pragma omp parallel for private(i,k,j,subpattern_row,tmp) schedule(static)          #pragma omp parallel for private(i,k,j,subpattern_row,tmp) schedule(static)
68          for (i=0;i<newNumRows;++i) {          for (i=0;i<newNumRows;++i) {
69               j=ptr[i];               j=ptr[i];
# Line 87  Paso_Pattern* Paso_Pattern_getSubpattern Line 87  Paso_Pattern* Paso_Pattern_getSubpattern
87    }    }
88    return out;    return out;
89  }  }
90    

Legend:
Removed from v.3641  
changed lines
  Added in v.3642

  ViewVC Help
Powered by ViewVC 1.1.26