Skip to content

Commit 6896138

Browse files
committed
Fix pycodestyle issues
1 parent e5eefed commit 6896138

File tree

2 files changed

+20
-29
lines changed

2 files changed

+20
-29
lines changed

examples/jacobi-1d/autoparallel/jacobi-1d.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def compute_b(coef, a_left, a_center, a_right):
9494
def copy(b):
9595
return b
9696

97+
9798
############################################
9899
# MAIN
99100
############################################

examples/matmul/autoparallel/matmul.py

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,44 +52,34 @@ def create_block(b_size, is_random):
5252
# MAIN FUNCTION
5353
############################################
5454

55-
# [COMPSs Autoparallel] Begin Autogenerated code
56-
from pycompss.api.api import compss_barrier, compss_wait_on, compss_open
57-
from pycompss.api.task import task
58-
from pycompss.api.parameter import *
59-
60-
61-
@task(var2=IN, var3=IN, var1=INOUT)
62-
def S1(var2, var3, var1):
63-
var1 += var2 * var3
64-
65-
55+
@parallel(pluto_extra_flags=[""])
6656
def matmul(a, b, c, m_size):
57+
# Debug
6758
if __debug__:
68-
print('Matrix A:')
59+
# TODO: PyCOMPSs BUG sync-INOUT-sync
60+
# a = compss_wait_on(a)
61+
# b = compss_wait_on(b)
62+
# c = compss_wait_on(c)
63+
print("Matrix A:")
6964
print(a)
70-
print('Matrix B:')
65+
print("Matrix B:")
7166
print(b)
72-
print('Matrix C:')
67+
print("Matrix C:")
7368
print(c)
74-
if m_size >= 1:
75-
lbp = 0
76-
ubp = m_size - 1
77-
for t1 in range(lbp, ubp + 1):
78-
lbp = 0
79-
ubp = m_size - 1
80-
for t2 in range(0, m_size - 1 + 1):
81-
lbv = 0
82-
ubv = m_size - 1
83-
for t3 in range(lbv, ubv + 1):
84-
S1(a[t3][t2], b[t2][t1], c[t3][t1])
85-
compss_barrier()
69+
70+
# Matrix multiplication
71+
for i in range(m_size):
72+
for j in range(m_size):
73+
for k in range(m_size):
74+
# multiply(a[i][k], b[k][j], c[i][j])
75+
c[i][j] += a[i][k] * b[k][j]
76+
77+
# Debug result
8678
if __debug__:
87-
print('New Matrix C:')
79+
print("New Matrix C:")
8880
c = compss_wait_on(c)
8981
print(c)
9082

91-
# [COMPSs Autoparallel] End Autogenerated code
92-
9383

9484
############################################
9585
# MAIN

0 commit comments

Comments
 (0)