about summary refs log tree commit diff
path: root/src/config.rs
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-11 13:21:05 +0000
committerPjotr <wrk@bosa.lan>2026-11-11 13:21:05 +0000
commitca7efa231bbd818b5166e38b59e3c81ea30821b3 (patch)
treeca02a03ebbf576afc1ea45ff3e251bd1c967056b /src/config.rs
parentf4d2d719f90774e85bc47eca041bc469f0f0951d (diff)
downloadgenenetwork4-ca7efa231bbd818b5166e38b59e3c81ea30821b3.tar.gz
bulklmm: BULKLMM_BLOCKS as a config option, default 4
The marker blocks a single-trait scan is split into were the driver's
default (Threads.nthreads()) and changed with --threads. They are a
separate knob now:

  BULKLMM_THREADS   Julia threads (--threads)               default 4
  BULKLMM_BLOCKS    independent marker blocks, scanned       default 4
                    in parallel (1 = serial scan)

Blocks are exact either way -- LOD 9.589938 and the same permutation
thresholds at 1 and 4 -- so the knob only buys wall clock. The reply says
what ran ("split into 4 independent blocks and scanned on 4 Julia
thread(s) (BULKLMM_BLOCKS / BULKLMM_THREADS ...)"), because the answer to
"is it multicore?" should be in the response and not in the log.
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 42b74e7..cf5476e 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -158,6 +158,10 @@ pub struct Config {
     pub bulklmm_depot: String,
     pub bulklmm_script: String,
     pub bulklmm_threads: u32,
+    /// Independent marker blocks scanned in parallel (`BULKLMM_BLOCKS`,
+    /// default 4). `1` is a plain serial scan; the LODs and thresholds are
+    /// identical either way.
+    pub bulklmm_blocks: u32,
     pub bulklmm_cache_dir: String,
     /// The script that draws a BulkLMM scan (`BULKLMM_PLOTTER`).
     pub bulklmm_plotter: String,
@@ -341,6 +345,10 @@ impl Config {
             "scripts/bulklmm_scan.jl".to_string(),
         );
         values.insert("BULKLMM_THREADS".to_string(), "4".to_string());
+        // Independent marker blocks scanned in parallel: a BulkLMM `scan()` is
+        // serial in Julia, so this is where a single-trait scan gets its
+        // parallelism. 1 is a plain serial scan and gives the same answer.
+        values.insert("BULKLMM_BLOCKS".to_string(), "4".to_string());
         values.insert(
             "BULKLMM_PLOTTER".to_string(),
             "scripts/plot-bulklmm.py".to_string(),
@@ -425,6 +433,7 @@ impl Config {
             "BULKLMM_DEPOT",
             "BULKLMM_SCRIPT",
             "BULKLMM_THREADS",
+            "BULKLMM_BLOCKS",
             "BULKLMM_CACHE_DIR",
             "BULKLMM_PLOTTER",
         ] {
@@ -478,6 +487,7 @@ impl Config {
             bulklmm_depot: values["BULKLMM_DEPOT"].clone(),
             bulklmm_script: values["BULKLMM_SCRIPT"].clone(),
             bulklmm_threads: values["BULKLMM_THREADS"].parse().unwrap_or(4),
+            bulklmm_blocks: values["BULKLMM_BLOCKS"].parse().unwrap_or(4),
             bulklmm_cache_dir: values["BULKLMM_CACHE_DIR"].clone(),
             bulklmm_plotter: values["BULKLMM_PLOTTER"].clone(),
             genotype_files_dir: values["GENOTYPE_FILES"].clone(),
@@ -734,6 +744,7 @@ mod tests {
             "BULKLMM_DEPOT",
             "BULKLMM_SCRIPT",
             "BULKLMM_THREADS",
+            "BULKLMM_BLOCKS",
             "BULKLMM_CACHE_DIR",
             "BULKLMM_PLOTTER",
         ] {