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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 969 - (show annotations)
Tue Feb 13 23:02:23 2007 UTC (12 years, 8 months ago) by ksteube
File MIME type: text/plain
File size: 4226 byte(s)
Parallelization using MPI for solution of implicit problems.

Parallelization for explicit problems has already been accomplished in
the main SVN branch.

This is incomplete and is not ready for use.


1 /* $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: interface to the direct solvers */
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia 2003 */
22 /* Author: gross@access.edu.au */
23
24 /**************************************************************/
25
26 #include "Paso.h"
27 #include "performance.h"
28 #include "Solver.h"
29
30 #ifdef SCSL
31 #include "SCSL.h"
32 #endif
33
34 #ifdef MKL
35 #include "MKL.h"
36 #endif
37
38 #ifdef UMFPACK
39 #include "UMFPACK.h"
40 #endif
41
42 #ifdef TRILINOS
43 #include "TRILINOS.h"
44 #endif
45
46 /**************************************************************/
47
48 void Paso_solve(Paso_SystemMatrix* A,
49 double* out,
50 double* in,
51 Paso_Options* options) {
52 Paso_Performance pp;
53 Paso_resetError();
54 if (A->num_rows!=A->num_cols || A->col_block_size!=A->row_block_size) {
55 Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
56 return;
57 }
58 Performance_open(&pp,options->verbose);
59 printf("ksteube in paso/src/solve.c : Paso_solve\n");
60 index_t package=Paso_Options_getPackage(options->method,options->package,options->symmetric);
61 if (Paso_noError()) {
62 switch(package) {
63
64 case PASO_PASO:
65 printf("ksteube in paso/src/solve.c : Paso_solve PASO_PASO\n");
66 Paso_Solver(A,out,in,options,&pp);
67 A->solver_package=PASO_PASO;
68 break;
69
70 #ifdef SCSL
71 case PASO_SCSL:
72 Paso_SCSL(A,out,in,options,&pp);
73 A->solver_package=PASO_SCSL;
74 break;
75 #endif
76
77
78 #ifdef MKL
79 case PASO_MKL:
80 Paso_MKL(A,out,in,options,&pp);
81 A->solver_package=PASO_MKL;
82 break;
83 #endif
84
85 #ifdef UMFPACK
86 case PASO_UMFPACK:
87 Paso_UMFPACK(A,out,in,options,&pp);
88 A->solver_package=PASO_UMFPACK;
89 break;
90 #endif
91
92 #ifdef TRILINOS
93 case PASO_TRILINOS:
94 printf("ksteube in paso/src/solve.c : Paso_solve PASO_TRILINOS\n");
95 Paso_TRILINOS(A,out,in,options,&pp);
96 A->solver_package=PASO_TRILINOS;
97 break;
98 #endif
99
100 default:
101 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
102 break;
103 }
104 }
105 Performance_close(&pp,options->verbose);
106 return;
107 }
108
109 /* free memory possibly resereved for a recall */
110
111 void Paso_solve_free(Paso_SystemMatrix* in) {
112
113 switch(in->solver_package) {
114
115 case PASO_PASO:
116 Paso_Solver_free(in);
117 break;
118
119 #ifdef SCSL
120 case PASO_SCSL:
121 Paso_SCSL_free(in);
122 break;
123 #endif
124
125
126 #ifdef MKL
127 case PASO_MKL:
128 Paso_MKL_free(in);
129 break;
130 #endif
131
132 #ifdef UMFPACK
133 case PASO_UMFPACK:
134 Paso_UMFPACK_free(in);
135 break;
136 #endif
137
138 #ifdef TRILINOS
139 case PASO_TRILINOS:
140 Paso_TRILINOS_free(in);
141 break;
142 #endif
143 }
144 }
145 /*
146 * $Log$
147 * Revision 1.2 2005/09/15 03:44:39 jgs
148 * Merge of development branch dev-02 back to main trunk on 2005-09-15
149 *
150 * Revision 1.1.2.2 2005/09/07 00:59:08 gross
151 * some inconsistent renaming fixed to make the linking work.
152 *
153 * Revision 1.1.2.1 2005/09/05 06:29:49 gross
154 * These files have been extracted from finley to define a stand alone libray for iterative
155 * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
156 * has not been tested yet.
157 *
158 *
159 */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26