[openrtm-commit:02841] r3048 - in trunk/OpenRTM-aist: . examples examples/Throughput
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 9月 24日 (日) 01:27:51 JST
Author: n-ando
Date: 2017-09-24 01:27:51 +0900 (Sun, 24 Sep 2017)
New Revision: 3048
Added:
trunk/OpenRTM-aist/examples/Throughput/
trunk/OpenRTM-aist/examples/Throughput/CMakeLists.txt
trunk/OpenRTM-aist/examples/Throughput/Makefile.am
trunk/OpenRTM-aist/examples/Throughput/Throughput.cpp
trunk/OpenRTM-aist/examples/Throughput/Throughput.h
trunk/OpenRTM-aist/examples/Throughput/ThroughputComp.cpp
trunk/OpenRTM-aist/examples/Throughput/cdr_samecomp.sh
trunk/OpenRTM-aist/examples/Throughput/cdr_sameproc.sh
trunk/OpenRTM-aist/examples/Throughput/direct.sh
trunk/OpenRTM-aist/examples/Throughput/rtc.conf
trunk/OpenRTM-aist/examples/Throughput/run.sh
Modified:
trunk/OpenRTM-aist/configure.ac
trunk/OpenRTM-aist/examples/Makefile.am
Log:
[compat,example] Throughput measurement component example added.
Modified: trunk/OpenRTM-aist/configure.ac
===================================================================
--- trunk/OpenRTM-aist/configure.ac 2017-09-22 07:23:15 UTC (rev 3047)
+++ trunk/OpenRTM-aist/configure.ac 2017-09-23 16:27:51 UTC (rev 3048)
@@ -1691,6 +1691,7 @@
examples/SimpleService/Makefile
examples/ExtTrigger/Makefile
examples/Templates/Makefile
+ examples/Throughput/Makefile
examples/tests/Makefile
docs/Makefile
win32/Makefile
Modified: trunk/OpenRTM-aist/examples/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/examples/Makefile.am 2017-09-22 07:23:15 UTC (rev 3047)
+++ trunk/OpenRTM-aist/examples/Makefile.am 2017-09-23 16:27:51 UTC (rev 3048)
@@ -8,10 +8,10 @@
AUTOMAKE_OPTIONS = 1.4
-SUBDIRS = Analyzer Composite ConfigSample SimpleIO SeqIO SimpleService ExtTrigger Templates @UNITTEST@
+SUBDIRS = Analyzer Composite ConfigSample SimpleIO SeqIO SimpleService ExtTrigger Templates Throughput @UNITTEST@
EXTRA_DIST = \
rtc.vcproj.yaml \
rtcdll.vcproj.yaml
-DIST_SUBDIRS = Analyzer Composite ConfigSample SimpleIO SeqIO SimpleService ExtTrigger AutoTest Templates tests
+DIST_SUBDIRS = Analyzer Composite ConfigSample SimpleIO SeqIO SimpleService ExtTrigger AutoTest Templates Throughput tests
Index: trunk/OpenRTM-aist/examples/Throughput
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput 2017-09-22 07:23:15 UTC (rev 3047)
+++ trunk/OpenRTM-aist/examples/Throughput 2017-09-23 16:27:51 UTC (rev 3048)
Property changes on: trunk/OpenRTM-aist/examples/Throughput
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,3 ##
+Makefile
+Makefile.in
+
Added: trunk/OpenRTM-aist/examples/Throughput/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/CMakeLists.txt (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/CMakeLists.txt 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,62 @@
+cmake_minimum_required (VERSION 2.6)
+
+project (Throughput)
+
+
+link_directories(${ORB_LINK_DIR})
+include_directories(
+ ${RTM_INCLUDE_DIR}
+ ${ORB_INCLUDE_DIR}
+ )
+
+ADD_DEFINITIONS(${ORB_C_FLAGS_LIST})
+
+
+
+set(target Throughput)
+
+set(srcs Throughput.cpp Throughput.h)
+set(standalone_srcs ThroughputComp.cpp ${srcs})
+
+
+if(VXWORKS AND NOT RTP)
+ set(standalone_srcs ${standalone_srcs} ${CMAKE_SOURCE_DIR}/src/lib/rtm/DataFlowComponentBase.cpp)
+ set(libs ${RTCSKEL_PROJECT_NAME})
+
+ add_executable(${target} ${standalone_srcs})
+ target_link_libraries(${target} ${libs})
+ add_dependencies(${target} ${RTM_PROJECT_NAME})
+
+ install(TARGETS ${target} RUNTIME DESTINATION examples)
+else()
+ if(VXWORKS)
+ set(libs ${RTM_PROJECT_NAME} ${ORB_LIBRARIES} ${COIL_PROJECT_NAME} ${RTCSKEL_PROJECT_NAME})
+ else(VXWORKS)
+ set(libs ${RTM_PROJECT_NAME} ${ORB_LIBRARIES} ${COIL_PROJECT_NAME})
+ endif(VXWORKS)
+
+ add_executable(${target}Comp ${standalone_srcs})
+ target_link_libraries(${target}Comp ${libs} ${RTM_LINKER_OPTION})
+ add_dependencies(${target}Comp ${RTM_PROJECT_NAME})
+
+ add_library(${target} SHARED ${srcs})
+ target_link_libraries(${target} ${libs} ${RTM_LINKER_OPTION})
+ add_dependencies(${target} ${RTM_PROJECT_NAME})
+ set_target_properties(${target} PROPERTIES PREFIX "")
+
+ install(TARGETS ${target}Comp RUNTIME DESTINATION examples)
+ if(WIN32)
+ install(TARGETS ${target} RUNTIME DESTINATION examples)
+ else(WIN32)
+ install(TARGETS ${target} LIBRARY DESTINATION examples)
+ endif(WIN32)
+endif()
+
+
+if(VXWORKS)
+ if(RTP)
+ set_target_properties(${target}Comp PROPERTIES SUFFIX ".vxe")
+ else(RTP)
+ set_target_properties(${target} PROPERTIES SUFFIX ".out")
+ endif(RTP)
+endif(VXWORKS)
Added: trunk/OpenRTM-aist/examples/Throughput/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/Makefile.am (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/Makefile.am 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,126 @@
+## -*- Makefile -*-
+##---------------------------------------------------------------------------
+## Makefile.am for performance Throughput components
+##
+## $Id$
+##---------------------------------------------------------------------------
+
+AUTOMAKE_OPTIONS = 1.9
+
+AM_CPPFLAGS=-I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/coil/include -I$(top_srcdir)/src/lib/rtm/idl
+AM_LDFLAGS=-L$(top_builddir) -L$(top_builddir)/src/lib/rtm -L$(top_builddir)/src/lib/rtm/idl
+
+#------------------------------------------------------------
+# Targets
+#------------------------------------------------------------
+# Targets directories
+exampledir = $(rtm_exampledir)
+socompdir = $(exampledir)/rtc
+sourcedir = $(exampledir)/src/Throughput
+
+# Loadable RTCs
+socomp_LTLIBRARIES = Throughput.la
+
+Throughput_la_SOURCES = Throughput.cpp Throughput.h
+Throughput_la_LDFLAGS = -module
+Throughput_la_FLAGS = -L$(top_builddir)/src/lib/rtm/.lib
+Throughput_la_LIBADD = $(top_builddir)/src/lib/rtm/libRTC.la \
+ $(top_builddir)/src/lib/coil/lib/libcoil.la
+
+# Standalone RTCs
+example_PROGRAMS = ThroughputComp
+example_DATA = rtc.conf
+
+ThroughputComp_SOURCES = ThroughputComp.cpp
+ThroughputComp_DEPENDENCIES = Throughput.la
+ThroughputComp_LDFLAGS = -L$(top_builddir)/src/lib/rtm/.libs
+ThroughputComp_LDADD = Throughput.o \
+ $(top_builddir)/src/lib/rtm/libRTC.la \
+ $(top_builddir)/src/lib/coil/lib/libcoil.la
+
+# Example sources
+source_DATA = $(ALL_SRC) $(EXTRA_DIST)
+
+#------------------------------------------------------------
+# Extra distributed files
+#------------------------------------------------------------
+EXTRA_DIST = \
+ CMakeLists.txt \
+ run.sh \
+ direct.sh \
+ cdr_samecomp.sh \
+ cdr_sameproc.sh \
+ rtc.conf
+
+ALL_SRC = \
+ ThroughputComp.cpp \
+ Throughput.cpp \
+ Throughput.h
+
+
+#------------------------------------------------------------
+# File list for deb/ports packages
+#------------------------------------------------------------
+lst:
+ echo $(ALL_SRC) > src.lst
+ echo $(EXTRA_DIST) > other.lst
+
+#------------------------------------------------------------
+# Visual Studio Project
+#------------------------------------------------------------
+win32_builddir=$(top_builddir)/win32/OpenRTM-aist/examples/SimpleIO
+
+vcproj: vc9proj vcxproj
+
+vc9proj:
+ $(top_builddir)/build/vcprojtool.py vcproj \
+ --type EXE \
+ --vcversion "9.00" \
+ --projectname "ThroughputComp" \
+ --version $(RTM_VERSION) \
+ --out $(win32_builddir)/Throughput_vc9.vcproj \
+ --yaml ../rtc.vcproj.yaml \
+ --source Throughput.cpp ThroughputComp.cpp \
+ --header Throughput.h
+ qkc -O- -sm $(win32_builddir)/Throughput_vc9.vcproj
+ $(top_builddir)/build/vcprojtool.py vcproj \
+ --type DLL \
+ --vcversion "9.00" \
+ --projectname "Throughput" \
+ --version $(RTM_VERSION) \
+ --out $(win32_builddir)/ThroughputDll_vc9.vcproj \
+ --yaml ../rtcdll.vcproj.yaml \
+ --source Throughput.cpp \
+ --header Throughput.h
+ qkc -O- -sm $(win32_builddir)/ThroughputDll_vc9.vcproj
+
+vcxproj:
+ for ver in $(VC_VERSION); do \
+ $(top_builddir)/build/vcxprojtool.py vcxproj \
+ --type EXE \
+ --vcversion "$${ver}.00" \
+ --projectname "ThroughputComp" \
+ --version $(RTM_VERSION) \
+ --out $(win32_builddir)/Throughput_vc$${ver}.vcxproj \
+ --yaml ../rtc.vcproj.yaml \
+ --source Throughput.cpp ThroughputComp.cpp \
+ --header Throughput.h ; \
+ qkc -O- -sm $(win32_builddir)/Throughput_vc$${ver}.vcxproj ; \
+ $(top_builddir)/build/vcxprojtool.py vcxproj \
+ --type DLL \
+ --vcversion "$${ver}.00" \
+ --projectname "Throughput" \
+ --version $(RTM_VERSION) \
+ --out $(win32_builddir)/ThroughputDll_vc$${ver}.vcxproj \
+ --yaml ../rtcdll.vcproj.yaml \
+ --source Throughput.cpp \
+ --header Throughput.h ; \
+ qkc -O- -sm $(win32_builddir)/ThroughputDll_vc$${ver}.vcxproj ; \
+ done
+
+dist-hook: lst vcproj
+
+clean-local:
+ rm -f *.bak *.rpo *.sym lib*.*_pure_*
+ rm -f *.dat *.lst *.core *~ *.so *.log
+ rm -f Makefile.old
Property changes on: trunk/OpenRTM-aist/examples/Throughput/Makefile.am
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/OpenRTM-aist/examples/Throughput/Throughput.cpp
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/Throughput.cpp (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/Throughput.cpp 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,521 @@
+// -*- C++ -*-
+/*!
+ * @file Throughput.cpp
+ * @brief Clock Throughput Component
+ * @date $Date$
+ *
+ * @author Noriaki Ando n-ando at aist.go.jp
+ *
+ * $Id$
+ */
+
+#include "Throughput.h"
+#include <math.h>
+#include <coil/Async.h>
+
+#define DEBUG 1
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* analyzer_spec[] =
+ {
+ "implementation_id", "Throughput",
+ "type_name", "Throughput",
+ "description", "Dataport throughput measurement component",
+ "version", "1.0.0",
+ "vendor", "AIST",
+ "category", "example",
+ "activity_type", "PERIODIC",
+ "kind", "DataFlowComponent",
+ "max_instance", "1",
+ "language", "C++",
+ "lang_type", "compile",
+ // Configuration variables
+ "conf.default.datatype", "double",
+ "conf.default.outputfile", "test.dat",
+ "conf.default.increment", "100",
+ "conf.default.sleep_time", "0.1",
+ "conf.default.mode", "logincr",
+ "conf.default.maxsize", "1000000",
+ "conf.default.maxsend", "1000",
+ "conf.default.maxsample", "100",
+
+ // Widget
+ "conf.__widget__.datatype", "radio",
+ "conf.__widget__.outputfile", "text",
+ "conf.__widget__.increment", "text",
+ "conf.__widget__.sleep_time", "text",
+ "conf.__widget__.mode", "radio",
+ "conf.__widget__.maxsize", "text",
+ "conf.__widget__.maxsend", "text",
+ "conf.__widget__.maxsample", "text",
+ // Constraints
+ "conf.__constraints__.datatype", "(octet,short,long,float,double)",
+ "conf.__constraints__.mode", "(logincr,incr,const)",
+
+ "conf.__type__.datatype", "string",
+ "conf.__type__.outputfile", "string",
+ "conf.__type__.increment", "long",
+ "conf.__type__.sleep_time", "double",
+ "conf.__type__.mode", "string",
+ "conf.__type__.maxsize", "long",
+ "conf.__type__.maxsend", "long",
+ "conf.__type__.maxsample", "long",
+
+ ""
+ };
+// </rtc-template>
+
+
+
+/*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+Throughput::Throughput(RTC::Manager* manager)
+ // <rtc-template block="initializer">
+ : RTC::DataFlowComponentBase(manager),
+ // Configuration parameters
+ m_datatype("double"), m_outputfile("throughput.dat"),
+ m_increment(100), m_mode("logincr"), m_maxsize(100000000),
+ m_maxsend(1000), m_maxsample(100),
+
+ // InPort, OutPort
+ m_inOctetIn("in", m_inOctet), m_outOctetOut("out", m_outOctet),
+ m_inShortIn("in", m_inShort), m_outShortOut("out", m_outShort),
+ m_inLongIn("in", m_inLong), m_outLongOut ("out", m_outLong),
+ m_inFloatIn("in", m_inFloat), m_outFloatOut("out", m_outFloat),
+ m_inDoubleIn("in", m_inDouble), m_outDoubleOut("out", m_outDouble),
+
+ // Other private members
+ m_fs(),
+ m_datasize(1),
+ m_record(m_maxsample),
+ m_sendcount(0),
+ m_logmulcnt(0)
+ // </rtc-template>
+{
+}
+
+/*!
+ * @brief destructor
+ */
+Throughput::~Throughput()
+{
+}
+
+
+
+RTC::ReturnCode_t Throughput::onInitialize()
+{
+ // Registration: InPort/OutPort/Service
+ // <rtc-template block="registration">
+ // Set InPort buffers
+ m_datatype = getProperties()["conf.default.datatype"];
+ m_filesuffix = getProperties()["conf.default.filesuffix"];
+ std::string datatype = coil::normalize(m_datatype);
+ if(datatype == "octet")
+ {
+ addInPort("in", m_inOctetIn);
+ m_inOctetIn.
+ addConnectorDataListener(ON_BUFFER_WRITE,
+ new DataListener<RTC::TimedOctetSeq>(this));
+ m_inOctetIn.addConnectorListener(ON_CONNECT,
+ new ConnListener(this));
+ addOutPort("out", m_outOctetOut);
+ m_varsize = sizeof(CORBA::Octet);
+ }
+ else if (datatype == "short")
+ {
+ addInPort("in", m_inShortIn);
+ m_inShortIn.
+ addConnectorDataListener(ON_BUFFER_WRITE,
+ new DataListener<RTC::TimedShortSeq>(this));
+ m_inShortIn.addConnectorListener(ON_CONNECT,
+ new ConnListener(this));
+ addOutPort("out", m_outShortOut);
+ m_varsize = sizeof(CORBA::Short);
+ }
+ else if (datatype == "long")
+ {
+ addInPort("in", m_inLongIn);
+ m_inLongIn.
+ addConnectorDataListener(ON_BUFFER_WRITE,
+ new DataListener<RTC::TimedLongSeq>(this));
+ m_inLongIn.addConnectorListener(ON_CONNECT,
+ new ConnListener(this));
+ addOutPort("out", m_outLongOut);
+ m_varsize = sizeof(CORBA::Long);
+ }
+ else if (datatype == "float")
+ {
+ addInPort("in", m_inFloatIn);
+ m_inFloatIn.
+ addConnectorDataListener(ON_BUFFER_WRITE,
+ new DataListener<RTC::TimedFloatSeq>(this));
+ m_inFloatIn.addConnectorListener(ON_CONNECT,
+ new ConnListener(this));
+ addOutPort("out", m_outFloatOut);
+ m_varsize = sizeof(CORBA::Float);
+ }
+ else if (datatype == "double")
+ {
+ addInPort("inDouble", m_inDoubleIn);
+ m_inDoubleIn.
+ addConnectorDataListener(ON_BUFFER_WRITE,
+ new DataListener<RTC::TimedDoubleSeq>(this));
+ m_inDoubleIn.addConnectorListener(ON_CONNECT,
+ new ConnListener(this));
+ addOutPort("out", m_outDoubleOut);
+ m_varsize = sizeof(CORBA::Double);
+ }
+ else
+ {
+ return RTC::RTC_ERROR;
+ }
+ std::cout << "varsize: " << m_varsize << std::endl;
+ // <rtc-template block="bind_config">
+ // Bind variables and configuration variable
+ bindParameter("datatype", m_datatype, "double");
+ bindParameter("outputfile", m_outputfile, "test.dat");
+ bindParameter("increment", m_increment, "100");
+ bindParameter("sleep_time", m_sleep_time, "0.1");
+ bindParameter("mode", m_mode, "logincr");
+ bindParameter("maxsize", m_maxsize, "100000");
+ bindParameter("maxsend", m_maxsend, "1000");
+ bindParameter("maxsample", m_maxsample, "100");
+ // </rtc-template>
+
+ m_record.reserve(m_maxsample);
+// for (size_t i(0); i < m_maxsample; ++i)
+// {
+// m_record[i] = coil::TimeValue(0, 0);
+// }
+ return RTC::RTC_OK;
+}
+
+RTC::ReturnCode_t Throughput::onActivated(RTC::UniqueId ec_id)
+{
+ m_datasize = 1;
+ setDataSize(m_datasize);
+
+ m_sendcount = 0;
+ m_logmulcnt = 0;
+
+ return RTC::RTC_OK;
+}
+
+RTC::ReturnCode_t Throughput::onDeactivated(RTC::UniqueId ec_id)
+{
+ if (m_fs.is_open()) { m_fs.close(); }
+
+ m_datasize = 1;
+ setDataSize(m_datasize);
+
+ m_sendcount = 0;
+ m_logmulcnt = 0;
+ coil::Async* async(coil::AsyncInvoker(this, std::mem_fun(&Throughput::exit)));
+ async->invoke();
+ return RTC::RTC_OK;
+}
+
+RTC::ReturnCode_t Throughput::onExecute(RTC::UniqueId ec_id)
+{
+ static double logmul[] = {2.0, 2.5, 2.0};
+
+ // Setting data length
+ if (getDataSize() != m_datasize) { setDataSize(m_datasize); }
+ writeData();
+ m_sendcount++;
+
+ if (m_sendcount % m_maxsample != 0) { return RTC::RTC_OK; }
+
+ // increment data size
+ if (m_mode == "logincr")
+ {
+#ifdef DEBUG
+ std::cout << "sendcount: " << m_sendcount;
+ std::cout << "\tmaxsample: " << m_maxsample;
+ std::cout << "\tlogmulcnt%3: " << m_logmulcnt % 3;
+ std::cout << "\tlogmul[]: " << logmul[m_logmulcnt % 3] << std::endl;
+#endif // DEBUG
+ m_datasize *= logmul[m_logmulcnt % 3];
+ m_logmulcnt++;
+ }
+ else if (m_mode == "incr")
+ {
+ m_datasize += m_increment;
+ }
+ else
+ {
+ if((long)m_sendcount > m_maxsend)
+ {
+ exit();
+ return RTC::RTC_OK;
+ }
+ }
+#ifdef DEBUG
+ std::cout << "######### data length changed #########" << std::endl;
+ std::cout << "length(): " << getDataSize();
+ std::cout << "\tm_datasize: " << m_datasize;
+ std::cout << "\tm_maxsize: " << m_maxsize;
+ std::cout << "\tsendcount: " << m_sendcount << std::endl;
+#endif // DEBUG
+
+ coil::sleep(0.5); // sleep for calculating measurement statistics
+
+ // calculation is triggered data size change
+ // to finish the last calculation, size 0 array is sent
+ if(m_datasize > m_maxsize)
+ {
+ std::cout << "Exiting" << std::endl;
+ setDataSize(1); // to finalize measurement
+ writeData();
+ deactivate(ec_id);
+ }
+ return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t Throughput::onAborting(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Throughput::onError(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Throughput::onReset(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Throughput::onStateUpdate(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Throughput::onRateChanged(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+void Throughput::writeData()
+{
+ std::string datatype = coil::normalize(m_datatype);
+ if(datatype == "octet")
+ {
+ setTimestamp(m_outOctet);
+ m_outOctetOut.write();
+ }
+ else if (datatype == "short")
+ {
+ setTimestamp(m_outShort);
+ m_outShortOut.write();
+ }
+ else if (datatype == "long")
+ {
+ setTimestamp(m_outLong);
+ m_outLongOut.write();
+ }
+ else if (datatype == "float")
+ {
+ setTimestamp(m_outFloat);
+ m_outFloatOut.write();
+ }
+ else if (datatype == "double")
+ {
+ setTimestamp(m_outDouble);
+ m_outDoubleOut.write();
+ }
+}
+
+void Throughput::setDataSize(CORBA::ULong size)
+{
+ std::string datatype = coil::normalize(m_datatype);
+ if(datatype == "octet")
+ {
+ m_outOctet.data.length(size);
+ }
+ else if (datatype == "short")
+ {
+ m_outShort.data.length(size);
+ }
+ else if (datatype == "long")
+ {
+ m_outLong.data.length(size);
+ }
+ else if (datatype == "float")
+ {
+ m_outFloat.data.length(size);
+ }
+ else if (datatype == "double")
+ {
+ m_outDouble.data.length(size);
+ }
+}
+CORBA::ULong Throughput::getDataSize()
+{
+ std::string datatype = coil::normalize(m_datatype);
+ if(datatype == "octet")
+ {
+ return m_outOctet.data.length();
+ }
+ else if (datatype == "short")
+ {
+ return m_outShort.data.length();
+ }
+ else if (datatype == "long")
+ {
+ return m_outLong.data.length();
+ }
+ else if (datatype == "float")
+ {
+ return m_outFloat.data.length();
+ }
+ else if (datatype == "double")
+ {
+ return m_outDouble.data.length();
+ }
+ return 0;
+}
+
+void Throughput::receiveData(const RTC::Time &tm, const CORBA::ULong seq_length)
+{
+ static size_t size(0);
+ static size_t record_num(0);
+ static size_t record_ptr(0);
+
+ // data arrived -> getting time
+ coil::TimeValue received_time(coil::gettimeofday());
+ if (size == 0) { size = seq_length; }
+
+ // calculate latency statistics
+#ifdef DEBUG
+ std::cout << "Time: " << tm.sec << "[s]\t" << tm.nsec << "[ns]" << std::endl;
+ std::cout << "length(): " << seq_length;
+ std::cout << "\tsize: " << size;
+ std::cout << "\trecord_num: " << record_num;
+ std::cout << "\trecord_ptr: " << record_ptr << std::endl;
+#endif // DEBUG
+
+ if (seq_length != size && record_num != 0)
+ {
+ double max_latency(0.0), min_latency(10000.0), mean_latency(0.0);
+ double variance(0.0), stddev(0.0), throughput(0.0);
+ double sum(0.0), sq_sum(0.0);
+ size_t record_len = record_num > record_ptr ? m_maxsample : record_ptr;
+
+#ifdef DEBUG
+ std::cout << "%%%%% record_num: " << record_num;
+ std::cout << " record_ptr: " << record_ptr;
+ std::cout << " record_len: " << record_len;
+ std::cout << " maxsample: " << m_maxsample << std::endl;
+#endif // DEBUG
+
+ for (size_t i(0); i < record_len; ++i)
+ {
+ double tmp(m_record[i]);
+ sum += tmp;
+ sq_sum += tmp * tmp;
+ if (tmp > max_latency) { max_latency = tmp; }
+ else if (tmp < min_latency) { min_latency = tmp; }
+ }
+ mean_latency = sum / record_len;
+ variance = (sq_sum / record_len) - (mean_latency * mean_latency);
+ stddev = sqrt(variance);
+ // Time tm (long, long) = 4byte + 4byte [Mbps]
+ throughput = ((((size * m_varsize) + 8) * 8) / mean_latency) / (1024 * 1024);
+
+ // size[byte], min[s], max[s], mean[s], stddev[s], throughpiut[Mbps]
+ m_fs << size << "\t";
+ m_fs << min_latency << "\t" << max_latency << "\t";
+ m_fs << mean_latency << "\t" << stddev << "\t";
+ m_fs << throughput << std::endl;
+
+#ifdef DEBUG
+ std::cout << "==============================" << std::endl;
+ std::cout << size << "\t";
+ std::cout << min_latency << "\t" << max_latency << "\t";
+ std::cout << mean_latency << "\t" << stddev << "\t";
+ std::cout << throughput << std::endl;
+#endif // DEBUG
+ // reset size/index variables
+ record_num = 0;
+ record_ptr = 0;
+ if (seq_length < size)
+ {
+ coil::Async* async;
+ async = coil::AsyncInvoker(this, std::mem_fun(&Throughput::exit));
+ async->invoke();
+ }
+ }
+ // measuring latency
+ coil::TimeValue send_time(tm.sec, tm.nsec/1000);
+ m_record[record_ptr] = received_time - send_time;
+ size = seq_length;
+ record_ptr++; record_num++;
+ if ((long)record_ptr == m_maxsample) { record_ptr = 0; }
+ return;
+}
+
+void Throughput::setConnectorProfile(const RTC::ConnectorInfo &info)
+{
+ m_outputfile = m_datatype + "-" + info.properties["interface_type"]
+ + m_filesuffix + ".dat";
+
+ if (!m_fs.is_open())
+ {
+ m_fs.open(m_outputfile.c_str(), std::ios::out);
+ if (!m_fs.is_open())
+ {
+ std::cerr << "File open failed!!" << std::endl;
+ return;
+ }
+ }
+
+ // print connector profile as comment lines
+ m_fs << "# Profile::name: " << info.name << std::endl;
+ m_fs << "# Profile::id: " << info.id << std::endl;
+ m_fs << "# Profile::properties: " << std::endl;
+ std::stringstream ss;
+ ss << info.properties;
+ coil::vstring propv = coil::split(ss.str(), "\n");
+ for (size_t i(0); i < propv.size(); ++i)
+ {
+ m_fs << "# " << propv[i] << std::endl;
+ }
+
+ // print header
+ m_fs << "size[byte]\tmin[s]\tmax[s]\tmean[s]\tstddev[s]\tthroughpiut[Mbps]";
+ m_fs << std::endl;
+ m_record.resize(m_maxsample);
+
+}
+
+
+extern "C"
+{
+
+ void ThroughputInit(RTC::Manager* manager)
+ {
+ coil::Properties profile(analyzer_spec);
+ manager->registerFactory(profile,
+ RTC::Create<Throughput>,
+ RTC::Delete<Throughput>);
+ }
+
+};
+
+
Property changes on: trunk/OpenRTM-aist/examples/Throughput/Throughput.cpp
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/OpenRTM-aist/examples/Throughput/Throughput.h
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/Throughput.h (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/Throughput.h 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,489 @@
+// -*- C++ -*-
+/*!
+ * @file Throughput.h
+ * @brief Clock Throughput Component
+ * @date $Date$
+ *
+ * @author n-ando n-ando at aist.go.jp
+ *
+ * $Id$
+ */
+
+#ifndef THROUGHPUT_H
+#define THROUGHPUT_H
+
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/idl/ExtendedDataTypesSkel.h>
+#include <rtm/idl/InterfaceDataTypesSkel.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="port_stub_h">
+// </rtc-template>
+
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+
+#include <vector>
+#include <fstream>
+
+using namespace RTC;
+
+
+class Throughput;
+
+/*!
+ * @class Throughput
+ * @brief Clock Throughput Component
+ *
+ * 時間計測用RTC
+ *
+ * データポートのスループットを計測するコンポーネント。interface_type,
+ * subscription_type 等 ConnectorProfile パラメータやデータサイズ、サン
+ * プル数などを変更して、その際の転送時間(最大、最小、平均、標準偏差)
+ * およびスループットを測定してファイルに記録することができる。
+ *
+ * 基本的には、以下の(a)や(b)のような接続形態で使用する。
+ * <pre>
+ * +-----------+
+ * | ______ | ______ ______
+ * +->|_____|>-+ >|_____|>-->|_____|>
+ * (a) (b)
+ * </pre>
+ * 同一コンポーネント内では(a)、同一プロセス内、同一ノード内のスループッ
+ * トは (a)または(b)、異なるノード間のスループットを計測する際は (b)の
+ * 接続形態で計測する。計測は以下の手順で行う。
+ *
+ * -# コンポーネントを起動する
+ * -# コンフィグレーションパラメータを設定する
+ * -# 必要なコネクタプロファイルを設定してポートを接続する
+ * -# コンポーネントをアクティベートする
+ *
+ * 計測結果はデータを受け取ったコンポーネントがファイルに記録する。
+ *
+ * * コンフィギュレーションパラメータ
+ *
+ * - mode: 計測モード名。logincr, incr, const から選択可能。
+ * - logincr: logスケールでデータ数を増加させ計測。実際には、1, 2, 5,
+ * 10, .. といった間隔でデータ数を増加させ、logスケールでプ
+ * ロットした際にほぼ等間隔となるように計測する。
+ * - incr: incrementパラメータで指定されたバイト数で、一定間隔でデータ
+ * 数を増加させる。
+ * - const: データは増加させず一定サイズでスループットを計測する。
+ *
+ * - outputfile: 出力ファイル名。onActivated時、またはデータ受信時にファ
+ * イルがオープンされるので、それ以降にパラメータを設定し
+ * た場合は反映されない。
+ * - increment: データ増分。mode が incr の場合のデータ増分を byte で指定する。
+ *
+ * - maxsize: 最大データ個数を指定する。送信するシーケンスデータのサイ
+ * ズを指定する。実際のデータサイズは、この個数に1データ当た
+ * りのバイト数をかけたものとなる。
+ * - maxsend: 最大送信数。データ送信回数の最大値を指定する。モードが
+ * logincr, incr の場合、データサイズ毎に maxsend 回数データ
+ * を送信する。
+ * - maxsample: 最大サンプリング数。データを受信し、統計情報を計算する
+ * 際の最大サンプル数を指定する。データ送信側の送信数がサン
+ * プル数より少ない場合、受信したサンプル数で統計情報を計算
+ * する。データ送信側の送信数がサンプル数より多い場合、古い
+ * 情報は破棄され、最新の maxsample 個の計測データから統計情
+ * 報を計算する。
+ *
+ *
+ */
+class Throughput
+ : public RTC::DataFlowComponentBase
+{
+ public:
+ /*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+ Throughput(RTC::Manager* manager);
+
+ /*!
+ * @brief destructor
+ */
+ ~Throughput();
+
+ // <rtc-template block="public_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="public_operation">
+
+ // </rtc-template>
+
+ /***
+ *
+ * The initialize action (on CREATED->ALIVE transition)
+ * formaer rtc_init_entry()
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onInitialize();
+
+ /***
+ *
+ * The finalize action (on ALIVE->END transition)
+ * formaer rtc_exiting_entry()
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onFinalize();
+
+ /***
+ *
+ * The startup action when ExecutionContext startup
+ * former rtc_starting_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The shutdown action when ExecutionContext stop
+ * former rtc_stopping_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The activated action (Active state entry action)
+ * former rtc_active_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The deactivated action (Active state exit action)
+ * former rtc_active_exit()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The execution action that is invoked periodically
+ * former rtc_active_do()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The aborting action when main logic error occurred.
+ * former rtc_aborting_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The error action in ERROR state
+ * former rtc_error_do()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The reset action that is invoked resetting
+ * This is same but different the former rtc_init_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The state update action that is invoked after onExecute() action
+ * no corresponding operation exists in OpenRTm-aist-0.2.0
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The action that is invoked when execution context's rate is changed
+ * no corresponding operation exists in OpenRTm-aist-0.2.0
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+ void writeData();
+ void setDataSize(CORBA::ULong size);
+ CORBA::ULong getDataSize();
+ void receiveData(const RTC::Time &tm, const CORBA::ULong seq_length);
+ void setConnectorProfile(const RTC::ConnectorInfo& info);
+
+ protected:
+ // <rtc-template block="protected_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="protected_operation">
+
+ // </rtc-template>
+
+ // Configuration variable declaration
+ // <rtc-template block="config_declare">
+ /*!
+ * データ型
+ * - Name: datatype
+ * - DefaultValue: double
+ */
+ std::string m_datatype;
+ /*!
+ * 出力ファイル名
+ * - Name: outputfile outputfile
+ * - DefaultValue: test.dat
+ */
+ std::string m_outputfile;
+ std::string m_filesuffix;
+ /*!
+ * データ増分
+ * - Name: increment increment
+ * - DefaultValue: 100
+ */
+ int m_increment;
+ /*!
+ * 内部で待機する時間
+ * - Name: sleep_time sleep_time
+ * - DefaultValue: 0.01
+ */
+ double m_sleep_time;
+ /*!
+ * 通信データ量を一定値(const)にするか、徐々に増加する値(increase)に
+ * するかの設定
+ *
+ * - Name: mode mode
+ * - DefaultValue: const
+ */
+ std::string m_mode;
+ /*!
+ * 通信データ量を徐々に増やすモードの場合最大データサイズ
+ * これを超えるとエラー状態に遷移
+ * - Name: maxsize maxsize
+ * - DefaultValue: 10000000
+ */
+ long m_maxsize;
+
+ /*!
+ * mode=constの時のデータ送信回数の最大値
+ *
+ * - Name: maxsend maxsend
+ * - DefaultValue: 1000
+ */
+ long m_maxsend;
+
+ /*!
+ * 1データセットごとの最大サンプル数
+ *
+ * - Name: maxsize maxsample
+ * - DefaultValue: 100
+ */
+ long m_maxsample;
+
+ // </rtc-template>
+
+ // OutPort, InPort declaration
+ RTC::TimedOctetSeq m_inOctet;
+ RTC::TimedOctetSeq m_outOctet;
+
+ RTC::TimedShortSeq m_inShort;
+ RTC::TimedShortSeq m_outShort;
+
+ RTC::TimedLongSeq m_inLong;
+ RTC::TimedLongSeq m_outLong;
+
+ RTC::TimedFloatSeq m_inFloat;
+ RTC::TimedFloatSeq m_outFloat;
+
+ RTC::TimedDoubleSeq m_inDouble;
+ RTC::TimedDoubleSeq m_outDouble;
+
+ InPort<RTC::TimedOctetSeq> m_inOctetIn;
+ OutPort<RTC::TimedOctetSeq> m_outOctetOut;
+
+ InPort<RTC::TimedShortSeq> m_inShortIn;
+ OutPort<RTC::TimedShortSeq> m_outShortOut;
+
+ InPort<RTC::TimedLongSeq> m_inLongIn;
+ OutPort<RTC::TimedLongSeq> m_outLongOut;
+
+ InPort<RTC::TimedFloatSeq> m_inFloatIn;
+ OutPort<RTC::TimedFloatSeq> m_outFloatOut;
+
+ InPort<RTC::TimedDoubleSeq> m_inDoubleIn;
+ OutPort<RTC::TimedDoubleSeq> m_outDoubleOut;
+
+
+ // CORBA Port declaration
+ // <rtc-template block="corbaport_declare">
+
+ // </rtc-template>
+
+ // Service declaration
+ // <rtc-template block="service_declare">
+
+ // </rtc-template>
+
+ // Consumer declaration
+ // <rtc-template block="consumer_declare">
+
+ // </rtc-template>
+
+
+
+ private:
+ // file output stream
+ std::ofstream m_fs;
+
+ //============================================================
+ // Time measurement statistics data
+ // data size to be send
+ long m_datasize;
+ std::vector<coil::TimeValue> m_record;
+
+ // received data store
+ size_t m_sendcount;
+ size_t m_logmulcnt;
+ size_t m_varsize;
+ // <rtc-template block="private_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="private_operation">
+
+ // </rtc-template>
+
+};
+
+template <class DataType>
+class DataListener
+ : public ConnectorDataListenerT<DataType>
+{
+public:
+ DataListener(Throughput *comp) : m_comp(comp) {};
+ virtual ~DataListener() {};
+ virtual void operator()(const ConnectorInfo& info,
+ const DataType& data)
+ {
+ m_comp->receiveData(data.tm, data.data.length());
+ }
+ Throughput* m_comp;
+};
+
+class ConnListener
+ : public ConnectorListener
+{
+public:
+ ConnListener(Throughput *comp) : m_comp(comp) {}
+ virtual ~ConnListener() {}
+ virtual void operator()(const ConnectorInfo& info)
+ {
+// Connector Listener: ON_CONNECT
+// Profile::name: ConsoleIn0.out_ConsoleOut0.in
+// Profile::id: 2cf0daa4-76d8-4e74-b734-98a683e7fe5e
+// Profile::properties:
+// - data_type: IDL:RTC/TimedLong:1.0
+// - interface_type: corba_cdr
+// - dataflow_type: push
+// - subscription_type: flush
+// - publisher
+// - push_policy: all
+// - serializer
+// - cdr
+// - endian: little,big
+// - corba_cdr
+// - inport_ior: IOR:010000001a00000049444c3a4f70656e52544d2f496e506f72744364723a312e30000000010000000000000064000000010102000d00000031302e3231312e35352e3138000092bb0e000000fea5d4c259000007de000000000400000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
+// - consumer:
+
+ std::cout << "------------------------------" << std::endl;
+ std::cout << " Connected !!" <<std::endl;
+ std::cout << "------------------------------" << std::endl;
+ std::cout << "Profile::name: " << info.name << std::endl;
+ std::cout << "Profile::id: " << info.id << std::endl;
+ std::cout << "Profile::properties: " << std::endl;
+ std::cout << info.properties;
+ std::cout << std::endl;
+ std::cout << "------------------------------" << std::endl;
+ m_comp->setConnectorProfile(info);
+ };
+ Throughput* m_comp;
+};
+
+
+extern "C"
+{
+ DLL_EXPORT void ThroughputInit(RTC::Manager* manager);
+};
+
+#endif // THROUGHPUT_H
Property changes on: trunk/OpenRTM-aist/examples/Throughput/Throughput.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/OpenRTM-aist/examples/Throughput/ThroughputComp.cpp
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/ThroughputComp.cpp (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/ThroughputComp.cpp 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+/*!
+ * @file ThroughputComp.cpp
+ * @brief Standalone component
+ * @date $Date$
+ *
+ * @author Noriaki Ando n-ando at aist.go.jp
+ *
+ * $Id$
+ */
+
+#include <rtm/Manager.h>
+#include <iostream>
+#include <string>
+#include <stdlib.h>
+#include "Throughput.h"
+
+#if defined(RTM_OS_VXWORKS) && not defined(__RTP__)
+int analyzer_main()
+{
+ RTC::Manager* manager = &RTC::Manager::instance();
+ RTC::RtcBase* comp;
+ ThroughputInit(manager);
+ comp = manager->createComponent("Throughput");
+ if(comp)
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+}
+#else
+void MyModuleInit(RTC::Manager* manager)
+{
+ ThroughputInit(manager);
+ RTC::RtcBase* comp;
+
+ // Create a component
+ comp = manager->createComponent("Throughput");
+
+ if (comp==NULL)
+ {
+ std::cerr << "Component create failed." << std::endl;
+ abort();
+ }
+
+ // Example
+ // The following procedure is examples how handle RT-Components.
+ // These should not be in this function.
+
+ // Get the component's object reference
+// RTC::RTObject_var rtobj;
+// rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
+
+ // Get the port list of the component
+// PortServiceList* portlist;
+// portlist = rtobj->get_ports();
+
+ // getting port profiles
+// std::cout << "Number of Ports: ";
+// std::cout << portlist->length() << std::endl << std::endl;
+// for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
+// {
+// PortService_ptr port;
+// port = (*portlist)[i];
+// std::cout << "Port" << i << " (name): ";
+// std::cout << port->get_port_profile()->name << std::endl;
+//
+// RTC::PortInterfaceProfileList iflist;
+// iflist = port->get_port_profile()->interfaces;
+// std::cout << "---interfaces---" << std::endl;
+// for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
+// {
+// std::cout << "I/F name: ";
+// std::cout << iflist[i].instance_name << std::endl;
+// std::cout << "I/F type: ";
+// std::cout << iflist[i].type_name << std::endl;
+// const char* pol;
+// pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
+// std::cout << "Polarity: " << pol << std::endl;
+// }
+// std::cout << "---properties---" << std::endl;
+// NVUtil::dump(port->get_port_profile()->properties);
+// std::cout << "----------------" << std::endl << std::endl;
+// }
+
+ return;
+}
+
+int main (int argc, char** argv)
+{
+ RTC::Manager* manager;
+ manager = RTC::Manager::init(argc, argv);
+
+ // Initialize manager
+ manager->init(argc, argv);
+
+ // Set module initialization proceduer
+ // This procedure will be invoked in activateManager() function.
+ manager->setModuleInitProc(MyModuleInit);
+
+ // Activate manager and register to naming service
+ manager->activateManager();
+
+ // run the manager in blocking mode
+ // runManager(false) is the default.
+ manager->runManager();
+
+ // If you want to run the manager in non-blocking mode, do like this
+ // manager->runManager(true);
+
+ return 0;
+}
+#endif
Property changes on: trunk/OpenRTM-aist/examples/Throughput/ThroughputComp.cpp
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/OpenRTM-aist/examples/Throughput/cdr_samecomp.sh
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/cdr_samecomp.sh (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/cdr_samecomp.sh 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+DATATYPES="octet short long float double"
+
+#------------------------------------------------------------
+# corba_cdr with same component
+#------------------------------------------------------------
+for d in $DATATYPES ; do
+ cat <<EOF > tmp.conf
+logger.enable: NO
+corba.args: -ORBgiopMaxMsgSize 209715200
+manager.components.preconnect: Throughput0.out:Throughput0.in(dataflow_type=push&interface_type=corba_cdr
+manager.components.preactivation: Throughput0
+example.Throughput.conf.default.maxsize: 100000000
+example.Throughput.conf.default.datatype: ${d}
+example.Throughput.conf.default.filesuffix: -samecomp
+EOF
+ ./ThroughputComp -f tmp.conf
+done
+rm -f tmp.conf
Property changes on: trunk/OpenRTM-aist/examples/Throughput/cdr_samecomp.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/OpenRTM-aist/examples/Throughput/cdr_sameproc.sh
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/cdr_sameproc.sh (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/cdr_sameproc.sh 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+DATATYPES="octet short long float double"
+
+#------------------------------------------------------------
+# corba_cdr with two component with same proc
+#------------------------------------------------------------
+for d in $DATATYPES ; do
+ cat <<EOF > tmp.conf
+logger.enable: NO
+corba.args: -ORBgiopMaxMsgSize 209715200
+manager.components.precreate: Throughput
+manager.components.preconnect: Throughput0.out:Throughput1.in(dataflow_type=push&interface_type=corba_cdr
+manager.components.preactivation: Throughput0, Throughput1
+example.Throughput.conf.default.maxsize: 100000000
+example.Throughput.conf.default.datatype: ${d}
+example.Throughput.conf.default.filesuffix: -sameproc
+
+EOF
+ ./ThroughputComp -f tmp.conf
+done
+rm -f tmp.conf
+
Property changes on: trunk/OpenRTM-aist/examples/Throughput/cdr_sameproc.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/OpenRTM-aist/examples/Throughput/direct.sh
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/direct.sh (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/direct.sh 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+DATATYPES="octet short long float double"
+
+#------------------------------------------------------------
+# direct mode
+#------------------------------------------------------------
+for d in $DATATYPES ; do
+ cat <<EOF > tmp.conf
+logger.enable: NO
+corba.args: -ORBgiopMaxMsgSize 209715200
+manager.components.preconnect: Throughput0.out:Throughput0.in(dataflow_type=push&interface_type=direct
+manager.components.preactivation: Throughput0
+example.Throughput.conf.default.maxsize: 100000000
+example.Throughput.conf.default.datatype: ${d}
+EOF
+ ./ThroughputComp -f tmp.conf
+done
+rm -f tmp.conf
Property changes on: trunk/OpenRTM-aist/examples/Throughput/direct.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/OpenRTM-aist/examples/Throughput/rtc.conf
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/rtc.conf (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/rtc.conf 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,18 @@
+corba.nameservers: localhost
+naming.formats: %h.host_cxt/%n.rtc
+logger.enable: YES
+logger.log_level: TRACE
+
+# CORBA configuration for large data
+corba.args: -ORBgiopMaxMsgSize 209715200
+
+# Component activation and connection
+manager.components.preconnect: Throughput0.out:Throughput0.in(dataflow_type=push&interface_type=corba_cdr
+manager.components.preactivation: Throughput0
+
+
+# Component configuration
+example.Throughput.conf.default.maxsize: 1000000
+example.Throughput.conf.default.datatype: double
+example.Throughput.conf.default.filesuffix: -samecomp
+
Property changes on: trunk/OpenRTM-aist/examples/Throughput/rtc.conf
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/OpenRTM-aist/examples/Throughput/run.sh
===================================================================
--- trunk/OpenRTM-aist/examples/Throughput/run.sh (rev 0)
+++ trunk/OpenRTM-aist/examples/Throughput/run.sh 2017-09-23 16:27:51 UTC (rev 3048)
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+DATATYPES="octet short long float double"
+
+#------------------------------------------------------------
+# direct mode
+#------------------------------------------------------------
+for d in $DATATYPES ; do
+ cat <<EOF > tmp.conf
+logger.enable: NO
+corba.args: -ORBgiopMaxMsgSize 209715200
+manager.components.preconnect: Throughput0.out:Throughput0.in(dataflow_type=push&interface_type=direct
+manager.components.preactivation: Throughput0
+example.Throughput.conf.default.maxsize: 100000000
+example.Throughput.conf.default.datatype: ${d}
+EOF
+ ./ThroughputComp -f tmp.conf
+done
+rm -f tmp.conf
+
+#------------------------------------------------------------
+# corba_cdr with same component
+#------------------------------------------------------------
+for d in $DATATYPES ; do
+ cat <<EOF > tmp.conf
+logger.enable: NO
+corba.args: -ORBgiopMaxMsgSize 209715200
+manager.components.preconnect: Throughput0.out:Throughput0.in(dataflow_type=push&interface_type=corba_cdr
+manager.components.preactivation: Throughput0
+example.Throughput.conf.default.maxsize: 100000000
+example.Throughput.conf.default.datatype: ${d}
+example.Throughput.conf.default.filesuffix: -samecomp
+EOF
+ ./ThroughputComp -f tmp.conf
+done
+rm -f tmp.conf
+
+#------------------------------------------------------------
+# corba_cdr with two component with same proc
+#------------------------------------------------------------
+for d in $DATATYPES ; do
+ cat <<EOF > tmp.conf
+logger.enable: NO
+corba.args: -ORBgiopMaxMsgSize 209715200
+manager.components.precreate: Throughput
+manager.components.preconnect: Throughput0.out:Throughput1.in(dataflow_type=push&interface_type=corba_cdr
+manager.components.preactivation: Throughput0, Throughput1
+example.Throughput.conf.default.maxsize: 100000000
+example.Throughput.conf.default.datatype: ${d}
+example.Throughput.conf.default.filesuffix: -sameproc
+
+EOF
+ ./ThroughputComp -f tmp.conf
+done
+rm -f tmp.conf
+
Property changes on: trunk/OpenRTM-aist/examples/Throughput/run.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
More information about the openrtm-commit
mailing list