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

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

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

temp/paso/src/Solver_ILU.c revision 1387 by trankine, Fri Jan 11 07:45:26 2008 UTC trunk/paso/src/Solver_ILU.c revision 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16    
# Line 52  Paso_Solver_ILU* Paso_Solver_getILU(Paso Line 51  Paso_Solver_ILU* Paso_Solver_getILU(Paso
51    dim_t n_block=A->row_block_size;    dim_t n_block=A->row_block_size;
52    index_t num_colors=0, *mis_marker=NULL;    index_t num_colors=0, *mis_marker=NULL;
53    register double A11,A12,A13,A21,A22,A23,A31,A32,A33,D;    register double A11,A12,A13,A21,A22,A23,A31,A32,A33,D;
   register double mainA11,mainA12,mainA13,mainA21,mainA22,mainA23,mainA31,mainA32,mainA33;  
54    register double S11,S12,S13,S21,S22,S23,S31,S32,S33;    register double S11,S12,S13,S21,S22,S23,S31,S32,S33;
55    register index_t i,iptr_main,iptr,iptr_ik,k,iptr_kj,j,iptr_ij,color,color2;    register index_t i,iptr_main,iptr,iptr_ik,k,iptr_kj,j,iptr_ij,color,color2;
56    double time0,time_color,time_fac;    double time0,time_color,time_fac;
# Line 353  void Paso_Solver_solveILU(Paso_Solver_IL Line 351  void Paso_Solver_solveILU(Paso_Solver_IL
351            
352            
353       /* copy x into b*/       /* copy x into b*/
354       #pragma omp for private(i) schedule(static)       #pragma omp parallel for private(i) schedule(static)
355       for (i=0;i<n*n_block;++i) x[i]=b[i];       for (i=0;i<n*n_block;++i) x[i]=b[i];
356       /* forward substitution */       /* forward substitution */
357       for (color=0;color<ilu->num_colors;++color) {       for (color=0;color<ilu->num_colors;++color) {
358             if (n_block==1) {             if (n_block==1) {
359                #pragma omp for schedule(static) private(i,iptr_ik,k,S1,R1,iptr_main)                #pragma omp parallel for schedule(static) private(i,iptr_ik,k,S1,R1,iptr_main)
360                for (i = 0; i < n; ++i) {                for (i = 0; i < n; ++i) {
361                     if (ilu->colorOf[i]==color) {                     if (ilu->colorOf[i]==color) {
362                       /* x_i=x_i-a_ik*x_k */                                           /* x_i=x_i-a_ik*x_k */                    
# Line 375  void Paso_Solver_solveILU(Paso_Solver_IL Line 373  void Paso_Solver_solveILU(Paso_Solver_IL
373                     }                     }
374                }                }
375             } else if (n_block==2) {             } else if (n_block==2) {
376                #pragma omp for schedule(static) private(i,iptr_ik,k,iptr_main,S1,S2,R1,R2)                #pragma omp parallel for schedule(static) private(i,iptr_ik,k,iptr_main,S1,S2,R1,R2)
377                for (i = 0; i < n; ++i) {                for (i = 0; i < n; ++i) {
378                     if (ilu->colorOf[i]==color) {                     if (ilu->colorOf[i]==color) {
379                       /* x_i=x_i-a_ik*x_k */                       /* x_i=x_i-a_ik*x_k */
# Line 397  void Paso_Solver_solveILU(Paso_Solver_IL Line 395  void Paso_Solver_solveILU(Paso_Solver_IL
395    
396                }                }
397             } else if (n_block==3) {             } else if (n_block==3) {
398                #pragma omp for schedule(static) private(i,iptr_ik,iptr_main,k,S1,S2,S3,R1,R2,R3)                #pragma omp parallel for schedule(static) private(i,iptr_ik,iptr_main,k,S1,S2,S3,R1,R2,R3)
399                for (i = 0; i < n; ++i) {                for (i = 0; i < n; ++i) {
400                     if (ilu->colorOf[i]==color) {                     if (ilu->colorOf[i]==color) {
401                       /* x_i=x_i-a_ik*x_k */                       /* x_i=x_i-a_ik*x_k */
# Line 422  void Paso_Solver_solveILU(Paso_Solver_IL Line 420  void Paso_Solver_solveILU(Paso_Solver_IL
420                   }                   }
421                }                }
422             }             }
            #pragma omp barrier  
423       }       }
424       /* backward substitution */       /* backward substitution */
425       for (color=(ilu->num_colors)-1;color>-1;--color) {       for (color=(ilu->num_colors)-1;color>-1;--color) {
426             if (n_block==1) {             if (n_block==1) {
427                #pragma omp for schedule(static) private(i,iptr_ik,k,S1,R1)                #pragma omp parallel for schedule(static) private(i,iptr_ik,k,S1,R1)
428                for (i = 0; i < n; ++i) {                for (i = 0; i < n; ++i) {
429                     if (ilu->colorOf[i]==color) {                     if (ilu->colorOf[i]==color) {
430                       /* x_i=x_i-a_ik*x_k */                       /* x_i=x_i-a_ik*x_k */
# Line 443  void Paso_Solver_solveILU(Paso_Solver_IL Line 440  void Paso_Solver_solveILU(Paso_Solver_IL
440                     }                     }
441                }                }
442             } else if (n_block==2) {             } else if (n_block==2) {
443                #pragma omp for schedule(static) private(i,iptr_ik,k,S1,S2,R1,R2)                #pragma omp parallel for schedule(static) private(i,iptr_ik,k,S1,S2,R1,R2)
444                for (i = 0; i < n; ++i) {                for (i = 0; i < n; ++i) {
445                     if (ilu->colorOf[i]==color) {                     if (ilu->colorOf[i]==color) {
446                       /* x_i=x_i-a_ik*x_k */                       /* x_i=x_i-a_ik*x_k */
# Line 463  void Paso_Solver_solveILU(Paso_Solver_IL Line 460  void Paso_Solver_solveILU(Paso_Solver_IL
460                     }                     }
461                }                }
462             } else if (n_block==3) {             } else if (n_block==3) {
463                #pragma omp for schedule(static) private(i,iptr_ik,k,S1,S2,S3,R1,R2,R3)                #pragma omp parallel for schedule(static) private(i,iptr_ik,k,S1,S2,S3,R1,R2,R3)
464                for (i = 0; i < n; ++i) {                for (i = 0; i < n; ++i) {
465                     if (ilu->colorOf[i]==color) {                     if (ilu->colorOf[i]==color) {
466                       /* x_i=x_i-a_ik*x_k */                       /* x_i=x_i-a_ik*x_k */

Legend:
Removed from v.1387  
changed lines
  Added in v.1811

  ViewVC Help
Powered by ViewVC 1.1.26