Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timing Statistics Object #611

Closed
ingu119 opened this issue Oct 18, 2022 · 1 comment
Closed

Timing Statistics Object #611

ingu119 opened this issue Oct 18, 2022 · 1 comment

Comments

@ingu119
Copy link

ingu119 commented Oct 18, 2022

Hello,
I would like to get the required CPU time in the function TNLP::finalize_solution. Did I understand the changelog correctly that it should be possible via the command ip_data->TimingStats().OverallAlgorithm().StartCpuTime() in the new version (instead of ip_data->cpu_time_start())?
There I run into the problem that IpoptData::TimingStats is not a const function, but the pointer ip_data in finalize_solution is const.
Did I misunderstand something or would it be possible to provide a const function TimingStatistics& TimingStats() const?

Thanks in advance for your help.

svigerske added a commit that referenced this issue Oct 19, 2022
@svigerske
Copy link
Member

svigerske commented Oct 19, 2022

StartCpuTime() (or ip_data->cpu_time_start()) gives the time when Ipopt started. To get the elapsed time, use CpuTime() - ipdata->TimingStats().OverallAlgorithm().StartCpuTime(), where CpuTime() is declared in IpUtils.hpp.

That a const variant of TimingStats() was missing is indeed an oversight.
I added this now on the default branch (stable/3.14).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants