Skip to content

Commit 3f266b7

Browse files
committed
More timing
1 parent 2dc2b85 commit 3f266b7

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

highs/ipm/hipo/factorhighs/DataCollector.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,21 @@ void DataCollector::printTimes(const Log& log) const {
182182
<< fix(times[kTimeDenseFact_convert], 8, 4) << "\n";
183183
log_stream << "\t\tpivoting: "
184184
<< fix(times[kTimeDenseFact_pivoting], 8, 4) << "\n";
185+
log_stream << "\tResize: "
186+
<< fix(times[kTimeFactoriseResize], 8, 4) << " ("
187+
<< fix(times[kTimeFactoriseResize] / times[kTimeFactorise] * 100,
188+
4, 1)
189+
<< "%)\n";
190+
log_stream << "\tMove: "
191+
<< fix(times[kTimeFactoriseMove], 8, 4) << " ("
192+
<< fix(times[kTimeFactoriseMove] / times[kTimeFactorise] * 100, 4,
193+
1)
194+
<< "%)\n";
195+
log_stream << "\tProcess: "
196+
<< fix(times[kTimeFactoriseProcess], 8, 4) << " ("
197+
<< fix(times[kTimeFactoriseProcess] / times[kTimeFactorise] * 100,
198+
4, 1)
199+
<< "%)\n";
185200
#endif
186201

187202
log_stream << "----------------------------------------------------\n";

highs/ipm/hipo/factorhighs/Factorise.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ bool Factorise::run(Numeric& num) {
401401
Clock clock;
402402
#endif
403403

404-
TaskGroupSpecial tg;
404+
#if HIPO_TIMING_LEVEL >= 2
405+
Clock clock2;
406+
#endif
405407

406408
total_reg_.assign(n_, 0.0);
407409

@@ -414,7 +416,12 @@ bool Factorise::run(Numeric& num) {
414416
// the memory of previous factorisations.
415417
sn_columns_.resize(S_.sn());
416418

419+
#if HIPO_TIMING_LEVEL >= 2
420+
data_.sumTime(kTimeFactoriseResize, clock2.stop());
421+
#endif
422+
417423
if (S_.parTree()) {
424+
TaskGroupSpecial tg;
418425
Int spawned_roots{};
419426
// spawn tasks for root supernodes
420427
for (Int sn = 0; sn < S_.sn(); ++sn) {
@@ -427,18 +434,33 @@ bool Factorise::run(Numeric& num) {
427434
// sync tasks for root supernodes
428435
tg.taskWait();
429436
} else {
437+
#if HIPO_TIMING_LEVEL >= 2
438+
clock2.start();
439+
#endif
430440
// processing the tree in serial requires a CliqueStack
431441
if (!stack_) return true;
432442
if (stack_->empty()) stack_->init(S_.maxStackSize());
443+
#if HIPO_TIMING_LEVEL >= 2
444+
data_.sumTime(kTimeFactoriseResize, clock2.stop());
445+
#endif
433446

447+
#if HIPO_TIMING_LEVEL >= 2
448+
clock2.start();
449+
#endif
434450
// go through each supernode serially
435451
for (Int sn = 0; sn < S_.sn(); ++sn) {
436452
processSupernode(sn);
437453
}
454+
#if HIPO_TIMING_LEVEL >= 2
455+
data_.sumTime(kTimeFactoriseProcess, clock2.stop());
456+
#endif
438457
}
439458

440459
if (flag_stop_) return true;
441460

461+
#if HIPO_TIMING_LEVEL >= 2
462+
clock2.start();
463+
#endif
442464
// move factorisation to numerical object
443465
num.S_ = &S_;
444466
num.sn_columns_ = &sn_columns_;
@@ -447,6 +469,10 @@ bool Factorise::run(Numeric& num) {
447469
num.pivot_2x2_ = std::move(pivot_2x2_);
448470
num.data_ = &data_;
449471

472+
#if HIPO_TIMING_LEVEL >= 2
473+
data_.sumTime(kTimeFactoriseMove, clock2.stop());
474+
#endif
475+
450476
#if HIPO_TIMING_LEVEL >= 1
451477
data_.sumTime(kTimeFactorise, clock.stop());
452478
#endif

highs/ipm/hipo/factorhighs/Timing.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ enum TimeItems {
2424
kTimeDenseFact_convert, // TIMING_LEVEL 2
2525
kTimeDenseFact_pivoting, // TIMING_LEVEL 2
2626
kTimeFactoriseTerminate, // TIMING_LEVEL 2
27+
kTimeFactoriseResize,
28+
kTimeFactoriseMove,
29+
kTimeFactoriseProcess,
2730
kTimeSolve, // TIMING_LEVEL 1
2831
kTimeSolvePrepare, // TIMING_LEVEL 2
2932
kTimeSolveSolve, // TIMING_LEVEL 2

0 commit comments

Comments
 (0)