Skip to content

feature(parallel): add parallel plugin execution with resource-aware scheduling#10

Merged
movingpictures83 merged 1 commit into
FIUBioRG:masterfrom
quinnjr:feature/parallel-execution
May 14, 2026
Merged

feature(parallel): add parallel plugin execution with resource-aware scheduling#10
movingpictures83 merged 1 commit into
FIUBioRG:masterfrom
quinnjr:feature/parallel-execution

Conversation

@quinnjr

@quinnjr quinnjr commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for running independent pipeline plugins concurrently via explicit Parallel/EndParallel blocks in PluMA configuration files. This enables significant speedups for pipelines with independent processing steps while preserving PluMA's modular plugin architecture.

Key features

  • Explicit parallel blocksParallel/EndParallel directives in config files with workers, memory, gpu, and fail options
  • Fork-based process isolation — each plugin runs in its own process, avoiding Python GIL and R interpreter limitations
  • Resource-aware scheduling — memory, GPU, and worker slot budgets prevent oversubscription
  • Configurable failure modesfail=fast (default) aborts on first error; fail=continue runs all tasks

Config syntax example

Prefix /data/pipeline
Plugin Normalize inputA.csv normalizedA.csv

Parallel workers=4 memory=8G fail=continue
  Plugin FeatureExtractA normalizedA.csv featuresA.csv
  Plugin FeatureExtractB normalizedB.csv featuresB.csv
  Plugin FeatureExtractC normalizedC.csv featuresC.csv
EndParallel

Plugin Merge featuresA.csv,featuresB.csv,featuresC.csv merged.csv

Components

File Description
src/ParallelTypes.h Core data structures (ParallelBlock, PluginTask, ResourceBudget, etc.)
src/ConfigParser.{h,cxx} Parses config files including Parallel blocks, size strings, plugin tasks
src/ResourceBudget.{h,cxx} Tracks and enforces memory/GPU/worker constraints
src/ParallelScheduler.{h,cxx} Fork-based concurrent dispatch with signal handling and cleanup
tests/ 67 Catch2 unit tests covering parser, budget, and scheduler
fuzz/ 4 libFuzzer harnesses with seed corpus for parse_size, parse_config, parse_plugin_task, and resource_budget

Testing

  • 67/67 unit tests passing (Catch2)
  • Fuzz testing with libFuzzer + ASan/UBSan — found and fixed one crash in malformed option parsing
  • Memory leak testing with AddressSanitizer/LeakSanitizer — zero findings

Test plan

  • Review config parser behavior with existing PluMA pipeline files (backward compatibility)
  • Integration test with actual PluMA plugins in parallel blocks
  • Performance benchmarking with real bioinformatics workloads
  • Test on multi-GPU systems for GPU slot scheduling
  • Wire ConfigParser and ParallelScheduler into src/PluMA.cxx main loop

Made with Cursor

@quinnjr quinnjr force-pushed the feature/parallel-execution branch from ef26e38 to e4a8bdd Compare March 27, 2026 18:08
…scheduling

Introduces explicit Parallel/EndParallel blocks in pipeline config files
to run independent plugins concurrently via fork()-based process isolation.

Components:
- ConfigParser: parses Parallel blocks with workers/memory/gpu/fail options
- ResourceBudget: tracks memory, GPU, and worker slot allocation
- ParallelScheduler: fork-based dispatch with fail-fast/continue modes
- Unit tests (Catch2): 67 tests covering parser, budget, and scheduler
- Fuzz targets (libFuzzer): parse_size, parse_config, parse_plugin_task,
  resource_budget with seed corpus

Made-with: Cursor
@quinnjr quinnjr force-pushed the feature/parallel-execution branch 2 times, most recently from 10a9951 to 8546ecf Compare May 14, 2026 16:15
@movingpictures83 movingpictures83 merged commit ba09863 into FIUBioRG:master May 14, 2026
@quinnjr quinnjr deleted the feature/parallel-execution branch May 14, 2026 23:37
quinnjr added a commit to quinnjr/PluMA that referenced this pull request May 21, 2026
Brings the windows-support work onto current master (post PRs FIUBioRG#7, FIUBioRG#8,
FIUBioRG#10, FIUBioRG#11, FIUBioRG#13) and reconciles the build configuration. The branch was
originally cut from 819d31a, before the SConstruct refactor and the
Rust / parallel / venv / build-fix series merged; a direct rebase
would have rewritten history beyond recognition, so we instead merge
master in and re-apply the windows-specific additions on top of the
refactored build files.

Resolution strategy:
- SConstruct, build_config.py, build_support.py: take master's
  post-refactor versions wholesale, then layer the windows-only
  additions on top.
- All other files (the Rust loader, the parallel scheduler, the
  Catch2 tests, the fuzz harness) merge cleanly from master with no
  intervention.

Windows-specific additions preserved:
- build_config.py gains is_msvc / is_mingw toolchain detection
  (alongside the is_windows / is_darwin / is_linux / is_alpine flags
  master already defines), an is_unix convenience flag, and
  platform-specific shared_lib_ext / shared_lib_prefix /
  executable_ext / path_separator constants. Windows overrides
  lib_search_path and include_search_path because the /lib +
  /usr/lib + /usr/local/lib convention doesn't apply.
- SConstruct's get_platform_config() picks up Windows /
  MSVC / MinGW branches that set PLUMA_PLATFORM_WINDOWS,
  WIN32_LEAN_AND_MEAN, and NOMINMAX defines (so src/platform.h
  selects the LoadLibrary / GetProcAddress code path) and, for
  MinGW, --export-all-symbols + psapi.
- create_base_environment() splits CCFLAGS / CXXFLAGS into MSVC
  (/EHsc /utf-8 /O2) and gcc-style branches.
- src/platform.h is preserved from the original branch and used by
  src/main.cxx and the language loaders to abstract dlopen / glob /
  pthread away from POSIX-specific includes.

Verified on Linux: clean scons build with --with-rust still produces
a pluma binary that imports dlsym (HAVE_RUST wiring intact); the
binary has all the upstream PRs' contributions present.
quinnjr added a commit to quinnjr/PluMA that referenced this pull request May 21, 2026
…-julia

Brings the Julia support work onto current master (post PRs FIUBioRG#7, FIUBioRG#8, FIUBioRG#10,
FIUBioRG#11, FIUBioRG#13) and makes Julia strictly opt-in via a new --with-julia
SConstruct flag.

Resolution strategy:
- SConstruct, build_support.py, src/PluGen/{main.cxx,README},
  src/PluginManager.h: take master's post-refactor versions, then layer
  Julia-specific additions on top.
- src/languages/Julia.{cxx,h} and src/PluGen/JuliaPluginGenerator.{cxx,h}
  merge cleanly with no intervention (they did not exist on master).
- Everything else (Rust loader, parallel scheduler, plugin venv, Catch2
  tests, fuzz harness) merges cleanly from master.

Feature-flag gating (new behavior):
- New SConstruct option `--with-julia` (default: False) added to OPTIONS.
- configure_julia() runs only when the flag is set; it calls
  detect_julia_config() and, on success, appends CPPPATH, LIBPATH,
  -ljulia, and the HAVE_JULIA preprocessor define. On failure
  (libjulia not found despite the flag), it logs a warning and the
  build continues without Julia rather than aborting.
- env["JULIA_ENABLED"] is set from configure_julia()'s return value;
  build_main_executable() appends "julia" to program_libs only when
  JULIA_ENABLED is True.
- src/PluginManager.h gains an `#ifdef HAVE_JULIA` block that registers
  the Julia language driver, matching the existing HAVE_JAVA / HAVE_RUST
  pattern.
- The default `scons` invocation (no flag) does NOT require libjulia
  to be installed: Julia.cxx and Julia.h are already #ifdef HAVE_JULIA
  guarded internally, so the file compiles to a no-op stub.

Julia detection layer (build_support.py):
- New JuliaConfig dataclass parallel to the existing JavaConfig.
- detect_julia_config() resolution order: $JULIA_HOME, then
  `julia -e 'print(Sys.BINDIR)'`, then a small list of fallback paths
  for Arch / Debian / Homebrew / official-binary installs.
- CheckJulia() SCons Configure test.

Verified on Linux without --with-julia: scons builds pluma cleanly,
the binary links against the existing language libs (-lpython /
-lperl / -lR / -lRInside / -ljvm) but NOT -ljulia; Julia.cxx is
compiled as a no-op stub. With --with-julia and libjulia installed,
the binary additionally links -ljulia and registers the Julia driver
in PluginManager.
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.

2 participants