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

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

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

revision 3439 by gross, Fri Oct 29 02:08:37 2010 UTC revision 3440 by gross, Fri Jan 14 00:04:53 2011 UTC
# Line 50  bool_t Paso_Util_isAny(dim_t N,index_t* Line 50  bool_t Paso_Util_isAny(dim_t N,index_t*
50     return out;     return out;
51  }  }
52    
53    /* returnsthe maximum value in array */
54    index_t Paso_Util_iMax(const dim_t N,const index_t* array) {
55       index_t out=INDEX_T_MIN;
56       register index_t out2;
57       dim_t i;
58       if (N>0) {
59           #pragma omp parallel private(i, out2)
60           {
61           out2=INDEX_T_MIN;
62               #pragma omp for schedule(static)
63               for (i=0;i<N;i++) out2 = MAX(out2, array[i]);
64    
65               #pragma omp critical
66               {
67                       out = MAX(out, out2);
68           }
69           }
70       }
71       return out;
72    }
73    
74  /**************************************************************/  /**************************************************************/
75    
76  /* calculates the cummultative sum in array and returns the total sum */  /* calculates the cummultative sum in array and returns the total sum */

Legend:
Removed from v.3439  
changed lines
  Added in v.3440

  ViewVC Help
Powered by ViewVC 1.1.26