You are on page 1of 31

mpi .

t xt
MPI
- spawn/ at t ach
- communi cat or s
- pt 2pt r equest s
- col l ect i ve
- RMA
- er r or ( handl i ng, FT,
r epor t i ng)
MPI D
- messages
- t r adi t i on MPI message
- one- si ded oper at i ons
- cont r ol ?
- st r eams
- pr ocess management ( vi a BNR)
Pgi na 1
mpi . t xt
Communi cat i on Met hods
- TCP
- VI A
- Shar ed Memor y
- Loopback
- I MPI
================================
================================
===============
MPI l ayer
- - - - - - - - - - - - - - - - - - - -
Oper at i ons
Pgi na 2
mpi . t xt
- poi nt - t o- poi nt
- r equest s
- dat at ypes
- communi cat or s
- st at us
- er r or s
- col l ect i ve
- dat at ypes
- communi cat or s
- er r or s
- pr ocess management
- communi cat or s
- i nf o
- er r or s
Pgi na 3
mpi . t xt
- RMA
- dat at ypes
- wi ndows
- communi cat or s
- gr oups
- epoch
- er r or s
- I / O
- depends on
- f i l es
- dat at ypes
- r equest s
- i nf o
- st at us
- er r or s
Pgi na 4
mpi . t xt
* i mpl ement ed vi a ROMI O
- dependent onl y on MPI
f unct i ons
- f ut ur e enhancement s may
use l ow- l evel i nt er f aces
- t opol ogy
- communi cat or s
- er r or s
* can be i mpl ement ed ent i r el y
at t he MPI l ayer
- gener al i zed r equest s
- er r or s
* can be i mpl ement ed ent i r el y
at t he MPI l ayer
Pgi na 5
mpi . t xt
- - - - - - - - - - - - - - - - - - - -
St r uct ur es
- r equest s
- dat at ypes
- communi cat or s
- gr oups
- gr oups
* ar e gr oups modi f i ed or
augment ed by l ow l ayer s?
- wi ndows
- f i l es
* def i ned and i mpl ement ed vi a
ROMI O
- f ut ur e enhancement s may
r equi r e access l ower l ayer s
Pgi na 6
mpi . t xt
- st at us
- er r or s
- at t r i but es
* can be def i ned and
oper at i ons i mpl ement ed ent i r el y
at t he MPI l ayer
- communi cat or
- dat at ypes
- wi ndows
- i nf o
* can be def i ned and
oper at i ons i mpl ement ed ent i r el y
at t he MPI l ayer
================================
================================
Pgi na 7
mpi . t xt
===============
MPI D
- - - - - - - - - - - - - - - - - - - -
Oper at i ons
- poi nt - t o- poi nt
- col l ect i ve oper at i ons
- pr ocess management
- RMA
- gener al i zed r equest s
Pgi na 8
mpi . t xt
St r uct ur es
- - - - - - - - - - - - - - - - - - - -
Concept s
- MPI buf f er movement ( movi ng
buf f er s def i ned by an addr ess,
count and
dat at ype)
- i nt er nal buf f er management
- Connect i on management
Pgi na 9
mpi . t xt
- vi r t ual connect i on
st r uct ur es
- l ow- l evel connnect i on
management ( socket s, et c. )
shoul d be handl ed
ent i r el y by t he devi ce and
pr obabl y dr i ven by a st at e
machi ne
================================
================================
===============
Mul t i - met hod desi gn
Pgi na 10
mpi . t xt
- - - - - - - - - - - - - - - - - - - -
Devi ce- l evel obj ect s
- gr oup
- dat a st r uct ur es
- met hods
- set _connect i on( gr oup,
r ank, vc_pt r ) - associ at e
poi nt er t o vi r t ual
connect i on st r uct ur e wi t h
a ( gr oup, r ank)

Pgi na 11
mpi . t xt
- get _connect i on( gr oup,
r ank) - r et ur ns poi nt er t o
vi r t ual connect i on
st r uct ur e associ at ed wi t h
( gr oup, r ank)
- communi cat or s
- dat a st r uct ur es
- gr oup
- met hods
- set _connect i on( dcomm,
r ank, vc_pt r ) - associ at e
poi nt er t o vi r t ual
Pgi na 12
mpi . t xt
connect i on st r uct ur e wi t h
a ( dcomm, r ank)

- get _connect i on( dcomm,
r ank) - r et ur ns poi nt er t o
vi r t ual connect i on
st r uct ur e associ at ed wi t h
( dcomm, r ank)
- vi r t ual connect i ons
- al l oc( ) - r et ur ns a poi nt er
t o a vi r t ual connect i on
st r uct ur e
- add_r ef ( vc) - i ncr ement s t he
r ef er ence count ( at omi cal l y)
Pgi na 13
mpi . t xt
- r el ease( ) - decr ement s t he
r ef er ence count ; i f t he
r ef er ence count r eaches
zer o, t he st r uct ur e i s f r eed
NOTE: I t may be usef ul t o be
abl e t o l ocat e a vi r t ual
connect i on based on a
pr ocess gr oup I D and r ank, i n
par t so we can det ect when
mul t i pl e vi r t ual
connect i ons mi ght be f or med
bet ween a pai r of pr ocesses.

Pgi na 14
mpi . t xt
can connect / accept be cal l ed
mul t i pl e t i mes bet ween a set of
pr ocesses?
- - - - - - - - - - - - - - - - - - - -
Met hod- l evel f unct i ons
Met hod descr i pt or s ar e st r i ngs
t hat ar e used t o descr i be t he
capabi l i t i es of
t he met hods. These descr i pt or s
can t hen be used t o det er mi ne i f
t wo pr ocesses
mi i ght be capabl e of "t al ki ng"
usi ng t he met hod i n quest i on.
We say "mi ght be
Pgi na 15
mpi . t xt
capabl e" because i n t he case of
a met hod l i ke VI A, i t may be
i mpossi bl e pr ovi de
enough i nf or mat i on i n t he
descr i pt or t o det er mi ne i n t wo
pr ocesses can t al k.
I t may be necessar y t o si mpl y
at t empt t o f or mt he connect i on.
Thi s i mpl i es
t hat bi ndi ng t o a par t i cul ar
pr ot ocol may need t o be def er r ed
unt i l we ar e
r eady t o f or ma r eal connect i on.
However , some met hods, such as
shar ed memor y,
can pr ovi de enough i nf or mat i on
and t hus can be bound
Pgi na 16
mpi . t xt
i mmedi at el y.
- quer y/ get _descr i pt or ( )
- mat ch_descr i pt or s( )
================================
================================
===============
MPI _I ni t ( )
- cr eat e basi c dat at ypes
MPI R_Dat at ype_i ni t ( )
{
Pgi na 17
mpi . t xt
f or each dt ( al l basi c
dat at ypes)
{
MPI D_Dat at ype_i ni t ( dt ,
. . . )
}
}
- i ni t i al i ze devi ce
- BNR i ni t i al i zat i on

BNR_I ni t ( )
BNR_Get _gr oup( &my_bnr _gr oup)
BNR_Get _si ze( my_bnr _gr oup,
&si ze)
Pgi na 18
mpi . t xt
BNR_Get _r ank( my_bnr _gr oup,
&r ank)

BNR_Get _par ent ( &par ent _bnr _gr oup
)
BNR_Mer ge( my_bnr _gr oup,
par ent _bnr _gr oup,
&i nt er _bnr _gr oup)

- l oop t hr ough met hods
- i ni t i al i ze met hod

- quer y f or descr i pt or of
met hod' s capabi l i t i es

Q: what about dymani cl y
Pgi na 19
mpi . t xt
l oaded met hods? do t hey have t o
be i ni t i al i zed now
or can t hey be added l at er ?

- publ i sh capabi l i t i es of al l
known met hods
- i ni t i al i ze AQ, buf f er
management , et c.
- est abl i sh MPI _COMM_WORLD
- cr eat e MPI _GROUP_WORLD
( i nt er nal ) f r omBNR my_gr oup,
et c.
st or es BNR i nf o i n gr oup
Pgi na 20
mpi . t xt
st r uct ur e
al l ocat es vi r t ual connect i on
st r uct ur es
i ni t i al i zes vi r t ual
connect i ons t o st ubs
- cr eat e MPI _COMM_WORLD f r om
MPI _GROUP_WORLD
- est abl i sh i nt er - communi cat or
wi t h par ent ( i f par ent exi st s)

- cr eat e i nt er _gr oup f r om
i nt er _bnr _gr oup

- cr eat e i nt er - communi cat or
f r omi nt er _gr oup
Pgi na 21
mpi . t xt

- cr eat e i nt er _gr oup f r om
i nt er _bnr _gor up
- cr eat e i nt er - communi cat or f r om
i nt er _gr oup
MPI _Spawn( )
{
BNR_Open_gr oup( my_bnr _gr oup,
&new_bnr _gr oup)
BNR_Spawn( r emot e_bnr _gr oup,
N, . . . , f unc)
BNR_Cl ose( r emot e_bnr _gr oup)
BNR_Mer ge( my_bnr _gr oup,
r emot e_bnr _gr oup,
Pgi na 22
mpi . t xt
&i nt er _bnr _gr oup) ;
}
need a BNR_Gr oup_I D whi ch i s
gl obal l y uni que i n or der t o
i mpl ement MPI _Connect / At t ach
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
St r uct ur es t hat cr oss l ayer s
Pgi na 23
mpi . t xt
- many of t he i nf or mat i on
st r uct ur es t hat ar e passed
t hr ough t he l ayer s cont ai n
dat a sect i ons f r ommul t i pl e
l ayer s
- ne opt i on i s t o i ncl ude devi ce
( and met hod) i ncl ude f i l es i n
t he MPI CH l ayer
i ncl ude f i l e. Rob and Br i an
f eel t hi s woul d be bad.
- Davi d suggest s t hat t he
st r uct ur e def i ni t i ons be
suppl i ed by t he devi ce
header f i l es and t hat met hod
speci f i c i nf or mat i on be i ncl uded
Pgi na 24
mpi . t xt
i n t hose
def i ni t i on usi ng uni ons. Rob
and Br i an f eel t hi s i s ugl y
( f r oma sof t war e
engi neer i ng st andpoi nt ) .
- Rob and Br i an suggest havi ng
each l ayer def i ne t hei r own
por t i on of t he
st r uct ur e. The def i ni t i ons of
t he hi gher l ayer s ar e known t o
t he l ower
l ayer s, but not vi ce ver sa.
To i ncr ease cache l ocal i t y and
r educe memor y
al l ocat i on, t he devi ce ( and
met hods) r epor t t he amount of
Pgi na 25
mpi . t xt
space t hey need i n
t hese st r uct ur es so t hat t he
hi ghest l ayer can al l ocat e
suf f i ci ent space.
poi nt er ar i t hmat i c, et c.
Vi r t ual connect i on
- used by MMi mpl ement at i on t o
al l ow l at e bi ndi ng t o a met hod
t hi s i mpl i es t hat t he VC
cont ai ns a poi nt er t o ei t her t he
f unct i on poi nt er
t abl e f or t he met hod t o whi ch
i t i s bound or t he f unct i on
poi nt er t o t abl e t o
Pgi na 26
mpi . t xt
a set of f unct i ons t hat
per f or mt he bi ndi ng t o such a
met hod
- one- t o- one cor r espondence
bet ween a vi r t ual connect i on and
a r eal connect i on
- Cont ai ns
- st at e of bi ndi ng
- met hod speci f i c i nf or mat i on
- f unct i on poi nt er t abl e?
- - - - - - - - - -
Communi cat or s
- Cont ai ns
Pgi na 27
mpi . t xt
- communi cat i on gr oup
- l ocal gr oup
( i nt er - communi cat or onl y)
- send and r ecei ve cont ext I Ds
- same f or i nt r a- communi cat or
- at t r i but es
- r ef er ence count
- er r or handl er s
- devi ce speci f i c i nf or mat i on
( needed f or MPI CH- G2)

- - - - - - - - - -
Gr oups
- Cont ai ns
- vi r t ual connect i on t abl e
- my r ank
Pgi na 28
mpi . t xt
- r ef er ence count
- devi ce speci f i c i nf or mat i on
( ???)
- - - - - - - - - -
Request s
- pr obabl y al l ocat ed and
par t i al l y i ni t i al i zed above ADI
- i ni t i al i zat i on compl et e by
devi ce/ met hod
- Request cont ai ns
- I mmut abl e af t er
i ni t i al i zat i on
- t ype of r equest
- per si st ent r equest f l ag
Pgi na 29
mpi . t xt
- send, bsend, r send,
ssend, r ecv, gener al i zed
- buf f er
- count
- dat at ype
- r ank ( sr c or dest
dependi ng on t ype of r equest )
- t ag
- comm
- - - - - - - - - -
Connect i on r esol ut i on
- needs t o t al k t o wi t h BNR
- - - - - - - - - -
Pgi na 30
mpi . t xt
Communi cat i on agent
Pgi na 31

You might also like