hpc_parallel
Subject
Section titled “Subject”Scaling, HPC and Infrastructure
Why This Module Exists
Section titled “Why This Module Exists”Research pipelines bottleneck on repeated independent computations; this module exposes reproducible partitioning and dispatch controls to scale those workloads safely.
Mathematical Foundations
Section titled “Mathematical Foundations”Linear Partition Boundary
Section titled “Linear Partition Boundary”
Nested Partition Boundary
Section titled “Nested Partition Boundary”
Throughput
Section titled “Throughput”
Usage Examples
Section titled “Usage Examples”Run atom->molecule callback in threaded mode
Section titled “Run atom->molecule callback in threaded mode”use openquant::hpc_parallel::{run_parallel, ExecutionMode, HpcParallelConfig, PartitionStrategy};
let atoms: Vec<f64> = (0..10_000).map(|i| i as f64).collect();let report = run_parallel( &atoms, HpcParallelConfig { mode: ExecutionMode::Threaded { num_threads: 8 }, partition: PartitionStrategy::Nested, mp_batches: 4, progress_every: 4, }, |chunk| Ok::<f64, &'static str>(chunk.iter().map(|x| x.sqrt()).sum()),)?;
println!("molecules={} atoms/s={:.0}", report.metrics.molecules_total, report.metrics.throughput_atoms_per_sec);API Reference
Section titled “API Reference”Rust API
Section titled “Rust API”partition_atomsrun_paralleldispatch_asyncExecutionModePartitionStrategyHpcParallelConfigParallelRunReportHpcParallelMetrics
Implementation Notes
Section titled “Implementation Notes”- Use
ExecutionMode::Serialfor deterministic debugging with identical callback semantics. - If per-atom cost rises with atom index (e.g., expanding windows), nested partitioning can reduce tail stragglers versus linear chunking.