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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 727 - (hide annotations)
Fri May 12 06:31:06 2006 UTC (12 years, 11 months ago) by gross
File MIME type: text/plain
File size: 3609 byte(s)
In case of an error in paso a seg fault occured. this was caused by
inproper deallocation of memory in this case. this problem is fixed now.


1 jgs 150 /* $Id$ */
2    
3 dhawcroft 631
4     /*
5     ********************************************************************************
6 dhawcroft 633 * Copyright 2006 by ACcESS MNRF *
7 dhawcroft 631 * *
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 jgs 150 /**************************************************************/
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 gross 584 #include "performance.h"
28 gross 700 #include "Solver.h"
29 jgs 150
30     #ifdef SCSL
31 gross 411 #include "SCSL.h"
32 jgs 150 #endif
33    
34     #ifdef MKL
35 gross 411 #include "MKL.h"
36 jgs 150 #endif
37    
38     #ifdef UMFPACK
39 gross 411 #include "UMFPACK.h"
40 jgs 150 #endif
41    
42     /**************************************************************/
43    
44     void Paso_solve(Paso_SystemMatrix* A,
45     double* out,
46     double* in,
47     Paso_Options* options) {
48 gross 584 Paso_Performance pp;
49 jgs 150 Paso_resetError();
50     if (A->num_rows!=A->num_cols || A->col_block_size!=A->row_block_size) {
51 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
52 jgs 150 return;
53     }
54 gross 584 Performance_open(&pp,options->verbose);
55 jgs 150 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 gross 584 Paso_Solver(A,out,in,options,&pp);
61 gross 727 A->solver_package=PASO_PASO;
62 jgs 150 break;
63    
64     #ifdef SCSL
65     case PASO_SCSL:
66 gross 584 Paso_SCSL(A,out,in,options,&pp);
67 gross 727 A->solver_package=PASO_SCSL;
68 jgs 150 break;
69     #endif
70    
71 gross 425
72     #ifdef MKL
73 jgs 150 case PASO_MKL:
74 gross 584 Paso_MKL(A,out,in,options,&pp);
75 gross 727 A->solver_package=PASO_MKL;
76 jgs 150 break;
77 gross 425 #endif
78 jgs 150
79     /*
80     case PASO_UMFPACK:
81     Paso_UMFPACK(A,out,in,options);
82 gross 727 A->solver_package=PASO_UMFPACK;
83 jgs 150 break;
84     */
85    
86     default:
87 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
88 gross 584 break;
89 jgs 150 }
90     }
91 gross 584 Performance_close(&pp,options->verbose);
92 jgs 150 return;
93     }
94    
95     /* free memory possibly resereved for a recall */
96    
97     void Paso_solve_free(Paso_SystemMatrix* in) {
98 gross 727
99 gross 425 switch(in->solver_package) {
100    
101     case PASO_PASO:
102 jgs 150 Paso_Solver_free(in);
103 gross 425 break;
104    
105     #ifdef SCSL
106     case PASO_SCSL:
107 jgs 150 Paso_SCSL_free(in);
108 gross 425 break;
109     #endif
110    
111    
112     #ifdef MKL
113     case PASO_MKL:
114     Paso_MKL_free(in);
115     break;
116     #endif
117    
118     /*
119     case PASO_UMFPACK:
120     Paso_UMFPACK_free(in);
121     break;
122     */
123     }
124 jgs 150 }
125     /*
126     * $Log$
127     * Revision 1.2 2005/09/15 03:44:39 jgs
128     * Merge of development branch dev-02 back to main trunk on 2005-09-15
129     *
130     * Revision 1.1.2.2 2005/09/07 00:59:08 gross
131     * some inconsistent renaming fixed to make the linking work.
132     *
133     * Revision 1.1.2.1 2005/09/05 06:29:49 gross
134     * These files have been extracted from finley to define a stand alone libray for iterative
135     * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
136     * has not been tested yet.
137     *
138     *
139     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26