bench_run() modifies some global options & ignores input nb_run=# when <-- BENCH NB RUN : ### --> is used. Patch attached
@sgougeon)
Reported by Samuel GOUGEON (Originally assigned to Pierre-Aime AGNEL
bench_run.sci (16.54 KB, text/x-csrc)
bench_run.sci: restoring input stacksize(), mode(), format(), ieee(). nb_run=## overrides NB_RUN directive in test file.
BUG DESCRIPTION:
----------------
1) Some benchmark tests modify some global options such that stacksize,
without restoring their initial value when returning.
mode(), ieee(), stacksize(), format() may be altered.
2) When the default number of runs is overridden with the
<-- BENCH NB RUN : ### --> directive in the test file,
the input option "nb_run=###" is ignored, while the
option should override the directive.
ERROR LOG:
----------
wrong behaviors
HOW TO REPRODUCE THE BUG:
-------------------------
stacksize(20000000)
stacksize()
bench_run("elementary_functions","bench_gsort","nb_run=3");
stacksize()
-->stacksize(20000000)
-->stacksize()
ans
20000000. 108698.
-->bench_run("elementary_functions","bench_gsort","nb_run=3");
For Loop (as reference) ........................... 281.00 ms [ 1000000 x]
001/001 - [elementary_functions] bench_gsort ............... 13977.00 ms [ 10 x]
-->stacksize()
ans =
30000000. 108698.