-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from cristianrcv/19-unittest-fails
BUG: Unittest failures
- Loading branch information
Showing
4 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 144 additions & 0 deletions
144
pycompss/util/translators/py2pycompss/tests/test3_multiply_taskified.expected3.pycompss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
# [COMPSs Autoparallel] Begin Autogenerated code | ||
import math | ||
|
||
from pycompss.api.api import compss_barrier, compss_wait_on, compss_open | ||
from pycompss.api.task import task | ||
from pycompss.api.parameter import * | ||
|
||
|
||
@task(t3=IN, m_size=IN, t2=IN, beta=IN, c={Type: COLLECTION_INOUT, Depth: 2}) | ||
def LT3(t3, m_size, t2, beta, c): | ||
for t4 in range(2 * t3, min(m_size - 1, 2 * t3 + 1) + 1): | ||
lbv = 2 * t2 | ||
ubv = min(m_size - 1, 2 * t2 + 1) | ||
for t5 in range(2 * t2, min(m_size - 1, 2 * t2 + 1) + 1): | ||
c[t5 - 2 * t2][t4 - 2 * t3] = S1_no_task(c[t5 - 2 * t2][t4 - 2 * t3], beta) | ||
|
||
|
||
@task(t3=IN, m_size=IN, t4=IN, t2=IN, alpha=IN, a={Type: COLLECTION_IN, Depth: 2}, b={Type: COLLECTION_IN, Depth: 2}, c={Type: COLLECTION_INOUT, Depth: 2}) | ||
def LT4(t3, m_size, t4, t2, alpha, a, b, c): | ||
for t5 in range(2 * t3, min(m_size - 1, 2 * t3 + 1) + 1): | ||
lbp = 2 * t4 | ||
ubp = min(m_size - 1, 2 * t4 + 1) | ||
for t6 in range(2 * t4, min(m_size - 1, 2 * t4 + 1) + 1): | ||
lbv = 2 * t2 | ||
ubv = min(m_size - 1, 2 * t2 + 1) | ||
for t7 in range(2 * t2, min(m_size - 1, 2 * t2 + 1) + 1): | ||
c[t7 - 2 * t2][t5 - 2 * t3] = S2_no_task(c[t7 - 2 * t2][t5 - 2 * t3], alpha, a[t7 - 2 * t2][t6 - 2 * | ||
t4], b[t6 - 2 * t4][t5 - 2 * t3]) | ||
|
||
|
||
@task(var2=IN, beta=IN, returns=1) | ||
def S1(var2, beta): | ||
return scale(var2, beta) | ||
|
||
|
||
def S1_no_task(var2, beta): | ||
return scale(var2, beta) | ||
|
||
|
||
@task(var2=IN, alpha=IN, var3=IN, var4=IN, returns=1) | ||
def S2(var2, alpha, var3, var4): | ||
return multiply(var2, alpha, var3, var4) | ||
|
||
|
||
def S2_no_task(var2, alpha, var3, var4): | ||
return multiply(var2, alpha, var3, var4) | ||
|
||
|
||
def matmul(a, b, c, m_size, alpha, beta, debug): | ||
if debug: | ||
print 'Matrix A:' | ||
print a | ||
print 'Matrix B:' | ||
print b | ||
print 'Matrix C:' | ||
print c | ||
if m_size >= 1: | ||
lbp = 0 | ||
ubp = int(math.floor(float(m_size - 1) / float(2))) | ||
for t2 in range(lbp, ubp + 1): | ||
lbp = 0 | ||
ubp = int(math.floor(float(m_size - 1) / float(2))) | ||
for t3 in range(0, int(math.floor(float(m_size - 1) / float(2))) + 1): | ||
lbp = 2 * t3 | ||
ubp = min(m_size - 1, 2 * t3 + 1) | ||
LT3_aux_0 = [[c[gv0][gv1] for gv1 in range(2 * t3, m_size if m_size >= 3 + 2 * t2 and -1 + m_size <= | ||
2 * t3 <= m_size else 2 + 2 * t3 if m_size >= 3 + 2 * t2 and 2 * t3 <= -2 + m_size else m_size if | ||
2 * t2 <= m_size <= 2 + 2 * t2 and -1 + m_size <= 2 * t3 <= m_size else 2 + 2 * t3, 1)] for gv0 in | ||
range(2 * t2, 2 + 2 * t2 if m_size >= 3 + 2 * t2 and -1 + m_size <= 2 * t3 <= m_size else 2 + 2 * | ||
t2 if m_size >= 3 + 2 * t2 and 2 * t3 <= -2 + m_size else m_size if 2 * t2 <= m_size <= 2 + 2 * | ||
t2 and -1 + m_size <= 2 * t3 <= m_size else m_size, 1)] | ||
LT3(t3, m_size, t2, beta, LT3_aux_0) | ||
lbp = 0 | ||
ubp = int(math.floor(float(m_size - 1) / float(2))) | ||
for t2 in range(lbp, ubp + 1): | ||
lbp = 0 | ||
ubp = int(math.floor(float(m_size - 1) / float(2))) | ||
for t3 in range(0, int(math.floor(float(m_size - 1) / float(2))) + 1): | ||
lbp = 0 | ||
ubp = int(math.floor(float(m_size - 1) / float(2))) | ||
for t4 in range(0, int(math.floor(float(m_size - 1) / float(2))) + 1): | ||
lbp = 2 * t3 | ||
ubp = min(m_size - 1, 2 * t3 + 1) | ||
LT4_aux_0 = [[a[gv0][gv1] for gv1 in range(2 * t4, 2 + 2 * t4 if 2 * t3 <= m_size <= 2 + 2 * t3 and | ||
2 * t4 <= -2 + m_size and -1 + m_size <= 2 * t2 <= m_size else 2 + 2 * t4 if 2 * t3 <= | ||
m_size <= 2 + 2 * t3 and 2 * t4 <= -2 + m_size and 2 * t2 <= -2 + m_size else m_size if 2 * | ||
t3 <= m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= m_size and -1 + m_size <= 2 * t2 <= | ||
m_size else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= m_size and | ||
2 * t2 <= -2 + m_size else 2 + 2 * t4 if m_size >= 3 + 2 * t3 and 2 * t4 <= -2 + m_size and | ||
-1 + m_size <= 2 * t2 <= m_size else 2 + 2 * t4 if m_size >= 3 + 2 * t3 and 2 * t4 <= -2 + | ||
m_size and 2 * t2 <= -2 + m_size else m_size if m_size >= 3 + 2 * t3 and -1 + m_size <= 2 * | ||
t4 <= m_size and -1 + m_size <= 2 * t2 <= m_size else m_size, 1)] for gv0 in range(2 * t2, | ||
m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and 2 * t4 <= -2 + m_size and -1 + m_size <= 2 * t2 <= | ||
m_size else 2 + 2 * t2 if 2 * t3 <= m_size <= 2 + 2 * t3 and 2 * t4 <= -2 + m_size and 2 * | ||
t2 <= -2 + m_size else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= | ||
m_size and -1 + m_size <= 2 * t2 <= m_size else 2 + 2 * t2 if 2 * t3 <= m_size <= 2 + 2 * t3 and | ||
-1 + m_size <= 2 * t4 <= m_size and 2 * t2 <= -2 + m_size else m_size if m_size >= 3 + 2 * | ||
t3 and 2 * t4 <= -2 + m_size and -1 + m_size <= 2 * t2 <= m_size else 2 + 2 * t2 if m_size >= | ||
3 + 2 * t3 and 2 * t4 <= -2 + m_size and 2 * t2 <= -2 + m_size else m_size if m_size >= 3 + | ||
2 * t3 and -1 + m_size <= 2 * t4 <= m_size and -1 + m_size <= 2 * t2 <= m_size else 2 + 2 * | ||
t2, 1)] | ||
LT4_aux_1 = [[b[gv0][gv1] for gv1 in range(2 * t3, m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and | ||
2 * t4 <= -2 + m_size and -1 + m_size <= 2 * t2 <= m_size else m_size if 2 * t3 <= m_size <= | ||
2 + 2 * t3 and 2 * t4 <= -2 + m_size and 2 * t2 <= -2 + m_size else m_size if 2 * t3 <= | ||
m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= m_size and -1 + m_size <= 2 * t2 <= m_size | ||
else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= m_size and 2 * | ||
t2 <= -2 + m_size else 2 + 2 * t3 if m_size >= 3 + 2 * t3 and 2 * t4 <= -2 + m_size and -1 + | ||
m_size <= 2 * t2 <= m_size else 2 + 2 * t3 if m_size >= 3 + 2 * t3 and 2 * t4 <= -2 + m_size and | ||
2 * t2 <= -2 + m_size else 2 + 2 * t3 if m_size >= 3 + 2 * t3 and -1 + m_size <= 2 * t4 <= | ||
m_size and -1 + m_size <= 2 * t2 <= m_size else 2 + 2 * t3, 1)] for gv0 in range(2 * t4, 2 + | ||
2 * t4 if 2 * t3 <= m_size <= 2 + 2 * t3 and 2 * t4 <= -2 + m_size and -1 + m_size <= 2 * t2 <= | ||
m_size else 2 + 2 * t4 if 2 * t3 <= m_size <= 2 + 2 * t3 and 2 * t4 <= -2 + m_size and 2 * | ||
t2 <= -2 + m_size else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= | ||
m_size and -1 + m_size <= 2 * t2 <= m_size else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and | ||
-1 + m_size <= 2 * t4 <= m_size and 2 * t2 <= -2 + m_size else 2 + 2 * t4 if m_size >= 3 + 2 * | ||
t3 and 2 * t4 <= -2 + m_size and -1 + m_size <= 2 * t2 <= m_size else 2 + 2 * t4 if m_size >= | ||
3 + 2 * t3 and 2 * t4 <= -2 + m_size and 2 * t2 <= -2 + m_size else m_size if m_size >= 3 + | ||
2 * t3 and -1 + m_size <= 2 * t4 <= m_size and -1 + m_size <= 2 * t2 <= m_size else m_size, 1)] | ||
LT4_aux_2 = [[c[gv0][gv1] for gv1 in range(2 * t3, 2 + 2 * t3 if m_size >= 3 + 2 * t3 and -1 + | ||
m_size <= 2 * t4 <= m_size and -1 + m_size <= 2 * t2 <= m_size else 2 + 2 * t3 if m_size >= | ||
3 + 2 * t3 and 2 * t4 <= -2 + m_size and -1 + m_size <= 2 * t2 <= m_size else m_size if 2 * | ||
t3 <= m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= m_size and -1 + m_size <= 2 * t2 <= | ||
m_size else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and 2 * t4 <= -2 + m_size and -1 + | ||
m_size <= 2 * t2 <= m_size else 2 + 2 * t3 if m_size >= 3 + 2 * t3 and -1 + m_size <= 2 * t4 <= | ||
m_size and 2 * t2 <= -2 + m_size else 2 + 2 * t3 if m_size >= 3 + 2 * t3 and 2 * t4 <= -2 + | ||
m_size and 2 * t2 <= -2 + m_size else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and -1 + | ||
m_size <= 2 * t4 <= m_size and 2 * t2 <= -2 + m_size else m_size, 1)] for gv0 in range(2 * | ||
t2, m_size if m_size >= 3 + 2 * t3 and -1 + m_size <= 2 * t4 <= m_size and -1 + m_size <= 2 * | ||
t2 <= m_size else m_size if m_size >= 3 + 2 * t3 and 2 * t4 <= -2 + m_size and -1 + m_size <= | ||
2 * t2 <= m_size else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= | ||
m_size and -1 + m_size <= 2 * t2 <= m_size else m_size if 2 * t3 <= m_size <= 2 + 2 * t3 and | ||
2 * t4 <= -2 + m_size and -1 + m_size <= 2 * t2 <= m_size else 2 + 2 * t2 if m_size >= 3 + 2 * | ||
t3 and -1 + m_size <= 2 * t4 <= m_size and 2 * t2 <= -2 + m_size else 2 + 2 * t2 if m_size >= | ||
3 + 2 * t3 and 2 * t4 <= -2 + m_size and 2 * t2 <= -2 + m_size else 2 + 2 * t2 if 2 * t3 <= | ||
m_size <= 2 + 2 * t3 and -1 + m_size <= 2 * t4 <= m_size and 2 * t2 <= -2 + m_size else 2 + | ||
2 * t2, 1)] | ||
LT4(t3, m_size, t4, t2, alpha, LT4_aux_0, LT4_aux_1, LT4_aux_2) | ||
compss_barrier() | ||
if debug: | ||
print 'Matrix C:' | ||
print c | ||
return c | ||
|
||
# [COMPSs Autoparallel] End Autogenerated code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters