140 likes | 172 Views
MASAR: A Powerful Tool for Accelerator Commissioning and Operation. Yong HU , NSLS-II, BNL May 26, 2016 Original authors: Guobao Shen , Marty Kraimer. Outline. Introduction of MA chine S napshot, A rchiving, and R etrieve Why MASAR? What is it for and not for?
E N D
MASAR: A Powerful Tool for Accelerator Commissioning and Operation Yong HU, NSLS-II, BNL May 26, 2016 Original authors: GuobaoShen, Marty Kraimer
Outline • Introduction of MAchine Snapshot, Archiving, and Retrieve • Why MASAR? What is it for and not for? • MASAR Basis: architecture, terminology • Application at NSLS-II • Server & client • Usage statistics • Lessons learned • Future development
Why MASAR: what is it for and not for? • At NSLS-II, we need a tool to make tomorrow’s accelerator as good as today: The machine is running so stable. Let’s save a snapshot of all magnets settings, and use the snapshot to restore the machine if it is broken in future. • Why MASAR? MASAR v.s. OpenXAL/SCORE (or CSS/PV Table) • MASAR features: • It is EPICS V4service: among the first products of V4 • It is Python-based: Python is one of the best pets for programmers • It is easy to use: that’s why we focus on the UI design & improvements • It is powerful: one mouse click making today’s machine as good as yesterday • It is efficient: restoring a machine with thousands of PVs in a few seconds • It is flexible: thanks to MASAR client Python & Java APIs • It is maintainable: data are managed by SQLite (or MongoDB) database • MASAR is NOT for: • Replacing Channel Archiver: MASAR’s archiving is on-demand, not continuous or real-time, not on monitors/DBE_LOG (PV value change) • Replacing “bumpless reboot” synApps/autosave: the autosave is inside an IOC and local to that IOC; MASAR restores IOC settings outside the IOC through Channel Access, MASAR deals with global IOCs
MASAR Basis: architeture • Classic EPICS model: MASAR system = MASAR Server + MASAR Client https://github.com/epics-base/masarService
MASAR Basis: terminology • MAchine: could be sub-accelerator (i.e. Linac), or sub-system(i.e. Magnet) • Snapshot: MASAR is all about snapshot • From users’ point of view, two basic concepts : Config, snapshot • Config: pre-defined PV group(s) containing a list of PVs with other info (config name, ID, desc, …) for one specific configuration of a machine • Snapshot: data (value, timestamp, alarm, …) of the pre-defined PVs (EPICS V3) in a Config • Archiving:saving a machine snapshot to database • Retrieve: get archived snapshot(s) from database (and restore a machine)
MASAR at NSLS-II: server • MASAR server: a daemon (softioc) wrapped in procServ • Config tool: EPICS (V3) PV orientated, PV group, simple GUI
MASAR at NSLS-II: client • MASAR Client: 7 APIs in Python; Focus on PyQt UI improvement • 3 tables: config table, snapshot/event table, snapshot data table • A few action buttons: Restore Machine, Compare Live Machine, Save Machine… the first PyQt-based UI latest PyQt-based UI
MASAR at NSLS-II: usage statistics(1) • Has been used since the first day (3/27/2012) of accelerator commissioning • Configuration increases with time: biggest increase during the busiest period of Storage Ring commissioning
MASAR at NSLS-II: usage statistics(2) • Snapshots taken with time: again, biggest increase during the busiest period of Storage Ring commissioning
MASAR at NSLS-II: interfacing to other tools • At the moment, only interfacing to one tool: logbook (O-log): • if anyone did a machine restore, a log entry is automatically generated and the action is logged • anyone is free to view snapshots, but be careful of machine restore -- you may break the machine
MASAR at NSLS-II: lessons learned • Design each configuration carefully (think before you act): • Collect requirement from user: physicist/operator • Ask sub-system control experts to review it before creating a configuration • Separate operator configuration from subsystem expert configuration : • Not all pvs need to be restored • Obvious, but not everyone is aware of it • Check snapshot before restoring • MASAR is aiming to snapshot the data: • Check the timestamp of both event and pvs when using the data • Timestamp of event is when the snapshot was taken while timestamp of pv is when the pv was processed
Future Plan • Improving waveform data plot • Waveform data are always challenging and they are everywhere • Support flexible plotting: user can choose different waveform PVs, or same PV with different snapshot data in one plot or multiple subplots • ChannelFinder integration for MASAR configuration • More tests and improvements on CSS MASAR client • Migration from SQLite to mongoDB • PyQt UI continuous improvement Thank you for your attention!