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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 633 by dhawcroft, Thu Mar 23 05:37:00 2006 UTC revision 1417 by gross, Mon Feb 25 04:45:48 2008 UTC
# Line 1  Line 1 
 /* $Id$ */  
1    
2    /* $Id$ */
3    
4  /*  /*******************************************************
5  ********************************************************************************   *
6  *               Copyright   2006 by ACcESS MNRF                                *   *           Copyright 2003-2007 by ACceSS MNRF
7  *                                                                              *   *       Copyright 2007 by University of Queensland
8  *                 http://www.access.edu.au                                     *   *
9  *           Primary Business: Queensland, Australia                            *   *                http://esscc.uq.edu.au
10  *     Licensed under the Open Software License version 3.0             *   *        Primary Business: Queensland, Australia
11  *        http://www.opensource.org/licenses/osl-3.0.php                        *   *  Licensed under the Open Software License version 3.0
12  ********************************************************************************   *     http://www.opensource.org/licenses/osl-3.0.php
13  */   *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
# Line 25  Line 26 
26    
27  #include "Paso.h"  #include "Paso.h"
28  #include "performance.h"  #include "performance.h"
29  #include "Solvers/Solver.h"  #include "Solver.h"
30    
31  #ifdef SCSL  #ifdef SCSL
32  #include "SCSL.h"  #include "SCSL.h"
# Line 42  Line 43 
43  /**************************************************************/  /**************************************************************/
44    
45  void Paso_solve(Paso_SystemMatrix* A,  void Paso_solve(Paso_SystemMatrix* A,
46                                 double* out,                  double* out,
47                                 double* in,                  double* in,
48                                 Paso_Options* options) {                  Paso_Options* options) {
49    
50    Paso_Performance pp;    Paso_Performance pp;
51      index_t package;
52    Paso_resetError();    Paso_resetError();
53    if (A->num_rows!=A->num_cols || A->col_block_size!=A->row_block_size) {    if (Paso_SystemMatrix_getGlobalNumCols(A) != Paso_SystemMatrix_getGlobalNumRows(A)
54                    || A->col_block_size!=A->row_block_size) {
55         Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");         Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
56         return;         return;
57    }    }
58    Performance_open(&pp,options->verbose);    Performance_open(&pp,options->verbose);
59    index_t package=Paso_Options_getPackage(options->method,options->package,options->symmetric);    package=Paso_Options_getPackage(options->method,options->package,options->symmetric);
60    if (Paso_noError()) {    if (Paso_noError()) {
61       switch(package) {       switch(package) {
62    
63          case PASO_PASO:          case PASO_PASO:
64            Paso_Solver(A,out,in,options,&pp);            Paso_Solver(A,out,in,options,&pp);
65            if (Paso_noError()) A->solver_package=PASO_PASO;            A->solver_package=PASO_PASO;
66            break;            break;
67    
68          #ifdef SCSL          #ifdef SCSL
69          case PASO_SCSL:          case PASO_SCSL:
70              if (A->mpi_info->size>1) {
71                  Paso_setError(VALUE_ERROR,"Paso_solve: SCSL package does not support MPI.");
72                  return;
73              }
74            Paso_SCSL(A,out,in,options,&pp);            Paso_SCSL(A,out,in,options,&pp);
75            if (Paso_noError()) A->solver_package=PASO_SCSL;            A->solver_package=PASO_SCSL;
76            break;            break;
77          #endif          #endif
78    
79        
80          #ifdef MKL          #ifdef MKL
81          case PASO_MKL:          case PASO_MKL:
82              if (A->mpi_info->size>1) {
83                  Paso_setError(VALUE_ERROR,"Paso_solve: MKL package does not support MPI.");
84                  return;
85              }
86            Paso_MKL(A,out,in,options,&pp);            Paso_MKL(A,out,in,options,&pp);
87            if (Paso_noError()) A->solver_package=PASO_MKL;            A->solver_package=PASO_MKL;
88            break;            break;
89          #endif          #endif
90    
91  /*          #ifdef UMFPACK
92          case PASO_UMFPACK:          case PASO_UMFPACK:
93            Paso_UMFPACK(A,out,in,options);            if (A->mpi_info->size>1) {
94            if (Paso_noError()) A->solver_package=PASO_UMFPACK;                Paso_setError(VALUE_ERROR,"Paso_solve: UMFPACK package does not support MPI.");
95                  return;
96              }
97              Paso_UMFPACK(A,out,in,options,&pp);
98              A->solver_package=PASO_UMFPACK;
99            break;            break;
100  */          #endif
101    
102          default:          default:
103             Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");             Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
# Line 95  void Paso_solve(Paso_SystemMatrix* A, Line 111  void Paso_solve(Paso_SystemMatrix* A,
111  /*  free memory possibly resereved for a recall */  /*  free memory possibly resereved for a recall */
112    
113  void Paso_solve_free(Paso_SystemMatrix* in) {  void Paso_solve_free(Paso_SystemMatrix* in) {
114    
115         if (in==NULL) return;
116    
117       switch(in->solver_package) {       switch(in->solver_package) {
118    
119          case PASO_PASO:          case PASO_PASO:
# Line 114  void Paso_solve_free(Paso_SystemMatrix* Line 133  void Paso_solve_free(Paso_SystemMatrix*
133            break;            break;
134          #endif          #endif
135    
136  /*          #ifdef UMFPACK
137          case PASO_UMFPACK:          case PASO_UMFPACK:
138            Paso_UMFPACK_free(in);            Paso_UMFPACK_free(in);
139            break;            break;
140  */          #endif
141    
142     }     }
143  }  }
 /*  
  * $Log$  
  * Revision 1.2  2005/09/15 03:44:39  jgs  
  * Merge of development branch dev-02 back to main trunk on 2005-09-15  
  *  
  * Revision 1.1.2.2  2005/09/07 00:59:08  gross  
  * some inconsistent renaming fixed to make the linking work.  
  *  
  * Revision 1.1.2.1  2005/09/05 06:29:49  gross  
  * These files have been extracted from finley to define a stand alone libray for iterative  
  * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but  
  * has not been tested yet.  
  *  
  *  
  */  

Legend:
Removed from v.633  
changed lines
  Added in v.1417

  ViewVC Help
Powered by ViewVC 1.1.26