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

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

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

revision 2523 by artak, Mon Jul 6 03:13:11 2009 UTC revision 2524 by artak, Wed Jul 8 00:39:26 2009 UTC
# Line 113  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 113  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
113    out->A=Paso_SparseMatrix_getReference(A_p);    out->A=Paso_SparseMatrix_getReference(A_p);
114    /*out->GS=Paso_Solver_getGS(A_p,verbose);*/    /*out->GS=Paso_Solver_getGS(A_p,verbose);*/
115    out->GS=Paso_Solver_getJacobi(A_p);    out->GS=Paso_Solver_getJacobi(A_p);
   /*out->GS->sweeps=2;*/  
116    out->level=level;    out->level=level;
117      
118      if (level==0 || n<=options->min_coarse_matrix_size)
119        out->coarsest_level=TRUE;
120      else
121        out->coarsest_level=FALSE;
122    
123    if ( !(Paso_checkPtr(mis_marker) || Paso_checkPtr(out) || Paso_checkPtr(counter) || level==0 ) ) {    if ( !(Paso_checkPtr(mis_marker) || Paso_checkPtr(out) || Paso_checkPtr(counter) || level==0 || n<=options->min_coarse_matrix_size) ) {
124       /* identify independend set of rows/columns */       /* identify independend set of rows/columns */
125       #pragma omp parallel for private(i) schedule(static)       #pragma omp parallel for private(i) schedule(static)
126       for (i=0;i<n;++i) mis_marker[i]=-1;       for (i=0;i<n;++i) mis_marker[i]=-1;
# Line 174  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 178  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
178             if( Paso_noError()) {             if( Paso_noError()) {
179                /* if there are no nodes in the coarse level there is no more work to do */                /* if there are no nodes in the coarse level there is no more work to do */
180                out->n_C=n-out->n_F;                out->n_C=n-out->n_F;
181                if (level>0 && out->n_C>500) {                
182                 /*if (out->n_F>500) {*/                 /*if (out->n_F>500) {*/
183                     out->rows_in_C=MEMALLOC(out->n_C,index_t);                     out->rows_in_C=MEMALLOC(out->n_C,index_t);
184                     out->mask_C=MEMALLOC(n,index_t);                     out->mask_C=MEMALLOC(n,index_t);
# Line 255  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 259  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
259                           }                           }
260                       }                       }
261                   }                   }
262                }                
263             }             }
264          }          }
265       }       }
# Line 263  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 267  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
267    TMPMEMFREE(mis_marker);    TMPMEMFREE(mis_marker);
268    TMPMEMFREE(counter);    TMPMEMFREE(counter);
269    if (Paso_noError()) {    if (Paso_noError()) {
270        if (verbose && level>0) {        if (verbose && level>0 && !out->coarsest_level) {
271           printf("AMG: %d unknowns eliminated. %d left.\n",out->n_F,out->n_C);           printf("AMG: %d unknowns eliminated. %d left.\n",out->n_F,out->n_C);
272       }       }
273       return out;       return out;
# Line 309  void Paso_Solver_solveAMG(Paso_Solver_AM Line 313  void Paso_Solver_solveAMG(Paso_Solver_AM
313       #endif       #endif
314            
315            
316       if (amg->level==0  || amg->n_C<=500) {       if (amg->coarsest_level) {
317                
318        time0=Paso_timer();        time0=Paso_timer();
319         #ifdef MKL         #ifdef MKL

Legend:
Removed from v.2523  
changed lines
  Added in v.2524

  ViewVC Help
Powered by ViewVC 1.1.26