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

Annotation of /trunk/paso/src/BlockOps.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3559 - (hide annotations)
Fri Aug 26 07:47:27 2011 UTC (8 years, 2 months ago) by jfenwick
File MIME type: text/plain
File size: 1656 byte(s)
Silence some warnings unused var warnings under gcc.


1 gross 3121
2     /*******************************************************
3     *
4     * Copyright (c) 2003-2010 by University of Queensland
5     * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13    
14    
15     #include "BlockOps.h"
16     #include "Paso.h"
17    
18     /**************************************************************
19    
20     PASO block operations
21    
22     **************************************************************/
23    
24 gross 3402 void Paso_BlockOps_solveAll(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x) {
25 gross 3121 dim_t i;
26 gross 3402 int failed=0;
27 jfenwick 3559 const dim_t block_size=n_block*n_block+17;
28     (void)block_size; /* silence the warning which happens when because var is sometimes ignored by a macro*/
29 gross 3402
30 gross 3121 if (n_block==1) {
31     #pragma omp parallel for private(i) schedule(static)
32 gross 3402 for (i=0;i<n;++i) x[i]*=D[i];
33 gross 3121 } else if (n_block==2) {
34 gross 3402 #pragma omp parallel for private(i) schedule(static)
35     for (i=0;i<n;++i) Paso_BlockOps_MViP_2(&D[4*i], &x[2*i]);
36    
37 gross 3121 } else if (n_block==3) {
38 gross 3402 #pragma omp parallel for private(i) schedule(static)
39     for (i=0;i<n;++i) Paso_BlockOps_MViP_3(&D[9*i], &x[3*i]);
40     } else {
41 jfenwick 3559
42 gross 3402 #pragma omp parallel for private(i) schedule(static)
43     for (i=0;i<n;++i) {
44     Paso_BlockOps_solve_N(n_block, &x[n_block*i], &D[block_size*i], &pivot[n_block*i], &failed);
45     }
46 gross 3121 }
47 gross 3402 if (failed > 0) {
48     Esys_setError(ZERO_DIVISION_ERROR, "Paso_BlockOps_solveAll: solution failed.");
49     }
50 gross 3121 return;
51     }

  ViewVC Help
Powered by ViewVC 1.1.26