<s>
DOPIPE	B-Operating_System
parallelism	B-Operating_System
is	O
a	O
method	O
to	O
perform	O
loop-level	B-Operating_System
parallelism	I-Operating_System
by	O
pipelining	B-General_Concept
the	O
statements	O
in	O
a	O
loop	O
.	O
</s>
<s>
Pipelined	B-General_Concept
parallelism	B-Operating_System
may	O
exist	O
at	O
different	O
levels	O
of	O
abstraction	O
like	O
loops	O
,	O
functions	O
and	O
algorithmic	O
stages	O
.	O
</s>
<s>
The	O
extent	O
of	O
parallelism	B-Operating_System
depends	O
upon	O
the	O
programmers	O
 '	O
ability	O
to	O
make	O
best	O
use	O
of	O
this	O
concept	O
.	O
</s>
<s>
The	O
main	O
purpose	O
of	O
employing	O
loop-level	B-Operating_System
parallelism	I-Operating_System
is	O
to	O
search	O
and	O
split	O
sequential	O
tasks	O
of	O
a	O
program	O
and	O
convert	O
them	O
into	O
parallel	O
tasks	O
without	O
any	O
prior	O
information	O
about	O
the	O
algorithm	O
.	O
</s>
<s>
Parts	O
of	O
data	O
that	O
are	O
recurring	O
and	O
consume	O
significant	O
amount	O
of	O
execution	O
time	O
are	O
good	O
candidates	O
for	O
loop-level	B-Operating_System
parallelism	I-Operating_System
.	O
</s>
<s>
Some	O
common	O
applications	O
of	O
loop-level	B-Operating_System
parallelism	I-Operating_System
are	O
found	O
in	O
mathematical	O
analysis	O
that	O
uses	O
multiple-dimension	O
matrices	O
which	O
are	O
iterated	O
in	O
nested	O
loops	O
.	O
</s>
<s>
There	O
are	O
different	O
kind	O
of	O
parallelization	B-Operating_System
techniques	O
which	O
are	O
used	O
on	O
the	O
basis	O
of	O
data	O
storage	O
overhead	O
,	O
degree	O
of	O
parallelization	B-Operating_System
and	O
data	B-Operating_System
dependencies	I-Operating_System
.	O
</s>
<s>
Some	O
of	O
the	O
known	O
techniques	O
are	O
:	O
DOALL	B-Operating_System
,	O
DOACROSS	B-Operating_System
and	O
DOPIPE	B-Operating_System
.	O
</s>
<s>
DOALL	B-Operating_System
:	O
This	O
technique	O
is	O
used	O
where	O
we	O
can	O
parallelize	O
each	O
iteration	O
of	O
the	O
loop	O
without	O
any	O
interaction	O
between	O
the	O
iterations	O
.	O
</s>
<s>
DOACROSS	B-Operating_System
:	O
This	O
technique	O
is	O
used	O
wherever	O
there	O
is	O
a	O
possibility	O
for	O
data	B-Operating_System
dependencies	I-Operating_System
.	O
</s>
<s>
There	O
is	O
a	O
degree	O
of	O
synchronization	O
used	O
to	O
sync	O
the	O
dependent	O
tasks	O
across	O
parallel	B-Operating_System
processors	I-Operating_System
.	O
</s>
<s>
DOPIPE	B-Operating_System
is	O
a	O
pipelined	B-General_Concept
parallelization	B-Operating_System
technique	O
that	O
is	O
used	O
in	O
programs	O
where	O
each	O
element	O
produced	O
during	O
each	O
iteration	O
is	O
consumed	O
in	O
the	O
later	O
iteration	O
.	O
</s>
<s>
The	O
following	O
example	O
shows	O
how	O
to	O
implement	O
the	O
DOPIPE	B-Operating_System
technique	O
to	O
reduce	O
the	O
total	O
execution	O
time	O
by	O
breaking	O
the	O
tasks	O
inside	O
the	O
loop	O
and	O
executing	O
them	O
in	O
a	O
pipelined	B-General_Concept
manner	O
.	O
</s>
<s>
The	O
breaking	O
into	O
tasks	O
takes	O
place	O
in	O
such	O
a	O
way	O
that	O
all	O
the	O
dependencies	B-Operating_System
within	O
the	O
loop	O
are	O
unidirectional	O
,	O
i.e.	O
</s>
<s>
The	O
program	O
below	O
shows	O
a	O
pseudocode	B-Language
for	O
DOPIPE	B-Operating_System
parallelization	I-Operating_System
.	O
</s>
<s>
In	O
this	O
code	O
,	O
we	O
see	O
that	O
there	O
are	O
three	O
tasks	O
(	O
F0	O
,	O
F1	O
and	O
F2	O
)	O
inside	O
a	O
loop	O
iterating	O
over	O
j	O
for	O
1	O
to	O
N	O
.	O
Following	O
is	O
a	O
list	O
of	O
dependencies	B-Operating_System
in	O
the	O
code	O
:	O
</s>
<s>
Now	O
,	O
if	O
we	O
parallelize	O
the	O
loop	O
by	O
pipelining	B-General_Concept
the	O
statements	O
inside	O
the	O
loop	O
in	O
the	O
following	O
manner:Since	O
,	O
F0	O
is	O
an	O
independent	O
function	O
,	O
i.e.	O
</s>
<s>
Hence	O
,	O
we	O
can	O
completely	O
separate	O
out	O
this	O
function	O
and	O
run	O
it	O
parallelly	O
using	O
DOALL	B-Operating_System
parallelism	B-Operating_System
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
Statements	O
F1	O
and	O
F2	O
are	O
dependent	O
(	O
explained	O
above	O
)	O
,	O
therefore	O
we	O
split	O
them	O
into	O
two	O
different	O
loops	O
and	O
execute	O
them	O
in	O
a	O
pipelined	B-General_Concept
fashion	O
.	O
</s>
<s>
DOALL	B-Operating_System
parallelism	B-Operating_System
mainly	O
works	O
on	O
principle	O
of	O
divide	O
and	O
conquer	O
.	O
</s>
<s>
So	O
the	O
problem	O
with	O
this	O
implementation	O
is	O
that	O
when	O
large	O
amount	O
of	O
data	O
works	O
is	O
computed	O
together	O
,	O
a	O
large	O
cache	B-General_Concept
space	O
is	O
needed	O
to	O
work	O
for	O
different	O
threads	B-Operating_System
.	O
</s>
<s>
Since	O
there	O
is	O
no	O
dependencies	B-Operating_System
in	O
the	O
threads	B-Operating_System
,	O
there	O
is	O
no	O
overhead	O
for	O
the	O
inter	O
-	O
thread	B-Operating_System
communication	O
.	O
</s>
<s>
While	O
in	O
DOPIPE	B-Operating_System
,	O
there	O
is	O
a	O
synchronization	O
overhead	O
between	O
the	O
threads	B-Operating_System
.	O
</s>
<s>
But	O
,	O
due	O
to	O
its	O
pipelined	B-General_Concept
structure	O
,	O
it	O
requires	O
less	O
cache	B-General_Concept
space	O
because	O
the	O
data	O
produced	O
is	O
immediately	O
consumed	O
by	O
the	O
consumer	O
.	O
</s>
