summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-15 06:33:57 +0000
committersergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-15 06:33:57 +0000
commit1c024cdd1ab796b80825192b80e5aec66a2f20e9 (patch)
treef0a0224bb1fdcbfcca276343b34f0253776826a3
parenta9510d263a5020202ebfa4386e8e6d03f63eb6fa (diff)
downloadATCD-1c024cdd1ab796b80825192b80e5aec66a2f20e9.tar.gz
*** empty log message ***
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/Makefile231
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/README105
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.cpp308
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.h50
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/Util_Thread.cpp37
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/client.cpp159
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/client.h10
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.cpp4
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.h2
-rw-r--r--TAO/tests/Cubit/COOL/MT_Cubit/server.cpp35
10 files changed, 483 insertions, 458 deletions
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/Makefile b/TAO/tests/Cubit/COOL/MT_Cubit/Makefile
index 53b76a30af3..9089658dda8 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/Makefile
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/Makefile
@@ -1,5 +1,5 @@
#----------------------------------------------------------------------------
-# @(#)Makefile 1.1 10/18/96
+# $Id$
#
# Makefile for the CHORUS COOL Cubit tests
#----------------------------------------------------------------------------
@@ -10,13 +10,21 @@
IDL_SRC = cubit.cpp cubit.H sk_cubit.C sk_cubit.H
-SRC = $(IDL_SRC) cubit_impl.cpp server.cpp client.cpp Task_Client.cpp Util_Thread.cpp
+SRC = $(IDL_SRC) \
+ cubit_impl.cpp \
+ server.cpp \
+ client.cpp \
+ Task_Client.cpp \
+ Util_Thread.cpp
-SVR_OBJS = cubit_impl.o server.o cubit.o
+SVR_OBJS = cubit_impl.o \
+ server.o \
+ cubit.o
-CLT_OBJS = Task_Client.o client.o cubit.o Util_Thread.o
-
-LDLIBS = -lOrb-mt
+CLT_OBJS = Task_Client.o \
+ client.o \
+ cubit.o \
+ Util_Thread.o
VLDLIBS = $(LDLIBS:%=%$(VAR))
@@ -35,15 +43,22 @@ include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU
#----------------------------------------------------------------------------
# CHORUS related macros and target settings.
#----------------------------------------------------------------------------
-
CHORUS_BINDIR = $(CHORUS_ROOT)/bin
CHORUS_LIBDIR = $(CHORUS_ROOT)/lib
CHORUS_INCDIR = $(CHORUS_ROOT)/include
-CPPFLAGS += -I$(CHORUS_INCDIR) -I$(CHORUS_ROOT)
-LDFLAGS += -L$(CHORUS_LIBDIR) -R $(CHORUS_LIBDIR) -L$(ACE)/ace
+CPPFLAGS += -I$(CHORUS_INCDIR) -I$(CHORUS_ROOT)
+LDFLAGS += -L$(CHORUS_LIBDIR) -R$(CHORUS_LIBDIR) -L$(ACE)/ace
IDLFLAGS = --stub-header --stub-impl --skeleton-header --skeleton-impl --no-local --no-any --binding Cubit Cubit_Impl
+# pccTimer will eventually get integrated into ACE. It is specific for ClassiX on VME
+ifdef CHORUS
+ SRC += pccTimer.cpp
+ CLT_OBJS += pccTimer.o
+ LDLIBS += -lOrb
+else
+ LDLIBS += -lOrb-mt
+endif
#----------------------------------------------------------------------------
# Local targets
#----------------------------------------------------------------------------
@@ -69,203 +84,5 @@ realclean: clean
# DO NOT DELETE THIS LINE -- g++dep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-.obj/cubit.o .shobj/cubit.so: cubit.cpp cubit.H
-.obj/sk_cubit.o .shobj/sk_cubit.so: sk_cubit.C
-.obj/cubit_impl.o .shobj/cubit_impl.so: cubit_impl.cpp \
- $(ACE_ROOT)/ace/ACE.h \
- $(ACE_ROOT)/ace/OS.h \
- $(ACE_ROOT)/ace/inc_user_config.h \
- $(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/streams.h \
- $(ACE_ROOT)/ace/Basic_Types.h \
- $(ACE_ROOT)/ace/Basic_Types.i \
- $(ACE_ROOT)/ace/OS.i \
- $(ACE_ROOT)/ace/Trace.h \
- $(ACE_ROOT)/ace/Log_Msg.h \
- $(ACE_ROOT)/ace/Log_Record.h \
- $(ACE_ROOT)/ace/Log_Priority.h \
- $(ACE_ROOT)/ace/Log_Record.i \
- $(ACE_ROOT)/ace/Version.h \
- $(ACE_ROOT)/ace/ACE.i cubit_impl.h \
- cubit.H \
- /project/doc/miniCOOL/minicool.r4.3/solaris2.5-CC-mt/include/corba/cool.H
-.obj/server.o .shobj/server.so: server.cpp cubit.H cubit_impl.h sk_cubit.H sk_cubit.C \
- $(ACE_ROOT)/ace/OS.h \
- $(ACE_ROOT)/ace/inc_user_config.h \
- $(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/streams.h \
- $(ACE_ROOT)/ace/Basic_Types.h \
- $(ACE_ROOT)/ace/Basic_Types.i \
- $(ACE_ROOT)/ace/OS.i \
- $(ACE_ROOT)/ace/Trace.h \
- $(ACE_ROOT)/ace/Log_Msg.h \
- $(ACE_ROOT)/ace/Log_Record.h \
- $(ACE_ROOT)/ace/ACE.h \
- $(ACE_ROOT)/ace/Version.h \
- $(ACE_ROOT)/ace/ACE.i \
- $(ACE_ROOT)/ace/Log_Priority.h \
- $(ACE_ROOT)/ace/Log_Record.i
-.obj/client.o .shobj/client.so: client.cpp \
- $(ACE_ROOT)/ace/Task.h \
- $(ACE_ROOT)/ace/Service_Object.h \
- $(ACE_ROOT)/ace/Shared_Object.h \
- $(ACE_ROOT)/ace/ACE.h \
- $(ACE_ROOT)/ace/OS.h \
- $(ACE_ROOT)/ace/inc_user_config.h \
- $(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/streams.h \
- $(ACE_ROOT)/ace/Basic_Types.h \
- $(ACE_ROOT)/ace/Basic_Types.i \
- $(ACE_ROOT)/ace/OS.i \
- $(ACE_ROOT)/ace/Trace.h \
- $(ACE_ROOT)/ace/Log_Msg.h \
- $(ACE_ROOT)/ace/Log_Record.h \
- $(ACE_ROOT)/ace/Log_Priority.h \
- $(ACE_ROOT)/ace/Log_Record.i \
- $(ACE_ROOT)/ace/Version.h \
- $(ACE_ROOT)/ace/ACE.i \
- $(ACE_ROOT)/ace/Shared_Object.i \
- $(ACE_ROOT)/ace/Event_Handler.h \
- $(ACE_ROOT)/ace/Event_Handler.i \
- $(ACE_ROOT)/ace/Service_Object.i \
- $(ACE_ROOT)/ace/Thread_Manager.h \
- $(ACE_ROOT)/ace/Thread.h \
- $(ACE_ROOT)/ace/Thread.i \
- $(ACE_ROOT)/ace/Synch.h \
- $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \
- $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \
- $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \
- $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \
- $(ACE_ROOT)/ace/Synch.i \
- $(ACE_ROOT)/ace/Synch_T.h \
- $(ACE_ROOT)/ace/Synch_T.i \
- $(ACE_ROOT)/ace/Atomic_Op.i \
- $(ACE_ROOT)/ace/Containers.h \
- $(ACE_ROOT)/ace/Containers.i \
- $(ACE_ROOT)/ace/Thread_Manager.i \
- $(ACE_ROOT)/ace/Task.i \
- $(ACE_ROOT)/ace/Task_T.h \
- $(ACE_ROOT)/ace/Message_Queue.h \
- $(ACE_ROOT)/ace/Message_Block.h \
- $(ACE_ROOT)/ace/Malloc.h \
- $(ACE_ROOT)/ace/Malloc.i \
- $(ACE_ROOT)/ace/Malloc_T.h \
- $(ACE_ROOT)/ace/Free_List.h \
- $(ACE_ROOT)/ace/Free_List.i \
- $(ACE_ROOT)/ace/Malloc_T.i \
- $(ACE_ROOT)/ace/Memory_Pool.h \
- $(ACE_ROOT)/ace/Signal.h \
- $(ACE_ROOT)/ace/Signal.i \
- $(ACE_ROOT)/ace/Object_Manager.h \
- $(ACE_ROOT)/ace/Object_Manager.i \
- $(ACE_ROOT)/ace/Managed_Object.h \
- $(ACE_ROOT)/ace/Managed_Object.i \
- $(ACE_ROOT)/ace/Mem_Map.h \
- $(ACE_ROOT)/ace/Mem_Map.i \
- $(ACE_ROOT)/ace/Memory_Pool.i \
- $(ACE_ROOT)/ace/Message_Block.i \
- $(ACE_ROOT)/ace/IO_Cntl_Msg.h \
- $(ACE_ROOT)/ace/Strategies.h \
- $(ACE_ROOT)/ace/Strategies_T.h \
- $(ACE_ROOT)/ace/Service_Config.h \
- $(ACE_ROOT)/ace/Service_Config.i \
- $(ACE_ROOT)/ace/Reactor.h \
- $(ACE_ROOT)/ace/Handle_Set.h \
- $(ACE_ROOT)/ace/Handle_Set.i \
- $(ACE_ROOT)/ace/Timer_Queue.h \
- $(ACE_ROOT)/ace/Timer_Queue_T.h \
- $(ACE_ROOT)/ace/Timer_Queue_T.i \
- $(ACE_ROOT)/ace/Reactor.i \
- $(ACE_ROOT)/ace/Reactor_Impl.h \
- $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \
- $(ACE_ROOT)/ace/Synch_Options.h \
- $(ACE_ROOT)/ace/Hash_Map_Manager.h \
- $(ACE_ROOT)/ace/Message_Queue.i \
- $(ACE_ROOT)/ace/Task_T.i \
- $(ACE_ROOT)/ace/Get_Opt.h \
- $(ACE_ROOT)/ace/Get_Opt.i \
- /project/doc/miniCOOL/minicool.r4.3/solaris2.5-CC-mt/include/api/api.H \
- cubit.H Task_Client.h
-.obj/Task_Client.o .shobj/Task_Client.so: Task_Client.cpp Task_Client.h \
- $(ACE_ROOT)/ace/Synch.h \
- $(ACE_ROOT)/ace/ACE.h \
- $(ACE_ROOT)/ace/OS.h \
- $(ACE_ROOT)/ace/inc_user_config.h \
- $(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/streams.h \
- $(ACE_ROOT)/ace/Basic_Types.h \
- $(ACE_ROOT)/ace/Basic_Types.i \
- $(ACE_ROOT)/ace/OS.i \
- $(ACE_ROOT)/ace/Trace.h \
- $(ACE_ROOT)/ace/Log_Msg.h \
- $(ACE_ROOT)/ace/Log_Record.h \
- $(ACE_ROOT)/ace/Log_Priority.h \
- $(ACE_ROOT)/ace/Log_Record.i \
- $(ACE_ROOT)/ace/Version.h \
- $(ACE_ROOT)/ace/ACE.i \
- $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \
- $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \
- $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \
- $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \
- $(ACE_ROOT)/ace/Synch.i \
- $(ACE_ROOT)/ace/Synch_T.h \
- $(ACE_ROOT)/ace/Event_Handler.h \
- $(ACE_ROOT)/ace/Event_Handler.i \
- $(ACE_ROOT)/ace/Synch_T.i \
- $(ACE_ROOT)/ace/Thread.h \
- $(ACE_ROOT)/ace/Thread.i \
- $(ACE_ROOT)/ace/Atomic_Op.i \
- $(ACE_ROOT)/ace/Task.h \
- $(ACE_ROOT)/ace/Service_Object.h \
- $(ACE_ROOT)/ace/Shared_Object.h \
- $(ACE_ROOT)/ace/Shared_Object.i \
- $(ACE_ROOT)/ace/Service_Object.i \
- $(ACE_ROOT)/ace/Thread_Manager.h \
- $(ACE_ROOT)/ace/Containers.h \
- $(ACE_ROOT)/ace/Containers.i \
- $(ACE_ROOT)/ace/Thread_Manager.i \
- $(ACE_ROOT)/ace/Task.i \
- $(ACE_ROOT)/ace/Task_T.h \
- $(ACE_ROOT)/ace/Message_Queue.h \
- $(ACE_ROOT)/ace/Message_Block.h \
- $(ACE_ROOT)/ace/Malloc.h \
- $(ACE_ROOT)/ace/Malloc.i \
- $(ACE_ROOT)/ace/Malloc_T.h \
- $(ACE_ROOT)/ace/Free_List.h \
- $(ACE_ROOT)/ace/Free_List.i \
- $(ACE_ROOT)/ace/Malloc_T.i \
- $(ACE_ROOT)/ace/Memory_Pool.h \
- $(ACE_ROOT)/ace/Signal.h \
- $(ACE_ROOT)/ace/Signal.i \
- $(ACE_ROOT)/ace/Object_Manager.h \
- $(ACE_ROOT)/ace/Object_Manager.i \
- $(ACE_ROOT)/ace/Managed_Object.h \
- $(ACE_ROOT)/ace/Managed_Object.i \
- $(ACE_ROOT)/ace/Mem_Map.h \
- $(ACE_ROOT)/ace/Mem_Map.i \
- $(ACE_ROOT)/ace/Memory_Pool.i \
- $(ACE_ROOT)/ace/Message_Block.i \
- $(ACE_ROOT)/ace/IO_Cntl_Msg.h \
- $(ACE_ROOT)/ace/Strategies.h \
- $(ACE_ROOT)/ace/Strategies_T.h \
- $(ACE_ROOT)/ace/Service_Config.h \
- $(ACE_ROOT)/ace/Service_Config.i \
- $(ACE_ROOT)/ace/Reactor.h \
- $(ACE_ROOT)/ace/Handle_Set.h \
- $(ACE_ROOT)/ace/Handle_Set.i \
- $(ACE_ROOT)/ace/Timer_Queue.h \
- $(ACE_ROOT)/ace/Timer_Queue_T.h \
- $(ACE_ROOT)/ace/Timer_Queue_T.i \
- $(ACE_ROOT)/ace/Reactor.i \
- $(ACE_ROOT)/ace/Reactor_Impl.h \
- $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \
- $(ACE_ROOT)/ace/Synch_Options.h \
- $(ACE_ROOT)/ace/Hash_Map_Manager.h \
- $(ACE_ROOT)/ace/Message_Queue.i \
- $(ACE_ROOT)/ace/Task_T.i \
- $(ACE_ROOT)/ace/Get_Opt.h \
- $(ACE_ROOT)/ace/Get_Opt.i \
- /project/doc/miniCOOL/minicool.r4.3/solaris2.5-CC-mt/include/api/api.H \
- cubit.H
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/README b/TAO/tests/Cubit/COOL/MT_Cubit/README
index 31e1b9fc72a..f8e7941cbdf 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/README
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/README
@@ -22,7 +22,10 @@ the client or open a separate window for the client and server.
server:
-------
-./server <tpr | tpool> cool-tcp://<THIS_HOSTNAME>:<THIS_HOST_PORT> -v -cool-tcp -cool-iiop
+./server <tpr | tpool>
+ <cool-tcp://THIS_HOSTNAME:THIS_HOST_PORT | cool-chorus://:THIS_HOST_PORT>
+ -v
+ <-cool-tcp -cool-iiop | -cool-chorus>
tpr : this indicates to the server to use the Thread Per Request concurrency model.
@@ -41,7 +44,15 @@ but it is not required by the client.
client:
-------
-./client [-n <LOOP_COUNT>] [-t <NUM_THREADS>] [-h SERVER_HOSTNAME] [-p <SERVER_PORT_NUM>] -cool-tcp -cool-iiop
+./client [-n <LOOP_COUNT>]
+ [-t <NUM_THREADS>]
+ [-h SERVER_HOSTNAME]
+ [-p <SERVER_PORT_NUM>]
+ [-cool-tcp -cool-iiop | -cool-chorus]
+ [-I]
+
+[-I] indicates to the client to use Chorus IPC as the underlying transport
+ instead of TCP
<SERVER_HOSTNAME>: is the hostname of the server.
@@ -68,8 +79,11 @@ Results
The client prints the latency observed by the high priority client,
and the average latency observed by the low priority client.
-An Example
-----------
+Examples
+--------
+
+(1) An Example on a Sparc running SunOS 5.5.1 using TCP as the underlying transport
+
On the host lambada.cs.wustl.edu :
@@ -107,43 +121,46 @@ An Example
Low priority client latency : 15.995959 msec, jitter: 527.515277 msec
utilization task performed 435 computations
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- \ No newline at end of file
+(2) An Example on a MVME177 backplane using 68k processors running ClassiX using
+ Chorus IPC as the underlying transport
+
+
+ On the host tambora2.cs.wustl.edu :
+
+ % rsh tambora2 arun /tests/Cubit/COOL/MT_Cubit/server tpool cool-chorus://:1023 -v -cool-chorus
+
+ On the host tambora1.cs.wustl.edu :
+
+ % rsh tambora1 arun /tests/Cubit/COOL/MT_Cubit/client -n 400 -I -t 2 -p 1023 -cool-chorus
+
+ The output of the client program might look like this:
+
+ started aid = 12
+ COOL:0000000001000000010000001C00750AA60000000200750AA65555555500000001429A00000000000A(13) Thread created
+ (13) Im the high priority client, my id is 0.
+ Using ior = cool-chorus://:1023
+ Creating 1 clients with low priority of 125
+ (13) Binding succeeded
+ (13) Cb == 2c6144
+ Object Created at: '2908484l'connected to object 'COOL:0000000001000000010000001C00750AA60000000200750AA65555555500000001429A00000000000A'
+ COOL:0000000001000000010000001C00750AA60000000200750AA65555555500000001429A00000000000A
+ (13) Waiting for other threads to finish binding..
+ (12) Thread created
+ (12) Im a low priority client, my id is 1
+ Using ior = cool-chorus://:1023
+ (12) Binding succeeded
+ (12) Cb == 2c6164
+ Object Created at: '2908516l'connected to object 'COOL:0000000001000000010000001C00750AA60000000200750AA65555555500000001429A00000000000A'(12) Waiting for other threads to finish binding..
+ (13) Everyone's done, here I go!!
+ (12) Everyone's done, here I go!!
+ (12|13) cube average call ACE_OS::time = 12835 usec, 77 calls/second
+ (13) My latency was 12835
+ 400 calls, 0 errors
+ (12|12) cube average call ACE_OS::time = 12931 usec, 77 calls/second
+ (12) My latency was 12931
+ Test done.
+ High priority client latency : 12835 usec
+ Low priority client latency : 12931 usec
+ 400 calls, 0 errors
+ --->Output file for latency data is "cb12__2.txt"
+ (8) utilization task performed 0 computations
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.cpp b/TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.cpp
index 5b2c2c067f2..3caff110df8 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.cpp
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.cpp
@@ -1,39 +1,6 @@
-#include "Task_Client.h"
-
-#if defined (VXWORKS)
-#include "my_time.h"
-#endif /* defined (VXWORKS) */
-
-int stats(int data[], int n)
-{
- int i, j, key, sum, mean;
-
- if( n < 2 )
- return 0;
-
- /* sort the samples */
- for(j=1; j<n; j++) {
- key = data[j];
- i = j - 1;
- while( i >= 0 && data[i] > key ) {
- data[i+1] = data[i];
- i--;
- }
- data[i+1] = key;
- }
-
- sum = 0;
- for(i=0; i<n; i++) {
- sum += data[i];
- }
+// $Id$
- if( (n%2) == 0 )
- mean = (data[n/2-1] + data[n/2]) / 2;
- else
- mean = data[n/2];
-
- return sum/n;
-}
+#include "Task_Client.h"
Task_State::Task_State (int argc, char **argv)
: start_count_ (0),
@@ -44,15 +11,28 @@ Task_State::Task_State (int argc, char **argv)
argc_ (argc),
argv_ (argv),
thread_per_rate_ (0),
- global_jitter_array_ (0)
+ global_jitter_array_ (0),
+ use_chorus_ipc_ (0),
+ grain_ (1)
{
- ACE_OS::strcpy (server_host_, "localhost");
- ACE_Get_Opt opts (argc, argv, "h:n:t:p:d:r");
int c;
int datatype;
+ // defaults
+ ACE_OS::strcpy (server_host_, "localhost");
+ ior_header_ = ACE_OS::strdup ("cool-tcp");
+ ACE_Get_Opt opts (argc, argv, "Hh:n:t:p:d:rIg:");
+
while ((c = opts ()) != -1)
switch (c) {
+ case 'g':
+ grain_ = ACE_OS::atoi (opts.optarg);
+ if (grain_ < 1)
+ grain_ = 1;
+ break;
+ case 'I':
+ use_chorus_ipc_ = 1;
+ break;
case 'r':
thread_per_rate_ = 1;
break;
@@ -74,8 +54,8 @@ Task_State::Task_State (int argc, char **argv)
break;
case CB_SHORT:
default:
- datatype_ = CB_SHORT;
ACE_DEBUG ((LM_DEBUG, "Testing Shorts\n"));
+ datatype_ = CB_SHORT;
break;
}
continue;
@@ -91,46 +71,55 @@ Task_State::Task_State (int argc, char **argv)
case 't':
thread_count_ = (u_int) ACE_OS::atoi (opts.optarg);
continue;
- case '?':
- default:
+ case 'H':
ACE_DEBUG ((LM_DEBUG, "usage: %s"
"[-d datatype Octet=0, Short=1, Long=2, Struct=3]"
" [-n num_calls]"
" [-h server_hostname]"
" [-p server_port_num]"
" [-t num_threads]"
+ " [-I Use Chorus IPC. (For Chorus ClassiX *only*) ]"
+ " [-g granularity_of_request_timing]"
"\n", argv [0]));
+ continue;
}
+
+ if (use_chorus_ipc_ == 1)
+ {
+ ior_header_ = ACE_OS::strdup ("cool-chorus");
+ ACE_OS::strcpy (server_host_, "");
+ }
+
// thread_count_ + 1 because there is one utilization thread also
// wanting to begin at the same time the clients begin..
ACE_NEW (barrier_, ACE_Barrier (thread_count_ + 1));
ACE_NEW (latency_, double [thread_count_]);
ACE_NEW (global_jitter_array_, double *[thread_count_]);
- ACE_NEW (ave_latency_, int [thread_count_]);
}
Client::Client (Task_State *ts)
: ACE_Task<ACE_MT_SYNCH> (ACE_Thread_Manager::instance ()),
ts_ (ts)
{
-
-}
-
-void
-Client::put_ave_latency (int ave_latency, u_int thread_id) {
- ts_->lock_.acquire ();
- ts_->ave_latency_[thread_id] = ave_latency;
- ts_->lock_.release ();
}
void
Client::put_latency (double *jitter, double latency, u_int thread_id)
{
- ts_->lock_.acquire ();
+ ACE_MT (ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, ts_->lock_));
+
ts_->latency_[thread_id] = latency;
- ACE_DEBUG ((LM_DEBUG, "(%t) My latency was %f\n", latency));
ts_->global_jitter_array_ [thread_id] = jitter;
- ts_->lock_.release ();
+
+#if defined (ACE_LACKS_FLOATING_POINT)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) My latency was %u\n",
+ latency));
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) My latency was %f\n",
+ latency));
+#endif /* ! ACE_LACKS_FLOATING_POINT */
}
double
@@ -146,44 +135,67 @@ Client::get_low_priority_latency (void)
for (u_int i = 1; i < ts_->start_count_; i++)
l += (double) ts_->latency_[i];
- return l / (double) (ts_->start_count_ - 1);
+ return ts_->start_count_ > 1? l / (double) (ts_->start_count_ - 1) : 0;
}
int
Client::get_latency (u_int thread_id)
{
- return ts_->ave_latency_ [thread_id];
+ return ts_->latency_ [thread_id];
}
double
-Client::get_high_priority_jitter () {
+Client::get_high_priority_jitter (void)
+{
double jitter = 0;
double average = get_high_priority_latency ();
+
+ // Compute the standard deviation (i.e. jitter) from the values
+ // stored in the global_jitter_array_.
+
+ // we first compute the sum of the squares of the differences
+ // each latency has from the average
for (u_int i = 0; i < ts_->loop_count_; i ++)
{
- double difference = ts_->global_jitter_array_ [0][i] - average;
+ double difference =
+ ts_->global_jitter_array_ [0][i] - average;
jitter += difference * difference;
}
- return sqrt (jitter / (double) (ts_->loop_count_ - 1));
+
+ // Return the square root of the sum of the differences computed
+ // above, i.e. jitter.
+ return sqrt (jitter);
}
double
-Client::get_low_priority_jitter () {
+Client::get_low_priority_jitter (void)
+{
double jitter = 0;
double average = get_low_priority_latency ();
+
+ // Compute the standard deviation (i.e. jitter) from the values
+ // stored in the global_jitter_array_.
+
+ // We first compute the sum of the squares of the differences each
+ // latency has from the average.
for (u_int j = 1; j < ts_->start_count_; j ++)
for (u_int i = 0; i < ts_->loop_count_; i ++)
{
double difference = ts_->global_jitter_array_ [j][i] - average;
jitter += difference * difference;
}
- return (double) (jitter / ((ts_->loop_count_* (ts_->start_count_ - 1)) - 1));
+
+ // Return the square root of the sum of the differences computed
+ // above, i.e. jitter.
+ return sqrt (jitter);
}
int
Client::svc (void)
{
- ACE_DEBUG ((LM_DEBUG, "(%t) Thread created\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) Thread created\n"));
+
u_int thread_id;
Cubit_ptr cb;
char ior [1024];
@@ -203,10 +215,11 @@ Client::svc (void)
ACE_DEBUG ((LM_DEBUG,
"(%t) Im the high priority client, my id is %d.\n",
thread_id));
- ::sprintf (ior,
- "cool-tcp://%s:%d",
- ts_->server_host_,
- ts_->base_port_);
+ ACE_OS::sprintf (ior,
+ "%s://%s:%d",
+ ts_->ior_header_,
+ ts_->server_host_,
+ ts_->base_port_);
frequency = CB_HIGH_PRIORITY_RATE;
}
else
@@ -214,10 +227,11 @@ Client::svc (void)
ACE_DEBUG ((LM_DEBUG,
"(%t) Im a low priority client, my id is %d\n",
thread_id));
- ::sprintf (ior,
- "cool-tcp://%s:%d",
- ts_->server_host_,
- ts_->base_port_);// + thread_id);
+ ACE_OS::sprintf (ior,
+ "%s://%s:%d",
+ ts_->ior_header_,
+ ts_->server_host_,
+ ts_->base_port_);// + thread_id);
frequency = CB_LOW_PRIORITY_RATE;
}
}
@@ -225,6 +239,9 @@ Client::svc (void)
{
switch (thread_id)
{
+/////////////////////////////////////
+// THIS NEEDS TO BE UPDATED AS ABOVE.
+/////////////////////////////////////
case CB_40HZ_CONSUMER:
ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, my id is %d.\n", thread_id));
::sprintf (ior, "cool-tcp://%s:%d", ts_->server_host_, ts_->base_port_);
@@ -274,15 +291,13 @@ Client::svc (void)
//
- // Initialise client's binding to an
+ // Initialize client's binding to an
// arbitrary cubit server (at some host)
//
COOL::EOABindingData bindingData (ior);
cb = Cubit::_bind(bindingData, env);
-
-
// objref = orb_ptr->string_to_object ((CORBA::String) ior, env);
// if (env.exception () != 0)
@@ -318,8 +333,6 @@ Client::svc (void)
ACE_OS::fflush (stdout);
ACE_DEBUG ((LM_DEBUG, "Object Created at: '%ul'", cb));
ACE_DEBUG ((LM_DEBUG, "connected to object '%s'", str));
- // if (cb->cube_short (2, env) == 8) // dummy call.
- // ACE_DEBUG ((LM_DEBUG, "(%t) Made successful dummy call"));
}
ACE_DEBUG ((LM_DEBUG, "(%t) Waiting for other threads to finish binding..\n"));
@@ -350,18 +363,32 @@ Client::run_tests (Cubit_ptr cb,
double latency = 0;
double sleep_time = (1/frequency) * (1000 * 1000);
double delta = 0;
- // Make the calls in a loop.
+ int pstartTime = 0;
+ int pstopTime = 0;
+ double real_time = 0.0;
+
+#if defined (USE_QUANTIFY)
+ quantify_stop_recording_data();
+ quantify_clear_data ();
+#endif /* USE_QUANTIFY */
+
+ // Make the calls in a loop.
for (i = 0; i < loop_count; i++)
{
-#if defined (VXWORKS)
- TimeStamp(&start[i]);
-#else
- ACE_Profile_Timer timer;
+ ACE_High_Res_Timer timer_;
ACE_Time_Value tv (0, (long int) (sleep_time - delta));
ACE_OS::sleep (tv);
- timer.start ();
-#endif /* defined (VXWORKS) */
+
+ // Elapsed time will be in microseconds.
+ ACE_Time_Value delta_t;
+
+#if defined (CHORUS)
+ pstartTime = pccTime1Get();
+#else /* CHORUS */
+ timer_.start ();
+#endif /* !CHORUS */
+
switch (datatype)
{
case CB_OCTET:
@@ -369,7 +396,16 @@ Client::run_tests (Cubit_ptr cb,
// Cube an octet.
CORBA::Octet arg_octet = func (i), ret_octet = 0;
+#if defined (USE_QUANTIFY)
+ /* start recording quantify data from here */
+ quantify_start_recording_data ();
+#endif /* USE_QUANTIFY */
ret_octet = cb->cube_octet (arg_octet, env);
+
+#if defined (USE_QUANTIFY)
+ quantify_stop_recording_data();
+#endif /* USE_QUANTIFY */
+
if (env.exception () != 0)
{
CORBA::SystemException* ex;
@@ -405,8 +441,17 @@ Client::run_tests (Cubit_ptr cb,
CORBA::Short arg_short = func (i), ret_short;
+#if defined (USE_QUANTIFY)
+ // start recording quantify data from here.
+ quantify_start_recording_data ();
+#endif /* USE_QUANTIFY */
+
ret_short = cb->cube_short (arg_short, env);
+#if defined (USE_QUANTIFY)
+ quantify_stop_recording_data();
+#endif /* USE_QUANTIFY */
+
if (env.exception () != 0)
ACE_ERROR_RETURN ((LM_ERROR,
"%s:Call failed\n",
@@ -430,8 +475,17 @@ Client::run_tests (Cubit_ptr cb,
CORBA::Long arg_long = func (i), ret_long;
+#if defined (USE_QUANTIFY)
+ // start recording quantify data from here.
+ quantify_start_recording_data ();
+#endif /* USE_QUANTIFY */
+
ret_long = cb->cube_long (arg_long, env);
+#if defined (USE_QUANTIFY)
+ quantify_stop_recording_data();
+#endif /* USE_QUANTIFY */
+
if (env.exception () != 0)
ACE_ERROR_RETURN ((LM_ERROR,"%s:Call failed\n", env.exception ()), 2);
@@ -456,8 +510,17 @@ Client::run_tests (Cubit_ptr cb,
arg_struct.s = func (i);
arg_struct.o = func (i);
+#if defined (USE_QUANTIFY)
+ // start recording quantify data from here.
+ quantify_start_recording_data ();
+#endif /* USE_QUANTIFY */
+
ret_struct = cb->cube_struct (arg_struct, env);
+#if defined (USE_QUANTIFY)
+ quantify_stop_recording_data();
+#endif /* USE_QUANTIFY */
+
if (env.exception () != 0)
ACE_ERROR_RETURN ((LM_ERROR,"%s:Call failed\n", env.exception ()), 2);
@@ -477,45 +540,84 @@ Client::run_tests (Cubit_ptr cb,
}
}
-#if defined (VXWORKS)
- TimeStamp(&stop[i]);
- elapsed_time[i] = DeltaTime(start[i], stop[i]);
- delta = ( (0.4 * fabs (elapsed_time[i])) + (0.6 * delta) ); // pow(10,6)
- latency += (double)elapsed_time[i];
-#else
- timer.stop();
- ACE_Profile_Timer::ACE_Elapsed_Time et;
- timer.elapsed_time (et);
- delta = ((0.4 * fabs (et.real_time * (1000 * 1000))) + (0.6 * delta)); // pow(10,6)
- latency += et.real_time;
- my_jitter_array [i] = et.real_time * 1000;
-#endif /* defined (VXWORKS) */
+ // use sysBench when CHORUS defined and option specified on command line
+#if defined (CHORUS)
+ if ( (loop_count % ts_->grain_) == 0)
+ pstopTime = pccTime1Get();
+#else /* CHORUS */
+ // if CHORUS is not defined just use plain timer_.stop ().
+ timer_.stop ();
+ timer_.elapsed_time (delta_t);
+#endif /* !CHORUS */
+
+ // Calculate time elapsed
+#if defined (ACE_LACKS_FLOATING_POINT)
+# if defined (CHORUS)
+ real_time = pstopTime - pstartTime;
+ my_jitter_array [i/ts_->grain_] = real_time; // in units of microseconds.
+ // update the latency array, correcting the index using the granularity
+# else /* CHORUS */
+ // Store the time in usecs.
+ real_time = delta_t.sec () * ACE_ONE_SECOND_IN_USECS +
+ delta_t.usec ();
+ my_jitter_array [i] = real_time; // in units of microseconds.
+# endif /* !CHORUS */
+ delta = ((40 * fabs (real_time) / 100) + (60 * delta / 100)); // pow(10,6)
+ latency += real_time;
+#else /* ACE_LACKS_FLOATING_POINT */
+ delta = ((0.4 * fabs (real_time * (1000 * 1000))) + (0.6 * delta)); // pow(10,6)
+ latency += real_time;
+ my_jitter_array [i] = real_time * 1000;
+#endif /* !ACE_LACKS_FLOATING_POINT */
}
-#if defined (VXWORKS)
- int ave_latency = stats(elapsed_time, loop_count);
- put_ave_latency(ave_latency, thread_id);
-#endif
-
if (call_count > 0)
{
-#if !defined (VXWORKS)
if (error_count == 0)
{
+#if defined (ACE_LACKS_FLOATING_POINT)
+ double calls_per_second = (call_count * ACE_ONE_SECOND_IN_USECS) / latency;
+#endif /* ACE_LACKS_FLOATING_POINT */
latency /= call_count;
if (latency > 0)
{
+#if defined (ACE_LACKS_FLOATING_POINT)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) cube average call ACE_OS::time\t= %u usec, \t"
+ "%u calls/second\n",
+ latency,
+ calls_per_second));
+
+ this->put_latency (my_jitter_array,
+ latency,
+ thread_id);
+#else
ACE_DEBUG ((LM_DEBUG, "cube average call ACE_OS::time\t= %f msec, \t"
"%f calls/second\n",
latency * 1000,
1 / latency));
- this->put_latency (my_jitter_array, latency * 1000, thread_id);
+ this->put_latency (my_jitter_array,
+ latency * 1000,
+ thread_id);
+#endif /* ! ACE_LACKS_FLOATING_POINT */
+ }
+ else
+ {
+ // still we have to call this function to store a valid array pointer.
+ this->put_latency (my_jitter_array,
+ 0,
+ thread_id);
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Warning: Latency is less than or equal to zero."
+ " Precision may have been lost.\n"));
}
}
-#endif /* !defined (VXWORKS) */
- ACE_DEBUG ((LM_DEBUG, "%d calls, %d errors\n", call_count, error_count));
+ ACE_DEBUG ((LM_DEBUG,
+ "%d calls, %d errors\n",
+ call_count,
+ error_count));
}
// cb->please_exit (env);
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.h b/TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.h
index 038f8a1db53..3e7e301e9a0 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.h
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/Task_Client.h
@@ -1,3 +1,5 @@
+// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -14,19 +16,40 @@
#if !defined (TASK_CLIENT_H)
#define TASK_CLIENT_H
+#include <corba/cool.H>
+#include "api/api.H"
+#include "cubit.H"
+
#include "ace/Synch.h"
#include "ace/Task.h"
#include "ace/Thread_Manager.h"
#include "ace/Get_Opt.h"
#include "ace/Profile_Timer.h"
#include <math.h>
-#include "api/api.H"
-#include "cubit.H"
+#if defined (CHORUS)
+#include "pccTimer.h"
+#endif /* CHORUS */
+
+// @@ Should we put this into a more general file, e.g., OS.h?
+//
+// I will integrate this, together with the sqrt() function when
+// the implementation is complete. --Sergio.
+#if defined (ACE_LACKS_FLOATING_POINT)
+#define double ACE_UINT32
+#define fabs(X) ((X) >= 0 ? (X) : -(X))
+// the following is just temporary, until we finish the sqrt()
+// implementation.
+#define sqrt(X) (1)
+#endif /* ACE_LACKS_FLOATING_POINT */
// Arbitrary generator used by the client to create the numbers to be
// cubed.
-inline int func (unsigned i) { return i - 117; }
+inline int
+func (unsigned i)
+{
+ return i - 117;
+}
// The various datatypes which the client and the server can exchange.
enum Cubit_Datatypes
@@ -59,8 +82,6 @@ class Task_State
// = DESCRIPTION
// This class maintains state which is common to the potentially
// multiple concurrent clients.
-
-
{
public:
ACE_Barrier *barrier_;
@@ -93,9 +114,6 @@ public:
// Array to store the latency for every client, indexed by
// thread-id.
- int *ave_latency_;
- // Int array to store the latencies
-
Cubit_Datatypes datatype_;
// Which datatype to use to make the calls
@@ -113,6 +131,19 @@ public:
// this array stores the latency seen by each client for each
// request, to be used later to compute jitter
+ u_int use_chorus_ipc_;
+ // flag that indicates that we are going to use Chorus IPC
+ // communication mechanism, instead of the TCP/IP protocol stack.
+ // This only applies to the CHORUS ClassiX OS.
+
+ char * ior_header_;
+ // pointer to the ior part where you specify the type of transport
+ // for COOL (i.e. ipc or tcp)
+
+ u_int grain_;
+ // this is the granularity of the timing of the CORBA requests. A
+ // value of 5 represents that we will take time every 5 requests,
+ // instead of the default of every request (1).
};
class Client : public ACE_Task<ACE_MT_SYNCH>
@@ -148,9 +179,6 @@ private:
unsigned int);
// Records the latencies in the Task_State
- void put_ave_latency (int latency, unsigned int);
- // Records the latencies in the Task_State
-
int parse_args (int, char **);
// parses the arguments
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/Util_Thread.cpp b/TAO/tests/Cubit/COOL/MT_Cubit/Util_Thread.cpp
index a883a3537ec..aaf4ace0192 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/Util_Thread.cpp
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/Util_Thread.cpp
@@ -18,7 +18,11 @@ Util_Thread::svc (void)
"(%t) Utilization Thread created, "
"waiting for threads to finish binding\n"));
- // Sumedh, please add comments here.
+ // this barrier synchronizes the utilization thread with
+ // the client threads
+ // i.e., the Util_thread should wait until all the
+ // clients have finished binding, and only then
+ // start measuring the utilization.
this->ts_->barrier_->wait ();
ACE_DEBUG ((LM_DEBUG,
@@ -35,35 +39,22 @@ Util_Thread::get_number_of_computations (void)
return this->number_of_computations_;
}
-// Perform repeated prime factor computations on an arbitrary number
-// and you thought your life was boring. :-)
+// Perform repeated prime factor computations on an arbitrary number.
+// And you thought your life was boring... :-)
int
Util_Thread::run_computations (void)
{
- // Sumedh, isn't there a "ACE::is_prime()" method that we can reuse
- // here? If this doesn't work right, can you please add a new
- // method in class ACE so that we can leverage existing effort and
- // prepare for the future?
-
while (this->done_ == 0)
{
- u_long original = CUBIT_ARBIT_NUMBER;
- u_long n = original;
- u_long test_done = 1;
- u_long sqrt_n = (u_long) ceil (sqrt (n));
- u_long i;
-
- for (i = 2; i <= sqrt_n; i++)
- while ((n % i) == 0)
- {
- n /= i;
- test_done *= i;
- }
-
- ACE_ASSERT (test_done * n == original);
-
+ // See if this number is prime. 2 and CUBIT_ARBIT_NUMBER / 2 are
+ // the recommended values for min_factor and max_factor, as
+ // explained in ACE.h (is_prime).
+ ACE::is_prime (CUBIT_ARBIT_NUMBER,
+ 2,
+ CUBIT_ARBIT_NUMBER / 2);
this->number_of_computations_ ++;
}
+
return 0;
}
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/client.cpp b/TAO/tests/Cubit/COOL/MT_Cubit/client.cpp
index 4ec478f6ea9..f0b6adb3c27 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/client.cpp
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/client.cpp
@@ -1,3 +1,5 @@
+// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -49,62 +51,42 @@ do_priority_inversion_test (Task_State &ts)
ACE_Sched_Priority priority =
ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
ACE_SCOPE_THREAD);
-
+
// First activate the Utilization thread. It will wait until all
// threads have finished binding.
util_thread.activate (THR_BOUND,
1,
0,
priority);
-
-
- // Now activate the high priority client.
- // @@ The ifdef here is temporarily placed here until
- // I figure out how to map NT's thread priorities
- // into pthread's priorities.
-#if defined (ACE_THR_PRI_FIFO_DEF)
+ // Now activate the high priority client.
priority = ACE_THR_PRI_FIFO_DEF;
-#else
- priority = ACE_DEFAULT_THREAD_PRIORITY;
-#endif
-
+
if (high_priority_client.activate (THR_BOUND | ACE_SCHED_FIFO,
1,
0,
priority) == -1)
-
ACE_ERROR ((LM_ERROR,
"%p\n",
"activate failed"));
- // @@ Sumedh, can you please document why we need this VxWorks
- // #ifdef? Is there a way to make this more general so we don't
- // need the #ifdef? In other words, please check with David or
- // Brian about this.
-
-#if !defined (VXWORKS)
- priority =
- ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
-#else
- priority = 65;
-#endif /* !defined (VXWORKS) */
-
+ // Drop the priority, so that the priority of clients will increase
+ // with increasing client number.
+ for (int i = 0; i < ts.thread_count_; i++)
+ priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
+ priority,
+ ACE_SCOPE_THREAD);
+
ACE_DEBUG ((LM_DEBUG,
- "Creating %d clients with low priority\n",
- ts.thread_count_ - 1));
-
+ "Creating %d clients with low priority of %d\n",
+ ts.thread_count_ - 1,
+ priority));
+
for (u_int i = 0; i < ts.thread_count_ - 1; i++)
{
// The first thread starts at min + 1, since the minimum
// priority thread is the utilization thread.
- // get the next higher priority
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
if (low_priority_client.activate (THR_BOUND,
1,
1,
@@ -112,11 +94,63 @@ do_priority_inversion_test (Task_State &ts)
ACE_ERROR ((LM_ERROR,
"%p\n",
"activate failed"));
+
+ // get the next higher priority
+ priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
+ priority,
+ ACE_SCOPE_THREAD);
}
// Wait for all the threads to exit.
ACE_Thread_Manager::instance ()->wait ();
-#if !defined (VXWORKS)
+#if defined (VXWORKS)
+ ACE_OS::printf ("Test done.\n"
+ "High priority client latency : %d usec\n"
+ "Low priority client latency : %d usec\n",
+ high_client.get_high_priority_latency (),
+ low_client.get_low_priority_latency ());
+#elif defined (CHORUS)
+ ACE_OS::printf ("Test done.\n"
+ "High priority client latency : %u usec\n"
+ "Low priority client latency : %u usec\n",
+ high_priority_client.get_high_priority_latency (),
+ low_priority_client.get_low_priority_latency ());
+
+ // output the latency values to a file, tab separated, to import it
+ // to Excel to calculate jitter, in the mean time we come up with
+ // the sqrt() function.
+ FILE *latency_file_handle = 0;
+ char latency_file[BUFSIZ];
+ char buffer[BUFSIZ];
+
+ ACE_OS::sprintf (latency_file,
+ "cb__%d.txt",
+ ts.thread_count_);
+
+ ACE_OS::fprintf(stderr,
+ "--->Output file for latency data is \"%s\"\n",
+ latency_file);
+
+ latency_file_handle = ACE_OS::fopen (latency_file, "w");
+
+ for (u_int j = 0; j < ts.start_count_; j ++)
+ {
+ ACE_OS::sprintf(buffer,
+ "%s #%d",
+ j==0? "High Priority": "Low Priority",
+ j);
+ for (u_int i = 0; i < ts.loop_count_; i ++)
+ {
+ ACE_OS::sprintf(buffer+strlen(buffer),
+ "\t%u\n",
+ ts.global_jitter_array_[j][i]);
+ fputs (buffer, latency_file_handle);
+ buffer[0]=0;
+ }
+ }
+
+ ACE_OS::fclose (latency_file_handle);
+#else
ACE_DEBUG ((LM_DEBUG, "Test done.\n"
"High priority client latency : %f msec, jitter: %f msec\n"
"Low priority client latency : %f msec, jitter: %f msec\n",
@@ -124,20 +158,24 @@ do_priority_inversion_test (Task_State &ts)
high_priority_client.get_high_priority_jitter (),
low_priority_client.get_low_priority_latency (),
low_priority_client.get_low_priority_jitter ()));
+#endif /* !defined (CHORUS) && !defined (VXWORKS) */
+
+ // signal the utilization thread to finish with its work..
+ util_thread.done_ = 1;
+
+ // This will wait for the utilization thread to finish.
+ thr_mgr.wait ();
+
+#if defined (ACE_LACKS_FLOATING_POINT)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) utilization task performed %u computations\n",
+ util_thread.get_number_of_computations ()));
#else
- ACE_OS::printf ("Test done.\n"
- "High priority client latency : %d usec\n"
- "Low priority client latency : %d usec\n",
- high_client.get_high_priority_latency (),
- low_client.get_low_priority_latency ());
-#endif /* !defined (VXWORKS) */
- util_thread.done_ = 1;
- thr_mgr.wait ();
- cerr << "utilization task performed "
- << util_thread.get_number_of_computations ()
- << " computations"
- << endl;
-
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) utilization task performed %g computations\n",
+ util_thread.get_number_of_computations ()));
+#endif /* ! ACE_LACKS_FLOATING_POINT */
+
return 0;
}
@@ -191,7 +229,7 @@ do_thread_per_rate_test (Task_State &ts)
CB_20Hz_client.get_latency (1),
CB_10Hz_client.get_latency (2),
CB_5Hz_client.get_latency (3),
- CB_1Hz_client.get_latency (4));
+ CB_1Hz_client.get_latency (4));
return 0;
}
@@ -216,9 +254,32 @@ main (int argc, char *argv [])
#endif /* defined (FORCE_ARGS) */
Task_State ts (argc, argv);
+
+#if defined (CHORUS)
+ // start the pccTimer for chorus classix
+ int pTime;
+
+ // Initialize the PCC timer Chip
+ pccTimerInit();
+
+ if(pccTimer(PCC2_TIMER1_START,&pTime) !=K_OK)
+ {
+ printf("pccTimer has a pending bench mark\n");
+ }
+#endif
+
if (ts.thread_per_rate_ == 0)
do_priority_inversion_test (ts);
else
do_thread_per_rate_test (ts);
+
+#if defined (CHORUS)
+ // stop the pccTimer for chorus ClassiX
+ if(pccTimer(PCC2_TIMER1_STOP,&pTime) !=K_OK)
+ {
+ printf("pccTimer has a pending benchmark\n");
+ }
+#endif
+
return 0;
}
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/client.h b/TAO/tests/Cubit/COOL/MT_Cubit/client.h
index dc355016ad1..b4066444a7c 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/client.h
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/client.h
@@ -1,3 +1,5 @@
+// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -11,15 +13,21 @@
//
// ============================================================================
+#include <corba/cool.H>
+#include "cubit.H"
+
#include "ace/Task.h"
#include "ace/Thread_Manager.h"
#include "ace/Get_Opt.h"
#include "ace/Sched_Params.h"
-#include "cubit.H"
#include "Task_Client.h"
#include "Util_Thread.h"
+#if defined (CHORUS)
+#include "pccTimer.h"
+#endif /* CHORUS */
+
#if defined (VME_DRIVER)
#include <hostLib.h>
extern "C" STATUS vmeDrv (void);
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.cpp b/TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.cpp
index 1f50e334099..8e98bfef258 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.cpp
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.cpp
@@ -1,5 +1,7 @@
-#include "ace/ACE.h"
+// $Id$
+
#include "cubit_impl.h"
+#include "ace/ACE.h"
CORBA::Octet Cubit_Impl:: cube_octet (CORBA::Octet o, CORBA::Environment &IT_env)
{
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.h b/TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.h
index f6651687b88..20cf27424af 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.h
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/cubit_impl.h
@@ -1,7 +1,9 @@
+// $Id$
#ifndef cubit_ih
#define cubit_ih
+#include <corba/cool.H>
#include "cubit.H"
class Cubit_Impl {
diff --git a/TAO/tests/Cubit/COOL/MT_Cubit/server.cpp b/TAO/tests/Cubit/COOL/MT_Cubit/server.cpp
index 97bd79847bd..fa79b11ba86 100644
--- a/TAO/tests/Cubit/COOL/MT_Cubit/server.cpp
+++ b/TAO/tests/Cubit/COOL/MT_Cubit/server.cpp
@@ -1,11 +1,17 @@
-//**************************************************************************
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests
//
-// NAME : tpr_server.cpp
-// DESCRIPTION:
+// = FILENAME
+// server.cpp
//
-// Server mainline
+// = AUTHOR
+// Andy Gokhale, Sumedh Mungee, and Sergio Flores-Gaitan
//
-//****************************************************************************
+// ============================================================================
#include <api/binding.H>
#include <api/api.H>
@@ -24,14 +30,6 @@ CORBA_BOA_ptr boa;
int
create_servant (void *arg)
{
- // char name [1024];
- // int i = * (int *)arg;
- //
- // if (i == 0)
- // strcpy (name, "HP_Cubit");
- // else
- // strcpy (name, "LP_Cubit");
-
char ** argv = (char **) arg;
CORBA_Environment env;
@@ -132,22 +130,21 @@ main (int argc, char** argv)
ACE_DEBUG ((LM_ERROR, "OA_init failed..\n"));
return -1;
}
-
+
COOL_Activity_ptr new_activity [2];
-
+
for (int i = 0; i < 1; i++)
{
if (thisCapsule->createActivity ((COOL_ActivityFunc) create_servant,
- //(void *) &i,
(void *) argv,
new_activity [i]) != C_OK)
{
- ACE_ERROR ((LM_ERROR, "%p\n", "activate failed\n"));
+ ACE_ERROR ((LM_ERROR, "%p\n", "activate failed\n"));
}
}
-
+
CORBA_Long status;
- for (i = 0; i < 1; i++)
+ for (int i = 0; i < 1; i++)
{
if (new_activity [i]->join (status) != C_OK)
{