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

fix Numba p2p #493

Open
jeffhammond opened this issue Jul 14, 2020 · 0 comments
Open

fix Numba p2p #493

jeffhammond opened this issue Jul 14, 2020 · 0 comments
Assignees
Labels

Comments

@jeffhammond
Copy link
Member

Apply this patch from @dalcinl...

diff --git a/PYTHON/p2p-numba.py b/PYTHON/p2p-numba.py
index 82ff99be..5fd8cecd 100755
--- a/PYTHON/p2p-numba.py
+++ b/PYTHON/p2p-numba.py
@@ -61,12 +61,15 @@ import numpy
 print('Numpy version  = ', numpy.version.version)
 import numba
 
-@jit
+@numba.jit
 def iterate_over_grid(grid, m, n):
     for i in range(1,m):
         for j in range(1,n):
             grid[i][j] = grid[i-1][j] + grid[i][j-1] - grid[i-1][j-1]
 
+    # copy top right corner value to bottom left corner to create dependency
+    grid[0,0] = -grid[m-1,n-1]
+
 def main():
 
     # ********************************************************************
@@ -106,9 +109,6 @@ def main():
 
         iterate_over_grid(grid, m, n)
 
-        # copy top right corner value to bottom left corner to create dependency
-        grid[0,0] = -grid[m-1,n-1]
-
 
     t1 = timer()
     pipeline_time = t1 - t0
@jeffhammond jeffhammond self-assigned this Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant