/[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 3258 by gross, Fri Aug 13 08:38:06 2010 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 28  Line 28 
28    
29  /**************************************************************/  /**************************************************************/
30    
31  #include "mpi_C.h"  
32  #include "Paso.h"  #include "Paso.h"
33  #include "PasoUtil.h"  #include "PasoUtil.h"
34  #include "Pattern.h"  #include "Pattern.h"
35    #include "esysUtils/mpi_C.h"
36    
37  /* used to generate pseudo random numbers: */  /* used to generate pseudo random numbers: */
38    
# Line 55  void Paso_Pattern_mis(Paso_Pattern* patt Line 55  void Paso_Pattern_mis(Paso_Pattern* patt
55    bool_t flag;    bool_t flag;
56    dim_t n=pattern_p->numOutput;    dim_t n=pattern_p->numOutput;
57    if (pattern_p->type & PATTERN_FORMAT_SYM) {    if (pattern_p->type & PATTERN_FORMAT_SYM) {
58      Paso_setError(TYPE_ERROR,"Paso_Pattern_mis: symmetric matrix pattern is not supported yet");      Esys_setError(TYPE_ERROR,"Paso_Pattern_mis: symmetric matrix pattern is not supported yet");
59      return;      return;
60    }    }
61    if (pattern_p->numOutput != pattern_p->numInput) {    if (pattern_p->numOutput != pattern_p->numInput) {
62       Paso_setError(VALUE_ERROR,"Paso_Pattern_mis: pattern must be square.");       Esys_setError(VALUE_ERROR,"Paso_Pattern_mis: pattern must be square.");
63       return;       return;
64    }    }
65    value=TMPMEMALLOC(n,double);    value=TMPMEMALLOC(n,double);
66    if (!Paso_checkPtr(value)) {    if (!Esys_checkPtr(value)) {
67    
68        
69       /* is there any vertex available ?*/       /* is there any vertex available ?*/
# Line 128  void Paso_Pattern_color(Paso_Pattern* pa Line 128  void Paso_Pattern_color(Paso_Pattern* pa
128    index_t out=0, *mis_marker=NULL,i;    index_t out=0, *mis_marker=NULL,i;
129    dim_t n=pattern->numOutput;    dim_t n=pattern->numOutput;
130    mis_marker=TMPMEMALLOC(n,index_t);    mis_marker=TMPMEMALLOC(n,index_t);
131    if ( !Paso_checkPtr(mis_marker) ) {    if ( !Esys_checkPtr(mis_marker) ) {
132      /* get coloring */      /* get coloring */
133      #pragma omp parallel for private(i) schedule(static)      #pragma omp parallel for private(i) schedule(static)
134      for (i = 0; i < n; ++i) {      for (i = 0; i < n; ++i) {
# Line 136  void Paso_Pattern_color(Paso_Pattern* pa Line 136  void Paso_Pattern_color(Paso_Pattern* pa
136          mis_marker[i]=-1;          mis_marker[i]=-1;
137      }      }
138    
139      while (Paso_Util_isAny(n,colorOf,-1) && Paso_noError()) {      while (Paso_Util_isAny(n,colorOf,-1) && Esys_noError()) {
140         /*#pragma omp parallel for private(i) schedule(static)         /*#pragma omp parallel for private(i) schedule(static)
141         for (i = 0; i < n; ++i) mis_marker[i]=colorOf[i];*/         for (i = 0; i < n; ++i) mis_marker[i]=colorOf[i];*/
142         Paso_Pattern_mis(pattern,mis_marker);         Paso_Pattern_mis(pattern,mis_marker);

Legend:
Removed from v.3258  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26