Debian Codegraph @

include/deal.II/lac/scalapack.templates.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2017 - 2025 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // Part of the source code is dual licensed under Apache-2.0 WITH
9 // LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10 // governing the source code and code contributions can be found in
11 // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12 //
13 // ------------------------------------------------------------------------
14
15 #ifndef dealii_scalapack_templates_h
16 #define dealii_scalapack_templates_h
17
18
19 #include <deal.II/base/config.h>
20
21 // This file does not actually import anything into namespace dealii,
22 // but to avoid it being completely empty to some of our scripts, we
23 // need to make sure it opens and closes the namespace at least once.
24 DEAL_II_NAMESPACE_OPEN
25 DEAL_II_NAMESPACE_CLOSE // Do not convert for module purposes
26
27
28 #ifdef DEAL_II_WITH_SCALAPACK
29
30 # include <deal.II/base/mpi.h>
31 # include <deal.II/base/mpi.templates.h>
32
33 # ifdef DEAL_II_HAVE_FP_EXCEPTIONS
34 # include <cfenv>
35 # endif
36
37
38 // useful examples:
39 // https://stackoverflow.com/questions/14147705/cholesky-decomposition-scalapack-error/14203864
40 // http://icl.cs.utk.edu/lapack-forum/viewtopic.php?t=139 // second post by
41 // Julien Langou
42 // https://andyspiros.wordpress.com/2011/07/08/an-example-of-blacs-with-c/
43 // http://qboxcode.org/trac/browser/qb/tags/rel1_63_4/src/Matrix.C
44 // https://gitlab.phys.ethz.ch/lwossnig/lecture/blob/a534f562dfb2ad5c564abe5c2356d5d956fb7218/examples/mpi/scalapack.cpp
45 // https://github.com/elemental/Elemental/blob/master/src/core/imports/scalapack.cpp
46 // https://scicomp.stackexchange.com/questions/7766/performance-optimization-or-tuning-possible-for-scalapack-gemm
47 //
48 // info:
49 // http://www.netlib.org/scalapack/slug/index.html // User guide
50 // http://www.netlib.org/scalapack/slug/node135.html // How to Measure Errors
51
52 extern "C"
53 {
54 /* Basic Linear Algebra Communication Subprograms (BLACS) declarations */
55 // https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_dinitb.htm#dinitb
56
57 /**
58 * Determine how many processes are available and the current process rank.
59 *
60 * https://www.ibm.com/support/knowledgecenter/en/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_dbpnf.htm
61 */
62 void Cblacs_pinfo(int *rank, int *nprocs);
63
64 /**
65 * Return internal BLACS value in @p val based on the input @p what and @p icontxt.
66 * The most common use is in retrieving a default system context (@p what = 0, @p icontxt is ignored)
67 * to be used in BLACS_GRIDINIT or BLACS_GRIDMAP.
68 *
69 * https://www.ibm.com/support/knowledgecenter/en/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_dbget.htm
70 */
71 void Cblacs_get(int icontxt, int what, int *val);
72
73 /**
74 * Map the processes sequentially in row-major or column-major order
75 * into the process grid. Input arguments must be the same on every process.
76 *
77 * On return, @p context is the integer handle to the BLACS context,
78 * whereas on entry it is a system context to be used in creating the
79 * BLACS context.
80 *
81 * https://www.ibm.com/support/knowledgecenter/en/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_dbint.htm
82 */
83 void Cblacs_gridinit(int *context,
84 const char *order,
85 int grid_height,
86 int grid_width);
87
88 /**
89 * Return the process row and column index.
90 *
91 * https://www.ibm.com/support/knowledgecenter/en/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_dbinfo.htm
92 */
93 void Cblacs_gridinfo(int context,
94 int *grid_height,
95 int *grid_width,
96 int *grid_row,
97 int *grid_col);
98
99 /**
100 * Given the system process number, return the row and column coordinates in
101 * the BLACS' process grid.
102 */
103 void Cblacs_pcoord(int ictxt, int pnum, int *prow, int *pcol);
104
105 /**
106 * Release a BLACS context.
107 */
108 void Cblacs_gridexit(int context);
109
110 /**
111 * This routines holds up execution of all processes within the indicated
112 * scope until they have all called the routine.
113 */
114 void Cblacs_barrier(int, const char *);
115
116 /**
117 * Free all BLACS contexts and releases all allocated memory.
118 */
119 void Cblacs_exit(int error_code);
120
121 /**
122 * Receives a message from a process @prsrc, @p csrc into a general rectangular matrix.
123 *
124 * https://software.intel.com/en-us/mkl-developer-reference-c-gerv2d
125 */
126 void Cdgerv2d(
127 int context, int M, int N, double *A, int lda, int rsrc, int csrc);
128 void Csgerv2d(
129 int context, int M, int N, float *A, int lda, int rsrc, int csrc);
130
131 /**
132 * Sends the general rectangular matrix A to the destination
133 * process @p rdest @p cdest in the process grid.
134 *
135 * https://software.intel.com/en-us/mkl-developer-reference-c-2018-beta-gesd2d
136 */
137 void Cdgesd2d(
138 int context, int M, int N, double *A, int lda, int rdest, int cdest);
139 void Csgesd2d(
140 int context, int M, int N, float *A, int lda, int rdest, int cdest);
141
142 /**
143 * Get BLACS context from MPI @p comm.
144 */
145 int Csys2blacs_handle(MPI_Comm comm);
146
147 /**
148 * Compute how many rows and columns each process owns (NUMber of Rows Or
149 * Columns).
150 *
151 * https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_dnumy.htm
152 */
153 int numroc_(const int *n,
154 const int *nb,
155 const int *iproc,
156 const int *isproc,
157 const int *nprocs);
158
159 /**
160 * Compute the Cholesky factorization of an N-by-N real
161 * symmetric positive definite distributed matrix sub( A ) denoting
162 * A(IA:IA+N-1, JA:JA+N-1).
163 *
164 * http://www.netlib.org/scalapack/explore-html/d5/d9e/pdpotrf_8f_source.html
165 * https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_lpotrf.htm
166 */
167 void pdpotrf_(const char *UPLO,
168 const int *N,
169 double *A,
170 const int *IA,
171 const int *JA,
172 const int *DESCA,
173 int *INFO);
174 void pspotrf_(const char *UPLO,
175 const int *N,
176 float *A,
177 const int *IA,
178 const int *JA,
179 const int *DESCA,
180 int *INFO);
181
182 /**
183 * Computes an LU factorization of a general distributed matrix sub( A )
184 * using partial pivoting with row interchanges.
185 *
186 * http://www.netlib.org/scalapack/explore-html/df/dfe/pdgetrf_8f_source.html
187 * https://www.ibm.com/support/knowledgecenter/en/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_lgetrf.htm
188 */
189 void pdgetrf_(const int *m,
190 const int *n,
191 double *A,
192 const int *IA,
193 const int *JA,
194 const int *DESCA,
195 int *ipiv,
196 int *INFO);
197 void psgetrf_(const int *m,
198 const int *n,
199 float *A,
200 const int *IA,
201 const int *JA,
202 const int *DESCA,
203 int *ipiv,
204 int *INFO);
205
206 /**
207 * Compute the inverse of a real symmetric positive definite
208 * distributed matrix sub( A ) = A(IA:IA+N-1,JA:JA+N-1) using the
209 * Cholesky factorization sub( A ) = U**T*U or L*L**T computed by
210 * PDPOTRF.
211 *
212 * http://www.netlib.org/scalapack/explore-html/d2/d44/pdpotri_8f_source.html
213 * https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_lpotri.htm
214 * https://software.intel.com/en-us/mkl-developer-reference-c-p-potri
215 */
216 void pdpotri_(const char *UPLO,
217 const int *N,
218 double *A,
219 const int *IA,
220 const int *JA,
221 const int *DESCA,
222 int *INFO);
223 void pspotri_(const char *UPLO,
224 const int *N,
225 float *A,
226 const int *IA,
227 const int *JA,
228 const int *DESCA,
229 int *INFO);
230
231 /**
232 * PDGETRI computes the inverse of a distributed matrix using the LU
233 * factorization computed by PDGETRF. This method inverts U and then
234 * computes the inverse of sub( A ) = A(IA:IA+N-1,JA:JA+N-1) denoted
235 * InvA by solving the system InvA*L = inv(U) for InvA.
236 *
237 * http://www.netlib.org/scalapack/explore-html/d3/df3/pdgetri_8f_source.html
238 * https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_lgetri.htm
239 */
240 void pdgetri_(const int *N,
241 double *A,
242 const int *IA,
243 const int *JA,
244 const int *DESCA,
245 const int *ipiv,
246 double *work,
247 int *lwork,
248 int *iwork,
249 int *liwork,
250 int *info);
251 void psgetri_(const int *N,
252 float *A,
253 const int *IA,
254 const int *JA,
255 const int *DESCA,
256 const int *ipiv,
257 float *work,
258 int *lwork,
259 int *iwork,
260 int *liwork,
261 int *info);
262
263
264 /**
265 * PDTRTRI computes the inverse of a upper or lower triangular
266 * distributed matrix sub( A ) = A(IA:IA+N-1,JA:JA+N-1).
267 *
268 * http://www.netlib.org/scalapack/explore-html/d9/dc0/pdtrtri_8f_source.html
269 * https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_lpdtri.htm
270 * https://software.intel.com/en-us/mkl-developer-reference-c-p-trtri
271 */
272 void pdtrtri_(const char *UPLO,
273 const char *DIAG,
274 const int *N,
275 double *A,
276 const int *IA,
277 const int *JA,
278 const int *DESCA,
279 int *INFO);
280 void pstrtri_(const char *UPLO,
281 const char *DIAG,
282 const int *N,
283 float *A,
284 const int *IA,
285 const int *JA,
286 const int *DESCA,
287 int *INFO);
288
289 /**
290 * Estimate the reciprocal of the condition number (in the
291 * l1-norm) of a real symmetric positive definite distributed matrix
292 * using the Cholesky factorization.
293 *
294 * https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_lpocon.htm#lpocon
295 * http://www.netlib.org/scalapack/explore-html/d4/df7/pdpocon_8f.html
296 * https://software.intel.com/en-us/mkl-developer-reference-fortran-pocon
297 */
298 void pdpocon_(const char *uplo,
299 const int *N,
300 const double *A,
301 const int *IA,
302 const int *JA,
303 const int *DESCA,
304 const double *ANORM,
305 double *RCOND,
306 double *WORK,
307 const int *LWORK,
308 int *IWORK,
309 const int *LIWORK,
310 int *INFO);
311 void pspocon_(const char *uplo,
312 const int *N,
313 const float *A,
314 const int *IA,
315 const int *JA,
316 const int *DESCA,
317 const float *ANORM,
318 float *RCOND,
319 float *WORK,
320 const int *LWORK,
321 int *IWORK,
322 const int *LIWORK,
323 int *INFO);
324
325 /**
326 * Norm of a real symmetric matrix
327 *
328 * http://www.netlib.org/scalapack/explore-html/dd/d12/pdlansy_8f_source.html
329 * https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_pdlansy.htm#pdlansy
330 */
331 double pdlansy_(const char *norm,
332 const char *uplo,
333 const int *N,
334 const double *A,
335 const int *IA,
336 const int *JA,
337 const int *DESCA,
338 double *work);
339 float pslansy_(const char *norm,
340 const char *uplo,
341 const int *N,
342 const float *A,
343 const int *IA,
344 const int *JA,
345 const int *DESCA,
346 float *work);
347
348 /**
349 * Compute the Least Common Multiple (LCM) of two positive integers @p M and @p N.
350 * In fact the routine Compute the greatest common divisor (GCD) and
351 * use the fact that M*N = GCD*LCM.
352 *
353 * http://www.netlib.org/scalapack/explore-html/d0/d9b/ilcm_8f_source.html
354 */
355 int ilcm_(const int *M, const int *N);
356
357 /**
358 * Return the ceiling of the division of two integers.
359 *
360 * http://www.netlib.org/scalapack/explore-html/df/d07/iceil_8f_source.html
361 */
362 int iceil_(const int *i1, const int *i2);
363
364 /**
365 * Initialize the descriptor vector with the 8 input arguments
366 */
367 void descinit_(int *desc,
368 const int *m,
369 const int *n,
370 const int *mb,
371 const int *nb,
372 const int *irsrc,
373 const int *icsrc,
374 const int *ictxt,
375 const int *lld,
376 int *info);
377
378 /**
379 * Compute the global index of a distributed matrix entry
380 * pointed to by the local index @p indxloc of the process indicated by
381 * @p iproc.
382 *
383 * @param indxloc The local index of the distributed matrix entry.
384 * @param nb Block size, size of the blocks the distributed matrix is split
385 * into.
386 * @param iproc The coordinate of the process whose local array row or column
387 * is to be determined
388 * @param isrcproc The coordinate of the process that possesses the first
389 * row/column of the distributed matrix
390 * @param nprocs The total number processes over which the distributed matrix
391 * is distributed
392 */
393 int indxl2g_(const int *indxloc,
394 const int *nb,
395 const int *iproc,
396 const int *isrcproc,
397 const int *nprocs);
398
399 /**
400 * Compute the solution to a real system of linear equations
401 */
402 void pdgesv_(const int *n,
403 const int *nrhs,
404 double *A,
405 const int *ia,
406 const int *ja,
407 const int *desca,
408 int *ipiv,
409 double *B,
410 const int *ib,
411 const int *jb,
412 const int *descb,
413 int *info);
414 void psgesv_(const int *n,
415 const int *nrhs,
416 float *A,
417 const int *ia,
418 const int *ja,
419 const int *desca,
420 int *ipiv,
421 float *B,
422 const int *ib,
423 const int *jb,
424 const int *descb,
425 int *info);
426
427 /**
428 * Perform one of the matrix-matrix operations:
429 * @f{align*}{
430 * \mathrm{sub}(C) &\dealcoloneq \alpha op(\mathrm{sub}(A))op(\mathrm{sub}(B))
431 * + \beta \mathrm{sub}(C), \\
432 * \mathrm{sub}(C) &\dealcoloneq \alpha op(\mathrm{sub}(A))op(\mathrm{sub}(B))
433 * + beta sub(C),
434 * @f}
435 * where
436 * $\mathrm{sub}(C)$ denotes C(IC:IC+M-1,JC:JC+N-1), and, $op(X)$ is one of
437 * $op(X) = X$ or $op(X) = X^T$.
438 */
439 void pdgemm_(const char *transa,
440 const char *transb,
441 const int *m,
442 const int *n,
443 const int *k,
444 const double *alpha,
445 const double *A,
446 const int *IA,
447 const int *JA,
448 const int *DESCA,
449 const double *B,
450 const int *IB,
451 const int *JB,
452 const int *DESCB,
453 const double *beta,
454 double *C,
455 const int *IC,
456 const int *JC,
457 const int *DESCC);
458 void psgemm_(const char *transa,
459 const char *transb,
460 const int *m,
461 const int *n,
462 const int *k,
463 const float *alpha,
464 const float *A,
465 const int *IA,
466 const int *JA,
467 const int *DESCA,
468 const float *B,
469 const int *IB,
470 const int *JB,
471 const int *DESCB,
472 const float *beta,
473 float *C,
474 const int *IC,
475 const int *JC,
476 const int *DESCC);
477
478 /**
479 * Return the value of the one norm, or the Frobenius norm, or the infinity
480 * norm, or the element of largest absolute value of a distributed matrix
481 */
482 double pdlange_(const char *norm,
483 const int *m,
484 const int *n,
485 const double *A,
486 const int *ia,
487 const int *ja,
488 const int *desca,
489 double *work);
490 float pslange_(const char *norm,
491 const int *m,
492 const int *n,
493 const float *A,
494 const int *ia,
495 const int *ja,
496 const int *desca,
497 float *work);
498
499 /**
500 * Compute the process coordinate which possesses the entry of a
501 * distributed matrix specified by a global index
502 */
503 int indxg2p_(const int *glob,
504 const int *nb,
505 const int *iproc,
506 const int *isproc,
507 const int *nprocs);
508
509 /**
510 * Compute all eigenvalues and, optionally, eigenvectors of a real symmetric
511 * matrix A by calling the recommended sequence of ScaLAPACK routines. In its
512 * present form, the routine assumes a homogeneous system and makes no checks
513 * for consistency of the eigenvalues or eigenvectors across the different
514 * processes. Because of this, it is possible that a heterogeneous system may
515 * return incorrect results without any error messages.
516 *
517 * http://www.netlib.org/scalapack/explore-html/d0/d1a/pdsyev_8f.html
518 * https://www.ibm.com/support/knowledgecenter/SSNR5K_4.2.0/com.ibm.cluster.pessl.v4r2.pssl100.doc/am6gr_lsyev.htm#lsyev
519 */
520 void pdsyev_(const char *jobz,
521 const char *uplo,
522 const int *m,
523 double *A,
524 const int *ia,
525 const int *ja,
526 int *desca,
527 double *w,
528 double *z,
529 const int *iz,
530 const int *jz,
531 int *descz,
532 double *work,
533 const int *lwork,
534 int *info);
535 void pssyev_(const char *jobz,
536 const char *uplo,
537 const int *m,
538 float *A,
539 const int *ia,
540 const int *ja,
541 int *desca,
542 float *w,
543 float *z,
544 const int *iz,
545 const int *jz,
546 int *descz,
547 float *work,
548 const int *lwork,
549 int *info);
550
551 /**
552 * Copy all or a part of a distributed matrix A to another distributed matrix
553 * B. No communication is performed, pdlacpy performs a local copy
554 * $\mathrm{sub}(A) \dealcoloneq \mathrm{sub}(B)$, where $\mathrm{sub}(A)$
555 * denotes $A(ia:ia+m-1, ja:ja+n-1)$ and $\mathrm{sub}(B)$ denotes
556 * $B(ib:ib+m-1, jb:jb+n-1)$.
557 */
558 void pdlacpy_(const char *uplo,
559 const int *m,
560 const int *n,
561 const double *A,
562 const int *ia,
563 const int *ja,
564 const int *desca,
565 double *B,
566 const int *ib,
567 const int *jb,
568 const int *descb);
569 void pslacpy_(const char *uplo,
570 const int *m,
571 const int *n,
572 const float *A,
573 const int *ia,
574 const int *ja,
575 const int *desca,
576 float *B,
577 const int *ib,
578 const int *jb,
579 const int *descb);
580
581 /**
582 * Copies the content of a general rectangular distributed matrix @p A to another distributed matrix @p B
583 * It is not required that the matrices A and B have the same process grid or
584 * block size, e.g. copying a matrix from a one-dimensional to a
585 * two-dimensional process grid
586 * @p ictxt is a context which is at least a union of all processes in context
587 * A and B
588 */
589 void pdgemr2d_(const int *m,
590 const int *n,
591 const double *A,
592 const int *ia,
593 const int *ja,
594 const int *desca,
595 double *B,
596 const int *ib,
597 const int *jb,
598 const int *descb,
599 const int *ictxt);
600 void psgemr2d_(const int *m,
601 const int *n,
602 const float *A,
603 const int *ia,
604 const int *ja,
605 const int *desca,
606 float *B,
607 const int *ib,
608 const int *jb,
609 const int *descb,
610 const int *ictxt);
611
612 /**
613 * helper routines determining machine precision
614 */
615 double pdlamch_(const int *ictxt, const char *cmach);
616 float pslamch_(const int *ictxt, const char *cmach);
617
618
619 /**
620 * psyevx computes selected eigenvalues and, optionally, eigenvectors
621 * of a real symmetric matrix A. Eigenvalues/vectors can be selected by
622 * specifying a range of values or a range of indices for the desired
623 * eigenvalues.
624 */
625 void pdsyevx_(const char *jobz,
626 const char *range,
627 const char *uplo,
628 const int *n,
629 double *A,
630 const int *ia,
631 const int *ja,
632 const int *desca,
633 const double *VL,
634 const double *VU,
635 const int *il,
636 const int *iu,
637 const double *abstol,
638 const int *m,
639 const int *nz,
640 double *w,
641 double *orfac,
642 double *Z,
643 const int *iz,
644 const int *jz,
645 const int *descz,
646 double *work,
647 int *lwork,
648 int *iwork,
649 int *liwork,
650 int *ifail,
651 int *iclustr,
652 double *gap,
653 int *info);
654 void pssyevx_(const char *jobz,
655 const char *range,
656 const char *uplo,
657 const int *n,
658 float *A,
659 const int *ia,
660 const int *ja,
661 const int *desca,
662 const float *VL,
663 const float *VU,
664 const int *il,
665 const int *iu,
666 const float *abstol,
667 const int *m,
668 const int *nz,
669 float *w,
670 float *orfac,
671 float *Z,
672 const int *iz,
673 const int *jz,
674 const int *descz,
675 float *work,
676 int *lwork,
677 int *iwork,
678 int *liwork,
679 int *ifail,
680 int *iclustr,
681 float *gap,
682 int *info);
683
684 /*
685 * PDGESVD computes the singular value decomposition (SVD) of an
686 * M-by-N matrix A, optionally computing the left and/or right
687 * singular vectors
688 */
689 void pdgesvd_(const char *jobu,
690 const char *jobvt,
691 const int *m,
692 const int *n,
693 double *A,
694 const int *ia,
695 const int *ja,
696 const int *desca,
697 double *S,
698 double *U,
699 const int *iu,
700 const int *ju,
701 const int *descu,
702 double *VT,
703 const int *ivt,
704 const int *jvt,
705 const int *descvt,
706 double *work,
707 int *lwork,
708 int *info);
709 void psgesvd_(const char *jobu,
710 const char *jobvt,
711 const int *m,
712 const int *n,
713 float *A,
714 const int *ia,
715 const int *ja,
716 const int *desca,
717 float *S,
718 float *U,
719 const int *iu,
720 const int *ju,
721 const int *descu,
722 float *VT,
723 const int *ivt,
724 const int *jvt,
725 const int *descvt,
726 float *work,
727 int *lwork,
728 int *info);
729
730 /*
731 * P_GELS solves overdetermined or underdetermined real linear
732 * systems involving an M-by-N matrix A, or its transpose,
733 * using a QR or LQ factorization of A. It is assumed that A has full rank.
734 */
735 void pdgels_(const char *trans,
736 const int *m,
737 const int *n,
738 const int *nrhs,
739 double *A,
740 const int *ia,
741 const int *ja,
742 const int *desca,
743 double *B,
744 const int *ib,
745 const int *jb,
746 const int *descb,
747 double *work,
748 int *lwork,
749 int *info);
750 void psgels_(const char *trans,
751 const int *m,
752 const int *n,
753 const int *nrhs,
754 float *A,
755 const int *ia,
756 const int *ja,
757 const int *desca,
758 float *B,
759 const int *ib,
760 const int *jb,
761 const int *descb,
762 float *work,
763 int *lwork,
764 int *info);
765
766 /*
767 * Perform matrix sum:
768 * @f{equation*}{
769 * C \dealcoloneq \beta C + \alpha op(A),
770 * @f
771 * where $op(A)$ denotes either $op(A) = A$ or $op(A)=A^T$.
772 */
773 void pdgeadd_(const char *transa,
774 const int *m,
775 const int *n,
776 const double *alpha,
777 const double *A,
778 const int *IA,
779 const int *JA,
780 const int *DESCA,
781 const double *beta,
782 double *C,
783 const int *IC,
784 const int *JC,
785 const int *DESCC);
786 void psgeadd_(const char *transa,
787 const int *m,
788 const int *n,
789 const float *alpha,
790 const float *A,
791 const int *IA,
792 const int *JA,
793 const int *DESCA,
794 const float *beta,
795 float *C,
796 const int *IC,
797 const int *JC,
798 const int *DESCC);
799
800 /**
801 * Routine to transpose a matrix:
802 * C = beta C + alpha A^T
803 */
804 void pdtran_(const int *m,
805 const int *n,
806 const double *alpha,
807 const double *A,
808 const int *IA,
809 const int *JA,
810 const int *DESCA,
811 const double *beta,
812 double *C,
813 const int *IC,
814 const int *JC,
815 const int *DESCC);
816 void pstran_(const int *m,
817 const int *n,
818 const float *alpha,
819 const float *A,
820 const int *IA,
821 const int *JA,
822 const int *DESCA,
823 const float *beta,
824 float *C,
825 const int *IC,
826 const int *JC,
827 const int *DESCC);
828
829 /**
830 * psyevr computes selected eigenvalues and, optionally, eigenvectors
831 * of a real symmetric matrix A using a parallel implementation of the MRR
832 * algorithm. Eigenvalues/vectors can be selected by specifying a range of
833 * values or a range of indices for the desired eigenvalues.
834 */
835 void pdsyevr_(const char *jobz,
836 const char *range,
837 const char *uplo,
838 const int *n,
839 double *A,
840 const int *IA,
841 const int *JA,
842 const int *DESCA,
843 const double *VL,
844 const double *VU,
845 const int *IL,
846 const int *IU,
847 int *m,
848 int *nz,
849 double *w,
850 double *Z,
851 const int *IZ,
852 const int *JZ,
853 const int *DESCZ,
854 double *work,
855 int *lwork,
856 int *iwork,
857 int *liwork,
858 int *info);
859 void pssyevr_(const char *jobz,
860 const char *range,
861 const char *uplo,
862 const int *n,
863 float *A,
864 const int *IA,
865 const int *JA,
866 const int *DESCA,
867 const float *VL,
868 const float *VU,
869 const int *IL,
870 const int *IU,
871 int *m,
872 int *nz,
873 float *w,
874 float *Z,
875 const int *IZ,
876 const int *JZ,
877 const int *DESCZ,
878 float *work,
879 int *lwork,
880 int *iwork,
881 int *liwork,
882 int *info);
883 }
884
885
886
887 /*
888 * In the following we have template wrappers for the ScaLAPACK routines
889 * wrappers for other numeric types can be added in the future
890 */
891 template <typename number>
892 inline void
893 Cgerv2d(int /*context*/,
894 int /*M*/,
895 int /*N*/,
896 number * /*A*/,
897 int /*lda*/,
898 int /*rsrc*/,
899 int /*csrc*/)
900 {
901 DEAL_II_NOT_IMPLEMENTED();
902 }
903
904 inline void
905 Cgerv2d(int context, int M, int N, double *A, int lda, int rsrc, int csrc)
906 {
907 Cdgerv2d(context, M, N, A, lda, rsrc, csrc);
908 }
909
910 inline void
911 Cgerv2d(int context, int M, int N, float *A, int lda, int rsrc, int csrc)
912 {
913 Csgerv2d(context, M, N, A, lda, rsrc, csrc);
914 }
915
916
917 template <typename number>
918 inline void
919 Cgesd2d(int /*context*/,
920 int /*M*/,
921 int /*N*/,
922 number * /*A*/,
923 int /*lda*/,
924 int /*rdest*/,
925 int /*cdest*/)
926 {
927 DEAL_II_NOT_IMPLEMENTED();
928 }
929
930 inline void
931 Cgesd2d(int context, int M, int N, double *A, int lda, int rdest, int cdest)
932 {
933 Cdgesd2d(context, M, N, A, lda, rdest, cdest);
934 }
935
936 inline void
937 Cgesd2d(int context, int M, int N, float *A, int lda, int rdest, int cdest)
938 {
939 Csgesd2d(context, M, N, A, lda, rdest, cdest);
940 }
941
942
943 template <typename number>
944 inline void
945 ppotrf(const char * /*UPLO*/,
946 const int * /*N*/,
947 number * /*A*/,
948 const int * /*IA*/,
949 const int * /*JA*/,
950 const int * /*DESCA*/,
951 int * /*INFO*/)
952 {
953 DEAL_II_NOT_IMPLEMENTED();
954 }
955
956 inline void
957 ppotrf(const char *UPLO,
958 const int *N,
959 double *A,
960 const int *IA,
961 const int *JA,
962 const int *DESCA,
963 int *INFO)
964 {
965 pdpotrf_(UPLO, N, A, IA, JA, DESCA, INFO);
966 }
967
968 inline void
969 ppotrf(const char *UPLO,
970 const int *N,
971 float *A,
972 const int *IA,
973 const int *JA,
974 const int *DESCA,
975 int *INFO)
976 {
977 pspotrf_(UPLO, N, A, IA, JA, DESCA, INFO);
978 }
979
980
981 template <typename number>
982 inline void
983 pgetrf(const int * /*m*/,
984 const int * /*n*/,
985 number * /*A*/,
986 const int * /*IA*/,
987 const int * /*JA*/,
988 const int * /*DESCA*/,
989 int * /*ipiv*/,
990 int * /*INFO*/)
991 {
992 DEAL_II_NOT_IMPLEMENTED();
993 }
994
995 inline void
996 pgetrf(const int *m,
997 const int *n,
998 double *A,
999 const int *IA,
1000 const int *JA,
1001 const int *DESCA,
1002 int *ipiv,
1003 int *INFO)
1004 {
1005 pdgetrf_(m, n, A, IA, JA, DESCA, ipiv, INFO);
1006 }
1007
1008 inline void
1009 pgetrf(const int *m,
1010 const int *n,
1011 float *A,
1012 const int *IA,
1013 const int *JA,
1014 const int *DESCA,
1015 int *ipiv,
1016 int *INFO)
1017 {
1018 psgetrf_(m, n, A, IA, JA, DESCA, ipiv, INFO);
1019 }
1020
1021
1022 template <typename number>
1023 inline void
1024 ppotri(const char * /*UPLO*/,
1025 const int * /*N*/,
1026 number * /*A*/,
1027 const int * /*IA*/,
1028 const int * /*JA*/,
1029 const int * /*DESCA*/,
1030 int * /*INFO*/)
1031 {
1032 DEAL_II_NOT_IMPLEMENTED();
1033 }
1034
1035 inline void
1036 ppotri(const char *UPLO,
1037 const int *N,
1038 double *A,
1039 const int *IA,
1040 const int *JA,
1041 const int *DESCA,
1042 int *INFO)
1043 {
1044 pdpotri_(UPLO, N, A, IA, JA, DESCA, INFO);
1045 }
1046
1047 inline void
1048 ppotri(const char *UPLO,
1049 const int *N,
1050 float *A,
1051 const int *IA,
1052 const int *JA,
1053 const int *DESCA,
1054 int *INFO)
1055 {
1056 pspotri_(UPLO, N, A, IA, JA, DESCA, INFO);
1057 }
1058
1059
1060 template <typename number>
1061 inline void
1062 pgetri(const int * /*N*/,
1063 number * /*A*/,
1064 const int * /*IA*/,
1065 const int * /*JA*/,
1066 const int * /*DESCA*/,
1067 const int * /*ipiv*/,
1068 number * /*work*/,
1069 int * /*lwork*/,
1070 int * /*iwork*/,
1071 int * /*liwork*/,
1072 int * /*info*/)
1073 {
1074 DEAL_II_NOT_IMPLEMENTED();
1075 }
1076
1077 inline void
1078 pgetri(const int *N,
1079 double *A,
1080 const int *IA,
1081 const int *JA,
1082 const int *DESCA,
1083 const int *ipiv,
1084 double *work,
1085 int *lwork,
1086 int *iwork,
1087 int *liwork,
1088 int *info)
1089 {
1090 pdgetri_(N, A, IA, JA, DESCA, ipiv, work, lwork, iwork, liwork, info);
1091 }
1092
1093 inline void
1094 pgetri(const int *N,
1095 float *A,
1096 const int *IA,
1097 const int *JA,
1098 const int *DESCA,
1099 const int *ipiv,
1100 float *work,
1101 int *lwork,
1102 int *iwork,
1103 int *liwork,
1104 int *info)
1105 {
1106 psgetri_(N, A, IA, JA, DESCA, ipiv, work, lwork, iwork, liwork, info);
1107 }
1108
1109 template <typename number>
1110 inline void
1111 ptrtri(const char * /*UPLO*/,
1112 const char * /*DIAG*/,
1113 const int * /*N*/,
1114 number * /*A*/,
1115 const int * /*IA*/,
1116 const int * /*JA*/,
1117 const int * /*DESCA*/,
1118 int * /*INFO*/)
1119 {
1120 DEAL_II_NOT_IMPLEMENTED();
1121 }
1122
1123 inline void
1124 ptrtri(const char *UPLO,
1125 const char *DIAG,
1126 const int *N,
1127 double *A,
1128 const int *IA,
1129 const int *JA,
1130 const int *DESCA,
1131 int *INFO)
1132 {
1133 pdtrtri_(UPLO, DIAG, N, A, IA, JA, DESCA, INFO);
1134 }
1135
1136 inline void
1137 ptrtri(const char *UPLO,
1138 const char *DIAG,
1139 const int *N,
1140 float *A,
1141 const int *IA,
1142 const int *JA,
1143 const int *DESCA,
1144 int *INFO)
1145 {
1146 pstrtri_(UPLO, DIAG, N, A, IA, JA, DESCA, INFO);
1147 }
1148
1149 template <typename number>
1150 inline void
1151 ppocon(const char * /*uplo*/,
1152 const int * /*N*/,
1153 const number * /*A*/,
1154 const int * /*IA*/,
1155 const int * /*JA*/,
1156 const int * /*DESCA*/,
1157 const number * /*ANORM*/,
1158 number * /*RCOND*/,
1159 number * /*WORK*/,
1160 const int * /*LWORK*/,
1161 int * /*IWORK*/,
1162 const int * /*LIWORK*/,
1163 int * /*INFO*/)
1164 {
1165 DEAL_II_NOT_IMPLEMENTED();
1166 }
1167
1168 inline void
1169 ppocon(const char *uplo,
1170 const int *N,
1171 const double *A,
1172 const int *IA,
1173 const int *JA,
1174 const int *DESCA,
1175 const double *ANORM,
1176 double *RCOND,
1177 double *WORK,
1178 const int *LWORK,
1179 int *IWORK,
1180 const int *LIWORK,
1181 int *INFO)
1182 {
1183 pdpocon_(
1184 uplo, N, A, IA, JA, DESCA, ANORM, RCOND, WORK, LWORK, IWORK, LIWORK, INFO);
1185 }
1186
1187 inline void
1188 ppocon(const char *uplo,
1189 const int *N,
1190 const float *A,
1191 const int *IA,
1192 const int *JA,
1193 const int *DESCA,
1194 const float *ANORM,
1195 float *RCOND,
1196 float *WORK,
1197 const int *LWORK,
1198 int *IWORK,
1199 const int *LIWORK,
1200 int *INFO)
1201 {
1202 pspocon_(
1203 uplo, N, A, IA, JA, DESCA, ANORM, RCOND, WORK, LWORK, IWORK, LIWORK, INFO);
1204 }
1205
1206
1207 template <typename number>
1208 inline number
1209 plansy(const char * /*norm*/,
1210 const char * /*uplo*/,
1211 const int * /*N*/,
1212 const number * /*A*/,
1213 const int * /*IA*/,
1214 const int * /*JA*/,
1215 const int * /*DESCA*/,
1216 number * /*work*/)
1217 {
1218 DEAL_II_NOT_IMPLEMENTED();
1219 }
1220
1221 inline double
1222 plansy(const char *norm,
1223 const char *uplo,
1224 const int *N,
1225 const double *A,
1226 const int *IA,
1227 const int *JA,
1228 const int *DESCA,
1229 double *work)
1230 {
1231 return pdlansy_(norm, uplo, N, A, IA, JA, DESCA, work);
1232 }
1233
1234 inline float
1235 plansy(const char *norm,
1236 const char *uplo,
1237 const int *N,
1238 const float *A,
1239 const int *IA,
1240 const int *JA,
1241 const int *DESCA,
1242 float *work)
1243 {
1244 return pslansy_(norm, uplo, N, A, IA, JA, DESCA, work);
1245 }
1246
1247
1248 template <typename number>
1249 inline void
1250 pgesv(const int * /*n*/,
1251 const int * /*nrhs*/,
1252 number * /*A*/,
1253 const int * /*ia*/,
1254 const int * /*ja*/,
1255 const int * /*desca*/,
1256 int * /*ipiv*/,
1257 number * /*B*/,
1258 const int * /*ib*/,
1259 const int * /*jb*/,
1260 const int * /*descb*/,
1261 int * /*info*/)
1262 {
1263 DEAL_II_NOT_IMPLEMENTED();
1264 }
1265
1266 inline void
1267 pgesv(const int *n,
1268 const int *nrhs,
1269 double *A,
1270 const int *ia,
1271 const int *ja,
1272 const int *desca,
1273 int *ipiv,
1274 double *B,
1275 const int *ib,
1276 const int *jb,
1277 const int *descb,
1278 int *info)
1279 {
1280 pdgesv_(n, nrhs, A, ia, ja, desca, ipiv, B, ib, jb, descb, info);
1281 }
1282
1283 inline void
1284 pgesv(const int *n,
1285 const int *nrhs,
1286 float *A,
1287 const int *ia,
1288 const int *ja,
1289 const int *desca,
1290 int *ipiv,
1291 float *B,
1292 const int *ib,
1293 const int *jb,
1294 const int *descb,
1295 int *info)
1296 {
1297 psgesv_(n, nrhs, A, ia, ja, desca, ipiv, B, ib, jb, descb, info);
1298 }
1299
1300
1301 template <typename number>
1302 inline void
1303 pgemm(const char * /*transa*/,
1304 const char * /*transb*/,
1305 const int * /*m*/,
1306 const int * /*n*/,
1307 const int * /*k*/,
1308 const number * /*alpha*/,
1309 number * /*A*/,
1310 const int * /*IA*/,
1311 const int * /*JA*/,
1312 const int * /*DESCA*/,
1313 number * /*B*/,
1314 const int * /*IB*/,
1315 const int * /*JB*/,
1316 const int * /*DESCB*/,
1317 const number * /*beta*/,
1318 number * /*C*/,
1319 const int * /*IC*/,
1320 const int * /*JC*/,
1321 const int * /*DESCC*/)
1322 {
1323 DEAL_II_NOT_IMPLEMENTED();
1324 }
1325
1326 inline void
1327 pgemm(const char *transa,
1328 const char *transb,
1329 const int *m,
1330 const int *n,
1331 const int *k,
1332 const double *alpha,
1333 const double *A,
1334 const int *IA,
1335 const int *JA,
1336 const int *DESCA,
1337 const double *B,
1338 const int *IB,
1339 const int *JB,
1340 const int *DESCB,
1341 const double *beta,
1342 double *C,
1343 const int *IC,
1344 const int *JC,
1345 const int *DESCC)
1346 {
1347 pdgemm_(transa,
1348 transb,
1349 m,
1350 n,
1351 k,
1352 alpha,
1353 A,
1354 IA,
1355 JA,
1356 DESCA,
1357 B,
1358 IB,
1359 JB,
1360 DESCB,
1361 beta,
1362 C,
1363 IC,
1364 JC,
1365 DESCC);
1366 }
1367
1368 inline void
1369 pgemm(const char *transa,
1370 const char *transb,
1371 const int *m,
1372 const int *n,
1373 const int *k,
1374 const float *alpha,
1375 const float *A,
1376 const int *IA,
1377 const int *JA,
1378 const int *DESCA,
1379 const float *B,
1380 const int *IB,
1381 const int *JB,
1382 const int *DESCB,
1383 const float *beta,
1384 float *C,
1385 const int *IC,
1386 const int *JC,
1387 const int *DESCC)
1388 {
1389 psgemm_(transa,
1390 transb,
1391 m,
1392 n,
1393 k,
1394 alpha,
1395 A,
1396 IA,
1397 JA,
1398 DESCA,
1399 B,
1400 IB,
1401 JB,
1402 DESCB,
1403 beta,
1404 C,
1405 IC,
1406 JC,
1407 DESCC);
1408 }
1409
1410
1411 template <typename number>
1412 inline number
1413 plange(const char * /*norm*/,
1414 const int * /*m*/,
1415 const int * /*n*/,
1416 const number * /*A*/,
1417 const int * /*ia*/,
1418 const int * /*ja*/,
1419 const int * /*desca*/,
1420 number * /*work*/)
1421 {
1422 DEAL_II_NOT_IMPLEMENTED();
1423 }
1424
1425 inline double
1426 plange(const char *norm,
1427 const int *m,
1428 const int *n,
1429 const double *A,
1430 const int *ia,
1431 const int *ja,
1432 const int *desca,
1433 double *work)
1434 {
1435 return pdlange_(norm, m, n, A, ia, ja, desca, work);
1436 }
1437
1438 inline float
1439 plange(const char *norm,
1440 const int *m,
1441 const int *n,
1442 const float *A,
1443 const int *ia,
1444 const int *ja,
1445 const int *desca,
1446 float *work)
1447 {
1448 return pslange_(norm, m, n, A, ia, ja, desca, work);
1449 }
1450
1451
1452 template <typename number>
1453 inline void
1454 psyev(const char * /*jobz*/,
1455 const char * /*uplo*/,
1456 const int * /*m*/,
1457 number * /*A*/,
1458 const int * /*ia*/,
1459 const int * /*ja*/,
1460 int * /*desca*/,
1461 number * /*w*/,
1462 number * /*z*/,
1463 const int * /*iz*/,
1464 const int * /*jz*/,
1465 int * /*descz*/,
1466 number * /*work*/,
1467 const int * /*lwork*/,
1468 int * /*info*/)
1469 {
1470 DEAL_II_NOT_IMPLEMENTED();
1471 }
1472
1473 inline void
1474 psyev(const char *jobz,
1475 const char *uplo,
1476 const int *m,
1477 double *A,
1478 const int *ia,
1479 const int *ja,
1480 int *desca,
1481 double *w,
1482 double *z,
1483 const int *iz,
1484 const int *jz,
1485 int *descz,
1486 double *work,
1487 const int *lwork,
1488 int *info)
1489 {
1490 pdsyev_(
1491 jobz, uplo, m, A, ia, ja, desca, w, z, iz, jz, descz, work, lwork, info);
1492 }
1493
1494 inline void
1495 psyev(const char *jobz,
1496 const char *uplo,
1497 const int *m,
1498 float *A,
1499 const int *ia,
1500 const int *ja,
1501 int *desca,
1502 float *w,
1503 float *z,
1504 const int *iz,
1505 const int *jz,
1506 int *descz,
1507 float *work,
1508 const int *lwork,
1509 int *info)
1510 {
1511 pssyev_(
1512 jobz, uplo, m, A, ia, ja, desca, w, z, iz, jz, descz, work, lwork, info);
1513 }
1514
1515
1516 template <typename number>
1517 inline void
1518 placpy(const char * /*uplo*/,
1519 const int * /*m*/,
1520 const int * /*n*/,
1521 const number * /*A*/,
1522 const int * /*ia*/,
1523 const int * /*ja*/,
1524 const int * /*desca*/,
1525 number * /*B*/,
1526 const int * /*ib*/,
1527 const int * /*jb*/,
1528 const int * /*descb*/)
1529 {
1530 DEAL_II_NOT_IMPLEMENTED();
1531 }
1532
1533 inline void
1534 placpy(const char *uplo,
1535 const int *m,
1536 const int *n,
1537 const double *A,
1538 const int *ia,
1539 const int *ja,
1540 const int *desca,
1541 double *B,
1542 const int *ib,
1543 const int *jb,
1544 const int *descb)
1545 {
1546 pdlacpy_(uplo, m, n, A, ia, ja, desca, B, ib, jb, descb);
1547 }
1548
1549 inline void
1550 placpy(const char *uplo,
1551 const int *m,
1552 const int *n,
1553 const float *A,
1554 const int *ia,
1555 const int *ja,
1556 const int *desca,
1557 float *B,
1558 const int *ib,
1559 const int *jb,
1560 const int *descb)
1561 {
1562 pslacpy_(uplo, m, n, A, ia, ja, desca, B, ib, jb, descb);
1563 }
1564
1565
1566 template <typename number>
1567 inline void
1568 pgemr2d(const int * /*m*/,
1569 const int * /*n*/,
1570 const number * /*A*/,
1571 const int * /*ia*/,
1572 const int * /*ja*/,
1573 const int * /*desca*/,
1574 number * /*B*/,
1575 const int * /*ib*/,
1576 const int * /*jb*/,
1577 const int * /*descb*/,
1578 const int * /*ictxt*/)
1579 {
1580 DEAL_II_NOT_IMPLEMENTED();
1581 }
1582
1583 inline void
1584 pgemr2d(const int *m,
1585 const int *n,
1586 const double *A,
1587 const int *ia,
1588 const int *ja,
1589 const int *desca,
1590 double *B,
1591 const int *ib,
1592 const int *jb,
1593 const int *descb,
1594 const int *ictxt)
1595 {
1596 pdgemr2d_(m, n, A, ia, ja, desca, B, ib, jb, descb, ictxt);
1597 }
1598
1599 inline void
1600 pgemr2d(const int *m,
1601 const int *n,
1602 const float *A,
1603 const int *ia,
1604 const int *ja,
1605 const int *desca,
1606 float *B,
1607 const int *ib,
1608 const int *jb,
1609 const int *descb,
1610 const int *ictxt)
1611 {
1612 psgemr2d_(m, n, A, ia, ja, desca, B, ib, jb, descb, ictxt);
1613 }
1614
1615
1616 template <typename number>
1617 inline void
1618 plamch(const int * /*ictxt*/, const char * /*cmach*/, number & /*val*/)
1619 {
1620 DEAL_II_NOT_IMPLEMENTED();
1621 }
1622
1623 inline void
1624 plamch(const int *ictxt, const char *cmach, double &val)
1625 {
1626 val = pdlamch_(ictxt, cmach);
1627 }
1628
1629 inline void
1630 plamch(const int *ictxt, const char *cmach, float &val)
1631 {
1632 val = pslamch_(ictxt, cmach);
1633 }
1634
1635
1636 template <typename number>
1637 inline void
1638 psyevx(const char * /*jobz*/,
1639 const char * /*range*/,
1640 const char * /*uplo*/,
1641 const int * /*n*/,
1642 number * /*A*/,
1643 const int * /*ia*/,
1644 const int * /*ja*/,
1645 const int * /*desca*/,
1646 number * /*VL*/,
1647 number * /*VU*/,
1648 const int * /*il*/,
1649 const int * /*iu*/,
1650 number * /*abstol*/,
1651 const int * /*m*/,
1652 const int * /*nz*/,
1653 number * /*w*/,
1654 number * /*orfac*/,
1655 number * /*Z*/,
1656 const int * /*iz*/,
1657 const int * /*jz*/,
1658 const int * /*descz*/,
1659 number * /*work*/,
1660 int * /*lwork*/,
1661 int * /*iwork*/,
1662 int * /*liwork*/,
1663 int * /*ifail*/,
1664 int * /*iclustr*/,
1665 number * /*gap*/,
1666 int * /*info*/)
1667 {
1668 DEAL_II_NOT_IMPLEMENTED();
1669 }
1670
1671 inline void
1672 psyevx(const char *jobz,
1673 const char *range,
1674 const char *uplo,
1675 const int *n,
1676 double *A,
1677 const int *ia,
1678 const int *ja,
1679 const int *desca,
1680 double *VL,
1681 double *VU,
1682 const int *il,
1683 const int *iu,
1684 double *abstol,
1685 const int *m,
1686 const int *nz,
1687 double *w,
1688 double *orfac,
1689 double *Z,
1690 const int *iz,
1691 const int *jz,
1692 const int *descz,
1693 double *work,
1694 int *lwork,
1695 int *iwork,
1696 int *liwork,
1697 int *ifail,
1698 int *iclustr,
1699 double *gap,
1700 int *info)
1701 {
1702 pdsyevx_(jobz,
1703 range,
1704 uplo,
1705 n,
1706 A,
1707 ia,
1708 ja,
1709 desca,
1710 VL,
1711 VU,
1712 il,
1713 iu,
1714 abstol,
1715 m,
1716 nz,
1717 w,
1718 orfac,
1719 Z,
1720 iz,
1721 jz,
1722 descz,
1723 work,
1724 lwork,
1725 iwork,
1726 liwork,
1727 ifail,
1728 iclustr,
1729 gap,
1730 info);
1731 }
1732
1733 inline void
1734 psyevx(const char *jobz,
1735 const char *range,
1736 const char *uplo,
1737 const int *n,
1738 float *A,
1739 const int *ia,
1740 const int *ja,
1741 const int *desca,
1742 float *VL,
1743 float *VU,
1744 const int *il,
1745 const int *iu,
1746 float *abstol,
1747 const int *m,
1748 const int *nz,
1749 float *w,
1750 float *orfac,
1751 float *Z,
1752 const int *iz,
1753 const int *jz,
1754 const int *descz,
1755 float *work,
1756 int *lwork,
1757 int *iwork,
1758 int *liwork,
1759 int *ifail,
1760 int *iclustr,
1761 float *gap,
1762 int *info)
1763 {
1764 pssyevx_(jobz,
1765 range,
1766 uplo,
1767 n,
1768 A,
1769 ia,
1770 ja,
1771 desca,
1772 VL,
1773 VU,
1774 il,
1775 iu,
1776 abstol,
1777 m,
1778 nz,
1779 w,
1780 orfac,
1781 Z,
1782 iz,
1783 jz,
1784 descz,
1785 work,
1786 lwork,
1787 iwork,
1788 liwork,
1789 ifail,
1790 iclustr,
1791 gap,
1792 info);
1793 }
1794
1795
1796 template <typename number>
1797 inline void
1798 pgesvd(const char * /*jobu*/,
1799 const char * /*jobvt*/,
1800 const int * /*m*/,
1801 const int * /*n*/,
1802 number * /*A*/,
1803 const int * /*ia*/,
1804 const int * /*ja*/,
1805 const int * /*desca*/,
1806 number * /*S*/,
1807 number * /*U*/,
1808 const int * /*iu*/,
1809 const int * /*ju*/,
1810 const int * /*descu*/,
1811 number * /*VT*/,
1812 const int * /*ivt*/,
1813 const int * /*jvt*/,
1814 const int * /*descvt*/,
1815 number * /*work*/,
1816 int * /*lwork*/,
1817 int * /*info*/)
1818 {
1819 DEAL_II_NOT_IMPLEMENTED();
1820 }
1821
1822 inline void
1823 pgesvd(const char *jobu,
1824 const char *jobvt,
1825 const int *m,
1826 const int *n,
1827 double *A,
1828 const int *ia,
1829 const int *ja,
1830 const int *desca,
1831 double *S,
1832 double *U,
1833 const int *iu,
1834 const int *ju,
1835 const int *descu,
1836 double *VT,
1837 const int *ivt,
1838 const int *jvt,
1839 const int *descvt,
1840 double *work,
1841 int *lwork,
1842 int *info)
1843 {
1844 pdgesvd_(jobu,
1845 jobvt,
1846 m,
1847 n,
1848 A,
1849 ia,
1850 ja,
1851 desca,
1852 S,
1853 U,
1854 iu,
1855 ju,
1856 descu,
1857 VT,
1858 ivt,
1859 jvt,
1860 descvt,
1861 work,
1862 lwork,
1863 info);
1864 }
1865
1866 inline void
1867 pgesvd(const char *jobu,
1868 const char *jobvt,
1869 const int *m,
1870 const int *n,
1871 float *A,
1872 const int *ia,
1873 const int *ja,
1874 const int *desca,
1875 float *S,
1876 float *U,
1877 const int *iu,
1878 const int *ju,
1879 const int *descu,
1880 float *VT,
1881 const int *ivt,
1882 const int *jvt,
1883 const int *descvt,
1884 float *work,
1885 int *lwork,
1886 int *info)
1887 {
1888 psgesvd_(jobu,
1889 jobvt,
1890 m,
1891 n,
1892 A,
1893 ia,
1894 ja,
1895 desca,
1896 S,
1897 U,
1898 iu,
1899 ju,
1900 descu,
1901 VT,
1902 ivt,
1903 jvt,
1904 descvt,
1905 work,
1906 lwork,
1907 info);
1908 }
1909
1910
1911 template <typename number>
1912 inline void
1913 pgels(const char * /*trans*/,
1914 const int * /*m*/,
1915 const int * /*n*/,
1916 const int * /*nrhs*/,
1917 number * /*A*/,
1918 const int * /*ia*/,
1919 const int * /*ja*/,
1920 const int * /*desca*/,
1921 number * /*B*/,
1922 const int * /*ib*/,
1923 const int * /*jb*/,
1924 const int * /*descb*/,
1925 number * /*work*/,
1926 int * /*lwork*/,
1927 int * /*info*/)
1928 {
1929 DEAL_II_NOT_IMPLEMENTED();
1930 }
1931
1932 inline void
1933 pgels(const char *trans,
1934 const int *m,
1935 const int *n,
1936 const int *nrhs,
1937 double *A,
1938 const int *ia,
1939 const int *ja,
1940 const int *desca,
1941 double *B,
1942 const int *ib,
1943 const int *jb,
1944 const int *descb,
1945 double *work,
1946 int *lwork,
1947 int *info)
1948 {
1949 pdgels_(
1950 trans, m, n, nrhs, A, ia, ja, desca, B, ib, jb, descb, work, lwork, info);
1951 }
1952
1953 inline void
1954 pgels(const char *trans,
1955 const int *m,
1956 const int *n,
1957 const int *nrhs,
1958 float *A,
1959 const int *ia,
1960 const int *ja,
1961 const int *desca,
1962 float *B,
1963 const int *ib,
1964 const int *jb,
1965 const int *descb,
1966 float *work,
1967 int *lwork,
1968 int *info)
1969 {
1970 psgels_(
1971 trans, m, n, nrhs, A, ia, ja, desca, B, ib, jb, descb, work, lwork, info);
1972 }
1973
1974
1975 template <typename number>
1976 inline void
1977 pgeadd(const char * /*transa*/,
1978 const int * /*m*/,
1979 const int * /*n*/,
1980 const number * /*alpha*/,
1981 const number * /*A*/,
1982 const int * /*IA*/,
1983 const int * /*JA*/,
1984 const int * /*DESCA*/,
1985 const number * /*beta*/,
1986 number * /*C*/,
1987 const int * /*IC*/,
1988 const int * /*JC*/,
1989 const int * /*DESCC*/)
1990 {
1991 DEAL_II_NOT_IMPLEMENTED();
1992 }
1993
1994 inline void
1995 pgeadd(const char *transa,
1996 const int *m,
1997 const int *n,
1998 const double *alpha,
1999 const double *A,
2000 const int *IA,
2001 const int *JA,
2002 const int *DESCA,
2003 const double *beta,
2004 double *C,
2005 const int *IC,
2006 const int *JC,
2007 const int *DESCC)
2008 {
2009 pdgeadd_(transa, m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2010 }
2011
2012 inline void
2013 pgeadd(const char *transa,
2014 const int *m,
2015 const int *n,
2016 const float *alpha,
2017 const float *A,
2018 const int *IA,
2019 const int *JA,
2020 const int *DESCA,
2021 const float *beta,
2022 float *C,
2023 const int *IC,
2024 const int *JC,
2025 const int *DESCC)
2026 {
2027 psgeadd_(transa, m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2028 }
2029
2030
2031 template <typename number>
2032 inline void
2033 ptran(const int * /*m*/,
2034 const int * /*n*/,
2035 const number * /*alpha*/,
2036 const number * /*A*/,
2037 const int * /*IA*/,
2038 const int * /*JA*/,
2039 const int * /*DESCA*/,
2040 const number * /*beta*/,
2041 number * /*C*/,
2042 const int * /*IC*/,
2043 const int * /*JC*/,
2044 const int * /*DESCC*/)
2045 {
2046 DEAL_II_NOT_IMPLEMENTED();
2047 }
2048
2049 inline void
2050 ptran(const int *m,
2051 const int *n,
2052 const double *alpha,
2053 const double *A,
2054 const int *IA,
2055 const int *JA,
2056 const int *DESCA,
2057 const double *beta,
2058 double *C,
2059 const int *IC,
2060 const int *JC,
2061 const int *DESCC)
2062 {
2063 pdtran_(m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2064 }
2065
2066 inline void
2067 ptran(const int *m,
2068 const int *n,
2069 const float *alpha,
2070 const float *A,
2071 const int *IA,
2072 const int *JA,
2073 const int *DESCA,
2074 const float *beta,
2075 float *C,
2076 const int *IC,
2077 const int *JC,
2078 const int *DESCC)
2079 {
2080 pstran_(m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2081 }
2082
2083
2084 template <typename number>
2085 inline void
2086 psyevr(const char * /*jobz*/,
2087 const char * /*range*/,
2088 const char * /*uplo*/,
2089 const int * /*n*/,
2090 number * /*A*/,
2091 const int * /*IA*/,
2092 const int * /*JA*/,
2093 const int * /*DESCA*/,
2094 const number * /*VL*/,
2095 const number * /*VU*/,
2096 const int * /*IL*/,
2097 const int * /*IU*/,
2098 int * /*m*/,
2099 int * /*nz*/,
2100 number * /*w*/,
2101 number * /*Z*/,
2102 const int * /*IZ*/,
2103 const int * /*JZ*/,
2104 const int * /*DESCZ*/,
2105 number * /*work*/,
2106 int * /*lwork*/,
2107 int * /*iwork*/,
2108 int * /*liwork*/,
2109 int * /*info*/)
2110 {
2111 DEAL_II_NOT_IMPLEMENTED();
2112 }
2113
2114 inline void
2115 psyevr(const char *jobz,
2116 const char *range,
2117 const char *uplo,
2118 const int *n,
2119 double *A,
2120 const int *IA,
2121 const int *JA,
2122 const int *DESCA,
2123 const double *VL,
2124 const double *VU,
2125 const int *IL,
2126 const int *IU,
2127 int *m,
2128 int *nz,
2129 double *w,
2130 double *Z,
2131 const int *IZ,
2132 const int *JZ,
2133 const int *DESCZ,
2134 double *work,
2135 int *lwork,
2136 int *iwork,
2137 int *liwork,
2138 int *info)
2139 {
2140 /*
2141 * Netlib ScaLAPACK performs floating point tests (e.g. divide-by-zero) within
2142 * the call to pdsyevr causing floating point exceptions to be thrown (at
2143 * least in debug mode). Therefore, we wrap the calls to pdsyevr into the
2144 * following code to suppress the exception.
2145 */
2146 # ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2147 fenv_t fp_exceptions;
2148 feholdexcept(&fp_exceptions);
2149 # endif
2150
2151 pdsyevr_(jobz,
2152 range,
2153 uplo,
2154 n,
2155 A,
2156 IA,
2157 JA,
2158 DESCA,
2159 VL,
2160 VU,
2161 IL,
2162 IU,
2163 m,
2164 nz,
2165 w,
2166 Z,
2167 IZ,
2168 JZ,
2169 DESCZ,
2170 work,
2171 lwork,
2172 iwork,
2173 liwork,
2174 info);
2175
2176 # ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2177 fesetenv(&fp_exceptions);
2178 # endif
2179 }
2180
2181 inline void
2182 psyevr(const char *jobz,
2183 const char *range,
2184 const char *uplo,
2185 const int *n,
2186 float *A,
2187 const int *IA,
2188 const int *JA,
2189 const int *DESCA,
2190 const float *VL,
2191 const float *VU,
2192 const int *IL,
2193 const int *IU,
2194 int *m,
2195 int *nz,
2196 float *w,
2197 float *Z,
2198 const int *IZ,
2199 const int *JZ,
2200 const int *DESCZ,
2201 float *work,
2202 int *lwork,
2203 int *iwork,
2204 int *liwork,
2205 int *info)
2206 {
2207 /*
2208 * Netlib ScaLAPACK performs floating point tests (e.g. divide-by-zero) within
2209 * the call to pssyevr causing floating point exceptions to be thrown (at
2210 * least in debug mode). Therefore, we wrap the calls to pssyevr into the
2211 * following code to suppress the exception.
2212 */
2213 # ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2214 fenv_t fp_exceptions;
2215 feholdexcept(&fp_exceptions);
2216 # endif
2217
2218 pssyevr_(jobz,
2219 range,
2220 uplo,
2221 n,
2222 A,
2223 IA,
2224 JA,
2225 DESCA,
2226 VL,
2227 VU,
2228 IL,
2229 IU,
2230 m,
2231 nz,
2232 w,
2233 Z,
2234 IZ,
2235 JZ,
2236 DESCZ,
2237 work,
2238 lwork,
2239 iwork,
2240 liwork,
2241 info);
2242
2243 # ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2244 fesetenv(&fp_exceptions);
2245 # endif
2246 }
2247
2248 #endif // DEAL_II_WITH_SCALAPACK
2249
2250 // This file does not actually import anything into namespace dealii,
2251 // but to avoid it being completely empty to some of our scripts, we
2252 // need to make sure it opens and closes the namespace at least once.
2253 DEAL_II_NAMESPACE_OPEN // Do not convert for module purposes
2254 DEAL_II_NAMESPACE_CLOSE
2255
2256
2257 #endif // dealii_scalapack_templates_h