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

Contents of /trunk-mpi-branch/paso/src/solve.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1096 - (show annotations)
Mon Apr 16 22:59:33 2007 UTC (12 years, 9 months ago) by ksteube
File MIME type: text/plain
File size: 4164 byte(s)
MPI implicit solver example run_simplesolve.py now compiling and
running successfully on one CPU of ess.

Adjusted SConscript, removed some debug print statements and removed
some partially implemented TRILINOS calls.


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 /**************************************************************/
43
44 void Paso_solve(Paso_SystemMatrix* A,
45 double* out,
46 double* in,
47 Paso_Options* options) {
48 Paso_Performance pp;
49 Paso_resetError();
50 if (A->numRows!=A->numCols || A->col_block_size!=A->row_block_size) {
51 Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
52 return;
53 }
54 Performance_open(&pp,options->verbose);
55 index_t package=Paso_Options_getPackage(options->method,options->package,options->symmetric);
56 if (Paso_noError()) {
57 switch(package) {
58
59 case PASO_PASO:
60 Paso_Solver(A,out,in,options,&pp);
61 A->solver_package=PASO_PASO;
62 break;
63
64 #ifdef SCSL
65 case PASO_SCSL:
66 if (A->mpi_info->size>1) {
67 Paso_setError(VALUE_ERROR,"Paso_solve: SCSL package does not support MPI.");
68 return;
69 }
70 Paso_SCSL(A,out,in,options,&pp);
71 A->solver_package=PASO_SCSL;
72 break;
73 #endif
74
75
76 #ifdef MKL
77 case PASO_MKL:
78 if (A->mpi_info->size>1) {
79 Paso_setError(VALUE_ERROR,"Paso_solve: MKL package does not support MPI.");
80 return;
81 }
82 Paso_MKL(A,out,in,options,&pp);
83 A->solver_package=PASO_MKL;
84 break;
85 #endif
86
87 #ifdef UMFPACK
88 case PASO_UMFPACK:
89 if (A->mpi_info->size>1) {
90 Paso_setError(VALUE_ERROR,"Paso_solve: UMFPACK package does not support MPI.");
91 return;
92 }
93 Paso_UMFPACK(A,out,in,options,&pp);
94 A->solver_package=PASO_UMFPACK;
95 break;
96 #endif
97
98 default:
99 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
100 break;
101 }
102 }
103 Performance_close(&pp,options->verbose);
104 return;
105 }
106
107 /* free memory possibly resereved for a recall */
108
109 void Paso_solve_free(Paso_SystemMatrix* in) {
110
111 switch(in->solver_package) {
112
113 case PASO_PASO:
114 Paso_Solver_free(in);
115 break;
116
117 #ifdef SCSL
118 case PASO_SCSL:
119 Paso_SCSL_free(in);
120 break;
121 #endif
122
123
124 #ifdef MKL
125 case PASO_MKL:
126 Paso_MKL_free(in);
127 break;
128 #endif
129
130 #ifdef UMFPACK
131 case PASO_UMFPACK:
132 Paso_UMFPACK_free(in);
133 break;
134 #endif
135
136 }
137 }
138 /*
139 * $Log$
140 * Revision 1.2 2005/09/15 03:44:39 jgs
141 * Merge of development branch dev-02 back to main trunk on 2005-09-15
142 *
143 * Revision 1.1.2.2 2005/09/07 00:59:08 gross
144 * some inconsistent renaming fixed to make the linking work.
145 *
146 * Revision 1.1.2.1 2005/09/05 06:29:49 gross
147 * These files have been extracted from finley to define a stand alone libray for iterative
148 * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
149 * has not been tested yet.
150 *
151 *
152 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26