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

Merge CPUTime into JuliaLang #1

Closed
zouhairm opened this issue Mar 8, 2015 · 5 comments
Closed

Merge CPUTime into JuliaLang #1

zouhairm opened this issue Mar 8, 2015 · 5 comments

Comments

@zouhairm
Copy link

zouhairm commented Mar 8, 2015

This pretty useful. It would be nice to have it as part of the master branch.

@schmrlng
Copy link
Owner

schmrlng commented Mar 9, 2015

I'm hesitant to do this as modern linear algebra libraries (OpenBLAS) have really good support for multi-threading, and this can lead to incorrect conclusions being drawn about timing since CPU time is summed across all child threads of a process:

julia> n = 1000; A = rand(n,n); B = rand(n,n);
julia> @time @CPUtime C = A*B;     # matrix multiplication on a quad-core i7
elapsed CPU time: 0.178905 seconds
elapsed time: 0.045403309 seconds (8000488 bytes allocated)

See also JuliaLang/julia#10157. It might seem that a possible resolution would be counting only the CPU time used by the top-level process, but that can also be misleading - in this case it's probably 0. For multi-core machines, I still don't know a good way to reliably benchmark code when you've got other stuff going on in the background (the motivation of this package in the first place: http://stackoverflow.com/questions/24427185/measuring-elapsed-cpu-time-in-julia/). Oh well.

So unless you're running single-threaded code (scientific computing without any linear algebra??), the utility of this package is sort of nebulous, which is why I haven't bothered trying to register it with the Julia package manager. Putting it in Julia master would probably do more harm than help.

@zouhairm
Copy link
Author

zouhairm commented Mar 9, 2015

sounds reasonable. It might not be useful in the general sense, but definitely useful for the single threaded case.

But I understand what you mean about potentially doing more harm.

@mykelk
Copy link

mykelk commented Mar 10, 2015

Might be nice to have registered on METADATA.jl so people can just do Pkg.add("CPUTime").

@schmrlng
Copy link
Owner

Fine fine, but caveat emptor.

@chriselrod
Copy link

since CPU time is summed across all child threads of a process

FWIW, I searched for a CPU time Julia library because this is the behavior I wanted (and expected from a "CPUTime").

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

4 participants