<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
gang	B-Operating_System
scheduling	I-Operating_System
is	O
a	O
scheduling	O
algorithm	O
for	O
parallel	O
systems	O
that	O
schedules	O
related	O
threads	B-Operating_System
or	O
processes	O
to	O
run	O
simultaneously	O
on	O
different	O
processors	O
.	O
</s>
<s>
Usually	O
these	O
will	O
be	O
threads	B-Operating_System
all	O
belonging	O
to	O
the	O
same	O
process	B-Operating_System
,	O
but	O
they	O
may	O
also	O
be	O
from	O
different	O
processes	O
,	O
where	O
the	O
processes	O
could	O
have	O
a	O
producer-consumer	O
relationship	O
or	O
come	O
from	O
the	O
same	O
MPI	B-Application
program	O
.	O
</s>
<s>
Gang	B-Operating_System
scheduling	I-Operating_System
is	O
used	O
to	O
ensure	O
that	O
if	O
two	O
or	O
more	O
threads	B-Operating_System
or	O
processes	O
communicate	O
with	O
each	O
other	O
,	O
they	O
will	O
all	O
be	O
ready	O
to	O
communicate	O
at	O
the	O
same	O
time	O
.	O
</s>
<s>
When	O
processors	O
are	O
over-subscribed	O
and	O
gang	B-Operating_System
scheduling	I-Operating_System
is	O
not	O
used	O
within	O
a	O
group	O
of	O
processes	O
or	O
threads	B-Operating_System
which	O
communicate	O
with	O
each	O
other	O
,	O
each	O
communication	O
event	O
could	O
suffer	O
the	O
overhead	O
of	O
a	O
context	B-Operating_System
switch	I-Operating_System
.	O
</s>
<s>
Gang	B-Operating_System
scheduling	I-Operating_System
is	O
based	O
on	O
a	O
data	O
structure	O
called	O
the	O
Ousterhout	O
matrix	O
.	O
</s>
<s>
In	O
this	O
matrix	O
each	O
row	O
represents	O
a	O
time	O
slice	O
,	O
and	O
each	O
column	O
a	O
processor	B-General_Concept
.	O
</s>
<s>
The	O
threads	B-Operating_System
or	O
processes	O
of	O
each	O
job	O
are	O
packed	O
into	O
a	O
single	O
row	O
of	O
the	O
matrix	O
.	O
</s>
<s>
During	O
execution	O
,	O
coordinated	O
context	B-Operating_System
switching	I-Operating_System
is	O
performed	O
across	O
all	O
nodes	O
to	O
switch	O
from	O
the	O
processes	O
in	O
one	O
row	O
to	O
those	O
in	O
the	O
next	O
row	O
.	O
</s>
<s>
Gang	B-Operating_System
scheduling	I-Operating_System
is	O
stricter	O
than	O
coscheduling	B-Operating_System
.	O
</s>
<s>
It	O
requires	O
all	O
threads	B-Operating_System
of	O
the	O
same	O
process	B-Operating_System
to	O
run	O
concurrently	O
,	O
while	O
coscheduling	B-Operating_System
allows	O
for	O
fragments	O
,	O
which	O
are	O
sets	O
of	O
threads	B-Operating_System
that	O
do	O
not	O
run	O
concurrently	O
with	O
the	O
rest	O
of	O
the	O
gang	O
.	O
</s>
<s>
Gang	B-Operating_System
scheduling	I-Operating_System
was	O
implemented	O
and	O
used	O
in	O
production	O
mode	O
on	O
several	O
parallel	B-Operating_System
machines	I-Operating_System
,	O
most	O
notably	O
the	B-Device
Connection	I-Device
Machine	I-Device
CM-5	B-Device
.	O
</s>
<s>
In	O
gang	B-Operating_System
scheduling	I-Operating_System
,	O
one	O
to	O
one	O
mapping	O
happens	O
,	O
which	O
means	O
each	O
task	O
will	O
be	O
mapped	O
to	O
a	O
processor	B-General_Concept
.	O
</s>
<s>
In	O
other	O
words	O
,	O
this	O
scheme	O
favors	O
smaller	O
jobs	O
as	O
compared	O
to	O
larger	O
jobs	O
based	O
on	O
the	O
availability	O
of	O
processor	B-General_Concept
,	O
thus	O
this	O
will	O
leads	O
to	O
increased	O
fragmentation	O
in	O
the	O
system	O
.	O
</s>
<s>
In	O
the	O
above	O
execution	O
scheme	O
,	O
the	O
tasks	O
which	O
correspond	O
to	O
increasing	O
job	O
size	O
are	O
placed	O
in	O
a	O
queue	O
,	O
with	O
the	O
tasks	O
belonging	O
to	O
the	O
largest	O
gang	O
scheduled	O
first	O
,	O
but	O
this	O
method	O
of	O
execution	O
tends	O
to	O
lead	O
to	O
the	O
starvation	B-Operating_System
of	O
resources	O
of	O
smaller	O
jobs	O
and	O
is	O
therefore	O
unfit	O
to	O
be	O
executed	O
in	O
systems	O
where	O
the	O
number	O
of	O
processors	O
is	O
comparatively	O
low	O
.	O
</s>
<s>
The	O
AFCFS	O
and	O
LGFS	O
also	O
have	O
to	O
deal	O
with	O
possible	O
processor	B-General_Concept
failure	O
.	O
</s>
<s>
In	O
such	O
a	O
case	O
,	O
tasks	O
executing	O
on	O
that	O
processor	B-General_Concept
are	O
submitted	O
to	O
other	O
processors	O
for	O
execution	O
.	O
</s>
<s>
The	O
tasks	O
wait	O
in	O
the	O
head	O
of	O
the	O
queue	O
on	O
these	O
processors	O
while	O
the	O
current	O
processor	B-General_Concept
is	O
being	O
repaired	O
.	O
</s>
<s>
Gang	B-Operating_System
scheduling	I-Operating_System
while	O
executing	O
the	O
I/O	O
bound	O
processes	O
keeps	O
the	O
CPUs	B-General_Concept
idle	O
while	O
awaiting	O
responses	O
from	O
the	O
other	O
processors	O
,	O
whereas	O
the	O
idle	O
processors	O
can	O
be	O
utilized	O
for	O
executing	O
tasks	O
.	O
</s>
<s>
If	O
the	O
gang	O
consists	O
of	O
a	O
mix	O
of	O
CPU	O
and	O
I/O	O
Processes	O
,	O
since	O
these	O
processes	O
interfere	O
little	O
in	O
each	O
other	O
’s	O
operation	O
,	O
algorithms	O
can	O
be	O
defined	O
to	O
keep	O
both	O
the	O
CPU	O
and	O
the	O
I/O	O
busy	O
at	O
the	O
same	O
time	O
and	O
exploiting	O
parallelism	B-Operating_System
.	O
</s>
<s>
In	O
strict	O
gang	B-Operating_System
scheduling	I-Operating_System
,	O
one	O
row	O
is	O
selected	O
at	O
a	O
time	O
following	O
which	O
a	O
node	O
scheduler	O
schedules	O
a	O
process	B-Operating_System
in	O
the	O
respective	O
cell	O
of	O
that	O
row	O
.	O
</s>
<s>
Paired	O
gang	O
:	O
In	O
paired	O
gang	B-Operating_System
scheduling	I-Operating_System
,	O
two	O
rows	O
are	O
selected	O
instead	O
of	O
one	O
,	O
one	O
each	O
of	O
the	O
I/O	O
bound	O
gang	O
and	O
CPU	O
gang	O
.	O
</s>
<s>
It	O
is	O
at	O
the	O
discretion	O
of	O
the	O
local	O
scheduler	O
to	O
allot	O
jobs	O
to	O
the	O
appropriate	O
processors	O
in	O
order	O
to	O
elicit	O
maximum	O
allowed	O
parallelism	B-Operating_System
.	O
</s>
<s>
Concurrent	B-Operating_System
gang	B-Operating_System
scheduling	I-Operating_System
a	O
highly	O
scalable	O
and	O
versatile	O
algorithm	O
and	O
assumes	O
the	O
existence	O
of	O
a	O
synchronizer	O
utilizing	O
the	O
internal	O
clock	O
of	O
each	O
node	O
.	O
</s>
<s>
Processor/Memory	O
module	O
(	O
Also	O
called	O
Processing	O
Element	O
)	O
.	O
</s>
<s>
The	O
SHARE	O
scheduling	O
system	O
utilizes	O
the	O
internal	O
clock	O
system	O
of	O
each	O
node	O
and	O
is	O
synchronized	O
using	O
the	O
NTP	B-Protocol
Protocol	I-Protocol
.	O
</s>
<s>
Each	O
gang	O
of	O
processes	O
utilizing	O
the	O
same	O
resources	O
are	O
mapped	O
to	O
a	O
different	O
processor	B-General_Concept
.	O
</s>
<s>
A	O
local	O
scheduler	O
:	O
After	O
the	O
local	O
scheduler	O
is	O
provided	O
the	O
jobs	O
to	O
execute	O
by	O
the	O
global	O
scheduler	O
,	O
it	O
ensures	O
that	O
only	O
one	O
of	O
the	O
parallel	O
process	B-Operating_System
is	O
executed	O
at	O
any	O
one	O
of	O
the	O
processors	O
in	O
a	O
given	O
time	O
slot	O
.	O
</s>
<s>
The	O
local	O
scheduler	O
requires	O
a	O
context	B-Operating_System
switch	I-Operating_System
to	O
preempt	O
a	O
job	O
once	O
its	O
time	O
slice	O
has	O
expired	O
and	O
swap	O
a	O
new	O
one	O
in	O
its	O
place	O
.	O
</s>
<s>
Suppose	O
that	O
PEs	O
are	O
allocated	O
to	O
a	O
job	O
which	O
has	O
threads	B-Operating_System
,	O
the	O
PE	O
in	O
the	O
load	O
order	O
(	O
last	O
one	O
)	O
will	O
determine	O
the	O
maximum	O
load	O
that	O
any	O
PE	O
can	O
have	O
which	O
is	O
available	O
in	O
the	O
slot	O
.	O
</s>
