mechanics of sticky events -...

18
Mechanics of sticky events Håkan Johansson, Chalmers, Göteborg LNGS/GSSI, Gran Sasso, May, 2017 Trace compression  page 14 with Giovanni Bruni:

Upload: others

Post on 06-Mar-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Mechanics of

sticky events

Håkan Johansson,

Chalmers, Göteborg

LNGS/GSSI,Gran Sasso, May, 2017

Tracecompression

 page 14→

with Giovanni Bruni:

Page 2: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

r3­14

r3­15

r3­30r3­52

r4­12

r4­11

r4­35r4­10

r4­43

x86­63

x86­36

r4­46

x86g­10x86g­71

München

Coimbra

r4­28

S406 systems

Experience with setups that:

● Have many channels.● Have many kinds of systems.● Take data for ~1 week.● Like high event rates. :-)

Page 3: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Introduction

● Store slow-control information (HV settings,magnet currents...) in the data stream– Integrate with a distributed DAQ (NuSTAR).

– Follow the DAQ topology.

● 'Normal' events not suitable:– Just flow through the DAQ / analysis.

– Late connected clients / files would not getearlier set values.

● New concept: sticky events.– Delivered however late the connection is.

Page 4: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Sticky subevents

● Packaged in sticky events.● The sticky thing is the subevents.

– Sticky = held active until replaced.

● Sticky subevents identified (as usual) by– type/subtype/ctrl/crate/procid

● Removed as active with length = ­1.

Page 5: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Sticky events: simple semantics

● Sticky subevents are valid until replaced● … or revoked (replace by nothing)

a aba cb

a a a a b ba ba c

Sticky state(is logically defined before each normal event)

Sticky (sub)events (same colour = same id, letter is 'content')

Normal events(Revoke)

Page 6: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Guaranteed delivery

● An receiver (either file or network client) will before each normal event have received exactly the (at that point) active set of sticky subevents.

Sticky subevents may be delivered:● Multiple times.● In any order.

abb ab ab a

=

=a b

=a b b

Page 7: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

DAQ / proxy servers

● Absorb the complications in standard programs.● Keeps analysis clients simple.

Not so much a design choice,rather a lucky side-effect.

Page 8: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Output stages keep track

aa a ab a

aa a

a b c

a b aba a a

a cabba

ab ca

Replay

Replay

Replay

Revoke

New files

Page 9: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Output stages keep track (network)

aa a ab a

aa a

a b c

b ab

a cabba

Replay

a c

Loss due to slow client

Replay

New client

Page 10: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Merging / time sorting

aa a ab aa b c

a aba c

a a ab

+

Page 11: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Merging – loss of source

aa a ab aa b c

a aba c

a a ab

+

Revoke active sticky subeventsthat lost their source

ab ab ab

ab ab

Usual insert(no special handling)

Replay bysource

Page 12: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Complicated?

Page 13: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Complicated? (comparing compressed)

Page 14: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Tracecompressionwith Giovanni Bruni Work-in-progress!!!

● FPGA-friendly● Reduce:

● bandwidth● storage

Example (1100 traces):● raw: 12 bits● this: 3.8 bits/sample

(From 16-bit storage:)● .gz: 5.4 bits/sample● .xz: 3.8 bits/sample

Page 15: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Strategy

Centre values to

store around 0

Length proportional to # significant bits(~ 2x, due to length-encoding prefix)(inspired by Huffman code)

Input value

Subtract previous

Encode(mask bits)

Bitshift,accumulate bitsin output word

Store bitpacked

For each sample:

Page 16: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

● VHDL● 1 sample/clock cycle

(@100 MHz easily)● Tested in testbench,

data compared to C implementation.● 550 LUTs on virtex4 (compiled, not tested)

– Dominated by large barrel shifter.

– (Could be smaller (~1/3), but with ~10-30 cycles/sample.)

FPGA codeentity logcode_compress is  generic(bits   : integer);  port (clk      : in  std_logic;

        reset    : in  std_logic;

        input    : in  std_logic_vector(bits­1 downto 0);        in_word  : in  std_logic;        get_last : in  std_logic;

        output   : out std_logic_vector(31 downto 0);        out_word : out std_logic        );end logcode_compress;

Page 17: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Some results

● Drawback: current version requires noise-level adaption● Working on new encoding scheme:

without drawback - slightly less efficient, even simpler (de)coding

Page 18: Mechanics of sticky events - Chalmersfy.chalmers.se/~f96hajo/shows/htj_may2017_sticky_traces.pdfIntroduction Store slow-control information (HV settings, magnet currents...) in the

Fine!

Thank you!

Lots of FUN !

Live by the compiler timing messages!

http://fy.chalmers.se/~f96hajo/shows/