Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National...

14
Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory http://sourceforge.net/ projects/epics-dds/ Application, Status, and Direction EPICS'09 Workshop, Kobe, Japan

description

Rationale Distributed Front-Ends Physical Device Virtual Device Physical Device Online ModelMachine Virtual Accelerator Thin Application Thick Application Client Applications e.g. MMLT, others Middle Layer Servers... CA Two different interfaces Low-Level interface and protocol (EPICS, ADO,...)‏ High-Level interface and protocol (CDEV, CORBA,...)‏ Typical three-tier high level application environment

Transcript of Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National...

Page 1: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

Russian Particle Accelerator Conference, 28.09 – 03.10, 2008

Nikolay MalitskyBrookhaven National Laboratory

http://sourceforge.net/projects/epics-dds/

Application, Status, and Direction

EPICS'09 Workshop, Kobe, Japan

Page 2: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

Outline

• Application: rationale, main Idea, DDS intro, benefits

• Status: EPICS-DDS structure, example

• Direction: new tasks, extensions, ...

Page 3: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

Rationale

Distributed

Front-EndsPhysical Device

Virtual Device

Physical Device

Online Model Machine Virtual Accelerator

Thin Application Thick ApplicationClient Applications

e.g. MMLT, others

Middle Layer

Servers

. . .

. . .

CA

Two different interfaces

Low-Level interface and protocol (EPICS, ADO, ...)

High-Level interface and protocol (CDEV, CORBA, ...)

Typical three-tier high level application environment

Page 4: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

Standard Publish/Subscribe Specificationsas candidates for high-level interface, [Summer 2008]

Middleware Language Data Type Data Content Filtering

QoS Complexity Year

CORBA Event Service

C++, Java, … Generic and typed events

no no hard 1997

CORBA Notification Service

C++, Java, … Structured events

yes yes hard ~2000

Java Messaging Service (JMS)

Java five types: text, map, bytes, stream, object messages

filters are message properties

no easy ~2000

High Level Application (HLA)

C++, Java, … Sequence of octets

no yes TBD ~2000

Data Distribution Service (DDS)

C++, Java, … User-specific data types

yes yes easy 2004

NSLS-II commissioning : 2013

Page 5: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

DDS Data-Centric Publish Subscribe Model

Topics of Typed Global Data Space:: a logical data space in which applications read and write data asynchronously, decoupled in space and time

Publisher/Subscriber:: produce/consume information into/from Global Data Space

QoS: reliability, predictability, availability, timeliness, etc.

A.Corsaro. Advanced DDS Tutorial

Page 6: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

DDS-Based Conceptual Design

EPICS-DDS

Main Idea: Start the implementation of the DDS specification in the form of the EPICS extension based on the Channel Access protocol

IOCDistributed

Front-Ends

IOC

Physical Device

Virtual Device

Physical Device

IOC

IOC

Online Model

IOC

Machine

CAC

IOC

Virtual Accelerator

Thin Application

CAC

Thick Application

CAC

Client Applications

e.g. MMLT, others

Middle Layer

Servers

. . .

. . .

CA

CA

Page 7: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

Benefits Brought by DDS to EPICS

The integration of these two technologies addresses five major tasks: First, DDS brings an industrial standard interface to the accelerator online environment allowing to decouple a variety of high-level applications and toolkits from the underlying low-level control systems, such as EPICS, TINE, TANGO, and others.

Second, the DDS topic-oriented approach elevates the EPICS Channel Access protocol to the high-level applications replacing the additional RPC-like communication interfaces.

Third, DDS creates a basis of Service-Oriented Architecture (SOA) promoting decoupling of the service interfaces from their project-oriented implementations [Nanbor Wang, Tech-X Corp.]

Fourth, the DDS specification introduces some guidance for extending the EPICS infrastructure with the relevant set of quality of service.

Finally, the DDS technology extends the EPICS run-time environment with the relational model creating a platform for adding relational queries and integration of full-scale Data Stream Management Systems (DSMS) for data stream processing and archiving.

Page 8: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

EPICS-DDS Packagehttp://sourceforge.net/projects/epics-dds/

• EPICS-DDS Middleware: implementation of the OMG Data Distribution Service (DDS) interface based on the EPICS Channel Access (CA) protocol

• PV Data: generic hierarchical collection of FieldType's and PVField's including the PV Structure suggested by the Java IOC project

• Accelerator Model Interfaces (AMI): collection of the accelerator-specific interfaces and data containers based on the PV Structure

• Accelerator Model Servers (AMS): accelerator-specific middle layer based on the EPICS Portable CA Server (PCAS)

• UI: EPICS-DDS script bindings including Python

Page 9: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

EPICS-DDS Interface

CA wrappers

Serializers and Deserializers of PV Structures

Compositions of Data Readers and Writers

Basis class of User's Listeners

Register of PV Structure-based User's types

Page 10: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

AMS: Accelerator Model Servers

PCAS-based Machine and Twiss Servers

Machine

Machine Publisher

Twiss Subscriber

Page 11: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

TwissCalculatorCAS

ITwissCalculator (Engine)

TwissPV

TwissMachineSubscriber

epicsThread

StrengthReaderListener

create

create

create

create

startrun

Event from MachineServerUpdate Twiss

Update Twiss

Post Twiss

on data available

write into pipe

select

select

select

select

select

select

select

select

select

callBack read from pipe

Post Twiss

Event to Twiss Client

fdManager

TwissMachineReginstallReg

create

Something beyond of the PCAS Tutorial l

create

pipe

Page 12: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

UI: Collection of C++/script bindings

SW

SWIG-based approach. SWIG is Simplified Wrapper and Interface Generator used for C++ bindings with many scripting languages such as Python, Perl, PHP, Tcl, Ruby, etc. It works for most cases ...

void AccStrengthReaderListener::on_data_available(

DDS::DataReader_ptr dr)

{

EPICS::PVStructureReaderCAC* pvStructureReader =

dynamic_cast< EPICS::PVStructureReaderCAC* > (dr);

. . .

::DDS::PVStructureSeq* data_values = 0;

::DDS::SampleInfoSeq* sample_infos = 0;

long max_len = 0;

pvStructureReader->read(data_values, sample_infos,

max_len, sampleMask, viewMask, instanceMask);

EPICS::AccStrengthData accStrengthData;

for(unsigned int i=0; i < data_values->length(); i++){

accStrengthData.setPVStructure(*((*data_values)[i]));

std::cout << i << " : {";

std::cout << accStrengthData.getAccName() << ", ";

std::cout << accStrengthData.getStrength() << ", ";

std::cout << "}" << std::endl;

}

1. callback

2. dynamic castt

3. inout and out arguments + our Python extension

1. Callable object

3. CORBA-compliant change in interface

2. Python-oriented adapter

Page 13: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

Composite Example

EPICS-DDS

IOCDistributed Front-Ends

IOC

Physical Device

Virtual Device

Physical Device

IOC

IOC/CAS

Machine

CAC

C++ DDS SubscriberClient Applicationse.g. MMLT, others

Middle LayerServers

. . .

. . .

CA

CA

CAC

TwissReaderListener

C++ DDS Publisher

CAC

IOC/CAS

Virtual Accelerator

CAC

IOC/CAS

Twiss Calculator

CAC

Python

Page 14: Russian Particle Accelerator Conference, 28.09 – 03.10, 2008 Nikolay Malitsky Brookhaven National Laboratory

New Tasks (life after ICALEPCS'09 .... )

EPICS-DDS

IOC IOC

Physical Device

Virtual Device

Physical Device

IOC

IOC/CAS

Machine

CAC

C++ DDS Subscriber

. . .

. . .

CA

CA

CAC

Client

C++ DDS Publisher

CAC

IOC/CAS

Virtual Accelerator

CAC

IOC/CAS

Twiss Calculator

CAC

Matlab

1. Stony Brook , Computer Department ERL, Cornell

IOC/CAS

Optimization

Web Server

CAC

2. SBIR Phase II: Tech -X

3. ERL, Cornell NSLS-II, BNL

6. Configurable Virtual Accelerator

4. EPICS V4: PV Structure, Protocol, ...

5. Java EPICS-DDS