Loading...
Searching...
No Matches
ScalapackLib.h File Reference

Runtime loader for ScaLAPACK / BLACS symbols (dlopen + dlsym). More...

#include <dlfcn.h>
#include <mpi.h>
#include <cassert>

Go to the source code of this file.

Classes

class  gpr::linalg::ScalapackLib

Namespaces

namespace  gpr
 Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
namespace  gpr::linalg
 Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators, backend selection.

Functions

void Cblacs_pinfo (int *a, int *b)
void Cblacs_get (int a, int b, int *c)
void Cblacs_gridinit (int *a, const char *b, int c, int d)
void Cblacs_gridinfo (int a, int *b, int *c, int *d, int *e)
void Cblacs_gridexit (int a)
void Cblacs_exit (int a)
MPI_Comm Cblacs2sys_handle (int a)
int Csys2blacs_handle (MPI_Comm communicator)
void Cfree_blacs_system_handle (int handle)
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)
int numroc_ (const int *n, const int *nb, const int *iproc, const int *isrcproc, const int *nprocs)
void Cpdgemr2d (int m, int n, const double *a, int ia, int ja, const int *desca, double *b, int ib, int jb, const int *descb, int ictxt)
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, const int *lwork, int *info)
void pdsyev_ (const char *jobz, const char *uplo, const int *n, double *a, const int *ia, const int *ja, const int *desca, double *w, double *z, const int *iz, const int *jz, const int *descz, double *work, const int *lwork, int *info)
bool pdsyevd_available_ ()
void pdsyevd_ (const char *jobz, const char *uplo, const int *n, double *a, const int *ia, const int *ja, const int *desca, double *w, double *z, const int *iz, const int *jz, const int *descz, double *work, const int *lwork, int *iwork, const int *liwork, int *info)
bool pdsyevr_available_ ()
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, const int *lwork, int *iwork, const 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 pdpotri_ (const char *uplo, const int *n, double *a, const int *ia, const int *ja, const int *desca, int *info)
void pdtrsm_ (const char *side, const char *uplo, const char *trans, const char *diag, const int *m, const int *n, const double *alpha, const double *a, const int *ia, const int *ja, const int *desca, double *b, const int *ib, const int *jb, const int *descb)
void pdgemv_ (const char *trans, const int *m, const int *n, const double *alpha, const double *a, const int *ia, const int *ja, const int *desca, const double *x, const int *ix, const int *jx, const int *descx, const int *incx, const double *beta, double *y, const int *iy, const int *jy, const int *descy, const int *incy)
void pdsyrk_ (const char *uplo, const char *trans, const int *n, const int *k, 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 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)

Detailed Description

Runtime loader for ScaLAPACK / BLACS symbols (dlopen + dlsym).

ScaLAPACK is loaded at runtime, not linked, so a single binary runs serially on hosts without libscalapack and distributes on hosts that have it – the same pattern CusolverBackend uses for libcusolver/libcublas, and the way eOn dlopens external potential libraries. Backend dispatch gates on ScalapackLib::available() (false when libscalapack is absent) and falls back to the Eigen serial path; nothing here throws on a missing library.

MPI stays LINKED (it is the launch substrate – mpirun-injected, and np==1 falls back to Eigen regardless). libscalapack calls MPI internally, so the handle is opened RTLD_GLOBAL: the dlopen'd ScaLAPACK then resolves its MPI symbols against the libmpi already linked into this process, keeping BLACS grids and our MPI_COMM_WORLD on the same communicator. RTLD_LOCAL would let ScaLAPACK bind a second libmpi and the contexts would not match.

Definition in file ScalapackLib.h.

Function Documentation

◆ Cblacs2sys_handle()

MPI_Comm Cblacs2sys_handle ( int a)
inline

Definition at line 230 of file ScalapackLib.h.

231{
233}
Cblacs2sys_handle_t Cblacs2sys_handle
static ScalapackLib & instance()

◆ Cblacs_exit()

void Cblacs_exit ( int a)
inline

Definition at line 226 of file ScalapackLib.h.

◆ Cblacs_get()

void Cblacs_get ( int a,
int b,
int * c )
inline

Definition at line 210 of file ScalapackLib.h.

◆ Cblacs_gridexit()

void Cblacs_gridexit ( int a)
inline

Definition at line 222 of file ScalapackLib.h.

◆ Cblacs_gridinfo()

void Cblacs_gridinfo ( int a,
int * b,
int * c,
int * d,
int * e )
inline

Definition at line 218 of file ScalapackLib.h.

219{
221}
Cblacs_gridinfo_t Cblacs_gridinfo

◆ Cblacs_gridinit()

void Cblacs_gridinit ( int * a,
const char * b,
int c,
int d )
inline

Definition at line 214 of file ScalapackLib.h.

215{
217}
Cblacs_gridinit_t Cblacs_gridinit

◆ Cblacs_pinfo()

void Cblacs_pinfo ( int * a,
int * b )
inline

Definition at line 204 of file ScalapackLib.h.

205{
207 assert(L.available());
208 L.Cblacs_pinfo(a, b);
209}

◆ Cfree_blacs_system_handle()

void Cfree_blacs_system_handle ( int handle)
inline

Definition at line 239 of file ScalapackLib.h.

240{
242}
Cfree_blacs_system_handle_t Cfree_blacs_system_handle

◆ Cpdgemr2d()

void Cpdgemr2d ( int m,
int n,
const double * a,
int ia,
int ja,
const int * desca,
double * b,
int ib,
int jb,
const int * descb,
int ictxt )
inline

Definition at line 256 of file ScalapackLib.h.

259{
260 gpr::linalg::ScalapackLib::instance().Cpdgemr2d(m, n, a, ia, ja, desca, b,
261 ib, jb, descb, ictxt);
262}

◆ Csys2blacs_handle()

int Csys2blacs_handle ( MPI_Comm communicator)
inline

Definition at line 234 of file ScalapackLib.h.

235{
237 communicator);
238}
Csys2blacs_handle_t Csys2blacs_handle

◆ descinit_()

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 )
inline

Definition at line 243 of file ScalapackLib.h.

246{
247 gpr::linalg::ScalapackLib::instance().descinit(desc, m, n, mb, nb, irsrc,
248 icsrc, ictxt, lld, info);
249}

◆ numroc_()

int numroc_ ( const int * n,
const int * nb,
const int * iproc,
const int * isrcproc,
const int * nprocs )
inline

Definition at line 250 of file ScalapackLib.h.

252{
253 return gpr::linalg::ScalapackLib::instance().numroc(n, nb, iproc, isrcproc,
254 nprocs);
255}

◆ pdgemv_()

void pdgemv_ ( const char * trans,
const int * m,
const int * n,
const double * alpha,
const double * a,
const int * ia,
const int * ja,
const int * desca,
const double * x,
const int * ix,
const int * jx,
const int * descx,
const int * incx,
const double * beta,
double * y,
const int * iy,
const int * jy,
const int * descy,
const int * incy )
inline

Definition at line 335 of file ScalapackLib.h.

342{
343 gpr::linalg::ScalapackLib::instance().pdgemv(trans, m, n, alpha, a, ia, ja,
344 desca, x, ix, jx, descx, incx,
345 beta, y, iy, jy, descy, incy);
346}
@ x
Definition Enums.h:28
@ y
Definition Enums.h:28

◆ pdgesvd_()

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,
const int * lwork,
int * info )
inline

Definition at line 263 of file ScalapackLib.h.

269{
271 jobu, jobvt, m, n, a, ia, ja, desca, s, u, iu, ju, descu, vt, ivt, jvt,
272 descvt, work, lwork, info);
273}

◆ pdpotrf_()

void pdpotrf_ ( const char * uplo,
const int * n,
double * a,
const int * ia,
const int * ja,
const int * desca,
int * info )
inline

Definition at line 313 of file ScalapackLib.h.

315{
316 gpr::linalg::ScalapackLib::instance().pdpotrf(uplo, n, a, ia, ja, desca,
317 info);
318}

◆ pdpotri_()

void pdpotri_ ( const char * uplo,
const int * n,
double * a,
const int * ia,
const int * ja,
const int * desca,
int * info )
inline

Definition at line 319 of file ScalapackLib.h.

321{
322 gpr::linalg::ScalapackLib::instance().pdpotri(uplo, n, a, ia, ja, desca,
323 info);
324}

◆ pdsyev_()

void pdsyev_ ( const char * jobz,
const char * uplo,
const int * n,
double * a,
const int * ia,
const int * ja,
const int * desca,
double * w,
double * z,
const int * iz,
const int * jz,
const int * descz,
double * work,
const int * lwork,
int * info )
inline

Definition at line 274 of file ScalapackLib.h.

278{
279 gpr::linalg::ScalapackLib::instance().pdsyev(jobz, uplo, n, a, ia, ja,
280 desca, w, z, iz, jz, descz,
281 work, lwork, info);
282}
@ z
Definition Enums.h:28

◆ pdsyevd_()

void pdsyevd_ ( const char * jobz,
const char * uplo,
const int * n,
double * a,
const int * ia,
const int * ja,
const int * desca,
double * w,
double * z,
const int * iz,
const int * jz,
const int * descz,
double * work,
const int * lwork,
int * iwork,
const int * liwork,
int * info )
inline

Definition at line 287 of file ScalapackLib.h.

292{
294 jobz, uplo, n, a, ia, ja, desca, w, z, iz, jz, descz, work, lwork,
295 iwork, liwork, info);
296}

◆ pdsyevd_available_()

bool pdsyevd_available_ ( )
inline

Definition at line 283 of file ScalapackLib.h.

284{
286}

◆ pdsyevr_()

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,
const int * lwork,
int * iwork,
const int * liwork,
int * info )
inline

Definition at line 301 of file ScalapackLib.h.

308{
310 jobz, range, uplo, n, a, ia, ja, desca, vl, vu, il, iu, m, nz, w, z, iz,
311 jz, descz, work, lwork, iwork, liwork, info);
312}

◆ pdsyevr_available_()

bool pdsyevr_available_ ( )
inline

Definition at line 297 of file ScalapackLib.h.

298{
300}

◆ pdsyrk_()

void pdsyrk_ ( const char * uplo,
const char * trans,
const int * n,
const int * k,
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 )
inline

Definition at line 347 of file ScalapackLib.h.

352{
354 uplo, trans, n, k, alpha, a, ia, ja, desca, beta, c, ic, jc, descc);
355}

◆ pdtran_()

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 )
inline

Definition at line 356 of file ScalapackLib.h.

360{
361 gpr::linalg::ScalapackLib::instance().pdtran(m, n, alpha, a, ia, ja, desca,
362 beta, c, ic, jc, descc);
363}

◆ pdtrsm_()

void pdtrsm_ ( const char * side,
const char * uplo,
const char * trans,
const char * diag,
const int * m,
const int * n,
const double * alpha,
const double * a,
const int * ia,
const int * ja,
const int * desca,
double * b,
const int * ib,
const int * jb,
const int * descb )
inline

Definition at line 325 of file ScalapackLib.h.

330{
331 gpr::linalg::ScalapackLib::instance().pdtrsm(side, uplo, trans, diag, m, n,
332 alpha, a, ia, ja, desca, b, ib,
333 jb, descb);
334}