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

Method initialize

highs/lp_data/HighsInterface.cpp:4287–4339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4285}
4286
4287void HighsProfiling::initialize(HighsTimer& timer_, const bool sub_solver,
4288 const bool mip) {
4289 // NB this->multi_threaded is set externally:
4290 //
4291 // * true in HighsProfiling::clear()
4292 //
4293 // * false in initializeSingleThreadedProfiling
4294 //
4295 // Hence don't call this->clear() here!
4296 this->timer = &timer_;
4297 this->num_profiling_clock_ = kToPresolveSolvePostsolve;
4298 this->name.assign(this->num_profiling_clock_, "");
4299 this->name[kPresolveTime] = "Presolve";
4300 this->name[kSolveTime] = "Solve";
4301 this->name[kPostsolveTime] = "Postsolve";
4302 // Now add clocks if performing subsolver profiling
4303 this->sub_solver_ = sub_solver;
4304 if (this->sub_solver_) {
4305 this->num_profiling_clock_ = kToSubSolver;
4306 this->name.resize(this->num_profiling_clock_);
4307 this->name[kSubSolverDuSimplexBasis] = "Du simplex (basis)";
4308 this->name[kSubSolverDuSimplexNoBasis] = "Du simplex (no basis)";
4309 this->name[kSubSolverPrSimplexBasis] = "Pr simplex (basis)";
4310 this->name[kSubSolverPrSimplexNoBasis] = "Pr simplex (no basis)";
4311 this->name[kSubSolverHipo] = "HiPO";
4312 this->name[kSubSolverIpx] = "IPX";
4313 this->name[kSubSolverHipoAc] = "HiPO (AC)";
4314 this->name[kSubSolverIpxAc] = "IPX (AC)";
4315 this->name[kSubSolverPdlp] = "PDLP";
4316 this->name[kSubSolverQpAsm] = "QP ASM";
4317 this->name[kSubSolverMip] = "MIP";
4318 this->name[kSubSolverSubMip] = "Sub-MIP";
4319 }
4320 // Now add clocks if also performing MIP profiling
4321 // Cannot perform MIP profiling without subsolver profiling
4322 if (mip) assert(sub_solver);
4323 this->mip_ = sub_solver && mip;
4324 if (this->mip_) {
4325 this->num_profiling_clock_ = kToMipClock;
4326 this->name.resize(this->num_profiling_clock_);
4327 initialiseMipProfilingNames(this->name);
4328 }
4329 HighsProfilingRecord thread_record;
4330 thread_record.num_call.assign(this->num_profiling_clock_, 0);
4331 thread_record.run_time.assign(this->num_profiling_clock_, 0);
4332 thread_record.start_time.assign(this->num_profiling_clock_, 1);
4333 HighsInt num_thread = this->numThread();
4334 assert(num_thread > 0);
4335 this->submip.assign(num_thread, false);
4336 this->record.assign(num_thread, thread_record);
4337 this->submip_record.assign(num_thread, thread_record);
4338 this->initialized = true;
4339}
4340
4341void HighsProfiling::clear() {
4342 this->timer = nullptr;

Callers 1

initializeProfilingMethod · 0.45

Calls 3

numThreadMethod · 0.95
resizeMethod · 0.45

Tested by

no test coverage detected