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

Benchmarks produce exceptions on 32bits OS #1003

Open
fccm opened this issue Jan 17, 2021 · 8 comments
Open

Benchmarks produce exceptions on 32bits OS #1003

fccm opened this issue Jan 17, 2021 · 8 comments

Comments

@fccm
Copy link
Member

fccm commented Jan 17, 2021

$ make bench
ocamlbuild -no-links -use-ocamlfind src/batteries.cma src/batteriesHelp.cmo src/batteriesThread.cma META src/batteries.cmxs src/batteriesThread.cmxs benchsuite/bench_int.native benchsuite/flip.native benchsuite/deque.native benchsuite/lines_of.native benchsuite/bitset.native benchsuite/bench_map.native benchsuite/bench_nreplace.native
Finished, 0 targets (0 cached) in 00:00:00.
Finished, 557 targets (526 cached) in 00:00:05.
rm -f bench.log
_build/benchsuite/bench_int.native | tee -a bench.log;   _build/benchsuite/flip.native | tee -a bench.log;   _build/benchsuite/deque.native | tee -a bench.log;   _build/benchsuite/lines_of.native | tee -a bench.log;   _build/benchsuite/bitset.native | tee -a bench.log;   _build/benchsuite/bench_map.native | tee -a bench.log;   _build/benchsuite/bench_nreplace.native | tee -a bench.log; 
Measuring: System Clock
Warming up
Fatal error: exception Invalid_argument("Array.make")
Estimating clock resolutionMeasuring: System Clock
Warming up
Estimating clock resolutionFatal error: exception Invalid_argument("Array.make")
Measuring: System Clock
Warming up
Fatal error: exception Invalid_argument("Array.make")
Estimating clock resolutionMeasuring: System Clock
Warming up
Estimating clock resolutionFatal error: exception Invalid_argument("Array.make")
Measuring: System Clock
Warming up
Estimating clock resolutionFatal error: exception Invalid_argument("Array.make")
Test with small maps (length = 500)
Fatal error: exception File "benchsuite/bench_map.ml", line 172, characters 4-10: Assertion failed
1000 iterations
Measuring: System Clock
Warming up
Estimating clock resolutionFatal error: exception Invalid_argument("Array.make")
Benchmarking results are written to bench.log
@UnixJunkie
Copy link
Member

Here is one of the problems with having tons of code "hanging around".
They also have a maintainance cost.
If you can send a PR to correct those, it should be merged.

@fccm fccm self-assigned this Jan 18, 2021
@fccm
Copy link
Member Author

fccm commented Jan 18, 2021

I know what maintaining means :)
I assigned this issue to me ;)
I think this is probably something simple like the max-length of arrays that are smaller on a 32bit OS.

@gasche
Copy link
Member

gasche commented Jan 30, 2021

I cannot reproduce this on my machine.

(I vaguely remember @UnixJunkie suggesting that you are using a 32bit system, could this be related?)

There is one anomaly in the log that I can reproduce:

Fatal error: exception File "benchsuite/bench_map.ml", line 172, characters 4-10: Assertion failed

I will look into this.

@gasche
Copy link
Member

gasche commented Jan 30, 2021

I propose a fix for this bench_map failure in #1009.

@UnixJunkie
Copy link
Member

Corrected by @gasche

@fccm
Copy link
Member Author

fccm commented Feb 28, 2021

testing with 59c7025:

make bench
[...]
For comparing 1000 pairs of random integers
mfp's compare (19.76 us) is probably (alpha=7.87%) same speed as
BatInt.compare (19.77 us) which is 3.2% faster than
naive compare (20.43 us) which is 18.4% faster than
external compare (25.03 us) which is 57.7% faster than
stdlib's compare (59.15 us)
Measuring: System Clock
Warming up
Estimating clock resolutionFatal error: exception Invalid_argument("Array.make")
Measuring: System Clock
Warming up
Estimating clock resolutionFatal error: exception Invalid_argument("Array.make")
Measuring: System Clock
Warming up
Estimating clock resolutionFatal error: exception Invalid_argument("Array.make")
Measuring: System Clock
Warming up
Estimating clock resolutionFatal error: exception Invalid_argument("Array.make")
Test with small maps (length = 500)
1000 iterations
Measuring: System Clock
Warming up
Fatal error: exception Invalid_argument("Array.make")
Estimating clock resolutionFatal error: exception Sys_error("bench_nreplace.ml: No such file or directory")
Measuring: System Clock
Warming up
Fatal error: exception Invalid_argument("Array.make")
Estimating clock resolutionBenchmarking results are written to bench.log

@fccm fccm reopened this Feb 28, 2021
@gasche
Copy link
Member

gasche commented Feb 28, 2021

I think that the issue that @fccm observes is 32bit-specific, not the one I fixed.

@UnixJunkie UnixJunkie changed the title Benchmarks produce exceptions Benchmarks produce exceptions on 32bits computers Mar 1, 2021
@UnixJunkie
Copy link
Member

@fccm can you get the stack trace?

export OCAMLRUNPARAM=b
# run the tests on 32bits

@fccm fccm changed the title Benchmarks produce exceptions on 32bits computers Benchmarks produce exceptions on 32bits OS Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants