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

Distributed ScaLAPACK pdpotrf-based KernelInverse impl. More...

Go to the source code of this file.

Detailed Description

Distributed ScaLAPACK pdpotrf-based KernelInverse impl.

First Kind::Distributed concrete implementation of gpr::linalg::KernelInverse. Its four ops (solve / solve_mat / log_det / trace_inv_times) are MPI collectives over the BLACS process grid managed by gpr::linalg::DistributedState. Every rank must enter each op together, so ProbeExecutor (Task 5) runs the probe loop on every rank rather than partitioning probes round-robin (which would deadlock at the next pdtrsm).

The factorise entry point takes a tile-distributed K buffer (per a 9-element BLACS descriptor) plus the global dimension n, calls in-place pdpotrf, and stores the resulting distributed L factor in the operator's own state. The dense K cannot be the input here – this impl is built to consume the distributed buffer assembled via the GaussianProcessRegression::decomposeCovarianceMatrixScalapack tile loop pattern.

Backend-equivalent to DenseLLTInverse on SPD K within 1e-10 relative error at np=1 (single-rank distributed-plumbing pin) on the 200-row PSD fixture used in KernelInverseTest.cpp. Multi-rank correctness (np=4) is exercised by the upstream integration tests; this wrapper covers the routing layer.

Cost:

  • factorise: O(n^3 / 3) pdpotrf, parallelised over the BLACS grid.
  • solve / column of solve_mat: two pdtrsm's (forward + back), each O(n^2) global FLOPs over the grid.
  • log_det: O(n) diagonal traversal of L on the diagonal owners followed by an ordered_sum_bcast collective.
  • trace_inv_times(A): two pdtrsm's of an n x n RHS = O(n^3) global FLOPs (matches the dense LLT cost; no extra ScaLAPACK trace primitive avoids materialising K^{-1} A explicitly).

Symmetry contract: trace_inv_times treats A as a general dense matrix. Inherits the base contract silently.

Definition in file ScalapackPDPotrfInverse.h.