50#include <asio/thread_pool.hpp>
57#include <unordered_map>
60namespace neograph::graph {
83 using RetryPolicyLookup = std::function<
RetryPolicy(
const std::string&)>;
100 const std::map<std::string, std::unique_ptr<GraphNode>>& nodes,
101 const std::vector<ChannelDef>& channel_defs,
102 RetryPolicyLookup retry_policy_for,
103 asio::thread_pool* fan_out_pool =
nullptr,
122 const std::string& node_name,
125 const std::unordered_map<std::string, NodeResult>& replay,
127 const std::string& parent_cp_id,
129 std::vector<std::string>& trace,
145 const std::string& node_name,
170 const std::vector<std::string>& ready,
173 const std::unordered_map<std::string, NodeResult>& replay,
175 const std::string& parent_cp_id,
177 std::vector<std::string>& trace,
200 const std::vector<Send>& sends,
203 const std::unordered_map<std::string, NodeResult>& replay,
205 const std::string& parent_cp_id,
206 std::vector<std::string>& trace,
218 void apply_input(
GraphState& state,
const json& input)
const;
229 void maybe_warn_serial_fanout(std::size_t width)
const;
231 const std::map<std::string, std::unique_ptr<GraphNode>>& nodes_;
232 const std::vector<ChannelDef>& channel_defs_;
233 RetryPolicyLookup retry_policy_for_;
234 asio::thread_pool* fan_out_pool_ =
nullptr;
236 mutable std::atomic<bool> warned_serial_fanout_{
false};
NEOGRAPH_API export/import macro for shared-library builds.
Per-run coordinator for checkpoint lifecycle operations.
Thread-safe container for all graph state channels.
Stateless-per-call node invocation dispatcher.
NodeExecutor(const std::map< std::string, std::unique_ptr< GraphNode > > &nodes, const std::vector< ChannelDef > &channel_defs, RetryPolicyLookup retry_policy_for, asio::thread_pool *fan_out_pool=nullptr, NodeCache *node_cache=nullptr)
asio::awaitable< NodeResult > run_one_async(const std::string &node_name, int step, GraphState &state, const std::unordered_map< std::string, NodeResult > &replay, CheckpointCoordinator &coord, const std::string &parent_cp_id, const BarrierState &barrier_state, std::vector< std::string > &trace, const GraphStreamCallback &cb, StreamMode stream_mode, const RunContext &ctx)
Execute a single node in the current super-step.
asio::awaitable< std::vector< NodeResult > > run_parallel_async(const std::vector< std::string > &ready, int step, GraphState &state, const std::unordered_map< std::string, NodeResult > &replay, CheckpointCoordinator &coord, const std::string &parent_cp_id, const BarrierState &barrier_state, std::vector< std::string > &trace, const GraphStreamCallback &cb, StreamMode stream_mode, const RunContext &ctx)
Execute all ready nodes concurrently via asio::experimental::make_parallel_group + wait_for_all.
asio::awaitable< std::vector< StepRouting > > run_sends_async(const std::vector< Send > &sends, int step, GraphState &state, const std::unordered_map< std::string, NodeResult > &replay, CheckpointCoordinator &coord, const std::string &parent_cp_id, std::vector< std::string > &trace, const GraphStreamCallback &cb, StreamMode stream_mode, const RunContext &ctx)
Execute a list of Send requests accumulated this step.
asio::awaitable< NodeResult > execute_node_with_retry_async(const std::string &node_name, GraphState &state, const GraphStreamCallback &cb, StreamMode stream_mode, const RunContext &ctx)
Inner retry loop with exponential backoff + NodeInterrupt short-circuit.
Pure JSON-definition → CompiledGraph parser, extracted from GraphEngine.
CheckpointCoordinator — owns the super-step checkpoint lifecycle.
Graph engine type definitions: channels, edges, nodes, events, and control flow.
std::function< void(const GraphEvent &)> GraphStreamCallback
Callback for receiving graph execution events.
StreamMode
Bitfield flags for selecting which events to stream during execution.
Graph node implementations: base class and built-in node types.
Per-node result cache (opt-in).
Pure routing / next-step-planning logic extracted from GraphEngine.
std::map< std::string, std::set< std::string > > BarrierState
Per-barrier signal bookkeeping.
Retry policy for node execution with exponential backoff.
Per-run dispatch metadata threaded through the engine and executor.