MCPcopy Create free account
hub / github.com/Open-Quant/openquant / default

Method default

crates/openquant/src/hpc_parallel.rs:37–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35//! let ends = |s| -> Result<Vec<usize>, HpcParallelError> {
36//! Ok(partition_atoms(10, 3, s)?.iter().map(|p| p.end).collect())
37//! };
38//! assert_eq!(ends(PartitionStrategy::Linear)?, [3, 6, 10]); // floor(10 i / 3)
39//! assert_eq!(ends(PartitionStrategy::Nested)?, [6, 8, 10]); // round(10 sqrt(i / 3))
40//!
41//! // Sum the squares of 1..=100 on four threads, two molecules per thread.
42//! let atoms: Vec<u64> = (1..=100).collect();
43//! let cfg = HpcParallelConfig {
44//! mode: ExecutionMode::Threaded { num_threads: 4 },
45//! partition: PartitionStrategy::Linear,
46//! mp_batches: 2,
47//! progress_every: 1,

Callers

nothing calls this directly

Calls 1

default_threadsFunction · 0.85

Tested by

no test coverage detected