summaryrefslogtreecommitdiff
path: root/TAO/performance-tests/Cubit
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/performance-tests/Cubit')
-rwxr-xr-xTAO/performance-tests/Cubit/TAO/MT_Cubit/MT_Cubit_Test61
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile100
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/README91
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp939
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h253
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp86
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.h56
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp688
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h35
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit.idl38
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp57
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h47
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp691
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h116
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/svc.conf49
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/tmplinst.cpp12
16 files changed, 0 insertions, 3319 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/MT_Cubit_Test b/TAO/performance-tests/Cubit/TAO/MT_Cubit/MT_Cubit_Test
deleted file mode 100755
index f75e46c2bdf..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/MT_Cubit_Test
+++ /dev/null
@@ -1,61 +0,0 @@
-#! /bin/sh
-# $Id$
-#
-# Spawns MT_Cubit server and client executables on a single host.
-
-usage="usage: $0 [-n <iterations>] [-t] <number of low priority threads>"
-
-user=`whoami`
-ior_file=/tmp/MT_Cubit-ior.${user}
-iterations=1000
-client_exec_prefix=time
-
-if [ "$HOSTTYPE" = "lynxos" ]; then
- server_exec_prefix='prio 30'
- tmp='/tmp/'
-else
- server_exec_prefix=
- tmp=
-fi
-
-
-########
-######## Interpret command arguments.
-########
-while getopts ?n:t arg; do
- case $arg in
- n ) iterations=$OPTARG ;;
- t ) tmp='/tmp/' ;;
- '?' ) echo $usage; exit 0 ;;
- esac
-done
-shift `expr $OPTIND - 1`
-
-if [ $# -ne 1 ]; then
- echo $usage
- exit 1
-fi
-threads=`expr $1 + 1`
-
-
-########
-######## Enable signal handler.
-########
-trap 'kill -1 $server_pid; /bin/rm -f $ior_file' 0 1 2 15
-
-
-########
-######## Start server and save its pid.
-########
-$server_exec_prefix ./server -s -f $ior_file -t $threads > \
- ${tmp}server.log 2>&1 &
-server_pid=$!
-
-sleep 4
-
-
-########
-######## Start client.
-########
-$client_exec_prefix ./client -s -f $ior_file -t $threads -n $iterations > \
- ${tmp}client-${threads}.log 2>&1
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile
deleted file mode 100644
index ddf3689d621..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Makefile
+++ /dev/null
@@ -1,100 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-ifndef TAO_ROOT
- TAO_ROOT = $(ACE_ROOT)/TAO
-endif # ! TAO_ROOT
-
-LDLIBS = -lorbsvcs -lTAO $(MATHLIB)
-
-IDL_SRC = cubitC.cpp cubitS.cpp
-PROG_SRCS = server.cpp \
- cubit_i.cpp \
- Task_Client.cpp \
- client.cpp \
- Util_Thread.cpp \
- tmplinst.cpp
-
-LSRC = $(IDL_SRC) $(PROG_SRCS)
-
-CUBIT_SVR_OBJS = \
- cubitC.o \
- cubitS.o \
- server.o \
- cubit_i.o \
- tmplinst.o
-
-CUBIT_CLIENT_OBJS = \
- cubitC.o \
- cubitS.o \
- Task_Client.o \
- client.o \
- Util_Thread.o \
- tmplinst.o
-
-BIN = server client
-BUILD = $(BIN)
-VLDLIBS = $(LDLIBS:%=%$(VAR))
-VBIN = $(BIN:%=%$(VAR))
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(TAO_ROOT)/rules.tao.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-# Local modifications to variables imported by includes above.
-#CPPFLAGS += -DACE_NLOGGING
-
-#CXX := purify $(CXX)
-
-LDFLAGS += -L$(TAO_ROOT)/tao -L$(TAO_ROOT)/orbsvcs
-CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT)/tao/compat
-
-# 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
-
-#
-ifdef quantify
- CPPFLAGS += -I/pkg/purify/quantify-3.0-solaris2
-endif
-
-.PRECIOUS: cubitC.h cubitC.i cubitC.cpp cubitS.h cubitS.i cubitS.cpp
-
-server: $(addprefix $(VDIR),$(CUBIT_SVR_OBJS))
- $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK)
-
-client: $(addprefix $(VDIR),$(CUBIT_CLIENT_OBJS))
- $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK)
-
-clean:
- -/bin/rm -rf *.o $(BIN) obj.* core Templates.DB .make.state
-
-realclean: clean
- -/bin/rm -rf cubitC.* cubitS.* cubitS_T.*
-
-# DO NOT DELETE THIS LINE -- g++dep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/README b/TAO/performance-tests/Cubit/TAO/MT_Cubit/README
deleted file mode 100644
index a31165c83f2..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/README
+++ /dev/null
@@ -1,91 +0,0 @@
-// $Id$
-
-The MT-Cubit example
---------------------
-
-Compiling
----------
-
-Makefile is provided. Use make to compile. Except, see below for
-VxWorks-specific instructions for building the client.
-
-You can either run the server in the background in the same window as
-the client or open a separate window for the client and server.
-
-server:
--------
-
-./server -p <port_num> -h <my_hostname> -t <number_of_servants>
-
-port_num is the port number at which the server will start the first
-(and highest priority) servant. Successive servants (with successively
-lower priorities) will be created starting at (port_num+1). The -n
-parameter specifies the total number of servants.
-
-The server will print the IOR of the servants, but it is not required
-by the client.
-
-client:
--------
-
-./client [-ORBobjrefstyle url]
- [-p <port_num>]
- [-h <server_hostname>]
- [-d <datatype>]
- [-n <num_calls>]
- [-t <num_of_clients>]
- [-r]
-
-[-ORBobjrefstyle url] Makes the IOR appear in URL format instead
- of that ugly number sequence format.
-
-<port_num> is the port number of the highest priority servant and
- should be the same as the port_num supplied to the server, as
- described earlier. The lower priority servant is assumed to be at
- (port_num+1).
-
-<server_hostname> is the hostname of the server.
-
- Based on the server_hostname and the port_num, the client
- automatically constructs the IOR's for the servants
-
-<datatype> is one of the following:
-
- 0 Octet
- 1 Short
- 2 Long
- 3 Struct of the above 3 types
-
-<num_calls> is the number of CORBA twoway calls to be made
-
-<num_of_clients> is the total number of concurrent clients to be
- created. The clients will have successively decreasing
- priorities.
-
-[-r] this option can be used to turn on the thread-per-rate tests.
-
-[-o] enables oneway calls instead of two-way calls. The oneway call
- is a noop call (for now).
-
-[-x] makes the client call the shutdown() method on the servant which
- invokes the shutdown() method on the ORB and causes it to exit.
-
-To build the client for VxWorks, for running the server and client
-on a single target:
-
- % make BIN=client ACELIB= LDLIBS="$ACE_ROOT/ace/.obj/High_Res_Timer.o $ACE_ROOT/ace/.obj/gethrtime.o"
-
-To run the server and client on a single target:
-
- -> iam "<login>"
- -> ld < server
- -> ld < client
- -> spa server, "-s", "-f", "ior.txt", "-t", "2"
- -> spa client, "-s", "-f", "ior.txt", "-t", "2", "-n", "1000"
-
-Results
--------
-
-The client prints the latency observed by the high priority client,
-and the average latency observed by the low priority clients. Jitter
-(standard deviation of the latency) is also printed by the client.
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
deleted file mode 100644
index 706280166f2..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
+++ /dev/null
@@ -1,939 +0,0 @@
-// $Id$
-
-#include "Task_Client.h"
-#include "ace/Stats.h"
-
-#if defined (ACE_QUANTIFY)
-#include "quantify.h"
-#endif /* ACE_QUANTIFY */
-
-Task_State::Task_State (int argc, char **argv)
- : key_ ("Cubit"),
- start_count_ (0),
- loop_count_ (1000),
- thread_count_ (2),
- datatype_ (CB_OCTET),
- argc_ (argc),
- argv_ (argv),
- thread_per_rate_ (0),
- global_jitter_array_ (0),
- shutdown_ (0),
- oneway_ (0),
- use_name_service_ (1),
- one_to_n_test_ (0),
- context_switch_test_ (0),
- ior_file_ (0),
- granularity_ (1),
- use_utilization_test_ (0),
- high_priority_loop_count_ (0)
-{
- ACE_Get_Opt opts (argc, argv, "usn:t:d:rxof:g:1c");
- int c;
- int datatype;
-
- while ((c = opts ()) != -1)
- switch (c) {
- case 'g':
- granularity_ = ACE_OS::atoi (opts.optarg);
- if (granularity_ < 1)
- granularity_ = 1;
- break;
- case 'c':
- context_switch_test_ = 1;
- break;
- case '1':
- one_to_n_test_ = 1;
- break;
- case 'u':
- use_utilization_test_ = 1;
- break;
- case 's':
- use_name_service_ = 0;
- break;
- case 'f':
- ior_file_ = ACE_OS::strdup (opts.optarg);
- break;
- case 'o':
- oneway_ = 1;
- break;
- case 'x':
- shutdown_ = 1;
- break;
- case 'r':
- thread_per_rate_ = 1;
- break;
- case 'd':
- datatype = ACE_OS::atoi (opts.optarg);
- switch (datatype)
- {
- case CB_OCTET:
- ACE_DEBUG ((LM_DEBUG, "Testing Octets\n"));
- datatype_ = CB_OCTET;
- break;
- case CB_LONG:
- ACE_DEBUG ((LM_DEBUG, "Testing Longs\n"));
- datatype_ = CB_LONG;
- break;
- case CB_STRUCT:
- ACE_DEBUG ((LM_DEBUG, "Testing Structs\n"));
- datatype_ = CB_STRUCT;
- break;
- case CB_SHORT:
- default:
- ACE_DEBUG ((LM_DEBUG, "Testing Shorts\n"));
- datatype_ = CB_SHORT;
- break;
- }
- continue;
- case 'n': // loop count
- loop_count_ = (u_int) ACE_OS::atoi (opts.optarg);
- continue;
- case 't':
- thread_count_ = (u_int) ACE_OS::atoi (opts.optarg);
- continue;
- case '?':
- default:
- ACE_DEBUG ((LM_DEBUG, "usage: %s"
- "[-d datatype Octet=0, Short=1, Long=2, Struct=3]"
- " [-n num_calls]"
- " [-t num_threads]"
- " [-f ior_file]"
- " [-x] // makes a call to servant to shutdown"
- " [-o] // makes client use oneway calls instead"
- " [-s] // makes client *NOT* use the name service"
- " [-g granularity_of_timing]"
- "\n", argv [0]));
- }
-
- if (thread_per_rate_ == 1)
- thread_count_ = 5;
-
- // allocate the array of character pointers.
- ACE_NEW (iors_,
- char *[thread_count_]);
-
- if (ior_file_ != 0)
- {
- FILE *ior_file = ACE_OS::fopen (ior_file_, "r");
- char buf[BUFSIZ];
- u_int i = 0;
- int j = 0;
-
- while (ACE_OS::fgets (buf, BUFSIZ, ior_file) != 0 && i < thread_count_)
- {
- j = ACE_OS::strlen (buf);
- buf[j - 1] = 0; // this is to delete the "\n" that was read from the file.
- iors_[i] = ACE_OS::strdup (buf);
- i++;
- }
-
- ACE_OS::fclose (ior_file);
- }
-
- // thread_count_ + 2 because there is one utilization thread also
- // wanting to begin at the same time the clients begin && the main
- // thread wants to know when clients will start running to get
- // accurate context switch numbers.
- if (thread_per_rate_ == 0)
- {
- if (use_utilization_test_ == 1)
- // If we are to use the utilization test, include it in the
- // barrier count. See description of this variable in header
- // file.
- {
- ACE_NEW (barrier_,
- ACE_Barrier (thread_count_ + 2));
- }
- else
- {
- ACE_NEW (barrier_,
- ACE_Barrier (thread_count_ + 1));
- }
- }
- else
- {
- ACE_NEW (barrier_,
- ACE_Barrier (thread_count_));
- }
-
- ACE_NEW (semaphore_,
- ACE_Thread_Semaphore (0));
- ACE_NEW (latency_,
- double [thread_count_]);
- ACE_NEW (global_jitter_array_,
- double *[thread_count_]);
-}
-
-Client::Client (ACE_Thread_Manager &thread_manager, Task_State *ts, u_int id)
- : ACE_MT (ACE_Task<ACE_MT_SYNCH> (&thread_manager)),
- ts_ (ts),
- id_ (id)
-{
-}
-
-void
-Client::put_latency (double *jitter,
- double latency,
- u_int thread_id)
-{
- ACE_MT (ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, ts_->lock_));
-
- ts_->latency_[thread_id] = latency;
- ts_->global_jitter_array_[thread_id] = jitter;
-
-#if defined (ACE_LACKS_FLOATING_POINT)
- ACE_DEBUG ((LM_DEBUG,
- "(%t) My latency was %u msec\n",
- latency));
-#else
- ACE_DEBUG ((LM_DEBUG,
- "(%t) My latency was %f msec\n",
- latency));
-#endif /* ! ACE_LACKS_FLOATING_POINT */
-}
-
-double
-Client::get_high_priority_latency (void)
-{
- return (double) ts_->latency_ [0];
-}
-
-double
-Client::get_low_priority_latency (void)
-{
- if (ts_->thread_count_ == 1)
- return 0;
-
- double l = 0;
-
- for (u_int i = 1; i < ts_->thread_count_; i++)
- l += (double) ts_->latency_[i];
-
- return l / (double) (ts_->thread_count_ - 1);
-}
-
-double
-Client::get_latency (u_int thread_id)
-{
- return ACE_static_cast (double, ts_->latency_ [thread_id]);
-}
-
-double
-Client::get_high_priority_jitter (void)
-{
- double jitter = 0.0;
- double average = get_high_priority_latency ();
- double number_of_samples = ts_->high_priority_loop_count_ / ts_->granularity_;
-
- // Compute the standard deviation (i.e. jitter) from the values
- // stored in the global_jitter_array_.
-
- ACE_Stats stats;
-
- // We first compute the sum of the squares of the differences
- // each latency has from the average
- for (u_int i = 0; i < number_of_samples; i ++)
- {
- double difference =
- ts_->global_jitter_array_ [0][i] - average;
- jitter += difference * difference;
- stats.sample ((ACE_UINT32) (ts_->global_jitter_array_ [0][i] * 1000 + 0.5));
- }
-
- // Return the square root of the sum of the differences computed
- // above, i.e. jitter.
-
- ACE_OS::fprintf (stderr, "high priority jitter:\n");
- stats.print_summary (3, 1000, stderr);
-
- return sqrt (jitter / (number_of_samples - 1));
-}
-
-double
-Client::get_low_priority_jitter (void)
-{
- if (ts_->thread_count_ == 1)
- return 0;
-
- double jitter = 0.0;
- double average = get_low_priority_latency ();
- double number_of_samples = (ts_->thread_count_ - 1) * (ts_->loop_count_ / ts_->granularity_);
-
- // Compute the standard deviation (i.e. jitter) from the values
- // stored in the global_jitter_array_.
-
- ACE_Stats stats;
-
- // We first compute the sum of the squares of the differences each
- // latency has from the average.
- for (u_int j = 1; j < ts_->thread_count_; j ++)
- for (u_int i = 0; i < ts_->loop_count_ / ts_->granularity_; i ++)
- {
- double difference =
- ts_->global_jitter_array_[j][i] - average;
- jitter += difference * difference;
- stats.sample ((ACE_UINT32) (ts_->global_jitter_array_ [j][i] * 1000 + 0.5));
- }
-
- ACE_OS::fprintf (stderr, "low priority jitter:\n");
- stats.print_summary (3, 1000, stderr);
-
- // Return the square root of the sum of the differences computed
- // above, i.e. jitter.
- return sqrt (jitter / (number_of_samples - 1));
-}
-
-int
-Client::svc (void)
-{
- Cubit_ptr cb = 0;
- CORBA::ORB_var orb;
- CORBA::Object_var objref (0);
- CORBA::Object_var naming_obj (0);
- CORBA::Environment env;
-
- double frequency = 0.0;
-
- /// Add "-ORBobjrefstyle url" argument to the argv vector for the
- //orb to / use a URL style to represent the ior.
-
- // Convert the argv vector into a string.
- ACE_ARGV tmp_args (ts_->argv_);
- char tmp_buf[BUFSIZ];
-
- ACE_OS::strcpy (tmp_buf,
- tmp_args.buf ());
-
- // Add the argument.
- ACE_OS::strcat (tmp_buf,
- " -ORBobjrefstyle url "
- " -ORBrcvsock 32768 "
- " -ORBsndsock 32768 ");
-
- // Convert back to argv vector style.
- ACE_ARGV tmp_args2 (tmp_buf);
- int argc = tmp_args2.argc ();
-
- char *const *argv = tmp_args2.argv ();
-
- u_int naming_success = CORBA::B_FALSE;
-
- orb = CORBA::ORB_init (argc,
- argv,
- "internet",
- env);
-
- if (env.exception () != 0)
- {
- env.print_exception ("ORB_init()\n");
- return -1;
- }
-
- if (ts_->use_name_service_ != 0)
- {
- naming_obj =
- orb->resolve_initial_references ("NameService");
-
- if (CORBA::is_nil (naming_obj.in ()))
- ACE_ERROR ((LM_ERROR,
- " (%P|%t) Unable to resolve the Name Service.\n"));
- else
- this->naming_context_ =
- CosNaming::NamingContext::_narrow (naming_obj.in (), env);
- }
-
- {
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, ts_->lock_, -1));
-
- if (ts_->thread_per_rate_ == 0)
- {
- if (this->id_ == 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%t) I'm the high priority client, my id is %d.\n",
- this->id_));
- frequency = CB_HIGH_PRIORITY_RATE;
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%t) I'm a low priority client, my id is %d.\n",
- this->id_));
- frequency = CB_LOW_PRIORITY_RATE;
- }
- }
- else
- switch (this->id_)
- {
- case CB_40HZ_CONSUMER:
- ACE_DEBUG ((LM_DEBUG,
- "(%t) I'm the high priority client, "
- "my id is %d.\n", this->id_));
- frequency = CB_40HZ_CONSUMER_RATE;
- break;
- case CB_20HZ_CONSUMER:
- ACE_DEBUG ((LM_DEBUG, "(%t) I'm the high priority client, "
- "my id is %d.\n", this->id_));
- frequency = CB_20HZ_CONSUMER_RATE;
- break;
- case CB_10HZ_CONSUMER:
- ACE_DEBUG ((LM_DEBUG, "(%t) I'm the high priority client, "
- "my id is %d.\n", this->id_));
- frequency = CB_10HZ_CONSUMER_RATE;
- break;
- case CB_5HZ_CONSUMER:
- ACE_DEBUG ((LM_DEBUG, "(%t) I'm the high priority client, "
- "my id is %d.\n", this->id_));
- frequency = CB_5HZ_CONSUMER_RATE;
- break;
- case CB_1HZ_CONSUMER:
- ACE_DEBUG ((LM_DEBUG, "(%t) I'm the high priority client, "
- "my id is %d.\n", this->id_));
- frequency = CB_1HZ_CONSUMER_RATE;
- break;
- default:
- ACE_DEBUG ((LM_DEBUG, "(%t) Invalid Thread ID!!!!\n", this->id_));
- }
-
- TAO_TRY
- {
- // if the naming service was resolved successsfully ...
- if (!CORBA::is_nil (this->naming_context_.in ()))
- {
- ACE_DEBUG ((LM_DEBUG,
- " (%t) ----- Using the NameService resolve() method"
- " to get cubit objects -----\n"));
-
- // Construct the key for the name service lookup.
- CosNaming::Name mt_cubit_context_name (1);
- mt_cubit_context_name.length (1);
- mt_cubit_context_name[0].id = CORBA::string_dup ("MT_Cubit");
-
- objref =
- this->naming_context_->resolve (mt_cubit_context_name,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- this->mt_cubit_context_ =
- CosNaming::NamingContext::_narrow (objref.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- char *buffer;
- int l = ACE_OS::strlen (ts_->key_) + 3;
- ACE_NEW_RETURN (buffer,
- char[l],
- -1);
-
- ACE_OS::sprintf (buffer,
- "%s%02d",
- (char *) ts_->key_,
- this->id_);
-
- // Construct the key for the name service lookup.
- CosNaming::Name cubit_name (1);
- cubit_name.length (1);
- cubit_name[0].id = CORBA::string_dup (buffer);
-
- objref = this->mt_cubit_context_->resolve (cubit_name,
- TAO_TRY_ENV);
-
- if (TAO_TRY_ENV.exception () != 0
- || CORBA::is_nil (objref.in ()))
- {
- ACE_DEBUG ((LM_DEBUG,
- " (%t) resolve() returned nil\n"));
- TAO_TRY_ENV.print_exception ("Attempt to resolve() a cubit object"
- "using the name service Failed!\n");
- }
- else
- {
- naming_success = CORBA::B_TRUE;
- ACE_DEBUG ((LM_DEBUG,
- " (%t) Cubit object resolved to the name \"%s\".\n",
- buffer));
- }
- }
-
- if (naming_success == CORBA::B_FALSE)
- {
- char *my_ior = ts_->iors_[this->id_];
-
- // if we are running the "1 to n" test make sure all low
- // priority clients use only 1 low priority servant.
- if (this->id_ > 0 && ts_->one_to_n_test_ == 1)
- my_ior = ts_->iors_[1];
-
- if (my_ior == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Must specify valid factory ior key with -k option,"
- " naming service, or ior filename\n"),
- -1);
-
- objref = orb->string_to_object (my_ior,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
- }
-
- if (CORBA::is_nil (objref.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%t) string_to_object or NameService->resolve() Failed!\n"),
- -1);
-
- // Narrow the CORBA::Object reference to the stub object,
- // checking the type along the way using _is_a.
- cb = Cubit::_narrow (objref.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- if (CORBA::is_nil (cb))
- ACE_ERROR_RETURN ((LM_ERROR,
- "Create cubit failed\n"),
- 1);
-
- ACE_DEBUG ((LM_DEBUG,
- "(%t) Binding succeeded\n"));
-
- CORBA::String_var str =
- orb->object_to_string (cb, TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- ACE_DEBUG ((LM_DEBUG,
- "(%t) CUBIT OBJECT connected <%s>\n",
- str.in ()));
-
- ACE_DEBUG ((LM_DEBUG,
- "(%t) Waiting for other threads to "
- "finish binding..\n"));
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("get_object");
- return 1;
- }
- TAO_ENDTRY;
- }
-
- // Wait for all the client threads to be initialized before going
- // any further.
- ts_->barrier_->wait ();
- ACE_DEBUG ((LM_DEBUG,
- "(%t) Everyone's done, here I go!!\n"));
-
- if (ts_->oneway_ == 1)
- ACE_DEBUG ((LM_DEBUG,
- "(%t) **** USING ONEWAY CALLS ****\n"));
-
- // Perform the tests.
- int result = this->run_tests (cb,
- ts_->loop_count_,
- this->id_,
- ts_->datatype_,
- frequency);
-
- if (ts_->thread_per_rate_ == 1 && this->id_ == (ts_->thread_count_ - 1) )
- ts_->semaphore_->release (ts_->thread_count_ - 1);
- else
- ts_->semaphore_->release ();
-
- if (result == -1)
- return -1;
-
- if (ts_->shutdown_)
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%t) CALLING SHUTDOWN() ON THE SERVANT\n"));
- cb->shutdown (env);
- if (env.exception () != 0)
- {
- ACE_ERROR ((LM_ERROR,
- "Shutdown of the server failed!\n"));
- env.print_exception ("shutdown() call failed.\n");
- }
- }
-
- return 0;
-}
-
-int
-Client::run_tests (Cubit_ptr cb,
- u_int loop_count,
- u_int thread_id,
- Cubit_Datatypes datatype,
- double frequency)
-{
- CORBA::Environment env;
- u_int i = 0;
- u_int call_count = 0;
- u_int error_count = 0;
- u_int low_priority_client_count = ts_->thread_count_ - 1;
- double *my_jitter_array;
-
- if (id_ == 0)
- ACE_NEW_RETURN (my_jitter_array,
- double [(loop_count/ts_->granularity_)*10], // magic number, for now.
- -1);
- else
- ACE_NEW_RETURN (my_jitter_array,
- double [loop_count/ts_->granularity_],
- -1);
-
- double latency = 0;
- double sleep_time = (1 / frequency) * ACE_ONE_SECOND_IN_USECS * ts_->granularity_; // usec
- double delta = 0;
-
-#if defined (CHORUS)
- int pstartTime = 0;
- int pstopTime = 0;
-#endif /* CHORUS */
- double real_time = 0.0;
-
- ACE_High_Res_Timer timer_;
-
- // Make the calls in a loop.
-
- for (i = 0;
- // keep running for loop count, OR
- i < loop_count ||
- // keep running if we are the highest priority thread and at
- // least another lower client thread is running, OR
- (id_ == 0 && ts_->thread_count_ > 1) ||
- // keep running if test is thread_per_rate and we're not the
- // lowest frequency thread.
- (ts_->thread_per_rate_ == 1 && id_ < (ts_->thread_count_ - 1));
- i++)
- {
- // Elapsed time will be in microseconds.
- ACE_Time_Value delta_t;
-
- if ( (i % ts_->granularity_) == 0)
- {
- if (ts_->use_utilization_test_ == 0)
- {
- ACE_Time_Value tv (0,
- (u_long) ((sleep_time - delta) < 0
- ? 0
- : (sleep_time - delta)));
- ACE_OS::sleep (tv);
- }
-
-#if defined (CHORUS)
- pstartTime = pccTime1Get();
-#else /* CHORUS */
- timer_.start ();
-#endif /* !CHORUS */
- }
-
- if (ts_->oneway_ == 0)
- {
- switch (datatype)
- {
- case CB_OCTET:
- {
- // Cube an octet.
- CORBA::Octet arg_octet = func (i), ret_octet = 0;
-
-#if defined (ACE_QUANTIFY)
- /* start recording quantify data from here */
- quantify_start_recording_data ();
-#endif /* ACE_QUANTIFY */
- ret_octet = cb->cube_octet (arg_octet, env);
-
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
-#endif /* ACE_QUANTIFY */
-
- if (env.exception () != 0)
- {
- env.print_exception ("call to cube_octet()\n");
- ACE_ERROR_RETURN ((LM_ERROR,
- "%s:Call failed\n",
- env.exception ()),
- 2);
- }
-
- arg_octet = arg_octet * arg_octet * arg_octet;
-
- if (arg_octet != ret_octet)
- {
- ACE_DEBUG ((LM_DEBUG,
- "** cube_octet(%d) (--> %d)\n",
- arg_octet,
- ret_octet));
- error_count++;
- }
- call_count++;
- break;
- }
- case CB_SHORT:
- // Cube a short.
- {
- call_count++;
-
- CORBA::Short arg_short = func (i), ret_short;
-
-#if defined (ACE_QUANTIFY)
- // start recording quantify data from here.
- quantify_start_recording_data ();
-#endif /* ACE_QUANTIFY */
-
- ret_short = cb->cube_short (arg_short, env);
-
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
-#endif /* ACE_QUANTIFY */
-
- if (env.exception () != 0)
- {
- env.print_exception ("call to cube_short()\n");
- ACE_ERROR_RETURN ((LM_ERROR,
- "%s:Call failed\n",
- env.exception ()),
- 2);
- }
-
- arg_short = arg_short * arg_short * arg_short;
-
- if (arg_short != ret_short)
- {
- ACE_DEBUG ((LM_DEBUG,
- "** cube_short(%d) (--> %d)\n",
- arg_short ,
- ret_short));
- error_count++;
- }
- break;
- }
- // Cube a long.
-
- case CB_LONG:
- {
- call_count++;
-
- CORBA::Long arg_long = func (i);
- CORBA::Long ret_long;
-
-#if defined (ACE_QUANTIFY)
- /* start recording quantify data from here */
- quantify_start_recording_data ();
-#endif /* ACE_QUANTIFY */
-
- ret_long = cb->cube_long (arg_long, env);
-
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
-#endif /* ACE_QUANTIFY */
-
- if (env.exception () != 0)
- {
- env.print_exception ("call to cube_long()\n");
- ACE_ERROR_RETURN ((LM_ERROR,
- "%s:Call failed\n",
- env.exception ()),
- 2);
- }
-
- arg_long = arg_long * arg_long * arg_long;
-
- if (arg_long != ret_long)
- {
- ACE_DEBUG ((LM_DEBUG,
- "** cube_long(%d) (--> %d)\n",
- arg_long,
- ret_long));
- error_count++;
- }
- break;
- }
-
- case CB_STRUCT:
- // Cube a "struct" ...
- {
- Cubit::Many arg_struct, ret_struct;
-
- call_count++;
-
- arg_struct.l = func (i);
- arg_struct.s = func (i);
- arg_struct.o = func (i);
-
-#if defined (ACE_QUANTIFY)
- // start recording quantify data from here.
- quantify_start_recording_data ();
-#endif /* ACE_QUANTIFY */
-
- ret_struct = cb->cube_struct (arg_struct, env);
-
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
-#endif /* ACE_QUANTIFY */
-
- if (env.exception () != 0)
- {
- env.print_exception ("call to cube_struct()\n");
- ACE_ERROR_RETURN ((LM_ERROR,"%s:Call failed\n", env.exception ()), 2);
- }
-
- arg_struct.l = arg_struct.l * arg_struct.l * arg_struct.l ;
- arg_struct.s = arg_struct.s * arg_struct.s * arg_struct.s ;
- arg_struct.o = arg_struct.o * arg_struct.o * arg_struct.o ;
-
- if (arg_struct.l != ret_struct.l
- || arg_struct.s != ret_struct.s
- || arg_struct.o != ret_struct.o )
- {
- ACE_DEBUG ((LM_DEBUG, "**cube_struct error!\n"));
- error_count++;
- }
-
- break;
- }
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t); %s:%d; unexpected datatype: %d\n",
- datatype), -1);
- }
- }
- else
- {
- call_count++;
-#if defined (ACE_QUANTIFY)
- // start recording quantify data from here.
- quantify_start_recording_data ();
-#endif /* ACE_QUANTIFY */
- cb->noop (env);
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
-#endif /* ACE_QUANTIFY */
- if (env.exception () != 0)
- {
- env.print_exception ("oneway call noop()\n");
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%t) noop() call failed\n"),
- 2);
- }
- }
-
- if ((i % ts_->granularity_) == (ts_->granularity_ - 1))
- {
-#if defined (CHORUS)
- 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) / ts_->granularity_;
-# else /* CHORUS */
- // Store the time in usecs.
- real_time = (delta_t.sec () * ACE_ONE_SECOND_IN_USECS +
- delta_t.usec ()) / ts_->granularity_;
-# endif /* !CHORUS */
- delta = ((40 * fabs (real_time) / 100) + (60 * delta / 100)); // pow(10,6)
- latency += real_time * ts_->granularity_;
- my_jitter_array [i/ts_->granularity_] = real_time; // in units of microseconds.
- // update the latency array, correcting the index using the granularity
-#else /* ACE_LACKS_FLOATING_POINT */
- // Store the time in secs.
-
-// These comments are to temporarily fix what seems a bug in
-// the ACE_Long_Long class that is used to calc the elapsed
-// time.
-// I'll leave these here to debug it later.
- double tmp = (double)delta_t.sec ();
- double tmp2 = (double)delta_t.usec ();
- if (tmp > 100000) {tmp=0.0; tmp2 = 2000.0; fprintf(stderr, "tmp > 100000!, delta_t.usec ()=%f\n", (double)delta_t.usec ());}
-
- real_time = tmp + tmp2 / (double)ACE_ONE_SECOND_IN_USECS;
- // real_time = (double)delta_t.sec () + (double)delta_t.usec () / (double)ACE_ONE_SECOND_IN_USECS;
-
- real_time /= ts_->granularity_;
-
- delta = ((0.4 * fabs (real_time * ACE_ONE_SECOND_IN_USECS)) + (0.6 * delta)); // pow(10,6)
- latency += (real_time * ts_->granularity_);
- if (ts_->thread_per_rate_ == 0)
- my_jitter_array [i/ts_->granularity_] = real_time * ACE_ONE_SECOND_IN_MSECS;
-#endif /* !ACE_LACKS_FLOATING_POINT */
- }
-
- if ( ts_->thread_per_rate_ == 1 && id_ < (ts_->thread_count_ - 1) )
- {
- if (ts_->semaphore_->tryacquire () != -1)
- break;
- }
- else
- // if We are the high priority client.
- // if tryacquire() succeeded then a client must have done a
- // release () on it, thus we decrement the client counter.
- if (id_ == 0 && ts_->thread_count_ > 1)
- {
- if (ts_->semaphore_->tryacquire () != -1)
- {
- low_priority_client_count --;
- // if all clients are done then break out of loop.
- if (low_priority_client_count <= 0)
- break;
- }
- }
- }
-
- if (id_ == 0)
- ts_->high_priority_loop_count_ = call_count;
-
- if (call_count > 0)
- {
- 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; // calc average latency
-
- 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,
- "(%P|%t) 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 * ACE_ONE_SECOND_IN_MSECS,
- 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, %f, is less than or equal to zero."
- " Precision may have been lost.\n, latency"));
- }
- }
- ACE_DEBUG ((LM_DEBUG,
- "%d calls, %d errors\n",
- call_count,
- error_count));
- }
-
- return 0;
-}
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h
deleted file mode 100644
index c9223a20bfe..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests
-//
-// = FILENAME
-// Task_Client.h
-//
-// = AUTHOR
-// Andy Gokhale, Sumedh Mungee and Sergio Flores-Gaitan
-//
-// ============================================================================
-
-#if !defined (TASK_CLIENT_H)
-#define TASK_CLIENT_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 "ace/ARGV.h"
-#include "ace/Sched_Params.h"
-#include "ace/High_Res_Timer.h"
-
-#include "orbsvcs/CosNamingC.h"
-#include "cubitC.h"
-
-#if defined (CHORUS)
-#include "pccTimer.h"
-#endif /* CHORUS */
-
-#include <math.h>
-
-static unsigned int LOW_PRIORITY;
-static unsigned int HIGH_PRIORITY;
-
-// global test configuration parameters
-static unsigned long num_iterations = 1000;
-static unsigned int new_lwp = 0;
-
-// @@ 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 */
-
-#if !defined (ACE_HAS_THREADS)
-class NOOP_ACE_Barrier
-{
-public:
- NOOP_ACE_Barrier (int) {}
- void wait (void) {}
-};
-#define ACE_Barrier NOOP_ACE_Barrier
-#endif /* ACE_HAS_THREADS */
-
-// Arbitrary generator used by the client to create the numbers to be
-// cubed.
-static inline int
-func (u_int i)
-{
- return i - 117;
-}
-
-enum Cubit_Datatypes
-{
- // = The various datatypes the client and the server can exchange.
- CB_OCTET,
- CB_SHORT,
- CB_LONG,
- CB_STRUCT,
-
- // = Rate constants.
- CB_40HZ_CONSUMER = 0,
- CB_20HZ_CONSUMER = 1,
- CB_10HZ_CONSUMER = 2,
- CB_5HZ_CONSUMER = 3,
- CB_1HZ_CONSUMER = 4,
-
- CB_40HZ_CONSUMER_RATE = 40,
- CB_20HZ_CONSUMER_RATE = 20,
- CB_10HZ_CONSUMER_RATE = 10,
- CB_5HZ_CONSUMER_RATE = 5,
- CB_1HZ_CONSUMER_RATE = 1,
-
- CB_HIGH_PRIORITY_RATE = 20,
- CB_LOW_PRIORITY_RATE = 10
-};
-
-class Task_State
-{
- // = TITLE
- // Maintains state common to multiple Cubit clients.
- //
- // = DESCRIPTION
- // This class maintains state which is common to the potentially
- // multiple concurrent clients.
-public:
- ACE_Barrier *barrier_;
- // Barrier for the multiple clients to synchronize after binding to
- // the servants.
-
- Task_State (int argc, char **argv);
- // Constructor. Takes the command line arguments, which are later
- // passed into ORB_init.
-
- CORBA::String key_;
- // All cubit objects will have this as prefix to its key.
-
- u_int start_count_;
- // Keeps a count of the number of clients started. This count also
- // serves as a thread-id. The first thread created gets an ID of 0,
- // then 1, and so on.
-
- u_int loop_count_;
- // Number of times to loop, making calls.
-
- u_int thread_count_;
- // Number of concurrent clients to create.
-
- double *latency_;
- // 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.
-
- ACE_SYNCH_MUTEX lock_;
- // Lock to protect access to this object.
-
- // = Command line arguments.
- int argc_;
- char **argv_;
-
- u_int thread_per_rate_;
- // Flag for the thread_per_rate test.
-
- double **global_jitter_array_;
- // This array stores the latency seen by each client for each
- // request, to be used later to compute jitter.
-
- u_int shutdown_;
- // Flag that indicates if we are going to call the shutdown methos
- // for the servant.
-
- u_int oneway_;
- // Flag that indicates if we are going to use oneway calls instead
- // of two-way.
-
- u_int use_name_service_;
- // Flag that say if we are using the or not the name service.
-
- u_int one_to_n_test_;
- // indicates whether we are running the "1 to n" test, which has 1
- // low priority servant and n low priority clients.
-
- u_int context_switch_test_;
- // flag to run context switch test
-
- char **iors_;
- // Array of pointers used to hold the ior strings read from the ior file
- // that the server created.
-
- char *ior_file_;
- // Name of the filename that the server used to store the iors.
-
- u_int granularity_;
- // 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).
-
- u_int use_utilization_test_;
- // flag to indicate we are to use the utilization test. By default
- // we do not use it, because it can cause starvation with real-time
- // threads
-
- u_int high_priority_loop_count_;
- // Number of times the high priority looped. We are going to loop
- // as long as there is low priority clients running, so as to
- // maintain high priority traffic as long as low priority traffic is
- // going through.
-
- ACE_Thread_Semaphore *semaphore_;
- // semaphore in order for the high priority client to keep running
- // as long as the low priority clients are running. See explanation
- // of "high_priority_loop_count_" member in this class.
-};
-
-class Client : public ACE_Task<ACE_SYNCH>
-{
- // = TITLE
- // The Cubit client.
- //
- // = DESCRIPTION
- // This class implements the Cubit Client, which is an active object.
- // `n' threads execute svc, and make 2way CORBA calls on the server
-public:
- Client (ACE_Thread_Manager &, Task_State *ts, u_int id);
- // Constructor, with a pointer to the common task state.
-
- virtual int svc (void);
- // The thread function.
-
- double get_high_priority_latency (void);
- double get_low_priority_latency (void);
- double get_high_priority_jitter (void);
- double get_low_priority_jitter (void);
- double get_latency (u_int thread_id);
- // Accessors to get the various measured quantities.
-
-private:
- int run_tests (Cubit_ptr,
- u_int,
- u_int,
- Cubit_Datatypes,
- double frequency);
- // Makes the calls to the servant.
-
- void put_latency (double *jitter,
- double latency,
- u_int thread_id);
- // Records the latencies in the <Task_State>.
-
- int parse_args (int, char **);
- // Parses the arguments.
-
- Task_State *ts_;
- // Pointer to shared state.
-
- u_int id_;
- // unique id of the task
-
- CosNaming::NamingContext_var naming_context_;
- // Object reference to the naming service.
-
- CosNaming::NamingContext_var mt_cubit_context_;
- // Object reference to the cubit context "MT_Cubit".
-};
-
-#endif /* !defined (TASK_CLIENT_H) */
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp
deleted file mode 100644
index 91385e5b405..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// $Id$
-
-#include "Util_Thread.h"
-
-Util_Thread::Util_Thread (Task_State *ts,
- ACE_Thread_Manager *thr_mgr)
- : ACE_MT (ACE_Task<ACE_MT_SYNCH> (thr_mgr)),
- done_ (0),
- number_of_computations_ (0),
- ts_ (ts)
-{
-}
-
-int
-Util_Thread::svc (void)
-{
- ACE_DEBUG ((LM_DEBUG,
- "(%t) Utilization Thread created, "
- "waiting for threads to finish binding\n"));
-
- // 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,
- "(%t) Threads have bound, "
- "utilization test STARTED\n"));
-
- this->run_computations ();
-
- ACE_DEBUG ((LM_DEBUG,
- "(%t) utilization test ENDED\n"));
-
- return 0;
-}
-
-double
-Util_Thread::get_number_of_computations (void)
-{
- return this->number_of_computations_;
-}
-
-// computation performed by the Utilization thread. We need this in a
-// separate function to get it's execution time.
-//inline
-void
-Util_Thread::computation (void)
-{
- // This is the number that the Util_Thread uses to check for
- // primality.
- const u_long CUBIT_PRIME_NUMBER = 509UL;
-
- // See if this number is prime. 2 and CUBIT_PRIME_NUMBER / 2 are
- // the recommended values for min_factor and max_factor, as
- // explained in ACE.h (is_prime).
- ACE::is_prime (CUBIT_PRIME_NUMBER,
- 2UL,
- CUBIT_PRIME_NUMBER / 2);
-}
-
-// Perform repeated prime factor computations on an arbitrary number.
-// And you thought your life was boring... :-)
-int
-Util_Thread::run_computations (void)
-{
- while (this->done_ == 0)
- {
- // bound the number of computations, since we can potentially
- // block the machine if this thread never leaves the loop.
- if (this->number_of_computations_ > (ts_->loop_count_ * 50)) // magic number
- {
- ACE_DEBUG ((LM_DEBUG,
- "\t(%t) utilization test breaking loop so machine won't block.\n"));
- break;
- }
- this->computation ();
- this->number_of_computations_ ++;
- ACE_OS::thr_yield (); // Shouldn't need this. And I'm not sure
- // if it really helps.
- }
-
- return 0;
-}
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.h
deleted file mode 100644
index d44ecbddd33..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests
-//
-// = FILENAME
-// Util_Thread.h
-//
-// = AUTHOR
-// Andy Gokhale, Sumedh Mungee, and Sergio Flores-Gaitan
-//
-// ============================================================================
-
-#if !defined (UTIL_THREAD_H)
-#define UTIL_THREAD_H
-
-#include "Task_Client.h"
-
-class Util_Thread : public ACE_Task<ACE_SYNCH>
-{
- // = TITLE
- // The thread that computes utilization.
-public:
- Util_Thread (Task_State *,
- ACE_Thread_Manager *thr_mgr);
- // Constructor.
-
- virtual int svc (void);
- // The thread entry point function.
-
- double get_number_of_computations (void);
- // Gets the number of computations the thread was able to perform.
-
- void computation (void);
- // this is the actual "computation" being performed.
-
- int done_;
- // Indicates whether we're done.
-
-private:
- int run_computations (void);
- // Run the computations.
-
- double number_of_computations_;
- // This stores the number of computations performed
- // by the Util_Thread so far
-
- Task_State *ts_;
- // Pointer to the Task state. Stores the state
- // common to the multiple client threads
-};
-
-#endif /* !defined (UTIL_THREAD_H) */
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
deleted file mode 100644
index 9ab1282cd55..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
+++ /dev/null
@@ -1,688 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests
-//
-// = FILENAME
-// client.cpp
-//
-// = AUTHOR
-// Andy Gokhale, Brian Mendel, Sumedh Mungee, and Sergio Flores-Gaitan
-//
-// ============================================================================
-
-#include "client.h"
-#include "ace/Sched_Params.h"
-
-#if defined (ACE_QUANTIFY)
-#include "quantify.h"
-#endif /* ACE_QUANTIFY */
-
-double csw = 0.0;
-
-#if defined (VXWORKS)
-u_int ctx = 0;
-
-extern "C"
-int
-switchHook ( WIND_TCB *pOldTcb, /* pointer to old task's WIND_TCB */
- WIND_TCB *pNewTcb ) /* pointer to new task's WIND_TCB */
-{
- // We create the client threads with names starting with "@".
- if ( pNewTcb->name[0] == '@')
- ctx++;
-
- return 0;
-}
-#endif /* VXWORKS */
-
-int
-initialize (void)
-{
-#if defined (VXWORKS) && defined (VME_DRIVER)
- STATUS status = vmeDrv ();
- if (status != OK)
- printf ("ERROR on call to vmeDrv()\n");
- status = vmeDevCreate ("/vme");
- if (status != OK)
- printf ("ERROR on call to vmeDevCreate()\n");
-#endif /* VXWORKS && VME_DRIVER */
-
- // Make sure we've got plenty of socket handles. This call will
- // use the default maximum.
- ACE::set_handle_limit ();
-
- return 0;
-}
-
-void
-output_latency (Task_State &ts)
-{
- 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");
-
- // This loop visits each client. thread_count_ is the number of clients.
- for (u_int j = 0; j < ts.thread_count_; j ++)
- {
- ACE_OS::sprintf(buffer,
- "%s #%d",
- j==0? "High Priority": "Low Priority",
- j);
- // this loop visits each request latency from a client
- for (u_int i = 0; i < (j==0? ts.high_priority_loop_count_:ts.loop_count_)/ts.granularity_; i ++)
- {
- ACE_OS::sprintf(buffer+strlen(buffer),
-#if defined (CHORUS)
- "\t%u\n",
-#else
- "\t%f\n",
-#endif /* !CHORUS */
- ts.global_jitter_array_[j][i]);
- fputs (buffer, latency_file_handle);
- buffer[0]=0;
- }
- }
-
- ACE_OS::fclose (latency_file_handle);
-}
-
-int
-do_priority_inversion_test (ACE_Thread_Manager &thread_manager,
- Task_State &ts)
-{
- int i;
- u_int j, k;
-
-#if defined (VXWORKS)
- char * task_id = 0;
- ctx = 0;
- ACE_NEW_RETURN (task_id,
- char [32],
- -1);
-#endif /* VXWORKS */
-
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) <<<<<<< starting test on %D\n"));
-
- // stores the total number of context switches incurred by the
- // program while making CORBA requests
-#if defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE)
- u_int context_switch = 0;
-#endif /* ACE_HAS_PRUSAGE_T || ACE_HAS_GETRUSAGE */
-
- double util_task_duration = 0.0;
- double total_latency = 0.0;
- double total_latency_low = 0.0;
- double total_latency_high = 0.0;
- double total_util_task_duration = 0.0;
-
- // Create the clients.
- Client high_priority_client (thread_manager, &ts, 0);
-
- // Create an array to hold pointers to the low priority tasks.
- Client **low_priority_client;
-
- ACE_NEW_RETURN (low_priority_client,
- Client *[ts.thread_count_],
- -1);
-
- // hack to make sure we have something in this pointer, when
- // thread_count == 1
- low_priority_client[0] = &high_priority_client;
-
- // Create the daemon thread in its own <ACE_Thread_Manager>.
- ACE_Thread_Manager util_thr_mgr;
-
- Util_Thread util_thread (&ts, &util_thr_mgr);
-
- //
- // Time the utilization thread' "computation" to get %IdleCPU at the end of the test.
- //
-#if defined (CHORUS)
- int pstartTime = 0;
- int pstopTime = 0;
- // Elapsed time will be in microseconds.
- pstartTime = pccTime1Get();
- // execute one computation.
- util_thread.computation ();
- pstopTime = pccTime1Get();
- // Store the time in micro-seconds.
- util_task_duration = pstopTime - pstartTime;
-#else /* CHORUS */
- ACE_High_Res_Timer timer_;
- // Elapsed time will be in microseconds.
- ACE_Time_Value delta_t;
- timer_.start ();
- // execute one computation.
- util_thread.computation ();
- timer_.stop ();
- timer_.elapsed_time (delta_t);
- // Store the time in milli-seconds.
- util_task_duration = delta_t.sec () * ACE_ONE_SECOND_IN_MSECS + (double)delta_t.usec () / ACE_ONE_SECOND_IN_MSECS;
-#endif /* !CHORUS */
-
- // The thread priority
- ACE_Sched_Priority priority;
-
-#if defined (VXWORKS)
- // set a task_id string startiing with "@", so we are able to
- // accurately count the number of context switches.
- strcpy (task_id, "@High");
-#endif /* VXWORKS */
-
- // Now activate the high priority client.
-#if defined (VXWORKS)
- priority = ACE_THR_PRI_FIFO_DEF;
-#elif defined (ACE_WIN32)
- priority = ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
- ACE_SCOPE_THREAD);
-#else /* ! VXWORKS */
- priority = ACE_THR_PRI_FIFO_DEF + 25;
-#endif /* ! ACE_WIN32 */
-
- ACE_DEBUG ((LM_DEBUG,
- "Creating 1 client with high priority of %d\n",
- priority));
-
- if (high_priority_client.activate (THR_BOUND | ACE_SCHED_FIFO,
- 1,
- 0,
-#if !defined (VXWORKS)
- priority) == -1)
-#else
- priority,
- -1,
- 0,
- 0,
- 0,
- 0,
- &task_id) == -1)
-#endif /* VXWORKS */
- ACE_ERROR ((LM_ERROR,
- "%p; priority is %d\n",
- "activate failed",
- priority));
-
- u_int number_of_low_priority_client = ts.thread_count_ - 1;
-
- // Drop the priority
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
-
- ACE_DEBUG ((LM_DEBUG,
- "Creating %d clients at priority %d\n",
- ts.thread_count_ - 1,
- priority));
-
- for (i = number_of_low_priority_client; i > 0; i--)
- {
- ACE_NEW_RETURN (low_priority_client [i - 1],
- Client (thread_manager, &ts, i),
- -1);
-
-#if defined (VXWORKS)
- // Pace the connection establishment on VxWorks.
- const ACE_Time_Value delay (0L, 500000L);
- ACE_OS::sleep (delay);
-
- // set a task_id string startiing with "@", so we are able to
- // accurately count the number of context switches on VXWORKS
- sprintf (task_id, "@Low%u", i);
-#endif /* VXWORKS */
-
- ACE_DEBUG ((LM_DEBUG,
- "Creating client with thread ID %d\n",
- i));
-
- // The first thread starts at the lowest priority of all the low
- // priority clients.
- if (low_priority_client[i - 1]->activate (THR_BOUND | ACE_SCHED_FIFO,
- 1,
- 0,
-#if !defined (VXWORKS)
- priority) == -1)
-#else
- priority, // These are constructor defaults.
- -1, // int grp_id = -1,
- 0, // ACE_Task_Base *task = 0,
- 0, // ACE_hthread_t thread_handles[] = 0,
- 0, // void *stack[] = 0,
- 0, // size_t stack_size[] = 0,
- &task_id) == -1)
-#endif /* VXWORKS */
-
- ACE_ERROR ((LM_ERROR,
- "%p; priority is %d\n",
- "activate failed",
- priority));
-
- }
-
- if (ts.use_utilization_test_ == 1)
- // activate the utilization thread only if specified. See
- // description of this variable in header file.
- {
- priority =
- ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
- ACE_SCOPE_THREAD);
- ACE_DEBUG ((LM_DEBUG,
- "Creating utilization thread with priority of %d\n",
- priority));
-
- // activate the Utilization thread. It will wait until
- // all threads have finished binding.
- util_thread.activate (THR_BOUND | ACE_SCHED_FIFO,
- 1,
- 0,
- priority);
- }
- else
- {
- util_thread.close ();
- }
-
- // Wait for all the client threads to be initialized before going
- // any further.
- ts.barrier_->wait ();
-
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
- quantify_clear_data ();
-#endif /* ACE_QUANTIFY */
-
-#if (defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE)) && !defined (ACE_WIN32)
- ACE_Profile_Timer timer_for_context_switch;
- ACE_Profile_Timer::Rusage usage;
-
- if (ts.context_switch_test_ == 1)
- {
- timer_for_context_switch.start ();
- timer_for_context_switch.get_rusage (usage);
-# if defined (ACE_HAS_PRUSAGE_T)
- context_switch = usage.pr_vctx + usage.pr_ictx;
-# else /* ACE_HAS_PRUSAGE_T */
- context_switch = usage.ru_nvcsw + usage.ru_nivcsw;
-# endif /* ACE_HAS_GETRUSAGE */
- }
-#endif /* ACE_HAS_PRUSAGE_T || ACE_HAS_GETRUSAGE */
-
-#if defined (VXWORKS)
- if (ts.context_switch_test_ == 1)
- {
- fprintf(stderr, "Adding the context switch hook!\n");
- taskSwitchHookAdd ((FUNCPTR)&switchHook);
- }
-#endif
-
- // Wait for all the client threads to exit (except the utilization thread).
- thread_manager.wait ();
-
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
-#endif /* ACE_QUANTIFY */
-
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) >>>>>>> ending test on %D\n"));
-
- if (ts.use_utilization_test_ == 1)
- // signal the utilization thread to finish with its work..
- // only if utilization test was specified. See
- // description of this variable in header file.
- {
- util_thread.done_ = 1;
-
- // This will wait for the utilization thread to finish.
- util_thr_mgr.wait ();
- }
-
- ACE_DEBUG ((LM_DEBUG,
- "-------------------------- Stats -------------------------------\n"));
-
- if (ts.context_switch_test_ == 1)
- {
-#if defined (ACE_HAS_PRUSAGE_T)
- timer_for_context_switch.stop ();
- timer_for_context_switch.get_rusage (usage);
- // Add up the voluntary context switches & involuntary context switches
- context_switch = usage.pr_vctx + usage.pr_ictx - context_switch;
- ACE_DEBUG ((LM_DEBUG,
- "Voluntary context switches=%d, Involuntary context switches=%d\n",
- usage.pr_vctx,
- usage.pr_ictx));
-#elif defined (ACE_HAS_GETRUSAGE) && !defined (ACE_WIN32)
- timer_for_context_switch.stop ();
- timer_for_context_switch.get_rusage (usage);
- // Add up the voluntary context switches & involuntary context switches
- context_switch = usage.ru_nvcsw + usage.ru_nivcsw - context_switch;
- ACE_DEBUG ((LM_DEBUG,
- "Voluntary context switches=%d, Involuntary context switches=%d\n",
- usage.ru_nvcsw,
- usage.ru_nivcsw));
-#elif defined (VXWORKS) /* ACE_HAS_GETRUSAGE */
- taskSwitchHookDelete ((FUNCPTR)&switchHook);
- ACE_DEBUG ((LM_DEBUG,
- "Context switches=%d\n",
- ctx));
-#endif
- }
-
-#if defined (VXWORKS)
- 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",
- high_priority_client.get_high_priority_latency (),
- high_priority_client.get_high_priority_jitter (),
- low_priority_client[0]->get_low_priority_latency (),
- low_priority_client[0]->get_low_priority_jitter ()));
- // 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.
- output_latency (ts);
-
-#elif defined (CHORUS)
- ACE_DEBUG ((LM_DEBUG,
- "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[0]->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.
- output_latency (ts);
-#else /* !CHORUS */
- 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"
- "# of context switches: %d, context_switch_time: %f msec\n"
- "total context switch time: %f msec\n",
- high_priority_client.get_high_priority_latency (),
- high_priority_client.get_high_priority_jitter (),
- low_priority_client[0]->get_low_priority_latency (),
- low_priority_client[0]->get_low_priority_jitter (),
- context_switch,
- csw/1000,
- csw * context_switch/1000 ));
- output_latency (ts);
-#endif /* !VXWORKS && !CHORUS */
-
- // This loop visits each client. thread_count_ is the number of clients.
- for (j = 1; j < ts.thread_count_; j ++)
- for (k = 0; k < ts.loop_count_/ts.granularity_; k ++)
- total_latency_low += (ts.global_jitter_array_[j][k] * ts.granularity_);
-
- for (j = 0; j < ts.loop_count_/ts.granularity_; j ++)
- total_latency_high += (ts.global_jitter_array_[0][j] * ts.granularity_);
-
- total_util_task_duration = util_task_duration * util_thread.get_number_of_computations ();
-
- total_latency = total_latency_low +
- total_latency_high +
- total_util_task_duration;
-
- // Calc and print the CPU percentage. I add 0.5 to round to the
- // nearest integer before casting it to int.
- ACE_DEBUG ((LM_DEBUG,
- "\t%% Low Priority CPU utilization: %d %%\n"
- "\t%% High Priority CPU utilization: %d %%\n"
- "\t%% IDLE time: %d %%\n",
- (int) (total_latency_low * 100 / total_latency + 0.5),
- (int) (total_latency_high * 100 / total_latency + 0.5),
- (int) (total_util_task_duration * 100 / total_latency + 0.5) ));
-
-#if defined (ACE_LACKS_FLOATING_POINT)
- ACE_DEBUG ((LM_DEBUG,
- "(%t) utilization task performed %u computations\n",
- util_thread.get_number_of_computations ()));
- ACE_DEBUG ((LM_DEBUG,
- "(%t) utilization computation time is %u usecs\n",
- util_task_duration));
-#else
- ACE_DEBUG ((LM_DEBUG,
- "(%t) utilization task performed %g computations\n",
- util_thread.get_number_of_computations ()));
- ACE_DEBUG ((LM_DEBUG,
- "(%t) utilization computation time is %f msecs\n",
- util_task_duration));
-#endif /* ! ACE_LACKS_FLOATING_POINT */
-
-#if defined (VXWORKS)
- delete task_id;
-#endif /* VXWORKS */
- return 0;
-}
-
-int
-do_thread_per_rate_test (ACE_Thread_Manager &thread_manager,
- Task_State &ts)
-{
- // First activate the high priority client.
- Client CB_40Hz_client (thread_manager, &ts, CB_40HZ_CONSUMER);
- Client CB_20Hz_client (thread_manager, &ts, CB_20HZ_CONSUMER);
- Client CB_10Hz_client (thread_manager, &ts, CB_10HZ_CONSUMER);
- Client CB_5Hz_client (thread_manager, &ts, CB_5HZ_CONSUMER);
- Client CB_1Hz_client (thread_manager, &ts, CB_1HZ_CONSUMER);
-
- ACE_Sched_Priority priority;
-
-#if defined (VXWORKS)
- priority = ACE_THR_PRI_FIFO_DEF;
-#elif defined (ACE_WIN32)
- priority = ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
- ACE_SCOPE_THREAD);
-#else /* ! VXWORKS */
- priority = ACE_THR_PRI_FIFO_DEF + 25;
-#endif /* ! ACE_WIN32 */
-
- ACE_DEBUG ((LM_DEBUG,
- "Creating 40 Hz client with priority %d\n",
- priority));
- if (CB_40Hz_client.activate (THR_BOUND | ACE_SCHED_FIFO, 1, 1, priority) == -1)
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "activate failed"));
-
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
- ACE_DEBUG ((LM_DEBUG,
- "Creating 20 Hz client with priority %d\n",
- priority));
- if (CB_20Hz_client.activate (THR_BOUND | ACE_SCHED_FIFO, 1, 1, priority) == -1)
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "activate failed"));
-
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
- ACE_DEBUG ((LM_DEBUG,
- "Creating 10 Hz client with priority %d\n",
- priority));
- if (CB_10Hz_client.activate (THR_BOUND | ACE_SCHED_FIFO, 1, 1, priority) == -1)
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "activate failed"));
-
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
- ACE_DEBUG ((LM_DEBUG,
- "Creating 5 Hz client with priority %d\n",
- priority));
- if (CB_5Hz_client.activate (THR_BOUND | ACE_SCHED_FIFO, 1, 1, priority) == -1)
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "activate failed"));
-
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
- ACE_DEBUG ((LM_DEBUG,
- "Creating 1 Hz client with priority %d\n",
- priority));
- if (CB_1Hz_client.activate (THR_BOUND | ACE_SCHED_FIFO, 1, 1, priority) == -1)
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "activate failed"));
-
- // Wait for all the threads to exit.
- thread_manager.wait ();
-
-#if defined (ACE_LACKS_FLOATING_POINT)
- ACE_DEBUG ((LM_DEBUG,
- "Test done.\n"
- "40Hz client latency : %u usec\n"
- "20Hz client latency : %u usec\n"
- "10Hz client latency : %u usec\n"
- "5Hz client latency : %u usec\n"
- "1Hz client latency : %u usec\n",
- CB_40Hz_client.get_latency (0),
- CB_20Hz_client.get_latency (1),
- CB_10Hz_client.get_latency (2),
- CB_5Hz_client.get_latency (3),
- CB_1Hz_client.get_latency (4)));
-#else
- ACE_DEBUG ((LM_DEBUG,
- "Test done.\n"
- "40Hz client latency : %f msec\n"
- "20Hz client latency : %f msec\n"
- "10Hz client latency : %f msec\n"
- "5Hz client latency : %f msec\n"
- "1Hz client latency : %f msec\n",
- CB_40Hz_client.get_latency (0),
- CB_20Hz_client.get_latency (1),
- CB_10Hz_client.get_latency (2),
- CB_5Hz_client.get_latency (3),
- CB_1Hz_client.get_latency (4)));
-#endif /* ! ACE_LACKS_FLOATING_POINT */
- return 0;
-}
-
-// This is the main routine of the client, where we create a high
-// priority and a low priority client. we then activate the clients
-// with the appropriate priority threads, and wait for them to
-// finish. After they aer done, we compute the latency and jitter
-// metrics and print them.
-
-#if defined (VXWORKS)
-extern "C"
-int
-client (int argc, char *argv[])
-{
- ACE_Object_Manager ace_object_manager;
-#else
-int
-main (int argc, char *argv[])
-{
-#endif
-
-#if defined (ACE_HAS_THREADS)
-#if defined (FORCE_ARGS)
- int argc = 4;
- char *argv[] = {"client",
- "-s",
- "-f",
- "ior.txt"};
-#endif /* defined (FORCE_ARGS) */
-
- // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
- if (ACE_OS::sched_params (
- ACE_Sched_Params (
- ACE_SCHED_FIFO,
-#if defined (__Lynx__)
- 30,
-#else /* ! __Lynx__ */
- ACE_THR_PRI_FIFO_DEF,// ACE_Sched_Params::priority_min (ACE_SCHED_FIFO),
-#endif /* ! __Lynx__ */
- ACE_SCOPE_PROCESS)) != 0)
- {
- if (ACE_OS::last_error () == EPERM)
- ACE_DEBUG ((LM_MAX, "preempt: user is not superuser, "
- "so remain in time-sharing class\n"));
- else
- ACE_ERROR_RETURN ((LM_ERROR, "%n: ACE_OS::sched_params failed\n%a"),
- -1);
- }
-
-#if 0 // this is a debug section that will be removed soon. 1/6/98
- ACE_DEBUG ((LM_MAX, "<<<<<Delay of 5 seconds>>>>>\n"));
-
- ACE_High_Res_Timer *timer_;
- ACE_Time_Value delta_t;
-
- ACE_NEW_RETURN (timer_,
- ACE_High_Res_Timer,
- -1);
- timer_->start ();
-
- const ACE_Time_Value delay (5L, 0L);
- ACE_OS::sleep (delay);
-
- timer_->stop ();
- timer_->elapsed_time (delta_t);
-
- ACE_DEBUG ((LM_DEBUG, "5secs= %u secs, %u usecs\n", delta_t.sec (), delta_t.usec ()));
- delete timer_;
-#endif
-
- initialize ();
-
- 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 benchmark\n");
- }
-#endif /* CHORUS */
-
- // Create a separate manager for the client. This allows the use
- // of its wait () method on VxWorks, without interfering with the
- // server's (global) thread manager.
- ACE_Thread_Manager client_thread_manager;
-
- if (ts.thread_per_rate_ == 0)
- do_priority_inversion_test (client_thread_manager, ts);
- else
- do_thread_per_rate_test (client_thread_manager, ts);
-
-#if defined (CHORUS)
- if(pccTimer(PCC2_TIMER1_STOP,&pTime) !=K_OK)
- {
- printf("pccTimer has a pending bench mark\n");
- }
-#elif defined (VXWORKS)
- // Shoot myself. Otherwise, there's a General Protection Fault. This
- // will leak memory, but that's preferable. It looks like the problem
- // might be due to static objects in libTAO or liborbsvcs?
- int status;
- ACE_OS::thr_exit (&status);
-#endif /* CHORUS */
-
-#else /* !ACE_HAS_THREADS */
- ACE_DEBUG ((LM_DEBUG,
- "Test not run. This platform doesn't seem to have threads.\n"));
-#endif /* ACE_HAS_THREADS */
-
- return 0;
-}
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h
deleted file mode 100644
index a9386c52596..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests
-//
-// = FILENAME
-// client.h
-//
-// = AUTHOR
-// Andy Gokhale, Brian Mendel, Sumedh Mungee, and Sergio Flores-Gaitan
-//
-// ============================================================================
-
-#include "ace/Task.h"
-#include "ace/Thread_Manager.h"
-#include "ace/Get_Opt.h"
-#include "ace/Sched_Params.h"
-
-#include "cubitC.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);
-extern "C" STATUS vmeDevCreate (char *);
-#endif /* defined (VME_DRIVER) */
-
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit.idl b/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit.idl
deleted file mode 100644
index 74041bad851..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit.idl
+++ /dev/null
@@ -1,38 +0,0 @@
-// $Id$
-
-interface Cubit
-{
- // = TITLE
- // Defines an interface that encapsulates operations that cube
- // numbers.
- //
- // = DESCRIPTION
- // This interface encapsulates operations that cube
- // octets, shorts, longs, structs and unions.
-
- struct Many
- {
- octet o; // + 3 bytes padding (normally) ...
- long l;
- short s; // + 2 bytes padding (normally) ...
- };
-
- octet cube_octet (in octet o);
- // cube an octet
-
- short cube_short (in short s);
- // cube a short
-
- long cube_long (in long l);
- // cube a long
-
- Many cube_struct (in Many values);
- // cube each of the members of a struct
-
- oneway void noop ();
- // null operation
-
- oneway void shutdown ();
- // shut down the application
-};
-
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp
deleted file mode 100644
index bf7b61790c9..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// $Id$
-
-#include "tao/corba.h"
-#include "cubit_i.h"
-
-Cubit_i::Cubit_i (void)
-{
-}
-
-Cubit_i::~Cubit_i (void)
-{
-}
-
-CORBA::Octet
-Cubit_i::cube_octet (CORBA::Octet o,
- CORBA::Environment &)
-{
- //ACE_ERROR (( LM_ERROR, " {%t}\n"));
- return (CORBA::Octet) (o * o * o);
-}
-
-CORBA::Short
-Cubit_i::cube_short (CORBA::Short s,
- CORBA::Environment &)
-{
- return (CORBA::Short) (s * s * s);
-}
-
-CORBA::Long
-Cubit_i::cube_long (CORBA::Long l,
- CORBA::Environment &)
-{
- return (CORBA::Long) (l * l * l);
-}
-
-Cubit::Many
-Cubit_i::cube_struct (const Cubit::Many &values,
- CORBA::Environment &)
-{
- Cubit::Many out_values;
- out_values.o = values.o * values.o * values.o;
- out_values.s = values.s * values.s * values.s;
- out_values.l = values.l * values.l * values.l;
-
- return out_values;
-}
-
-void
-Cubit_i::noop (CORBA::Environment &)
-{
- // does nothing.
-}
-
-void Cubit_i::shutdown (CORBA::Environment &)
-{
- TAO_ORB_Core_instance ()->orb ()->shutdown ();
-}
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h
deleted file mode 100644
index bad9543cd81..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests
-//
-// = FILENAME
-// cubit_i.h
-//
-// = AUTHOR
-// Andy Gokhale, Sumedh Mungee, and Sergio Flores-Gaitan
-//
-// ============================================================================
-
-#if !defined (_CUBIT_I_HH)
-#define _CUBIT_I_HH
-
-#include "cubitS.h"
-
-class Cubit_i : public POA_Cubit
-{
- // = TITLE
- // Cubit implementation class.
-public:
- Cubit_i (void);
- ~Cubit_i (void);
-
- virtual CORBA::Octet cube_octet (CORBA::Octet o,
- CORBA::Environment &env);
-
- virtual CORBA::Short cube_short (CORBA::Short s,
- CORBA::Environment &env);
-
- virtual CORBA::Long cube_long (CORBA::Long l,
- CORBA::Environment &env);
-
- virtual Cubit::Many cube_struct (const Cubit::Many &values,
- CORBA::Environment &env);
-
- virtual void noop (CORBA::Environment &env);
-
- virtual void shutdown (CORBA::Environment &env);
-};
-
-#endif /* _CUBIT_I_HH */
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp
deleted file mode 100644
index 0e7b12bb461..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp
+++ /dev/null
@@ -1,691 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests
-//
-// = FILENAME
-// server.cpp
-//
-// = AUTHOR
-// Andy Gokhale, Sumedh Mungee, and Sergio Flores-Gaitan
-//
-// ============================================================================
-
-#include "server.h"
-#include "ace/Sched_Params.h"
-
-#if defined (ACE_QUANTIFY)
-#include "quantify.h"
-#endif /* ACE_QUANTIFY */
-
-// Global options used to configure various parameters.
-static char hostname[BUFSIZ];
-static char *ior_file = 0;
-static int base_port = ACE_DEFAULT_SERVER_PORT;
-static int num_of_objs = 2;
-static u_int use_name_service = 1;
-static u_int thread_per_rate = 0;
-
-Cubit_Task::Cubit_Task (void)
-{
- // No-op.
-}
-
-Cubit_Task::Cubit_Task (const char *args,
- const char *orbname,
- u_int num_of_objs,
- ACE_Barrier *barrier,
- u_int task_id)
- : key_ ("Cubit"),
- orbname_ ((char *) orbname),
- orbargs_ ((char *) args),
- num_of_objs_ (num_of_objs),
- servants_ (0),
- barrier_ (barrier),
- servants_iors_ (0),
- task_id_ (task_id)
-{
-}
-
-int
-Cubit_Task::svc (void)
-{
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) Beginning Cubit task with args = '%s'\n",
- orbargs_));
-
- int rc = this->initialize_orb ();
- if (rc == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "ORB initialization failed.\n"),
- -1);
-
- rc = this->create_servants ();
- if (rc == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Create Servants failed.\n"),
- -1);
-
- TAO_TRY
- {
- this->poa_manager_->activate (TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- this->barrier_->wait ();
-
- // Handle requests for this object until we're killed, or one of
- // the methods asks us to exit.
- if (this->orb_->run () == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "run"),
- -1);
-
- // Shut down the OA.
- this->poa_->destroy (CORBA::B_TRUE,
- CORBA::B_TRUE,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("poa->destroy()");
- }
- TAO_ENDTRY;
-
- // Need to clean up and do a CORBA::release on everything we've
- // created!
-
- for (u_int i = 0; i < num_of_objs_; i++)
- delete servants_ [i];
-
- return 0;
-}
-
-int
-Cubit_Task::initialize_orb (void)
-{
- TAO_TRY
- {
- ACE_ARGV args (this->orbargs_);
-
- int argc = args.argc ();
- char **argv = args.argv ();
-
- // Initialize the ORB.
- this->orb_ = CORBA::ORB_init (argc,
- argv,
- this->orbname_,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- // Initialize the Object Adapter.
- CORBA::Object_var poa_object =
- this->orb_->resolve_initial_references("RootPOA");
- if (CORBA::is_nil (poa_object.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to initialize the POA.\n"),
- 1);
-
- this->root_poa_ =
- PortableServer::POA::_narrow (poa_object.in(),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- this->poa_manager_ =
- this->root_poa_->the_POAManager (TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- CORBA::PolicyList policies (2);
- policies.length (2);
-
- // Id Assignment policy
- policies[0] =
- this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- // Lifespan policy
- policies[1] =
- this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- // We use a different POA, otherwise the user would have to
- // change the object key each time it invokes the server.
- this->poa_ =
- this->root_poa_->create_POA ("Persistent_POA",
- this->poa_manager_.in (),
- policies,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- // Creation of the new POAs over, so destroy the Policy_ptr's.
- for (CORBA::ULong i = 0;
- i < policies.length () && TAO_TRY_ENV.exception () == 0;
- ++i)
- {
- CORBA::Policy_ptr policy = policies[i];
- policy->destroy (TAO_TRY_ENV);
- }
- TAO_CHECK_ENV;
-
- if (use_name_service == 0)
- return 0;
-
- CORBA::Object_var naming_obj =
- this->orb_->resolve_initial_references ("NameService");
- if (CORBA::is_nil (naming_obj.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to resolve the Name Service.\n"),
- 1);
-
- this->naming_context_ =
- CosNaming::NamingContext::_narrow (naming_obj.in (),
- TAO_TRY_ENV);
-
- // Check the environment and return 1 if exception occurred or
- // nil pointer.
- if (TAO_TRY_ENV.exception () != 0 ||
- CORBA::is_nil (this->naming_context_.in ())==CORBA::B_TRUE )
- return 1;
-
- // Register the servant with the Naming Context....
- CosNaming::Name cubit_context_name (1);
- cubit_context_name.length (1);
- cubit_context_name[0].id =
- CORBA::string_dup ("MT_Cubit");
-
- TAO_TRY_ENV.clear ();
- CORBA::Object_var objref =
- this->naming_context_->bind_new_context (cubit_context_name,
- TAO_TRY_ENV);
-
- if (TAO_TRY_ENV.exception() != 0)
- {
- CosNaming::NamingContext::AlreadyBound_ptr ex =
- CosNaming::NamingContext::AlreadyBound::_narrow (TAO_TRY_ENV.exception());
- if (ex != 0)
- {
- TAO_TRY_ENV.clear ();
- objref = this->naming_context_->resolve (cubit_context_name,
- TAO_TRY_ENV);
- printf("NamingContext::AlreadyBound\n");
- }
- else
- TAO_TRY_ENV.print_exception ("bind() Cubit context object\n");
- }
- TAO_CHECK_ENV;
-
- this->mt_cubit_context_ =
- CosNaming::NamingContext::_narrow (objref.in (),
- TAO_TRY_ENV);
-
- TAO_CHECK_ENV;
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("orb_init");
- return -1;
- }
- TAO_ENDTRY;
-
- return 0;
-}
-
-CORBA::String
-Cubit_Task::get_servant_ior (u_int index)
-{
- if (index >= num_of_objs_)
- return 0;
-
- return ACE_OS::strdup (this->servants_iors_[index]);
-}
-
-int
-Cubit_Task::create_servants ()
-{
- TAO_TRY
- {
- // Create the array of cubit implementations.
- ACE_NEW_RETURN (this->servants_,
- Cubit_i *[this->num_of_objs_],
- -1);
-
- // Create the array of strings.
- ACE_NEW_RETURN (this->servants_iors_,
- CORBA::String [this->num_of_objs_],
- -1);
-
- char *buffer;
- int l = ACE_OS::strlen (this->key_) + 3;
-
- ACE_NEW_RETURN (buffer,
- char[l],
- -1);
-
- // This loop creates multiple servants, and prints out their
- // IORs.
- for (u_int i = 0;
- i < this->num_of_objs_;
- i++)
- {
- ACE_OS::sprintf (buffer,
- "%s%02d",
- (char *) this->key_,
- this->task_id_);
-
- PortableServer::ObjectId_var id =
- PortableServer::string_to_ObjectId (buffer);
-
- ACE_NEW_RETURN (this->servants_[i],
- Cubit_i,
- -1);
-
- if (this->servants_[i] == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to create "
- "implementation object #%d\n",
- i),
- 2);
-
- this->poa_->activate_object_with_id (id.in (),
- this->servants_[i],
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- // Stringify the objref we'll be implementing, and print it
- // to stdout. Someone will take that string and give it to
- // some client. Then release the object.
-
- Cubit_var cubit =
- this->servants_[i]->_this (TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- CORBA::String_var str =
- this->orb_->object_to_string (cubit.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- this->servants_iors_[i] = ACE_OS::strdup (str.in ());
-
- // Register the servant with the Naming Context....
- CosNaming::Name cubit_name (1);
- cubit_name.length (1);
- cubit_name[0].id =
- CORBA::string_dup (buffer);
-
- if (CORBA::is_nil (this->mt_cubit_context_.in ()) == CORBA::B_FALSE)
- {
- this->mt_cubit_context_->bind (cubit_name,
- cubit.in (),
- TAO_TRY_ENV);
- if (TAO_TRY_ENV.exception () != 0)
- TAO_TRY_ENV.print_exception ("Attempt to bind() a cubit object to the name service Failed!\n");
- else
- ACE_DEBUG ((LM_DEBUG,
- " (%t) Cubit object bound to the name \"%s\".\n",
- buffer));
- }
-
-#if 0 /* The IOR gets printout out later, so we don't need this. */
- ACE_DEBUG ((LM_DEBUG,
- " (%t) Object <%s> created\n",
- this->servants_iors_[i]));
-#endif /* 0 */
- }
- delete [] buffer;
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("print IOR");
- return -1;
- }
- TAO_ENDTRY;
- return 0;
-}
-
-// Parses the command line arguments and returns an error status.
-// @@ This method should be integrated into one of the classes
-// (preferably into an Options singleton) rather than kept as a
-// stand-alone function.
-
-static int
-parse_args (int argc, char *argv[])
-{
- ACE_Get_Opt opts (argc, argv, "sh:p:t:f:r");
- int c;
-
- if (ACE_OS::hostname (hostname, BUFSIZ) != 0)
- {
- perror ("gethostname");
- return -1;
- }
-
- while ((c = opts ()) != -1)
- switch (c)
- {
- case 'r':
- thread_per_rate = 1;
- break;
- case 's':
- use_name_service = 0;
- break;
- case 'f':
- ior_file = opts.optarg;
- break;
- case 'h':
- ACE_OS::strcpy (hostname, opts.optarg);
- ACE_DEBUG ((LM_DEBUG, "h\n"));
- break;
- case 'p':
- base_port = ACE_OS::atoi (opts.optarg);
- ACE_DEBUG ((LM_DEBUG, "p\n"));
- break;
- case 't':
- num_of_objs = ACE_OS::atoi (opts.optarg);
- break;
- case '?':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s"
- " [-s Means NOT to use the name service] "
- " [-p <port>]"
- " [-h <my_hostname>]"
- " [-t <num_objects>]"
- " [-f <ior_file>]"
- " [-r Use thread per rate]"
- "\n", argv [0]),
- 1);
- }
-
- if (thread_per_rate == 1)
- num_of_objs = 5;
-
- // Indicates successful parsing of command line
- return 0;
-}
-
-// @@ This method should be integrated into one of the classes rather
-// than kept as a stand-alone function.
-
-static int
-initialize (int argc, char **argv)
-{
-#if defined (VXWORKS)
-#if defined (VME_DRIVER)
- STATUS status = vmeDrv ();
-
- if (status != OK)
- printf ("ERROR on call to vmeDrv()\n");
-
- status = vmeDevCreate ("/vme");
-
- if (status != OK)
- printf ("ERROR on call to vmeDevCreate()\n");
-#endif /* defined (VME_DRIVER) */
-
-#if defined (FORCE_ARGS)
- int argc = 4;
- char *argv[] = { "server",
- "-s",
- "-f",
- "ior.txt" };
-
-#endif /* defined (FORCE_ARGS) */
-#endif /* defined (VXWORKS) */
-
- // Standard command line parsing utilities used.
- if (parse_args (argc, argv) != 0) return 1;
-
- if (hostname == 0 || base_port == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s"
- " [-s Means NOT to use the name service] "
- " [-p port]"
- " [-h my_hostname]"
- " [-t num_objects]"
- " [-f <ior_file>]"
- " [-r Use thread per rate]"
- "\n", argv [0]),
- 1);
-
- // Make sure we've got plenty of socket handles. This call will use
- // the default maximum.
- ACE::set_handle_limit ();
-
- return 0;
-}
-
-// Starts up the servants
-
-// @@ This method should be integrated into one of the classes rather
-// than kept as a stand-alone function.
-
-static int
-start_servants (ACE_Barrier &start_barrier)
-{
- char *args1;
-
- ACE_NEW_RETURN (args1,
- char[BUFSIZ],
- -1);
- int i;
-
- // Create an array to hold pointers to the Cubit objects.
- CORBA::String *cubits;
-
- ACE_NEW_RETURN (cubits,
- CORBA::String [num_of_objs],
- -1);
-
- ACE_OS::sprintf (args1,
- "rate20 -ORBport %d "
- "-ORBhost %s "
- "-ORBobjrefstyle URL "
- "-ORBsndsock 32768 "
- "-ORBrcvsock 32768 ",
- base_port,
- hostname);
-
- Cubit_Task *high_priority_task;
-
- ACE_NEW_RETURN (high_priority_task,
- Cubit_Task (args1,
- "internet",
- 1,
- &start_barrier,
- 0), //task id 0.
- -1);
-
-#if defined (VXWORKS)
- ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF;
-#elif defined (ACE_WIN32)
- ACE_Sched_Priority priority = ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
- ACE_SCOPE_THREAD);
-#else
- ACE_Sched_Priority priority = ACE_THR_PRI_FIFO_DEF + 25;
-#endif /* VXWORKS */
-
- ACE_DEBUG ((LM_DEBUG,
- "Creating servant with high priority %d\n",
- priority));
-
- // Make the high priority task an active object.
- if (high_priority_task->activate (THR_BOUND | ACE_SCHED_FIFO,
- 1,
- 0,
- priority) == -1)
- {
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n",
- "high_priority_task->activate"));
- }
-
- // Create an array to hold pointers to the low priority tasks.
- Cubit_Task **low_priority_task;
-
- ACE_NEW_RETURN (low_priority_task,
- Cubit_Task *[num_of_objs],
- -1);
-
- // Drop the priority
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
-
- ACE_DEBUG ((LM_DEBUG,
- "Creating %d servants with priority %d\n",
- num_of_objs - 1,
- priority));
-
- // Create the low priority servants.
-
- for (i = num_of_objs - 2; i >= 0; i--)
- {
- char *args;
-
- ACE_NEW_RETURN (args,
- char [BUFSIZ],
- -1);
-
- ACE_OS::sprintf (args,
- "rate10 -ORBport %d "
- "-ORBhost %s "
- "-ORBobjrefstyle URL "
- "-ORBsndsock 32768 "
- "-ORBrcvsock 32768 ",
- base_port + 1 + i,
- hostname);
-
- ACE_NEW_RETURN (low_priority_task [i],
- Cubit_Task (args, "internet", 1, &start_barrier, i+1),
- -1);
-
- // Make the low priority task an active object.
- if (low_priority_task [i]->activate (THR_BOUND | ACE_SCHED_FIFO,
- 1,
- 0,
- priority) == -1)
- {
- ACE_ERROR ((LM_ERROR, "(%P|%t; %p\n",
- "low_priority_task[i]->activate"));
- }
-
- // use different priorities on thread per rate.
- if (thread_per_rate == 1)
- priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
- priority,
- ACE_SCOPE_THREAD);
-
- ACE_DEBUG ((LM_DEBUG,
- "Created servant %d\n",
- i));
-
- }
-
- start_barrier.wait ();
-
-
- // Write the ior's to a file so the client can read them.
- {
- cubits[0] = high_priority_task->get_servant_ior (0);
-
- for (i = 0; i < num_of_objs-1; ++i)
- cubits[i + 1] = low_priority_task[i]->get_servant_ior (0);
-
- FILE *ior_f = 0;
-
- if (ior_file != 0)
- ior_f = ACE_OS::fopen (ior_file, "w+");
-
- for (i = 0; i < num_of_objs; ++i)
- {
- if (ior_f != 0)
- {
- ACE_OS::fprintf (ior_f, "%s\n", cubits[i]);
- }
- ACE_OS::printf ("cubits[%d] ior = %s\n",
- i,
- cubits[i]);
- }
-
- if (ior_f != 0)
- ACE_OS::fclose (ior_f);
- }
- return 0;
-}
-
-// main routine.
-
-#if defined (VXWORKS)
- // Rename main to server to make it easier to run both client and
- // server on one target.
-extern "C"
-int
-server (int argc, char *argv[])
-{
- ACE_Object_Manager ace_object_manager;
-#else
-int
-main (int argc, char *argv[])
-{
-#endif
-
-#if defined (ACE_HAS_THREADS)
- // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
- if (ACE_OS::sched_params (
- ACE_Sched_Params (
- ACE_SCHED_FIFO,
-#if defined (__Lynx__)
- 30,
-#else /* ! __Lynx__ */
- ACE_THR_PRI_FIFO_DEF, //ACE_Sched_Params::priority_min (ACE_SCHED_FIFO),
-#endif /* ! __Lynx__ */
- ACE_SCOPE_PROCESS)) != 0)
- {
- if (ACE_OS::last_error () == EPERM)
- ACE_DEBUG ((LM_MAX, "preempt: user is not superuser, "
- "so remain in time-sharing class\n"));
- else
- ACE_ERROR_RETURN ((LM_ERROR, "%n: ACE_OS::sched_params failed\n%a"),
- -1);
- }
-
- if (initialize (argc, argv) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Error in Initialization\n"),
- 1);
-
- // Barrier for the multiple clients to synchronize after binding to
- // the servants.
- ACE_Barrier start_barrier (num_of_objs + 1);
-
- if (start_servants (start_barrier) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Error creating the servants\n"),
- 1);
-
- ACE_DEBUG ((LM_DEBUG,
- "Wait for all the threads to exit\n"));
-
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
- quantify_clear_data ();
- quantify_start_recording_data();
-#endif /* ACE_QUANTIFY */
-
- // Wait for all the threads to exit.
- ACE_Thread_Manager::instance ()->wait ();
-
-#if defined (ACE_QUANTIFY)
- quantify_stop_recording_data();
-#endif /* ACE_QUANTIFY */
-
-#else
- ACE_DEBUG ((LM_DEBUG,
- "Test not run. This platform doesn't seem to have threads.\n"));
-#endif /* ACE_HAS_THREADS */
- return 0;
-}
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h
deleted file mode 100644
index 3176067327e..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests
-//
-// = FILENAME
-// server.h
-//
-// = AUTHOR
-// Andy Gokhale, Sumedh Mungee, and Sergio Flores-Gaitan
-//
-// ============================================================================
-
-// ACE includes.
-#include "ace/Get_Opt.h"
-#include "ace/Log_Msg.h"
-#include "ace/ARGV.h"
-#include "ace/Sched_Params.h"
-#include "orbsvcs/CosNamingC.h"
-
-// TAO includes.
-#include "tao/corba.h"
-
-// MT Cubit application includes.
-#include "cubit_i.h"
-
-#if defined (VME_DRIVER)
-#include <hostLib.h>
-extern "C" STATUS vmeDrv (void);
-extern "C" STATUS vmeDevCreate (char *);
-#endif /* VME_DRIVER */
-
-#if !defined (ACE_HAS_THREADS)
-class NOOP_ACE_Barrier
-{
-public:
- NOOP_ACE_Barrier (int ) {}
- void wait (void) {}
-};
-#define ACE_Barrier NOOP_ACE_Barrier
-#endif /* ACE_HAS_THREADS */
-
-class Cubit_Task : public ACE_Task<ACE_NULL_SYNCH>
-{
- // = TITLE
- // Encapsulates an ORB for the Cubit application.
- public:
- Cubit_Task (const char *args,
- const char* orbname,
- u_int num_of_objs,
- ACE_Barrier *barrier,
- u_int task_id);
- // Constructor.
-
- virtual int svc (void);
- // Active Object entry point.
-
- CORBA::String get_servant_ior (u_int index);
-
-protected:
- Cubit_Task (void);
- // No-op constructor.
-
-private:
- int initialize_orb (void);
- // Initialize the ORB, and POA.
-
- int create_servants (void);
- // Create the servants
-
- CORBA::String key_;
- // All cubit objects will have this as prefix to its key.
-
- char *orbname_;
- // Name of the ORB.
-
- char *orbargs_;
- // ORB arguments.
-
- u_int num_of_objs_;
- // Number of objects we're managing.
-
- CORBA::ORB_var orb_;
- // Pointer to the ORB
-
- PortableServer::POA_var root_poa_;
- // Pointer to the Root POA
-
- PortableServer::POA_var poa_;
- // Pointer to the child POA used on the application.
-
- PortableServer::POAManager_var poa_manager_;
- // The POA Manager for both the root POA and the child POA.
-
- Cubit_i **servants_;
- // Array to hold the servants
-
- ACE_Barrier *barrier_;
- // Barrier for the multiple servants to synchronize after
- // binding to the orb.
-
- CORBA::String *servants_iors_;
- // ior strings of the servants
-
- CosNaming::NamingContext_var naming_context_;
- // Object reference to the naming service
-
- u_int task_id_;
- // id used for naming service object name.
-
- CosNaming::NamingContext_var mt_cubit_context_;
- // context where all MT Cubit objects will be created.
-};
-
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/svc.conf b/TAO/performance-tests/Cubit/TAO/MT_Cubit/svc.conf
deleted file mode 100644
index 284c327aa0a..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/svc.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-# $Id$
-#
-# This file contains a sample ACE_Service_Config configuration
-# file specifying the strategy factories utilized by an application
-# using TAO. There are currently only two possible factories:
-# Client_Strategy_Factory and Server_Strategy_Factory. These names
-# must be used as the second argument to their corresponding line,
-# because that's what the ORB uses to find the desired factory.
-#
-# Note that there are two unordinary characteristics of the way *this*
-# file is set up:
-# - both client and server strategies are specified in the same
-# file, which would only make sense for co-located clients & servers
-# - both of the factories are actually sourced out of libTAO.so
-# (TAO.DLL on Win32), and they would normally be in a separate
-# dll from the TAO ORB Core.
-#
-# The options which can be passed to the Resource Factory are:
-#
-# -ORBresources <which>
-# where <which> can be 'global' to specify globally-held resources,
-# or 'tss' to specify thread-specific resources.
-#
-# The options which can be passed to the Client are:
-# <none currently>
-#
-# The options which can be passed to the Server are:
-# -ORBconcurrency <which>
-# where <which> can be 'thread-per-connection' to specify
-# use of the ACE_Threaded_Strategy concurrency strategy,
-# or 'reactive' to specify use of the ACE_Reactive_Strategy
-# concurrency strategy.
-#
-# -ORBthreadflags <flags>
-# specifies the default thread flags to use, where <flags> is a
-# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP,
-# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid
-# on every platform.
-#
-# -ORBdemuxstrategy <which>
-# where <which> can be one of 'dynamic', 'linear', 'active', or 'user',
-# and specifies the type of object lookup strategy used internally.
-# -ORBtablesize <unsigned>
-# specifies the size of the object table
-#
-dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources tss"
-dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() ""
-dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128"
-
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/tmplinst.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/tmplinst.cpp
deleted file mode 100644
index 91836d349b2..00000000000
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/tmplinst.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// $Id$
-//
-
-// The contents of this file REALLY should be generated by the IDL
-// compiler, but that functionality isn't available yet.
-
-#include "cubitC.h"
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */