/[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 2709 by artak, Mon Oct 5 06:11:58 2009 UTC revision 2711 by artak, Tue Oct 6 04:43:41 2009 UTC
# Line 57  void Paso_Solver_AMG_free(Paso_Solver_AM Line 57  void Paso_Solver_AMG_free(Paso_Solver_AM
57          Paso_SparseMatrix_free(in->A_FC);          Paso_SparseMatrix_free(in->A_FC);
58          Paso_SparseMatrix_free(in->A_CF);          Paso_SparseMatrix_free(in->A_CF);
59          Paso_SparseMatrix_free(in->A);          Paso_SparseMatrix_free(in->A);
60            if(in->coarsest_level==TRUE) {
61            #ifdef MKL
62              Paso_MKL_free1(in->AOffset1);
63              Paso_SparseMatrix_free(in->AOffset1);
64            #else
65              #ifdef UMFPACK
66              Paso_UMFPACK1_free((Paso_UMFPACK_Handler*)(in->solver));
67              #endif
68            #endif
69            }
70          MEMFREE(in->rows_in_F);          MEMFREE(in->rows_in_F);
71          MEMFREE(in->rows_in_C);          MEMFREE(in->rows_in_C);
72          MEMFREE(in->mask_F);          MEMFREE(in->mask_F);
# Line 65  void Paso_Solver_AMG_free(Paso_Solver_AM Line 75  void Paso_Solver_AMG_free(Paso_Solver_AM
75          MEMFREE(in->b_F);          MEMFREE(in->b_F);
76          MEMFREE(in->x_C);          MEMFREE(in->x_C);
77          MEMFREE(in->b_C);          MEMFREE(in->b_C);
         #ifdef UMFPACK  
         Paso_UMFPACK1_free((Paso_UMFPACK_Handler*)(in->solver));  
         #endif  
78          in->solver=NULL;          in->solver=NULL;
79          Paso_Solver_AMG_free(in->AMG_of_Schur);          Paso_Solver_AMG_free(in->AMG_of_Schur);
80          MEMFREE(in->b_C);          MEMFREE(in->b_C);
# Line 150  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 157  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
157           out->coarsest_level=TRUE;           out->coarsest_level=TRUE;
158           #ifdef UMFPACK           #ifdef UMFPACK
159           #else           #else
160              #ifdef MKL              #ifdef MKL
161                      out->AOffset1=Paso_SparseMatrix_alloc(MATRIX_FORMAT_BLK1 + MATRIX_FORMAT_OFFSET1, out->A->pattern,1,1, FALSE);
162                      #pragma omp parallel for private(i) schedule(static)
163                      for (i=0;i<out->A->len;++i) {
164                           out->AOffset1->val[i]=out->A->val[i];
165                      }
166              #else              #else
167                  out->GS=Paso_Solver_getJacobi(A_p);                  out->GS=Paso_Solver_getJacobi(A_p);
168              #endif              #endif
# Line 370  void Paso_Solver_solveAMG(Paso_Solver_AM Line 382  void Paso_Solver_solveAMG(Paso_Solver_AM
382       bool_t verbose=0;       bool_t verbose=0;
383       #ifdef UMFPACK       #ifdef UMFPACK
384            Paso_UMFPACK_Handler * ptr=NULL;            Paso_UMFPACK_Handler * ptr=NULL;
      #else      
         #ifdef MKL  
           Paso_SparseMatrix *temp=NULL;  
         #endif  
385       #endif       #endif
386       r=MEMALLOC(amg->n,double);       r=MEMALLOC(amg->n,double);
387       x0=MEMALLOC(amg->n,double);       x0=MEMALLOC(amg->n,double);
# Line 392  void Paso_Solver_solveAMG(Paso_Solver_AM Line 400  void Paso_Solver_solveAMG(Paso_Solver_AM
400               amg->solver=(void*) ptr;               amg->solver=(void*) ptr;
401         #else               #else      
402           #ifdef MKL           #ifdef MKL
403            temp=Paso_SparseMatrix_alloc(MATRIX_FORMAT_BLK1 + MATRIX_FORMAT_OFFSET1, amg->A->pattern,1,1, FALSE);            Paso_MKL1(amg->AOffset1,x,b,verbose);
           #pragma omp parallel for private(i) schedule(static)  
           for (i=0;i<amg->A->len;++i) {  
                temp->val[i]=amg->A->val[i];  
           }  
           Paso_MKL1(temp,x,b,verbose);  
           Paso_SparseMatrix_free(temp);  
404           #else           #else
405            Paso_Solver_solveJacobi(amg->GS,x,b);            Paso_Solver_solveJacobi(amg->GS,x,b);
406           #endif           #endif

Legend:
Removed from v.2709  
changed lines
  Added in v.2711

  ViewVC Help
Powered by ViewVC 1.1.26