summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-03-05 23:27:38 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-03-05 23:27:38 +0000
commit390fcf6d8c0b241be4539606412aed16d5cc4a10 (patch)
treee437ed3be6f1f0e808d72dcf81d5a625597bdc42
parent624894daf0ff8e43fc6db627e58684088170627a (diff)
downloadATCD-390fcf6d8c0b241be4539606412aed16d5cc4a10.tar.gz
ChangeLogTag:Tue Mar 5 15:21:51 2002 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a36
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp8
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf2
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh47
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp25
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h3
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp5
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp84
13 files changed, 177 insertions, 47 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index ba5f1e02ea2..7d5a1ef7a0b 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,39 @@
+Tue Mar 5 15:21:51 2002 Carlos O'Ryan <coryan@uci.edu>
+
+ * orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h:
+ * orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp:
+ Improve the implementation of stop_all_threads(), it is more
+ efficient to stop them all and then simultaneously wait for all
+ the threads to finish.
+ Fixed a number of bugs in the template, it was only working
+ because some global variables were visible at the point of
+ instantiation.
+
+ * orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp:
+ Run the process at the right priority, it was runnning at the
+ minimum priority + 1, while it is supposed to be (min+max)/2
+
+ * orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp:
+ Do not return if there is a single exception, simply continue
+ the loop. Add a bunch of debug messages, only to find out that
+ the ORB is dead-locking in the Leader/Followers code (yuck!)
+
+ * orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp:
+ * orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp:
+ Add debugging messages.
+ Use the new Low_Priority_Setup constructor.
+
+ * orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf:
+ * orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf:
+ * orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf:
+ * orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf:
+ * orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf:
+ Add service configurator files required for the test.
+
+ * orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh:
+ Add a simple test driver
+
+
Tue Mar 5 11:37:52 2002 Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
* orbsvcs/orbsvcs/Makefile:
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp
index ded7a5f1ef6..9bcc7ba19b6 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp
@@ -206,10 +206,10 @@ int main (int argc, char *argv[])
disable_low_priority ? 0 : 1,
rt_class.priority_low (),
rt_class.thr_sched_class (),
+ low_priority_period,
supplier_poa.in (),
consumer_poa.in (),
ec.in (),
- &my_thread_manager,
&barrier
ACE_ENV_ARG_PARAMETER);
@@ -241,11 +241,15 @@ int main (int argc, char *argv[])
&high_priority_task);
}
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - high priority task completed\n"));
+
if (disable_low_priority == 0)
{
low_priority_setup.stop_all_threads ();
}
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - low priority task(s) stopped\n"));
+
ACE_Sample_History &history =
high_priority_group.consumer ()->sample_history ();
if (do_dump_history)
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp
index bbe972a5109..a12a8440923 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp
@@ -198,7 +198,7 @@ int main (int argc, char *argv[])
Low_Priority_Setup<Client_Group> low_priority_setup (
nthreads,
- iterations,
+ 0,
1, // each client gets its own type
experiment_id,
ACE_ES_EVENT_UNDEFINED + 2,
@@ -207,10 +207,10 @@ int main (int argc, char *argv[])
disable_low_priority ? 0 : 1,
rt_class.priority_low (),
rt_class.thr_sched_class (),
+ low_priority_period,
supplier_poa.in (),
consumer_poa.in (),
ec.in (),
- &my_thread_manager,
&barrier
ACE_ENV_ARG_PARAMETER);
@@ -242,11 +242,15 @@ int main (int argc, char *argv[])
&high_priority_task);
}
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - high priority task completed\n"));
+
if (disable_low_priority == 0)
{
low_priority_setup.stop_all_threads ();
}
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - low priority task(s) stopped\n"));
+
ACE_Sample_History &history =
high_priority_group.consumer ()->sample_history ();
if (do_dump_history)
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf
new file mode 100644
index 00000000000..3c107d1ba17
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECDispatching reactive"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf
new file mode 100644
index 00000000000..4b3dee25fe1
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf
@@ -0,0 +1,2 @@
+# $Id$
+static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf
new file mode 100644
index 00000000000..3d04d8461d0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECDispatching mt -ECDispatchingThreads 2"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf
new file mode 100644
index 00000000000..b187ff3ed6b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf
new file mode 100644
index 00000000000..e578b42e926
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECSupplierFilter per-supplier"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh
new file mode 100755
index 00000000000..4414a4ebf64
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+LOW_PRIORITY="1 5 10 15 20 15 30 35 40 45 50"
+#" 60 70 80 90 100 110 120 130 140 150 160"
+
+#IOR=/project/amras/coryan/IOR/roundtrip.ior
+IOR=test.ior
+
+for c in $LOW_PRIORITY; do
+# date
+# echo reactive $c
+#
+# /bin/rm -f $IOR
+# ssh celegorm "cd /project/celegorm/coryan/EC_Roundtrip ; ./server -ORBSvcConf ec.dispatching_reactive.conf -o $IOR" >server.log 2>&1 </dev/null &
+# while [ ! -f $IOR ]; do
+# sleep 1
+# done
+# ./client -d -h 1000 -l 2000 -i 500 -n $c -k file://$IOR > ec_dispatching_reactive.$c.txt 2>&1
+# wait
+#
+# date
+# echo threaded $c
+#
+# /bin/rm -f $IOR
+# ssh celegorm "cd /project/celegorm/coryan/EC_Roundtrip ; ./server -ORBSvcConf ec.dispatching_threaded.conf -o $IOR" >server.log 2>&1 </dev/null &
+# while [ ! -f $IOR ]; do
+# sleep 1
+# done
+# ./client -d -h 1000 -l 2000 -i 500 -n $c -k file://$IOR > ec_dispatching_threaded.$c.txt 2>&1
+# wait
+
+ date
+ echo rtcorba $c
+
+ /bin/rm -f $IOR
+# ssh celegorm "cd /project/celegorm/coryan/EC_Roundtrip ; ./server -ORBSvcConf ec.dispatching_rtcorba.conf -r -o $IOR" >server.log 2>&1 </dev/null &
+ ./server -ORBSvcConf ec.dispatching_rtcorba.conf -r -o $IOR" >server.log 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -ORBSvcConf ec.dispatching_rtcorba.conf -r -d -h 1000 -l 2000 -i 500 -n $c -k file://$IOR > ec_dispatching_rtcorba.$c.txt 2>&1
+ wait
+
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp
index 51a5c9a70ef..712375ecd27 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp
@@ -23,10 +23,10 @@ Low_Priority_Setup (int nthreads,
int enable_threads,
int thread_priority,
int thread_sched_class,
+ int send_period,
PortableServer::POA_ptr supplier_poa,
PortableServer::POA_ptr consumer_poa,
RtecEventChannelAdmin::EventChannel_ptr ec,
- ACE_Thread_Manager *thr_mgr,
ACE_Barrier *barrier
ACE_ENV_ARG_DECL)
: nthreads_ (nthreads)
@@ -58,18 +58,18 @@ Low_Priority_Setup (int nthreads,
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
/// Automatically disconnect the group if the connection was
- /// successful
+ /// successful
this->disconnect_[i] = &this->clients_[i];
if (enable_threads)
{
- this->tasks_[i].init (iterations,
- low_priority_period,
- base_event_type,
- 1,
+ this->tasks_[i].init (0,
+ send_period,
+ event_type,
+ experiment_id,
this->clients_[i].supplier (),
barrier);
- this->tasks_[i].thr_mgr (thr_mgr);
+ this->tasks_[i].thr_mgr (&this->thr_mgr_);
this->stoppers_[i] = Auto_Send_Task_Stopper (
new Send_Task_Stopper (thread_priority,
thread_sched_class,
@@ -82,6 +82,15 @@ Low_Priority_Setup (int nthreads,
template<class Client_Type> void
Low_Priority_Setup<Client_Type>::stop_all_threads (void)
{
+ ACE_DEBUG ((LM_DEBUG, "Stopping:"));
+ for (int i = 0; i != this->nthreads_; ++i)
+ {
+ this->tasks_[i].stop ();
+ ACE_DEBUG ((LM_DEBUG, " %d", i));
+ }
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ this->thr_mgr_.wait ();
+
/// Resetting the auto_ptr<> destroys all the objects. The
/// destructors automatically stop and wait for all the threads.
/// Depending on your personal bias this is either "super neat" or
@@ -92,7 +101,7 @@ Low_Priority_Setup<Client_Type>::stop_all_threads (void)
template<class Client_Type> void
Low_Priority_Setup<Client_Type>::collect_basic_stats (ACE_Basic_Stats &stats)
{
- for (int i = 0; i != nthreads; ++i)
+ for (int i = 0; i != this->nthreads_; ++i)
{
ACE_Sample_History &history =
this->clients_[i].consumer ()->sample_history ();
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h
index 340da4a3772..15b7452fbef 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h
@@ -42,10 +42,10 @@ public:
int enable_threads,
int thread_priority,
int thread_sched_class,
+ int send_period,
PortableServer::POA_ptr supplier_poa,
PortableServer::POA_ptr consumer_poa,
RtecEventChannelAdmin::EventChannel_ptr ec,
- ACE_Thread_Manager *thr_mgr,
ACE_Barrier *barrier
ACE_ENV_ARG_DECL);
@@ -68,6 +68,7 @@ private:
Client_Auto_Disconnect_Array disconnect_;
Send_Task_Array tasks_;
Send_Task_Stopper_Array stoppers_;
+ ACE_Thread_Manager thr_mgr_;
};
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp
index 5518691b93d..02cc9acade5 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp
@@ -20,9 +20,8 @@ RT_Class::RT_Class (void)
, thr_sched_class_ (THR_SCHED_FIFO)
{
int priority =
- ACE_Sched_Params::next_priority (
- this->prc_sched_class_,
- ACE_Sched_Params::priority_min (this->prc_sched_class_));
+ (ACE_Sched_Params::priority_min (this->prc_sched_class_)
+ + ACE_Sched_Params::priority_max (this->prc_sched_class_))/2;
if (ACE_OS::sched_params (ACE_Sched_Params (this->prc_sched_class_,
priority,
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp
index 0487a2c071d..a8ac85cb79c 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp
@@ -47,52 +47,72 @@ Send_Task::stop (void)
int
Send_Task::svc (void)
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ if (this->barrier_ == 0)
+ return -1;
+
+ this->barrier_->wait ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread started, "
+ "iterations = %d, period = %d, event_type = %d\n",
+ this->iterations_, this->period_in_usecs_,
+ this->event_type_));
+
+ int start_i = 0;
+ if (this->iterations_ == 0)
{
- if (this->barrier_ == 0)
- return -1;
+ // Starting from 1 results in an infinite loop (well, so long
+ // that I call it infinite), which is exactly what we want, kind
+ // of hackish, oh well.
+ start_i = 1;
+ }
- this->barrier_->wait ();
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.type = this->event_type_;
+ event[0].header.source = this->event_source_;
+ event[0].header.ttl = 1;
- int start_i = 0;
- if (this->iterations_ == 0)
+ ACE_DECLARE_NEW_CORBA_ENV;
+ for (int i = start_i; i != this->iterations_; ++i)
+ {
+ if ((i + 1) % 1000 == 0)
{
- /// Starting from 1 results in an infinite loop, which is
- /// exactly what we want, kind of hackish IMHO...
- start_i = 1;
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread has sent %d messages\n",
+ i + 1));
}
- for (int i = start_i; i != this->iterations_; ++i)
- {
- RtecEventComm::EventSet event (1);
- event.length (1);
- event[0].header.type = this->event_type_;
- event[0].header.source = this->event_source_;
- event[0].header.ttl = 1;
- ACE_Time_Value period (0, this->period_in_usecs_);
+ ACE_Time_Value period (0, this->period_in_usecs_);
- ACE_OS::sleep (period);
+ ACE_OS::sleep (period);
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1);
+ if (this->stop_ != 0)
{
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1);
- if (this->stop_)
- return 0;
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread has been stopped\n"));
+ return 0;
}
- ACE_hrtime_t creation = ACE_OS::gethrtime ();
- ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time,
- creation);
+ }
+ ACE_hrtime_t creation = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time,
+ creation);
+ ACE_TRY
+ {
// push one event...
this->supplier_->push (event ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
}
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ }
+ ACE_ENDTRY;
}
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Caught exception:");
- return 1;
- }
- ACE_ENDTRY;
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread finished\n"));
return 0;
}