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

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

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

revision 495 by gross, Mon Feb 6 06:32:06 2006 UTC revision 971 by ksteube, Wed Feb 14 04:40:49 2007 UTC
# Line 1  Line 1 
1  /* $Id$ */  /* $Id$ */
2    
3    
4    /*
5    ********************************************************************************
6    *               Copyright   2006 by ACcESS MNRF                                *
7    *                                                                              *
8    *                 http://www.access.edu.au                                     *
9    *           Primary Business: Queensland, Australia                            *
10    *     Licensed under the Open Software License version 3.0             *
11    *        http://www.opensource.org/licenses/osl-3.0.php                        *
12    ********************************************************************************
13    */
14    
15  /**************************************************************/  /**************************************************************/
16    
17  /* Paso: matrix vector product with sparse matrix           */  /* Paso: matrix vector product with sparse matrix           */
# Line 207  void  Paso_SystemMatrix_MatrixVector_CSR Line 219  void  Paso_SystemMatrix_MatrixVector_CSR
219          #pragma omp for private(irow,iptr,reg) schedule(static)          #pragma omp for private(irow,iptr,reg) schedule(static)
220      for (irow=0;irow< A->pattern->n_ptr;++irow) {      for (irow=0;irow< A->pattern->n_ptr;++irow) {
221            reg=0.;            reg=0.;
           #pragma swp  
222        for (iptr=(A->pattern->ptr[irow]);iptr<(A->pattern->ptr[irow+1]); ++iptr) {        for (iptr=(A->pattern->ptr[irow]);iptr<(A->pattern->ptr[irow+1]); ++iptr) {
223            reg += A->val[iptr] * in[A->pattern->index[iptr]];            reg += A->val[iptr] * in[A->pattern->index[iptr]];
224        }        }
225        out[irow] += alpha * reg;        out[irow] += alpha * reg;
226      }      }
227      } else if (A ->col_block_size==2 && A->row_block_size ==2) {      } else if (A ->col_block_size==2 && A->row_block_size ==2) {
228          #pragma omp for private(ir,iptr,irb,icb,irow,icol,reg1,reg2,in1,in2,Aiptr,A00,A10,A01,A11) schedule(static)          #pragma omp for private(ir,reg1,reg2,iptr,ic,Aiptr,in1,in2,A00,A10,A01,A11) schedule(static)
229      for (ir=0;ir< A->pattern->n_ptr;ir++) {      for (ir=0;ir< A->pattern->n_ptr;ir++) {
230            reg1=0.;            reg1=0.;
231            reg2=0.;            reg2=0.;
           #pragma swp  
232        for (iptr=A->pattern->ptr[ir];iptr<A->pattern->ptr[ir+1]; iptr++) {        for (iptr=A->pattern->ptr[ir];iptr<A->pattern->ptr[ir+1]; iptr++) {
233             ic=2*(A->pattern->index[iptr]);             ic=2*(A->pattern->index[iptr]);
234                 Aiptr=iptr*4;                 Aiptr=iptr*4;
# Line 235  void  Paso_SystemMatrix_MatrixVector_CSR Line 245  void  Paso_SystemMatrix_MatrixVector_CSR
245        out[1+2*ir] += alpha * reg2;        out[1+2*ir] += alpha * reg2;
246      }      }
247      } else if (A ->col_block_size==3 && A->row_block_size ==3) {      } else if (A ->col_block_size==3 && A->row_block_size ==3) {
248          #pragma omp for private(ir,iptr,irb,icb,irow,icol,reg1,reg2,reg3,in1,in2,in3,Aiptr,A00,A10,A20,A01,A11,A21,A02,A12,A22) schedule(static)          #pragma omp for private(ir,reg1,reg2,reg3,iptr,ic,Aiptr,in1,in2,in3,A00,A10,A20,A01,A11,A21,A02,A12,A22) schedule(static)
249      for (ir=0;ir< A->pattern->n_ptr;ir++) {      for (ir=0;ir< A->pattern->n_ptr;ir++) {
250            reg1=0.;            reg1=0.;
251            reg2=0.;            reg2=0.;
252            reg3=0.;            reg3=0.;
           #pragma swp  
253        for (iptr=A->pattern->ptr[ir];iptr<A->pattern->ptr[ir+1]; iptr++) {        for (iptr=A->pattern->ptr[ir];iptr<A->pattern->ptr[ir+1]; iptr++) {
254             ic=3*(A->pattern->index[iptr]);             ic=3*(A->pattern->index[iptr]);
255                 Aiptr=iptr*9;                 Aiptr=iptr*9;
# Line 315  void  Paso_SystemMatrix_MatrixVector_CSR Line 324  void  Paso_SystemMatrix_MatrixVector_CSR
324        out[irow] += alpha * reg;        out[irow] += alpha * reg;
325      }      }
326      } else if (A ->col_block_size==2 && A->row_block_size ==2) {      } else if (A ->col_block_size==2 && A->row_block_size ==2) {
327          #pragma omp for private(ir,iptr,irb,icb,irow,icol,reg1,reg2) schedule(static)          #pragma omp for private(ir,reg1,reg2,iptr,ic) schedule(static)
328      for (ir=0;ir< A->pattern->n_ptr;ir++) {      for (ir=0;ir< A->pattern->n_ptr;ir++) {
329            reg1=0.;            reg1=0.;
330            reg2=0.;            reg2=0.;
# Line 328  void  Paso_SystemMatrix_MatrixVector_CSR Line 337  void  Paso_SystemMatrix_MatrixVector_CSR
337        out[1+2*ir] += alpha * reg2;        out[1+2*ir] += alpha * reg2;
338      }      }
339      } else if (A ->col_block_size==3 && A->row_block_size ==3) {      } else if (A ->col_block_size==3 && A->row_block_size ==3) {
340          #pragma omp for private(ir,iptr,irb,icb,irow,icol,reg1,reg2,reg3) schedule(static)          #pragma omp for private(ir,reg1,reg2,reg3,iptr,ic) schedule(static)
341      for (ir=0;ir< A->pattern->n_ptr;ir++) {      for (ir=0;ir< A->pattern->n_ptr;ir++) {
342            reg1=0.;            reg1=0.;
343            reg2=0.;            reg2=0.;

Legend:
Removed from v.495  
changed lines
  Added in v.971

  ViewVC Help
Powered by ViewVC 1.1.26