80
CERTI - Bindings to Matlab and Fortran Christian Stenzel, Sven Pawletta RG Computational Engineering and Automation University of Wismar, Germany 10. Magdeburger HLA-Forum 27.02.2008 1 / 29

CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

CERTI - Bindings to Matlab and Fortran

Christian Stenzel, Sven Pawletta

RG Computational Engineering and AutomationUniversity of Wismar, Germany

10. Magdeburger HLA-Forum27.02.2008

1 / 29

Page 2: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Outline

1 Introduction

2 Non-Commercial RTIs

3 CERTI BindingsBasic AspectsBindings to MatlabBindings to Fortran

4 Summary and Outlook

2 / 29

Page 3: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Outline

1 Introduction

2 Non-Commercial RTIs

3 CERTI BindingsBasic AspectsBindings to MatlabBindings to Fortran

4 Summary and Outlook

3 / 29

Page 4: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

RG Computational Engineering and Automation

research group at the University of Wismarprimary research fields:

I fundamentals of modeling and simulationI modeling, simulation and control applicationsI robotics, engine controlI distributed and parallel scientific computing in the engineering

domain

highly interested in advanced simulation technologies like HLAmain focus on the engineering domain

4 / 29

Page 5: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

RG Computational Engineering and Automation

research group at the University of Wismarprimary research fields:

I fundamentals of modeling and simulationI modeling, simulation and control applicationsI robotics, engine controlI distributed and parallel scientific computing in the engineering

domain

highly interested in advanced simulation technologies like HLAmain focus on the engineering domain

4 / 29

Page 6: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

RG Computational Engineering and Automation

research group at the University of Wismarprimary research fields:

I fundamentals of modeling and simulationI modeling, simulation and control applicationsI robotics, engine controlI distributed and parallel scientific computing in the engineering

domain

highly interested in advanced simulation technologies like HLAmain focus on the engineering domain

4 / 29

Page 7: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Motivation

today’s RTIs provide C++ and/or Java APIsI but:

F simulation model design and execution in the engineering domaintoday characterized by the usage of Scientific and technicalComputation Environments (SCEs)→ Matlab

F existing Fortran codes are daily used, Fortran primary programminglanguage in HPC community

aims:I provide engineers HLA access within their usual working

environmentI provide a way to easily extend existing code to HLA federatesI increase acceptance of HLA in the engineering domain

5 / 29

Page 8: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Motivation

today’s RTIs provide C++ and/or Java APIsI but:

F simulation model design and execution in the engineering domaintoday characterized by the usage of Scientific and technicalComputation Environments (SCEs)→ Matlab

F existing Fortran codes are daily used, Fortran primary programminglanguage in HPC community

aims:I provide engineers HLA access within their usual working

environmentI provide a way to easily extend existing code to HLA federatesI increase acceptance of HLA in the engineering domain

5 / 29

Page 9: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Motivation

today’s RTIs provide C++ and/or Java APIsI but:

F simulation model design and execution in the engineering domaintoday characterized by the usage of Scientific and technicalComputation Environments (SCEs)→ Matlab

F existing Fortran codes are daily used, Fortran primary programminglanguage in HPC community

aims:I provide engineers HLA access within their usual working

environmentI provide a way to easily extend existing code to HLA federatesI increase acceptance of HLA in the engineering domain

5 / 29

Page 10: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Motivation

today’s RTIs provide C++ and/or Java APIsI but:

F simulation model design and execution in the engineering domaintoday characterized by the usage of Scientific and technicalComputation Environments (SCEs)→ Matlab

F existing Fortran codes are daily used, Fortran primary programminglanguage in HPC community

aims:I provide engineers HLA access within their usual working

environmentI provide a way to easily extend existing code to HLA federatesI increase acceptance of HLA in the engineering domain

5 / 29

Page 11: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Outline

1 Introduction

2 Non-Commercial RTIs

3 CERTI BindingsBasic AspectsBindings to MatlabBindings to Fortran

4 Summary and Outlook

6 / 29

Page 12: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

preferred RTII free, open source→ possibility to study RTI implementation and to

participate in developmentI C++ bindings→ simplifies Fortran bindingI cross platform RTI (including Windows)I advanced implementation status of HLA servicesI active developer community

a number of non-commercial RTIs existoverview about existing non-commercial RTI implementationsrequired

7 / 29

Page 13: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

preferred RTII free, open source→ possibility to study RTI implementation and to

participate in developmentI C++ bindings→ simplifies Fortran bindingI cross platform RTI (including Windows)I advanced implementation status of HLA servicesI active developer community

a number of non-commercial RTIs existoverview about existing non-commercial RTI implementationsrequired

7 / 29

Page 14: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

preferred RTII free, open source→ possibility to study RTI implementation and to

participate in developmentI C++ bindings→ simplifies Fortran bindingI cross platform RTI (including Windows)I advanced implementation status of HLA servicesI active developer community

a number of non-commercial RTIs existoverview about existing non-commercial RTI implementationsrequired

7 / 29

Page 15: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

preferred RTII free, open source→ possibility to study RTI implementation and to

participate in developmentI C++ bindings→ simplifies Fortran bindingI cross platform RTI (including Windows)I advanced implementation status of HLA servicesI active developer community

a number of non-commercial RTIs existoverview about existing non-commercial RTI implementationsrequired

7 / 29

Page 16: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

preferred RTII free, open source→ possibility to study RTI implementation and to

participate in developmentI C++ bindings→ simplifies Fortran bindingI cross platform RTI (including Windows)I advanced implementation status of HLA servicesI active developer community

a number of non-commercial RTIs existoverview about existing non-commercial RTI implementationsrequired

7 / 29

Page 17: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

preferred RTII free, open source→ possibility to study RTI implementation and to

participate in developmentI C++ bindings→ simplifies Fortran bindingI cross platform RTI (including Windows)I advanced implementation status of HLA servicesI active developer community

a number of non-commercial RTIs existoverview about existing non-commercial RTI implementationsrequired

7 / 29

Page 18: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

preferred RTII free, open source→ possibility to study RTI implementation and to

participate in developmentI C++ bindings→ simplifies Fortran bindingI cross platform RTI (including Windows)I advanced implementation status of HLA servicesI active developer community

a number of non-commercial RTIs existoverview about existing non-commercial RTI implementationsrequired

7 / 29

Page 19: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

Name Vendor Standard Bindings License

BH-RTI Beijing University 1.3, IEEE 1516 ? ?

CERTI ONERA 1.3 partial, IEEE1516 planned

C++, Java planned GPL, LGPL

EODiSP HLA P&P Software IEEE 1516 partial Java GPL

GERTICO Fraunhofer IITB 1.3 ? ?

Open HLA 1.3 partial, IEEE1516 partial

Java Apache License

RTI-S US JFCOM J9Directorate

1.3 partial C++, Java US Government

poRTIco littlebluefrog labs 1.3 partial, IEEE1516 partial

Java, C++ CDDL

Rendezvous RTI NUST, Pakistan 1.3 C++, Java NUST

Table: www.wikipedia.org, Feb. 2008

8 / 29

Page 20: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

Name Vendor Standard Bindings License

BH-RTI Beijing University 1.3, IEEE 1516 ? ?

CERTI ONERA 1.3 partial, IEEE1516 planned

C++, Java planned GPL, LGPL

EODiSP HLA P&P Software IEEE 1516 partial Java GPL

GERTICO Fraunhofer IITB 1.3 ? ?

Open HLA 1.3 partial, IEEE1516 partial

Java Apache License

RTI-S US JFCOM J9Directorate

1.3 partial C++, Java US Government

poRTIco littlebluefrog labs 1.3 partial, IEEE1516 partial

Java, C++ CDDL

Rendezvous RTI NUST, Pakistan 1.3 C++, Java NUST

Table: www.wikipedia.org, Feb. 2008

not downloadable or no activities since 12 months; only binaries available

8 / 29

Page 21: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

Name Vendor Standard Bindings License

BH-RTI Beijing University 1.3, IEEE 1516 ? ?

CERTI ONERA 1.3 partial, IEEE1516 planned

C++, Java planned GPL, LGPL

EODiSP HLA P&P Software IEEE 1516 partial Java GPL

GERTICO Fraunhofer IITB 1.3 ? ?

Open HLA 1.3 partial, IEEE1516 partial

Java Apache License

RTI-S US JFCOM J9Directorate

1.3 partial C++, Java US Government

poRTIco littlebluefrog labs 1.3 partial, IEEE1516 partial

Java, C++ CDDL

Rendezvous RTI NUST, Pakistan 1.3 C++, Java NUST

Table: www.wikipedia.org, Feb. 2008

not downloadable or no activities since 12 months; only binaries available

8 / 29

Page 22: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Non-Commercial RTIs

Name Vendor Standard Bindings License

BH-RTI Beijing University 1.3, IEEE 1516 ? ?

CERTI ONERA 1.3 partial, IEEE1516 planned

C++, Java planned GPL, LGPL

EODiSP HLA P&P Software IEEE 1516 partial Java GPL

GERTICO Fraunhofer IITB 1.3 ? ?

Open HLA 1.3 partial, IEEE1516 partial

Java Apache License

RTI-S US JFCOM J9Directorate

1.3 partial C++, Java US Government

poRTIco littlebluefrog labs 1.3 partial, IEEE1516 partial

Java, C++ CDDL

Rendezvous RTI NUST, Pakistan 1.3 C++, Java NUST

Table: www.wikipedia.org, Feb. 2008

not downloadable or no activities since 12 months; only binaries available

8 / 29

Page 23: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

general informationI former known as jaRTI, developed since 2005, first public release

June 2006I since May 2007 poRTIcoI license: COMMON DEVELOPMENT AND DISTRIBUTION LICENSE

(CDDL, more "commercial friendly" than GNU LGPL)I homepage and development site: http://porticoproject.org

prosI open source, based on JavaI C++ and Java bindingsI HLA1.3 partial, IEEE1516 partial

consI three main developers, all phd students→What follows after their

thesis?I v0.8rc1, Feb. 2008; version < 1.0

9 / 29

Page 24: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

general informationI former known as jaRTI, developed since 2005, first public release

June 2006I since May 2007 poRTIcoI license: COMMON DEVELOPMENT AND DISTRIBUTION LICENSE

(CDDL, more "commercial friendly" than GNU LGPL)I homepage and development site: http://porticoproject.org

prosI open source, based on JavaI C++ and Java bindingsI HLA1.3 partial, IEEE1516 partial

consI three main developers, all phd students→What follows after their

thesis?I v0.8rc1, Feb. 2008; version < 1.0

9 / 29

Page 25: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

general informationI former known as jaRTI, developed since 2005, first public release

June 2006I since May 2007 poRTIcoI license: COMMON DEVELOPMENT AND DISTRIBUTION LICENSE

(CDDL, more "commercial friendly" than GNU LGPL)I homepage and development site: http://porticoproject.org

prosI open source, based on JavaI C++ and Java bindingsI HLA1.3 partial, IEEE1516 partial

consI three main developers, all phd students→What follows after their

thesis?I v0.8rc1, Feb. 2008; version < 1.0

9 / 29

Page 26: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

general informationI developed at CERT (ONERA Research Centre, ONERA - French

aerospace lab)I started 1996, first version available in Sept. 1997I license: GNU GPL, libraries under GNU LGPLI homepage: http://www.cert.fr/CERTII devel@Savannah: http://savannah.nongnu.org/projects/certi

prosI active developer community (11 members)I current release 3.2.5, well tested RTII HLA1.3 nearly complete, HLA1516 plannedI cmake build system, different tool chains possible (gcc, msc, icc)I HP CERTI, optimized for SMP multiprocessor machines

consI at present only C++ bindings; Java bindings planned

CERTI fulfills all requirements

10 / 29

Page 27: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

general informationI developed at CERT (ONERA Research Centre, ONERA - French

aerospace lab)I started 1996, first version available in Sept. 1997I license: GNU GPL, libraries under GNU LGPLI homepage: http://www.cert.fr/CERTII devel@Savannah: http://savannah.nongnu.org/projects/certi

prosI active developer community (11 members)I current release 3.2.5, well tested RTII HLA1.3 nearly complete, HLA1516 plannedI cmake build system, different tool chains possible (gcc, msc, icc)I HP CERTI, optimized for SMP multiprocessor machines

consI at present only C++ bindings; Java bindings planned

CERTI fulfills all requirements

10 / 29

Page 28: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

general informationI developed at CERT (ONERA Research Centre, ONERA - French

aerospace lab)I started 1996, first version available in Sept. 1997I license: GNU GPL, libraries under GNU LGPLI homepage: http://www.cert.fr/CERTII devel@Savannah: http://savannah.nongnu.org/projects/certi

prosI active developer community (11 members)I current release 3.2.5, well tested RTII HLA1.3 nearly complete, HLA1516 plannedI cmake build system, different tool chains possible (gcc, msc, icc)I HP CERTI, optimized for SMP multiprocessor machines

consI at present only C++ bindings; Java bindings planned

CERTI fulfills all requirements

10 / 29

Page 29: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

general informationI developed at CERT (ONERA Research Centre, ONERA - French

aerospace lab)I started 1996, first version available in Sept. 1997I license: GNU GPL, libraries under GNU LGPLI homepage: http://www.cert.fr/CERTII devel@Savannah: http://savannah.nongnu.org/projects/certi

prosI active developer community (11 members)I current release 3.2.5, well tested RTII HLA1.3 nearly complete, HLA1516 plannedI cmake build system, different tool chains possible (gcc, msc, icc)I HP CERTI, optimized for SMP multiprocessor machines

consI at present only C++ bindings; Java bindings planned

CERTI fulfills all requirements

10 / 29

Page 30: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Outline

1 Introduction

2 Non-Commercial RTIs

3 CERTI BindingsBasic AspectsBindings to MatlabBindings to Fortran

4 Summary and Outlook

11 / 29

Page 31: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Outline

1 Introduction

2 Non-Commercial RTIs

3 CERTI BindingsBasic AspectsBindings to MatlabBindings to Fortran

4 Summary and Outlook

12 / 29

Page 32: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

CERTI Architecture

federates interfacing libRTI throughHLA interface specificationRTIA process interacts with federateprocess through UNIX-domainsockets (Windows TCP sockets)RTIG interacts with RTIA throughTCP/UDP socketsHP CERTI replaces socketcommunication through sharedmemory communication

B. Bréholée, P. Siron: CERTI: Evolutions of theONERA RTI Prototype. In Proceedings of the Fall2002 Simulation Interoperability Workshop 8-13

September 2002, Orlando, FL, USA.

13 / 29

Page 33: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

CERTI Architecture

federates interfacing libRTI throughHLA interface specificationRTIA process interacts with federateprocess through UNIX-domainsockets (Windows TCP sockets)RTIG interacts with RTIA throughTCP/UDP socketsHP CERTI replaces socketcommunication through sharedmemory communication

B. Bréholée, P. Siron: CERTI: Evolutions of theONERA RTI Prototype. In Proceedings of the Fall2002 Simulation Interoperability Workshop 8-13

September 2002, Orlando, FL, USA.

13 / 29

Page 34: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

CERTI Architecture

federates interfacing libRTI throughHLA interface specificationRTIA process interacts with federateprocess through UNIX-domainsockets (Windows TCP sockets)RTIG interacts with RTIA throughTCP/UDP socketsHP CERTI replaces socketcommunication through sharedmemory communication

B. Bréholée, P. Siron: CERTI: Evolutions of theONERA RTI Prototype. In Proceedings of the Fall2002 Simulation Interoperability Workshop 8-13

September 2002, Orlando, FL, USA.

13 / 29

Page 35: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

CERTI Architecture

federates interfacing libRTI throughHLA interface specificationRTIA process interacts with federateprocess through UNIX-domainsockets (Windows TCP sockets)RTIG interacts with RTIA throughTCP/UDP socketsHP CERTI replaces socketcommunication through sharedmemory communication

B. Bréholée, P. Siron: CERTI: Evolutions of theONERA RTI Prototype. In Proceedings of the Fall2002 Simulation Interoperability Workshop 8-13

September 2002, Orlando, FL, USA.

13 / 29

Page 36: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Bindings to Procedural Language Environments

object oriented HLA interface⇐⇒ procedural Matlab, Fortranmapping not straightforward, general problems:

I bidirectional communicationI object instantiationI function overloadingI exception handling

data type conversionlinkage against libRTI

14 / 29

Page 37: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Bindings to Procedural Language Environments

object oriented HLA interface⇐⇒ procedural Matlab, Fortranmapping not straightforward, general problems:

I bidirectional communicationI object instantiationI function overloadingI exception handling

data type conversionlinkage against libRTI

14 / 29

Page 38: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Bindings to Procedural Language Environments

object oriented HLA interface⇐⇒ procedural Matlab, Fortranmapping not straightforward, general problems:

I bidirectional communicationI object instantiationI function overloadingI exception handling

data type conversionlinkage against libRTI

14 / 29

Page 39: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Outline

1 Introduction

2 Non-Commercial RTIs

3 CERTI BindingsBasic AspectsBindings to MatlabBindings to Fortran

4 Summary and Outlook

15 / 29

Page 40: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-Toolbox

general information:I project developed by RG CEA at the University of WismarI started in 1998I homepage: http://www.mb.hs-wismar.de/cea/sw_projects.htmlI development: http://savannah.nongnu.org/projects/certi

features:I abbreviated RTI service designatorsI selectable exception handlingI default interactive federate servicesI use of vectorization, implicit data types→ simpler RTI interface

implementation status:I standard: HLA 1.3I Federation Management, Declaration Management, Object

Management, Time Management completeI Data Distribution Management, Ownership Management not yet

implemented

16 / 29

Page 41: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-Toolbox

general information:I project developed by RG CEA at the University of WismarI started in 1998I homepage: http://www.mb.hs-wismar.de/cea/sw_projects.htmlI development: http://savannah.nongnu.org/projects/certi

features:I abbreviated RTI service designatorsI selectable exception handlingI default interactive federate servicesI use of vectorization, implicit data types→ simpler RTI interface

implementation status:I standard: HLA 1.3I Federation Management, Declaration Management, Object

Management, Time Management completeI Data Distribution Management, Ownership Management not yet

implemented

16 / 29

Page 42: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-Toolbox

general information:I project developed by RG CEA at the University of WismarI started in 1998I homepage: http://www.mb.hs-wismar.de/cea/sw_projects.htmlI development: http://savannah.nongnu.org/projects/certi

features:I abbreviated RTI service designatorsI selectable exception handlingI default interactive federate servicesI use of vectorization, implicit data types→ simpler RTI interface

implementation status:I standard: HLA 1.3I Federation Management, Declaration Management, Object

Management, Time Management completeI Data Distribution Management, Ownership Management not yet

implemented

16 / 29

Page 43: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxBidirectional Communication

Matlab External (MEX) interfaceallows access to external librariesRTI Services

I Matlab federate calls RTI servicem-function

I m-function directly calls functionwithin C++-wrapper (m2RtiSrv)

I type conversion (m2c)I m2RtiSrv calls appropriate RTIamb

methodFederate Services

I libRTI calls implemented federateservices in C++-wrapper

I type conversion (c2m)I fedService m-file invoked by

mexCallMatlab()

17 / 29

Page 44: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxBidirectional Communication

Matlab External (MEX) interfaceallows access to external librariesRTI Services

I Matlab federate calls RTI servicem-function

I m-function directly calls functionwithin C++-wrapper (m2RtiSrv)

I type conversion (m2c)I m2RtiSrv calls appropriate RTIamb

methodFederate Services

I libRTI calls implemented federateservices in C++-wrapper

I type conversion (c2m)I fedService m-file invoked by

mexCallMatlab()

17 / 29

Page 45: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxBidirectional Communication

Matlab External (MEX) interfaceallows access to external librariesRTI Services

I Matlab federate calls RTI servicem-function

I m-function directly calls functionwithin C++-wrapper (m2RtiSrv)

I type conversion (m2c)I m2RtiSrv calls appropriate RTIamb

methodFederate Services

I libRTI calls implemented federateservices in C++-wrapper

I type conversion (c2m)I fedService m-file invoked by

mexCallMatlab()

17 / 29

Page 46: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxObject Instantiation

objects (RTIamb, fedAmb) staticallyinstantiated once in C++-wrapper(one module)plain procedural interface towardslibRTIaccidental/automatic moduleunloading has to be avoided→module locking

18 / 29

Page 47: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxObject Instantiation

objects (RTIamb, fedAmb) staticallyinstantiated once in C++-wrapper(one module)plain procedural interface towardslibRTIaccidental/automatic moduleunloading has to be avoided→module locking

18 / 29

Page 48: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxObject Instantiation

objects (RTIamb, fedAmb) staticallyinstantiated once in C++-wrapper(one module)plain procedural interface towardslibRTIaccidental/automatic moduleunloading has to be avoided→module locking

18 / 29

Page 49: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxFunction Overloading

RTI-interface makes extensive use ofoverloaded methodsMatlab does not support overloadingnativelyMATLAB/MEX allows analysis offunction signatures (number, types)

Matlab Examplefunction fedService(in1, in2, in3, in4)

if nargin==4...else...end

19 / 29

Page 50: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxFunction Overloading

RTI-interface makes extensive use ofoverloaded methodsMatlab does not support overloadingnativelyMATLAB/MEX allows analysis offunction signatures (number, types)

Matlab Examplefunction fedService(in1, in2, in3, in4)

if nargin==4...else...end

19 / 29

Page 51: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxFunction Overloading

RTI-interface makes extensive use ofoverloaded methodsMatlab does not support overloadingnativelyMATLAB/MEX allows analysis offunction signatures (number, types)

Matlab Examplefunction fedService(in1, in2, in3, in4)

if nargin==4...else...end

19 / 29

Page 52: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxFunction Overloading

RTI-interface makes extensive use ofoverloaded methodsMatlab does not support overloadingnativelyMATLAB/MEX allows analysis offunction signatures (number, types)

Matlab Examplefunction fedService(in1, in2, in3, in4)

if nargin==4...else...end

19 / 29

Page 53: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxException Handling

possible exception catched(C++-Wrapper) and returned toMatlabMatlabHLA m-files provide optionalerror return valuecomplex error handling in Matlabfederate possible

Matlab Example...rtiSrv(in1, in2)...err = rtiSrv(in1, in2)switch errcase ’RTIinternalError’...

20 / 29

Page 54: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxException Handling

possible exception catched(C++-Wrapper) and returned toMatlabMatlabHLA m-files provide optionalerror return valuecomplex error handling in Matlabfederate possible

Matlab Example...rtiSrv(in1, in2)...err = rtiSrv(in1, in2)switch errcase ’RTIinternalError’...

20 / 29

Page 55: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxException Handling

possible exception catched(C++-Wrapper) and returned toMatlabMatlabHLA m-files provide optionalerror return valuecomplex error handling in Matlabfederate possible

Matlab Example...rtiSrv(in1, in2)...err = rtiSrv(in1, in2)switch errcase ’RTIinternalError’...

20 / 29

Page 56: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

MatlabHLA-ToolboxException Handling

possible exception catched(C++-Wrapper) and returned toMatlabMatlabHLA m-files provide optionalerror return valuecomplex error handling in Matlabfederate possible

Matlab Example...rtiSrv(in1, in2)...err = rtiSrv(in1, in2)switch errcase ’RTIinternalError’...

20 / 29

Page 57: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Outline

1 Introduction

2 Non-Commercial RTIs

3 CERTI BindingsBasic AspectsBindings to MatlabBindings to Fortran

4 Summary and Outlook

21 / 29

Page 58: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLA

general information:I project developed by RG CEA at the University of WismarI library for use with Fortran90, FORTRAN77 subset of Fortran90I MatlabHLA used as design patternI homepage: http://www.mb.hs-wismar.de/cea/sw_projects.htmlI development: http://savannah.nongnu.org/projects/certi

features:I abbreviated RTI service designatorsI selectable exception handlingI default federate servicesI support of gcc 3.x, gcc 4.x, icc 9.x, icc 10.x

implementation status:I standard: HLA 1.3I Federation Management completeI other management areas partial

22 / 29

Page 59: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLA

general information:I project developed by RG CEA at the University of WismarI library for use with Fortran90, FORTRAN77 subset of Fortran90I MatlabHLA used as design patternI homepage: http://www.mb.hs-wismar.de/cea/sw_projects.htmlI development: http://savannah.nongnu.org/projects/certi

features:I abbreviated RTI service designatorsI selectable exception handlingI default federate servicesI support of gcc 3.x, gcc 4.x, icc 9.x, icc 10.x

implementation status:I standard: HLA 1.3I Federation Management completeI other management areas partial

22 / 29

Page 60: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLA

general information:I project developed by RG CEA at the University of WismarI library for use with Fortran90, FORTRAN77 subset of Fortran90I MatlabHLA used as design patternI homepage: http://www.mb.hs-wismar.de/cea/sw_projects.htmlI development: http://savannah.nongnu.org/projects/certi

features:I abbreviated RTI service designatorsI selectable exception handlingI default federate servicesI support of gcc 3.x, gcc 4.x, icc 9.x, icc 10.x

implementation status:I standard: HLA 1.3I Federation Management completeI other management areas partial

22 / 29

Page 61: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 62: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 63: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 64: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 65: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 66: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 67: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 68: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 69: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 70: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 71: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLALinkage against libRTI

linkage Fortran C++ not straightforwardI C++/Fortran compiler use non-standardized name mangling (ifort:

modulename_mp_fcnname_, gfortran: __modulename__fcnname)I data types, e.g. C row-major order, Fortran column major-orderI parameters only passed by reference

realizable byI C++ compiler: C style naming (extern "C")→ linkage Fortran CI preprocessor constants for compiler dependenciesI functions for type conversion

PROGRAM CALLC /* rtisrv as c++ function with C-style naming */! extern "C" {IMPLICIT NONE void rtisrv_(int *a);! }INTEGER :: a!CALL rtisrv(a) ---> void rtisrv_(int *a) {! RTItype a_rti = fortranInt2RTItype(*a);! rtiAmb.rtiSrv(a_rti);! }END PROGRAM CALLC

23 / 29

Page 72: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLABidirectional Communication

RTI ServicesI F90 federate invokes RTI services

by calling the rtiModSrv fcnI signature analysis and C fcn callI C++ type conversion, call rtiAmb

methodFederate Services

I libRTI calls implemented federateservices

I type conversion from C/C++ typesinto Fortran types

I appropriate Fortran90 federateservice implementation is called

24 / 29

Page 73: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLABidirectional Communication

RTI ServicesI F90 federate invokes RTI services

by calling the rtiModSrv fcnI signature analysis and C fcn callI C++ type conversion, call rtiAmb

methodFederate Services

I libRTI calls implemented federateservices

I type conversion from C/C++ typesinto Fortran types

I appropriate Fortran90 federateservice implementation is called

24 / 29

Page 74: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLAObject Instantiation

similar to MatlabHLA-ToolboxRTIamb, fedAmb staticallyinstantiated in libF90HLA (rtiOn)plain procedural interface towardslibRTI

25 / 29

Page 75: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLAFunction Overloading

F90 allows optional functionparametersintrinsic function present can testexistence of optional parameterstests performed in F90 module

rtiSrvMod.f90subroutine rtiSrv(in1, in2)!implicit none!integer, intent(in) :: in1integer, intent(in), optional :: in2...if (present(in2)) then

...end if...end subroutine rtiSrv

26 / 29

Page 76: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLAFunction Overloading

F90 allows optional functionparametersintrinsic function present can testexistence of optional parameterstests performed in F90 module

rtiSrvMod.f90subroutine rtiSrv(in1, in2)!implicit none!integer, intent(in) :: in1integer, intent(in), optional :: in2...if (present(in2)) then...

end if...end subroutine rtiSrv

26 / 29

Page 77: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLAException Handling

similar method to realize selectableexception handlingdefault: program terminationoptional error parameter allowsexception handling in F90 fed

rtiSrvMod.f90subroutine rtiSrv(err)...integer, intent(out), optional :: errinteger :: tmpErr = 0...call rtisrvwrap(tmpErr)if (present(err)) then

err = tmpErrelse

if (tmpErr.lt.0) thenwrite(*,*) "Error = ", tmpErrstop "Terminating"

end ifend if...

27 / 29

Page 78: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

libF90HLAException Handling

similar method to realize selectableexception handlingdefault: program terminationoptional error parameter allowsexception handling in F90 fed

rtiSrvMod.f90subroutine rtiSrv(err)...integer, intent(out), optional :: errinteger :: tmpErr = 0...call rtisrvwrap(tmpErr)if (present(err)) then

err = tmpErrelse

if (tmpErr.lt.0) thenwrite(*,*) "Error = ", tmpErrstop "Terminating"

end ifend if...

27 / 29

Page 79: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Outline

1 Introduction

2 Non-Commercial RTIs

3 CERTI BindingsBasic AspectsBindings to MatlabBindings to Fortran

4 Summary and Outlook

28 / 29

Page 80: CERTI - Bindings to Matlab and Fortrannongnu.askapache.com/certi/papers/CERTIBindingsToMatlabAndFortran.pdfCERTI ONERA 1.3 partial, IEEE 1516 planned C++, Java planned GPL, LGPL EODiSP

Summary and Outlook

SummaryI at present two noteworthy open source RTIs: poRTIco, CERTI→ CERTI

I CERTI well tested RTI, remarkable development site at SavannahI introduction of two new open source projects: MatlabHLA,

libF90HLAI CERTI first RTI with native bindings to Matlab and Fortran

OutlookI completing work at libF90HLAI Simulink-Toolbox on basis of HLA-Toolbox, HLA integration into

other free SCEs (e.g. Octave)I finding bugs, applying patches and looking for help ...

29 / 29