Skip to content

Commit 516f213

Browse files
authored
Merge pull request #7 from cristianrcv/6-loop-taskification-with-collections
6 loop taskification with collections
2 parents db81a2e + 40223c6 commit 516f213

File tree

246 files changed

+167027
-144813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+167027
-144813
lines changed

examples/aliasing-lt/autoparallel/aliasing-lt.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ def create_entry(i, size):
4343
# MAIN FUNCTION
4444
############################################
4545

46-
# @parallel()
47-
@parallel(taskify_loop_level=1)
46+
@parallel(tile=True)
4847
def test_main(mat, n_size):
4948
# Debug
5049
if __debug__:

examples/aliasing-lt/autoparallel/aliasing-lt_autogen.py

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,24 @@ def create_entry(i, size):
4343
# MAIN FUNCTION
4444
############################################
4545

46-
# @parallel()
4746
# [COMPSs Autoparallel] Begin Autogenerated code
4847
import math
4948

5049
from pycompss.api.api import compss_barrier, compss_wait_on, compss_open
5150
from pycompss.api.task import task
5251
from pycompss.api.parameter import *
53-
from pycompss.util.translators.arg_utils.arg_utils import ArgUtils
54-
55-
56-
@task(n_size=IN, index=IN, mat=INOUT, returns="LT3_args_size")
57-
def LT3(n_size, index, *args):
58-
global LT3_args_size
59-
mat, = ArgUtils.rebuild_args(args)
60-
for t1 in range(2, n_size - 1 + 1):
61-
mat[t1 - (2 if n_size >= 2 and (index >= 3 or index == 2) else index)] = S1_no_task(n_size)
62-
S2_no_task(mat[index - (2 if n_size >= 2 and (index >= 3 or index == 2) else index)])
63-
return ArgUtils.flatten_args(mat)
6452

6553

6654
@task(n_size=IN, returns=1)
6755
def S1(n_size):
6856
return compute_mat(n_size)
6957

7058

71-
def S1_no_task(n_size):
72-
return compute_mat(n_size)
73-
74-
7559
@task(var1=IN)
7660
def S2(var1):
7761
display(var1)
7862

7963

80-
def S2_no_task(var1):
81-
display(var1)
82-
83-
8464
def test_main(mat, n_size):
8565
if __debug__:
8666
mat = compss_wait_on(mat)
@@ -90,16 +70,9 @@ def test_main(mat, n_size):
9070
if n_size >= 3:
9171
lbp = 2
9272
ubp = n_size - 1
93-
LT3_aux_0 = [mat[gv0] for gv0 in range(2 if n_size >= 2 and (index >= 3 or index == 2) else index, n_size if
94-
n_size >= 2 and (index < n_size or index == n_size) else index, 1)]
95-
LT3_argutils = ArgUtils()
96-
global LT3_args_size
97-
LT3_flat_args, LT3_args_size = LT3_argutils.flatten(1, LT3_aux_0, LT3_aux_0)
98-
LT3_new_args = LT3(n_size, index, *LT3_flat_args)
99-
LT3_aux_0, = LT3_argutils.rebuild(LT3_new_args)
100-
for gv0 in range(2 if n_size >= 2 and (index >= 3 or index == 2) else index, n_size if n_size >= 2 and (
101-
index < n_size or index == n_size) else index, 1):
102-
mat[gv0] = LT3_aux_0[gv0 - (2 if n_size >= 2 and (index >= 3 or index == 2) else index)]
73+
for t1 in range(2, n_size - 1 + 1):
74+
mat[t1] = S1(n_size)
75+
S2(mat[index])
10376
compss_barrier()
10477
if __debug__:
10578
mat = compss_wait_on(mat)

examples/aliasing-lt/enqueue.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@
4040
--cpus_per_node="${cpus_per_node}" \
4141
--worker_in_master_cpus=0 \
4242
--node_memory=50000 \
43-
--scheduler=es.bsc.compss.scheduler.fifoDataScheduler.FIFODataScheduler \
4443
\
4544
--tracing="${tracing}" \
4645
--graph="${graph}" \
4746
--summary \
4847
--log_level="${log_level}" \
4948
\
5049
--master_working_dir="${WORK_DIR}" \
51-
--worker_working_dir=/gpfs/projects/bsc19/COMPSs_SandBox \
50+
--worker_working_dir=/gpfs/scratch/bsc19/bsc19533 \
5251
--base_log_dir="${WORK_DIR}" \
5352
--pythonpath="${LOCAL_PYTHONPATH}" \
5453
--lang=python \

examples/aliasing-lt/results.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
move_traces=${3:-true}
1919

2020
# Initialize results log file
21-
echo -e "JOB_ID\tVERSION\t\tNSIZE\tTRACING\tNUM_WORKERS\tTOTAL_TIME\tINIT_TIME\tCOMP_TIME\tNUM_TASKS" > "${job_results_file}"
21+
echo -e "JOB_ID\\tVERSION\\t\\tNSIZE\\tTRACING\\tNUM_WORKERS\\tTOTAL_TIME\\tINIT_TIME\\tCOMP_TIME\\tNUM_TASKS" > "${job_results_file}"
2222

2323
first=0
2424
while read -r line; do
@@ -43,7 +43,7 @@
4343
num_tasks=$(grep "Total executed tasks:" "${job_output}" | awk '{ print $NF }' | cat)
4444

4545
# Print results
46-
echo -e "${job_id}\t${version}\t${nsize}\t${tracing}\t${num_workers}\t\t${total_time}\t${init_time}\t${comp_time}\t${num_tasks}" >> "${job_results_file}"
46+
echo -e "${job_id}\\t${version}\\t${nsize}\\t${tracing}\\t${num_workers}\\t\\t${total_time}\\t${init_time}\\t${comp_time}\\t${num_tasks}" >> "${job_results_file}"
4747

4848
# Move traces to its location
4949
if [ "${move_traces}" == "true" ] && [ "$tracing" == "true" ]; then

examples/aliasing-lt/results/local/autoparallel/complete_graph.dot

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,70 @@
11
digraph {
22
rankdir=TB;
33
labeljust="l";
4+
compound= true;
45
subgraph dependence_graph {
56
ranksep=0.20;
67
node[height=0.75];
78

9+
Synchro0[label="main", shape=octagon, style=filled fillcolor="#8B0000" fontcolor="#FFFFFF"];
810
1[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
11+
Synchro0 -> 1;
912
2[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
13+
Synchro0 -> 2;
1014
3[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
15+
Synchro0 -> 3;
1116
4[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
17+
Synchro0 -> 4;
1218
5[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
19+
Synchro0 -> 5;
1320
6[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
21+
Synchro0 -> 6;
1422
7[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
23+
Synchro0 -> 7;
1524
8[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
25+
Synchro0 -> 8;
1626
Synchro1[label="barrier", shape=octagon, style=filled fillcolor="#ff0000" fontcolor="#FFFFFF"];
17-
6 -> Synchro1;
18-
1 -> Synchro1;
19-
2 -> Synchro1;
20-
3 -> Synchro1;
21-
5 -> Synchro1;
22-
7 -> Synchro1;
23-
8 -> Synchro1;
24-
4 -> Synchro1;
27+
Synchro0 -> Synchro1 [color=grey];
28+
3 -> Synchro1 [color=grey];
29+
4 -> Synchro1 [color=grey];
30+
8 -> Synchro1 [color=grey];
31+
1 -> Synchro1 [color=grey];
32+
5 -> Synchro1 [color=grey];
33+
7 -> Synchro1 [color=grey];
34+
6 -> Synchro1 [color=grey];
35+
2 -> Synchro1 [color=grey];
2536
9[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
26-
Synchro1 -> 9[ label="d9v1" ];
27-
Synchro1 -> 9[ label="d3v2" ];
28-
Synchro1 -> 9[ label="d4v2" ];
29-
Synchro1 -> 9[ label="d5v2" ];
30-
Synchro1 -> 9[ label="d6v2" ];
31-
Synchro1 -> 9[ label="d7v2" ];
32-
Synchro1 -> 9[ label="d8v2" ];
37+
Synchro1 -> 9;
38+
10[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
39+
Synchro1 -> 10 [label="d5v2"];
40+
11[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
41+
Synchro1 -> 11;
42+
12[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
43+
Synchro1 -> 12 [label="d5v2"];
44+
13[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
45+
Synchro1 -> 13;
46+
14[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
47+
13 -> 14 [label="d11v2"];
48+
15[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
49+
Synchro1 -> 15;
50+
16[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
51+
13 -> 16 [label="d11v2"];
52+
17[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
53+
Synchro1 -> 17;
54+
18[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
55+
13 -> 18 [label="d11v2"];
56+
19[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
57+
Synchro1 -> 19;
58+
20[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
59+
13 -> 20 [label="d11v2"];
3360
Synchro2[label="barrier", shape=octagon, style=filled fillcolor="#ff0000" fontcolor="#FFFFFF"];
34-
Synchro1 -> Synchro2;
35-
9 -> Synchro2; }
61+
Synchro1 -> Synchro2 [color=grey];
62+
17 -> Synchro2 [color=grey];
63+
9 -> Synchro2 [color=grey];
64+
11 -> Synchro2 [color=grey];
65+
19 -> Synchro2 [color=grey];
66+
13 -> Synchro2 [color=grey];
67+
15 -> Synchro2 [color=grey]; }
3668
subgraph legend {
3769
rank=sink;
3870
node [shape=plaintext, height=0.75];
@@ -45,8 +77,12 @@ Synchro1 -> Synchro2;
4577
<td bgcolor="#0000ff">&nbsp;</td>
4678
</tr>
4779
<tr>
48-
<td align="right">aliasing-lt.LT3</td>
80+
<td align="right">aliasing-lt.S1</td>
4981
<td bgcolor="#ffffff">&nbsp;</td>
82+
</tr>
83+
<tr>
84+
<td align="right">aliasing-lt.S2</td>
85+
<td bgcolor="#ff0000">&nbsp;</td>
5086
</tr>
5187
</table>
5288
>]
Binary file not shown.
27.7 KB
Loading

examples/aliasing-lt/results/local/autoparallel/trace/aliasing-lt_autoparallel.pcf

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ VALUES
207207
35 Access Processor: Taskstate
208208
36 Access Processor: Delete file
209209
37 Access Processor: Finish acess to file
210+
56 Acces Processor: Cancel all tasks
210211
45 Task Dispatcher: Action update
211212
46 Task Dispatcher: CE registration
212213
47 Task Dispatcher: Execute tasks
@@ -216,16 +217,17 @@ VALUES
216217
51 Task Dispatcher: Shutdown
217218
52 Task Dispatcher: Update CEI local
218219
53 Task Dispatcher: Worker update request
220+
54 Worker: Creating task sandbox
221+
55 Worker: Removing task sandbox
219222

220223

221224
EVENT_TYPE
222225
0 8000000 Task
223226
VALUES
224227
0 End
228+
2 S1
229+
3 S2
225230
1 create_entry
226-
2 LT3
227-
3 S1
228-
4 S2
229231

230232

231233
EVENT_TYPE
@@ -252,18 +254,16 @@ EVENT_TYPE
252254
VALUES
253255
0 End
254256
1 Task execution
255-
2 User code execution 1
256-
3 User code execution 2
257-
4 User code execution 3
258-
5 Importing modules
259-
6 Thread binding
260-
7 Deserializing object
261-
8 Deserializing object
262-
9 Serializing object
263-
10 Create persistent threads
264-
11 Get by ID persistent object
265-
12 Make persistent object
266-
13 Delete persistent object
257+
2 User code execution
258+
3 Importing modules
259+
4 Thread binding
260+
5 Deserializing object
261+
6 Deserializing object
262+
7 Serializing object
263+
8 Create persistent threads
264+
9 Get by ID persistent object
265+
10 Make persistent object
266+
11 Delete persistent object
267267
102 Worker running
268268

269269

0 commit comments

Comments
 (0)