SystemsGenetics / ACE

Accelerated Computational Engine (ACE) is a GPU-enabled framework to simplify creation of GPU-capable applications
http://SystemsGenetics.github.io/ACE
GNU General Public License v2.0
1 stars 1 forks source link

Percent complete goes negative when analytic size is large #82

Closed bentsherman closed 5 years ago

bentsherman commented 5 years ago

Recently I've noticed when I extract a large network the percentage goes negative at some point. It doesn't cause an error but I think it's just an overflow during the percentage calculation:

int percentComplete {expectedIndex*100/analytic()->size()};

With the network I just extracted, the analytic size was roughly 33,000,000. So when expectedIndex reaches around 20,000,000 it is multiplied by 100 here which leads to overflow.

The quick and dirty fix here would be to cast this operation to qint64. A more laborious option would be to change analytic()->size() to be qint64. Since this issue isn't urgent, I would probably implement the latter.

4ctrl-alt-del commented 5 years ago

Fixed in 3b5c50806c902f5bc99381d9bdae169ec11f8207.