| 4411 | } |
| 4412 | |
| 4413 | void HighsProfiling::stop(const HighsInt profiling_clock) { |
| 4414 | assert(profiling_clock >= 0); |
| 4415 | if (profiling_clock >= this->num_profiling_clock_) return; |
| 4416 | // For a sub-MIP, don't start the clock for anything but a |
| 4417 | // sub-solver |
| 4418 | if (this->isSubMip() && profiling_clock >= kToSubSolver) return; |
| 4419 | HighsInt thread = this->myThread(); |
| 4420 | HighsProfilingRecord* thread_record = this->getHighsProfilingRecord(); |
| 4421 | double time_stop = timer->read(); |
| 4422 | double time_start = thread_record->start_time[profiling_clock]; |
| 4423 | const bool clock_running = std::signbit(time_start); |
| 4424 | if (!clock_running) { |
| 4425 | // Check for stopping a clock that's currently stopped |
| 4426 | printf( |
| 4427 | "HighsProfiling: clock not running for thread %d when stopping clock " |
| 4428 | "%d (%s) \n", |
| 4429 | int(thread), int(profiling_clock), this->name[profiling_clock].c_str()); |
| 4430 | assert(clock_running); |
| 4431 | } else { |
| 4432 | thread_record->num_call[profiling_clock]++; |
| 4433 | thread_record->run_time[profiling_clock] += (time_stop + time_start); |
| 4434 | } |
| 4435 | thread_record->start_time[profiling_clock] = time_stop; |
| 4436 | } |
| 4437 | |
| 4438 | double HighsProfiling::read(const HighsInt profiling_clock, |
| 4439 | const HighsInt record_type) { |
no test coverage detected