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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (hide annotations)
Mon Sep 24 06:18:44 2007 UTC (12 years ago) by ksteube
File MIME type: text/plain
File size: 3522 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

1 ksteube 1312
2 jgs 150 /* $Id$ */
3    
4 ksteube 1312 /*******************************************************
5     *
6     * Copyright 2003-2007 by ACceSS MNRF
7     * Copyright 2007 by University of Queensland
8     *
9     * http://esscc.uq.edu.au
10     * Primary Business: Queensland, Australia
11     * Licensed under the Open Software License version 3.0
12     * http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15 dhawcroft 631
16 jgs 150 /**************************************************************/
17    
18     /* Paso: interface to the direct solvers */
19    
20     /**************************************************************/
21    
22     /* Copyrights by ACcESS Australia 2003 */
23     /* Author: gross@access.edu.au */
24    
25     /**************************************************************/
26    
27     #include "Paso.h"
28 gross 584 #include "performance.h"
29 gross 700 #include "Solver.h"
30 jgs 150
31     #ifdef SCSL
32 gross 411 #include "SCSL.h"
33 jgs 150 #endif
34    
35     #ifdef MKL
36 gross 411 #include "MKL.h"
37 jgs 150 #endif
38    
39     #ifdef UMFPACK
40 gross 411 #include "UMFPACK.h"
41 jgs 150 #endif
42    
43     /**************************************************************/
44    
45     void Paso_solve(Paso_SystemMatrix* A,
46     double* out,
47     double* in,
48     Paso_Options* options) {
49 ksteube 1312
50 gross 584 Paso_Performance pp;
51 gross 1028 index_t package;
52 jgs 150 Paso_resetError();
53 ksteube 1312 if (Paso_SystemMatrix_getGlobalNumCols(A) != Paso_SystemMatrix_getGlobalNumRows(A)
54     || 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 gross 1028 package=Paso_Options_getPackage(options->method,options->package,options->symmetric);
60 jgs 150 if (Paso_noError()) {
61     switch(package) {
62    
63     case PASO_PASO:
64 gross 584 Paso_Solver(A,out,in,options,&pp);
65 gross 727 A->solver_package=PASO_PASO;
66 jgs 150 break;
67    
68     #ifdef SCSL
69     case PASO_SCSL:
70 ksteube 1312 if (A->mpi_info->size>1) {
71     Paso_setError(VALUE_ERROR,"Paso_solve: SCSL package does not support MPI.");
72     return;
73     }
74 gross 584 Paso_SCSL(A,out,in,options,&pp);
75 gross 727 A->solver_package=PASO_SCSL;
76 jgs 150 break;
77     #endif
78    
79 gross 425
80     #ifdef MKL
81 jgs 150 case PASO_MKL:
82 ksteube 1312 if (A->mpi_info->size>1) {
83     Paso_setError(VALUE_ERROR,"Paso_solve: MKL package does not support MPI.");
84     return;
85     }
86 gross 584 Paso_MKL(A,out,in,options,&pp);
87 gross 727 A->solver_package=PASO_MKL;
88 jgs 150 break;
89 gross 425 #endif
90 jgs 150
91 gross 805 #ifdef UMFPACK
92 jgs 150 case PASO_UMFPACK:
93 ksteube 1312 if (A->mpi_info->size>1) {
94     Paso_setError(VALUE_ERROR,"Paso_solve: UMFPACK package does not support MPI.");
95     return;
96     }
97 gross 806 Paso_UMFPACK(A,out,in,options,&pp);
98 gross 727 A->solver_package=PASO_UMFPACK;
99 jgs 150 break;
100 gross 805 #endif
101 jgs 150
102     default:
103 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
104 gross 584 break;
105 jgs 150 }
106     }
107 gross 584 Performance_close(&pp,options->verbose);
108 jgs 150 return;
109     }
110    
111     /* free memory possibly resereved for a recall */
112    
113     void Paso_solve_free(Paso_SystemMatrix* in) {
114 gross 727
115 gross 425 switch(in->solver_package) {
116    
117     case PASO_PASO:
118 jgs 150 Paso_Solver_free(in);
119 gross 425 break;
120    
121     #ifdef SCSL
122     case PASO_SCSL:
123 jgs 150 Paso_SCSL_free(in);
124 gross 425 break;
125     #endif
126    
127    
128     #ifdef MKL
129     case PASO_MKL:
130     Paso_MKL_free(in);
131     break;
132     #endif
133    
134 gross 806 #ifdef UMFPACK
135 gross 425 case PASO_UMFPACK:
136     Paso_UMFPACK_free(in);
137     break;
138 gross 806 #endif
139 ksteube 1312
140 gross 425 }
141 jgs 150 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26