Skip to content

Conversation

@rsarm
Copy link
Contributor

@rsarm rsarm commented Sep 22, 2021

On my laptop quite often I get the error

[==========] Finished on Tue Sep 21 22:13:38 2021
Run report saved in '/Users/sarafael/.reframe/reports/run-report.json'
./bin/reframe: run session stopped: zero division error: float division by zero
./bin/reframe: Traceback (most recent call last):
  File "/Users/sarafael/git_/reframe/reframe/frontend/cli.py", line 1062, in main
    runner.runall(testcases, restored_cases)
  File "/Users/sarafael/git_/reframe/reframe/frontend/executors/__init__.py", line 431, in runall
    self._runall(testcases)
  File "/Users/sarafael/git_/reframe/reframe/frontend/executors/__init__.py", line 504, in _runall
    self._policy.exit()
  File "/Users/sarafael/git_/reframe/reframe/frontend/executors/policies.py", line 545, in exit
    self._pollctl.running_tasks(num_running).snooze()
  File "/Users/sarafael/git_/reframe/reframe/frontend/executors/policies.py", line 68, in snooze
    f'(current poll rate: {self._num_polls/t_elapsed} polls/s)'
ZeroDivisionError: float division by zero

@rsarm rsarm added the bugfix label Sep 22, 2021
@rsarm rsarm added this to the ReFrame sprint 21.09.1 milestone Sep 22, 2021
@rsarm rsarm requested review from ekouts and vkarak September 22, 2021 08:29
@rsarm rsarm self-assigned this Sep 22, 2021
@vkarak vkarak changed the title [bug] Fix division by zero when calculating the poll rate [bugfix] Fix division by zero when calculating the poll rate Sep 22, 2021
Copy link
Contributor

@ekouts ekouts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. I agree with printing None in the log, but I am not sure if there is something more appropriate, like 0 or inf.

Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is very strange that t_elapsed can be zero! Could you reproduce that consistently?

@codecov-commenter
Copy link

Codecov Report

Merging #2199 (6d381ad) into master (59217e7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 6d381ad differs from pull request most recent head 1fef416. Consider uploading reports for the commit 1fef416 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2199   +/-   ##
=======================================
  Coverage   85.53%   85.53%           
=======================================
  Files          55       55           
  Lines        9743     9744    +1     
=======================================
+ Hits         8334     8335    +1     
  Misses       1409     1409           
Impacted Files Coverage Δ
reframe/frontend/executors/policies.py 99.69% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59217e7...1fef416. Read the comment docs.

@vkarak vkarak merged commit 32a94ef into reframe-hpc:master Sep 22, 2021
@rsarm
Copy link
Contributor Author

rsarm commented Sep 23, 2021

I think it has to do with the precision that the time package operates with on different platforms. It looks like my laptop's precision is lower than Piz Daint's.

Laptop:

>>> import time
>>> time.time_ns()
1632381243676665000
>>> time.time_ns()
1632381244415043000
>>> time.time_ns()
1632381245058365000

Piz Daint:

>>> import time
>>> time.time_ns()
1632381235653486557
>>> time.time_ns()
1632381247922103471
>>> time.time_ns()
1632381422630926203

@rsarm rsarm deleted the undefined-poll-rate branch February 3, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants