feat: add input file logging and optimize path traversal

Instrument index and scatter stages with `tracing::info` to log input file paths for better runtime observability. Additionally, optimize the path iterator by replacing redundant `is_dir()` checks with explicit `is_file()` validation and deferring metadata resolution, eliminating unnecessary `stat()` syscalls and improving traversal performance on high-latency network filesystems like Lustre and NFS.
This commit is contained in:
Eric Coissac committed 2026-05-22 11:04:04 +02:00
1 parent fe0832190b
commit fe2127c463
3 files changed
+21 -10

No files matched your search

-4
View File
@@ -100,10 +100,6 @@ pub fn run(args: IndexArgs) {
// ── Stage 1: scatter ─────────────────────────────────────────────────────
if idx.state() < IndexState::Scattered {
let paths: Vec<_> = args.common.seqfile_paths().collect();
for path in &paths {
info!("indexing: {}", path.display());
}
let k = idx.kmer_size();
let level_max = args.common.level_max;
let theta = args.common.theta;
+4 -1
View File
@@ -4,6 +4,7 @@ use std::time::{Duration, Instant};
use indicatif::{ProgressBar, ProgressStyle};
use obikpartitionner::KmerPartition;
use obisys::{Reporter, Stage};
use tracing::info;
use crate::cli::{PipelineData, open_chunks};
@@ -11,7 +12,7 @@ use crate::cli::{PipelineData, open_chunks};
/// Reports the "scatter" stage to `rep`.
pub fn scatter(
kp: &mut KmerPartition,
path_source: obiread::PathIter,
path_source: impl Iterator<Item = std::path::PathBuf> + Send + 'static,
k: usize,
level_max: usize,
theta: f64,
@@ -21,6 +22,8 @@ pub fn scatter(
use obikseq::RoutableSuperKmer;
let t = Stage::start("scatter");
let path_source = path_source.inspect(|p| info!("indexing: {}", p.display()));
let pipe = obipipeline::make_pipe! {
PipelineData : PathBuf => Vec<RoutableSuperKmer>,
||? { |path| open_chunks(path) } : Path => RawChunk,