MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / runTask

Method runTask

highs/mip/HighsMipSolver.cpp:75–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74template <class F>
75void HighsMipSolver::runTask(F&& f, highs::parallel::TaskGroup& tg,
76 bool parallel_lock, bool force_serial,
77 const std::vector<HighsInt>& indices) {
78 if (indices.empty()) return;
79 setParallelLock(parallel_lock);
80 const bool spawn_tasks = !force_serial && indices.size() > 1 &&
81 !options_mip_->mip_search_simulate_concurrency;
82 for (HighsInt i : indices) {
83 if (spawn_tasks) {
84 tg.spawn([&f, i] { f(i); });
85 } else {
86 f(i);
87 }
88 }
89 if (spawn_tasks) {
90 tg.taskWait();
91 }
92 setParallelLock(false);
93}
94
95void HighsMipSolver::run() {
96 modelstatus_ = HighsModelStatus::kNotset;

Callers

nothing calls this directly

Calls 4

spawnMethod · 0.80
taskWaitMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected