DFT-FE 1.3.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 double *rwork,
1103 int *lrwork,
1104 int *iwork,
1105 int *liwork,
1106 int *info);
1107 }
1108
1109
1110
1111 /*
1112 * In the following we have template wrappers for the ScaLAPACK routines
1113 * wrappers for other numeric types can be added in the future
1114 */
1115 template <typename number>
1116 inline void
1117 Cgerv2d(int /*context*/,
1118 int /*M*/,
1119 int /*N*/,
1120 number * /*A*/,
1121 int /*lda*/,
1122 int /*rsrc*/,
1123 int /*csrc*/)
1124 {
1125 AssertThrow(false, dealii::ExcNotImplemented());
1126 }
1127
1128 inline void
1129 Cgerv2d(int context, int M, int N, double *A, int lda, int rsrc, int csrc)
1130 {
1131 Cdgerv2d(context, M, N, A, lda, rsrc, csrc);
1132 }
1133
1134 inline void
1135 Cgerv2d(int context, int M, int N, float *A, int lda, int rsrc, int csrc)
1136 {
1137 Csgerv2d(context, M, N, A, lda, rsrc, csrc);
1138 }
1139
1140
1141 template <typename number>
1142 inline void
1143 Cgesd2d(int /*context*/,
1144 int /*M*/,
1145 int /*N*/,
1146 number * /*A*/,
1147 int /*lda*/,
1148 int /*rdest*/,
1149 int /*cdest*/)
1150 {
1151 AssertThrow(false, dealii::ExcNotImplemented());
1152 }
1153
1154 inline void
1155 Cgesd2d(int context, int M, int N, double *A, int lda, int rdest, int cdest)
1156 {
1157 Cdgesd2d(context, M, N, A, lda, rdest, cdest);
1158 }
1159
1160 inline void
1161 Cgesd2d(int context, int M, int N, float *A, int lda, int rdest, int cdest)
1162 {
1163 Csgesd2d(context, M, N, A, lda, rdest, cdest);
1164 }
1165
1166 inline void
1167 pplacgv(const int *N,
1168 double *A,
1169 const int *IA,
1170 const int *JA,
1171 const int *DESCA,
1172 const int *INCX)
1173 {}
1174
1175 inline void
1176 pplacgv(const int *N,
1177 std::complex<double> *A,
1178 const int *IA,
1179 const int *JA,
1180 const int *DESCA,
1181 const int *INCX)
1182 {
1183 pzlacgv_(N, A, IA, JA, DESCA, INCX);
1184 }
1185
1186 template <typename number>
1187 inline void
1188 ppotrf(const char * /*UPLO*/,
1189 const int * /*N*/,
1190 number * /*A*/,
1191 const int * /*IA*/,
1192 const int * /*JA*/,
1193 const int * /*DESCA*/,
1194 int * /*INFO*/)
1195 {
1196 AssertThrow(false, dealii::ExcNotImplemented());
1197 }
1198
1199 inline void
1200 ppotrf(const char *UPLO,
1201 const int *N,
1202 double *A,
1203 const int *IA,
1204 const int *JA,
1205 const int *DESCA,
1206 int *INFO)
1207 {
1208 pdpotrf_(UPLO, N, A, IA, JA, DESCA, INFO);
1209 }
1210
1211 inline void
1212 ppotrf(const char *UPLO,
1213 const int *N,
1214 float *A,
1215 const int *IA,
1216 const int *JA,
1217 const int *DESCA,
1218 int *INFO)
1219 {
1220 pspotrf_(UPLO, N, A, IA, JA, DESCA, INFO);
1221 }
1222
1223 inline void
1224 ppotrf(const char *UPLO,
1225 const int *N,
1226 std::complex<double> *A,
1227 const int *IA,
1228 const int *JA,
1229 const int *DESCA,
1230 int *INFO)
1231 {
1232 pzpotrf_(UPLO, N, A, IA, JA, DESCA, INFO);
1233 }
1234
1235 template <typename number>
1236 inline void
1237 pgetrf(const int * /*m*/,
1238 const int * /*n*/,
1239 number * /*A*/,
1240 const int * /*IA*/,
1241 const int * /*JA*/,
1242 const int * /*DESCA*/,
1243 int * /*ipiv*/,
1244 int * /*INFO*/)
1245 {
1246 AssertThrow(false, dealii::ExcNotImplemented());
1247 }
1248
1249 inline void
1250 pgetrf(const int *m,
1251 const int *n,
1252 double *A,
1253 const int *IA,
1254 const int *JA,
1255 const int *DESCA,
1256 int *ipiv,
1257 int *INFO)
1258 {
1259 pdgetrf_(m, n, A, IA, JA, DESCA, ipiv, INFO);
1260 }
1261
1262 inline void
1263 pgetrf(const int *m,
1264 const int *n,
1265 float *A,
1266 const int *IA,
1267 const int *JA,
1268 const int *DESCA,
1269 int *ipiv,
1270 int *INFO)
1271 {
1272 psgetrf_(m, n, A, IA, JA, DESCA, ipiv, INFO);
1273 }
1274
1275 inline void
1276 pgetrf(const int *m,
1277 const int *n,
1278 std::complex<double> *A,
1279 const int *IA,
1280 const int *JA,
1281 const int *DESCA,
1282 int *ipiv,
1283 int *INFO)
1284 {
1285 pzgetrf_(m, n, A, IA, JA, DESCA, ipiv, INFO);
1286 }
1287
1288 template <typename number>
1289 inline void
1290 ppotri(const char * /*UPLO*/,
1291 const int * /*N*/,
1292 number * /*A*/,
1293 const int * /*IA*/,
1294 const int * /*JA*/,
1295 const int * /*DESCA*/,
1296 int * /*INFO*/)
1297 {
1298 AssertThrow(false, dealii::ExcNotImplemented());
1299 }
1300
1301 inline void
1302 ppotri(const char *UPLO,
1303 const int *N,
1304 double *A,
1305 const int *IA,
1306 const int *JA,
1307 const int *DESCA,
1308 int *INFO)
1309 {
1310 pdpotri_(UPLO, N, A, IA, JA, DESCA, INFO);
1311 }
1312
1313 inline void
1314 ppotri(const char *UPLO,
1315 const int *N,
1316 float *A,
1317 const int *IA,
1318 const int *JA,
1319 const int *DESCA,
1320 int *INFO)
1321 {
1322 pspotri_(UPLO, N, A, IA, JA, DESCA, INFO);
1323 }
1324
1325 inline void
1326 ppotri(const char *UPLO,
1327 const int *N,
1328 std::complex<double> *A,
1329 const int *IA,
1330 const int *JA,
1331 const int *DESCA,
1332 int *INFO)
1333 {
1334 pzpotri_(UPLO, N, A, IA, JA, DESCA, INFO);
1335 }
1336
1337 template <typename number>
1338 inline void
1339 pgetri(const int * /*N*/,
1340 number * /*A*/,
1341 const int * /*IA*/,
1342 const int * /*JA*/,
1343 const int * /*DESCA*/,
1344 const int * /*ipiv*/,
1345 number * /*work*/,
1346 int * /*lwork*/,
1347 int * /*iwork*/,
1348 int * /*liwork*/,
1349 int * /*info*/)
1350 {
1351 AssertThrow(false, dealii::ExcNotImplemented());
1352 }
1353
1354 inline void
1355 pgetri(const int *N,
1356 double *A,
1357 const int *IA,
1358 const int *JA,
1359 const int *DESCA,
1360 const int *ipiv,
1361 double *work,
1362 int *lwork,
1363 int *iwork,
1364 int *liwork,
1365 int *info)
1366 {
1367 pdgetri_(N, A, IA, JA, DESCA, ipiv, work, lwork, iwork, liwork, info);
1368 }
1369
1370 inline void
1371 pgetri(const int *N,
1372 float *A,
1373 const int *IA,
1374 const int *JA,
1375 const int *DESCA,
1376 const int *ipiv,
1377 float *work,
1378 int *lwork,
1379 int *iwork,
1380 int *liwork,
1381 int *info)
1382 {
1383 psgetri_(N, A, IA, JA, DESCA, ipiv, work, lwork, iwork, liwork, info);
1384 }
1385
1386 inline void
1387 pgetri(const int *N,
1388 std::complex<double> *A,
1389 const int *IA,
1390 const int *JA,
1391 const int *DESCA,
1392 const int *ipiv,
1393 std::complex<double> *work,
1394 int *lwork,
1395 int *iwork,
1396 int *liwork,
1397 int *info)
1398 {
1399 pzgetri_(N, A, IA, JA, DESCA, ipiv, work, lwork, iwork, liwork, info);
1400 }
1401
1402
1403
1404 template <typename number>
1405 inline void
1406 ptrtri(const char * /*UPLO*/,
1407 const char * /*DIAG*/,
1408 const int * /*N*/,
1409 number * /*A*/,
1410 const int * /*IA*/,
1411 const int * /*JA*/,
1412 const int * /*DESCA*/,
1413 int * /*INFO*/)
1414 {
1415 AssertThrow(false, dealii::ExcNotImplemented());
1416 }
1417
1418 inline void
1419 ptrtri(const char *UPLO,
1420 const char *DIAG,
1421 const int *N,
1422 double *A,
1423 const int *IA,
1424 const int *JA,
1425 const int *DESCA,
1426 int *INFO)
1427 {
1428 pdtrtri_(UPLO, DIAG, N, A, IA, JA, DESCA, INFO);
1429 }
1430
1431 inline void
1432 ptrtri(const char *UPLO,
1433 const char *DIAG,
1434 const int *N,
1435 float *A,
1436 const int *IA,
1437 const int *JA,
1438 const int *DESCA,
1439 int *INFO)
1440 {
1441 pstrtri_(UPLO, DIAG, N, A, IA, JA, DESCA, INFO);
1442 }
1443
1444 inline void
1445 ptrtri(const char *UPLO,
1446 const char *DIAG,
1447 const int *N,
1448 std::complex<double> *A,
1449 const int *IA,
1450 const int *JA,
1451 const int *DESCA,
1452 int *INFO)
1453 {
1454 pztrtri_(UPLO, DIAG, N, A, IA, JA, DESCA, INFO);
1455 }
1456
1457 template <typename number>
1458 inline void
1459 ppocon(const char * /*uplo*/,
1460 const int * /*N*/,
1461 const number * /*A*/,
1462 const int * /*IA*/,
1463 const int * /*JA*/,
1464 const int * /*DESCA*/,
1465 const number * /*ANORM*/,
1466 number * /*RCOND*/,
1467 number * /*WORK*/,
1468 const int * /*LWORK*/,
1469 int * /*IWORK*/,
1470 const int * /*LIWORK*/,
1471 int * /*INFO*/)
1472 {
1473 AssertThrow(false, dealii::ExcNotImplemented());
1474 }
1475
1476 inline void
1477 ppocon(const char *uplo,
1478 const int *N,
1479 const double *A,
1480 const int *IA,
1481 const int *JA,
1482 const int *DESCA,
1483 const double *ANORM,
1484 double *RCOND,
1485 double *WORK,
1486 const int *LWORK,
1487 int *IWORK,
1488 const int *LIWORK,
1489 int *INFO)
1490 {
1491 pdpocon_(uplo,
1492 N,
1493 A,
1494 IA,
1495 JA,
1496 DESCA,
1497 ANORM,
1498 RCOND,
1499 WORK,
1500 LWORK,
1501 IWORK,
1502 LIWORK,
1503 INFO);
1504 }
1505
1506 inline void
1507 ppocon(const char *uplo,
1508 const int *N,
1509 const float *A,
1510 const int *IA,
1511 const int *JA,
1512 const int *DESCA,
1513 const float *ANORM,
1514 float *RCOND,
1515 float *WORK,
1516 const int *LWORK,
1517 int *IWORK,
1518 const int *LIWORK,
1519 int *INFO)
1520 {
1521 pspocon_(uplo,
1522 N,
1523 A,
1524 IA,
1525 JA,
1526 DESCA,
1527 ANORM,
1528 RCOND,
1529 WORK,
1530 LWORK,
1531 IWORK,
1532 LIWORK,
1533 INFO);
1534 }
1535
1536
1537 template <typename number>
1538 inline number
1539 plansy(const char * /*norm*/,
1540 const char * /*uplo*/,
1541 const int * /*N*/,
1542 const number * /*A*/,
1543 const int * /*IA*/,
1544 const int * /*JA*/,
1545 const int * /*DESCA*/,
1546 number * /*work*/)
1547 {
1548 AssertThrow(false, dealii::ExcNotImplemented());
1549 }
1550
1551 inline double
1552 plansy(const char *norm,
1553 const char *uplo,
1554 const int *N,
1555 const double *A,
1556 const int *IA,
1557 const int *JA,
1558 const int *DESCA,
1559 double *work)
1560 {
1561 return pdlansy_(norm, uplo, N, A, IA, JA, DESCA, work);
1562 }
1563
1564 inline float
1565 plansy(const char *norm,
1566 const char *uplo,
1567 const int *N,
1568 const float *A,
1569 const int *IA,
1570 const int *JA,
1571 const int *DESCA,
1572 float *work)
1573 {
1574 return pslansy_(norm, uplo, N, A, IA, JA, DESCA, work);
1575 }
1576
1577
1578 template <typename number>
1579 inline void
1580 pgesv(const int * /*n*/,
1581 const int * /*nrhs*/,
1582 number * /*A*/,
1583 const int * /*ia*/,
1584 const int * /*ja*/,
1585 const int * /*desca*/,
1586 int * /*ipiv*/,
1587 number * /*B*/,
1588 const int * /*ib*/,
1589 const int * /*jb*/,
1590 const int * /*descb*/,
1591 int * /*info*/)
1592 {
1593 AssertThrow(false, dealii::ExcNotImplemented());
1594 }
1595
1596 inline void
1597 pgesv(const int *n,
1598 const int *nrhs,
1599 double *A,
1600 const int *ia,
1601 const int *ja,
1602 const int *desca,
1603 int *ipiv,
1604 double *B,
1605 const int *ib,
1606 const int *jb,
1607 const int *descb,
1608 int *info)
1609 {
1610 pdgesv_(n, nrhs, A, ia, ja, desca, ipiv, B, ib, jb, descb, info);
1611 }
1612
1613 inline void
1614 pgesv(const int *n,
1615 const int *nrhs,
1616 float *A,
1617 const int *ia,
1618 const int *ja,
1619 const int *desca,
1620 int *ipiv,
1621 float *B,
1622 const int *ib,
1623 const int *jb,
1624 const int *descb,
1625 int *info)
1626 {
1627 psgesv_(n, nrhs, A, ia, ja, desca, ipiv, B, ib, jb, descb, info);
1628 }
1629
1630
1631 template <typename number>
1632 inline void
1633 pgemm(const char * /*transa*/,
1634 const char * /*transb*/,
1635 const int * /*m*/,
1636 const int * /*n*/,
1637 const int * /*k*/,
1638 const number * /*alpha*/,
1639 const number * /*A*/,
1640 const int * /*IA*/,
1641 const int * /*JA*/,
1642 const int * /*DESCA*/,
1643 const number * /*B*/,
1644 const int * /*IB*/,
1645 const int * /*JB*/,
1646 const int * /*DESCB*/,
1647 const number * /*beta*/,
1648 number * /*C*/,
1649 const int * /*IC*/,
1650 const int * /*JC*/,
1651 const int * /*DESCC*/)
1652 {
1653 AssertThrow(false, dealii::ExcNotImplemented());
1654 }
1655
1656 inline void
1657 pgemm(const char *transa,
1658 const char *transb,
1659 const int *m,
1660 const int *n,
1661 const int *k,
1662 const double *alpha,
1663 const double *A,
1664 const int *IA,
1665 const int *JA,
1666 const int *DESCA,
1667 const double *B,
1668 const int *IB,
1669 const int *JB,
1670 const int *DESCB,
1671 const double *beta,
1672 double *C,
1673 const int *IC,
1674 const int *JC,
1675 const int *DESCC)
1676 {
1677 pdgemm_(transa,
1678 transb,
1679 m,
1680 n,
1681 k,
1682 alpha,
1683 A,
1684 IA,
1685 JA,
1686 DESCA,
1687 B,
1688 IB,
1689 JB,
1690 DESCB,
1691 beta,
1692 C,
1693 IC,
1694 JC,
1695 DESCC);
1696 }
1697
1698 inline void
1699 pgemm(const char *transa,
1700 const char *transb,
1701 const int *m,
1702 const int *n,
1703 const int *k,
1704 const float *alpha,
1705 const float *A,
1706 const int *IA,
1707 const int *JA,
1708 const int *DESCA,
1709 const float *B,
1710 const int *IB,
1711 const int *JB,
1712 const int *DESCB,
1713 const float *beta,
1714 float *C,
1715 const int *IC,
1716 const int *JC,
1717 const int *DESCC)
1718 {
1719 psgemm_(transa,
1720 transb,
1721 m,
1722 n,
1723 k,
1724 alpha,
1725 A,
1726 IA,
1727 JA,
1728 DESCA,
1729 B,
1730 IB,
1731 JB,
1732 DESCB,
1733 beta,
1734 C,
1735 IC,
1736 JC,
1737 DESCC);
1738 }
1739
1740
1741 inline void
1742 pgemm(const char *transa,
1743 const char *transb,
1744 const int *m,
1745 const int *n,
1746 const int *k,
1747 const std::complex<double> *alpha,
1748 const std::complex<double> *A,
1749 const int *IA,
1750 const int *JA,
1751 const int *DESCA,
1752 const std::complex<double> *B,
1753 const int *IB,
1754 const int *JB,
1755 const int *DESCB,
1756 const std::complex<double> *beta,
1757 std::complex<double> *C,
1758 const int *IC,
1759 const int *JC,
1760 const int *DESCC)
1761 {
1762 pzgemm_(transa,
1763 transb,
1764 m,
1765 n,
1766 k,
1767 alpha,
1768 A,
1769 IA,
1770 JA,
1771 DESCA,
1772 B,
1773 IB,
1774 JB,
1775 DESCB,
1776 beta,
1777 C,
1778 IC,
1779 JC,
1780 DESCC);
1781 }
1782
1783 template <typename number>
1784 inline number
1785 plange(const char * /*norm*/,
1786 const int * /*m*/,
1787 const int * /*n*/,
1788 const number * /*A*/,
1789 const int * /*ia*/,
1790 const int * /*ja*/,
1791 const int * /*desca*/,
1792 number * /*work*/)
1793 {
1794 AssertThrow(false, dealii::ExcNotImplemented());
1795 }
1796
1797 inline double
1798 plange(const char *norm,
1799 const int *m,
1800 const int *n,
1801 const double *A,
1802 const int *ia,
1803 const int *ja,
1804 const int *desca,
1805 double *work)
1806 {
1807 return pdlange_(norm, m, n, A, ia, ja, desca, work);
1808 }
1809
1810 inline float
1811 plange(const char *norm,
1812 const int *m,
1813 const int *n,
1814 const float *A,
1815 const int *ia,
1816 const int *ja,
1817 const int *desca,
1818 float *work)
1819 {
1820 return pslange_(norm, m, n, A, ia, ja, desca, work);
1821 }
1822
1823
1824 template <typename number>
1825 inline void
1826 psyev(const char * /*jobz*/,
1827 const char * /*uplo*/,
1828 const int * /*m*/,
1829 number * /*A*/,
1830 const int * /*ia*/,
1831 const int * /*ja*/,
1832 int * /*desca*/,
1833 number * /*w*/,
1834 number * /*z*/,
1835 const int * /*iz*/,
1836 const int * /*jz*/,
1837 int * /*descz*/,
1838 number * /*work*/,
1839 const int * /*lwork*/,
1840 int * /*info*/)
1841 {
1842 AssertThrow(false, dealii::ExcNotImplemented());
1843 }
1844
1845 inline void
1846 psyev(const char *jobz,
1847 const char *uplo,
1848 const int *m,
1849 double *A,
1850 const int *ia,
1851 const int *ja,
1852 int *desca,
1853 double *w,
1854 double *z,
1855 const int *iz,
1856 const int *jz,
1857 int *descz,
1858 double *work,
1859 const int *lwork,
1860 int *info)
1861 {
1862 pdsyev_(
1863 jobz, uplo, m, A, ia, ja, desca, w, z, iz, jz, descz, work, lwork, info);
1864 }
1865
1866 inline void
1867 psyev(const char *jobz,
1868 const char *uplo,
1869 const int *m,
1870 float *A,
1871 const int *ia,
1872 const int *ja,
1873 int *desca,
1874 float *w,
1875 float *z,
1876 const int *iz,
1877 const int *jz,
1878 int *descz,
1879 float *work,
1880 const int *lwork,
1881 int *info)
1882 {
1883 pssyev_(
1884 jobz, uplo, m, A, ia, ja, desca, w, z, iz, jz, descz, work, lwork, info);
1885 }
1886
1887 inline void
1888 psyev(const char *jobz,
1889 const char *uplo,
1890 const int *m,
1891 std::complex<double> *A,
1892 const int *ia,
1893 const int *ja,
1894 int *desca,
1895 double *w,
1896 std::complex<double> *z,
1897 const int *iz,
1898 const int *jz,
1899 int *descz,
1900 std::complex<double> *work,
1901 const int *lwork,
1902 int *info)
1903 {
1904 pzheev_(
1905 jobz, uplo, m, A, ia, ja, desca, w, z, iz, jz, descz, work, lwork, info);
1906 }
1907
1908 template <typename number>
1909 inline void
1910 placpy(const char * /*uplo*/,
1911 const int * /*m*/,
1912 const int * /*n*/,
1913 const number * /*A*/,
1914 const int * /*ia*/,
1915 const int * /*ja*/,
1916 const int * /*desca*/,
1917 number * /*B*/,
1918 const int * /*ib*/,
1919 const int * /*jb*/,
1920 const int * /*descb*/)
1921 {
1922 AssertThrow(false, dealii::ExcNotImplemented());
1923 }
1924
1925 inline void
1926 placpy(const char *uplo,
1927 const int *m,
1928 const int *n,
1929 const double *A,
1930 const int *ia,
1931 const int *ja,
1932 const int *desca,
1933 double *B,
1934 const int *ib,
1935 const int *jb,
1936 const int *descb)
1937 {
1938 pdlacpy_(uplo, m, n, A, ia, ja, desca, B, ib, jb, descb);
1939 }
1940
1941 inline void
1942 placpy(const char *uplo,
1943 const int *m,
1944 const int *n,
1945 const float *A,
1946 const int *ia,
1947 const int *ja,
1948 const int *desca,
1949 float *B,
1950 const int *ib,
1951 const int *jb,
1952 const int *descb)
1953 {
1954 pslacpy_(uplo, m, n, A, ia, ja, desca, B, ib, jb, descb);
1955 }
1956
1957
1958 template <typename number>
1959 inline void
1960 pgemr2d(const int * /*m*/,
1961 const int * /*n*/,
1962 const number * /*A*/,
1963 const int * /*ia*/,
1964 const int * /*ja*/,
1965 const int * /*desca*/,
1966 number * /*B*/,
1967 const int * /*ib*/,
1968 const int * /*jb*/,
1969 const int * /*descb*/,
1970 const int * /*ictxt*/)
1971 {
1972 AssertThrow(false, dealii::ExcNotImplemented());
1973 }
1974
1975 inline void
1976 pgemr2d(const int *m,
1977 const int *n,
1978 const double *A,
1979 const int *ia,
1980 const int *ja,
1981 const int *desca,
1982 double *B,
1983 const int *ib,
1984 const int *jb,
1985 const int *descb,
1986 const int *ictxt)
1987 {
1988 pdgemr2d_(m, n, A, ia, ja, desca, B, ib, jb, descb, ictxt);
1989 }
1990
1991 inline void
1992 pgemr2d(const int *m,
1993 const int *n,
1994 const float *A,
1995 const int *ia,
1996 const int *ja,
1997 const int *desca,
1998 float *B,
1999 const int *ib,
2000 const int *jb,
2001 const int *descb,
2002 const int *ictxt)
2003 {
2004 psgemr2d_(m, n, A, ia, ja, desca, B, ib, jb, descb, ictxt);
2005 }
2006
2007
2008 template <typename number>
2009 inline void
2010 plamch(const int * /*ictxt*/, const char * /*cmach*/, number & /*val*/)
2011 {
2012 AssertThrow(false, dealii::ExcNotImplemented());
2013 }
2014
2015 inline void
2016 plamch(const int *ictxt, const char *cmach, double &val)
2017 {
2018 val = pdlamch_(ictxt, cmach);
2019 }
2020
2021 inline void
2022 plamch(const int *ictxt, const char *cmach, float &val)
2023 {
2024 val = pslamch_(ictxt, cmach);
2025 }
2026
2027
2028 template <typename number>
2029 inline void
2030 psyevx(const char * /*jobz*/,
2031 const char * /*range*/,
2032 const char * /*uplo*/,
2033 const int * /*n*/,
2034 number * /*A*/,
2035 const int * /*ia*/,
2036 const int * /*ja*/,
2037 const int * /*desca*/,
2038 number * /*VL*/,
2039 number * /*VU*/,
2040 const int * /*il*/,
2041 const int * /*iu*/,
2042 number * /*abstol*/,
2043 const int * /*m*/,
2044 const int * /*nz*/,
2045 number * /*w*/,
2046 number * /*orfac*/,
2047 number * /*Z*/,
2048 const int * /*iz*/,
2049 const int * /*jz*/,
2050 const int * /*descz*/,
2051 number * /*work*/,
2052 int * /*lwork*/,
2053 int * /*iwork*/,
2054 int * /*liwork*/,
2055 int * /*ifail*/,
2056 int * /*iclustr*/,
2057 number * /*gap*/,
2058 int * /*info*/)
2059 {
2060 AssertThrow(false, dealii::ExcNotImplemented());
2061 }
2062
2063 inline void
2064 psyevx(const char *jobz,
2065 const char *range,
2066 const char *uplo,
2067 const int *n,
2068 double *A,
2069 const int *ia,
2070 const int *ja,
2071 const int *desca,
2072 double *VL,
2073 double *VU,
2074 const int *il,
2075 const int *iu,
2076 double *abstol,
2077 const int *m,
2078 const int *nz,
2079 double *w,
2080 double *orfac,
2081 double *Z,
2082 const int *iz,
2083 const int *jz,
2084 const int *descz,
2085 double *work,
2086 int *lwork,
2087 int *iwork,
2088 int *liwork,
2089 int *ifail,
2090 int *iclustr,
2091 double *gap,
2092 int *info)
2093 {
2094 pdsyevx_(jobz,
2095 range,
2096 uplo,
2097 n,
2098 A,
2099 ia,
2100 ja,
2101 desca,
2102 VL,
2103 VU,
2104 il,
2105 iu,
2106 abstol,
2107 m,
2108 nz,
2109 w,
2110 orfac,
2111 Z,
2112 iz,
2113 jz,
2114 descz,
2115 work,
2116 lwork,
2117 iwork,
2118 liwork,
2119 ifail,
2120 iclustr,
2121 gap,
2122 info);
2123 }
2124
2125 inline void
2126 psyevx(const char *jobz,
2127 const char *range,
2128 const char *uplo,
2129 const int *n,
2130 float *A,
2131 const int *ia,
2132 const int *ja,
2133 const int *desca,
2134 float *VL,
2135 float *VU,
2136 const int *il,
2137 const int *iu,
2138 float *abstol,
2139 const int *m,
2140 const int *nz,
2141 float *w,
2142 float *orfac,
2143 float *Z,
2144 const int *iz,
2145 const int *jz,
2146 const int *descz,
2147 float *work,
2148 int *lwork,
2149 int *iwork,
2150 int *liwork,
2151 int *ifail,
2152 int *iclustr,
2153 float *gap,
2154 int *info)
2155 {
2156 pssyevx_(jobz,
2157 range,
2158 uplo,
2159 n,
2160 A,
2161 ia,
2162 ja,
2163 desca,
2164 VL,
2165 VU,
2166 il,
2167 iu,
2168 abstol,
2169 m,
2170 nz,
2171 w,
2172 orfac,
2173 Z,
2174 iz,
2175 jz,
2176 descz,
2177 work,
2178 lwork,
2179 iwork,
2180 liwork,
2181 ifail,
2182 iclustr,
2183 gap,
2184 info);
2185 }
2186
2187 inline void
2188 psyevx(const char *jobz,
2189 const char *range,
2190 const char *uplo,
2191 const int *n,
2192 std::complex<double> *A,
2193 const int *ia,
2194 const int *ja,
2195 const int *desca,
2196 double *VL,
2197 double *VU,
2198 const int *il,
2199 const int *iu,
2200 double *abstol,
2201 const int *m,
2202 const int *nz,
2203 double *w,
2204 double *orfac,
2205 std::complex<double> *Z,
2206 const int *iz,
2207 const int *jz,
2208 const int *descz,
2209 std::complex<double> *work,
2210 int *lwork,
2211 int *iwork,
2212 int *liwork,
2213 int *ifail,
2214 int *iclustr,
2215 double *gap,
2216 int *info)
2217 {
2218 pzheevx_(jobz,
2219 range,
2220 uplo,
2221 n,
2222 A,
2223 ia,
2224 ja,
2225 desca,
2226 VL,
2227 VU,
2228 il,
2229 iu,
2230 abstol,
2231 m,
2232 nz,
2233 w,
2234 orfac,
2235 Z,
2236 iz,
2237 jz,
2238 descz,
2239 work,
2240 lwork,
2241 iwork,
2242 liwork,
2243 ifail,
2244 iclustr,
2245 gap,
2246 info);
2247 }
2248
2249 template <typename number>
2250 inline void
2251 pgesvd(const char * /*jobu*/,
2252 const char * /*jobvt*/,
2253 const int * /*m*/,
2254 const int * /*n*/,
2255 number * /*A*/,
2256 const int * /*ia*/,
2257 const int * /*ja*/,
2258 const int * /*desca*/,
2259 number * /*S*/,
2260 number * /*U*/,
2261 const int * /*iu*/,
2262 const int * /*ju*/,
2263 const int * /*descu*/,
2264 number * /*VT*/,
2265 const int * /*ivt*/,
2266 const int * /*jvt*/,
2267 const int * /*descvt*/,
2268 number * /*work*/,
2269 int * /*lwork*/,
2270 int * /*info*/)
2271 {
2272 AssertThrow(false, dealii::ExcNotImplemented());
2273 }
2274
2275 inline void
2276 pgesvd(const char *jobu,
2277 const char *jobvt,
2278 const int *m,
2279 const int *n,
2280 double *A,
2281 const int *ia,
2282 const int *ja,
2283 const int *desca,
2284 double *S,
2285 double *U,
2286 const int *iu,
2287 const int *ju,
2288 const int *descu,
2289 double *VT,
2290 const int *ivt,
2291 const int *jvt,
2292 const int *descvt,
2293 double *work,
2294 int *lwork,
2295 int *info)
2296 {
2297 pdgesvd_(jobu,
2298 jobvt,
2299 m,
2300 n,
2301 A,
2302 ia,
2303 ja,
2304 desca,
2305 S,
2306 U,
2307 iu,
2308 ju,
2309 descu,
2310 VT,
2311 ivt,
2312 jvt,
2313 descvt,
2314 work,
2315 lwork,
2316 info);
2317 }
2318
2319 inline void
2320 pgesvd(const char *jobu,
2321 const char *jobvt,
2322 const int *m,
2323 const int *n,
2324 float *A,
2325 const int *ia,
2326 const int *ja,
2327 const int *desca,
2328 float *S,
2329 float *U,
2330 const int *iu,
2331 const int *ju,
2332 const int *descu,
2333 float *VT,
2334 const int *ivt,
2335 const int *jvt,
2336 const int *descvt,
2337 float *work,
2338 int *lwork,
2339 int *info)
2340 {
2341 psgesvd_(jobu,
2342 jobvt,
2343 m,
2344 n,
2345 A,
2346 ia,
2347 ja,
2348 desca,
2349 S,
2350 U,
2351 iu,
2352 ju,
2353 descu,
2354 VT,
2355 ivt,
2356 jvt,
2357 descvt,
2358 work,
2359 lwork,
2360 info);
2361 }
2362
2363
2364 template <typename number>
2365 inline void
2366 pgels(const char * /*trans*/,
2367 const int * /*m*/,
2368 const int * /*n*/,
2369 const int * /*nrhs*/,
2370 number * /*A*/,
2371 const int * /*ia*/,
2372 const int * /*ja*/,
2373 const int * /*desca*/,
2374 number * /*B*/,
2375 const int * /*ib*/,
2376 const int * /*jb*/,
2377 const int * /*descb*/,
2378 number * /*work*/,
2379 int * /*lwork*/,
2380 int * /*info*/)
2381 {
2382 AssertThrow(false, dealii::ExcNotImplemented());
2383 }
2384
2385 inline void
2386 pgels(const char *trans,
2387 const int *m,
2388 const int *n,
2389 const int *nrhs,
2390 double *A,
2391 const int *ia,
2392 const int *ja,
2393 const int *desca,
2394 double *B,
2395 const int *ib,
2396 const int *jb,
2397 const int *descb,
2398 double *work,
2399 int *lwork,
2400 int *info)
2401 {
2402 pdgels_(
2403 trans, m, n, nrhs, A, ia, ja, desca, B, ib, jb, descb, work, lwork, info);
2404 }
2405
2406 inline void
2407 pgels(const char *trans,
2408 const int *m,
2409 const int *n,
2410 const int *nrhs,
2411 float *A,
2412 const int *ia,
2413 const int *ja,
2414 const int *desca,
2415 float *B,
2416 const int *ib,
2417 const int *jb,
2418 const int *descb,
2419 float *work,
2420 int *lwork,
2421 int *info)
2422 {
2423 psgels_(
2424 trans, m, n, nrhs, A, ia, ja, desca, B, ib, jb, descb, work, lwork, info);
2425 }
2426
2427
2428 template <typename number>
2429 inline void
2430 pgeadd(const char * /*transa*/,
2431 const int * /*m*/,
2432 const int * /*n*/,
2433 const number * /*alpha*/,
2434 const number * /*A*/,
2435 const int * /*IA*/,
2436 const int * /*JA*/,
2437 const int * /*DESCA*/,
2438 const number * /*beta*/,
2439 number * /*C*/,
2440 const int * /*IC*/,
2441 const int * /*JC*/,
2442 const int * /*DESCC*/)
2443 {
2444 AssertThrow(false, dealii::ExcNotImplemented());
2445 }
2446
2447 inline void
2448 pgeadd(const char *transa,
2449 const int *m,
2450 const int *n,
2451 const double *alpha,
2452 const double *A,
2453 const int *IA,
2454 const int *JA,
2455 const int *DESCA,
2456 const double *beta,
2457 double *C,
2458 const int *IC,
2459 const int *JC,
2460 const int *DESCC)
2461 {
2462 pdgeadd_(transa, m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2463 }
2464
2465 inline void
2466 pgeadd(const char *transa,
2467 const int *m,
2468 const int *n,
2469 const float *alpha,
2470 const float *A,
2471 const int *IA,
2472 const int *JA,
2473 const int *DESCA,
2474 const float *beta,
2475 float *C,
2476 const int *IC,
2477 const int *JC,
2478 const int *DESCC)
2479 {
2480 psgeadd_(transa, m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2481 }
2482
2483 inline void
2484 pgeadd(const char *transa,
2485 const int *m,
2486 const int *n,
2487 const std::complex<double> *alpha,
2488 const std::complex<double> *A,
2489 const int *IA,
2490 const int *JA,
2491 const int *DESCA,
2492 const std::complex<double> *beta,
2493 std::complex<double> *C,
2494 const int *IC,
2495 const int *JC,
2496 const int *DESCC)
2497 {
2498 pzgeadd_(transa, m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2499 }
2500
2501 template <typename number>
2502 inline void
2503 ptran(const int * /*m*/,
2504 const int * /*n*/,
2505 const number * /*alpha*/,
2506 const number * /*A*/,
2507 const int * /*IA*/,
2508 const int * /*JA*/,
2509 const int * /*DESCA*/,
2510 const number * /*beta*/,
2511 number * /*C*/,
2512 const int * /*IC*/,
2513 const int * /*JC*/,
2514 const int * /*DESCC*/)
2515 {
2516 AssertThrow(false, dealii::ExcNotImplemented());
2517 }
2518
2519 inline void
2520 ptran(const int *m,
2521 const int *n,
2522 const double *alpha,
2523 const double *A,
2524 const int *IA,
2525 const int *JA,
2526 const int *DESCA,
2527 const double *beta,
2528 double *C,
2529 const int *IC,
2530 const int *JC,
2531 const int *DESCC)
2532 {
2533 pdtran_(m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2534 }
2535
2536 inline void
2537 ptran(const int *m,
2538 const int *n,
2539 const float *alpha,
2540 const float *A,
2541 const int *IA,
2542 const int *JA,
2543 const int *DESCA,
2544 const float *beta,
2545 float *C,
2546 const int *IC,
2547 const int *JC,
2548 const int *DESCC)
2549 {
2550 pstran_(m, n, alpha, A, IA, JA, DESCA, beta, C, IC, JC, DESCC);
2551 }
2552
2553
2554
2555 inline void
2556 psyevr(const char *jobz,
2557 const char *range,
2558 const char *uplo,
2559 const int *n,
2560 double *A,
2561 const int *IA,
2562 const int *JA,
2563 const int *DESCA,
2564 const double *VL,
2565 const double *VU,
2566 const int *IL,
2567 const int *IU,
2568 int *m,
2569 int *nz,
2570 double *w,
2571 double *Z,
2572 const int *IZ,
2573 const int *JZ,
2574 const int *DESCZ,
2575 double *work,
2576 int *lwork,
2577 int *iwork,
2578 int *liwork,
2579 int *info)
2580 {
2581 /*
2582 * Netlib ScaLAPACK performs floating point tests (e.g. divide-by-zero)
2583 * within the call to pdsyevr causing floating point exceptions to be thrown
2584 * (at least in debug mode). Therefore, we wrap the calls to pdsyevr into
2585 * the following code to suppress the exception.
2586 */
2587#ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2588 fenv_t fp_exceptions;
2589 feholdexcept(&fp_exceptions);
2590#endif
2591
2592 pdsyevr_(jobz,
2593 range,
2594 uplo,
2595 n,
2596 A,
2597 IA,
2598 JA,
2599 DESCA,
2600 VL,
2601 VU,
2602 IL,
2603 IU,
2604 m,
2605 nz,
2606 w,
2607 Z,
2608 IZ,
2609 JZ,
2610 DESCZ,
2611 work,
2612 lwork,
2613 iwork,
2614 liwork,
2615 info);
2616
2617#ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2618 fesetenv(&fp_exceptions);
2619#endif
2620 }
2621
2622 inline void
2623 psyevr(const char *jobz,
2624 const char *range,
2625 const char *uplo,
2626 const int *n,
2627 float *A,
2628 const int *IA,
2629 const int *JA,
2630 const int *DESCA,
2631 const float *VL,
2632 const float *VU,
2633 const int *IL,
2634 const int *IU,
2635 int *m,
2636 int *nz,
2637 float *w,
2638 float *Z,
2639 const int *IZ,
2640 const int *JZ,
2641 const int *DESCZ,
2642 float *work,
2643 int *lwork,
2644 int *iwork,
2645 int *liwork,
2646 int *info)
2647 {
2648 /*
2649 * Netlib ScaLAPACK performs floating point tests (e.g. divide-by-zero)
2650 * within the call to pssyevr causing floating point exceptions to be thrown
2651 * (at least in debug mode). Therefore, we wrap the calls to pssyevr into
2652 * the following code to suppress the exception.
2653 */
2654#ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2655 fenv_t fp_exceptions;
2656 feholdexcept(&fp_exceptions);
2657#endif
2658
2659 pssyevr_(jobz,
2660 range,
2661 uplo,
2662 n,
2663 A,
2664 IA,
2665 JA,
2666 DESCA,
2667 VL,
2668 VU,
2669 IL,
2670 IU,
2671 m,
2672 nz,
2673 w,
2674 Z,
2675 IZ,
2676 JZ,
2677 DESCZ,
2678 work,
2679 lwork,
2680 iwork,
2681 liwork,
2682 info);
2683
2684#ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2685 fesetenv(&fp_exceptions);
2686#endif
2687 }
2688
2689 inline void
2690 psyevr(const char *jobz,
2691 const char *range,
2692 const char *uplo,
2693 const int *n,
2694 std::complex<double> *A,
2695 const int *IA,
2696 const int *JA,
2697 const int *DESCA,
2698 const double *VL,
2699 const double *VU,
2700 const int *IL,
2701 const int *IU,
2702 int *m,
2703 int *nz,
2704 double *w,
2705 std::complex<double> *Z,
2706 const int *IZ,
2707 const int *JZ,
2708 const int *DESCZ,
2709 std::complex<double> *work,
2710 int *lwork,
2711 double *rwork,
2712 int *lrwork,
2713 int *iwork,
2714 int *liwork,
2715 int *info)
2716 {
2717 /*
2718 * Netlib ScaLAPACK performs floating point tests (e.g. divide-by-zero)
2719 * within the call to pdsyevr causing floating point exceptions to be thrown
2720 * (at least in debug mode). Therefore, we wrap the calls to pdsyevr into
2721 * the following code to suppress the exception.
2722 */
2723#ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2724 fenv_t fp_exceptions;
2725 feholdexcept(&fp_exceptions);
2726#endif
2727
2728 pzheevr_(jobz,
2729 range,
2730 uplo,
2731 n,
2732 A,
2733 IA,
2734 JA,
2735 DESCA,
2736 VL,
2737 VU,
2738 IL,
2739 IU,
2740 m,
2741 nz,
2742 w,
2743 Z,
2744 IZ,
2745 JZ,
2746 DESCZ,
2747 work,
2748 lwork,
2749 rwork,
2750 lrwork,
2751 iwork,
2752 liwork,
2753 info);
2754
2755#ifdef DEAL_II_HAVE_FP_EXCEPTIONS
2756 fesetenv(&fp_exceptions);
2757#endif
2758 }
2759
2760 inline int
2761 lworkFromWork(std::vector<double> &work)
2762 {
2763 return static_cast<int>(work[0]);
2764 }
2765
2766 inline int
2767 lworkFromWork(std::vector<float> &work)
2768 {
2769 return static_cast<int>(work[0]);
2770 }
2771
2772 inline int
2773 lworkFromWork(std::vector<std::complex<double>> &work)
2774 {
2775 return static_cast<int>(work[0].real());
2776 }
2777} // namespace dftfe
2778#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:1117
number plansy(const char *, const char *, const int *, const number *, const int *, const int *, const int *, number *)
Definition scalapack.templates.h:1539
void pgetrf(const int *, const int *, number *, const int *, const int *, const int *, int *, int *)
Definition scalapack.templates.h:1237
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:2366
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:1960
void pgetri(const int *, number *, const int *, const int *, const int *, const int *, number *, int *, int *, int *, int *)
Definition scalapack.templates.h:1339
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 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 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, double *rwork, int *lrwork, int *iwork, int *liwork, int *info)
void plamch(const int *, const char *, number &)
Definition scalapack.templates.h:2010
int lworkFromWork(std::vector< double > &work)
Definition scalapack.templates.h:2761
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:2251
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:1290
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:1188
void pplacgv(const int *N, double *A, const int *IA, const int *JA, const int *DESCA, const int *INCX)
Definition scalapack.templates.h:1167
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:1633
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:1826
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:1459
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:2503
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:1406
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 psyevr(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)
Definition scalapack.templates.h:2556
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:1785
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 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:1910
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:2030
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:1580
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:1143
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:2430
void pspotri_(const char *UPLO, const int *N, float *A, const int *IA, const int *JA, const int *DESCA, int *INFO)