#include <gtopt/work_pool.hpp>
template<typename Key = int64_t>
BasicTaskRequirements struct
Task requirements with a generic priority key.
| Template parameters | |
|---|---|
| Key | The type of the secondary sort key. Must be default- constructible and equality-comparable. The default is int64_t for backward compatibility. |
When two tasks share the same TaskPriority, the pool dequeues them according to KeyCompare(key1, key2) (see BasicWorkPool): by default the task with the smaller key runs first.
Public types
- using key_type = Key
Public variables
- std::chrono::milliseconds estimated_duration
- int estimated_threads
- bool gate_bypass
- std::optional<std::string> name
- TaskPriority priority
- Key priority_key
- ResourceClass resource_class
Variable documentation
template<typename Key>
bool gtopt:: BasicTaskRequirements<Key>:: gate_bypass
Admission flag, fully decoupled from ordering. When true, the task may be dispatched even when physical CPU load is at/above the pool's saturation threshold (it gets the same max_cpu_threshold_ + 5 % relaxation TaskPriority::High used to grant). This splits the "bypass the CPU gate" intent off TaskPriority so a task can order LOW (by its priority_key) yet still bypass the gate — dissolving the SDDP sim⇄wedge trap where High was used only for gate-bypass but also reordered ahead of every same-iteration training task.
template<typename Key>
Key gtopt:: BasicTaskRequirements<Key>:: priority_key
Sort key. With the default std::less<Key> comparator on the pool, the task with the smaller key is dequeued first. This key is the SOLE ordering criterion (see Task::operator<): TaskPriority no longer participates in queue ordering — it only controls the dispatch gate (Critical relaxes the memory/CPU gates).
template<typename Key>
ResourceClass gtopt:: BasicTaskRequirements<Key>:: resource_class
Dominant resource of the task. cpu (default) keeps today's behaviour. gpu additionally gates dispatch on the process-global GPU token bucket (ResourceGovernor) so GPU-backed solves (cuOpt) never fan out to cpu_factor x cores concurrency — in Default compute mode the device time-slices contexts, so oversubscription buys no throughput and risks VRAM OOM. Stamped by SolverTier from the backend's declared SolverResourceDescriptor.