class gpr::linalg::ProbeExecutor¶
Overview¶
#include <ProbeExecutor.h>
class ProbeExecutor {
public:
// construction
ProbeExecutor();
// methods
Eigen::VectorXd run(int n_probes, const std::function<double(int)>& probe_fn, KernelInverse::Kind kind, const MpiContext& ctx) const;
};
Detailed Documentation¶
Methods¶
Eigen::VectorXd run(int n_probes, const std::function<double(int)>& probe_fn, KernelInverse::Kind kind, const MpiContext& ctx) const
Run n_probes probe evaluations under the dispatch policy implied by kind, against the MPI context ctx, and return the global result vector. The result vector has length n_probes on every rank.
Performance contract: the std::function<double(int)> parameter is type-erased; lambdas larger than the SBO threshold (~24-32 bytes on libstdc++) heap-allocate on construction. Callers should construct the std::function ONCE outside the loop and reuse it, not re-bind on every probe. The probe lambda itself is invoked n_probes / nprocs times under RankLocal kind, n_probes times under Distributed kind.
Parameters:
n_probes |
Total number of probes to evaluate. Must be >= 0. |
probe_fn |
Callable with signature |
kind |
Dispatch policy. |
ctx |
MPI context. Use |
Returns:
The n_probes -element vector of probe values, identical on every rank.