<s>
Message	B-Application
Passing	I-Application
Interface	I-Application
(	O
MPI	O
)	O
is	O
a	O
standardized	O
and	O
portable	B-Architecture
message-passing	B-Architecture
standard	O
designed	O
to	O
function	O
on	O
parallel	B-Operating_System
computing	I-Operating_System
architectures	B-General_Concept
.	O
</s>
<s>
The	O
MPI	O
standard	O
defines	O
the	O
syntax	O
and	O
semantics	B-Application
of	O
library	B-Library
routines	I-Library
that	O
are	O
useful	O
to	O
a	O
wide	O
range	O
of	O
users	O
writing	O
portable	B-Architecture
message-passing	B-Architecture
programs	O
in	O
C	B-Language
,	O
C++	B-Language
,	O
and	O
Fortran	B-Application
.	O
</s>
<s>
There	O
are	O
several	O
open-source	B-License
MPI	O
implementations	B-Application
,	O
which	O
fostered	O
the	O
development	O
of	O
a	O
parallel	O
software	B-Application
industry	I-Application
,	O
and	O
encouraged	O
development	O
of	O
portable	B-Architecture
and	O
scalable	O
large-scale	O
parallel	O
applications	O
.	O
</s>
<s>
The	O
message	B-Application
passing	I-Application
interface	I-Application
effort	O
began	O
in	O
the	O
summer	O
of	O
1991	O
when	O
a	O
small	O
group	O
of	O
researchers	O
started	O
discussions	O
at	O
a	O
mountain	O
retreat	O
in	O
Austria	O
.	O
</s>
<s>
Out	O
of	O
that	O
discussion	O
came	O
a	O
Workshop	O
on	O
Standards	O
for	O
Message	B-Architecture
Passing	I-Architecture
in	O
a	O
Distributed	B-Operating_System
Memory	I-Operating_System
Environment	O
,	O
held	O
on	O
April	O
29	O
–	O
30	O
,	O
1992	O
in	O
Williamsburg	O
,	O
Virginia	O
.	O
</s>
<s>
Attendees	O
at	O
Williamsburg	O
discussed	O
the	O
basic	O
features	O
essential	O
to	O
a	O
standard	O
message-passing	B-Architecture
interface	O
and	O
established	O
a	O
working	O
group	O
to	O
continue	O
the	O
standardization	O
process	O
.	O
</s>
<s>
The	O
draft	O
MPI	O
standard	O
was	O
presented	O
at	O
the	O
Supercomputing	B-Architecture
'	O
93	O
conference	O
in	O
November	O
1993	O
.	O
</s>
<s>
Most	O
of	O
the	O
major	O
vendors	O
of	O
concurrent	B-Operating_System
computers	I-Operating_System
were	O
involved	O
in	O
the	O
MPI	O
effort	O
,	O
collaborating	O
with	O
researchers	O
from	O
universities	O
,	O
government	O
laboratories	O
,	O
and	O
industry	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
hardware	O
vendors	O
can	O
build	O
upon	O
this	O
collection	O
of	O
standard	O
low-level	B-Language
routines	O
to	O
create	O
higher-level	B-Language
routines	O
for	O
the	O
distributed-memory	O
communication	O
environment	O
supplied	O
with	O
their	O
parallel	B-Operating_System
machines	I-Operating_System
.	O
</s>
<s>
MPI	O
provides	O
a	O
simple-to-use	O
portable	B-Architecture
interface	O
for	O
the	O
basic	O
user	O
,	O
yet	O
one	O
powerful	O
enough	O
to	O
allow	O
programmers	O
to	O
use	O
the	O
high-performance	O
message	B-Architecture
passing	I-Architecture
operations	O
available	O
on	O
advanced	O
machines	O
.	O
</s>
<s>
In	O
an	O
effort	O
to	O
create	O
a	O
universal	O
standard	O
for	O
message	B-Architecture
passing	I-Architecture
,	O
researchers	O
did	O
not	O
base	O
it	O
off	O
of	O
a	O
single	O
system	O
but	O
it	O
incorporated	O
the	O
most	O
useful	O
features	O
of	O
several	O
systems	O
,	O
including	O
those	O
designed	O
by	O
IBM	O
,	O
Intel	O
,	O
nCUBE	B-Application
,	O
PVM	B-Operating_System
,	O
Express	O
,	O
P4	O
and	O
PARMACS	O
.	O
</s>
<s>
The	O
message-passing	B-Architecture
paradigm	O
is	O
attractive	O
because	O
of	O
wide	O
portability	B-Architecture
and	O
can	O
be	O
used	O
in	O
communication	O
for	O
distributed-memory	O
and	O
shared-memory	B-Operating_System
multiprocessors	I-Operating_System
,	O
networks	O
of	O
workstations	O
,	O
and	O
a	O
combination	O
of	O
these	O
elements	O
.	O
</s>
<s>
MPI	O
is	O
a	O
communication	O
protocol	O
for	O
programming	O
parallel	B-Operating_System
computers	I-Operating_System
.	O
</s>
<s>
MPI	O
"	O
is	O
a	O
message-passing	B-Architecture
application	O
programmer	O
interface	O
,	O
together	O
with	O
protocol	O
and	O
semantic	O
specifications	O
for	O
how	O
its	O
features	O
must	O
behave	O
in	O
any	O
implementation.	O
"	O
</s>
<s>
MPI	O
's	O
goals	O
are	O
high	O
performance	O
,	O
scalability	O
,	O
and	O
portability	B-Architecture
.	O
</s>
<s>
MPI	O
remains	O
the	O
dominant	O
model	O
used	O
in	O
high-performance	B-Architecture
computing	I-Architecture
today	O
.	O
</s>
<s>
MPI	O
is	O
not	O
sanctioned	O
by	O
any	O
major	O
standards	O
body	O
;	O
nevertheless	O
,	O
it	O
has	O
become	O
a	O
de	O
facto	O
standard	O
for	O
communication	O
among	O
processes	B-Operating_System
that	O
model	O
a	O
parallel	B-Operating_System
program	I-Operating_System
running	O
on	O
a	O
distributed	B-Operating_System
memory	I-Operating_System
system	O
.	O
</s>
<s>
Actual	O
distributed	B-Operating_System
memory	I-Operating_System
supercomputers	B-Architecture
such	O
as	O
computer	O
clusters	O
often	O
run	O
such	O
programs	O
.	O
</s>
<s>
The	O
principal	O
MPI-1	O
model	O
has	O
no	O
shared	B-Operating_System
memory	I-Operating_System
concept	O
,	O
and	O
MPI-2	O
has	O
only	O
a	O
limited	O
distributed	B-Operating_System
shared	I-Operating_System
memory	I-Operating_System
concept	O
.	O
</s>
<s>
Nonetheless	O
,	O
MPI	O
programs	O
are	O
regularly	O
run	O
on	O
shared	B-Operating_System
memory	I-Operating_System
computers	O
,	O
and	O
both	O
MPICH	B-Library
and	O
Open	B-Library
MPI	I-Library
can	O
use	O
shared	B-Operating_System
memory	I-Operating_System
for	O
message	O
transfer	O
if	O
it	O
is	O
available	O
.	O
</s>
<s>
Designing	O
programs	O
around	O
the	O
MPI	O
model	O
(	O
contrary	O
to	O
explicit	O
shared	B-Operating_System
memory	I-Operating_System
models	O
)	O
has	O
advantages	O
when	O
running	O
on	O
NUMA	B-Operating_System
architectures	B-General_Concept
since	O
MPI	O
encourages	O
memory	B-General_Concept
locality	I-General_Concept
.	O
</s>
<s>
Explicit	O
shared	B-Operating_System
memory	I-Operating_System
programming	I-Operating_System
was	O
introduced	O
in	O
MPI-3	O
.	O
</s>
<s>
Although	O
MPI	O
belongs	O
in	O
layers	O
5	O
and	O
higher	O
of	O
the	O
OSI	O
Reference	O
Model	O
,	O
implementations	B-Application
may	O
cover	O
most	O
layers	O
,	O
with	O
sockets	B-Protocol
and	O
Transmission	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
TCP	O
)	O
used	O
in	O
the	O
transport	O
layer	O
.	O
</s>
<s>
Most	O
MPI	O
implementations	B-Application
consist	O
of	O
a	O
specific	O
set	O
of	O
routines	O
directly	O
callable	O
from	O
C	B-Language
,	O
C++	B-Language
,	O
Fortran	B-Application
(	O
i.e.	O
,	O
an	O
API	B-General_Concept
)	O
and	O
any	O
language	O
able	O
to	O
interface	O
with	O
such	O
libraries	O
,	O
including	O
C#	B-Application
,	O
Java	B-Language
or	O
Python	B-Language
.	O
</s>
<s>
The	O
advantages	O
of	O
MPI	O
over	O
older	O
message	B-Architecture
passing	I-Architecture
libraries	O
are	O
portability	B-Architecture
(	O
because	O
MPI	O
has	O
been	O
implemented	O
for	O
almost	O
every	O
distributed	B-Operating_System
memory	I-Operating_System
architecture	O
)	O
and	O
speed	O
(	O
because	O
each	O
implementation	O
is	O
in	O
principle	O
optimized	O
for	O
the	O
hardware	O
on	O
which	O
it	O
runs	O
)	O
.	O
</s>
<s>
MPI	O
uses	O
Language	B-Language
Independent	I-Language
Specifications	I-Language
(	O
LIS	O
)	O
for	O
calls	O
and	O
language	B-Application
bindings	I-Application
.	O
</s>
<s>
The	O
first	O
MPI	O
standard	O
specified	O
ANSI	O
C	B-Language
and	O
Fortran-77	O
bindings	B-Application
together	O
with	O
the	O
LIS	O
.	O
</s>
<s>
The	O
draft	O
was	O
presented	O
at	O
Supercomputing	B-Architecture
1994	O
(	O
November	O
1994	O
)	O
and	O
finalized	O
soon	O
thereafter	O
.	O
</s>
<s>
At	O
present	O
,	O
the	O
standard	O
has	O
several	O
versions	O
:	O
version	O
1.3	O
(	O
commonly	O
abbreviated	O
MPI-1	O
)	O
,	O
which	O
emphasizes	O
message	B-Architecture
passing	I-Architecture
and	O
has	O
a	O
static	O
runtime	B-Device
environment	I-Device
,	O
MPI-2.2	O
(	O
MPI-2	O
)	O
,	O
which	O
includes	O
new	O
features	O
such	O
as	O
parallel	O
I/O	O
,	O
dynamic	O
process	O
management	O
and	O
remote	O
memory	O
operations	O
,	O
and	O
MPI-3.1	O
(	O
MPI-3	O
)	O
,	O
which	O
includes	O
extensions	O
to	O
the	O
collective	B-Operating_System
operations	I-Operating_System
with	O
non-blocking	O
versions	O
and	O
extensions	O
to	O
the	O
one-sided	O
operations	O
.	O
</s>
<s>
MPI-2	O
'	O
s	O
LIS	O
specifies	O
over	O
500	O
functions	O
and	O
provides	O
language	B-Application
bindings	I-Application
for	O
ISO	O
C	B-Language
,	O
ISO	O
C++	B-Language
,	O
and	O
Fortran	B-Application
90	O
.	O
</s>
<s>
Object	O
interoperability	O
was	O
also	O
added	O
to	O
allow	O
easier	O
mixed-language	O
message	B-Architecture
passing	I-Architecture
programming	I-Architecture
.	O
</s>
<s>
MPI-1.3	O
programs	O
still	O
work	O
under	O
MPI	O
implementations	B-Application
compliant	O
with	O
the	O
MPI-2	O
standard	O
.	O
</s>
<s>
MPI-3	O
includes	O
new	O
Fortran	B-Application
2008	O
bindings	B-Application
,	O
while	O
it	O
removes	O
deprecated	O
C++	B-Language
bindings	B-Application
as	O
well	O
as	O
many	O
deprecated	O
routines	O
and	O
MPI	O
objects	O
.	O
</s>
<s>
MPI	O
is	O
often	O
compared	O
with	O
Parallel	B-Operating_System
Virtual	I-Operating_System
Machine	I-Operating_System
(	O
PVM	B-Operating_System
)	O
,	O
which	O
is	O
a	O
popular	O
distributed	O
environment	O
and	O
message	B-Architecture
passing	I-Architecture
system	O
developed	O
in	O
1989	O
,	O
and	O
which	O
was	O
one	O
of	O
the	O
systems	O
that	O
motivated	O
the	O
need	O
for	O
standard	O
parallel	O
message	B-Architecture
passing	I-Architecture
.	O
</s>
<s>
Threaded	O
shared	B-Operating_System
memory	I-Operating_System
programming	I-Operating_System
models	O
(	O
such	O
as	O
Pthreads	B-Operating_System
and	O
OpenMP	B-Application
)	O
and	O
message	B-Architecture
passing	I-Architecture
programming	I-Architecture
(	O
MPI/PVM	O
)	O
can	O
be	O
considered	O
complementary	O
and	O
have	O
been	O
used	O
together	O
on	O
occasion	O
in	O
,	O
for	O
example	O
,	O
servers	O
with	O
multiple	O
large	O
shared-memory	B-Operating_System
nodes	O
.	O
</s>
<s>
The	O
MPI	O
interface	O
is	O
meant	O
to	O
provide	O
essential	O
virtual	O
topology	O
,	O
synchronization	O
,	O
and	O
communication	O
functionality	O
between	O
a	O
set	O
of	O
processes	B-Operating_System
(	O
that	O
have	O
been	O
mapped	O
to	O
nodes/servers/computer	O
instances	O
)	O
in	O
a	O
language-independent	O
way	O
,	O
with	O
language-specific	O
syntax	O
(	O
bindings	B-Application
)	O
,	O
plus	O
a	O
few	O
language-specific	O
features	O
.	O
</s>
<s>
MPI	O
programs	O
always	O
work	O
with	O
processes	B-Operating_System
,	O
but	O
programmers	O
commonly	O
refer	O
to	O
the	O
processes	B-Operating_System
as	O
processors	O
.	O
</s>
<s>
Typically	O
,	O
for	O
maximum	O
performance	O
,	O
each	O
CPU	B-Device
(	O
or	O
core	B-Architecture
in	O
a	O
multi-core	B-Architecture
machine	O
)	O
will	O
be	O
assigned	O
just	O
a	O
single	O
process	O
.	O
</s>
<s>
This	O
assignment	O
happens	O
at	O
runtime	B-Device
through	O
the	O
agent	O
that	O
starts	O
the	O
MPI	O
program	O
,	O
normally	O
called	O
mpirun	O
or	O
mpiexec	O
.	O
</s>
<s>
MPI	O
library	B-Library
functions	I-Library
include	O
,	O
but	O
are	O
not	O
limited	O
to	O
,	O
point-to-point	O
rendezvous-type	O
send/receive	O
operations	O
,	O
choosing	O
between	O
a	O
Cartesian	B-Algorithm
or	O
graph-like	O
logical	O
process	O
topology	O
,	O
exchanging	O
data	O
between	O
process	O
pairs	O
(	O
send/receive	O
operations	O
)	O
,	O
combining	O
partial	O
results	O
of	O
computations	O
(	O
gather	O
and	O
reduce	O
operations	O
)	O
,	O
synchronizing	O
nodes	O
(	O
barrier	O
operation	O
)	O
as	O
well	O
as	O
obtaining	O
network-related	O
information	O
such	O
as	O
the	O
number	O
of	O
processes	B-Operating_System
in	O
the	O
computing	O
session	O
,	O
current	O
processor	O
identity	O
that	O
a	O
process	O
is	O
mapped	O
to	O
,	O
neighboring	O
processes	B-Operating_System
accessible	O
in	O
a	O
logical	O
topology	O
,	O
and	O
so	O
on	O
.	O
</s>
<s>
Point-to-point	O
operations	O
come	O
in	O
synchronous	O
,	O
asynchronous	B-Architecture
,	O
buffered	O
,	O
and	O
ready	O
forms	O
,	O
to	O
allow	O
both	O
relatively	O
stronger	O
and	O
weaker	O
semantics	B-Application
for	O
the	O
synchronization	O
aspects	O
of	O
a	O
rendezvous-send	O
.	O
</s>
<s>
Many	O
outstanding	O
operations	O
are	O
possible	O
in	O
asynchronous	B-Architecture
mode	O
,	O
in	O
most	O
implementations	B-Application
.	O
</s>
<s>
MPI-1	O
and	O
MPI-2	O
both	O
enable	O
implementations	B-Application
that	O
overlap	O
communication	O
and	O
computation	O
,	O
but	O
practice	O
and	O
theory	O
differ	O
.	O
</s>
<s>
MPI	O
also	O
specifies	O
thread	B-Operating_System
safe	I-Operating_System
interfaces	O
,	O
which	O
have	O
cohesion	O
and	O
coupling	B-Application
strategies	O
that	O
help	O
avoid	O
hidden	O
state	O
within	O
the	O
interface	O
.	O
</s>
<s>
It	O
is	O
relatively	O
easy	O
to	O
write	O
multithreaded	B-General_Concept
point-to-point	O
MPI	O
code	O
,	O
and	O
some	O
implementations	B-Application
support	O
such	O
code	O
.	O
</s>
<s>
Multithreaded	B-General_Concept
collective	O
communication	O
is	O
best	O
accomplished	O
with	O
multiple	O
copies	O
of	O
Communicators	O
,	O
as	O
described	O
below	O
.	O
</s>
<s>
Communicator	O
objects	O
connect	O
groups	O
of	O
processes	B-Operating_System
in	O
the	O
MPI	O
session	O
.	O
</s>
<s>
Each	O
communicator	O
gives	O
each	O
contained	O
process	O
an	O
independent	O
identifier	O
and	O
arranges	O
its	O
contained	O
processes	B-Operating_System
in	O
an	O
ordered	O
topology	O
.	O
</s>
<s>
MPI	O
also	O
has	O
explicit	O
groups	O
,	O
but	O
these	O
are	O
mainly	O
good	O
for	O
organizing	O
and	O
reorganizing	O
groups	O
of	O
processes	B-Operating_System
before	O
another	O
communicator	O
is	O
made	O
.	O
</s>
<s>
A	O
number	O
of	O
important	O
MPI	O
functions	O
involve	O
communication	O
between	O
two	O
specific	O
processes	B-Operating_System
.	O
</s>
<s>
Point-to-point	O
operations	O
,	O
as	O
these	O
are	O
called	O
,	O
are	O
particularly	O
useful	O
in	O
patterned	O
or	O
irregular	O
communication	O
,	O
for	O
example	O
,	O
a	O
data-parallel	B-Operating_System
architecture	O
in	O
which	O
each	O
processor	O
routinely	O
swaps	O
regions	O
of	O
data	O
with	O
specific	O
other	O
processors	O
between	O
calculation	O
steps	O
,	O
or	O
a	O
master	B-Operating_System
–	I-Operating_System
slave	I-Operating_System
architecture	O
in	O
which	O
the	O
master	O
sends	O
new	O
task	O
data	O
to	O
a	O
slave	O
whenever	O
the	O
prior	O
task	O
is	O
completed	O
.	O
</s>
<s>
MPI-1	O
specifies	O
mechanisms	O
for	O
both	O
blocking	B-Operating_System
and	O
non-blocking	O
point-to-point	O
communication	O
mechanisms	O
,	O
as	O
well	O
as	O
the	O
so-called	O
'	O
ready-send	O
'	O
mechanism	O
whereby	O
a	O
send	O
request	O
can	O
be	O
made	O
only	O
when	O
the	O
matching	O
receive	O
request	O
has	O
already	O
been	O
made	O
.	O
</s>
<s>
Collective	B-Operating_System
functions	I-Operating_System
involve	O
communication	O
among	O
all	O
processes	B-Operating_System
in	O
a	O
process	O
group	O
(	O
which	O
can	O
mean	O
the	O
entire	O
process	O
pool	O
or	O
a	O
program-defined	O
subset	O
)	O
.	O
</s>
<s>
A	O
typical	O
function	O
is	O
the	O
MPI_Bcast	O
call	O
(	O
short	O
for	O
"	O
broadcast	B-Operating_System
"	O
)	O
.	O
</s>
<s>
This	O
function	O
takes	O
data	O
from	O
one	O
node	O
and	O
sends	O
it	O
to	O
all	O
processes	B-Operating_System
in	O
the	O
process	O
group	O
.	O
</s>
<s>
A	O
reverse	O
operation	O
is	O
the	O
MPI_Reduce	O
call	O
,	O
which	O
takes	O
data	O
from	O
all	O
processes	B-Operating_System
in	O
a	O
group	O
,	O
performs	O
an	O
operation	O
(	O
such	O
as	O
summing	O
)	O
,	O
and	O
stores	O
the	O
results	O
on	O
one	O
node	O
.	O
</s>
<s>
Many	O
MPI	O
functions	O
require	O
that	O
you	O
specify	O
the	O
type	O
of	O
data	O
which	O
is	O
sent	O
between	O
processes	B-Operating_System
.	O
</s>
<s>
This	O
is	O
because	O
MPI	O
aims	O
to	O
support	O
heterogeneous	O
environments	O
where	O
types	O
might	O
be	O
represented	O
differently	O
on	O
the	O
different	O
nodes	O
(	O
for	O
example	O
they	O
might	O
be	O
running	O
different	O
CPU	B-Device
architectures	B-General_Concept
that	O
have	O
different	O
endianness	O
)	O
,	O
in	O
which	O
case	O
MPI	O
implementations	B-Application
can	O
perform	O
data	O
conversion	O
.	O
</s>
<s>
Since	O
the	O
C	B-Language
language	I-Language
does	O
not	O
allow	O
a	O
type	O
itself	O
to	O
be	O
passed	O
as	O
a	O
parameter	O
,	O
MPI	O
predefines	O
the	O
constants	O
MPI_INT	O
,	O
MPI_CHAR	O
,	O
MPI_DOUBLE	O
to	O
correspond	O
with	O
int	O
,	O
char	O
,	O
double	O
,	O
etc	O
.	O
</s>
<s>
Here	O
is	O
an	O
example	O
in	O
C	B-Language
that	O
passes	O
arrays	O
of	O
ints	O
from	O
all	O
processes	B-Operating_System
to	O
one	O
.	O
</s>
<s>
All	O
the	O
processes	B-Operating_System
ask	O
to	O
send	O
their	O
arrays	O
to	O
the	O
root	O
with	O
MPI_Gather	O
,	O
which	O
is	O
equivalent	O
to	O
having	O
each	O
process	O
(	O
including	O
the	O
root	O
itself	O
)	O
call	O
MPI_Send	O
and	O
the	O
root	O
make	O
the	O
corresponding	O
number	O
of	O
ordered	O
MPI_Recv	O
calls	O
to	O
assemble	O
all	O
of	O
these	O
arrays	O
into	O
a	O
larger	O
one	O
:	O
</s>
<s>
The	O
disp	O
(	O
displacements	O
)	O
array	O
is	O
needed	O
for	O
data	B-Application
structure	I-Application
alignment	I-Application
,	O
since	O
the	O
compiler	O
may	O
pad	O
the	O
variables	O
in	O
a	O
class	O
or	O
data	O
structure	O
.	O
</s>
<s>
This	O
is	O
done	O
with	O
MPI_Get_address	O
,	O
which	O
is	O
normally	O
the	O
same	O
as	O
C	B-Language
's	O
&	O
operator	O
but	O
that	O
might	O
not	O
be	O
true	O
when	O
dealing	O
with	O
memory	B-General_Concept
segmentation	I-General_Concept
.	O
</s>
<s>
This	O
is	O
because	O
fixed-size	O
blocks	O
do	O
not	O
require	O
serialization	B-Application
during	O
transfer	O
.	O
</s>
<s>
Here	O
's	O
the	O
C	B-Language
code	O
for	O
building	O
an	O
MPI-derived	O
data	O
type	O
:	O
</s>
<s>
The	O
key	O
aspect	O
is	O
"	O
the	O
ability	O
of	O
an	O
MPI	O
process	O
to	O
participate	O
in	O
the	O
creation	O
of	O
new	O
MPI	O
processes	B-Operating_System
or	O
to	O
establish	O
communication	O
with	O
MPI	O
processes	B-Operating_System
that	O
have	O
been	O
started	O
separately.	O
"	O
</s>
<s>
The	O
MPI-2	O
specification	O
describes	O
three	O
main	O
interfaces	O
by	O
which	O
MPI	O
processes	B-Operating_System
can	O
dynamically	O
establish	O
communications	O
,	O
MPI_Comm_spawn	O
,	O
MPI_Comm_accept/MPI_Comm_connect	O
and	O
MPI_Comm_join	O
.	O
</s>
<s>
The	O
newly	O
spawned	O
set	O
of	O
MPI	O
processes	B-Operating_System
form	O
a	O
new	O
MPI_COMM_WORLD	O
intracommunicator	O
but	O
can	O
communicate	O
with	O
the	O
parent	O
and	O
the	O
intercommunicator	O
the	O
function	O
returns	O
.	O
</s>
<s>
Collective	O
I/O	O
substantially	O
boosts	B-Language
applications	O
 '	O
I/O	O
bandwidth	O
by	O
having	O
processes	B-Operating_System
collectively	O
transform	O
the	O
small	O
and	O
noncontiguous	O
I/O	O
operations	O
into	O
large	O
and	O
contiguous	O
ones	O
,	O
thereby	O
reducing	O
the	O
locking	B-Operating_System
and	O
disk	O
seek	O
overhead	O
.	O
</s>
<s>
Due	O
to	O
its	O
vast	O
performance	O
benefits	O
,	O
MPI-IO	O
also	O
became	O
the	O
underlying	O
I/O	O
layer	O
for	O
many	O
state-of-the-art	O
I/O	O
libraries	O
,	O
such	O
as	O
HDF5	B-Application
and	O
Parallel	B-Application
NetCDF	I-Application
.	O
</s>
<s>
The	O
initial	O
implementation	O
of	O
the	O
MPI	O
1.x	O
standard	O
was	O
MPICH	B-Library
,	O
from	O
Argonne	O
National	O
Laboratory	O
(	O
ANL	O
)	O
and	O
Mississippi	O
State	O
University	O
.	O
</s>
<s>
IBM	O
also	O
was	O
an	O
early	O
implementor	O
,	O
and	O
most	O
early	O
90s	O
supercomputer	B-Architecture
companies	O
either	O
commercialized	O
MPICH	B-Library
,	O
or	O
built	O
their	O
own	O
implementation	O
.	O
</s>
<s>
LAM/MPI	B-Operating_System
from	O
Ohio	B-Architecture
Supercomputer	I-Architecture
Center	I-Architecture
was	O
another	O
early	O
open	O
implementation	O
.	O
</s>
<s>
ANL	O
has	O
continued	O
developing	O
MPICH	B-Library
for	O
over	O
a	O
decade	O
,	O
and	O
now	O
offers	O
MPICH-3.2	O
,	O
implementing	O
the	O
MPI-3.1	O
standard	O
.	O
</s>
<s>
Open	B-Library
MPI	I-Library
(	O
not	O
to	O
be	O
confused	O
with	O
OpenMP	B-Application
)	O
was	O
formed	O
by	O
the	O
merging	O
FT-MPI	O
,	O
LA-MPI	O
,	O
LAM/MPI	B-Operating_System
,	O
and	O
PACX-MPI	O
,	O
and	O
is	O
found	O
in	O
many	O
TOP-500	B-Operating_System
supercomputers	B-Architecture
.	O
</s>
<s>
Many	O
other	O
efforts	O
are	O
derivatives	O
of	O
MPICH	B-Library
,	O
LAM	O
,	O
and	O
other	O
works	O
,	O
including	O
,	O
but	O
not	O
limited	O
to	O
,	O
commercial	O
implementations	B-Application
from	O
HP	O
,	O
Intel	O
,	O
Microsoft	O
,	O
and	O
NEC	O
.	O
</s>
<s>
While	O
the	O
specifications	O
mandate	O
a	O
C	B-Language
and	O
Fortran	B-Application
interface	O
,	O
the	O
language	O
used	O
to	O
implement	O
MPI	O
is	O
not	O
constrained	O
to	O
match	O
the	O
language	O
or	O
languages	O
it	O
seeks	O
to	O
support	O
at	O
runtime	B-Device
.	O
</s>
<s>
Most	O
implementations	B-Application
combine	O
C	B-Language
,	O
C++	B-Language
and	O
assembly	O
language	O
,	O
and	O
target	O
C	B-Language
,	O
C++	B-Language
,	O
and	O
Fortran	B-Application
programmers	O
.	O
</s>
<s>
Bindings	B-Application
are	O
available	O
for	O
many	O
other	O
languages	O
,	O
including	O
Perl	O
,	O
Python	B-Language
,	O
R	B-Language
,	O
Ruby	O
,	O
Java	B-Language
,	O
and	O
CL	B-Operating_System
(	O
see	O
#Language	O
bindings	B-Application
)	O
.	O
</s>
<s>
The	O
ABI	B-Operating_System
of	O
MPI	O
implementations	B-Application
are	O
roughly	O
split	O
between	O
MPICH	B-Library
and	O
Open	B-Library
MPI	I-Library
derivatives	O
,	O
so	O
that	O
a	O
library	O
from	O
one	O
family	O
works	O
as	O
a	O
drop-in	O
replacement	O
of	O
one	O
from	O
the	O
same	O
family	O
,	O
but	O
direct	O
replacement	O
across	O
families	O
is	O
impossible	O
.	O
</s>
<s>
MPI	O
hardware	O
research	O
focuses	O
on	O
implementing	O
MPI	O
directly	O
in	O
hardware	O
,	O
for	O
example	O
via	O
processor-in-memory	B-Architecture
,	O
building	O
MPI	O
operations	O
into	O
the	O
microcircuitry	O
of	O
the	O
RAM	B-Architecture
chips	I-Architecture
in	O
each	O
node	O
.	O
</s>
<s>
By	O
implication	O
,	O
this	O
approach	O
is	O
independent	O
of	O
language	O
,	O
operating	O
system	O
,	O
and	O
CPU	B-Device
,	O
but	O
cannot	O
be	O
readily	O
updated	O
or	O
removed	O
.	O
</s>
<s>
Another	O
approach	O
has	O
been	O
to	O
add	O
hardware	O
acceleration	O
to	O
one	O
or	O
more	O
parts	O
of	O
the	O
operation	O
,	O
including	O
hardware	O
processing	O
of	O
MPI	O
queues	O
and	O
using	O
RDMA	B-General_Concept
to	O
directly	O
transfer	O
data	O
between	O
memory	O
and	O
the	O
network	B-Protocol
interface	I-Protocol
controller	I-Protocol
without	O
CPU	B-Device
or	O
OS	O
kernel	O
intervention	O
.	O
</s>
<s>
mpicc	B-Application
(	O
and	O
similarly	O
mpic++	O
,	O
mpif90	O
,	O
etc	O
.	O
)	O
</s>
<s>
Bindings	B-Application
are	O
libraries	O
that	O
extend	O
MPI	O
support	O
to	O
other	O
languages	O
by	O
wrapping	O
an	O
existing	O
MPI	O
implementation	O
such	O
as	O
MPICH	B-Library
or	O
Open	B-Library
MPI	I-Library
.	O
</s>
<s>
The	O
two	O
managed	O
Common	O
Language	O
Infrastructure	O
.NET	B-Application
implementations	B-Application
are	O
Pure	O
Mpi.NET	O
and	O
MPI.NET	O
,	O
a	O
research	O
effort	O
at	O
Indiana	O
University	O
licensed	O
under	O
a	O
BSD-style	O
license	O
.	O
</s>
<s>
It	O
is	O
compatible	O
with	O
Mono	B-Application
,	O
and	O
can	O
make	O
full	O
use	O
of	O
underlying	O
low-latency	O
MPI	O
network	O
fabrics	O
.	O
</s>
<s>
Although	O
Java	B-Language
does	O
not	O
have	O
an	O
official	O
MPI	O
binding	O
,	O
several	O
groups	O
attempt	O
to	O
bridge	O
the	O
two	O
,	O
with	O
different	O
degrees	O
of	O
success	O
and	O
compatibility	O
.	O
</s>
<s>
One	O
of	O
the	O
first	O
attempts	O
was	O
Bryan	O
Carpenter	O
's	O
mpiJava	O
,	O
essentially	O
a	O
set	O
of	O
Java	B-Language
Native	I-Language
Interface	I-Language
(	O
JNI	B-Language
)	O
wrappers	O
to	O
a	O
local	O
C	B-Language
MPI	O
library	O
,	O
resulting	O
in	O
a	O
hybrid	O
implementation	O
with	O
limited	O
portability	B-Architecture
,	O
which	O
also	O
has	O
to	O
be	O
compiled	O
against	O
the	O
specific	O
MPI	O
library	O
being	O
used	O
.	O
</s>
<s>
However	O
,	O
this	O
original	O
project	O
also	O
defined	O
the	O
mpiJava	O
API	B-General_Concept
(	O
a	O
de	O
facto	O
MPI	O
API	B-General_Concept
for	O
Java	B-Language
that	O
closely	O
followed	O
the	O
equivalent	O
C++	B-Language
bindings	B-Application
)	O
which	O
other	O
subsequent	O
Java	B-Language
MPI	O
projects	O
adopted	O
.	O
</s>
<s>
One	O
less-used	O
API	B-General_Concept
is	O
MPJ	O
API	B-General_Concept
,	O
which	O
was	O
designed	O
to	O
be	O
more	O
object-oriented	B-Language
and	O
closer	O
to	O
Sun	O
Microsystems	O
 '	O
coding	O
conventions	O
.	O
</s>
<s>
Beyond	O
the	O
API	B-General_Concept
,	O
Java	B-Language
MPI	O
libraries	O
can	O
be	O
either	O
dependent	O
on	O
a	O
local	O
MPI	O
library	O
,	O
or	O
implement	O
the	O
message	B-Architecture
passing	I-Architecture
functions	O
in	O
Java	B-Language
,	O
while	O
some	O
like	O
P2P-MPI	O
also	O
provide	O
peer-to-peer	O
functionality	O
and	O
allow	O
mixed-platform	O
operation	O
.	O
</s>
<s>
Some	O
of	O
the	O
most	O
challenging	O
parts	O
of	O
Java/MPI	O
arise	O
from	O
Java	B-Language
characteristics	O
such	O
as	O
the	O
lack	O
of	O
explicit	O
pointers	O
and	O
the	O
linear	B-General_Concept
memory	I-General_Concept
address	O
space	O
for	O
its	O
objects	O
,	O
which	O
make	O
transferring	O
multidimensional	O
arrays	O
and	O
complex	O
objects	O
inefficient	O
.	O
</s>
<s>
Workarounds	O
usually	O
involve	O
transferring	O
one	O
line	O
at	O
a	O
time	O
and/or	O
performing	O
explicit	O
de-serialization	O
and	O
casting	O
at	O
both	O
the	O
sending	O
and	O
receiving	O
ends	O
,	O
simulating	O
C	B-Language
or	O
Fortran-like	O
arrays	O
by	O
the	O
use	O
of	O
a	O
one-dimensional	O
array	O
,	O
and	O
pointers	O
to	O
primitive	O
types	O
by	O
the	O
use	O
of	O
single-element	O
arrays	O
,	O
thus	O
resulting	O
in	O
programming	O
styles	O
quite	O
far	O
from	O
Java	B-Language
conventions	O
.	O
</s>
<s>
Another	O
Java	B-Language
message	B-Architecture
passing	I-Architecture
system	O
is	O
MPJ	O
Express	O
.	O
</s>
<s>
Recent	O
versions	O
can	O
be	O
executed	O
in	O
cluster	O
and	O
multicore	B-Architecture
configurations	O
.	O
</s>
<s>
In	O
the	O
cluster	O
configuration	O
,	O
it	O
can	O
execute	O
parallel	O
Java	B-Language
applications	O
on	O
clusters	O
and	O
clouds	O
.	O
</s>
<s>
Here	O
Java	B-Language
sockets	B-Protocol
or	O
specialized	O
I/O	O
interconnects	O
like	O
Myrinet	B-General_Concept
can	O
support	O
messaging	O
between	O
MPJ	O
Express	O
processes	B-Operating_System
.	O
</s>
<s>
It	O
can	O
also	O
utilize	O
native	O
C	B-Language
implementation	O
of	O
MPI	O
using	O
its	O
native	O
device	O
.	O
</s>
<s>
In	O
the	O
multicore	B-Architecture
configuration	O
,	O
a	O
parallel	O
Java	B-Language
application	O
is	O
executed	O
on	O
multicore	B-Architecture
processors	I-Architecture
.	O
</s>
<s>
In	O
this	O
mode	O
,	O
MPJ	O
Express	O
processes	B-Operating_System
are	O
represented	O
by	O
Java	B-Language
threads	O
.	O
</s>
<s>
There	O
is	O
a	O
Julia	B-Application
language	I-Application
wrapper	O
for	O
MPI	O
.	O
</s>
<s>
There	O
are	O
a	O
few	O
academic	O
implementations	B-Application
of	O
MPI	O
using	O
MATLAB	B-Language
.	O
</s>
<s>
MATLAB	B-Language
has	O
its	O
own	O
parallel	O
extension	O
library	O
implemented	O
using	O
MPI	O
and	O
PVM	B-Operating_System
.	O
</s>
<s>
An	O
11,000	O
-line	O
OCaml	B-Language
program	O
was	O
"	O
MPI-ified	O
"	O
using	O
the	O
module	O
,	O
with	O
an	O
additional	O
500	O
lines	O
of	O
code	O
and	O
slight	O
restructuring	O
and	O
ran	O
with	O
excellent	O
results	O
on	O
up	O
to	O
170	O
nodes	O
in	O
a	O
supercomputer	B-Architecture
.	O
</s>
<s>
PARI/GP	B-Language
can	O
be	O
built	O
to	O
use	O
MPI	O
as	O
its	O
multi-thread	O
engine	O
,	O
allowing	O
to	O
run	O
parallel	O
PARI	O
and	O
GP	O
programs	O
on	O
MPI	O
clusters	O
unmodified	O
.	O
</s>
<s>
MPI	O
implementations	B-Application
in	O
Python	B-Language
include	O
:	O
pyMPI	B-Language
,	O
mpi4py	O
,	O
pypar	O
,	O
MYMPI	O
,	O
and	O
the	O
MPI	O
submodule	O
in	O
ScientificPython	B-Library
.	O
</s>
<s>
pyMPI	B-Language
is	O
notable	O
because	O
it	O
is	O
a	O
variant	O
python	B-Language
interpreter	O
,	O
while	O
pypar	O
,	O
MYMPI	O
,	O
and	O
ScientificPython	B-Library
's	O
module	O
are	O
import	O
modules	O
.	O
</s>
<s>
In	O
2006	O
the	O
Boost	B-Language
C++	I-Language
Libraries	I-Language
acquired	O
Boost:MPI	O
which	O
included	O
the	O
MPI	O
Python	B-Language
Bindings	B-Application
.	O
</s>
<s>
This	O
is	O
of	O
particular	O
help	O
for	O
mixing	O
C++	B-Language
and	O
Python	B-Language
.	O
</s>
<s>
Boost:MPI	O
'	O
s	O
Python	B-Language
bindings	B-Application
still	O
have	O
unfixed	O
packaging	O
bugs	O
in	O
CentOS	O
.	O
</s>
<s>
R	B-Language
bindings	B-Application
of	O
MPI	O
include	O
Rmpi	O
and	O
pbdMPI	B-Algorithm
,	O
where	O
Rmpi	O
focuses	O
on	O
manager-workers	B-Operating_System
parallelism	B-Operating_System
while	O
pbdMPI	B-Algorithm
focuses	O
on	O
SPMD	B-Operating_System
parallelism	B-Operating_System
.	O
</s>
<s>
Both	O
implementations	B-Application
fully	O
support	O
Open	B-Library
MPI	I-Library
or	O
MPICH2	B-Library
.	O
</s>
<s>
program	O
in	O
MPI	O
written	O
in	O
C	B-Language
.	O
In	O
this	O
example	O
,	O
we	O
send	O
a	O
"	O
hello	O
"	O
message	O
to	O
each	O
processor	O
,	O
manipulate	O
it	O
trivially	O
,	O
return	O
the	O
results	O
to	O
the	O
main	O
process	O
,	O
and	O
print	O
the	O
messages	O
.	O
</s>
<s>
When	O
run	O
with	O
4	O
processes	B-Operating_System
,	O
it	O
should	O
produce	O
the	O
following	O
output	O
:	O
</s>
<s>
Here	O
,	O
mpiexec	O
is	O
a	O
command	O
used	O
to	O
execute	O
the	O
example	O
program	O
with	O
4	O
processes	B-Operating_System
,	O
each	O
of	O
which	O
is	O
an	O
independent	O
instance	O
of	O
the	O
program	O
at	O
run	O
time	O
and	O
assigned	O
ranks	O
(	O
i.e.	O
</s>
<s>
The	O
name	O
mpiexec	O
is	O
recommended	O
by	O
the	O
MPI	O
standard	O
,	O
although	O
some	O
implementations	B-Application
provide	O
a	O
similar	O
command	O
under	O
the	O
name	O
mpirun	O
.	O
</s>
<s>
The	O
MPI_COMM_WORLD	O
is	O
the	O
communicator	O
that	O
consists	O
of	O
all	O
the	O
processes	B-Operating_System
.	O
</s>
<s>
A	O
single	B-Operating_System
program	I-Operating_System
,	I-Operating_System
multiple	I-Operating_System
data	I-Operating_System
(	O
SPMD	B-Operating_System
)	O
programming	O
model	O
is	O
thereby	O
facilitated	O
,	O
but	O
not	O
required	O
;	O
many	O
MPI	O
implementations	B-Application
allow	O
multiple	O
,	O
different	O
,	O
executables	O
to	O
be	O
started	O
in	O
the	O
same	O
MPI	O
job	O
.	O
</s>
<s>
Each	O
process	O
has	O
its	O
own	O
rank	O
,	O
the	O
total	O
number	O
of	O
processes	B-Operating_System
in	O
the	O
world	O
,	O
and	O
the	O
ability	O
to	O
communicate	O
between	O
them	O
either	O
with	O
point-to-point	O
(	O
send/receive	O
)	O
communication	O
,	O
or	O
by	O
collective	O
communication	O
among	O
the	O
group	O
.	O
</s>
<s>
It	O
is	O
enough	O
for	O
MPI	O
to	O
provide	O
an	O
SPMD-style	O
program	O
with	O
MPI_COMM_WORLD	O
,	O
its	O
own	O
rank	O
,	O
and	O
the	O
size	O
of	O
the	O
world	O
to	O
allow	O
algorithms	O
to	O
decide	O
what	O
to	O
do	O
.	O
</s>
<s>
It	O
generally	O
works	O
as	O
expected	O
on	O
the	O
rank-0	O
process	O
,	O
and	O
some	O
implementations	B-Application
also	O
capture	O
and	O
funnel	O
the	O
output	O
from	O
other	O
processes	B-Operating_System
.	O
</s>
<s>
Program	O
copies	O
are	O
mapped	O
to	O
processors	O
by	O
the	O
MPI	O
runtime	B-Device
.	O
</s>
<s>
In	O
that	O
sense	O
,	O
the	O
parallel	B-Operating_System
machine	I-Operating_System
can	O
map	O
to	O
one	O
physical	O
processor	O
,	O
or	O
to	O
N	O
processors	O
,	O
where	O
N	O
is	O
the	O
number	O
of	O
available	O
processors	O
,	O
or	O
even	O
something	O
in	O
between	O
.	O
</s>
<s>
This	O
example	O
adjusts	O
its	O
behavior	O
to	O
the	O
size	O
of	O
the	O
world	O
N	O
,	O
so	O
it	O
also	O
seeks	O
to	O
scale	O
to	O
the	O
runtime	B-Device
configuration	O
without	O
compilation	O
for	O
each	O
size	O
variation	O
,	O
although	O
runtime	B-Device
decisions	O
might	O
vary	O
depending	O
on	O
that	O
absolute	O
amount	O
of	O
concurrency	B-Operating_System
available	O
.	O
</s>
<s>
MPI-2	O
implementations	B-Application
include	O
I/O	O
and	O
dynamic	O
process	O
management	O
,	O
and	O
the	O
size	O
of	O
the	O
middleware	O
is	O
substantially	O
larger	O
.	O
</s>
<s>
Portability	B-Architecture
concerns	O
initially	O
slowed	O
adoption	O
,	O
although	O
wider	O
support	O
has	O
lessened	O
this	O
.	O
</s>
<s>
Architectures	B-General_Concept
are	O
changing	O
,	O
with	O
greater	O
internal	O
concurrency	B-Operating_System
(	O
multi-core	B-Architecture
)	O
,	O
better	O
fine-grained	O
concurrency	B-Operating_System
control	O
(	O
threading	O
,	O
affinity	O
)	O
,	O
and	O
more	O
levels	O
of	O
memory	B-General_Concept
hierarchy	I-General_Concept
.	O
</s>
<s>
Multithreaded	B-General_Concept
programs	O
can	O
take	O
advantage	O
of	O
these	O
developments	O
more	O
easily	O
than	O
single-threaded	O
applications	O
.	O
</s>
<s>
This	O
has	O
already	O
yielded	O
separate	O
,	O
complementary	O
standards	O
for	O
symmetric	B-Operating_System
multiprocessing	I-Operating_System
,	O
namely	O
OpenMP	B-Application
.	O
</s>
<s>
MPI-2	O
defines	O
how	O
standard-conforming	O
implementations	B-Application
should	O
deal	O
with	O
multithreaded	B-General_Concept
issues	O
,	O
but	O
does	O
not	O
require	O
that	O
implementations	B-Application
be	O
multithreaded	B-General_Concept
,	O
or	O
even	O
thread-safe	B-Operating_System
.	O
</s>
<s>
MPI-3	O
adds	O
the	O
ability	O
to	O
use	O
shared-memory	B-Operating_System
parallelism	B-Operating_System
within	O
a	O
node	O
.	O
</s>
<s>
Implementations	B-Application
of	O
MPI	O
such	O
as	O
Adaptive	O
MPI	O
,	O
Hybrid	O
MPI	O
,	O
Fine-Grained	O
MPI	O
,	O
MPC	O
and	O
others	O
offer	O
extensions	O
to	O
the	O
MPI	O
standard	O
that	O
address	O
different	O
challenges	O
in	O
MPI	O
.	O
</s>
<s>
Astrophysicist	O
Jonathan	O
Dursi	O
wrote	O
an	O
opinion	O
piece	O
calling	O
MPI	O
obsolescent	O
,	O
pointing	O
to	O
newer	O
technologies	O
like	O
the	O
Chapel	B-Language
language	O
,	O
Unified	B-Operating_System
Parallel	I-Operating_System
C	I-Operating_System
,	O
Hadoop	B-Application
,	O
Spark	B-Language
and	O
Flink	B-Application
.	O
</s>
<s>
At	O
the	O
same	O
time	O
,	O
nearly	O
all	O
of	O
the	O
projects	O
in	O
the	O
Exascale	B-General_Concept
Computing	I-General_Concept
Project	I-General_Concept
build	O
explicitly	O
on	O
MPI	O
;	O
MPI	O
has	O
been	O
shown	O
to	O
scale	O
to	O
the	O
largest	O
machines	O
as	O
of	O
the	O
early	O
2020s	O
and	O
is	O
widely	O
considered	O
to	O
stay	O
relevant	O
for	O
a	O
long	O
time	O
to	O
come	O
.	O
</s>
