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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3642 - (show annotations)
Thu Oct 27 03:41:51 2011 UTC (7 years, 5 months ago) by caltinay
File MIME type: text/plain
File size: 1621 byte(s)
Assorted spelling/comment fixes in paso.

1
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 void Paso_BlockOps_solveAll(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x) {
25 dim_t i;
26 int failed=0;
27 const dim_t block_size=n_block*n_block+17;
28 (void)block_size; /* silence warning from var being unused by macros */
29
30 if (n_block==1) {
31 #pragma omp parallel for private(i) schedule(static)
32 for (i=0;i<n;++i) x[i]*=D[i];
33 } else if (n_block==2) {
34 #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 } else if (n_block==3) {
38 #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
42 #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 }
47 if (failed > 0) {
48 Esys_setError(ZERO_DIVISION_ERROR, "Paso_BlockOps_solveAll: solution failed.");
49 }
50 return;
51 }

  ViewVC Help
Powered by ViewVC 1.1.26