Argonne National Laboratory is managed by The University of Chicago for the U.S. Department of Energy ICALEPCS 2005: EPICS Workshop EPICS V4 : Runtime.

Slides:



Advertisements
Similar presentations
1 1999/Ph 514: Channel Access Concepts EPICS Channel Access Concepts Bob Dalesio LANL.
Advertisements

EPICS Base R and beyond Andrew Johnson Computer Scientist, AES Controls Group.
CS252: Systems Programming Ninghui Li Program Interview Questions.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Written by: Dr. JJ Shepherd
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree.
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
PvData,pvAccess,javaIOC,pvService Status EPICS Meeting Aix-en-Provence, France Marty Kraimer, Guobao Shen, and Matej Sekoranja.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Processes CSCI 444/544 Operating Systems Fall 2008.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
Connecting AreaDetector to GDA John Hammonds Software Services Group Advanced Photon Source The submitted manuscript has been created by UChicago Argonne,
V4 – Executive Summary 1.Provide online add/delete of I/O to support continuous operation. 2.Provide redundant control of remote I/O to support improved.
In conclusion our tool: can be used with any operator overloading AD package replaces the manual process, which is slow and overestimates the number active.
Fundamentals of Python: From First Programs Through Data Structures
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
Virtual Memory.
ORNL is managed by UT-Battelle for the US Department of Energy EPICS State Notation Language (SNL), “Sequencer” Kay Kasemir, SNS/ORNL Many slides from.
JavaIOC Marty Kraimer EPICS Collaboration Meeting ICALEPCS October
Lecture 22 Miscellaneous Topics 4 + Memory Allocation.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
(a) Alice and Bob are back together. Today Alice wants to send Bob a message that is secret and also authenticated, so that Bob "knows" the message came.
Experience with Processes and Monitors in Mesa
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
EPICS devSNMP Extensions Euan Troup, CSIRO Australia Telescope National Facility ASKAP Project Paul Wild Observatory.
The Java Programming Language
JavaIOC EPICS Meeting SSRF March Presented by: Marty Kraimer.
Consider the short (and useless) C program off to the right. Each of the variables {a, b, c} references an integer value that occupies some memory at runtime.
1 1999/Ph 514: Record Support EPICS Record Support Marty Kraimer APS.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
Pointers OVERVIEW.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Page: 1 การโปรแกรมเชิงวัตถุด้วยภาษา JAVA บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 15 มิถุนายน 2552 Keyword & Data Type มหาวิทยาลัยเนชั่น.
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
Stacks and Queues. 2 3 Runtime Efficiency efficiency: measure of computing resources used by code. can be relative to speed (time), memory (space), etc.
Writing a Channel Access Client in EPICS Bob Dalesio, April 5, 2000.
Writing a Channel Access Client in EPICS Bob Dalesio, April 5, 2000.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Copyright Curt Hill Variables What are they? Why do we need them?
EPICS Release 3.15 Bob Dalesio May 19, Features for 3.15 Support for large arrays - done for rsrv in 3.14 Channel access priorities - planned to.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
1 1999/Ph 514: Flow of Control EPICS Flow of Control Marty Kraimer APS.
1. LabVIEW and EPICS Workshop EPICS Collaboration Meeting Fall 2011.
Application development with Java Lecture 21. Inheritance Subclasses Overriding Object class.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
CS533 – Spring Jeanie M. Schwenk Experiences and Processes and Monitors with Mesa What is Mesa? “Mesa is a strongly typed, block structured programming.
Object Oriented Software Development 4. C# data types, objects and references.
EPICS Release 3.15 Bob Dalesio May 19, Features for 3.15 Support for large arrays Channel access priorities Portable server replacement of rsrv.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – August 23, 2001.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
B. Dalesio, N. Arnold, M. Kraimer, E. Norum, A. Johnson EPICS Collaboration Meeting December 8-10, 2004 Roadmap for IOC.
Written by: Dr. JJ Shepherd
1 Channel Access Concepts – IHEP EPICS Training – K.F – Aug EPICS Channel Access Concepts Kazuro Furukawa, KEK (Bob Dalesio, LANL)
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 7 – Buffer Management.
1 EPICS Flow of Control: EPICS Workshop at IHEP, Beijing, August 2001 EPICS Flow of Control Marty Kraimer APS.
Control System Overview J. Frederick Bartlett Fermilab June 1,1999.
Review of Last Year’s Midterm
JavaIOC Overview and Update
Processes and threads.
Module 11: File Structure
EPICS Roadmap Where Do We Go From Here?
Operating Systems.
Operating Systems.
Introduction to Data Structure
Channel Access Concepts
Channel Access Concepts
Presentation transcript:

Argonne National Laboratory is managed by The University of Chicago for the U.S. Department of Energy ICALEPCS 2005: EPICS Workshop EPICS V4 : Runtime Database Marty Kraimer and Andrew Johnson The submitted manuscript has been created by the University of Chicago as Operator of Argonne National Laboratory (“Argonne”) under Contract No. W ENG-38 with the U.S. Department of Energy. The U.S. Government retains for itself, and others act-ing on its behalf, a paid-up, nonexclusive, irrevocable worldwide license in said article to reproduce, prepare derivative works, dis-tribute copies to the public, and perform publicly and display publicly, by or on behalf of the Government.

2 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database EPICS V4 Database – Summary Of New Features WARNING: –The design for the V4 Database is not complete –The ideas presented in this talk are subject to modification Database Definition Files and Record Instance Definitions –struct is a valid field type –Array fields are allowed Better Support for Data Acquisition –New Link Semantics - All can request Process Wait until linked record completes Link can block or allow other processing while waiting –While active a record can be processed and post monitors db_post_event no longer exists – Database Access handles monitors Lock Sets replaced by per-record lock

3 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database EPICS V4 – Database Definition: Field Types Primitive types –boolean, octet, int16, int32, int64, float32, float64 boolean is true,false but no conversion to/from integer octet is 8-bit byte but no conversion to/from integer string –Array of UTF-8 encoded characters Array field –1-dimensional arrays of all DBD types are allowed –Multidimensional arrays may be restricted (only int or float?) enum – Like V3 but references a field that is an array of string menu – Like V3 struct –struct is a dbd type –A field of a record can be a struct

4 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Example Record Definition: CalcRecord From dbCommon.dbd struct(InputLinkData) { field(pvname,string) field(process,boolean) field(wait,boolean) field(block,boolean) field(inheritSeverity,boolean) } struct(MonitorLinkData) { field(pvname,string) field(process,boolean) field(inheritSeverity,boolean) } struct(ProcessLinkData) {... } struct(OutputLinkData) {... } Features –Options for processing and waiting –Option to block calcRecord.dbd I nclude “dbCommon.dbd” struct(CalcInpLink) { field(link, link(in,interface( "monitorLinkFloat64","inputLinkFloat64" ))) field(value,float64) } record(CalcRecord) extends RecordCommon { field(result,float64) {asl(0)} field(calc,string) {special(yes)} field(inp,array(struct(CalcInpLink)[])) field(units,string) field(displayLimit,struct(DisplayLimit)) field(alarmLimit,struct(AlarmLimit)) field(alarmDeadband,float64) field(lastValueAlarmed,float64) { design(no) readonly(yes) } } Feature –arbitrary number of input links

5 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Example Record Definition: MbbiRecord The following describes a state struct(MbbiState) { field(name,string) field(value,array(octet[])) field (severity,menu(menuAlarmSevr)) } Part of the record definition record(MbbiRecord) extends RecordCommon { field(state, array(struct(MbbiState)[])) {...} field(stateName,array(string[])) { design(no) readonly(yes) } field(value, enum(stateName)) {...}... } Features –Octet[] allows a multiple of 8 bits. For example a 128-bit Digital I/O module –Arbitrary number of states are allowed MbbiState describes –name – the name for the state –value – bit pattern as array of octets –severity Record definition describes –state – an array of mbbiState –stateName – an array of string Record Support will make sure this matches mbbiState names –value

6 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Record Instance Examples Counter Record – count 0 to 10 CalcRecord counter = { scan = “.1 second”; calc = “(a<10)?(a+1):0”; inp = [1] { {link = inputLinkFloat64 {pvname=counter} } }; } Compute Max of recordA, recordB CalcRecord computeMax = { calc = “(a>b)?a:b”; inp = [2] { {link = monitorLinkFloat64 {pvname=recordA;process=yes} }, {link = monitorLinkFloat64 {pvname=recordB;process=yes} } } } mbbi Record 16 bit DAC, 3 states MbbiRecord dac16 = { state = [3] { {name = “state1”; value = octet [2]{0x00,0x01}}, {name = “state2”; octet[2]{0x00,0x02}}, {name=“state3”;octet[2]{0x00,0x04}} }... }

7 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database V4 Links Monitor Link Data - Input –pvname –process – on new value –inheritSeverity Input Link Data - NOT monitored –pvname –process –Wait –block –inheritSeverity Output Link Data –pvname –process –Wait –block –inheritSeverity Process Link Data Replaces V3 fwd link –pvname –Wait –block

8 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database V4 Link Semantics pvname – Process Variable Name process –For MonitorLink it means to process record containing link –For others it means to request that linked record be processed wait – Wait until record completes processing before link completion –If process false then wait until next time record processes –For input wait BEFORE getting value –For output wait after putting value –For process wait until process completion block –If yes then do no other record processsing until this link completes –If no then allow other record processing

9 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Data Acquisition Link Example Scan a sample Repeat the following until done –Move motor A to new position: record incA does this –Move motor B to new position: record incB does this –Wait until A and B are at new position –Take a sample; record getSample does this –NOTE: incA, incB, and getSample may all be a set of records Rules –Motors A and B can be moved together –Don't start a new move until Channel Access Client has received data Approach –The Channel Access Client will ask to go to new position –It will wait for record to complete, read sample, and then repeat

10 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Some V4 Features RecordCommon replaces dbCommon –RecordCommon has associated record support –The following replaces the V3 FLNK field field(processLink,array(RecordCommonProcessLink[])) –This is an array of: struct(ProcessCommonProcessLink) { field(link,link(process,interface(ProcessLink))) } –Thus an array of processLinks For our example we could use any record type –Just assume a record type void which has only RecordCommon

11 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Record Type Void For Data Acquisition Assume that incA, incB, and getSample exist The following does the data acquisition: void collectSample={ processLink=[3] { {pvname = “incA”; wait=true; block=false}, {pvname= “incB”; wait=true; block = true}, {pvname= “getSample”; wait=true; block=true} } } The following occurs –The client issues a processWait request to record collectSample –collectSample requests that both incA and incB process; it waits –collectSample requests that getSample processes; it waits –collectSample completes –client receives completion notification, reads sample, and starts again

12 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database V4 Record Processing Semantics V3 record processing semantics did not work well for data acquisition –New V4 Link semantics help –SynApps (Xray beamline software) created new record types Scan, Motor, etc. Set PACT false but do NOT call recGblFwdLink Thus can be processed again even though they are not done Can issue db_post_event so that current position can be monitored When really done call recGblFwdLink This behavior came as a big suprise to iocCore developers V4 provides semantics that allow this behavior –Previous example showed new link behavior –Although not explained in this talk, the V4 processing semantics allow monitors to be posted While a record is in state processActive At the completion of record processing

13 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Posting Monitors Database Access does all posting of monitors itself –It posts monitors when record support returns processActive –It posts monitors when RecordCommon returns processDone –Thus monitors are posted when state is processActive or when the record completes processing How can Database Access handle monitors itself? –Short answer is that database fields can ONLY be modified via an interface that is implemented by Database Access

14 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Lock Sets Replaced By Per Record Lock V3 implemented lock sets –Allowed dbProcess to be called recursively Process passive database links implemented via recursion –Prevented deadly embrace –For synchronous links fields can not be modified by Channel Access while records in lock set are being modified For asynchronous records this is no longer true V4 queues requests rather than making recursive call to dbProcess in order to process linked records –Prevents stack overflow –Removes many complications of lock sets

15 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database V4 Record Processing: Performance Issues All access to database fields is via interface –Example: interface DbfOctet extends Dbf { int16 get(); void put(int16 val); } –Storage Overhead –Runtime Overhead Queue Request instead of recursive call to dbProcess –Queue Request overhead –Context Switch overhead

16 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Accessing Database Via Interface: Storage Overhead Storage is increased for fields that exist –Database Access keeps private info for every field BUT many fewer fields will exist –RecordCommon has fewer fields than the V3 dbCommon ProcessLink, which replaces the V3 FLNK is an array of links. It can be an empty array –CalcRecord has array of struct(CalcInputLink). V3 always had storage for 16 links and associated info V4 will only allocate storage for the number of links used –Several other record types will have major savings, e.g. mbbi, mbbo –New link semantics will require fewer record instances

17 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Accessing Database Via Interface: Runtime Overhead Overhead for primitive types is extra level of indirection –For gets it is just overhead –For puts posting monitors makes extra level of indirection insignificant Overhead for other types more severe –Arrays biggest problem Record or device support can provide storage and can share storage between record types for demanding applications Will impose more discipline on record and device support –Don't use database to store private info –Set monitors so that it is not necessary to access field everytime record processes –Reward is not getting involved with monitors, etc. Data in IOC records is owned and controlled by database access, not by record and device support

18 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database Record Processing: Overhead of Queue Request Issuing a queue request instead of recursive call to dbProcess has more overhead –Queue request itself –Possible context switch Queue requests often not necessary –Using MonitorLink for input causes no queue request –Synchronous device support requires no queue request –InputLink and OutputLink with process and wait false require no queue request Many queue requests are because of new desired features of V4 Optimization for context switch –When a queue request is issued, the scan thread will process this request as soon as the record issuing the request returns

19 ICALEPCS 2005: EPICS Workshop: EPICS V4 Database WIKI Pages More Details are available in wiki pages –They are available via the main EPICS site –The core developer wiki pages are available via The current wikis of interest are those under the headings: –V4 Database Definition –V4 Database Runtime