Complications and Troubleshooting

Slides:



Advertisements
Similar presentations
ECE122 L4: Creating Objects February 8, 2007 ECE 122 Engineering Problem Solving with Java Lecture 4 Creating and Using Objects.
Advertisements

Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Friday, July 07, 2006 “Vision without action is a daydream, Action without a vision is a nightmare.” - Japanese Proverb.
Introduction to Python
C++ fundamentals.
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to Classes and Objects Outline Introduction Classes, Objects, Member Functions and Data.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Built-in Data Structures in Python An Introduction.
Chapter 5 Linked List by Before you learn Linked List 3 rd level of Data Structures Intermediate Level of Understanding for C++ Please.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
The Electromagnetic Spectrum High Harmonic Generation
Mathematical Derivation of Probability
Jonathan Donkers1, Lin Zhang1+
Madhu Karra1, Jason Koglin1,2
Development Environment
Project Management: Messages
Sentiment Analysis and Data visualization Techniques of Experiments
Memory Management.
Non Contiguous Memory Allocation
Characterizing Optics with White-Light Interferometry
Matter in Extreme Conditions at LCLS:
MICROPROCESSOR BASED SYSTEM DESIGN
Kevin Shimbo1, Matt Hayes+
CHP - 9 File Structures.
Crystallography images
Hutch 4 (XCS) Laser System
Topics Introduction Hardware and Software How Computers Store Data
Chapter 6 - Database Implementation and Use
Anomaly Detection LCLS data: Introduction Research Conclusion
A remote EPICS monitoring tool
EASE: Alert Management
Managing Diffraction Beam
Integration of Blu-Ice into
Effects of Wrapping Vacuum
Scintillation Material Encapsulation Fixture
LCLS CXI Sample Chambers and Engineering Solutions
Values to Normalize Data
LAMP Vacuum System Documentation
About the Presentations
Your Name, Elias Catalano, Robert Sublett, Robin Curtis
Determining a Detector’s Saturation Threshold
HXRSD Helium Enclosure
Crystallography Labeling Using Machine Learning
Functions CIS 40 – Introduction to Programming in Python
IT Inventory and Optimization
Margaret Koulikova1, William Colocho+
Analytical Solutions for Heat Distribution in KB Mirror Systems
Optimizing Malloc and Free
O.S Lecture 13 Virtual Memory.
Analytical Solutions for Temperature
Barron Montgomery1,2, Christopher O’Grady2, Chuck Yoon2, Mark Hunter2+
Elizabeth Van Campen, Barrack Obama2, Stephen Curry1,2, Steve Kerr2+
Advanced Methods of Klystron Phasing
Ryan Dudschus, Alex Wallace, Zachary Lentz
Jennifer Hoover1, William Colocho2
Topics Introduction Hardware and Software How Computers Store Data
Redesigning of The SED Calendars
Automatic compression control for the LCLS injector laser
BIC 10503: COMPUTER ARCHITECTURE
Classes and Objects.
Russell Edmonds1, Matt Hayes2+ 1LCLS Summer Research Intern
Introduction C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell.
Title of Your Poster Introduction Research Conclusions Acknowledgments
Reconstruction algorithms Challenges & Future work
Topics Introduction to Functions Defining and Calling a Void Function
Introduction to Data Structure
Defining Classes and Methods
Lecture 13 Teamwork Bryan Burlingame 1 May 2019.
Presentation transcript:

Complications and Troubleshooting LCLS2 Data Formatting Hayden Blair1, Clemens Weninger2, Paul Christopher O’Grady2,+ 1LCLS Intern 2Linac Coherent Light Source, SLAC National Accelerator Laboratory, 2575 Sand Hill Road, Menlo Park, CA 94025, USA. +Contact: cpo@slac.stanford.edu 1 Complications and Troubleshooting Introduction The Python Conversion: In order to make the Datagram’s structure intuitive and easy to navigate, I created two new python objects to store its information. Each individual sensor output in the Datagram is known as an Xtc. The first python object I created acts as an information retriever for a single sensor segment, so I also called it “Xtc”. This Xtc object stores the memory locations and names of the output data for its specified detector. These names and pointers are created using the information contained in the Datagram’s Descriptor. This is depicted in Figure 3. The Xtc’s data names can be accessed by implementing its “keys()” function. It also calls a unique constructor when the user tries to access an array from the Datagram; allocating large chunks of memory takes a non-negligible amount of time, so once a sizable array is stored at a certain location, for performance’s sake, it should not move. When a user calls an array for retrieval, the Xtc python object identifies its memory positions, and returns a Numpy array whose entries point back to those positions. This way, the previously allocated data will not be duplicated. The LCLS currently shoots 120 photon packets every second. The LCLS-II will be 8,000 times faster, shooting up to a million pulses per second. Each pulse produces a large memory block filled with data, called a Datagram. Each Datagram must be parsed, analyzed, and then stored. All of this must happen in under one millionth of a second. I have written optimized C code that will accept the Datagram, build a unique Python type object for it, and then distribute its components into that object. This object will then be used in further analytical processes, which will be carried out in Python. Keywords: Pulse, Datagram, Analysis One of the first challenges we faced was figuring out how long to store the data from the laser in memory. Each new pulse produced a new Datagram from the sensors, but analysis requires comparing data across multiple shots. We couldn’t simply store every single Datagram, because of memory access restrictions. Solving this issue required the use of a Python tool known as “reference counting”. When a Datagram is first created, it has a reference count of 1. In order to access the correct information from an array in that Dgram, the memory that contains that array must not be altered. When a user accesses an array, the reference count of the Dgram is increased, and is subsequently decreased when that array is no longer in use. The Datagram’s memory is then deallocated when its reference count reaches 0. The biggest issue this program currently faces is data inflation. The output of a single pixel from the sensor array is 16 bits long. The first 2 bits describe the gain the pixel was set at during bombardment, and the last 14 hold its received information. In order to access the data as quickly as possible, the gain needs to be stored separately. However, the smallest, store-able unit is 8 bits, meaning the original 16 bits must become 24. This is a 50% data increase the LCLS-II cannot afford. Research Fig 1: Beam Visual Fig 3: Conversion Flow Chart Datagram {(descriptor:DescA;DescB) [data: DataA,DataB]}, {(descriptor:DescC;DescD) [data: DataC,DataD]} to This is a depiction of how the LCLS procures data. The beam will hit its target at the Interaction Point, and then the result will be captured by the sensor array placed behind it. The depicted CSPAD is one of many detectors whose outputs must be accounted for during data parsing. *Image courtesy of LCLS-II homepage webmaster Python 1 Dgram: Xtc1: DataA DataB Xtc2: DataC DataD 3 2 1:Use Dgram segment to create Xtc object 2:Use DescA to find name and memory location of DataA 3: DataA in Xtc points to original DataA memory address in Dgram Conclusions The goal of this project was to properly deliver the beam information to the data analysis routines. These routines will be executed in Python, because their implementation is much easier than it would be in C. However, Python is inefficient with memory management and cannot parse a million datagrams per second. This part of the process needs to be handled by C. The Datagram: Every datagram is segmented, with each segment representing the output of one sensor in the array. The leading bytes of each segment describe the names, data types, and positions in memory of all the output data from that sensor. Figure 2 is a visualization of this structure. My work has helped lay foundations for future data handling at the LCLS-II. The Python extensions I have written will need to be updated and changed as the LCLS-II develops, but the fundamental data structure and reference counted memory management are solid. The data inflation issue is a good example of the unforeseen complications that will keep popping up as development continues. These complications can necessitate moderate or even dramatic change in the software, and future efforts in LCLS-II data formatting must be able to keep up with the changing needs of this project. The second python object is meant as an ease of access tool and allows the user to quickly maneuver all of the information in the Datagram. Since it holds every piece of information we want to be able to use, I called the object “Dgram”. It contains a dictionary that can be accessed using the tab complete routine in IPython. Each value in the dictionary is an Xtc python object, with the corresponding key being the name of the sensor assigned to that Xtc. When a user presses “Tab” on a Dgram object instance in IPython, a list of every sensor contained in that Dgram is printed to the screen. The user can then cycle through all of sensors by repeatedly pressing “Tab”. This utility combined with the “keys()” method contained in the Xtc python object creates an efficient data management routine. The user can create a Dgram instance, tab complete to the desired sensor, print a list of its components, and then use the Xtc object’s predefined, custom retrieval functions to access their desired data member. Fig 2: Datagram {(descriptor: “sensor temp”, float, offset=0; ”position”, int[2], offset=4) [data: 53.9514;[2,5]]}, {(descriptor: “incident angle”, float, offset=12) [data: 33.26]}, {(descriptor: …) [data: …]}, {(descriptor: …) [data: …]}, … Acknowledgments The successes of this project are due in large part to the efforts of the faculty that guided me. I am very grateful to Chris O’Grady and Clemens Weninger for all of the clear, deeply beneficial advice they provided, and thank them both for the opportunity to be a part of this effort. Each entry in “data” can be either a single value, or an array, of any fundamental data type (integer, float, double). The “offset” indicates the size (in bytes) of all the “data” entries before the one currently being described. No matter where in memory the Datagram is saved, we can find the location of any “data” member by adding its offset to the Datagram’s starting memory address. Date: 08/07/2017