#[non_exhaustive]pub struct ExtMemOpts {
pub max_context: usize,
pub subproblem_count: usize,
pub work_dir: PathBuf,
pub physical_file_count: usize,
pub ordered_phase4_emit: bool,
pub lcp_memoization: LcpMemoizationPolicy,
/* private fields */
}Expand description
Tunable options for build_ext_mem.
This structure is non-exhaustive so future releases can add options
without repeatedly breaking callers that use struct literals. Start from
Self::default or Self::from_env and use the builder methods.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_context: usizeBound on suffix-comparison context. Comparisons equal through this many
symbols are resolved by LimitProvider::boundary_order, so
usize::MAX (the default) is required for ordinary full lexicographic
ordering unless the caller deliberately wants truncated contexts.
subproblem_count: usizeNumber of subarrays (p in upstream CaPS-SA). 0 (default) targets
roughly 65,536 selected positions per subarray, clamped to at least one
subarray per Rayon worker and at most 8,192 (and never above n).
work_dir: PathBufDirectory for temp files. Defaults to std::env::temp_dir.
physical_file_count: usizeNumber of physical files backing the final partition buckets. 0
(default) picks rayon::current_num_threads() —
the right answer in practice: one writable inode per worker
keeps kernel-level write contention bounded.
The p logical buckets (typically thousands at genome scale) collapse
onto this pool of anonymous tempfiles via
bucket_id % physical_file_count. Larger values lower kernel
write contention; smaller values are kinder to networked
filesystems with high metadata cost. The CAPS_SA_N_PHYS env
var overrides this for one-off benches.
ordered_phase4_emit: boolUse the bounded ordered phase-4 emitter instead of the default chunk collect-then-emit path. This can reduce transient merged partition residency on skewed workloads, but is slower on the GRCh38 32-thread benchmark because of channel coordination and backpressure, so it is opt-in.
lcp_memoization: LcpMemoizationPolicyPolicy for reusing exact long-LCP intervals during phase-4 partition
merges. Disabled by default; callers with long repeated contexts can
opt into LcpMemoizationPolicy::Geometric.
Implementations§
Source§impl ExtMemOpts
impl ExtMemOpts
Sourcepub fn with_work_dir(work_dir: impl AsRef<Path>) -> Self
pub fn with_work_dir(work_dir: impl AsRef<Path>) -> Self
Convenience constructor with the supplied work_dir and defaults
for everything else.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Defaults plus caps-sa environment overrides.
Recognised variables:
CAPS_SA_WORK_DIR/CAPS_SA_TMPDIR: temp-file directoryCAPS_SA_SUBPROBLEMS: subarray count (p)CAPS_SA_N_PHYS: physical backing-file countCAPS_SA_MAX_CONTEXT: LCP comparison capCAPS_SA_ORDERED_PHASE4=1|true|yes|on: bounded ordered phase-4 emitCAPS_SA_GEOMETRIC_MEMO=1|true|yes|on: geometric LCP memoizationCAPS_SA_MEMO_PROBE: ordinary symbols compared before table lookupCAPS_SA_MEMO_MIN_LCP: minimum exact LCP admitted to the tableCAPS_SA_MEMO_ACTIVATE_ENTRIES: entries learned before table lookupCAPS_SA_MEMO_CAPACITY: maximum entries per partition tableCAPS_SA_MEMO_STATS=1|true|yes|on: detailed memoization counters
Invalid and zero-valued numeric overrides are ignored, preserving the
corresponding defaults. Memoization tuning variables take effect only
when CAPS_SA_GEOMETRIC_MEMO enables the policy.
Sourcepub fn max_context(self, max_context: usize) -> Self
pub fn max_context(self, max_context: usize) -> Self
Builder-style setter for Self::max_context.
Sourcepub fn subproblem_count(self, subproblem_count: usize) -> Self
pub fn subproblem_count(self, subproblem_count: usize) -> Self
Builder-style setter for Self::subproblem_count.
Sourcepub fn work_dir(self, work_dir: impl AsRef<Path>) -> Self
pub fn work_dir(self, work_dir: impl AsRef<Path>) -> Self
Builder-style setter for Self::work_dir.
Sourcepub fn physical_file_count(self, physical_file_count: usize) -> Self
pub fn physical_file_count(self, physical_file_count: usize) -> Self
Builder-style setter for Self::physical_file_count.
Sourcepub fn ordered_phase4_emit(self, ordered_phase4_emit: bool) -> Self
pub fn ordered_phase4_emit(self, ordered_phase4_emit: bool) -> Self
Builder-style setter for Self::ordered_phase4_emit.
Sourcepub fn lcp_memoization(
self,
lcp_memoization: impl Into<LcpMemoizationPolicy>,
) -> Self
pub fn lcp_memoization( self, lcp_memoization: impl Into<LcpMemoizationPolicy>, ) -> Self
Builder-style setter for Self::lcp_memoization.
Trait Implementations§
Source§impl Clone for ExtMemOpts
impl Clone for ExtMemOpts
Source§fn clone(&self) -> ExtMemOpts
fn clone(&self) -> ExtMemOpts
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExtMemOpts
impl Debug for ExtMemOpts
Auto Trait Implementations§
impl Freeze for ExtMemOpts
impl RefUnwindSafe for ExtMemOpts
impl Send for ExtMemOpts
impl Sync for ExtMemOpts
impl Unpin for ExtMemOpts
impl UnsafeUnpin for ExtMemOpts
impl UnwindSafe for ExtMemOpts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more