Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

Embed Size (px)

Citation preview

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    1/11

    T r e e c o d e s f o r v o r t e x d y n a m i c s :

    A p p l i c a t i o n o f a p r o g r a m m i n g f r a m e w o r k

    S a n d e e p B h a t t P a n g f e n g L i u

    B e l l C o m m u n i c a t i o n s R e s e a r c h , M o r r i s t o w n N J 0 7 9 6 0 , a n d

    C o m p u t e r S c i e n c e , R u t g e r s U n i v e r s i t y , P i s c a t a w a y N J 0 8 8 5 5 .

    V i c t o r F e r n a n d e z N o r m a n Z a b u s k y

    M e c h a n i c a l a n d A e r o s p a c e E n g i n e e r i n g , R u t g e r s U n i v e r s i t y , P i s c a t a w a y N J 0 8 8 5 5 .

    A b s t r a c t

    T h i s p a p e r d e s c r i b e s t h e i m p l e m e n t a t i o n o f a f a s t

    N - b o d y a l g o r i t h m f o r t h e s t u d y o f m u l t i - l a m e n t v o r -

    t e x s i m u l a t i o n s . T h e s i m u l a t i o n s i n v o l v e d i s t r i b u -

    t i o n s t h a t a r e i r r e g u l a r a n d t i m e - v a r y i n g . W e a d a p t

    o u r p r o g r a m m i n g f r a m e w o r k w h i c h w a s e a r l i e r u s e d

    t o d e v e l o p h i g h - p e r f o r m a n c e i m p l e m e n t a t i o n s o f t h e

    B a r n e s - H u t a n d G r e e n g a r d - R o k h l i n a l g o r i t h m s f o r

    g r a v i t a t i o n a l e l d s . W e d e s c r i b e h o w t h e a d d i t i o n a l

    s u b t l e t i e s i n v o l v e d i n v o r t e x l a m e n t s i m u l a t i o n s a r e

    a c c o m m o d a t e d e c i e n t l y w i t h i n t h e f r a m e w o r k .

    W e d e s c r i b e t h e o n g o i n g e x p e r i m e n t a l s t u d i e s a n d

    r e p o r t p r e l i m i n a r y r e s u l t s w i t h s i m u l a t i o n s o f o n e m i l -

    l i o n p a r t i c l e s o n t h e 1 2 8 - n o d e C o n n e c t i o n M a c h i n e

    C M - 5 . T h e i m p l e m e n t a t i o n s u s t a i n s a r a t e o f a l m o s t

    3 0 % o f t h e p e a k m a c h i n e r a t e . T h e s e s i m u l a t i o n s a r e

    m o r e t h a n a n o r d e r o f m a g n i t u d e l a r g e r i n s i z e t h a n

    p r e v i o u s l y s t u d i e d u s i n g d i r e c t m e t h o d s . W e e x p e c t

    t h a t t h e u s e o f t h e f a s t a l g o r i t h m w i l l a l l o w u s t o s t u d y

    t h e g e n e r a t i o n o f s m a l l s c a l e s i n t h e v o r t e x c o l l a p s e

    a n d r e c o n n e c t i o n p r o b l e m w i t h a d e q u a t e r e s o l u t i o n .

    1 I n t r o d u c t i o n

    C o m p u t a t i o n a l m e t h o d s t o t r a c k t h e m o t i o n s o f

    b o d i e s w h i c h i n t e r a c t w i t h o n e a n o t h e r , a n d p o s s i -

    b l y s u b j e c t t o a n e x t e r n a l e l d a s w e l l , h a v e b e e n t h e

    s u b j e c t o f e x t e n s i v e r e s e a r c h f o r c e n t u r i e s . S o - c a l l e d

    \ N - b o d y " m e t h o d s h a v e b e e n a p p l i e d t o p r o b l e m s i n

    a s t r o p h y s i c s , s e m i c o n d u c t o r d e v i c e s i m u l a t i o n , m o l e c -

    u l a r d y n a m i c s , p l a s m a p h y s i c s , a n d u i d m e c h a n i c s .

    T h i s p a p e r d e s c r i b e s t h e i m p l e m e n t a t i o n o f a t r e e

    c o d e f o r v o r t e x d y n a m i c s s i m u l a t i o n s , w h i c h w e a p p l y

    t o t h e s t u d y o f v o r t e x c o l l a p s e a n d r e c o n n e c t i o n 2 0 ] .

    W e e x p e c t t h a t t h e u s e o f t h e f a s t a l g o r i t h m w i l l a l l o w

    u s t o s t u d y t h e g e n e r a t i o n o f s m a l l s c a l e s w i t h a d e -

    q u a t e r e s o l u t i o n , a n d m a k e i t p o s s i b l e t o r e a l i s t i c a l l y

    s i m u l a t e t h e o w s a r o u n d b o d i e s o f c o m p l e x s h a p e s

    e n c o u n t e r e d i n e n g i n e e r i n g a p p l i c a t i o n s . T h e a d v a n -

    t a g e s o f t h e f a s t p a r t i c l e v o r t e x m e t h o d s w i l l b e e s p e -

    c i a l l y i m p o r t a n t i n t h e h i g h R e y n o l d s n u m b e r r e g i m e ,

    w h i c h c a n n o t b e s t u d i e d w i t h t h e c u r r e n t g r i d b a s e d

    m e t h o d s ( n i t e d i e r e n c e , n i t e v o l u m e , a n d s p e c t r a l )

    b e c a u s e o f t h e r e s o l u t i o n l i m i t a t i o n s i m p o s e d b y c u r -

    r e n t c o m p u t e r s .

    C o m p u t i n g t h e e l d a t a p o i n t i n v o l v e s s u m m i n g

    t h e c o n t r i b u t i o n s f r o m e a c h o f t h e N ? 1 p a r t i c l e s .

    T h e d i r e c t m e t h o d e v a l u a t e s a l l p a i r s o f t w o - b o d y i n -

    t e r a c t i o n s . W h i l e t h i s m e t h o d i s c o n c e p t u a l l y s i m -

    p l e , v e c t o r i z e s w e l l , a n d i s t h e a l g o r i t h m o f c h o i c e f o r

    m a n y a p p l i c a t i o n s , i t s O ( N

    2

    ) a r i t h m e t i c c o m p l e x i t y

    r u l e s i t o u t f o r l a r g e - s c a l e s i m u l a t i o n s i n v o l v i n g m i l -

    l i o n s o f p a r t i c l e s i t e r a t e d o v e r m a n y t i m e s t e p s . F o r

    v o r t e x s i m u l a t i o n s t h e l a r g e s t n u m b e r o f p a r t i c l e s r e -

    p o r t e d i s a r o u n d f t y t h o u s a n d 3 , 2 1 , 3 6 ] .

    L a r g e r s i m u l a t i o n s r e q u i r e f a s t e r m e t h o d s i n v o l v i n g

    f e w e r i n t e r a c t i o n s t o e v a l u a t e t h e e l d a t a n y p o i n t .

    I n t h e l a s t d e c a d e a n u m b e r o f a p p r o x i m a t i o n a l g o -

    r i t h m s h a v e e m e r g e d . T h e s e a l g o r i t h m s e x p l o i t t h e

    o b s e r v a t i o n t h a t t h e e e c t o f a c l u s t e r o f p a r t i c l e s a t a

    d i s t a n t p o i n t c a n b e a p p r o x i m a t e d b y a s m a l l n u m b e r

    o f i n i t i a l t e r m s o f a n a p p r o p r i a t e p o w e r s e r i e s . T h i s

    l e a d s t o a n o b v i o u s d i v i d e - a n d - c o n q u e r a l g o r i t h m i n

    w h i c h t h e p a r t i c l e s a r e o r g a n i z e d i n a h i e r a r c h y o f

    c l u s t e r s w h i c h a l l o w s t h e a p p r o x i m a t i o n t o b e a p p l i e d

    e c i e n t l y . B a r n e s a n d H u t 5 ] a p p l i e d t h i s i d e a t o

    g r a v i t a t i o n a l s i m u l a t i o n s . M o r e s o p h i s t i c a t e d s c h e m e s

    w e r e d e v e l o p e d b y G r e e n g a r d a n d R o k h l i n 1 5 ] a n d

    s u b s e q u e n t l y r e n e d b y Z h a o 3 7 ] , A n d e r s o n 2 ] . B e t -

    t e r d a t a s t r u c t u r e s h a v e r e c e n t l y b e e n d e v e l o p e d b y

    C a l l a h a n a n d K o s a r a j u 9 ] .

    S e v e r a l p a r a l l e l i m p l e m e n t a t i o n s o f t h e a l g o r i t h m s

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    2/11

    m e n t i o n e d a b o v e h a v e b e e n d e v e l o p e d . S a l m o n 2 7 ]

    i m p l e m e n t e d t h e B a r n e s - H u t a l g o r i t h m o n t h e

    N C U B E a n d I n t e l i P S C , W a r r e n a n d S a l m o n 3 4 ] r e -

    p o r t e d e x p e r i m e n t s o n t h e 5 1 2 - n o d e I n t e l T o u c h s t o n e

    D e l t a , a n d l a t e r d e v e l o p e d h a s h e d i m p l e m e n t a t i o n s o f

    a g l o b a l t r e e s t r u c t u r e w h i c h t h e y r e p o r t i n 3 5 , 1 8 ] .

    T h e y h a v e u s e d t h e i r c o d e s f o r a s t r o p h y s i c a l s i m u l a -

    t i o n s a n d a l s o f o r v o r t e x d y n a m i c s . T h i s p a p e r b u i l d s

    o n o u r C M - 5 i m p l e m e n t a t i o n 2 5 ] o f t h e B a r n e s - H u t

    a l g o r i t h m f o r a s t r o p h y s i c a l s i m u l a t i o n s a n d c o n t r a s t s

    o u r a p p r o a c h a n d c o n c l u s i o n s w i t h t h e a f o r e m e n t i o n e d

    e o r t s .

    T h i s a b s t r a c t i s o r g a n i z e d a s f o l l o w s . S e c t i o n 2 d e -

    s c r i b e s t h e a p p l i c a t i o n p r o b l e m i n s o m e d e t a i l , a n d

    o u t l i n e s t h e B a r n e s - H u t f a s t s u m m a t i o n a l g o r i t h m .

    S e c t i o n 3 d e s c r i b e s h o w w e u s e o u r f r a m e w o r k f o r

    b u i l d i n g i m p l i c i t g l o b a l t r e e s i n d i s t r i b u t e d m e m o r y

    a s w e l l a s m e t h o d s f o r a c c e s s i n g a n d m o d i f y i n g t h e s e

    s t r u c t u r e s e c i e n t l y . S e c t i o n 4 d e s c r i b e s e x p e r i m e n t a l

    r e s u l t s o n t h e C o n n e c t i o n M a c h i n e C M - 5 .

    2 V o r t e x m e t h o d s i n u i d d y n a m i c s

    M a n y o w s c a n b e s i m u l a t e d b y c o m p u t i n g t h e

    e v o l u t i o n i n t i m e o f v o r t i c i t y u s i n g t h e B i o t - S a v a r t

    l a w . B i o t - S a v a r t m o d e l s o e r t h e a d v a n t a g e t h a t t h e

    c a l c u l a t i o n e o r t c o n c e n t r a t e s i n t h e s m a l l r e g i o n s o f

    t h e u i d t h a t c o n t a i n t h e v o r t i c i t y , w h i c h a r e u s u a l l y

    s m a l l c o m p a r e d t o t h e d o m a i n t h a t c o n t a i n s t h e o w

    2 3 ] . T h i s n o t o n l y r e d u c e s c o n s i d e r a b l y t h e c o m p u -

    t a t i o n a l e x p e n s e , b u t a l l o w s b e t t e r r e s o l u t i o n f o r h i g h

    R e y n o l d s n u m b e r o w s . B i o t - S a v a r t m o d e l s a l s o a l l o w

    u s t o p e r f o r m e e c t i v e l y i n v i s c i d c o m p u t a t i o n s w i t h n o

    a c c u m u l a t i o n o f n u m e r i c a l d i u s i o n 3 , 2 2 , 2 3 ] .

    V o r t e x m e t h o d s a r e a l s o a p p r o p r i a t e f o r s t u d y i n g

    t h e m a n y c o m p l e x o w s t h a t p r e s e n t c o h e r e n t s t r u c -

    t u r e s . T h e s e c o h e r e n t s t r u c t u r e s f r e q u e n t l y a r e c l o s e l y

    i n t e r a c t i n g t u b e - l i k e v o r t i c e s . S o m e o f t h e o w s o f

    p r a c t i c a l i n t e r e s t t h a t p r e s e n t i n t e r a c t i n g t u b e - l i k e

    v o r t e x s t r u c t u r e s a r e w i n g t i p v o r t i c e s 1 0 , 1 9 ] , a v a -

    r i e t y o f 3 D j e t o w s o f d i e r e n t s h a p e s 1 6 , 1 7 ] a n d

    t u r b u l e n t o w s 1 1 ] . A g e n e r i c t y p e o f i n t e r a c t i o n b e -

    t w e e n v o r t e x t u b e s i s c o l l a p s e a n d r e c o n n e c t i o n , w h i c h

    i s t h e c l o s e a p p r o a c h o f v o r t e x t u b e s t h a t r e s u l t s i n

    l a r g e v o r t i c i t y a n d s t r a i n - r a t e a m p l i c a t i o n 2 0 ] . C o l -

    l a p s e a n d r e c o n n e c t i o n i s a n e x a m p l e o f s m a l l s c a l e

    f o r m a t i o n i n h i g h R e y n o l d s n u m b e r o w s . S m a l l s c a l e

    g e n e r a t i o n i s v e r y i m p o r t a n t f o r t h e e n e r g y t r a n s f e r

    a n d d i s s i p a t i o n p r o c e s s e s i n t u r b u l e n t o w s 2 6 ] .

    T h e s t u d y o f s m a l l s c a l e s f o r m a t i o n i n h i g h

    R e y n o l d s n u m b e r o w s t e n d s t o r e q u i r e s u b s t a n t i a l

    a m o u n t o f c o m p u t a t i o n a l r e s o u r c e s . I n m u l t i - l a m e n t

    U

    = 0.04

    = 0.05

    = 0.02 = 0.01 = 0.005

    N = 2.4576 x 10^6

    = 0.06

    = 0.03

    overpredicting initial condition

    qa

    0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0

    0.31

    0.32

    0.33

    0.34

    0.35

    0.36

    0.37

    0.38

    0.39

    0.40

    = 0.07595C

    F i g u r e 1 : I n d u c e d v e l o c i t y U v s . n o n d i m e n s i o n a l g r i d

    s i z e q

    a

    .

    m o d e l s , t h e O ( N

    2

    ) n a t u r e o f t h e c o m p u t a t i o n a l e x -

    p e n s e o f t h e B i o t - S a v a r t d i r e c t m e t h o d ( w h e r e N i s

    t h e n u m b e r o f g r i d p o i n t s ) s e v e r e l y l i m i t s t h e v o r t e x

    c o l l a p s e s i m u l a t i o n s , l e a v i n g t h e m o s t i n t e r e s t i n g c a s e s

    o f c o l l a p s e b e y o n d t h e c a s e s t h a t h a v e b e e n e x a m i n e d

    t o d a t e 1 2 , 1 3 ] .

    R e c e n t m u l t i - l a m e n t s i m u l a t i o n s h a v e r a i s e d

    d o u b t s a b o u t t h e c o n v e r g e n c e o f t h e r e s u l t s 1 , 3 ] .

    F i g u r e 1 p r e s e n t s a c o n v e r g e n c e s t u d y o f t h e v e l o c -

    i t y U i n d u c e d o n i t s e l f b y a c i r c u l a r v o r t e x r i n g w i t h

    t h i c k n e s s

    C

    = 0 : 0 7 5 9 5 a n d r a d i u s a = 1 . T h e r e s o l u -

    t i o n i s r e p r e s e n t e d ( a l o n g t h e h o r i z o n t a l a x i s ) b y t h e

    n o n d i m e n s i o n a l g r i d s i z e q

    a

    = 2 = h

    a

    , w h e r e i s t h e

    s m o o t h i n g p a r a m e t e r i n t h e s i m u l a t i o n a n d h

    a

    i s t h e

    m i n i m u m d i s t a n c e b e t w e e n g r i d p o i n t s . T w o t y p e s o f

    d i s c r e t i z a t i o n s c h e m e s a r e e m p l o y e d . O n e u n d e r p r e -

    d i c t s a n d t h e o t h e r o v e r p r e d i c t s t h e v e l o c i t y U . W e

    o b s e r v e i n F i g u r e 1 t h a t , i n o r d e r f o r c o n v e r g e n c e , i t

    i s n e c e s s a r y t o h a v e b o t h a s u c i e n t l y h i g h n u m b e r

    o f g r i d p o i n t s N a n d a s u c i e n t l y s m a l l v a l u e o f t h e

    s m o o t h i n g p a r a m e t e r , i n a g r e e m e n t w i t h t h e c o n -

    v e r g e n c e t h e o r e m s 6 , 1 4 ] . T h e s m a l l v a l u e s o f n e c -

    e s s a r y f o r c o n v e r g e n c e m a k e i t n e c e s s a r y t o e m p l o y

    m i l l i o n s o f p a r t i c l e s f o r t h e s e p a r t i c u l a r v a l u e s o f t h e

    r a t i o

    C

    = .

    2 . 1 T h e B i o t - S a v a r t m o d e l

    T h e v e r s i o n o f t h e v o r t e x m e t h o d w e u s e w a s d e -

    v e l o p e d b y K n i o a n d G h o n i e m 2 1 ] . T h e v o r t i c i t y o f a

    v o r t e x t u b e i s r e p r e s e n t e d b y a b u n d l e o f v o r t e x l a -

    m e n t s

    l

    ( ; t

    ) , e a c h o f t h e m w i t h c i r c u l a t i o n ?

    l

    . T h e

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    3/11

    N

    f

    l a m e n t s f o r m i n g t h e b u n d l e a r e a d v e c t e d a c c o r d -

    i n g t o t h e v e l o c i t y e l d

    u ( x ) = ?

    N

    f

    X

    l = 1

    ?

    l

    4

    Z

    C

    ( x ?

    l

    ) d

    l

    j x ?

    l

    j

    3

    g ( j x ?

    l

    j ) ;

    ( 1 )

    w h e r e g ( ) = 1 ? e x p ( ?

    3

    =

    3

    ) .

    2 . 2 D i s c r e t i z a t i o n

    E a c h l a m e n t o f t h e v o r t e x r i n g i s d i s c r e t i z e d b y n

    0

    g r i d p o i n t s o r v o r t e x e l e m e n t s . O n c e t h i s i s d o n e , t h e

    o r d e r o f t h e s u m m a t i o n s i n E q u a t i o n ( 1 ) i s u n i m p o r -

    t a n t , i . e . ( 1 ) i s s o l v e d n u m e r i c a l l y a t N d i s c r e t e p o i n t s

    o r v o r t e x e l e m e n t s

    p

    b y u s i n g t h e a p p r o x i m a t i o n

    u ( x ) = ?

    1

    4

    N

    X

    p = 1

    ( x ?

    p

    )

    p

    ?

    p

    j x ?

    p

    j

    3

    g ( j x ?

    p

    j ) ;

    ( 2 )

    w h e r e t h e l a m e n t o r d e r i n g h a s t o b e c o n s i d e r e d i n

    t h e c o m p u t a t i o n o f t h e c e n t r a l d i e r e n c e

    p

    p

    =

    1

    2

    (

    p + 1

    ?

    p ? 1

    ) : ( 3 )

    T h i s i s a c h a r a c t e r i s t i c o f t h e l a m e n t a p p r o a c h i n 3 D

    v o r t e x m e t h o d s . I n c o n t r a s t w i t h t h e \ v o r t e x a r r o w "

    a p p r o a c h 1 8 , 2 3 ] , u p d a t i n g t h e \ s t r e n g t h " o f t h e v o r -

    t e x e l e m e n t s i n t h e l a m e n t m e t h o d d o e s n o t r e q u i r e

    t h e e v a l u a t i o n o f t h e v e l o c i t y g r a d i e n t , w h i c h i n v o l v e s

    t h e c o m p u t a t i o n o f a n o t h e r i n t e g r a l o v e r a l l o f t h e

    p a r t i c l e s . A l s o , l a m e n t s w i t h f o r m o f c l o s e d c u r v e s ,

    s a t i s f y t h e d i v e r g e n c e f r e e c o n d i t i o n o f t h e v o r t i c i t y

    e l d . T h i s i s n o t a l w a y s t h e c a s e a t a l l t i m e s i n t h e

    v o r t e x a r r o w a p p r o a c h .

    T h e v e l o c i t y e l d i n e q . ( 2 ) c a n b e c o m p u t e d m o r e

    e c i e n t l y b y u s i n g t h e m u l t i p o l e e x p a n s i o n

    u ( x ) = ?

    m

    X

    n = 0

    X

    j + k n

    M ( j ; k ; n ? j ? k )

    D ( j ; k ; n ? j ? k ) r ( x ?

    0

    )

    + r

    m

    ; ( 4 )

    w h e r e

    M ( j ; k ; n ? j ? k ) =

    N

    X

    p = 1

    p

    (

    p

    ?

    0

    )

    j

    1

    (

    p

    ?

    0

    )

    k

    2

    (

    p

    ?

    0

    )

    n ? j ? k

    3

    ;

    ( 5 )

    a n d

    D ( j ; k ; n ? j ? k ) =

    ( ? 1 )

    n

    ( n ? j ? k ) ! j ! k !

    @

    j

    1

    @

    k

    2

    @

    n ? j ? k

    3

    :

    ( 6 )

    T h e s t r e n g t h o f t h e p a r t i c l e s i s

    p

    = ?

    p

    p

    a n d

    ( ) =

    R

    0

    g ( s ) d s = s

    2

    + ( 0 ) . T h e t e r m r

    m

    i s t h e t r u n c a t i o n e r r o r t h a t r e s u l t s f r o m u s i n g a n i t e

    n u m b e r o f t e r m s i n t h e m u l t i p o l e e x p a n s i o n ( 4 ) .

    2 . 3 I n i t i a l C o n d i t i o n s

    T h e m u l t i - l a m e n t r i n g i s c o n s t r u c t e d a r o u n d t h e

    c e n t e r l i n e

    (

    1

    ;

    2

    ;

    3

    ) = ( a c o s ; b s i n ; c s i n 2 ) ; ( 7 )

    w h e r e 0 2 . T h e g r i d p o i n t s a r e l o c a t e d a t

    e q u a l l y s p a c e d i n t e r v a l s o r a t v a r i a b l e i n t e r v a l s ,

    w i t h t h e s m a l l e r i n t e r v a l s o n t h e c o l l a p s e r e g i o n . W e

    c a l l t h i s g e o m e t r y t h e \ L i s s a j o u s - e l l i p t i c " r i n g b e c a u s e

    o f i t s p r o j e c t i o n s o n t w o o r t h o g o n a l p l a n e s ( f o r c > 0 ) .

    T h e t h i c k n e s s o f t h e m u l t i - l a m e n t r i n g i s

    C

    . T h e c i r -

    c u l a t i o n d i s t r i b u t i o n ?

    i

    , a n d t h e i n i t i a l l a m e n t c o r e

    r a d i u s

    i

    a l s o n e e d t o b e s p e c i e d . B e s i d e s t h e f a c t

    t h a t i t s p a r a m e t e r s p a c e c o n t a i n s c a s e s o f v e r y r a p i d

    c o l l a p s e , t h e l o w n u m b e r o f p a r a m e t e r s o f t h i s c o n g u -

    r a t i o n a l l o w s a c o m p l e t e p a r a m e t e r s t u d y a t l e s s c o m -

    p u t a t i o n a l e x p e n s e . T h e c a s e a = b = 1 , c = 0 c o r r e -

    s p o n d s t o t h e c i r c u l a r r i n g w e u s e f o r t h e s t a t i c s t u d i e s

    ( F i g u r e 1 ) . L o w a s p e c t r a t i o e l l i p t i c r i n g s a > b ; c = 0

    c o r r e s p o n d t o r i n g s w i t h p e r i o d i c b e h a v i o r t h a t c a n

    b e u s e d f o r d y n a m i c a n d l o n g t i m e b e h a v i o r t e s t i n g o f

    t h e a l g o r i t h m . A f t e r t h o r o u g h t e s t i n g i s c a r r i e d o u t ,

    p r o d u c t i o n s i m u l a t i o n s o f c o l l a p s i n g v o r t e x c o n g u r a -

    t i o n s w i t h c > 0 w i l l b e p e r f o r m e d .

    I n o r d e r t o e v a l u a t e t h e q u a l i t y o f t h e s i m u l a t i o n s

    w e h a v e a l s o i m p l e m e n t e d d i e r e n t t y p e s o f d i a g n o s -

    t i c s . T h e s e i n c l u d e t h e m o t i o n i n v a r i a n t s ( l i n e a r a n d

    a n g u l a r i m p u l s e a n d e n e r g y ) . F o r l o w a s p e c t r a t i o e l -

    l i p t i c r i n g s w e m e a s u r e t h e p e r i o d o f o s c i l l a t i o n a n d

    t h e d e v i a t i o n o f t h e i n i t i a l p l a n a r s h a p e o f t h e r i n g

    a t e a c h p e r i o d . O t h e r t y p e s o f d i a g n o s t i c s h a v e b e e n

    i m p l e m e n t e d t o o b t a i n p h y s i c a l i n s i g h t i n t o t h e c o l -

    l a p s e p r o b l e m . T h e s e i n c l u d e m e a s u r e m e n t s o f v o r -

    t i c i t y , s t r a i n - r a t e a n d v o r t e x s t r e t c h i n g . T h e e c i e n t

    e v a l u a t i o n o f t h e s e d i a g n o s t i c s r e q u i r e s t h e u s e o f t h e

    f a s t s u m m a t i o n a l g o r i t h m e m p l o y e d i n t h e s i m u l a t i o n

    i t s e l f .

    2 . 4 F a s t s u m m a t i o n m e t h o d

    T o r e d u c e t h e c o m p l e x i t y o f c o m p u t i n g t h e s u m s

    i n E q u a t i o n 2 , w e u s e t h e B a r n e s - H u t a l g o r i t h m . T o

    o r g a n i z e a h i e r a r c h y o f c l u s t e r s , w e r s t c o m p u t e a n

    o c t - t r e e p a r t i t i o n o f t h e t h r e e - d i m e n s i o n a l b o x ( r e g i o n

    o f s p a c e ) e n c l o s i n g t h e s e t o f b o d i e s . T h e p a r t i t i o n i s

    c o m p u t e d r e c u r s i v e l y b y d i v i d i n g t h e o r i g i n a l b o x i n t o

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    4/11

    e i g h t o c t a n t s o f e q u a l v o l u m e u n t i l e a c h u n d i v i d e d b o x

    c o n t a i n s e x a c t l y o n e b o d y . A l t e r n a t i v e t r e e d e c o m -

    p o s i t i o n s h a v e b e e n s u g g e s t e d 4 , 9 ] ; t h e B a r n e s - H u t

    a l g o r i t h m a p p l i e s t o t h e s e a s w e l l .

    E a c h i n t e r n a l n o d e o f t h e o c t - t r e e r e p r e s e n t s a c l u s -

    t e r . O n c e t h e o c t - t r e e h a s b e e n b u i l t , t h e m o m e n t s o f

    t h e i n t e r n a l n o d e s a r e c o m p u t e d i n o n e p h a s e u p t h e

    t r e e , s t a r t i n g a t t h e l e a v e s . T h e n e x t s t e p i s t o c o m -

    p u t e i n d u c e d v e l o c i t i e s ; e a c h p a r t i c l e t r a v e r s e s t h e t r e e

    i n d e p t h - r s t m a n n e r s t a r t i n g a t t h e r o o t . F o r a n y i n -

    t e r n a l n o d e , i f t h e d i s t a n c e D f r o m t h e c o r r e s p o n d i n g

    b o x t o t h e p a r t i c l e e x c e e d s t h e q u a n t i t y R = , w h e r e R

    i s t h e s i d e - l e n g t h o f t h e b o x a n d i s a n a c c u r a c y p a -

    r a m e t e r , t h e n t h e e e c t o f t h e s u b t r e e o n t h e p a r t i c l e i s

    a p p r o x i m a t e d b y a t w o - b o d y i n t e r a c t i o n b e t w e e n t h e

    p a r t i c l e a n d a p o i n t v o r t e x l o c a t e d a t t h e g e o m e t r i c

    c e n t e r o f t h e t r e e n o d e . T h e t r e e t r a v e r s a l c o n t i n u e s ,

    b u t t h e s u b t r e e i s b y p a s s e d .

    O n c e t h e i n d u c e d v e l o c i t i e s o f a l l t h e b o d i e s

    a r e k n o w n , t h e n e w p o s i t i o n s a n d v o r t e x e l e m e n t

    s t r e n g t h s a r e c o m p u t e d . T h e e n t i r e p r o c e s s , s t a r t i n g

    w i t h t h e c o n s t r u c t i o n o f t h e o c t - t r e e , i s r e p e a t e d f o r

    t h e d e s i r e d n u m b e r o f t i m e s t e p s .

    F o r c o n v e n i e n c e w e r e f e r t o t h e s e t o f n o d e s w h i c h

    c o n t r i b u t e t o t h e a c c e l e r a t i o n o n a p a r t i c l e a s t h e e s -

    s e n t i a l n o d e s f o r t h e p a r t i c l e . E a c h p a r t i c l e h a s a d i s -

    t i n c t s e t o f e s s e n t i a l n o d e s w h i c h c h a n g e s w i t h t i m e .

    O n e r e m a r k c o n c e r n i n g d i s t a n c e m e a s u r e m e n t s i s i n

    o r d e r . T h e r e a r e s e v e r a l w a y s t o m e a s u r e t h e d i s t a n c e

    b e t w e e n a p a r t i c l e a n d a b o x . S a l m o n 2 7 ] d i s c u s s e s

    v a r i o u s a l t e r n a t i v e s i n s o m e d e t a i l . F o r c o n s i s t e n c y ,

    w e m e a s u r e d i s t a n c e s f r o m b o d i e s t o t h e p e r i m e t e r o f

    a b o x i n t h e L

    1

    m e t r i c . I n o u r e x p e r i m e n t s w e v a r y

    t o t e s t t h e a c c u r a c y o f t h e c o d e c o m p a r e d t o s o l u t i o n s

    c o m p u t e d u s i n g t h e d i r e c t m e t h o d a t s p e c i c p o i n t s .

    3 T h e f r a m e w o r k a n d i t s a p p l i c a t i o n

    W h i l e t h e p h y s i c a l m o d e l s o f N - b o d y a p p l i c a t i o n s

    d i e r g r e a t l y , t h e c o m p u t a t i o n a l s t r u c t u r e i s m o r e -

    o r - l e s s a p p l i c a t i o n - i n d e p e n d e n t . I t i s n a t u r a l , t h e r e -

    f o r e , t o d e v e l o p p r o g r a m m i n g t o o l s w h i c h r e d u c e t h e

    t i m e t o d e v e l o p h i g h - p e r f o r m a n c e a p p l i c a t i o n c o d e s .

    T h i s s e c t i o n d e s c r i b e s o u r p r o g r a m m i n g f r a m e w o r k

    f o r h i e r a r c h i c a l N - b o d y a l g o r i t h m s ; t h i s f r a m e w o r k

    h a s b e e n u s e d e a r l i e r f o r i m p l e m e n t i n g t h e B a r n e s -

    H u t a n d G r e e n g a r d - R o k h l i n a l g o r i t h m s f o r g r a v i t a -

    t i o n a l e l d s . W a r r e n a n d S a l m o n 3 5 ] h a v e d e v e l o p e d

    a d i e r e n t f r a m e w o r k ; w e c o n t r a s t t h e t w o a p p r o a c h e s

    i n t h i s s e c t i o n .

    A l l t r e e c o d e s r e s o l v e c o m m o n i s s u e s o f b u i l d i n g ,

    t r a v e r s i n g , u p d a t i n g a n d l o a d - b a l a n c i n g l a r g e t r e e s i n

    d i s t r i b u t e d m e m o r y . T h e t e n s i o n b e t w e e n t h e c o m -

    m u n i c a t i o n o v e r h e a d a n d c o m p u t a t i o n a l t h r o u g h p u t

    i s o f c e n t r a l c o n c e r n t o o b t a i n i n g h i g h p e r f o r m a n c e .

    T h e c h a l l e n g e s c a n b e s u m m a r i z e d a s f o l l o w s .

    1 . T h e o c t - t r e e i s i r r e g u l a r l y s t r u c t u r e d a n d d y -

    n a m i c ; a s t h e t r e e e v o l v e s , a g o o d m a p p i n g m u s t

    c h a n g e a d a p t i v e l y .

    2 . T h e d a t a a c c e s s p a t t e r n s a r e i r r e g u l a r a n d d y -

    n a m i c ; t h e s e t o f e s s e n t i a l t r e e n o d e s c a n n o t b e

    p r e d i c t e d w i t h o u t t r a v e r s i n g t h e t r e e . T h e o v e r -

    h e a d o f t r a v e r s i n g a d i s t r i b u t e d t r e e t o n d t h e e s -

    s e n t i a l n o d e s c a n b e p r o h i b i t i v e u n l e s s d o n e c a r e -

    f u l l y .

    3 . T h e n u m b e r o f o a t i n g p o i n t o p e r a t i o n s n e c e s s a r y

    t o u p d a t e t h e p o s i t i o n c a n v a r y t r e m e n d o u s l y b e -

    t w e e n b o d i e s ; t h e d i e r e n c e o f t e n r a n g e s o v e r a n

    o r d e r o f m a g n i t u d e . T h e r e f o r e , i t i s n o t s u c i e n t

    t o m a p e q u a l n u m b e r s o f b o d i e s a m o n g p r o c e s -

    s o r s ; r a t h e r , t h e w o r k m u s t b e e q u a l l y d i s t r i b u t e d

    a m o n g p r o c e s s o r s . T h i s i s a t r i c k y i s s u e s i n c e

    m a p p i n g t h e n o d e s u n e v e n l y c a n c r e a t e i m b a l -

    a n c e s i n t h e w o r k r e q u i r e d t o b u i l d t h e o c t - t r e e .

    T h e t e c h n i q u e s w e u s e t o g u a r a n t e e e c i e n c y i n -

    c l u d e : ( a ) e x p l o i t i n g p h y s i c a l l o c a l i t y , ( b ) a n i m p l i c i t

    t r e e r e p r e s e n t a t i o n w h i c h r e q u i r e s o n l y i n c r e m e n t a l

    u p d a t e s w h e n n e c e s s a r y , ( c ) s e n d e r - d r i v e n c o m m u n i -

    c a t i o n , ( d ) a g g r e g a t i o n o f c o m p u t a t i o n a n d c o m m u -

    n i c a t i o n i n b u l k q u a n t i t i e s , a n d ( e ) i m p l e m e n t i n g t h e

    \ a l l - t o - s o m e " c o m m u n i c a t i o n a b s t r a c t i o n .

    3 . 1 E x p l o i t i n g p h y s i c a l l o c a l i t y

    W e u s e o r t h o g o n a l r e c u r s i v e b i s e c t i o n ( O R B ) t o d i s -

    t r i b u t e b o d i e s a m o n g p r o c e s s o r s . T h e s p a c e b o u n d -

    i n g a l l t h e b o d i e s i s i s p a r t i t i o n e d i n t o a s m a n y b o x e s

    a s t h e r e a r e p r o c e s s o r s , a n d a l l b o d i e s w i t h i n a b o x

    a r e a s s i g n e d t o o n e p r o c e s s o r . A t e a c h r e c u r s i v e s t e p ,

    t h e s e p a r a t i n g h y p e r p l a n e i s o r i e n t e d t o l i e a l o n g t h e

    s m a l l e s t d i m e n s i o n ; t h e i n t u i t i o n i s t h a t r e d u c i n g t h e

    s u r f a c e - t o - v o l u m e r a t i o i s l i k e l y t o r e d u c e t h e v o l u m e

    o f d a t a c o m m u n i c a t e d i n l a t e r s t a g e s . E a c h s e p a r a t o r

    d i v i d e s t h e w o r k l o a d w i t h i n t h e r e g i o n e q u a l l y . W h e n

    t h e n u m b e r o f p r o c e s s o r s i s n o t a p o w e r o f t w o , i t i s

    a t r i v i a l m a t t e r t o a d j u s t t h e d i v i s i o n a t e a c h s t e p

    a c c o r d i n g l y .

    T h e O R B d e c o m p o s i t i o n c a n b e r e p r e s e n t e d b y a

    b i n a r y t r e e , t h e O R B t r e e , a c o p y o f w h i c h i s s t o r e d

    i n e v e r y p r o c e s s o r . T h e O R B t r e e i s u s e d a s a m a p

    w h i c h l o c a t e s p o i n t s i n s p a c e t o p r o c e s s o r s . S t o r i n g

    a c o p y a t e a c h p r o c e s s o r i s q u i t e r e a s o n a b l e w h e n t h e

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    5/11

    n u m b e r o f p r o c e s s o r s i s s m a l l r e l a t i v e t o t h e n u m b e r

    o f p a r t i c l e s .

    W e c h o s e O R B d e c o m p o s i t i o n f o r s e v e r a l r e a s o n s .

    I t p r o v i d e s a s i m p l e w a y t o d e c o m p o s e s p a c e a m o n g

    p r o c e s s o r s , a n d a w a y t o q u i c k l y m a p p o i n t s i n s p a c e

    t o p r o c e s s o r s . T h i s l a t t e r p r o p e r t y i s e s s e n t i a l f o r

    s e n d e r - d i r e c t e d c o m m u n i c a t i o n o f e s s e n t i a l d a t a , f o r

    r e l o c a t i n g b o d i e s w h i c h c r o s s p r o c e s s o r b o u n d a r i e s ,

    f o r n d i n g s u c c e s s o r p a r t i c l e s a l o n g a l a m e n t , a n d

    a l s o f o r b u i l d i n g t h e g l o b a l B H - t r e e . F u r t h e r m o r e ,

    O R B p r e s e r v e s d a t a l o c a l i t y r e a s o n a b l y w e l l

    1

    a n d p e r -

    m i t s s i m p l e l o a d - b a l a n c i n g . W h i l e i t i s e x p e n s i v e t o

    r e c o m p u t e t h e O R B a t e a c h t i m e s t e p 2 8 ] , t h e c o s t o f

    i n c r e m e n t a l l o a d - b a l a n c i n g i s n e g l i g i b l e 2 5 ] .

    T h e O R B d e c o m p o s i t i o n i s i n c r e m e n t a l l y u p d a t e d

    i n p a r a l l e l a s f o l l o w s . A t t h e e n d o f a n i t e r a t i o n , e a c h

    O R B t r e e n o d e i s a s s i g n e d a w e i g h t e q u a l t o t h e t o t a l

    n u m b e r o f o p e r a t i o n s p e r f o r m e d i n u p d a t i n g t h e s t a t e s

    o f p a r t i c l e s i n e a c h o f t h e p r o c e s s o r s w h i c h i s a d e s c e n -

    d a n t o f t h e n o d e . A n o d e i s o v e r l o a d e d i f i t s w e i g h t

    e x c e e d s t h e a v e r a g e w e i g h t o f n o d e s a t i t s l e v e l b y a

    s m a l l , x e d p e r c e n t a g e , s a y 5 % . W e i d e n t i f y n o d e s

    w h i c h a r e n o t o v e r l o a d e d b u t o n e o f w h o s e c h i l d r e n

    i s o v e r l o a d e d ; c a l l e a c h s u c h n o d e a n i n i t i a t o r . O n l y

    t h e p r o c e s s o r s w i t h i n t h e c o r r e s p o n d i n g s u b t r e e p a r -

    t i c i p a t e i n b a l a n c i n g t h e l o a d f o r t h e r e g i o n o f s p a c e

    a s s o c i a t e d w i t h t h e i n i t i a t o r . T h e s u b t r e e s f o r d i f -

    f e r e n t i n i t i a t o r s a r e d i s j o i n t s o t h a t n o n - o v e r l a p p i n g

    r e g i o n s c a n b e b a l a n c e d i n p a r a l l e l . A t e a c h s t e p o f

    t h e l o a d - b a l a n c i n g s t e p i t i s n e c e s s a r y t o m o v e b o d i e s

    f r o m t h e o v e r l o a d e d c h i l d t o t h e n o n - o v e r l o a d e d c h i l d .

    T h i s i n v o l v e s c o m p u t i n g a n e w s e p a r a t i n g h y p e r p l a n e ;

    w e u s e a b i n a r y s e a r c h c o m b i n e d w i t h a t r e e t r a v e r -

    s a l o n t h e l o c a l B H - t r e e t o d e t e r m i n e t h e t o t a l w e i g h t

    w i t h i n a p a r a l l e l p i p e d .

    3 . 2 V i r t u a l g l o b a l t r e e s

    U n l i k e t h e o r i g i n a l i m p l e m e n t a t i o n o f W a r r e n a n d

    S a l m o n 3 4 ] , w e c h o s e t o c o n s t r u c t a r e p r e s e n t a t i o n o f

    a d i s t r i b u t e d g l o b a l o c t - t r e e . A n i m p o r t a n t c o n s i d e r -

    a t i o n f o r u s w a s t o i n v e s t i g a t e a b s t r a c t i o n s t h a t a l l o w

    t h e a p p l i c a t i o n s p r o g r a m m e r t o d e c l a r e a g l o b a l d a t a

    s t r u c t u r e , a t r e e f o r e x a m p l e , w i t h o u t h a v i n g t o w o r r y

    a b o u t t h e d e t a i l s o f d i s t r i b u t e d - m e m o r y i m p l e m e n t a -

    t i o n . F o r t h i s r e a s o n w e s e p a r a t e d t h e c o n s t r u c t i o n

    o f t h e t r e e f r o m t h e d e t a i l s o f l a t e r s t a g e s o f t h e a l -

    g o r i t h m . T h e i n t e r e s t e d r e a d e r i s r e f e r r e d t o 7 ] f o r

    f u r t h e r d e t a i l s c o n c e r n i n g a l i b r a r y o f a b s t r a c t i o n s f o r

    N - b o d y a l g o r i t h m s .

    1

    C l u s t e r i n g t e c h n i q u e s w h i c h e x p l o i t t h e g e o m e t r i c a l p r o p -

    e r t i e s o f t h e d i s t r i b u t i o n w i l l p r e s e r v e l o c a l i t y b e t t e r , b u t m i g h t

    l o s e s o m e o f t h e o t h e r a t t r a c t i v e p r o p e r t i e s o f O R B .

    R e p r e s e n t a t i o n . W e a s s i g n e a c h B H - t r e e n o d e

    a n o w n e r a s f o l l o w s . S i n c e e a c h t r e e n o d e r e p r e s e n t s

    a x e d r e g i o n o f s p a c e , t h e o w n e r i s c h o s e n t o b e t h e

    p r o c e s s o r w h o s e d o m a i n c o n t a i n s a c a n o n i c a l p o i n t ,

    s a y t h e c e n t e r o f t h e c o r r e s p o n d i n g r e g i o n . T h e d a t a

    f o r a t r e e n o d e , t h e m u l t i p o l e r e p r e s e n t a t i o n f o r e x -

    a m p l e , i s m a i n t a i n e d b y t h e o w n i n g p r o c e s s o r . S i n c e

    e a c h p r o c e s s o r c o n t a i n s t h e O R B - t r e e i t i s a s i m p l e

    c a l c u l a t i o n t o g u r e o u t w h i c h p r o c e s s o r o w n s a t r e e

    n o d e .

    T h e o n l y c o m p l i c a t i o n i s t h a t t h e r e g i o n c o r r e -

    s p o n d i n g t o a n o d e c a n b e s p a n n e d b y t h e d o m a i n s

    o f m u l t i p l e p r o c e s s o r s . I n t h i s c a s e e a c h o f t h e s p a n -

    n i n g p r o c e s s o r s c o m p u t e s i t s c o n t r i b u t i o n t o t h e n o d e ;

    t h e o w n e r a c c e p t s a l l i n c o m i n g d a t a a n d c o m b i n e s t h e

    i n d i v i d u a l c o n t r i b u t i o n s . T h i s c a n b e d o n e e c i e n t l y

    w h e n t h e c o m b i n a t i o n i s a s i m p l e l i n e a r f u n c t i o n , a s

    i s t h e c a s e w i t h a l l t r e e c o d e s .

    C o n s t r u c t i o n . E a c h p r o c e s s o r r s t b u i l d s a l o c a l

    o c t - t r e e f o r t h e b o d i e s w h i c h a r e w i t h i n i t s d o m a i n .

    A t t h e e n d o f t h i s s t a g e , t h e l o c a l t r e e s w i l l n o t , i n

    g e n e r a l , b e s t r u c t u r a l l y c o n s i s t e n t . F o r e x a m p l e , F i g -

    u r e 2 s h o w s a s e t o f p r o c e s s o r d o m a i n s t h a t s p a n a

    n o d e ; t h e n o d e c o n t a i n s f o u r b o d i e s , o n e p e r p r o c e s -

    s o r d o m a i n . E a c h l o c a l t r e e w i l l c o n t a i n t h e n o d e a s

    a l e a f ; b u t t h i s i s i n c o n s i s t e n t w i t h t h e g l o b a l t r e e .

    .

    ..

    .

    F i g u r e 2 : A n i n t e r n a l n o d e w h i c h a p p e a r s a s a l e a f i n

    e a c h l o c a l t r e e .

    T h e n e x t s t e p i s t o m a k e t h e l o c a l t r e e s b e s t r u c -

    t u r a l l y c o n s i s t e n t w i t h t h e g l o b a l o c t - t r e e . T h i s r e -

    q u i r e s a d j u s t i n g t h e l e v e l s o f a l l n o d e s w h i c h a r e s p l i t

    b y O R B l i n e s . W e o m i t t h e d e t a i l s o f t h e l e v e l -

    a d j u s t m e n t p r o c e d u r e i n t h i s p a p e r . A s i m i l a r p r o -

    c e s s w a s d e v e l o p e d i n d e p e n d e n t l y i n 2 8 ] ; a n a d d i -

    t i o n a l c o m p l i c a t i o n i n o u r c a s e i s t h a t w e b u i l d t h e

    o c t - t r e e u n t i l e a c h l e a f c o n t a i n s a n u m b e r , L , o f b o d -

    i e s . C h o o s i n g L t o b e m u c h l a r g e r t h a n 1 r e d u c e s t h e

    s i z e o f t h e B H - t r e e , b u t m a k e s l e v e l - a d j u s t m e n t s o m e -

    w h a t t r i c k y .

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    6/11

    T h e l e v e l a d j u s t m e n t p r o c e d u r e a l s o m a k e s i t e a s y

    t o u p d a t e t h e o c t - t r e e i n c r e m e n t a l l y . W e c a n i n s e r t

    a n d d e l e t e b o d i e s d i r e c t l y o n t h e l o c a l t r e e s b e c a u s e

    w e d o n o t e x p l i c i t l y m a i n t a i n t h e g l o b a l t r e e . A f t e r t h e

    i n s e r t i o n / d e l e t i o n w i t h i n t h e l o c a l t r e e s , l e v e l a d j u s t -

    m e n t r e s t o r e s c o h e r e n c e t o t h e i m p l i c i t l y r e p r e s e n t e d

    d i s t r i b u t e d t r e e s t r u c t u r e .

    3 . 3 C o m p u t i n g m u l t i p o l e m o m e n t s

    F o r g r a v i t a t i o n a l s i m u l a t i o n s o n c e l e v e l - a d j u s t m e n t

    i s c o m p l e t e , e a c h p r o c e s s o r c o m p u t e s t h e c e n t e r s - o f -

    m a s s a n d m u l t i p o l e m o m e n t s o n i t s l o c a l t r e e . T h i s

    p h a s e r e q u i r e s n o c o m m u n i c a t i o n . N e x t , e a c h p r o c e s -

    s o r s e n d s i t s c o n t r i b u t i o n t o a n o d e t o t h e o w n e r o f

    t h e n o d e . O n c e t h e t r a n s m i t t e d d a t a h a v e b e e n c o m -

    b i n e d b y t h e r e c e i v i n g p r o c e s s o r s , t h e c o n s t r u c t i o n o f

    t h e g l o b a l o c t - t r e e i s c o m p l e t e . T h i s m e t h o d o f r e d u c -

    i n g a t r e e c o m p u t a t i o n i n t o o n e l o c a l s t e p t o c o m p u t e

    p a r t i a l v a l u e s , f o l l o w e d b y o n e c o m m u n i c a t i o n s t e p t o

    c o m b i n e p a r t i a l v a l u e s a t s h a r e d n o d e s i s w i d e l y u s e -

    f u l .

    F o r m u l t i - l a m e n t v o r t e x d y n a m i c s , c o m p u t i n g t h e

    v o r t e x e l e m e n t s t r e n g t h s r e q u i r e s a n e x t r a p h a s e i n

    t h e t r e e c o n s t r u c t i o n . T h e v o r t e x e l e m e n t s t r e n g t h

    o f a p a r t i c l e i s d e n e d a s t h e d i s p l a c e m e n t o f i t s t w o

    n e i g h b o r s a l o n g t h e l a m e n t ( e q u a t i o n 3 ) . O n c e t h e

    v o r t e x e l e m e n t s t r e n g t h s a r e c o m p u t e d , w e c o m p u t e

    t h e m u l t i p o l e m o m e n t s o n t h e l o c a l t r e e s . F i n a l l y ,

    e a c h p r o c e s s o r s e n d s i t s c o n t r i b u t i o n t o a n o d e t o t h e

    o w n e r o f t h e n o d e s o t h a t i n d i v i d u a l c o n t r i b u t i o n s a r e

    c o m b i n e d i n t o g l o b a l l y c o r r e c t i n f o r m a t i o n .

    F i n d i n g n e i g h b o r s a l o n g a l a m e n t r e q u i r e s c o m -

    m u n i c a t i o n w h e n t h e n e i g h b o r s a r e o w n e d b y o t h e r

    p r o c e s s o r s . T o e c i e n t l y d e t e r m i n e w h i c h p a r t i c l e s

    h a v e m i s s i n g n e i g h b o r s a n d r e q u i r e c o m m u n i c a t i o n ,

    e a c h p r o c e s s o r n e e d s t o m a i n t a i n a l i n e a r o r d e r i n g

    o f p a r t i c l e s i n t h e s a m e l a m e n t w i t h i n i t s d o m a i n .

    O n c e t h e l i n e a r o r d e r i n g i s c o m p u t e d , a p r o c e s s o r c a n

    g o t h r o u g h t h e l i s t t o c o m p u t e t h e v o r t e x e l e m e n t

    s t r e n g t h , a n d r e q u e s t i n f o r m a t i o n f r o m m i s s i n g n e i g h -

    b o r s .

    T h e l i n e a r o r d e r i n g m u s t b e m a i n t a i n e d d y n a m i -

    c a l l y a s p a r t i c l e s m o v e a c r o s s p r o c e s s o r b o u n d a r i e s , e i -

    t h e r b e c a u s e o f t h e i r i n d u c e d v e l o c i t y o r d u r i n g w o r k -

    l o a d r e m a p p i n g . W e u s e a s p l a y s e a r c h t r e e 2 9 ] t o

    s t o r e t h e i n d i c e s o f p a r t i c l e s o f t h e s a m e l a m e n t .

    W h e n p a r t i c l e s e n t e r / l e a v e a p r o c e s s o r d o m a i n , i t s l -

    a m e n t n u m b e r a n d i n d e x w i t h i n t h e l a m e n t ( f ; i ) a r e

    s e n t t o t h e n e w p r o c e s s o r , s o t h a t i c a n b e i n s e r t e d

    i n t o t h e s e a r c h t r e e f o r l a m e n t f i n t h e d e s t i n a t i o n .

    W e u s e a s p l a y t r e e i m p l e m e n t a t i o n b e c a u s e o f i t s s i m -

    p l i c i t y a n d s e l f - a d j u s t i n g p r o p e r t y .

    3 . 4 S e n d e r - d r i v e n c o m m u n i c a t i o n

    O n c e t h e g l o b a l o c t - t r e e h a s b e e n c o n s t r u c t e d i t i s

    p o s s i b l e t o s t a r t c a l c u l a t i n g a c c e l e r a t i o n s . F o r B a r n e s -

    H u t a l g o r i t h m e a c h p r o c e s s o r c a n c o m p u t e t h e a c c e l -

    e r a t i o n f o r i t s p a r t i c l e s b y t r a v e r s i n g t h e o c t - t r e e , a n d

    r e q u e s t i n g e s s e n t i a l t r e e d a t a f r o m o w n e r s w h e n e v e r

    i t i s n o t l o c a l l y a v a i l a b l e .

    T h i s n a i v e s t r a t e g y o f t r a v e r s i n g t h e t r e e , a n d

    t r a n s m i t t i n g d a t a - o n - d e m a n d , h a s s e v e r a l d r a w b a c k s :

    ( 1 ) i t i n v o l v e s t w o - w a y c o m m u n i c a t i o n , ( 2 ) t h e m e s -

    s a g e s a r e n e - g r a i n s o t h a t e i t h e r t h e c o m m u n i c a t i o n

    o v e r h e a d i s p r o h i b i t i v e o r t h e p r o g r a m m i n g c o m p l e x -

    i t y g o e s u p , a n d ( 3 ) p r o c e s s o r s c a n s p e n d s u b s t a n t i a l

    t i m e r e q u e s t i n g d a t a f o r t r e e n o d e s t h a t d o n o t e x i s t .

    I t i s s i g n i c a n t l y e a s i e r a n d f a s t e r t o r s t c o n s t r u c t

    t h e l o c a l l y e s s e n t i a l t r e e s . T h e o w n e r o f a n o d e c o m -

    p u t e s t h e d e s t i n a t i o n p r o c e s s o r s f o r w h i c h t h e n o d e

    m i g h t b e e s s e n t i a l ; t h i s i n v o l v e s t h e i n t e r s e c t i o n o f

    t h e a n n u l a r r e g i o n o f i n u e n c e o f t h e n o d e w i t h t h e

    O R B - m a p . E a c h p r o c e s s o r r s t c o l l e c t s a l l t h e i n -

    f o r m a t i o n d e e m e d e s s e n t i a l t o o t h e r n o d e s , a n d t h e n

    s e n d s l o n g m e s s a g e s d i r e c t l y t o t h e a p p r o p r i a t e d e s -

    t i n a t i o n s . O n c e a l l p r o c e s s o r s h a v e r e c e i v e d a n d i n -

    s e r t e d t h e d a t a r e c e i v e d i n t o t h e l o c a l t r e e , a l l t h e

    l o c a l l y e s s e n t i a l t r e e s h a v e b e e n b u i l t .

    S e n d e r - d r i v e n c o m m u n i c a t i o n i s u s e d n o t o n l y

    i n t r a n s f e r r i n g e s s e n t i a l d a t a b u t a l s o i n a l l t h e

    o t h e r c o m m u n i c a t i o n p h a s e s . T h i s i s t r u e f o r t h e

    G r e e n g a r d - R o k h l i n a l g o r i t h m a s w e l l 8 ] . F o r e x a m -

    p l e , t o c o m p u t e t h e v o r t e x e l e m e n t s t r e n g t h f o r e a c h

    p a r t i c l e i n t h e m u l t i - l a m e n t v o r t e x m e t h o d , i t s t w o

    n e i g h b o r i n g p a r t i c l e s i n t h e l a m e n t m u s t b e f e t c h e d

    t h r o u g h c o m m u n i c a t i o n i f t h e y a r e n o t i n t h e l o c a l

    t r e e . S i n c e t h e d a t a d e p e n d e n c y i s s y m m e t r i c a l f o r

    t h e c o m p u t a t i o n , t h e o w n e r o f a p a r t i c l e c a n e a s i l y

    d e t e r m i n e i f t h i s p a r t i c l e s h o u l d b e s e n t o u t . B y m a i n -

    t a i n i n g a n u p p e r b o u n d o n t h e m a x i m u m d i s t a n c e b e -

    t w e e n t w o n e i g h b o r i n g p a r t i c l e s , i t b e c o m e s p o s s i b l e

    t o l o c a t e t h e n e i g h b o r s o f a p a r t i c l e q u i c k l y .

    3 . 5 B u l k p r o c e s s i n g

    W e s e p a r a t e c o n t r o l i n t o a s e q u e n c e o f a l t e r n a t -

    i n g c o m p u t a t i o n a n d c o m m u n i c a t i o n p h a s e s . T h i s

    h e l p s m a i n t a i n s i m p l e c o n t r o l s t r u c t u r e ; e c i e n c y i s

    o b t a i n e d b y p r o c e s s i n g d a t a i n b u l k . F o r e x a m p l e ,

    u p t o a c e r t a i n p o i n t , i t i s b e t t e r t o c o m b i n e m u l t i -

    p l e m e s s a g e s t o t h e s a m e d e s t i n a t i o n a n d s e n d o n e

    l o n g m e s s a g e . S i m i l a r l y , i t i s b e t t e r t o c o m p u t e t h e

    e s s e n t i a l d a t a f o r s e v e r a l b o d i e s r a t h e r t h a n f o r o n e

    a t a t i m e . A n o t h e r i d e a t h a t p r o v e d u s e f u l i s s e n d e r -

    d i r e c t e d c o m m u n i c a t i o n , s e n d d a t a w h e r e v e r i t m i g h t

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    7/11

    b e n e e d e d r a t h e r t h a n r e q u e s t i n g i t w h e n e v e r i t i s

    n e e d e d . I n d e e d , w i t h o u t t h e u s e o f t h e C M - 5 v e c t o r

    u n i t s w e f o u n d t h a t t h e s e t w o i d e a s k e p t t h e o v e r h e a d

    b e c a u s e o f p a r a l l e l i s m m i n i m a l .

    3 . 6 A l l - t o - s o m e c o m m u n i c a t i o n

    T h e c o m m u n i c a t i o n p h a s e s c a n a l l b e a b s t r a c t e d a s

    t h e \ a l l - t o - s o m e " p r o b l e m . E a c h p r o c e s s o r c o n t a i n s a

    s e t o f m e s s a g e s ; t h e n u m b e r o f m e s s a g e s w i t h t h e s a m e

    d e s t i n a t i o n c a n v a r y a r b i t r a r i l y . T h e c o m m u n i c a t i o n

    p a t t e r n i s i r r e g u l a r a n d u n k n o w n i n a d v a n c e . F o r e x -

    a m p l e , l e v e l a d j u s t m e n t i s i m p l e m e n t e d a s t w o s e p -

    a r a t e a l l - t o - s o m e c o m m u n i c a t i o n p h a s e s . T h e p h a s e

    f o r c o n s t r u c t i n g l o c a l l y e s s e n t i a l t r e e s u s e s o n e a l l - t o -

    s o m e c o m m u n i c a t i o n .

    T h e r s t i s s u e i s d e t e c t i n g t e r m i n a t i o n : w h e n d o e s

    a p r o c e s s o r k n o w t h a t a l l m e s s a g e s h a v e b e e n s e n t

    a n d r e c e i v e d T h e n a i v e m e t h o d o f a c k n o w l e d g i n g

    r e c e i p t o f e v e r y m e s s a g e , a n d h a v i n g a l e a d e r c o u n t

    t h e n u m b e r s o f m e s s a g e s s e n t a n d r e c e i v e d w i t h i n t h e

    s y s t e m , p r o v e d i n e c i e n t .

    A b e t t e r m e t h o d i s t o u s e a s e r i e s o f g l o b a l r e d u c -

    t i o n s t h e c o n t r o l n e t w o r k o f t h e C M - 5 t o r s t c o m p u t e

    t h e n u m b e r o f m e s s a g e s d e s t i n e d f o r e a c h p r o c e s s o r .

    A f t e r t h i s t h e s e n d / r e c e i v e p r o t o c o l b e g i n s ; w h e n a

    p r o c e s s o r h a s r e c e i v e d t h e p r o m i s e d n u m b e r o f m e s -

    s a g e s , i t i s r e a d y t o s y n c h r o n i z e f o r t h e n e x t p h a s e .

    W e n o t i c e d t h a t t h e c o m m u n i c a t i o n t h r o u g h p u t

    v a r i e d w i t h t h e s e q u e n c e i n w h i c h m e s s a g e s w e r e s e n t

    a n d r e c e i v e d . A s a n e x t r e m e e x a m p l e , i f a l l m e s s a g e s

    a r e s e n t b e f o r e a n y i s r e c e i v e d , a l a r g e m a c h i n e w i l l

    s i m p l y c r a s h w h e n t h e n u m b e r o f v i r t u a l c h a n n e l s h a s

    b e e n e x h a u s t e d . I n t h e C M M D m e s s a g e - p a s s i n g l i -

    b r a r y ( v e r s i o n 3 . 0 ) e a c h o u t s t a n d i n g s e n d r e q u i r e s a

    v i r t u a l c h a n n e l 3 2 ] a n d t h e n u m b e r o f c h a n n e l s i s l i m -

    i t e d .

    I n s t e a d , w e u s e d a p r o t o c o l w h i c h a l t e r n a t e s s e n d s

    w i t h r e c e i v e s . T h e p r o b l e m i s t h u s r e d u c e d t o o r d e r i n g

    t h e m e s s a g e s t o b e s e n t . F o r e x a m p l e , s e n d i n g m e s -

    s a g e s i n o r d e r o f i n c r e a s i n g d e s t i n a t i o n a d d r e s s g i v e s

    l o w t h r o u g h p u t s i n c e v i r t u a l c h a n n e l s t o t h e s a m e r e -

    c e i v e r a r e b l o c k e d . I n a n e a r l i e r p a p e r 2 4 ] w e d e -

    v e l o p e d t h e a t o m i c m e s s a g e m o d e l t o i n v e s t i g a t e t h i s

    p h e n o m e n o n . C o n s i s t e n t w i t h t h e t h e o r y , w e n d t h a t

    s e n d i n g m e s s a g e s i n r a n d o m o r d e r w o r k e d b e s t .

    3 . 7 A p p l i c a t i o n t o v o r t e x s i m u l a t i o n

    W e i m p l e m e n t e d t h e m u l t i - l a m e n t v o r t e x s i m u l a -

    t i o n u s i n g o u r f r a m e w o r k . F i g u r e 3 g i v e s a h i g h - l e v e l

    d e s c r i p t i o n o f t h e c o d e s t r u c t u r e . M o s t o f t h e c o d e

    w a s t a k e n d i r e c t l y f r o m o u r e a r l i e r g r a v i t a t i o n a l s i m -

    u l a t i o n c o d e . F o r e x a m p l e , t h e O R B d e c o m p o s i t i o n ,

    l o a d r e m a p p i n g , c o m m u n i c a t i o n p r o t o c o l , a n d t h e B H

    t r e e m o d u l e a r e e x a c t l y t h e s a m e . T h e o n l y m o d i -

    c a t i o n s r e q u i r e d f o r t h e v o r t e x s i m u l a t i o n a r e t h e e x -

    t r a p h a s e ( s t e p 1 . 2 ) t o c o m p u t e t h e v o r t e x e l e m e n t

    s t r e n g t h o f e a c h p a r t i c l e , a n d t h e d y n a m i c u p d a t e o f

    l a m e n t - t r e e s w h i c h c o n t a i n i n d i c e s o f p a r t i c l e s i n o n e

    l a m e n t ( s t e p 5 ) .

    0 . b u i l d l o c a l B H t r e e s

    f o r e v e r y t i m e s t e p d o :

    1 . c o n s t r u c t t h e B H - t r e e r e p r e s e n t a t i o n

    1 . 1 a d j u s t n o d e l e v e l s

    1 . 2 c o m p u t e t h e s t r e n g t h o f e a c h p a r t i c l e

    1 . 3 c o m p u t e p a r t i a l n o d e v a l u e s o n l o c a l t r e e s

    1 . 4 c o m b i n e p a r t i a l n o d e v a l u e s a t o w n e r s

    2 . o w n e r s s e n d e s s e n t i a l d a t a

    3 . c a l c u l a t e i n d u c e d v e l o c i t y

    4 . u p d a t e v e l o c i t i e s a n d p o s i t i o n s o f b o d i e s

    5 . u p d a t e i n c r e m e n t a l d a t a s t r u c t u r e s :

    l o c a l B H - t r e e a n d f i l a m e n t - t r e e s

    6 . i f t h e w o r k l o a d i s n o t b a l a n c e d

    u p d a t e t h e O R B i n c r e m e n t a l l y

    e n d d o

    F i g u r e 3 : O u t l i n e o f c o d e s t r u c t u r e

    S t e p 0 b u i l d s a l o c a l B H t r e e i n e a c h p r o c e s s o r . A f -

    t e r t h a t t h e l o c a l B H t r e e s a r e m a i n t a i n e d i n c r e m e n -

    t a l l y a n d n e v e r r e b u i l t f r o m s c r a t c h . S t e p 1 c o n s t r u c t s

    a n i m p l i c i t r e p r e s e n t a t i o n o f t h e g l o b a l B H t r e e b y

    c o m b i n i n g i n f o r m a t i o n i n t h e l o c a l t r e e s . S t e p 5 u p -

    d a t e s t h e l o c a l t r e e s a f t e r p a r t i c l e s m o v e t o t h e i r n e w

    p o s i t i o n s .

    S t e p 2 b r o a d c a s t s e s s e n t i a l i n f o r m a t i o n a n d i s t h e

    m o s t c o m m u n i c a t i o n i n t e n s i v e p h a s e . T h e s e n d e r -

    o r i e n t e d c o m m u n i c a t i o n a v o i d s t w o - w a y t r a c i n

    f e t c h i n g r e m o t e d a t a , a n d a g g r e g a t e s m e s s a g e s f o r

    h i g h e r c o m m u n i c a t i o n t h r o u g h p u t .

    S t e p 3 c o m p u t e s t h e i n d u c e d v e l o c i t y f o r e a c h v o r -

    t e x a n d i s m o s t t i m e - c o n s u m i n g . W e u s e t h e K n i o -

    G h o n i e m a l g o r i t h m t o s o l v e t h e B i o t - S a v a r t e q u a t i o n s ,

    u s i n g m o n o p l e , d i p o l e a n d q u a d r a p o l e t e r m s i n t h e

    m u l t i p o l e e x p a n s i o n t o a p p r o x i m a t e t h e e e c t o f a

    c l u s t e r . W e u s e C D P E A C a s s e m b l y l a n g u a g e t o i m -

    p l e m e n t t h i s c o m p u t a t i o n i n t e n s i v e r o u t i n e . O n e s i g -

    n i c a n t o p t i m i z a t i o n w a s t o a p p r o x i m a t e t h e e x p o -

    n e n t i a l s m o o t h i n g t e r m i n e q u a t i o n 1 . W h e n = i s

    l a r g e r t h a n 2 0 w e i g n o r e t h e t e r m ; f o r s m a l l e r v a l u e s

    w e c o m p u t e t h e r s t s e v e n t e r m s i n t h e T a y l o r e x p a n -

    s i o n . T h i s g u a r a n t e e s a c c u r a c y t o w i t h i n a t l e a s t v e

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    8/11

    d e c i m a l p l a c e s .

    S t e p 6 r e d i s t r i b u t e s p a r t i c l e s w h e n w o r k l o a d b e -

    c o m e s i m b a l a n c e d . T h e O R B i s i n c r e m e n t a l l y u p -

    d a t e d s o t h a t w o r k l o a d i s b a l a n c e d a m o n g p r o c e s s o r s .

    3 . 8 C o m p a r i s o n s w i t h p r e v i o u s w o r k

    W e s k e t c h t h e i m p o r t a n t d i e r e n c e s b e t w e e n o u r

    f r a m e w o r k a n d t h e g l o b a l h a s h e d s t r u c t u r e o f W a r r e n

    a n d S a l m o n 3 5 , 1 8 ] . W a r r e n a n d S a l m o n 3 5 ] u s e a d i f -

    f e r e n t c r i t e r i o n f o r a p p l y i n g a p p r o x i m a t i o n s . T h e y d o

    n o t c o n s t r u c t e s s e n t i a l t r e e s t h e r e b y s a v i n g t h e s p a c e

    o v e r h e a d a s s o c i a t e d w i t h l o c a l e s s e n t i a l t r e e s . I n s t e a d ,

    t h e y c o n s t r u c t a n e x p l i c i t r e p r e s e n t a t i o n o f t h e o c t -

    t r e e . E a c h b o d y i s a s s i g n e d a k e y b a s e d o n i t s p o s i -

    t i o n , a n d b o d i e s a r e d i s t r i b u t e d a m o n g p r o c e s s o r s b y

    s o r t i n g t h e c o r r e s p o n d i n g k e y s . B e s i d e s o b v i a t i n g t h e

    n e e d f o r t h e O R B d e c o m p o s i t i o n , t h i s a l s o s i m p l i e s

    t h e c o n s t r u c t i o n o f t h e o c t - t r e e .

    T h e s e a d v a n t a g e s a r e b a l a n c e d b y o t h e r f a c t o r s : ( 1 )

    t h e a d v a n t a g e s o f s e n d e r - d i r e c t e d c o m m u n i c a t i o n a r e

    l o s t , ( 2 ) t h e d a t a s t r u c t u r e s a r e n o t m a i n t a i n e d i n c r e -

    m e n t a l l y , b u t r e b u i l t f r o m s c r a t c h e a c h i t e r a t i o n , a n d

    ( 3 ) t h e c o m p u t a t i o n s t a g e i s s l o w e d d o w n b y c o m -

    m u n i c a t i o n ; t h e l a t e n c y i s l a r g e l y h i d d e n b y m u l t i p l e

    t h r e a d s t o p i p e l i n e t r e e t r a v e r s a l s a n d t o u p d a t e a c -

    c e l e r a t i o n s , b u t t h e p r o g r a m c o n t r o l s t r u c t u r e i s c o m -

    p l i c a t e d a n d l e s s t r a n s p a r e n t . F i n a l l y , i t i s n o t c l e a r

    h o w h a s h e d o c t - t r e e s c a n b e e x t e n d e d g r a c e f u l l y t o

    m u l t i - l a m e n t s i m u l a t i o n s w h e r e e a c h l a m e n t m u s t

    m a i n t a i n a c y c l i c o r d e r i n g . I n d e e d , t h e i r u i d d y n a m -

    i c s s i m u l a t i o n i n v o l v e s o n l y \ f r e e " p a r t i c l e s ( v o r t e x a r -

    r o w s ) .

    W h i l e o u r v o r t e x s i m u l a t i o n s a r e v e r y d i e r e n t f r o m

    t h o s e o f 1 8 ] t o m a k e m e a n i n g f u l c o m p a r i s o n s , t h e e x -

    p e r i m e n t s f o r g r a v i t a t i o n a l s i m u l a t i o n s a r e q u i t e s i m -

    i l a r . O u r p e r f o r m a n c e g u r e s c o m p a r e f a v o r a b l y w i t h

    t h o s e r e p o r t e d b y W a r r e n a n d S a l m o n 3 4 , 3 5 ] . W i t h

    1 0 m i l l i o n p a r t i c l e s d i s t r i b u t e d u n i f o r m l y i n s p a c e , t h e

    t o t a l t i m e p e r i t e r a t i o n f o r o u r c o d e i s 2 7 s e c o n d s o n a

    2 5 6 n o d e C M - 5 ; l e s s t h a n 3 0 % o f t h e t i m e i s d e v o t e d t o

    m a n a g i n g t h e B a r n e s - H u t t r e e , c o n s t r u c t i n g l o c a l l y e s -

    s e n t i a l t r e e s , p r e p a r i n g e s s e n t i a l d a t a v i a c a c h i n g , a n d

    b a l a n c i n g w o r k l o a d . I n c o n t r a s t , t h e t i m e p e r i t e r a -

    t i o n f o r a u n i f o r m d i s t r i b u t i o n o f 8 . 8 m i l l i o n p a r t i c l e s

    o n t h e 5 1 2 - n o d e D e l t a T o u c h s t o n e r e p o r t e d b y W a r r e n

    a n d S a l m o n i s 7 7 s e c o n d s 3 4 ] a n d 1 1 4 s e c o n d s 3 5 ]

    u s i n g t h e h a s h e d d a t a s t r u c t u r e . I n t h e l a t t e r i m p l e -

    m e n t a t i o n o v e r 5 3 % o f t h e t i m e i s s p e n t c o n s t r u c t i n g

    a n d m a n i p u l a t i n g t h e t r e e s t r u c t u r e .

    4 P e r f o r m a n c e

    O u r p l a t f o r m i s t h e C o n n e c t i o n M a c h i n e C M - 5 w i t h

    S P A R C v e c t o r u n i t s 3 0 ] . E a c h p r o c e s s i n g n o d e h a s

    3 2 M b y t e s o f m e m o r y a n d c a n p e r f o r m o a t i n g p o i n t

    o p e r a t i o n s a t p e a k r a t e o f 1 2 8 M o p / s 3 3 ] . W e u s e

    t h e C M M D c o m m u n i c a t i o n l i b r a r y 3 2 ] . T h e v e c t o r

    u n i t s a r e p r o g r a m m e d i n C D P E A C w h i c h p r o v i d e s a n

    i n t e r f a c e b e t w e e n C a n d t h e D P E A C a s s e m b l y l a n -

    g u a g e f o r v e c t o r u n i t s 3 1 ] . T h e r e s t o f t h e p r o g r a m i s

    w r i t t e n i n C .

    T h e v o r t e x d y n a m i c s c o d e a l o n g w i t h s e v e r a l d i -

    a g n o s t i c s a r e o p e r a t i o n a l . S t a r t i n g w i t h t h e g r a v i t a -

    t i o n a l c o d e , t h e e o r t i n v o l v e d a d d i n g t h e p h a s e t o

    c o m p u t e v o r t e x e l e m e n t s t r e n g t h a n d w r i t i n g t h e c o m -

    p u t a t i o n a l C D P E A C k e r n e l . A s e x p e c t e d , t h e l a t t e r

    p a r t t o o k m o s t o f t h e e o r t ; t h e d a t a s t r u c t u r e s w e r e

    a d a p t e d a n d d e b u g g e d i n l e s s t h a n a w e e k .

    W e a r e c u r r e n t l y r u n n i n g e x t e n s i v e t e s t s t o c h e c k

    t h e a c c u r a c y o f t h e B a r n e s - H u t m e t h o d a s a f u n c t i o n

    o f t h e a p p r o x i m a t i o n p a r a m e t e r . P r e l i m i n a r y r e s u l t s

    s h o w t h a t w i t h q u a d r u p o l e e x p a n s i o n s w e c a n o b t a i n

    u p t o v e d i g i t s o f a c c u r a c y w h e n i s a b o u t 0 . 2 5 , a n d

    t h e t i m e s t e p i s 0 . 0 0 2 .

    p h a s e t i m e ( s e c o n d )

    a d j u s t l e v e l 1 . 4 0 7

    c o m p u t e v o r t e x s t r e n g t h a n d m o m e n t s 1 . 4 3 5

    c o n s t r u c t g l o b a l t r e e 0 . 3 1 7

    c o l l e c t l o c a l e s s e n t i a l d a t a 1 5 . 8 7 3

    c o m p u t e t h e n e w v e l o c i t y 3 0 7 . 2 2 1

    u p d a t e p a r t i c l e p o s i t i o n 0 . 1 4 4

    m o v e p a r t i c l e s i n t o r i g h t p r o c e s s o r s 1 . 7 2 0

    r e m a p t h e w o r k l o a d 0 . 1 4 1

    t o t a l t i m e 3 2 8 . 2 5 8

    F i g u r e 4 : T i m i n g b r e a k d o w n f o r v o r t e x s i m u l a t i o n .

    F i g u r e 4 s h o w s t h e t i m i n g b r e a k d o w n f o r a 3 D v o r -

    t e x s i m u l a t i o n o n a 1 2 8 - n o d e C M - 5 . T h e i n p u t c o n -

    g u r a t i o n i s a 2 2 l a y e r s , 1 0 1 2 l a m e n t v o r t e x r i n g

    2

    .

    E a c h l a m e n t h a s 1 0 2 4 p a r t i c l e s a n d t h e t o t a l n u m -

    b e r o f p a r t i c l e s i s a b o u t o n e m i l l i o n . T h e r a d i u s o f

    t h e c r o s s s e c t i o n o f t h e v o r t e x r i n g i s 0 : 0 7 5 9 5 a n d t h e

    c o r e r a d i u s i s 0 : 0 6 . W e u s e =

    1

    4

    i n t h e o p e n i n g

    t e s t f o r m u l t i p o l e a p p r o x i m a t i o n s o t h a t t h e e r r o r i n

    t o t a l i n d u c e d v e l o c i t y i s w i t h i n 0 . 0 0 0 0 1 . T h e v e c t o r

    u n i t s c o m p u t e t h e i n d u c e d v e l o c i t y a t 5 4 M o p / s e c ,

    a n d t h e s i m u l a t i o n s u s t a i n s a n o v e r a l l r a t e o f o v e r 3 7

    2

    W e u s e a = 1 , b = 0 6 , a n d c = 0 i n E q u a t i o n 7 .

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    9/11

    M o p / s e c p e r n o d e ( a v e r a g e d o v e r 5 t i m e s t e p s , n o t

    i n c l u d i n g t h e r s t ) .

    S i n c e t h e l o c a l l y e s s e n t i a l t r e e s o v e r l a p c o n s i d e r -

    a b l y , t h e t o t a l s i z e o f l o c a l t r e e s e x c e e d s t h e s i z e o f t h e

    g l o b a l t r e e . F i g u r e 5 s h o w s t h e m e m o r y o v e r h e a d ( r a -

    t i o o f t o t a l d i s t r i b u t e d m e m o r y u s e d d i v i d e d b y g l o b a l

    t r e e s i z e ) v e r s u s g r a n u l a r i t y ( n u m b e r o f p a r t i c l e s p e r

    n o d e ) o n a 3 2 - n o d e C M - 5 . T h i s r a t i o i s l e s s t h a n 2 . 4 a s

    t h e g r a n u l a r i t y e x c e e d s 1 0 0 0 0 p a r t i c l e s p e r p r o c e s s o r s ,

    e v e n f o r v e r y s m a l l = 0 : 2 5 .

    Ratio of essential and global tree size (P = 32)

    theta = 0.25

    theta = 0.33

    theta = 0.5

    Ratio

    3Granularity x 10

    1.80

    2.00

    2.20

    2.40

    2.60

    2.80

    3.00

    3.20

    3.40

    3.60

    3.80

    4.00

    4.20

    4.40

    4.60

    0.00 2.00 4.00 6.00 8.00 10.00

    F i g u r e 5 : M e m o r y o v e r h e a d v e r s u s g r a n u l a r i t y f o r d i f -

    f e r e n t .

    top view

    side view

    F i g u r e 6 : L o w a s p e c t r a t i o e l l i p t i c r i n g o s c i l l a t e s b e -

    t w e e n t h e s t a t e s s h o w n . T h e r i n g h a s N = 1 5 3 6 0

    p a r t i c l e s . T h e l a s t t i m e s h o w n i s a f t e r 1 0 0 0 t i m e s t e p s

    t = 6 : 2 8 x 1 0

    ? 3

    .

    A s p a r t o f t h e i n i t i a l t e s t i n g , w e h a v e e x a m i n e d

    t w o c a s e s . T h e r s t i s a l o w a s p e c t r a t i o e l l i p t i c r i n g

    top view

    side view

    F i g u r e 7 : C o l l a p s i n g v o r t e x r i n g . T h i s r i n g i s d i s -

    c r e t i z e d w i t h N = 1 1 2 6 4 0 p a r t i c l e s . T h e c o l l a p s e s t a t e

    s h o w n i s o b t a i n e d b y 2 0 0 0 t i m e s t e p s t = 1 0

    ? 3

    .

    w i t h a = 1 ; b = 0 : 8 a n d c = 0 ( s e e E q . 7 ) . T h i s r i n g

    p r e s e n t s a n o s c i l l a t i n g b e h a v i o r b e t w e e n t h e t w o s t a t e s

    p r e s e n t e d i n F i g 6 . T h e r i n g w a s d i s c r e t i z e d w i t h N

    f

    =

    6 0 l a m e n t s w i t h a t o t a l n u m b e r o f p a r t i c l e s N =

    1 5 3 6 0 . T h e n a l s t a t e i n F i g 6 i s a f t e r 1 0 0 0 t i m e s t e p s

    t = 6 : 2 8 x 1 0

    ? 3

    . T h e s e c o n d c a s e t e s t e d c o r r e s p o n d s

    t o a c o l l a p s i n g v o r t e x r i n g w i t h a = 1 ; b = 0 : 4 a n d

    c = 0 : 5 . T h e i n i t i a l c o n d i t i o n a n d t h e c o l l a p s e s t a t e

    a r e s h o w n i n F i g 7 . T h i s r i n g h a s N

    f

    = 2 2 0 l a m e n t s

    w i t h a t o t a l n u m b e r o f p a r t i c l e s N = 1 1 2 6 4 0 . T h e

    n a l s t a t e c o r r e s p o n d s t o 2 0 0 0 t i m e s t e p s t = 1 0

    ? 3

    .

    A c k n o w l e d g m e n t s

    W e t h a n k A p o s t o l o s G e r a s o u l i s o f R u t g e r s f o r h e l p i n g

    s e t u p t h e c o l l a b o r a t i o n a n d h e l p f u l d i s c u s s i o n s . T h i s

    w o r k i s s u p p o r t e d i n p a r t b y O N R G r a n t N 0 0 0 1 4 - 9 3 -

    1 - 0 9 4 4 a n d A R P A c o n t r a c t D A B T - 6 3 - 9 3 - C - 0 0 6 4 \ H y -

    p e r c o m p u t i n g & D e s i g n . " T h e c o n t e n t o f t h e i n f o r m a -

    t i o n h e r e i n d o e s n o t n e c e s s a r i l y r e e c t t h e p o s i t i o n o f

    t h e G o v e r n m e n t a n d o c i a l e n d o r s e m e n t s h o u l d n o t

    b e i n f e r r e d .

    T h e c o d e w a s d e v e l o p e d a n d t e s t e d o n t h e C M - 5 a t

    t h e N a v a l R e s e a r c h L a b o r a t o r i e s , t h e N a t i o n a l C e n t e r

    f o r S u p e r c o m p u t e r A p p l i c a t i o n s , U n i v e r s i t y o f I l l i n o i s

    a t U r b a n a - C h a m p a i g n , a n d t h e M i n n e s o t a S u p e r c o m -

    p u t i n g C e n t e r .

    R e f e r e n c e s

    1 ] A . S . A l m g r e n , T . B u t t k e , a n d P . C o l e l l a . A

    f a s t a d a p t i v e v o r t e x m e t h o d i n t h r e e d i m e n s i o n s .

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    10/11

    J o u r n a l o f C o m p u t a t i o n a l P h y s i c s , 1 1 3 : 1 7 7 { 2 0 0 ,

    1 9 9 4 .

    2 ] C . A n d e r s o n . A n i m p l e m e n t a t i o n o f t h e f a s t m u l -

    t i p o l e m e t h o d w i t h o u t m u l t i p o l e s . S I A M J o u r n a l

    o n S c i e n t i c a n d S t a t i s t i c a l C o m p u t i n g , 1 3 , 1 9 9 2 .

    3 ] C . A n d e r s o n a n d C . G r e e n g a r d . T h e v o r t e x

    m e r g e r p r o b l e m a t i n n i t e R e y n o l d s n u m b e r .

    C o m m u n i c a t i o n s o n P u r e a n d A p p l i e d M a t h e m a t -

    i c s , X L I I : 1 1 2 3 { 1 1 3 9 , 1 9 8 9 .

    4 ] R . A n d e r s o n . N e a r e s t n e i g h b o r t r e e s a n d N - b o d y

    s i m u l a t i o n . m a n u s c r i p t , 1 9 9 4 .

    5 ] J . B a r n e s a n d P . H u t . A h i e r a r c h i c a l O ( N l o g N )

    f o r c e - c a l c u l a t i o n a l g o r i t h m . N a t u r e , 3 2 4 , 1 9 8 6 .

    6 ] J . T . B e a l e a n d A . M a j d a . V o r t e x m e t h o d s . I :

    C o n v e r g e n c e i n t h r e e d i m e n s i o n s . M a t h e m a t i c s

    o f C o m p u t a t i o n , 3 9 ( 1 5 9 ) : 1 { 2 7 , 1 9 8 2 .

    7 ] S . B h a t t , M . C h e n , J . C o w i e , , C . L i n , a n d P . L i u .

    O b j e c t - o r i e n t e d s u p p o r t f o r a d a p t i v e m e t h o d s o n

    p a r a l l e l m a c h i n e s . I n O b j e c t O r i e n t e d N u m e r i c s

    C o n f e r e n c e , 1 9 9 3 .

    8 ] S B h a t t a n d P . L i u . A f r a m e w o r k f o r p a r a l l e l

    n - b o d y s i m u l a t i o n s . m a n u s c r i p t , 1 9 9 4 .

    9 ] P . C a l l a h a n a n d S . K o s a r a j u . A d e c o m p o s i -

    t i o n o f m u l t i - d i m e n s i o n p o i n t - s e t s w i t h a p p l i c a -

    t i o n s t o k - n e a r e s t - n e i g h b o r s a n d N - b o d y p o t e n -

    t i a l e l d s . 2 4 t h A n n u a l A C M S y m p o s i u m o n T h e -

    o r y o f C o m p u t i n g , 1 9 9 2 .

    1 0 ] S . C . C r o w . S t a b i l i t y t h e o r y f o r a p a i r o f t r a i l i n g

    v o r t i c e s . A I A A J o u r n a l , 8 ( 1 2 ) : 2 1 7 2 { 2 1 7 9 , 1 9 7 0 .

    1 1 ] S . D o u a d y , Y . C o u d e r , a n d M . E . B r a c h e t . D i -

    r e c t o b s e r v a t i o n o f t h e i n t e r m i t t e n c y o f i n t e n s e

    v o r t i c i t y l a m e n t s i n t u r b u l e n c e . P h y s i c a l R e v i e w

    L e t t e r s , 6 7 ( 8 ) : 9 8 3 { 9 8 6 , 1 9 9 1 .

    1 2 ] V . M . F e r n a n d e z . V o r t e x i n t e n s i c a t i o n a n d c o l -

    l a p s e o f t h e L i s s a j o u s - E l l i p t i c r i n g : B i o t - S a v a r t

    s i m u l a t i o n s a n d v i s i o m e t r i c s . P h . D . T h e s i s , R u t -

    g e r s U n i v e r s i t y , N e w B r u n s w i c k , N e w J e r s e y ,

    1 9 9 4 .

    1 3 ] V . M . F e r n a n d e z , N . J . Z a b u s k y , a n d V . M .

    G r y a n i k . N e a r - s i n g u l a r c o l l a p s e a n d l o c a l i n t e n s i -

    c a t i o n o f a \ L i s s a j o u s - e l l i p t i c " v o r t e x r i n g : N o n -

    m o n o t o n i c b e h a v i o r a n d z e r o - a p p r o a c h i n g l o c a l

    e n e r g y d e n s i t i e s . P h y s i c s o f F l u i d s A , 6 ( 7 ) : 2 2 4 2 {

    2 2 4 4 , 1 9 9 4 .

    1 4 ] C . G r e e n g a r d . C o n v e r g e n c e o f t h e v o r t e x l -

    a m e n t m e t h o d . M a t h e m a t i c s o f C o m p u t a t i o n ,

    4 7 ( 1 7 6 ) : 3 8 7 { 3 9 8 , 1 9 8 6 .

    1 5 ] L . G r e e n g a r d a n d V . R o k h l i n . A f a s t a l g o r i t h m

    f o r p a r t i c l e s i m u l a t i o n s . J o u r n a l o f C o m p u t a -

    t i o n a l P h y s i c s , 7 3 , 1 9 8 7 .

    1 6 ] H . S . H u s a i n a n d F . H u s s a i n . E l l i p t i c j e t s . P a r t 3 .

    D y n a m i c s o f p r e f e r r e d m o d e c o h e r e n t s t r u c t u r e .

    J o u r n a l o f F l u i d M e c h a n i c s , 2 4 8 : 3 1 5 { 3 6 1 , 1 9 9 3 .

    1 7 ] F . H u s s a i n a n d H . S . H u s a i n . E l l i p t i c j e t s . P a r t

    1 . C h a r a c t e r i s t i c s o f u n e x c i t e d a n d e x c i t e d j e t s .

    J o u r n a l o f F l u i d M e c h a n i c s , 2 0 8 : 2 5 7 { 3 2 0 , 1 9 8 9 .

    1 8 ] M . W a r r e n J . S a l m o n a n d G . W i n c k e l m a n s . F a s t

    p a r a l l e l t r e e c o d e s f o r g r a v i t a t i o n a l a n d u i d d y -

    n a m i c a l N - b o d y p r o b l e m s . I n t l . J . S u p e r c o m p u t e r

    A p p l i c a t i o n s , 8 . 2 , 1 9 9 4 .

    1 9 ] R . T . J o h n s t o n a n d J . P . S u l l i v a n . A o w v i s u a l -

    i z a t i o n s t u d y o f t h e i n t e r a c t i o n b e t w e e n a h e l i c a l

    v o r t e x a n d a l i n e v o r t e x . S u b m i t t e d t o E x p e r i -

    m e n t s i n F l u i d s , 1 9 9 3 .

    2 0 ] S . K i d a a n d M . T a k a o k a . V o r t e x r e c o n n e c t i o n .

    A n n u . R e v . F l u i d M e c h . , 2 6 : 1 6 9 { 1 8 9 , 1 9 9 4 .

    2 1 ] O . M . K n i o a n d A . F . G h o n i e m . N u m e r i c a l s t u d y

    o f a t h r e e - d i m e n s i o n a l v o r t e x m e t h o d . J o u r n a l o f

    C o m p u t a t i o n a l P h y s i c s , 8 6 : 7 5 { 1 0 6 , 1 9 9 0 .

    2 2 ] A . L e o n a r d . V o r t e x m e t h o d s f o r o w s i m u l a t i o n .

    J o u r n a l o f C o m p u t a t i o n a l P h y s i c s , 3 7 : 2 8 9 { 3 3 5 ,

    1 9 8 0 .

    2 3 ] A . L e o n a r d . C o m p u t i n g t h r e e - d i m e n s i o n a l i n -

    c o m p r e s s i b l e o w s w i t h v o r t e x e l e m e n t s . A n n .

    R e v . F l u i d M e c h . , 1 7 : 5 2 3 { 5 5 9 , 1 9 8 5 .

    2 4 ] P . L i u , W . A i e l l o , a n d S . B h a t t . A n a t o m i c m o d e l

    f o r m e s s a g e p a s s i n g . I n 5 t h A n n u a l A C M S y m -

    p o s i u m o n P a r a l l e l A l g o r i t h m s a n d A r c h i t e c t u r e ,

    1 9 9 3 .

    2 5 ] P . L i u a n d S . B h a t t . E x p e r i e n c e s w i t h p a r a l l e l n -

    b o d y s i m u l a t i o n . I n 6 t h A n n u a l A C M S y m p o s i u m

    o n P a r a l l e l A l g o r i t h m s a n d A r c h i t e c t u r e , 1 9 9 4 .

    2 6 ] A . J . M a j d a . V o r t i c i t y , t u r b u l e n c e a n d a c o u s t i c s i n

    u i d o w . S I A M R e v i e w , 3 3 ( 3 ) : 3 4 9 { 3 8 8 , S e p t e m -

    b e r 1 9 9 1 .

    2 7 ] J . S a l m o n . P a r a l l e l H i e r a r c h i c a l N - b o d y M e t h o d s .

    P h D t h e s i s , C a l t e c h , 1 9 9 0 .

  • 8/3/2019 Sandeep Bhatt et al- Tree codes for vortex dynamics: Application of a programming framework

    11/11

    2 8 ] J . S i n g h . P a r a l l e l H i e r a r c h i c a l N - b o d y M e t h o d s

    a n d t h e i r I m p l i c a t i o n s f o r M u l t i p r o c e s s o r s . P h D

    t h e s i s , S t a n f o r d U n i v e r s i t y , 1 9 9 3 .

    2 9 ] R . E . T a r j a n . D a t a S t r u c t u r e s a n d N e t w o r k A l g o -

    r i t h m s . S o c i e t y f o r I n d u s t r i a l a n d A p p l i e d M a t h -

    e m a t i c s , 1 9 8 3 .

    3 0 ] T h i n k i n g M a c h i n e s C o r p o r a t i o n . T h e C o n n e c t i o n

    M a c h i n e C M - 5 T e c h n i c a l S u m m a r y , 1 9 9 1 .

    3 1 ] T h i n k i n g M a c h i n e s C o r p o r a t i o n . C D P E A C : U s -

    i n g G C C t o p r o g r a m i n D P E A C , 1 9 9 3 .

    3 2 ] T h i n k i n g M a c h i n e s C o r p o r a t i o n . C M M D R e f e r -

    e n c e M a n u a l , 1 9 9 3 .

    3 3 ] T h i n k i n g M a c h i n e s C o r p o r a t i o n . D P E A C R e f e r -

    e n c e M a n u a l , 1 9 9 3 .

    3 4 ] M . W a r r e n a n d J . S a l m o n . A s t r o p h y s i c a l N - b o d y

    s i m u l a t i o n s u s i n g h i e r a r c h i c a l t r e e d a t a s t r u c -

    t u r e s . I n P r o c e e d i n g s o f S u p e r c o m p u t i n g , 1 9 9 2 .

    3 5 ] M . W a r r e n a n d J . S a l m o n . A p a r a l l e l h a s h e d o c t -

    t r e e N - b o d y a l g o r i t h m . I n P r o c e e d i n g s o f S u p e r -

    c o m p u t i n g , 1 9 9 3 .

    3 6 ] G . S . W i n c k e l m a n s . T o p i c s i n v o r t e x m e t h o d s f o r

    t h e c o m p u t a t i o n o f t h r e e - a n d t w o - d i m e n s i o n a l

    i n c o m p r e s s i b l e u n s t e a d y o w s . P h . D . T h e s i s , C a l -

    i f o r n i a I n s t i t u t e o f T e c h n o l o g y , P a s a d e n a , C a l i -

    f o r n i a , 1 9 8 9 .

    3 7 ] F . Z h a o . A n O ( N ) a l g o r i t h m f o r t h r e e d i m e n -

    s i o n a l N - b o d y s i m u l a t i o n . T e c h n i c a l r e p o r t , M I T ,

    1 9 8 7 .