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

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

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

revision 425 by gross, Tue Jan 10 04:10:39 2006 UTC revision 584 by gross, Thu Mar 9 23:03:38 2006 UTC
# Line 52  void Paso_MKL_free(Paso_SystemMatrix* A) Line 52  void Paso_MKL_free(Paso_SystemMatrix* A)
52  void Paso_MKL(Paso_SystemMatrix* A,  void Paso_MKL(Paso_SystemMatrix* A,
53                            double* out,                            double* out,
54                            double* in,                            double* in,
55                            Paso_Options* options) {                            Paso_Options* options,
56                              Paso_Performance* pp) {
57  #ifdef MKL  #ifdef MKL
58       double time0;       double time0;
59       index_t i;       index_t i;
# Line 61  void Paso_MKL(Paso_SystemMatrix* A, Line 62  void Paso_MKL(Paso_SystemMatrix* A,
62          Paso_setError(TYPE_ERROR,"Paso_MKL: MKL requires CSR format with index offset 1 and block size 1.");          Paso_setError(TYPE_ERROR,"Paso_MKL: MKL requires CSR format with index offset 1 and block size 1.");
63          return;          return;
64       }       }
65         Performance_startMonitor(pp,PERFORMANCE_ALL);
66       _INTEGER_t mtype = MKL_MTYPE_UNSYM;       _INTEGER_t mtype = MKL_MTYPE_UNSYM;
67       if (A->type & MATRIX_FORMAT_SYM) mtype=MKL_MTYPE_SYM;       if (A->type & MATRIX_FORMAT_SYM) mtype=MKL_MTYPE_SYM;
68       _INTEGER_t n = A->num_rows;       _INTEGER_t n = A->num_rows;
# Line 114  void Paso_MKL(Paso_SystemMatrix* A, Line 116  void Paso_MKL(Paso_SystemMatrix* A,
116          if (error != MKL_ERROR_NO) {          if (error != MKL_ERROR_NO) {
117               Paso_setError(VALUE_ERROR,"symbolic factorization in paradiso library failed.");               Paso_setError(VALUE_ERROR,"symbolic factorization in paradiso library failed.");
118               Paso_MKL_free(A);               Paso_MKL_free(A);
119               return;          } else {
120          }             /* LDU factorization */
121          /* LDU factorization */             phase = MKL_PHASE_FACTORIZATION;
122          phase = MKL_PHASE_FACTORIZATION;             PARDISO(pt, &maxfct, &mnum, &mtype, &phase,
         PARDISO(pt, &maxfct, &mnum, &mtype, &phase,  
123                  &n, A->val, A->pattern->ptr, A->pattern->index, &idum, &nrhs,                  &n, A->val, A->pattern->ptr, A->pattern->index, &idum, &nrhs,
124                  iparm, &msglvl, in, out, &error);                  iparm, &msglvl, in, out, &error);
125          if (error != MKL_ERROR_NO) {             if (error != MKL_ERROR_NO) {
126               Paso_setError(ZERO_DIVISION_ERROR,"factorization in paradiso library failed.");               Paso_setError(ZERO_DIVISION_ERROR,"factorization in paradiso library failed.");
127               Paso_MKL_free(A);               Paso_MKL_free(A);
128               return;             }
129               if (options->verbose) printf("timing MKL: LDU factorization: %.4e sec.\n",Paso_timer()-time0);
130          }          }
         if (options->verbose) printf("timing MKL: LDU factorization: %.4e sec.\n",Paso_timer()-time0);  
131       }       }
132       /* forward backward substitution\ */       /* forward backward substitution\ */
133       if (Paso_noError())  {       if (Paso_noError())  {
# Line 138  void Paso_MKL(Paso_SystemMatrix* A, Line 139  void Paso_MKL(Paso_SystemMatrix* A,
139          if (options->verbose) printf("timing MKL: solve: %.4e sec\n",Paso_timer()-time0);          if (options->verbose) printf("timing MKL: solve: %.4e sec\n",Paso_timer()-time0);
140          if (error != MKL_ERROR_NO) {          if (error != MKL_ERROR_NO) {
141                Paso_setError(VALUE_ERROR,"forward/backward substition in paradiso library failed.");                Paso_setError(VALUE_ERROR,"forward/backward substition in paradiso library failed.");
               return;  
142          }          }
143       }       }
144         Performance_stopMonitor(pp,PERFORMANCE_ALL);
145  #else  #else
146      Paso_setError(SYSTEM_ERROR,"Paso_MKL:MKL is not avialble.");      Paso_setError(SYSTEM_ERROR,"Paso_MKL:MKL is not avialble.");
147  #endif  #endif

Legend:
Removed from v.425  
changed lines
  Added in v.584

  ViewVC Help
Powered by ViewVC 1.1.26