TeamSPoon / reorder_task

A parallelization library for normally non-parallizable code

Repository from Github https://github.comTeamSPoon/reorder_taskRepository from Github https://github.comTeamSPoon/reorder_task

Task Executor and Sync System (Prolog + Python + MeTTa)

This system provides a multi-threaded, constraint-aware task execution and scheduling engine built with SWI-Prolog, extended by Python tools and MeTTa integration for flexible pipeline-based AI planning.

βœ… Quick Start

  1. Activate the development environment:
   ./from_venv.sh

Or, if you want to keep your shell:

source ./from_venv.sh
  1. Run the full pipeline (example):

    ./run_pipeline.sh
  2. Load core modules in Prolog:

    ?- [prolog/reorder_executor, prolog/reorder_task_static, prolog/threaded_attvar].
  3. Run tests:

    ?- [prolog/run_tests], run_tests.

πŸ”— Key Files and Modules

🧠 Core Logic

πŸ§ͺ Tests

  • test/ – Full test suite for executors, annotations, DAGs, and sync logic

🐍 Python Integration

πŸ“„ Examples

🧰 Dev Utilities

  • from_venv.sh – Smart virtualenv setup (detects shell, installs deps, symlinks pack)
  • Makefile – Common targets for building, running, and testing
  • run_pipeline.sh – Launch pipeline logic end-to-end

πŸ“˜ Documentation


🧠 Supported Execution Strategies

Mode Threads Dynamic Shared Vars Best Use Case
run_static_sequential/3 ❌ ❌ ❌ Deterministic, step-by-step
run_static_parallel/3 βœ… ❌ ⚠ Independent tasks, no var sharing
run_dynamic_ready_loop/3 βœ… βœ… βœ… Tasks become ready at runtime
run_dynamic_parallel_ready/3 βœ… βœ… βœ… Parallel with full readiness + sync

πŸ’‘ Notes

  • Requires SWI-Prolog β‰₯ 8.2
  • Automatically symlinks the local folder as a SWI-Prolog pack
  • Compatible with .env for configuration
  • .venv/ is created automatically by from_venv.sh if missing

For detailed developer usage, see WALKTHROUGH.md. See AGENTS.md for how agents (human or AI) coordinate work and document reasoning.

About

A parallelization library for normally non-parallizable code


Languages

Language:Prolog 92.8%Language:Python 3.9%Language:HTML 1.5%Language:Shell 1.3%Language:Makefile 0.4%