a fast direct n-body solver on the connection machine

Upload: christopher-lewis

Post on 10-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    1/9

    A Fast Direct N-body Solver on theConnection Machine

    Jean-Philippe Dmuel.Alan EdelmanJill P. Mcsirov

    Thinking M l l r l J j , , ~ .Cor"oral;on

    :).15 Firs! Strl 'N, Cllmbridg .., AI'! OZI42

    (Jallll,lry 30, 1 DOD)

    Abstract

    The direct method for .ohjug ,v-hod)' 1"01,10"" l,," h""" effi-

    ciently implemented on the Connection !\1Mhinc. The kef fertlure ilan opt;IlUll cOltllllunication p"tte", On the hypercube ntcllilc.ln, .. ofth e eM-2, u.ing rot"I.,1 Gray code' to obll\in ti",.-w;le cdge disjointIIBulilt"";",, path . 'I'l,. utili,,,tio" of th e full cOll"nun],,,t;,,,, bllJnlwidth of th . ullIch'"' ' m"k .. . th e collUllunkntion cost ncgUgihlc forl:ugc N.th"o t h e n ut;on tillle i . 0(",2/1'), where I ' i l lhe llu,uhcrof proce"or>. Tinting> l\I"e pre,cnted for no UNt1pl. "ppll""t;"n c.uco f the COIIIl'lIl"lion o f the ,.Iocily field imlueed b)' a oct of interactingpoin. " o r ( i c ~ s .I p ~ r h l l l ' l g i \ ' ~"n "eh",1 timing here]

    1

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    2/9

    1 In t roduc t ion

    The N - b o d ~ 'algorithm il a cril;ul kernel in II wide '-ariely of application u

    e u induding a ~ l r o n o n l J ' ,molecub.r biolo!)', lind Ruid d)'nlUtlics, The dired

    "",I hod ( u opposed 10 10cIII correction I'!], hierarchic"ll '!, '!]. or mullipole

    ['!] melhods) runs in O(N') serilll time for N bodi"" since 1I11,1&;"";se inlet,

    IId;ons are compuled; Ihe force on each bod}', t';,;s gi"en b)'

    f'orce(.';) C L F.,("i)',

    whele Fv,("i) i . l he fOlce Clterled on Vi b}' Vi'

    The direct mel hod is e ~ l ' e c i l t l l yi",portanl ;n ClUes where Ihe intelll

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    3/9

    II1gorilhm. ~ I o [ edetailed implc'Il

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    4/9

    ,l,iii":u;>\"",, l " l l l t ' l i JoJ ~ . \ ! I \ ' U J " I [ .

    ( U l ~ t i D '.{II1! """:>UI I I" ......... O U ~110).\ III,! ' [ ' I I . . . , 0 \ .\ " . . I'{St' ' ' 'II IOU

    A.q_qo,d S! 1!'1.LJ ','>.UO!I)nllJ"! :>1"ldUIO) "",""1 IOU 01' I I!"n IU!OU\'P"lIl :"11 JO 11"I)OU1:W!'''l'I''!l I ' ' ' ':>S!,"""!!' ;>'ll lI:J'l'''P'l 'pJOj puu ~ ) " ( loll 0\ "'l"P SUlsQd''''!J\ .\'l ';)Il{!uu,1 S!

    1\ l\tlll ;>IOU 1'\"0'1';1'" '1!1I" l\l!od llu!ll\'!'P'"II

    "'II JO ppom '!l[1 'J::I.\G:IIOI'Z ':>UO JO 1)Y.)1$1I! ~ p o u1""111000 1 I ~ ' ' ' 1 : > ' l1l:>11

    -,,"'!" 1I0!1\,"!Un'll,mo) 0 ....\ 'II!" :tl:l'''',::od.\'l~ l I O ! ' . : > t " ! PI I " \ ' n F P : > I I I 1 Q )'SOlpoU I"!OO jU!,\,0U 8111i: gu'O!l ' "I{I ul .(JoUl.. m

    , 0 , s : > , , 0 l < l l l t ~ ! ' { ' l dIt JO 'W\IIt!l'"mb-l! ;:;C "! (1:>1'01:>011""'11'1"0 ... pJO.... \ ! I l ' l t

    U JO ,,5"'01' :1111 \:>1'0'" ;'S!'''l'PlJ lun,,, n'll "I ';:;-1VJ n,p JO SJOSSOl"Old \ u ~ !

    "" ' ld 11:>11t!""'''''lC "'II JO .(,o", ..", :>'lI 1"''01 I!"" 1"!Qd llU!lI!QU" JO "'1'l'U:>llU:>

    ::"11 ""I OI"U!'P"", :>I{l "0 S:>llOU ll"!"""l'!'uoo ..... 'S! 1 " 1 { ~'["1'0111"'!""-":>!l!i :>'(1 '1 ! 00 ' 11:>""1'" ' ! 1"'1'" U! :>,,!'(nw :>'11 1" llu!'1 Q O I Jq l"' ' '! ' 'I 'I0 "U "

    _n.n ' ! ;UO!,u,oJJ..d '''11''''1 ,uO!lvlndwoo In!Od SU!I"U iU!'UJoJJ:>d u"l(j\\

    ' iu!dd"lU "PO" . , , , ,:) l"no!.

    ''':>W!I'!I\lllU \I i l l! 'n "''1'''' [00'1 :>'1' o,uo "''',''IJOS ,,,:>\S. . . "'(I ,\'1 I _ o d m !_J:>dn . \U....!I\l'Uo'n .. "! 'I:>!'I 'p!J:lI .."O!.lI:>W!P . ~ " ' v II:>JnSglloo .'II""P!U:>

    ;>{l "" .. :>"!I{.. ltlll "'11 ,u1:>1I'1d "O!I'OI"!""l1lUlQ"pmnpllJIS :>10'" JO,i 'UO!I'II-"d'lIo" "lI\l :>1"\d'l/o:> 01 " J u . " ..n" SlI lllO...... OJd 11I:>J"!l!P JO ""!JO'l/n", :>'ll

    u:>:>,,,pq p:>llll "q"u:>q "'OIl "1"1' q:>!,\... "qllO!I1!l!UllUm,o:> p:>'''q J:>ll1!od I ' / l

    .,,:>)1 ' ! :>1:>'I.L ,UI,!U"'I,,",llI "O!IV"!Ull""UOO >!' v'I 0"', ' IJoddnr Z ' I ~ J;"1.1,

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    5/9

    11 is wilh t h i ~model of the Cl\I-2 thaI we illll>lelllenl"d our f a ~ tdircrcsenls II differenl

    d imen .ion of the cube. There is lin cdS" between two IIodes i lind j in the

    hypercube if and only if Iheir binar>" represenlat ions diff"r in only one bit.

    We cnn th ink of t he edges u.s t r1,,"ersillg di fferent dimensions of t he hyt'ercu be.

    A Gray code i ~ II circuit of all b inary d t u p l e ~such thlll only one coor

    dillate position chllnges at each slel" 1'1",", olle eM, think of., Gmy code ns

    i< 11a",iho"iall circuit or p.,tlt throllgh a hypercu],e. There are lots of ways

    to cOllstruet Gmy codes, a slnl ldard eXMnp!c is th e hi"n.ry reflected Gmy

    code [[?)I. Th e d im en si on c od c correspondillS to II Grny code is lhe listof positions "'hich challge lit eacl, s tep of the code, o r the list o f dimensions

    traversed on th e hypcrcube lit "ach s tep of the circuit. In FiSure I we show

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    6/9

    t h ~ binarr reJleelc

    Gi'-en" Gray code On d-Illples b"8inning at 0, one can genernle a Gmr

    wde . t"r t i"s 0.1 a"y olher olle i, b)- t"kirlg the ~ u l l l s i c eO r of i wilh the

    d-tuples ill Ihe origi""l code_ Th e rC"'lOIl for this is Obl'ious, since if i and

    k differ onlr in One hit, thc" i 0 ; and k (!) i will nlso differ by th e Mrne

    bi\. 1Ilor"01'er, Ihis lIle""S th"l the dimension C Q d ~ . , .for the 111'0 Gr.')- codes

    will be Ihe sn",,,. Fig"re 2 shows the e rny code st"rtillg a t notle 5 '" 101

    resulting fromlrnnslating the code ill Fig"re 1 ns we h.wej"st described.

    3.2 All to All Broadcast ing

    HecalJ thM Our problem is to send d"t" ill eyery node of ., h)'pereuhe, s"y

    of dimension d, to el'ery other notle using all of the edges (or wires) of the

    cllhe all of th e ti",e and ""oiding collisiolls_ We ..-m assume thill we ha\"

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    7/9

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    8/9

  • 8/8/2019 A Fast Direct N-body Solver on the Connection Machine

    9/9