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

optimizer ZeroDivisionError #467

Closed
goerlibe opened this issue Dec 19, 2023 · 4 comments
Closed

optimizer ZeroDivisionError #467

goerlibe opened this issue Dec 19, 2023 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@goerlibe
Copy link
Collaborator

Running the usual steps on this program, then running the optimizer without arguments, i.e. discopop_optimizer, results in ZeroDivisionError. Exhaustive Search works fine.

Source Code
#define N 1000

int main() {
    double a[N];
    double b[N];
    for (int i = 0; i < N; ++i) {
        a[i] = (double) i;
    }
    for (int i = 0; i < N *N; ++i) {
        a[i%N] = (double) i;
        b[i%N] = a[i%N] + 42;
    }
    return 0;
}
Error
Traceback (most recent call last):
  File "/home/bg/.local/bin/discopop_optimizer", line 11, in <module>
    load_entry_point('discopop', 'console_scripts', 'discopop_optimizer')()
  File "/home/bg/dp-workspace/discopop/discopop_library/discopop_optimizer/__main__.py", line 67, in main
    run(arguments)
  File "/home/bg/dp-workspace/discopop/discopop_library/discopop_optimizer/optimizer.py", line 179, in run
    best_configuration = perform_evolutionary_search(
  File "/home/bg/dp-workspace/discopop/discopop_library/discopop_optimizer/optimization/evolutionary_algorithm.py", line 60, in perform_evolutionary_search
    population = __select(
  File "/home/bg/dp-workspace/discopop/discopop_library/discopop_optimizer/optimization/evolutionary_algorithm.py", line 243, in __select
    probabilityMap[tuple(element)] = 1 - (fitness[element_idx] / score_sum)
ZeroDivisionError: float division by zero
@goerlibe goerlibe added the bug Something isn't working label Dec 19, 2023
@lukasrothenberger lukasrothenberger added this to the Release 3.1.0 milestone Dec 19, 2023
@lukasrothenberger
Copy link
Collaborator

Issue has been identified as unrelated to the optimizer.

@goerlibe , please close the issue once you are pleases with your fix in the VSCode Extension.

@goerlibe
Copy link
Collaborator Author

goerlibe commented Dec 21, 2023

Deleting .discopop after running cmake did fix the issue. However a new problem was introduced, because now the Hotspot Detection and DiscoPoP do not play well together. (They each require a new cmake build, therefore deleting each other's results)

my current build process creates the following directories:

  • path/to/build
    • .discopop (shared by DiscoPoP and HotspotDetection)
    • DiscoPoP (the build directory for DiscoPoP)
    • HotspotDetection (the build directory for HotspotDetection)

Is it safe to run the cmake command without the DOT_DISCOPOP, then delete the local .discopop directory and run make and the instrumentation with the DOT_DISCOPOP pointing to the above mentioned directory?
Or does some component remember the .discopop location used during the cmake command and everything results in a mess?

@lukasrothenberger
Copy link
Collaborator

lukasrothenberger commented Dec 21, 2023

"Is it safe to run..."
I think this should be fine since the value of DOT_DISCOPOP is read from the environment whenever it is required.

@lukasrothenberger
Copy link
Collaborator

Hi @goerlibe,
can close this issue? It should be fixed by #464.

@goerlibe goerlibe closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants