1 / 50

input

input. output. MAC *. (*) monitoring and control. Herding FPGAs. or: distributed monitor and control. harro verkouter. Joint Institute for VLBI in Europe. 16x 10 Gbps ethernet. 16x 10 Gbps ethernet. input. output. MAC *. UDP/IPv4. file server. file server. file server. output.

pali
Download Presentation

input

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. input output MAC* (*) monitoring and control

  2. Herding FPGAs or: distributed monitor and control harroverkouter Joint Institute for VLBI in Europe

  3. 16x 10 Gbps ethernet 16x 10 Gbps ethernet

  4. input output MAC*

  5. UDP/IPv4 file server file server file server output MAC*

  6. UDP/IPv4 UDP/IPv4 file server file server file server capture MAC*

  7. UDP/IPv4 UDP/IPv4 file server file server file server capture UDP/IPv4 unb_control

  8. UDP/IPv4 UDP/IPv4 file server file server file server capture UDP/IPv4 unb_control correlator_control

  9. UDP/IPv4 UDP/IPv4 file server file server file server capture UDP/IPv4 unb_control correlator_control

  10. UDP/IPv4 UDP/IPv4 Mark5ABC file server capture capture ...... ≤ 32 ≤ 4/Board ... UDP/IPv4 unb_control correlator_control

  11. correlator_control • distributed ⇒ much communication • multiple UniBoards • up to 32 input data servers • multiple capture nodes • heterogeneous

  12. Which language/system? • MarkIV correlator control s/w • archaic C++ (predates STL!) • home grown message passing • id. for distributed processing • Other C/C++ implementations • MPI library • Boost library • LOFAR control s/w • ...

  13. Which language/system? • JAVA • XMLRPC or RMI for remote execution • no distributed multiprocessing • Python • multiprocessing module (threads, not machines) • message passing module

  14. Write the control system from scratch in another language!

  15. http://www.erlang.org • functional programming language • high level • compiles to byte code (cf. Python, JAVA) • developed by Ericsson AB since 1987 • designed for monitoring/control • designed for concurrency • designed to build distributed systems • open sourced in 1998

  16. Functional goodies • immutable data • functions can return functions • functions can take functions as arguments • pattern matching + guard expressions • no for() or while() loops • less Lines Of Code • you have to think about your code

  17. Functional goodies • immutable data • functions can return functions • functions can take functions as arguments • pattern matching + guard expressions • no for() or while() loops • less Lines Of Code • you have to think about your code code explodes!

  18. Functional goodies • immutable data • functions can return functions • functions can take functions as arguments • pattern matching + guard expressions • no for() or while() loops • less Lines Of Code • you have to think about your code head explodes!

  19. Pid = spawn(‘node@host’, Function, [Arg1, Arg2, ...]) • built-in execute function on remote node! • creates a new, concurrent, Erlang process • “almost, but not quite, ...” (no unix process) • lightweight – 106 processes/node easily • returned process identifier “Pid” is built-in type • encodes which process running where

  20. Pid!Message, receive Message -> do_something() end • communication exclusively via messages • syntax elements: • operator! for sending • keywordreceive accepts incoming messages

  21. V = 42 LE = <<V:32-unsigned-little>> BE = <<V:9-unsigned-big>> • binaries are a built-in type • arbitrary sizes of bit fields • syntax elements: • keywords<< and >> for creation • keyword: for specification of field width &cet.

  22. {_,Code,_} = code:get_object_code(Module) rpc:call(‘node@host’, code, load_binary, [Code]) executescode:load_binary(Code) remotely, transfers the Code blob via the network

  23. host A init() job0() job1() host Y host X writerN() reader0_job0() readerZ() writer1_job1() host Z process23() process42()

  24. host A init() job0() job1() host Y host X writerN() reader0_job0() readerZ() writer1_job1() host Z process23() process42()

  25. worker supervisor

  26. {error, Reason} {error, Reason} {error, Reason} {error, Reason} worker supervisor

  27. ccs.jive.nl fileserv0.jive.nl unb_ctl.jive.nl capture.jive.nl

  28. ccs.jive.nl UNB = spawn(‘unb_ctl.jive.nl’, unb_control, [...]) unb_control setup_board() -> fpga:read(version), fpga:write(Config).

  29. ccs.jive.nl UNB = spawn(‘unb_ctl.jive.nl’, unb_control, [...]) CAP = spawn(‘capture.jive.nl’, capturer, [...]) unb_control capturer receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl

  30. ccs.jive.nl UNB = spawn(‘unb_ctl.jive.nl’, unb_control, [...]) CAP = spawn(‘capture.jive.nl’, capturer, [...]) SEND = spawn(‘fileserv0.jive.nl’, sender, [...]) unb_control sender capturer spawn(file_reader,..) receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl

  31. ccs.jive.nl UNB = spawn(‘unb_ctl.jive.nl’, unb_control, [...]) CAP = spawn(‘capture.jive.nl’, capturer, [...]) SEND = spawn(‘fileserv0.jive.nl’, sender, [...]) unb_control sender capturer spawn(file_reader,..) receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl file_reader FD = open_file(Infile)

  32. ccs.jive.nl UNB = spawn(‘unb_ctl.jive.nl’, unb_control, [...]) CAP = spawn(‘capture.jive.nl’, capturer, [...]) SEND = spawn(‘fileserv0.jive.nl’, sender, [...]) unb_control sender capturer receive {do,UTSecond} -> ...; end receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl file_reader receive {do,UTSecond} -> Frame = file:read(FD), udp:write(Frame) end

  33. ccs.jive.nl CAP ! {start, OutfileName} unb_control sender capturer receive {do,UTSecond} -> ...; end receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl file_reader do_capture receive {do,UTSecond} -> Frame = file:read(FD), udp:write(Frame) end FD = file:open(Out)

  34. ccs.jive.nl unb_control sender capturer receive {do,UTSecond} -> ...; end receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl file_reader do_capture receive {do,UTSecond} -> Frame = file:read(FD), udp:write(Frame) end receive {udp,Data} -> file:write(FD,Data) end

  35. ccs.jive.nl case UNB ! fifo_level of ... unb_control sender capturer receive {do,UTSecond} -> ...; end receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl file_reader do_capture receive {do,UTSecond} -> Frame = file:read(FD), udp:write(Frame) end receive {udp,Data} -> file:write(FD,Data) end

  36. ccs.jive.nl case UNB ! fifo_level of empty-> SND ! {do, 1426550400}; unb_control sender capturer receive {do,UTSecond} -> ...; end receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl file_reader do_capture receive {do,UTSecond} -> Frame = file:read(FD), udp:write(Frame) end receive {udp,Data} -> file:write(FD,Data) end

  37. ccs.jive.nl case UNB ! fifo_level of empty-> SND ! {do, 1426550400}, UNB ! {do, 1426550400} unb_control sender capturer receive {do,UTSecond} -> ...; end receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl file_reader do_capture receive {do,UTSecond} -> Frame = file:read(FD), udp:write(Frame) end receive {udp,Data} -> file:write(FD,Data) end

  38. Works like a charm! file_sender and do_capture pure Erlang • trivial to implement  • too slow  Erlang can interact with external (UNIX) processes • implement file_sender/do_capture in C

  39. ccs.jive.nl case UNB ! fifo_level of empty-> SND ! {do, 1426550400}; unb_control sender capturer receive {do,UTSecond} -> ...; end receive {start,F} ->; stop -> ...; end receive fifo_level -> ...; {do,UTSecond} -> ...; end fileserv0.jive.nl cpp_sender cpp_capture fd = open(“..”, O_RDONLY) while( true ) { if( new_second ) { read(fd, buf, frame_sz); write(sok, buf, frame_sz); } fd = open(“.”, O_WRONLY) while( true ) { read(sok, buf, N); write(fd, buf, N); }

  40. Everything you read on the internet about Erlang is true ...

More Related