TELKOM NIKA Indonesia n  Journal of  Electrical En gineering   Vol.12, No.6, Jun e  201 4, pp. 4361 ~ 4 3 6 7   DOI: 10.115 9 1 /telkomni ka. v 12i6.453 1          4361     Re cei v ed O c t ober 1, 20 13;  Revi se d Ja n uary 11, 201 4 ;  Accepte d  Febru a ry 3, 20 14   Load Balancin g Algorithm of  GPU Based on Genetic  Algorithm      Zhang Xiang y ang*, Feng  Chaomin, Zh ao Shugui. Wen Ling. Li Chang c hun      PetroC hi na R e searc h  Institute of Petrol e u m Exp l or ation &D evel opme n t-No rth w e s t,   Lanz ho u, Gansu Provinc e  73 0 020, Ch in a   *Corres p o ndi n g  author, e-ma i l : zxy_ petro@ 1 63.com       A b st r a ct   As the dev elo p m e n t of GPU/CPU par all e l c o mputi ng  i n  re cent years, l o a d  bal anc e of GPU serve r   has bee n more   an d mor e   i m p o rtant,  so  w e  p r omote a  g e n e tic al gor ith m -ba s ed  loa d   bal an cing  al gorith m  fo r   GPU RT M. T h e alg o rith m tak e s the server  status  and j ob  assig n m ent i n to accou n t, and  desig n a co di n g   m e c h anis m  and  genetic  m a nipul ation,  as well as  fitness function. Th e experim ents s how  that,the algor ithm  can re ach  a  b e tter effect of  efficiency  an d l oad- bal anc ing.  It can h i d den   data tra n s m issi on i n  th e p a ral l e l   computi ng, an d duri ng server  dow nt ime, it can prev ent the  idle  of other co mp utin g resour ces.     Ke y w ords :   reverse-ti me  migrati on, gen eti c  algorit hm,  lo ad ba lanc in g, GPU/CPU het erog ene ous p a r alle l   computi ng, GPU Server     Copy right  ©  2014 In stitu t e o f  Ad van ced  En g i n eerin g and  Scien ce. All  rig h t s reser ve d .       1. Introduc tion  With the i n creasi ng difficu lty of oil expl oration,  reve rse time  mig r ation, full wa vefor m   inversi on a n d  other n e w p r ocessin g  technolo g ies  as  well a s  GPU  and othe r eq uipment s hav e   been a pplie d  in sei s mic  data processing. Relati ve  to the CPU serve r , GP U se rver  gre a tly  improve d  the  parall e lism  a nd computati onal effici e n cy of reverse time migration,  and ha s a  go od  effect of reve rse  time mi gration. Howev e r, du to th e la ck  of loa d  bala n ci ng  strategy  or j u st  throug simpl e  metho d  to  achi eve loa d   balan cing  of t he reverse - time mig r ation   algorith m  ba sed  on GPU serv er, there i s  n o t suitable lo ad balan ci n g  algorith m  for the algorith m s ba sed on G P serve r . In thi s  pa pe r, a  Geneti c  Algo rithm ba se load b a lan c i ng alg o rithm  of reverse - ti me   migratio n ha s been  de sign ed to ad apt to the cha r ac t e risti c s of GP U serve r s, a n d  ma ke different  batch es a nd  different mod e ls of GPU  servers dy nam ically assig n  tasks d epe ndi ng on the loa d  of  servers, so that all serv ers  can be fully utilized.   Geneti c  algo rithm (GA G enetic Algo rithm) is a cl a ss of self -org anizi ng and  adaptive  artificial intelli gen ce tech ni que by simul a ting evol utio n and mecha n ism s  of natural biolo g ical  to   solve the  pro b lem [1-5]. By the en codin g , fitness fun c tion a nd g e netic m anipul ation alg o rith ms,  GA ca n be  u s ed to  obtain  environ ment al inform atio n  to se arch a n d  adju s t the  search  dire ctio n.  Thro ugh thi s   self-o rg ani zin g , adaptive chara c te risti c s,  GA can a u tomatically di scover th e la ws of  the enviro n m ent, so that  it is very suitable  for  real-time stat us cha ngin g   environ ment   of  appli c ation a nd serve r s, a c cordi ng  to   the current st ate of the  se rver de cid e   t a sk allo catio n . In   summ ary, this pa per  pre s ents a  Gen e tic Algo rithm b a se d dynami c  loa d  bala n cing algo rithm  of   reverse - time  migratio n tha t  takes the e a ch  se rv er status an se rver  type i n to co nsi deration   together, it ca n flexibly adjust task for ea ch se rv er. On  the one han d, based o n  different types of  serve r s, it allocate diffe ren t  amounts of  task,  on th e other h and, a d just s assig n m ents b a sed  on   serve r  lo ad  st ate, so th at, it can  ma ke ful l  use   of serve r and  achiev e the effe ct of   load -bal an ce t hereby  in cr e a sin g  t he loa d  cap a cit y  of   serv e r s [ 6 -11 ]     2. Parallel Algorithm for  Rev e rse-tim e  Migration  Reverse  time  migration i s   the seismi d a ta  mig r ation  method  that  usin g two-wa y wave  equatio n, the basi c  form ula  is as follo ws:   22 22 2 2 11 1 1 11 1 1 () () ( ) () P PP P P P x xy y x x y y vt v t                                 (1)  Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 6, June 20 14:  4361 – 4 367   4362 Whe r e,   ,, , PP x y z t  is  the pre s sure  field of medium (, , ) x yz is the medium  den sity (, , ) vv x y z is  the veloc i ty field ,, , s xy z t  is the  source te rm.  With the hi g h  order  differen c e o r  comp act diffe ren c e sch e m e  is used to solve the Equa tion (1), it can  be use d  for the  nume r ical si mulation of wave pro pagati on.  Dabl ain(1986 ) already  discusse d in  detail the hig her  orde r finite differen c e soluti on of the thre e-dim e n s iona l two-way wa ve equation.  Here just list the  basi c  calculat ion formul a of the forwa r d a nd inverse ex trapolatio n [12-15].   The 3d  hig h  ord e r fini te differen c e  wave eq u a tion, with  truncation e rro r is  2 , , , t z y x O M M M  , is  as  follows      2 1 , , , , , , 0 2 2 1 , , , , , , 0 2 2 1 , , , , , , 0 2 1 , , , , 1 , , 2 1 2 1 2 1 2 M m n m k j i n m k j i m n k j i M m n k m j i n k m j i m n k j i M m n k j m i n k j m i m n k j i n k j i n k j i n k j i u u u z t v u u u y t v u u u x t v u u u                  (2)                                                           The im pleme n tation of  rev e rse-time  mi gration  with  n o  load -b alan ce is  sh own in  Figu re  1, the so urce  data ha s b e en tota lly dist ributed  at the  begin n ing,  with no  co nsi deratio n of th e   serve r  type a nd se rver lo a d  state,  re sul t ing in the se rvers with faster pro c e s sin g  spe ed waiting  the serve r s with slo w e r  pro c e ssi ng speed for  a l ong time. And once a server failu re,  job   pro c e ssi ng ti me will  be lo nger agai n; al l the othe r se rvers mu st be  waiting fo r th e fault server to  finis h  its  task .       Figure 1. Parallel Algorith m  of Reverse - time Migratio n with on Lo a d  Balance       Becau s e of the pro b lem s  of reverse-ti me  migratio n  with no load -bala n ce, through the   optimizatio of software,  desi gn the  p o lling al go rithm ba se d lo ad b a lan c ing  algo rithm f o reverse - time  migratio n, a s   sho w n  in Fi g u re  2. Thi s   al gorithm  can  a ssi gn ta sk d u r ing th sei s mic   data processi ng, and avoi d  t hat all the other  serve r s wait for t he faul t serve r , but becau se of th e   algorith m   without  con s id ering the  serve r  lo ad  st ate  a nd the  type  o f  se rver, j ob  compl e tion ti me  differen c e is  bigge r, and st ill cann ot make full use of the se rvers.   Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     Load Bala nci ng Algorithm  of  GPU Base d on Gen e tic  Algorithm  (Zh ang Xiang ya n g 4363   Figure 2. The  Polling Algori t hm Based L oad Bala n c in g Algorithm for Reve rse-ti me Migratio n       The above al gorithm  still cannot solve the pro b lem o f  load balan ci ng very well, so this  article d e si gn ed a gen etic  algorith m  ba sed load bal a n cin g  algo rith m of reverse-time migratio n .   The algo rith m con s ide r s the different p r ocessin g   ca pacity of each GPU se rv er type, for different   GPU serve r Sets in differe nt servi c e ma tching d egree . The algorith m  flow cha r t is as follo ws:         Figure 3. The  Genetic Algo rithm Base d Load Bala nci ng Algorithm  of Reverse - time Migratio n       3. Algorith m  Desig n  for th e G e n e tic  Algor ithm Ba sed  Load  Balan c ing Algo rithm of  Rev e rse-tim e  Migration   In the pro c e s s of solvin g p r acti cal p r obl ems,   ge netic algorith m s ca nnot  deal  dire ctly with   the data i n  the p r obl em  spa c e, it  can  handl o n ly data exp r e s sed i n  the f o rm of  gen o m chromo som e , and the r efo r e to u s g enetic  algo rithm to solve  the proble m , first of al l is  conve r ting th e sol u tion of  probl em into  the org ani zat i on form  of chrom o some,  namely codin g   [16-19].     3.1. Encoding Mechanis m   Each ta sk in t he form of a " n  (l ) p" d e scri p tion, re sp ect i vely task  nu mber,  and th e si ze  of  the task, ta sk matching d egre e . The n u mbe r  of s h o t  data is use d  to descri b e  the size of the   task,  acco rdi ng to the typ e  of serve r  setups ta sk m a tchin g  de gre e ,  due to  proce s sing  ca p a city  Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 6, June 20 14:  4361 – 4 367   4364 different type  of task of  GPU  se rver  matchin g  d e g ree  varie s In the alg o rit h ms, e a ch g ene   rep r e s ent s a   task to b e   distributed;  a g r oup to  be  a s sign ed ta sks  that ma ke  up  a  ch romo so me,  each  ch romo some  rep r e s e n ts a   scheme .  So codin g   p r oble m  i s  th prima r y p r obl em o c currin in  the  u s e of  ge netic algo rith m.  The algo ri thm  u s es  the  de cimal  en coding,  su ch  a s  a  cl uste r of  N  serve r s,  in clu d ing GPU  S2 090 se rvers, GPU  S1 070  serve r a nd  GPU k1 0 servers. Du to the  different pro c essing capa city, di fferent serve r  types have differ ent service matchin g  deg ree,  servi c e  matching  deg ree  i s  d e scribed  b y  usin g p,  If  a  task n a me M, ea ch ta sk  informatio < n,  l, p  > info rmat ion  contai ns three  info rmati on, n fo r ta sk  numbe r, l fo task si ze,  and  p o n   behalf  o f   the task mat c hin g  de gre e .  Obviously,  n, l and  p el ement a r e d e c imal  numb e r, a ch rom o so me   encode d as  shown:      Figure 4. Chromosome En codi ng       3.2.  Fitness Function   Server' s   statu s  is th e impo rtant factors in fluenci ng the  load bal an cin g . First, a s su me the   total time for  each  s e rver  completes  task s as   s um T , its maximum as  ma x T , the minimu m v a lue a s   mi n T ,average a s   T , the minimum differen c e  of  s ,The sm aller of  s , means that the  task  allocation mo re bala n ced; Secon d ly, the load e rro rate refle c ts t he overall di stributio n of the  load of GPU serve r s, the  higher  utilization of GP U serve r ’s a n d  smalle r load  erro r rate, t he  better p e rfo r mance of th serve r , a  se rv er fitne s s fun c tion fo f ,set the  current  se rver’ s  loa d  fo i CL , new load for  i NL , server’ s  utilization rate of GPU for i GP , with mean  GP , there  are:      p l n l n 2 1 0 k q 0 j p i N N i i NL CL T                                ( 1 )       N T T N i i 0                                                      ( 2 )       min max T T s                                                       (3)      max T T GP i i                                                       ( 4 )       N GP GP N i i 0                                                 ( 5 )   The fitness fu nction of alg o r ithm as follo w:      i GP T s f ) GP - 1 ( ) 1 ( 2 i                      (6)   Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     Load Bala nci ng Algorithm  of  GPU Base d on Gen e tic  Algorithm  (Zh ang Xiang ya n g 4365 3.3.  Genetic Opera t ions   (1) Sele ct op eration. In order to ma ke the  individual s with large r  fitness deg ree  can be   dire ctly retain ed to the ne xt generation  of gr oup, se lect " determ i ne the type of samplin g to  cho o se" meth od, sp ecifi c   steps to  see lit eratu r e [3],se tting thre shol d, kee p  the  server  whi c h   i GP   is bigg er than  the threshold  direct ly to the next genera t ion of group s.  (2) T he cro s sover o p e r ati on. For con v eni ent of crossover o p e r ation and m u tation   operation, so  the above chrom o some s recom b ine,  combi ned int o  one dimen s ion a l encod ed  string. As  sho w n in figure 5  is one-dime n s ion a l co ding  gene s u s ed i n  the algorith m .          Figure 5. One - dime nsi onal  Codi ng Ge ne s of Ch romo somes      Select two p a rent individ u a ls from a p opulatio n, make cro s sover operatio n, and meet  that interse c tion ha s th e same g ene l o cation.  Ran d o mly exch an ge ge ne s whi c h a r on the  left  of the interse c tion a nd a r e  not the  sam e , after  that t o  get two ne w individ ual  chromo som e s.  Whe n  a  cro s sover op eration i s   compl e ted, the  ch an ge of  gen e lo cation  will  lea d  to the  chan ge   of task allo cat i on, so the  i p  value s  sh ould  cha nge  corre s po ndin g ly.  (3) M u tation.  Due to the  st ate of the se rv er i s  a re al -time chang e ,  so value s  o f   i p will   also  ch ang e. Whe n  a  se rver failure,  i p to 0; If the server  re place m ent value s   of  i p  is al so  cha ngin g . Accordingly, after the  com p l e tion of a m u tation, valu es of  i p  also  need to  be  modified.       4.Experimen t  and An aly s is   4.1. Test Cas e      Article ta ke an a c tual  rev e rse-time  mig r at ion ta sk a s  the exam ple;  equip m ent in clud es  24  serve r s of  S2090  GP U, 24  se rvers o f  GPU K1 0,  and  12  se rve r s of  S10 70 GPU,  op eration  para m eters a s  follo ws: Co ntrast  dia g ra m of the  ta sks total  time a s  follo ws, through  the  act ual   test re sult, we ca see th at the effect  of the  alg o rit h m obvio usly  is b e tter tha n  the oth e r t w o   kind s of algo rithms, esp e ci ally for the prese n ce  of server failure, th e load-bala n ce perfo rman ce  of algorithm  effect is bette r, and with th e increa se  of  Work L oad, the effect of the algo rithm  will   be more obvi ous.       Table 1. Para meter Li st of Reverse - time  Migration Ta sk  Area Km 2   300   Data amount  ( G b )   487  Sampling interval ms   FLOD  120  Trace length ms   6000   Bin size m   25x25   Shot number   29328   Continuation dep th  5000   Time continuation  0.4ms  Main frequenc y o f   wa v e l e t     F = 2 0       Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 6, June 20 14:  4361 – 4 367   4366 Figure 6 .  Co mparison Chart o f   Algorithm‘s  Ef fect in   T r o uble-Free Co ndition   Figure 7 .  Co mparison chart o f   Algorithm‘S  Ef fec t  with  O ne Ser v er Fa ilure  for 12  H ours       Figure 8. Co mpari s o n  Ch art of Algorith m ‘S  Effec t  with Two Servers  Failure for 12  Hours  Figure 9. Co mpari s o n  Ch art of Algorith m ‘S  Effec t  with One Server Failure for 24 Hours      4.2. Perform a nce Compa r ison   Relative to th e othe r two  a l gorithm s, ge netic al go rith m ba sed l o a d  bala n ci ng a l gorithm   of reverse - time migratio n can have bette r run n i ng effe ct, the algorit hm ca n gen e r ate re asona ble   distrib u tion schem e by se rver loa d  sta t e and t he type of serve r ; The pollin g algorithm j u st  assign ed  a fi xed nu mbe r   of task, a nd  can't  adj ust  according  to  the serve r   st atus,  so  that  it’s  effect of load balan cing i s  not as goo d a s  gen etic  alg o rithm; witho u t of load balanci ng algo rit h m,  sei s mic d a ta  is di stribute d  in  one -tim e, and  th e  al gorithm  com p letely do es  not con s ide r   the   serve r   state. Whe n   serve r  failure, th e g enetic al go rit h m ba se d al gorithm  can  have the  effect of  load-bala n ce, and   comp ared  with the  p o lling  algo rith m, it ha s b e tter  effect of  lo ad-b a lan c e,  a nd  as fo r the  alg o rithm  withou t load b a lan c i ng, on ce  a se rver failu re, al l the othe se rvers mu st  wait  until the serv er is no rmal.       5. Conclusio n   The alg o rith m fully con s i dere d  the typ e  of  se rver,  serve r  lo ad  state, and the  averag e   pro c e ssi ng  time of  ea ch   serve r , thi s   a l gorithm  can   distrib u te ta sks a c cording  to the  stat u s  of  different serv ers, m a ke full use of  the  se rvers, and av oid the influe nc of se rver  failure, so it h a a good a ppli c ation effect.      Referen ces   [1]  Z hang W e n x iu , Lian g Yi. T h e mathem atic al bas is of  g e netic al gor ithm . Xi ' an:  xi ' a n  jia o ton g     univ e rsit y  pres s.  2000.   [2]  Dai W e n h u a . Rese arch o n  text cl assific a ti on a nd s e rver ing  base d  o n   gen etic al gor ithm. Beiji ng :   scienc e press. 200 8.  [3]  Yang Pi ng, Z h eng Ji nh ua. Co mpariso n  of  ge netic sel e ctio oper ator an d stud y.  Co mp uter  engi ne erin g   and a p p licati o n . 2007; 43( 15): 59-6 2 [4] Z hu  Li Sh en Weiming Pa n  Shaom ing,  et al.  A Dyn a m i c  Loa d Ba lanc ing M e tho d  for  Spatia l D a t a   Netw ork Service.  T he 5th Internatio nal C o nferenc e on  W i reless Com m unic a tions. N e t w o r ki ng an d   Mobil e  Com put ing. Bei jin g. 20 09.   66 68 70 72 74 76 Tasks  total  time(hours) withou t   load  balanc i n g Pollin g   algori t h m Geneti c   algori t h m 0 20 40 60 80 100 Tasks  total  time(hours) withou t   load  balanc i n g Pollin g   algori t h m Geneti c   algori t h m 0 20 40 60 80 100 Tasks  total  time(hours) without  load  balancing Polling  algorithm Genetic  algorithm 0 20 40 60 80 100 120 Tasks  total  time(hours) without  load  balancing Polling  algorithm Genetic  algorithm Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     Load Bala nci ng Algorithm  of  GPU Base d on Gen e tic  Algorithm  (Zh ang Xiang ya n g 4367 [5]  Pico  CAG, Wain w r ight RL Dy namic  Scheduling of Computer  T a sks Using  Genetic A l gor ithms.  IEEE   W o rld Co ngres s Computati o n a l Intell ige n ce.  199 4; (2): 829- 833.   [6]  Z o ma ya AY, Y ee-H w e i  T .  Observatio ns o n   Using  Gen e tic  Algor ithms for  D y nam ic L o a d -Bal anci n g .   Parall el a nd Di stributed Syste m s.  20 01; 12( 9 ) 899-91 1.   [7]  GB Z heng. Achievi ng H i gh  Performance  on Ex trem el y Lar ge Par a l l el Mach in es: Performan c e   Predicti on a nd  Loa d Bal anci n g Urban a UIUC. 200 5   [8] JM  Bahi et al . D y n a mic lo a d  bal anc ing  a nd efficie n t lo ad estimators  for as y n c h ro nous iter ativ e   algorithms.  IEEE T Parall Distrib.  200 5; 16(4) 289-2 9 9   [9]  YIN W en, YIN Xi ng- ya o, Z H ANG F an-cha ng. A st ud o n  seism i c attri bute o p timiz a ti on b a se d o n   para lle l ge netic  algor ithm.  Jou r nal of Jil i n Un i v ersity (Earth Scienc e Editio n).  2005; 3 5 (5) :  672-67 6.  [10] Yu  Lei Li n Z ong-K a i Guo Yu-Ch a i Li n Shuo- Xun. Lo ad ba lanc in g and fau l t-toler ant services i n   multi-server s ystem.  Journal  of System Si mulati on . 20 01; 13(3): 32 5-3 2 8  (in Chi nese)   [11]  Li Shu a n g -Qin g, Gu Ping, C hen g Da i-Jie.  Anal ys is an d researc h  on l o a d  bal anc ing str a teg y  in W e b   server s y stem.  Journ a l of Co mputer Eng i n eeri ng an d App lica t ion . 200 2; (19) : 40-43 (in ch in ese)   [12] Liu  M i n W u   Che ng, Yi W enju n . Solvi ng i d e n tical  p a rall el m a chi n e pro ducti on l i ne sc he dul ing   prob lem  w i th  s peci a proc edu re co nstraint  b y   ge netic  al gor ithm.  Acta Automatica Sinica . 200 1; 2 7 (3) :   381- 386 (i n Ch ines e)   [13]  Liu Mi n, Hao J i ngh ua, W u  Ch eng. A g enetic  algor ithm for para lle l mach in e sche dul ing  p r obl ems  w i t h   proce dure c o n s traint and its a pplic atio ns.  Chi nese Jo urn a l o f  Electronics.  2 006; 15( 3): 463 -466.   [14]  Ramamrith am  KJ, Stankovic   A, Shia h PF . E ffici ent sch ed ul ing  al gorit hms  for rea l -time m u ltipr o cesso r   s y stems.  IEEE Trans on Parallel an d Distributed  System s . 1 990; 1(2): 1 84- 194.   [15]  Manimar an G, Murth y  CS R. An efficie n t d y namic  sch ed uli ng al gor ithm for multipr o ces s or real-ti m e   s y stems.  IEEE Trans on Parallel  and Distributed System s.  1998; 9(3): 3 12- 319.   [16]  Xu eso ng Ya n, W e ighted K- Near est Neig h bor Cl assificati on Alg o rithm  Based o n  Gen e tic Algor ithm .   T E LKOMNIKA Indon esi an Jou r nal of Electric al Eng i ne eri ng.  2013; 1 1 (10):  617 3-61 78.   [17]  Yanb ei  Li,  Lei  Yan,  Hu a Qi an. A Ga it R e c ogn ition  S y st em us ing  GA-base d  C-SV C  an d Pl anta r   Pressure.  T E L K OMNIKA Indones ian J ourn a l of Electrica l  Engi neer in g.  2013; 11( 10): 61 35-6 142.   [18]  YU Z h ij un. R B F  Neura l  N e t w orks O p timi zation A l g o rith m and A p p lic ation  on T a x F o recastin g.   T E LKOMNIKA Indon esi an Jou r nal of Electric al Eng i ne eri n g .  2013; 1 1 (7): 3 491- 349 7.   [19]  Jings ong Ya ng . A personifica tion he uristic  Genetic Alg o rit h m for Digit al Microflui d ics-b a sed  Bi ochi p s   Placem ent.  T E LKOMNIKA Indon esia n Jour nal  of Electric al  Engin eeri ng.  2 013; 11( 6): 318 7-31 93.      Evaluation Warning : The document was created with Spire.PDF for Python.