dds-psm-cxx and simd-cxx

21
OpenSplice DDS DDS-PSM-Cxx v1.0 and simd-cxx Angelo CORSARO, Ph.D. Chief Technology Ocer OMG DDS Sig Co-Chair PrismTech [email protected]

Upload: angelo-corsaro

Post on 15-Jan-2015

813 views

Category:

Technology


1 download

DESCRIPTION

This presentation provides with an historical perspective on the development of the DDS-PSM-Cxx and its relationship with simd-cxx 0.x and simd-cxx v1.0

TRANSCRIPT

Page 1: DDS-PSM-Cxx and simd-cxx

Ope

nSpl

ice

DD

S

DDS-PSM-Cxx v1.0andsimd-cxx

Angelo CORSARO, Ph.D.Chief Technology Officer OMG DDS Sig Co-Chair

[email protected]

Page 2: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

History on a Napkin

Page 3: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Page 4: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

La Vallee...

Page 5: DDS-PSM-Cxx and simd-cxx

Ope

nSpl

ice

DD

S

DDS-PSM-Cxx v1.0Overview

Page 6: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Anatomy of a DDS Application

Domain

Reader/Writers for User Defined for Types

Session

// Create a DataWriter/DataWriterauto writer = DataWriter<ShapeType>(pub, topic);auto reader = DataReader<ShapeType>(sub, topic);

Reader/Writer for application defined

Topic Types

Domain Participant

Publisher

DataWriter

Topic Subscriber

DataReader

[DDS C++ API 2010]

auto dp = DomainParticipant(domainId);

// Create a Topicauto topic = Topic<ShapeType>(dp, “Circle”);// Create a Publisher / Subscriberauto pub = Publisher(dp);auto sub = Subscriber(dp);

Page 7: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Anatomy of a DDS Application

Domain

Reader/Writers for User Defined for Types

Session

// Write datawriter.write(ShapeType(“RED”, 131, 107, 89));// But you can also write like this...writer << ShapeType(“RED”, 131, 107, 89);

// Read new data (loaned)auto data = reader.read();

Reader/Writer for application defined

Topic Types

auto dp = DomainParticipant(domainId); Domain

Participant

Publisher

DataWriter

Topic Subscriber

DataReader

// Create a Topicauto topic = Topic<ShapeType>(dp, “Circle”);// Create a Publisher / Subscriberauto pub = Publisher(dp);auto sub = Subscriber(dp);

[DDS C++ API 2010]

Page 8: DDS-PSM-Cxx and simd-cxx

Ope

nSpl

ice

DD

S

Content-Based Data Selection

Page 9: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Filters and Queries☐ DDS Filters allow to control what gets

into a DataReader cache

☐ DDS Queries allow to control what gets out of a DataReader cache

☐ Filters are defined by means of ContentFilteredTopics

☐ Queries operate in conjunction with read operations

☐ Filters and Queries are expressed as SQL where clauses

DataReader Cache

DataReader

...... ... ...

Filter

Query

Application

Page 10: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Filters/** * NOTE: The Scala API if not provided with DP/Sub/Pub assumes * default domains and default partition. **/// Create a Topicauto topic = Topic<ShapeType>(dp, “Circle”);

// Define filter expression and parametersauto filter = Filter(“x < 100 AND y < 200”);

// Define content filtered topicauto cftopic = ContentFilteredTopic<ShapeType>(“CFCircle”, topic, filter)

// Create a DataReader for the content-filtered Topicauto dr = DataReader<ShapeType>(sub,cftopic)

[C++ API]

struct ShapeType { @Key string color; long x; long y; long shapesize;};

Page 11: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Query

// Define filter expression and parametersauto dr = DataReader<ShapeType>(sub, topic) val query = Query(dr, “x < 100 AND y < 200”);

dr.select() .content(query) .read();

struct ShapeType { @Key string color; long x; long y; long shapesize;};[C++ API]

Page 12: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Instances☐ DDS provides a very efficient way of reading data belonging to a

specific Topic Instance

☐ Obviously, one could use queries to match the key’s value, but this is not as efficient as the special purpose instance selector

auto handle = dr.lookup_instance(ShapeType(“RED”, 0, 0, 0));

auto data = dr.select() .instance(handle) .read();

Page 13: DDS-PSM-Cxx and simd-cxx

Ope

nSpl

ice

DD

S

State-Based Selection

Page 14: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Sample, Instance, and View State☐ The samples included in the DataReader cache have associated

some meta-information which, among other things, describes the status of the sample and its associated stream/instance

☐ The Sample State (READ, NOT_READ) allows to distinguish between new samples and samples that have already been read

☐ The View State (NEW, NOT_NEW) allows to distinguish a new instance from an existing one

☐ The Intance State (ALIVE, NOT_ALIVE_DISPOSED, NOT_ALIVE_NO_WRITERS) allows to track the life-cycle transitions of the instance to which a sample belongs

Page 15: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

State Selector in Action

// Read only new samplesauto data = dr.read()

// Read any samples from live instancesauto data = dr.select() .state(DataState::any_data()) .read();

[C++ API]

Page 16: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

auto data = dr.select() .content(query) .state(data_state) .instance(handle) .read();

Putting all Together

☐ Selectors can be composed in a flexible and expressive manner

[C++ API]

Page 17: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

QoS Provider☐ The new C++ and Java APIs introduce the concept of a QoS

Provider

☐ This class allows to externally define policies and decouples the mechanism used to define and access policy definition with policy creation

           //  QosProvider...            QosProvider  qos_provider(                        "http://www.opensplice.org/demo/config/qos.xml",                        "ishapes-­‐profile");

           DataReader<ShapeType>  dr(sub,  topic,  qos_provider.datareader_qos());

Page 18: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

In Summary

☐ simd-cxx v0.x available at http://code.google.com/p/simd-cxx was the major influencer of the new DDS-PSM-Cxx standard. Yet simd-cxx v0.x does not comply with the DDS-PSM-Cxx

☐ simd-cxx v1.0 available at http://github.com/kydos/simd-cxx is an alpha implementation of the DDS-PSM-Cxx

Page 19: DDS-PSM-Cxx and simd-cxx

Ope

nSpl

ice

DD

S

Page 20: DDS-PSM-Cxx and simd-cxx

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

References

¥Fastest growing JVM Language¥Open Source¥www.scala-lang.org

¥ #1 OMG DDS Implementation¥ Open Source¥ www.opensplice.org

OpenSplice | DDS¥Scala API for OpenSplice DDS¥Open Source¥github.com/kydos/escalier

Escalier

¥Simple C++ API for DDS¥Open Source¥github.com/kydos/simd-cxx

¥DDS-PSM-Java for OpenSplice DDS¥Open Source¥github.com/kydos/simd-java

¥ DDS-based Advanced Distributed Algorithms Toolkit

¥Open Source¥github.com/kydos/dada