coin-or / CHiPPS-ALPS

This is the Abstract Library for Parallel Search (ALPS), the abstract base layer of the COIN-OR High Performance Parallel Search framework.
Eclipse Public License 1.0
9 stars 8 forks source link

wallclock time #2

Closed kibaekkim closed 4 years ago

kibaekkim commented 7 years ago

AlpsWallClock() does not return the correct wall clock time (without MPI) on Mac. I do not understand the implementation of the function. Is there any reason for this implementation, not using CoinGetTimeOfDay()?

tkralphs commented 7 years ago

It looks like the implementation of AlpsWallClock should be a true wall clock time for Windows, but for any other OS, it should be the CPU time of the process. I guess the naming is a bit misleading, but CPU time is what you really want in most cases when the program is sequential. The difference between wall clock and CPU on Linux should be minimal unless something else is running on the machine that slows down the process.

When you say it's not returning the correct time on Mac, is it way off? What is happening specifically? I haven't really tested on Mac, although I have a Mac available.

kibaekkim commented 7 years ago

The time is way off. For example, I called my solver that uses Alps in Julia. Alps measured 627 seconds, whereas Julia did 117 seconds. My solver processes each node in parallel with multiple cores (using OpenMP).

Alps0278I Search wall-clock time: 627.12 seconds
117.298107 seconds (7.95 M allocations: 812.961 MB, 0.23% gc time)

I got the right wall-clock time when I use CoinGetTimeOfDay() as in my fork. And the timing results were

Alps0278I Search wall-clock time: 109.84 seconds
114.173550 seconds (7.98 M allocations: 814.823 MB, 0.22% gc time)

I can make a pull request for this with my fork.

tkralphs commented 7 years ago

Right, yes, that's because in shared memory parallel, it's reporting the sum of the CPU of all cores. You can submit a pull request, although the project is still being managed in SVN (this will hopefully change soon), so I'll have to just turn the pull request into a patch and commit it to SVN.

tkralphs commented 4 years ago

This should be fixed by 2c2bc54a3bc5472931d1760d236cfda33a553302.