| 4378 | } |
| 4379 | |
| 4380 | void HighsProfiling::start(const HighsInt profiling_clock, const bool restart) { |
| 4381 | assert(profiling_clock >= 0); |
| 4382 | if (profiling_clock >= this->num_profiling_clock_) return; |
| 4383 | // For a sub-MIP, don't start the clock for anything but a |
| 4384 | // sub-solver |
| 4385 | if (this->isSubMip() && profiling_clock >= kToSubSolver) return; |
| 4386 | // Start timing sub-solver profiling_clock |
| 4387 | HighsInt thread = this->myThread(); |
| 4388 | HighsProfilingRecord* thread_record = this->getHighsProfilingRecord(); |
| 4389 | double time_start = timer->read(); |
| 4390 | |
| 4391 | if (profiling_clock == kMipClockSubMipSolve) { |
| 4392 | printf("HighsProfiling::start SubMipSolve on thread %2d with submip = %s\n", |
| 4393 | int(thread), this->submip[thread] ? "T" : "F"); |
| 4394 | } |
| 4395 | const bool clock_running = |
| 4396 | std::signbit(thread_record->start_time[profiling_clock]); |
| 4397 | if (clock_running && profiling_clock != kSubSolverHipoAc && |
| 4398 | profiling_clock != kSubSolverIpxAc) { |
| 4399 | // Check for starting a clock that's currently running - except |
| 4400 | // for analytic centre calculation that may by stopped by |
| 4401 | // terminating the task |
| 4402 | printf( |
| 4403 | "HighsProfiling: clock running for thread %d when starting clock %d " |
| 4404 | "(%s) and subMip = %s\n", |
| 4405 | int(thread), int(profiling_clock), this->name[profiling_clock].c_str(), |
| 4406 | this->submip[thread] ? "T" : "F"); |
| 4407 | assert(!clock_running); |
| 4408 | } |
| 4409 | thread_record->start_time[profiling_clock] = -time_start; |
| 4410 | if (restart) thread_record->num_call[profiling_clock]--; |
| 4411 | } |
| 4412 | |
| 4413 | void HighsProfiling::stop(const HighsInt profiling_clock) { |
| 4414 | assert(profiling_clock >= 0); |
no test coverage detected