The Methods & Tools Special Interest Group met today from 4 pm till 5:30 pm Central European Time.
- Tasks remaining for Work Package 1 of COBIA Phase III
U.S. Environmental Protection Agency (represented by Bill BARRETT), AmsterCHEM (represented by Jasper van BATEN), Bryan Research & Engineering (represented by Michael HLAVINKA), Michel PONS (contractor to CO-LaN as Chief Technology Officer).
Methods & Tools Special Interest Group defined the next tasks in Work Package 1 of Phase III in COBIA development project.
The overall context: a program does nothing unless its instructions are executed by a CPU. A program in execution is called a process. In a computer supporting multiprogramming, memory is subdivided among different processes. Processes run in different memory spaces. CAPE-OPEN is ensuring interoperability of different applications which may or may not execute in different processes.
The scope of Work Package 1 (WP1) is to specify how the data used for method invocations between applications are standardized for transport across process boundaries and to develop the marshalers to conduct this transport.
If most of the tasks in WP1 have been completed, as demonstrated at the CAPE-OPEN 2021 Annual Meeting, a few tasks already defined remain to be done and new tasks have been identified as necessary.
To transport the data used for method invocations by a caller on a callee, the view of the caller to the callee needs to be generated and made available to the caller.
For CAPE-OPEN interfaces, this view, a proxy, is produced from the CAPE-OPEN interface definition language (IDL) by a code generator. The marshaler creates and exposes a proxy for an interface present in the CAPE-OPEN IDL. This proxy knows the methods available on the interface, the parameter data types, the returned value data types, and a mechanism to return the error code indicating whether the call succeeded or nature of the call failure.
Being based on the known CAPE-OPEN IDL, the code of a marshaler can be automatically generated, compiled and made available on a machine as part of the COBIA distribution.
COBIA-based applications may contain non CAPE-OPEN interfaces: on-the-fly generation of non-CAPE-OPEN proxy interfaces is therefore necessary. Prototyping of this implementation was performed early within WP-1, using libffi. The libffi library provides a portable, high level programming interface to various calling conventions. Moving from a prototype to a full-scale implementation was in the initial list of tasks to be performed in WP1 and this task remains to be done.
In developing the generic marshaling functionality within WP1, Transmission Control Protocol/Internet Protocol (TCP/IP) was used. Marshalers using TCP/IP transport protocol have been demonstrated.
TCP/IP is a very flexible protocol that can be used in a variety of scenarios, and wide range of applications at some expense of performance. TCP/IP has overhead related to packaging of data for use in transport in the most general cases. The overhead in TCP/IP provides assurances that the data stream created by the caller is correctly copied to the callee, and the return data stream is received properly. Due to the overhead inherent to the TCP/IP transport protocol and its multiple layers, it is not the most efficient means for marshaling on a single machine. On a single machine, performance can be improved using more direct interactions using a common shared memory accessible by both the callee and caller.
On a single machine, the transport can be simplified because there is no need to package the data for use in a general situation. This can be done using memory written to and accessed by the caller and the callee. Memory-based transport eliminates the overhead required for copying of data between caller and callee. The implemented mechanism memory-based transport on a single machine will be a circular buffer. A circular buffer is a type of first-in/first out (FIFO) buffer that reuses the memory allocated for data storage by circulating back to the start of the memory block when it reaches the end of the memory block. The circular buffer is made thread safe to prevent data races from occurring, which could compromise the transport of data, leading to unpredictable behavior, or deadlocks.
This development corresponds to a new task that Methods & Tools SIG considers necessary for providing the best performance out of COBIA.
Contact Bill BARRETT (representative of US Environmental Protection Agency, leader of the Methods & Tools Special Interest Group) should you wish to join the Methods & Tools Special Interest Group. Its charter is: “Improve integration, and expand utilization of Computer-Aided Process Engineering (CAPE) applications within the enterprise through identification and resolution of existing cross-cutting issues with the CAPE-OPEN platform, develop mechanisms for use of CAPE within other application domains, and incorporate advances in information technology into the CAPE-OPEN platform.”