Skip to content

Commit

Permalink
Fix pycodestyle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianrcv committed Mar 29, 2018
1 parent e5eefed commit 6896138
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
1 change: 1 addition & 0 deletions examples/jacobi-1d/autoparallel/jacobi-1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def compute_b(coef, a_left, a_center, a_right):
def copy(b):
return b


############################################
# MAIN
############################################
Expand Down
48 changes: 19 additions & 29 deletions examples/matmul/autoparallel/matmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,44 +52,34 @@ def create_block(b_size, is_random):
# MAIN FUNCTION
############################################

# [COMPSs Autoparallel] Begin Autogenerated code
from pycompss.api.api import compss_barrier, compss_wait_on, compss_open
from pycompss.api.task import task
from pycompss.api.parameter import *


@task(var2=IN, var3=IN, var1=INOUT)
def S1(var2, var3, var1):
var1 += var2 * var3


@parallel(pluto_extra_flags=[""])
def matmul(a, b, c, m_size):
# Debug
if __debug__:
print('Matrix A:')
# TODO: PyCOMPSs BUG sync-INOUT-sync
# a = compss_wait_on(a)
# b = compss_wait_on(b)
# c = compss_wait_on(c)
print("Matrix A:")
print(a)
print('Matrix B:')
print("Matrix B:")
print(b)
print('Matrix C:')
print("Matrix C:")
print(c)
if m_size >= 1:
lbp = 0
ubp = m_size - 1
for t1 in range(lbp, ubp + 1):
lbp = 0
ubp = m_size - 1
for t2 in range(0, m_size - 1 + 1):
lbv = 0
ubv = m_size - 1
for t3 in range(lbv, ubv + 1):
S1(a[t3][t2], b[t2][t1], c[t3][t1])
compss_barrier()

# Matrix multiplication
for i in range(m_size):
for j in range(m_size):
for k in range(m_size):
# multiply(a[i][k], b[k][j], c[i][j])
c[i][j] += a[i][k] * b[k][j]

# Debug result
if __debug__:
print('New Matrix C:')
print("New Matrix C:")
c = compss_wait_on(c)
print(c)

# [COMPSs Autoparallel] End Autogenerated code


############################################
# MAIN
Expand Down

0 comments on commit 6896138

Please sign in to comment.