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