Skip to content

Commit

Permalink
Merge pull request #7 from cristianrcv/6-loop-taskification-with-coll…
Browse files Browse the repository at this point in the history
…ections

6 loop taskification with collections
  • Loading branch information
cristianrcv authored Oct 7, 2019
2 parents db81a2e + 40223c6 commit 516f213
Show file tree
Hide file tree
Showing 246 changed files with 167,027 additions and 144,813 deletions.
3 changes: 1 addition & 2 deletions examples/aliasing-lt/autoparallel/aliasing-lt.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def create_entry(i, size):
# MAIN FUNCTION
############################################

# @parallel()
@parallel(taskify_loop_level=1)
@parallel(tile=True)
def test_main(mat, n_size):
# Debug
if __debug__:
Expand Down
33 changes: 3 additions & 30 deletions examples/aliasing-lt/autoparallel/aliasing-lt_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,24 @@ def create_entry(i, size):
# MAIN FUNCTION
############################################

# @parallel()
# [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 *
from pycompss.util.translators.arg_utils.arg_utils import ArgUtils


@task(n_size=IN, index=IN, mat=INOUT, returns="LT3_args_size")
def LT3(n_size, index, *args):
global LT3_args_size
mat, = ArgUtils.rebuild_args(args)
for t1 in range(2, n_size - 1 + 1):
mat[t1 - (2 if n_size >= 2 and (index >= 3 or index == 2) else index)] = S1_no_task(n_size)
S2_no_task(mat[index - (2 if n_size >= 2 and (index >= 3 or index == 2) else index)])
return ArgUtils.flatten_args(mat)


@task(n_size=IN, returns=1)
def S1(n_size):
return compute_mat(n_size)


def S1_no_task(n_size):
return compute_mat(n_size)


@task(var1=IN)
def S2(var1):
display(var1)


def S2_no_task(var1):
display(var1)


def test_main(mat, n_size):
if __debug__:
mat = compss_wait_on(mat)
Expand All @@ -90,16 +70,9 @@ def test_main(mat, n_size):
if n_size >= 3:
lbp = 2
ubp = n_size - 1
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
n_size >= 2 and (index < n_size or index == n_size) else index, 1)]
LT3_argutils = ArgUtils()
global LT3_args_size
LT3_flat_args, LT3_args_size = LT3_argutils.flatten(1, LT3_aux_0, LT3_aux_0)
LT3_new_args = LT3(n_size, index, *LT3_flat_args)
LT3_aux_0, = LT3_argutils.rebuild(LT3_new_args)
for gv0 in range(2 if n_size >= 2 and (index >= 3 or index == 2) else index, n_size if n_size >= 2 and (
index < n_size or index == n_size) else index, 1):
mat[gv0] = LT3_aux_0[gv0 - (2 if n_size >= 2 and (index >= 3 or index == 2) else index)]
for t1 in range(2, n_size - 1 + 1):
mat[t1] = S1(n_size)
S2(mat[index])
compss_barrier()
if __debug__:
mat = compss_wait_on(mat)
Expand Down
3 changes: 1 addition & 2 deletions examples/aliasing-lt/enqueue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@
--cpus_per_node="${cpus_per_node}" \
--worker_in_master_cpus=0 \
--node_memory=50000 \
--scheduler=es.bsc.compss.scheduler.fifoDataScheduler.FIFODataScheduler \
\
--tracing="${tracing}" \
--graph="${graph}" \
--summary \
--log_level="${log_level}" \
\
--master_working_dir="${WORK_DIR}" \
--worker_working_dir=/gpfs/projects/bsc19/COMPSs_SandBox \
--worker_working_dir=/gpfs/scratch/bsc19/bsc19533 \
--base_log_dir="${WORK_DIR}" \
--pythonpath="${LOCAL_PYTHONPATH}" \
--lang=python \
Expand Down
4 changes: 2 additions & 2 deletions examples/aliasing-lt/results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
move_traces=${3:-true}

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

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

# Print results
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}"
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}"

# Move traces to its location
if [ "${move_traces}" == "true" ] && [ "$tracing" == "true" ]; then
Expand Down
72 changes: 54 additions & 18 deletions examples/aliasing-lt/results/local/autoparallel/complete_graph.dot
Original file line number Diff line number Diff line change
@@ -1,38 +1,70 @@
digraph {
rankdir=TB;
labeljust="l";
compound= true;
subgraph dependence_graph {
ranksep=0.20;
node[height=0.75];

Synchro0[label="main", shape=octagon, style=filled fillcolor="#8B0000" fontcolor="#FFFFFF"];
1[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
Synchro0 -> 1;
2[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
Synchro0 -> 2;
3[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
Synchro0 -> 3;
4[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
Synchro0 -> 4;
5[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
Synchro0 -> 5;
6[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
Synchro0 -> 6;
7[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
Synchro0 -> 7;
8[shape=circle, style=filled fillcolor="#0000ff" fontcolor="#ffffff"];
Synchro0 -> 8;
Synchro1[label="barrier", shape=octagon, style=filled fillcolor="#ff0000" fontcolor="#FFFFFF"];
6 -> Synchro1;
1 -> Synchro1;
2 -> Synchro1;
3 -> Synchro1;
5 -> Synchro1;
7 -> Synchro1;
8 -> Synchro1;
4 -> Synchro1;
Synchro0 -> Synchro1 [color=grey];
3 -> Synchro1 [color=grey];
4 -> Synchro1 [color=grey];
8 -> Synchro1 [color=grey];
1 -> Synchro1 [color=grey];
5 -> Synchro1 [color=grey];
7 -> Synchro1 [color=grey];
6 -> Synchro1 [color=grey];
2 -> Synchro1 [color=grey];
9[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
Synchro1 -> 9[ label="d9v1" ];
Synchro1 -> 9[ label="d3v2" ];
Synchro1 -> 9[ label="d4v2" ];
Synchro1 -> 9[ label="d5v2" ];
Synchro1 -> 9[ label="d6v2" ];
Synchro1 -> 9[ label="d7v2" ];
Synchro1 -> 9[ label="d8v2" ];
Synchro1 -> 9;
10[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
Synchro1 -> 10 [label="d5v2"];
11[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
Synchro1 -> 11;
12[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
Synchro1 -> 12 [label="d5v2"];
13[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
Synchro1 -> 13;
14[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
13 -> 14 [label="d11v2"];
15[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
Synchro1 -> 15;
16[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
13 -> 16 [label="d11v2"];
17[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
Synchro1 -> 17;
18[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
13 -> 18 [label="d11v2"];
19[shape=circle, style=filled fillcolor="#ffffff" fontcolor="#000000"];
Synchro1 -> 19;
20[shape=circle, style=filled fillcolor="#ff0000" fontcolor="#000000"];
13 -> 20 [label="d11v2"];
Synchro2[label="barrier", shape=octagon, style=filled fillcolor="#ff0000" fontcolor="#FFFFFF"];
Synchro1 -> Synchro2;
9 -> Synchro2; }
Synchro1 -> Synchro2 [color=grey];
17 -> Synchro2 [color=grey];
9 -> Synchro2 [color=grey];
11 -> Synchro2 [color=grey];
19 -> Synchro2 [color=grey];
13 -> Synchro2 [color=grey];
15 -> Synchro2 [color=grey]; }
subgraph legend {
rank=sink;
node [shape=plaintext, height=0.75];
Expand All @@ -45,8 +77,12 @@ Synchro1 -> Synchro2;
<td bgcolor="#0000ff">&nbsp;</td>
</tr>
<tr>
<td align="right">aliasing-lt.LT3</td>
<td align="right">aliasing-lt.S1</td>
<td bgcolor="#ffffff">&nbsp;</td>
</tr>
<tr>
<td align="right">aliasing-lt.S2</td>
<td bgcolor="#ff0000">&nbsp;</td>
</tr>
</table>
>]
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ VALUES
35 Access Processor: Taskstate
36 Access Processor: Delete file
37 Access Processor: Finish acess to file
56 Acces Processor: Cancel all tasks
45 Task Dispatcher: Action update
46 Task Dispatcher: CE registration
47 Task Dispatcher: Execute tasks
Expand All @@ -216,16 +217,17 @@ VALUES
51 Task Dispatcher: Shutdown
52 Task Dispatcher: Update CEI local
53 Task Dispatcher: Worker update request
54 Worker: Creating task sandbox
55 Worker: Removing task sandbox


EVENT_TYPE
0 8000000 Task
VALUES
0 End
2 S1
3 S2
1 create_entry
2 LT3
3 S1
4 S2


EVENT_TYPE
Expand All @@ -252,18 +254,16 @@ EVENT_TYPE
VALUES
0 End
1 Task execution
2 User code execution 1
3 User code execution 2
4 User code execution 3
5 Importing modules
6 Thread binding
7 Deserializing object
8 Deserializing object
9 Serializing object
10 Create persistent threads
11 Get by ID persistent object
12 Make persistent object
13 Delete persistent object
2 User code execution
3 Importing modules
4 Thread binding
5 Deserializing object
6 Deserializing object
7 Serializing object
8 Create persistent threads
9 Get by ID persistent object
10 Make persistent object
11 Delete persistent object
102 Worker running


Expand Down
Loading

0 comments on commit 516f213

Please sign in to comment.