Skip to content

add stages to long_fastsurfer.sh#786

Merged
m-reuter merged 10 commits into
devfrom
long-stages
Feb 12, 2026
Merged

add stages to long_fastsurfer.sh#786
m-reuter merged 10 commits into
devfrom
long-stages

Conversation

@m-reuter
Copy link
Copy Markdown
Member

Enhancement requested #780

Summary

Adds stage-based execution to long_fastsurfer.sh, allowing users to run individual pipeline stages independently for flexible resource allocation across compute nodes with varying GPU/CPU capabilities.

Changes

  • Added --stage flag to select which stages to run: prepare, template_seg, template_surf, long_seg, long_surf, or all (default)
  • Automatic dependency validation ensures required stages have completed before running dependent stages
  • Smart input validation: only requires --t1s when running prepare stage
  • Backward compatible: default behavior unchanged (runs all stages)

Usage

# Run full pipeline (default, unchanged)
./long_fastsurfer.sh --tid template01 --t1s tp1.mgz tp2.mgz --tpids tp1 tp2

# Run individual stage
./long_fastsurfer.sh --tid template01 --tpids tp1 tp2 --stage template_seg

# Run multiple stages
./long_fastsurfer.sh --tid template01 --tpids tp1 tp2 --stage template_surf --stage long_surf

Benefits

  • Resource optimization: Send GPU stages to GPU nodes, CPU stages to CPU nodes
  • Restart capability: Re-run individual stages without reprocessing completed ones
  • Better cluster scheduling: Split heavy jobs into smaller, faster-to-schedule jobs

@m-reuter m-reuter changed the title add staged to long_fastsurfer.sh add stages to long_fastsurfer.sh Feb 12, 2026
@m-reuter m-reuter requested a review from Copilot February 12, 2026 11:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the longitudinal pipeline driver long_fastsurfer.sh by adding a --stage flag to run individual pipeline stages independently (or the full pipeline by default), enabling splitting work across different compute resources (CPU/GPU) and improving restartability.

Changes:

  • Added stage selection (--stage) with a set of named pipeline stages and updated help text.
  • Added stage dependency checks and stage-aware input validation (e.g., only requiring --t1s for prepare).
  • Wrapped each pipeline block (prepare, template_seg, template_surf, long_seg, long_surf) behind stage gating logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread long_fastsurfer.sh Outdated
Comment thread long_fastsurfer.sh Outdated
Comment thread long_fastsurfer.sh Outdated
Comment thread long_fastsurfer.sh
Comment thread long_fastsurfer.sh Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread long_fastsurfer.sh Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@dkuegler dkuegler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would use should_run_stage also in the validation check function.
And at the end only print "Full" if it is actually the final stage.

Comment thread long_fastsurfer.sh
Comment thread long_fastsurfer.sh Outdated
Comment thread long_fastsurfer.sh Outdated
Comment thread long_fastsurfer.sh Outdated
m-reuter and others added 3 commits February 12, 2026 17:13
Co-authored-by: David Kügler <david.kuegler@dzne.de>
Co-authored-by: David Kügler <david.kuegler@dzne.de>
Copy link
Copy Markdown
Member

@dkuegler dkuegler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@m-reuter m-reuter merged commit b706ae0 into dev Feb 12, 2026
2 of 3 checks passed
@m-reuter m-reuter deleted the long-stages branch February 12, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants