@@ -141,31 +141,14 @@ void HybridPackedFormatHandler::assembleChild(Int child_sn,
141141
142142 bool parallel = S_->parTree () || S_->parNode ();
143143
144- if (parallel && child_clique_size > kParallelAssemblyThresh ) {
145- // The loop over the columns of the child clique has completely independent
146- // iterations. The loop is split evenly among the available threads.
147-
148- TaskGroupSpecial tg;
149- const Int threads = highs::parallel::num_threads ();
150- const double ops_per_thread =
151- (double )child_clique_size * (child_clique_size + 1 ) / 2 / threads;
152- double ops_current = 0 ;
153- Int next_col = 0 ;
154- for (Int last_col = 0 ; last_col < child_clique_size; ++last_col) {
155- ops_current += child_clique_size - last_col;
156-
157- if (ops_current > ops_per_thread || last_col == child_clique_size - 1 ) {
158- tg.spawn ([=]() {
159- for (Int col = next_col; col <= last_col; ++col) {
144+ if (parallel) {
145+ highs::parallel::for_each (
146+ 0 , child_clique_size,
147+ [=](Int start, Int end) {
148+ for (Int col = start; col < end; ++col)
160149 assembleChildSingleCol (child_sn, child, child_clique_size, col);
161- }
162- });
163- next_col = last_col + 1 ;
164- ops_current = 0 ;
165- }
166- }
167- tg.taskWait ();
168-
150+ },
151+ kParallelAssemblyThresh );
169152 } else {
170153 for (Int col = 0 ; col < child_clique_size; ++col)
171154 assembleChildSingleCol (child_sn, child, child_clique_size, col);
0 commit comments