/[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 1258 - (show annotations)
Mon Aug 20 03:56:05 2007 UTC (12 years, 1 month ago) by gross
File MIME type: text/plain
File size: 3740 byte(s)
solver starts now but there still seems to be a problem in the MVM
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
49 Paso_Performance pp;
50 index_t package;
51 Paso_resetError();
52 if (Paso_SystemMatrix_getGlobalNumCols(A) != Paso_SystemMatrix_getGlobalNumRows(A)
53 || A->col_block_size!=A->row_block_size) {
54 Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
55 return;
56 }
57 Performance_open(&pp,options->verbose);
58 package=Paso_Options_getPackage(options->method,options->package,options->symmetric);
59 if (Paso_noError()) {
60 switch(package) {
61
62 case PASO_PASO:
63 Paso_Solver(A,out,in,options,&pp);
64 A->solver_package=PASO_PASO;
65 break;
66
67 #ifdef SCSL
68 case PASO_SCSL:
69 if (A->mpi_info->size>1) {
70 Paso_setError(VALUE_ERROR,"Paso_solve: SCSL package does not support MPI.");
71 return;
72 }
73 Paso_SCSL(A,out,in,options,&pp);
74 A->solver_package=PASO_SCSL;
75 break;
76 #endif
77
78
79 #ifdef MKL
80 case PASO_MKL:
81 if (A->mpi_info->size>1) {
82 Paso_setError(VALUE_ERROR,"Paso_solve: MKL package does not support MPI.");
83 return;
84 }
85 Paso_MKL(A,out,in,options,&pp);
86 A->solver_package=PASO_MKL;
87 break;
88 #endif
89
90 #ifdef UMFPACK
91 case PASO_UMFPACK:
92 if (A->mpi_info->size>1) {
93 Paso_setError(VALUE_ERROR,"Paso_solve: UMFPACK package does not support MPI.");
94 return;
95 }
96 Paso_UMFPACK(A,out,in,options,&pp);
97 A->solver_package=PASO_UMFPACK;
98 break;
99 #endif
100
101 default:
102 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
103 break;
104 }
105 }
106 Performance_close(&pp,options->verbose);
107 return;
108 }
109
110 /* free memory possibly resereved for a recall */
111
112 void Paso_solve_free(Paso_SystemMatrix* in) {
113
114 switch(in->solver_package) {
115
116 case PASO_PASO:
117 Paso_Solver_free(in);
118 break;
119
120 #ifdef SCSL
121 case PASO_SCSL:
122 Paso_SCSL_free(in);
123 break;
124 #endif
125
126
127 #ifdef MKL
128 case PASO_MKL:
129 Paso_MKL_free(in);
130 break;
131 #endif
132
133 #ifdef UMFPACK
134 case PASO_UMFPACK:
135 Paso_UMFPACK_free(in);
136 break;
137 #endif
138
139 }
140 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26