From 4d64675689f51d6dd048934dd3d2e7cf8c8bfbc4 Mon Sep 17 00:00:00 2001 From: Yousef Moazzam Date: Thu, 2 Apr 2026 09:27:21 +0100 Subject: [PATCH] Set reslice dir default value to output dir Prior to this change, the default value for the `--reslice-dir` flag of `None` was transformed into a temp dir. However, there have been observations of: - insufficient storage space - sometimes very slow write speeds when on the cusp of filling up the storage space in `/tmp` of DLS cluster nodes. This, together with noting that the output directory is very often at DLS a dir within a GPFS mount and that write speeds are more consistent and faster this way, motivated the decision to instead transform the default value of `None` for the `--reslice-dir` flag to the output dir that httomo creates. --- httomo/cli.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/httomo/cli.py b/httomo/cli.py index c9cd7756b..580fcd600 100644 --- a/httomo/cli.py +++ b/httomo/cli.py @@ -1,5 +1,6 @@ from contextlib import AbstractContextManager, nullcontext from datetime import datetime +from os import PathLike from pathlib import Path, PurePath import sys import tempfile @@ -278,7 +279,7 @@ def run( max_memory, monitor, monitor_output, - reslice_dir, + reslice_dir if reslice_dir is not None else httomo.globals.run_out_dir, save_snapshots, ) else: @@ -418,7 +419,7 @@ def execute_high_throughput_run( max_memory: str, monitor: List[str], monitor_output: TextIO, - reslice_dir: Union[Path, None], + reslice_dir: PathLike, save_snapshots: bool, ) -> None: # we use half the memory for blocks since we typically have inputs/output @@ -429,8 +430,6 @@ def execute_high_throughput_run( # Run the pipeline using Taskrunner, with temp dir or reslice dir mon = make_monitors(monitor, global_comm) ctx: AbstractContextManager = nullcontext(reslice_dir) - if reslice_dir is None: - ctx = tempfile.TemporaryDirectory() with ctx as tmp_dir: runner = TaskRunner( pipeline,