/[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 2279 by artak, Wed Feb 4 01:17:06 2009 UTC revision 2280 by artak, Thu Feb 19 03:34:35 2009 UTC
# Line 154  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 154  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
154             if( Paso_noError()) {             if( Paso_noError()) {
155                /* 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 */
156                out->n_C=n-out->n_F;                out->n_C=n-out->n_F;
157                /*if (level<3) {*/                if (level<3) {
158                 if (out->n_F>500) {                 /*if (out->n_F>500) {*/
159                     out->rows_in_C=MEMALLOC(out->n_C,index_t);                     out->rows_in_C=MEMALLOC(out->n_C,index_t);
160                     out->mask_C=MEMALLOC(n,index_t);                     out->mask_C=MEMALLOC(n,index_t);
161                     if (! (Paso_checkPtr(out->mask_C) || Paso_checkPtr(out->rows_in_C) ) ) {                     if (! (Paso_checkPtr(out->mask_C) || Paso_checkPtr(out->rows_in_C) ) ) {
# Line 186  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 186  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
186    
187                              schur_withFillIn=Paso_SparseMatrix_alloc(A_p->type,Paso_Pattern_binop(PATTERN_FORMAT_DEFAULT, schur->pattern, Paso_Pattern_multiply(PATTERN_FORMAT_DEFAULT,out->A_CF->pattern,out->A_FC->pattern)),1,1);                              schur_withFillIn=Paso_SparseMatrix_alloc(A_p->type,Paso_Pattern_binop(PATTERN_FORMAT_DEFAULT, schur->pattern, Paso_Pattern_multiply(PATTERN_FORMAT_DEFAULT,out->A_CF->pattern,out->A_FC->pattern)),1,1);
188                                                            
189                              fprintf(stderr,"Sparsity of Schure: %dx%d LEN %d Percentage %f\n",schur_withFillIn->pattern->numOutput,schur_withFillIn->pattern->numInput,schur_withFillIn->len,schur_withFillIn->len/(1.*schur_withFillIn->pattern->numOutput*schur_withFillIn->pattern->numInput));                              /*fprintf(stderr,"Sparsity of Schure: %dx%d LEN %d Percentage %f\n",schur_withFillIn->pattern->numOutput,schur_withFillIn->pattern->numInput,schur_withFillIn->len,schur_withFillIn->len/(1.*schur_withFillIn->pattern->numOutput*schur_withFillIn->pattern->numInput));*/
190                                                            
191                              /* copy values over*/                              /* copy values over*/
192                              #pragma omp parallel for private(i,iPtr,j,iPtr_s,index,where_p) schedule(static)                              #pragma omp parallel for private(i,iPtr,j,iPtr_s,index,where_p) schedule(static)
# Line 249  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 249  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
249    if (Paso_noError()) {    if (Paso_noError()) {
250        if (verbose) {        if (verbose) {
251           printf("AMG: %d unknowns eliminated. %d left.\n",out->n_F,n-out->n_F);           printf("AMG: %d unknowns eliminated. %d left.\n",out->n_F,n-out->n_F);
252           /*if (level<3) {*/           if (level<3) {
253           if (out->n_F<500) {          /* if (out->n_F<500) {*/
254              printf("timing: AMG: MIS/reordering/elemination : %e/%e/%e\n",time2,time0,time1);              printf("timing: AMG: MIS/reordering/elemination : %e/%e/%e\n",time2,time0,time1);
255           } else {           } else {
256              printf("timing: AMG: MIS: %e\n",time2);              printf("timing: AMG: MIS: %e\n",time2);
# Line 294  void Paso_Solver_solveAMG(Paso_Solver_AM Line 294  void Paso_Solver_solveAMG(Paso_Solver_AM
294       double *x0=MEMALLOC(amg->n,double);       double *x0=MEMALLOC(amg->n,double);
295       double time0=0;       double time0=0;
296            
297       /*if (amg->level==3) {*/       if (amg->level==3) {
298       if (amg->n_F<=500) {       /*if (amg->n_F<=500) {*/
299        time0=Paso_timer();        time0=Paso_timer();
300                    
301          Paso_Solver_solveJacobi(amg->GS,x,b);          Paso_Solver_solveJacobi(amg->GS,x,b);

Legend:
Removed from v.2279  
changed lines
  Added in v.2280

  ViewVC Help
Powered by ViewVC 1.1.26