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

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

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

revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC revision 2608 by jfenwick, Tue Aug 18 01:25:18 2009 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2009 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 22  Line 21 
21  /**************************************************************/  /**************************************************************/
22    
23  /* Copyrights by ACcESS Australia 2003,2004,2005              */  /* Copyrights by ACcESS Australia 2003,2004,2005              */
24  /* Author: gross@access.edu.au                                */  /* Author: Lutz Gross, l.gross@uq.edu.au                                */
25    
26  /**************************************************************/  /**************************************************************/
27    
# Line 43  void Paso_Solver_updateIncompleteSchurCo Line 42  void Paso_Solver_updateIncompleteSchurCo
42    dim_t n_block=A_CC->row_block_size;    dim_t n_block=A_CC->row_block_size;
43    register double A_CF_11,A_CF_21,A_CF_31,A_CF_12,A_CF_22,A_CF_32,A_CF_13,A_CF_23,A_CF_33,    register double A_CF_11,A_CF_21,A_CF_31,A_CF_12,A_CF_22,A_CF_32,A_CF_13,A_CF_23,A_CF_33,
44           invA_FF_11,invA_FF_21,invA_FF_31,invA_FF_12,invA_FF_22,invA_FF_32,invA_FF_13,invA_FF_23,invA_FF_33,           invA_FF_11,invA_FF_21,invA_FF_31,invA_FF_12,invA_FF_22,invA_FF_32,invA_FF_13,invA_FF_23,invA_FF_33,
45           A11,A21,A31,A12,A22,A32,A13,A23,A33,A_FC_11,A_FC_21,A_FC_31,A_FC_12,A_FC_22,A_FC_32,A_FC_13,A_FC_23,A_FC_33;           A11=0,A21=0,A31=0,A12=0,A22=0,A32=0,A13=0,A23=0,A33=0,A_FC_11,A_FC_21,A_FC_31,A_FC_12,A_FC_22,A_FC_32,A_FC_13,A_FC_23,A_FC_33;
46    if (n_block==1) {    if (n_block==1) {
47       #pragma omp parallel for private(i,iPtr_CC,index_CC,index_CC_len,col_CF,set_A,iPtr_CF,iPtr_FC,col_FC,where_p,A11) schedule(static)       #pragma omp parallel for firstprivate(A11) private(i,iPtr_CC,index_CC,index_CC_len,col_CF,set_A,iPtr_CF,iPtr_FC,col_FC,where_p) schedule(static)
48       for (i = 0; i < n_loc_rows;++i) {       for (i = 0; i < n_loc_rows;++i) {
49          iPtr_CC=A_CC->pattern->ptr[i];          iPtr_CC=A_CC->pattern->ptr[i];
50          index_CC=&(A_CC->pattern->index[iPtr_CC]);          index_CC=&(A_CC->pattern->index[iPtr_CC]);
# Line 57  void Paso_Solver_updateIncompleteSchurCo Line 56  void Paso_Solver_updateIncompleteSchurCo
56               for (iPtr_FC = A_FC->pattern->ptr[col_CF]; iPtr_FC < A_FC->pattern->ptr[col_CF + 1]; ++iPtr_FC) {               for (iPtr_FC = A_FC->pattern->ptr[col_CF]; iPtr_FC < A_FC->pattern->ptr[col_CF + 1]; ++iPtr_FC) {
57                  col_FC=A_FC->pattern->index[iPtr_FC];                  col_FC=A_FC->pattern->index[iPtr_FC];
58                  /* is (i,col_FC) in the shape of A_CC ? */                  /* is (i,col_FC) in the shape of A_CC ? */
59                  where_p=(index_t*)bsearch(&col_FC,index_CC,index_CC_len,sizeof(index_t),Paso_comparIndex);                 where_p=(index_t*)bsearch(&col_FC,index_CC,index_CC_len,sizeof(index_t),Paso_comparIndex);
60                  if (where_p!=NULL) {                  if (where_p!=NULL) {
61                      if (set_A) {                      if (set_A) {
62                         A11=A_CF->val[iPtr_CF]*invA_FF[col_CF];                         A11=A_CF->val[iPtr_CF]*invA_FF[col_CF];
63                         set_A=FALSE;                         set_A=FALSE;
# Line 69  void Paso_Solver_updateIncompleteSchurCo Line 68  void Paso_Solver_updateIncompleteSchurCo
68           } /* end of iPtr_CF loop */           } /* end of iPtr_CF loop */
69        } /* end of irow loop */        } /* end of irow loop */
70     } else if (n_block==2) {     } else if (n_block==2) {
71        #pragma omp parallel for private(i,iPtr_CC,index_CC,index_CC_len,iPtr_CF,col_CF,iPtr_FC,col_FC,where_p,iPtr_CC_2,set_A,A_CF_11,A_CF_21,A_CF_12,A_CF_22,invA_FF_11,invA_FF_21,invA_FF_12,invA_FF_22,A11,A21,A12,A22,A_FC_11,A_FC_21,A_FC_12,A_FC_22) schedule(static)        #pragma omp parallel for firstprivate(A11,A21,A12,A22) private(i,iPtr_CC,index_CC,index_CC_len,iPtr_CF,col_CF,iPtr_FC,col_FC,where_p,iPtr_CC_2,set_A,A_CF_11,A_CF_21,A_CF_12,A_CF_22,invA_FF_11,invA_FF_21,invA_FF_12,invA_FF_22,A_FC_11,A_FC_21,A_FC_12,A_FC_22) schedule(static)
72       for (i = 0; i < n_loc_rows;++i) {       for (i = 0; i < n_loc_rows;++i) {
73          iPtr_CC=A_CC->pattern->ptr[i];          iPtr_CC=A_CC->pattern->ptr[i];
74          index_CC=&(A_CC->pattern->index[iPtr_CC]);          index_CC=&(A_CC->pattern->index[iPtr_CC]);
# Line 119  void Paso_Solver_updateIncompleteSchurCo Line 118  void Paso_Solver_updateIncompleteSchurCo
118           } /* end of iPtr_CF loop */           } /* end of iPtr_CF loop */
119        } /* end of irow loop */        } /* end of irow loop */
120     } else if (n_block==3) {     } else if (n_block==3) {
121        #pragma omp parallel for private(i,iPtr_CC,index_CC,index_CC_len,iPtr_CF,col_CF,iPtr_FC,col_FC,where_p,iPtr_CC_2,set_A,A_CF_11,A_CF_21,A_CF_31,A_CF_12,A_CF_22,A_CF_32,A_CF_13,A_CF_23,A_CF_33,invA_FF_11,invA_FF_21,invA_FF_31,invA_FF_12,invA_FF_22,invA_FF_32,invA_FF_13,invA_FF_23,invA_FF_33,A11,A21,A31,A12,A22,A32,A13,A23,A33,A_FC_11,A_FC_21,A_FC_31,A_FC_12,A_FC_22,A_FC_32,A_FC_13,A_FC_23,A_FC_33) schedule(static)        #pragma omp parallel for firstprivate(A11,A21,A31,A12,A22,A32,A13,A23,A33) private(i,iPtr_CC,index_CC,index_CC_len,iPtr_CF,col_CF,iPtr_FC,col_FC,where_p,iPtr_CC_2,set_A,A_CF_11,A_CF_21,A_CF_31,A_CF_12,A_CF_22,A_CF_32,A_CF_13,A_CF_23,A_CF_33,invA_FF_11,invA_FF_21,invA_FF_31,invA_FF_12,invA_FF_22,invA_FF_32,invA_FF_13,invA_FF_23,invA_FF_33,A_FC_11,A_FC_21,A_FC_31,A_FC_12,A_FC_22,A_FC_32,A_FC_13,A_FC_23,A_FC_33) schedule(static)
122       for (i = 0; i < n_loc_rows;++i) {       for (i = 0; i < n_loc_rows;++i) {
123          iPtr_CC=A_CC->pattern->ptr[i];          iPtr_CC=A_CC->pattern->ptr[i];
124          index_CC=&(A_CC->pattern->index[iPtr_CC]);          index_CC=&(A_CC->pattern->index[iPtr_CC]);

Legend:
Removed from v.1312  
changed lines
  Added in v.2608

  ViewVC Help
Powered by ViewVC 1.1.26