discovering exis7ng systems t rex
play

Discovering Exis7ng Systems: T-Rex G. Cugola E. - PowerPoint PPT Presentation

Stream and Complex Event Processing Discovering Exis7ng Systems: T-Rex G. Cugola E. Della Valle A. Margara Politecnico


  1. Stream ¡and ¡Complex ¡Event ¡Processing ¡ Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ G. ¡Cugola ¡ ¡ ¡ ¡E. ¡Della ¡Valle ¡ ¡ ¡ ¡A. ¡Margara ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Politecnico ¡di ¡Milano ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Vrije ¡Universiteit ¡Amsterdam ¡ cugola@elet.polimi.it a.margara@vu.nl dellavalle@elet.polimi.it

  2. T-­‑Rex: ¡an ¡Engine ¡for ¡TESLA ¡ ¡ Define ¡ ¡CE(AI 1 ¡: ¡Type 1 , ¡…, ¡AI n ¡: ¡Type n ) ¡ From ¡ ¡ ¡PaIern ¡ Where ¡ ¡AI 1 ¡= ¡f 1 (..), ¡…, ¡AI n ¡= ¡f n (..) ¡ Consuming ¡e 1 , ¡…, ¡e m ¡ ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 2 ¡

  3. The ¡Ingredients: ¡Selec7on ¡… ¡ • Selec7on ¡of ¡a ¡single ¡ event ¡ CE ¡ • A(x>10) A ¡ (X=15) ¡ B ¡ B ¡ • Timer() 3 ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡

  4. The ¡Ingredients: ¡… ¡Sequences ¡… ¡ • Selec7on ¡of ¡sequences ¡ 5 ¡min ¡ CE ¡ • A(x>10) and each CE ¡ B within 5 min from A B ¡ B ¡ A ¡(X=15) ¡ • A(x>10) and last B within 5 min CE ¡ from A • A(x>10) and first A ¡(X=15) ¡ ¡ B B ¡ B within 5 min from A CE ¡ • Generaliza7on ¡ • n-­‑first ¡/ ¡n-­‑last ¡ B ¡ B ¡ A ¡(X=15) ¡ 4 ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡

  5. The ¡Ingredients: ¡… ¡Sequences ¡… ¡ • TESLA ¡allows ¡*-­‑within ¡operators ¡to ¡be ¡ composed ¡with ¡each ¡other: ¡ • In ¡chains ¡of ¡events ¡ • A and each B within 3 min from A and last C ¡ C ¡ B ¡ A within 2 min from B • In ¡parallel ¡ • A and each B within 3 min from A C ¡ B ¡ A ¡ and last C within 4 min from A ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 5 ¡

  6. The ¡Ingredients: ¡… ¡Parameters ¡… ¡ • Parameters ¡can ¡be ¡added ¡between ¡events ¡in ¡a ¡ paIern ¡ • A(a=$x) and each B(a=$x) within 3 min from A and last C(a=$x) within 4 min from A ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 6 ¡

  7. SELECTION ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 7 ¡

  8. Selec7on ¡ • Generic ¡problem ¡of ¡ matching ¡ events ¡against ¡ constraints ¡on ¡their ¡content ¡ • Used ¡twice ¡in ¡CEP ¡ • To ¡select ¡the ¡set ¡of ¡rules ¡a ¡primi7ve ¡event ¡is ¡ relevant ¡for ¡ • To ¡select ¡the ¡set ¡of ¡sinks ¡a ¡(composite) ¡event ¡ needs ¡to ¡be ¡delivered ¡to ¡ • Classical ¡Publish ¡/ ¡Subscribe ¡Content-­‑Based ¡Matching ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 8 ¡

  9. Content-­‑Based ¡Matching ¡ Content-­‑Based ¡Matching ¡ Events ¡ Sinks ¡ ¡ Predicate ¡ Filter ¡ (Smoke=true and Room = “Kitchen”) or Light=50, A;ribute ¡ (Light>30 and Room=“Bedroom”) Room=Bedroom, Sender=“Sensor1” Constraint ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 9 ¡

  10. Related ¡Work ¡ • Two ¡kinds ¡of ¡algorithms ¡ • Tree-­‑Based ¡ • Coun7ng ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 10 ¡

  11. Tree-­‑Based ¡Algorithms ¡ • Build ¡a ¡decision ¡tree ¡ A>0 ¡ • Inner ¡nodes: ¡condi7onal ¡ statements ¡ Yes ¡ No ¡ • Leaves: ¡sinks ¡ B≤2 B>8 ¡ 4 ¡ Yes ¡ Yes ¡ S1, ¡S3 ¡ C>2 ¡ Yes ¡ S1, ¡S2, ¡S4 ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 11 ¡

  12. Coun7ng ¡Algorithms ¡ • For ¡each ¡filter ¡… ¡ • … ¡count ¡how ¡many ¡constraints ¡have ¡been ¡ sa7sfied ¡so ¡far ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 12 ¡

  13. Coun7ng ¡Algorithms ¡ F1: A>10 and B=20 S1 ¡ A=12 F2: B>15 and C<30 B=20 A=12 B=20 S2 ¡ F3: D=20 Constraint ¡ Filter ¡ Filter ¡ Size ¡ Count ¡ Predicate ¡ A>10 ¡ F1 ¡ F1 ¡ 2 ¡ 1 ¡ S1 ¡ 0 ¡ 2 ¡ F2 ¡ 2 ¡ S1 ¡ B=20 ¡ F1 ¡ 0 ¡ 1 ¡ F3 ¡ 1 ¡ S2 ¡ B>15 ¡ F2 ¡ 0 ¡ C<30 ¡ F2 ¡ D=20 ¡ F3 ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 13 ¡

  14. Idea: ¡Exploit ¡Parallel ¡Hardware ¡ • PCM: ¡Parallel ¡Content-­‑Based ¡Matching ¡ • Both ¡mul7 ¡core ¡CPUs ¡… ¡ • OCM ¡– ¡OpenMP ¡ • … ¡and ¡Nvidia, ¡CUDA ¡GPUs ¡ • CCM ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 14 ¡

  15. Programming ¡GPUs: ¡CUDA ¡ • General ¡purpose ¡parallel ¡compu7ng ¡ architecture ¡by ¡Nvidia ¡ • New ¡instruc7on ¡set ¡ • New ¡programming ¡model ¡ • Programmable ¡using ¡high-­‑level ¡languages ¡ • Cuda ¡C ¡(a ¡C ¡dialect) ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 15 ¡

  16. Programming ¡Model: ¡Basics ¡ • The ¡GPU ¡acts ¡as ¡a ¡coprocessor ¡with ¡its ¡own ¡ separate ¡memory ¡space ¡ • Copy ¡data ¡to/from ¡the ¡GPU ¡memory ¡is ¡ expensive ¡ • Communica7on ¡through ¡the ¡PCI-­‑Ex ¡bus ¡ • Bandwidth ¡but ¡also ¡latency! ¡ • Serializa7on ¡of ¡data ¡structures ¡ • Keep ¡them ¡simple! ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 16 ¡

  17. Typical ¡Workflow ¡ Allocate memory on device Serialize and copy data to device Execute one or more kernels on the device Wait for the device to finish processing Copy results back Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 17 ¡

  18. Programming ¡Model: ¡Fundamentals ¡ • Single ¡Program ¡Mul>ple ¡Threads ¡ strategy ¡ • A ¡single ¡ kernel ¡is ¡executed ¡by ¡mul7ple ¡ threads ¡in ¡parallel ¡ • Threads ¡are ¡organized ¡in ¡ blocks ¡ • The ¡run7me ¡provides ¡a ¡ blockId ¡ and ¡a ¡ threadId ¡variable, ¡to ¡uniquely ¡iden7fy ¡ each ¡running ¡thread ¡ • Accessing ¡such ¡variables ¡is ¡the ¡only ¡way ¡ to ¡differen7ate ¡the ¡work ¡done ¡by ¡ different ¡threads ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 18 ¡

  19. Hardware ¡MaIers! ¡ • Lots ¡(lots!) ¡of ¡cores ¡… ¡ • … ¡but ¡specialized ¡for ¡data ¡parallelism ¡ • Threads ¡organized ¡into ¡groups, ¡called ¡warps ¡ • Maximum ¡performance ¡only ¡if ¡all ¡threads ¡in ¡a ¡ warp ¡agree ¡on ¡the ¡execu7on ¡path ¡ • Condi7onal ¡statement ¡can ¡create ¡divergence! ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 19 ¡

  20. Hardware ¡MaIers! ¡ • Lots ¡(lots!) ¡of ¡cores ¡… ¡ • … ¡limited ¡space ¡for ¡cache ¡ L ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 20 ¡

  21. Hardware ¡MaIers! ¡ • Lots ¡(lots!) ¡of ¡cores ¡… ¡ • … ¡limited ¡space ¡for ¡cache ¡ L ¡ • In ¡some ¡architecture ¡caching ¡is ¡controlled ¡by ¡the ¡ programmer ¡ • Hierarchies ¡of ¡memories ¡ • Global ¡(DRAM, ¡GB) ¡ à ¡Shared ¡(SRAM, ¡block ¡level, ¡KB) ¡ à ¡ Local ¡(Registers) ¡ • Access ¡to ¡GPU ¡memory ¡oren ¡a ¡boIleneck ¡ • Threads ¡with ¡con7guous ¡ids ¡should ¡access ¡con7guous ¡ memory ¡regions ¡ • Hardware ¡combines ¡them ¡into ¡memory-­‑wide ¡accesses ¡ Stream ¡& ¡Complex ¡Event ¡Processing ¡-­‑ ¡Discovering ¡Exis7ng ¡Systems: ¡T-­‑Rex ¡ 21 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend