56
56
&n, A->mainBlock->val, A->mainBlock->pattern->ptr, A->mainBlock->pattern->index, &idum, &nrhs,
57
57
iparm, &msglvl,&ddum, &ddum, &error);
58
58
MEMFREE(A->solver);
59
if (error != MKL_ERROR_NO) Paso_setError(TYPE_ERROR,"memory release in paradiso library failed.");
59
if (error != MKL_ERROR_NO) Esys_setError(TYPE_ERROR,"memory release in paradiso library failed.");
74
74
if (! (A->type & (MATRIX_FORMAT_OFFSET1 + MATRIX_FORMAT_BLK1)) ) {
75
Paso_setError(TYPE_ERROR,"Paso_MKL: MKL requires CSR format with index offset 1 and block size 1.");
75
Esys_setError(TYPE_ERROR,"Paso_MKL: MKL requires CSR format with index offset 1 and block size 1.");
78
78
options->converged=FALSE;
118
118
/* allocate address pointer */
119
119
pt=MEMALLOC(64,_MKL_DSS_HANDLE_t);
120
if (Paso_checkPtr(pt)) return;
120
if (Esys_checkPtr(pt)) return;
121
121
A->solver=(void*) pt;
122
122
for (i=0;i<64;++i) pt[i]=NULL;
124
124
/* symbolic factorization */
125
125
phase = MKL_PHASE_SYMBOLIC_FACTORIZATION;
126
126
PARDISO (pt, &maxfct, &mnum, &mtype, &phase,
128
128
iparm, &msglvl, in, out, &error);
129
129
if (error != MKL_ERROR_NO) {
130
130
if (options->verbose) printf("MKL: symbolic factorization factorization failed.\n");
131
Paso_setError(VALUE_ERROR,"symbolic factorization in paradiso library failed.");
131
Esys_setError(VALUE_ERROR,"symbolic factorization in paradiso library failed.");
132
132
Paso_MKL_free(A);
134
134
/* LDU factorization */
138
138
iparm, &msglvl, in, out, &error);
139
139
if (error != MKL_ERROR_NO) {
140
140
if (options->verbose) printf("MKL: LDU factorization failed.\n");
141
Paso_setError(ZERO_DIVISION_ERROR,"factorization in paradiso library failed. Most likely the matrix is singular.");
141
Esys_setError(ZERO_DIVISION_ERROR,"factorization in paradiso library failed. Most likely the matrix is singular.");
142
142
Paso_MKL_free(A);
144
144
if (options->verbose) printf("MKL: LDU factorization completed.\n");
146
options->set_up_time=Paso_timer()-time0;
146
options->set_up_time=Esys_timer()-time0;
148
148
options->set_up_time=0;
150
150
/* forward backward substitution\ */
151
if (Paso_noError()) {
151
if (Esys_noError()) {
153
153
phase = MKL_PHASE_SOLVE;
154
154
PARDISO (pt, &maxfct, &mnum, &mtype, &phase,
155
155
&n, A->mainBlock->val, A->mainBlock->pattern->ptr, A->mainBlock->pattern->index, &idum, &nrhs,
157
157
if (options->verbose) printf("MKL: solve completed.\n");
158
158
if (error != MKL_ERROR_NO) {
159
159
if (options->verbose) printf("MKL: forward/backward substitution failed.\n");
160
Paso_setError(VALUE_ERROR,"forward/backward substitution in paradiso library failed. Most likely the matrix is singular.");
160
Esys_setError(VALUE_ERROR,"forward/backward substitution in paradiso library failed. Most likely the matrix is singular.");
162
162
if (options->verbose) printf("MKL: forward/backward substitution completed.\n");
163
163
options->residual_norm=0.;
166
166
options->num_inner_iter=0;
167
167
options->converged=TRUE;
169
options->time=Paso_timer()-time0 + options->set_up_time;
169
options->time=Esys_timer()-time0 + options->set_up_time;
171
171
Performance_stopMonitor(pp,PERFORMANCE_ALL);
173
Paso_setError(SYSTEM_ERROR,"Paso_MKL:MKL is not avialble.");
173
Esys_setError(SYSTEM_ERROR,"Paso_MKL:MKL is not avialble.");
196
196
&n, A->val, A->pattern->ptr, A->pattern->index, &idum, &nrhs,
197
197
iparm, &msglvl,&ddum, &ddum, &error);
198
198
MEMFREE(A->solver);
199
if (error != MKL_ERROR_NO) Paso_setError(TYPE_ERROR,"memory release in paradiso library failed.");
199
if (error != MKL_ERROR_NO) Esys_setError(TYPE_ERROR,"memory release in paradiso library failed.");
212
212
if (! (A->type & (MATRIX_FORMAT_OFFSET1 + MATRIX_FORMAT_BLK1)) ) {
213
Paso_setError(TYPE_ERROR,"Paso_MKL: MKL requires CSR format with index offset 1 and block size 1.");
213
Esys_setError(TYPE_ERROR,"Paso_MKL: MKL requires CSR format with index offset 1 and block size 1.");
216
216
_INTEGER_t mtype = MKL_MTYPE_UNSYM;
249
249
/* allocate address pointer */
250
250
pt=MEMALLOC(64,_MKL_DSS_HANDLE_t);
251
if (Paso_checkPtr(pt)) return;
251
if (Esys_checkPtr(pt)) return;
252
252
A->solver=(void*) pt;
253
253
for (i=0;i<64;++i) pt[i]=NULL;
254
254
/* symbolic factorization */
257
257
&n, A->val, A->pattern->ptr, A->pattern->index, &idum, &nrhs,
258
258
iparm, &msglvl, in, out, &error);
259
259
if (error != MKL_ERROR_NO) {
260
Paso_setError(VALUE_ERROR,"symbolic factorization in paradiso library failed.");
260
Esys_setError(VALUE_ERROR,"symbolic factorization in paradiso library failed.");
261
261
Paso_MKL_free1(A);
263
263
/* LDU factorization */
266
266
&n, A->val, A->pattern->ptr, A->pattern->index, &idum, &nrhs,
267
267
iparm, &msglvl, in, out, &error);
268
268
if (error != MKL_ERROR_NO) {
269
Paso_setError(ZERO_DIVISION_ERROR,"factorization in paradiso library failed. Most likely the matrix is singular.");
269
Esys_setError(ZERO_DIVISION_ERROR,"factorization in paradiso library failed. Most likely the matrix is singular.");
270
270
Paso_MKL_free1(A);
272
272
if (verbose) printf("MKL: LDU factorization completed.\n");
275
275
/* forward backward substitution\ */
276
if (Paso_noError()) {
276
if (Esys_noError()) {
277
277
phase = MKL_PHASE_SOLVE;
278
278
PARDISO (pt, &maxfct, &mnum, &mtype, &phase,
279
279
&n, A->val, A->pattern->ptr, A->pattern->index, &idum, &nrhs,
280
280
iparm, &msglvl, in, out, &error);
281
281
if (verbose) printf("MKL: solve completed.\n");
282
282
if (error != MKL_ERROR_NO) {
283
Paso_setError(VALUE_ERROR,"forward/backward substition in paradiso library failed. Most likely the matrix is singular.");
283
Esys_setError(VALUE_ERROR,"forward/backward substition in paradiso library failed. Most likely the matrix is singular.");
287
Paso_setError(SYSTEM_ERROR,"Paso_MKL:MKL is not avialble.");
287
Esys_setError(SYSTEM_ERROR,"Paso_MKL:MKL is not avialble.");