プロジェクト

全般

プロフィール

機能 #3225

同一プロセスのコンポーネント間のデータポート接続で、データ転送をダイレクトに行うようにする

n-andoほぼ9年前に追加. 6年以上前に更新.

ステータス:
担当
優先度:
通常
担当者:
対象バージョン:
開始日:
2015/06/17
期日:
進捗率:

100%

予定工数:

説明

同一プロセスに存在する複数のコンポーネント間のデータ転送においては、

  • マーシャリング
  • バッファリング
  • アンマーシャリング

が行われているが、実際には単にOutPortからInPortの変数にデータを書き込むことができれば効率的である。
複数のRTCが並列に動作していたり、異なる周期で動作する場合などはバッファリングも必要になるケースも考えられるが、例えばECを共有しそれらのコンポーネントの実行がシーケンシャルであることが保証される場合、コンポーネントの実行・データ転送効率を上げる意味でも、OutPort→InPortで直接変数に書き込む機能があればよいのでこれを実装する。

関係しているリビジョン

リビジョン 757 (差分)
win-ei約8年前に追加

Direct data put functionality between data ports has been implemented. refs #3225

リビジョン 801 (差分)
win-ei約8年前に追加

Direct data put functionality between data ports has been implemented. refs #3225

リビジョン 803 (差分)
win-ei約8年前に追加

Added get_configuration function. refs #3225

履歴

#1 n-andoほぼ9年前に更新

仕様

  • ConnectorProfile.properties["dataport.outport.direct_dataput.disable"] != YES の時、または当該プロパティーが設定されていない場合にDirect data put モードにする
  • Direct data-putモードでは、同一プロセス内のInPortとOutPortのpush接続時に、corba_cdrのインターフェースを通すことなく、InPortの変数にOutPortから直接データを書き込む
  • Direct data putモードでは、データが変数に書き込まれた場合にInPort::isNew()=true, InPort::isEmpty()=falseとなり、InPort::read()がよばれた後は、変数およびバッファの状態によりInPort::isNew(),isEmpty()の状態が変化する

実装方法

  • InPort
    • 変数書き込みフラグとミューテックスを追加
    • void write(const DataType&) 関数(OutPortConnectorからコール)を用意し、変数書き込み、フラグtrue代入をロック下で行う
    • 変数書き込みフラグの状態に応じてisNew(),isEmpty()を修正
    • read()関数内で変数書き込みフラグがtrueの場合のロジックを追加
    • InPort変数への参照をミューテックスで保護
  • OutPortConnector
    • InPortのサーバントを与える setInPort() 関数を追加
    • write()関数内にInPortのwrite()関数を呼ぶ static_cast<InPort<DataType>*>(m_directInPort)->write(data); コードを追加
  • OutPortBase
    • コネクタープロファイルのプロパティー (dataport.outport.)direct_dataput.disable を取得。disable=YESなら通常の処理、でなければ以下の処理を行う
    • Push接続時のコネクタ生成ロジック内で、InPortのローカルサーバントを取得する
    • 取得できない場合は、リモートオブジェクトなのでそのまま継続、取得できる場合は、コネクタにInPortのサーバントを渡す (setLocalInPort())
    • サーバント取得ロジック: InPortBase* inport = dynamic_cast<InPortBase*>(poa->reference_to_servant(obj));

#2 win-ei約8年前に更新

  • 進捗率0 から 100 に変更

動作確認

  • ConnectorComp.java に以下を追加。
    CORBA_SeqUtil.push_back(nvholder,
    NVUtil.newNVString("dataport.outport.direct_dataput.disable", "YES"));
    
  • rtc.conf で ConsoleOut をpreload、precreate、preactivateする。
    具体的には以下をrtc.confへ追加する。
    manager.modules.load_path:./RTMExamples/SimpleIO
    manager.modules.preload: ConsoleOut
    manager.components.precreate: ConsoleOut
    
    manager.components.preactivate: ConsoleIn0, ConsoleOut0
    
  • ConsoleIn.sh を起動後、Connector.sh を起動して動作確認

#3 win-ei約8年前に更新

  • 進捗率100 から 50 に変更

#4 katami が6年以上前に更新

動作確認

  • rtc.conf で ConsoleOut をpreload、precreate、preactivateする。
    具体的には以下をrtc.confへ追加する。
    manager.modules.load_path:./RTMExamples/SimpleIO
    manager.modules.preload: ConsoleOut
    manager.components.precreate: ConsoleOut
    
    manager.components.preactivate: ConsoleIn0, ConsoleOut0
    
  • [direct][push][new]
    $ rtcon ./localhost/ubuntu.host_cxt/ConsoleIn0.rtc:out ./localhost/ubuntu.host_cxt/ConsoleOut0.rtc:in -p dataport.interface_type=direct
    
  • [direct][push][flush]
    $ rtcon ./localhost/ubuntu.host_cxt/ConsoleIn0.rtc:out ./localhost/ubuntu.host_cxt/ConsoleOut0.rtc:in -p dataport.interface_type=direct -p dataport.subscription_type=flush
    
  • [direct][push][periodic]
    $ rtcon ./localhost/ubuntu.host_cxt/ConsoleIn0.rtc:out ./localhost/ubuntu.host_cxt/ConsoleOut0.rtc:in -p dataport.interface_type=direct -p dataport.subscription_type=flush
    
  • [direct][pull]
    $ rtcon ./localhost/ubuntu.host_cxt/ConsoleIn0.rtc:out ./localhost/ubuntu.host_cxt/ConsoleOut0.rtc:in -p dataport.interface_type=direct -p dataport.dataflow_type=pull
    

#5 katami が6年以上前に更新

  • ステータス新規 から 担当 に変更
  • 担当者win-ei にセット
  • 進捗率50 から 100 に変更

#6 katami が6年以上前に更新

  • 対象バージョンRELEASE_1_2_0 にセット

他の形式にエクスポート: Atom PDF