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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 969 - (hide 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 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 ksteube 969 #ifdef TRILINOS
43     #include "TRILINOS.h"
44     #endif
45    
46 jgs 150 /**************************************************************/
47    
48     void Paso_solve(Paso_SystemMatrix* A,
49     double* out,
50     double* in,
51     Paso_Options* options) {
52 gross 584 Paso_Performance pp;
53 jgs 150 Paso_resetError();
54     if (A->num_rows!=A->num_cols || A->col_block_size!=A->row_block_size) {
55 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
56 jgs 150 return;
57     }
58 gross 584 Performance_open(&pp,options->verbose);
59 ksteube 969 printf("ksteube in paso/src/solve.c : Paso_solve\n");
60 jgs 150 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 ksteube 969 printf("ksteube in paso/src/solve.c : Paso_solve PASO_PASO\n");
66 gross 584 Paso_Solver(A,out,in,options,&pp);
67 gross 727 A->solver_package=PASO_PASO;
68 jgs 150 break;
69    
70     #ifdef SCSL
71     case PASO_SCSL:
72 gross 584 Paso_SCSL(A,out,in,options,&pp);
73 gross 727 A->solver_package=PASO_SCSL;
74 jgs 150 break;
75     #endif
76    
77 gross 425
78     #ifdef MKL
79 jgs 150 case PASO_MKL:
80 gross 584 Paso_MKL(A,out,in,options,&pp);
81 gross 727 A->solver_package=PASO_MKL;
82 jgs 150 break;
83 gross 425 #endif
84 jgs 150
85 gross 805 #ifdef UMFPACK
86 jgs 150 case PASO_UMFPACK:
87 gross 806 Paso_UMFPACK(A,out,in,options,&pp);
88 gross 727 A->solver_package=PASO_UMFPACK;
89 jgs 150 break;
90 gross 805 #endif
91 jgs 150
92 ksteube 969 #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 jgs 150 default:
101 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
102 gross 584 break;
103 jgs 150 }
104     }
105 gross 584 Performance_close(&pp,options->verbose);
106 jgs 150 return;
107     }
108    
109     /* free memory possibly resereved for a recall */
110    
111     void Paso_solve_free(Paso_SystemMatrix* in) {
112 gross 727
113 gross 425 switch(in->solver_package) {
114    
115     case PASO_PASO:
116 jgs 150 Paso_Solver_free(in);
117 gross 425 break;
118    
119     #ifdef SCSL
120     case PASO_SCSL:
121 jgs 150 Paso_SCSL_free(in);
122 gross 425 break;
123     #endif
124    
125    
126     #ifdef MKL
127     case PASO_MKL:
128     Paso_MKL_free(in);
129     break;
130     #endif
131    
132 gross 806 #ifdef UMFPACK
133 gross 425 case PASO_UMFPACK:
134     Paso_UMFPACK_free(in);
135     break;
136 gross 806 #endif
137 ksteube 969
138     #ifdef TRILINOS
139     case PASO_TRILINOS:
140     Paso_TRILINOS_free(in);
141     break;
142     #endif
143 gross 425 }
144 jgs 150 }
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