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

Profiling code slows runtime (CpuTime getrusage) #299

Closed
svigerske opened this issue Jan 29, 2019 · 2 comments
Closed

Profiling code slows runtime (CpuTime getrusage) #299

svigerske opened this issue Jan 29, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@svigerske
Copy link
Member

Issue created by migration from Trac.

Original creator: bdavis

Original creation time: 2018-02-28 20:13:17

Assignee: ipopt-team

Version: 3.12

I am running Ipopt on MacOS Sierra built with clang. I am using the Matlab Interface on 2017a.
My problem order is low (2 variables, no constraints), but I need to run many times with different input.

I ran a profile with Instruments and found that a large amount of time was spent in the getrusage system call. This happens in IpUtils.cpp CpuTime() and SysTime().

My hack solution (attached) was to add a compiler define around this to bypass the calling of getrusage and simply return zero for the profile times. This improved my runtime by about 33%.

I wish there was a more elegant solution to this (an option?) that could be configured at runtime.

@svigerske
Copy link
Member Author

Comment by bdavis created at 2018-02-28 20:16:19

I was unable to attach my file as it was flagged as spam :-(

svigerske added a commit that referenced this issue Apr 7, 2021
- measure time via system calls can take a lot of time if done very often
- for #299
@svigerske
Copy link
Member Author

With Ipopt 3.14, detailed timing statistics are no longer recorded by default. If no timelimit is set, then there are calls to CpuTime(), SysTime(), WallTime() only at the begin and end of the Ipopt run (so it can report the overall runtime). If a timelimit is set, then there are additional calls at every iteration, but still this is much less than the previous behavior that recorded the time spend in various components of Ipopt and function evaluations.
There are options to reenable the detailed timing.

svigerske added a commit that referenced this issue May 15, 2021
- because some components measure initialization time
- more for #299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant