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

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

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

revision 1315 by ksteube, Tue Sep 25 02:41:13 2007 UTC revision 1361 by gross, Fri Dec 14 09:26:51 2007 UTC
# Line 120  void Paso_Pattern_mis(Paso_Pattern* patt Line 120  void Paso_Pattern_mis(Paso_Pattern* patt
120  #undef IS_IN_MIS_NOW  #undef IS_IN_MIS_NOW
121  #undef IS_IN_MIS  #undef IS_IN_MIS
122  #undef IS_CONNECTED_TO_MIS  #undef IS_CONNECTED_TO_MIS
123    
124    void Paso_Pattern_color(Paso_Pattern* pattern, index_t* num_colors, index_t* colorOf) {
125      index_t out=0, *mis_marker=NULL,i;
126      dim_t n=pattern->numOutput;
127      mis_marker=TMPMEMALLOC(n,index_t);
128      if ( !Paso_checkPtr(mis_marker) ) {
129        /* get coloring */
130        #pragma omp parallel for private(i) schedule(static)
131        for (i = 0; i < n; ++i) colorOf[i]=-1;
132    
133        while (Paso_Util_isAny(n,colorOf,-1) && Paso_noError()) {
134           #pragma omp parallel for private(i) schedule(static)
135           for (i = 0; i < n; ++i) mis_marker[i]=colorOf[i];
136           Paso_Pattern_mis(pattern,mis_marker);
137    
138           #pragma omp parallel for private(i) schedule(static)
139           for (i = 0; i < n; ++i) if (mis_marker[i]) colorOf[i]=out;
140           ++out;
141        }
142        TMPMEMFREE(mis_marker);
143        *num_colors=out;
144      }
145    }

Legend:
Removed from v.1315  
changed lines
  Added in v.1361

  ViewVC Help
Powered by ViewVC 1.1.26