diff options
| author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
|---|---|---|
| committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
| commit | b71531b42b3325fd6079a7039aae8641262c8adf (patch) | |
| tree | a5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/performance-tests/Benchmark/Multi_Threaded | |
| parent | a0f67cc97c0050d907145e312135b60c0125e56e (diff) | |
| download | ATCD-DS-main.tar.gz | |
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/performance-tests/Benchmark/Multi_Threaded')
8 files changed, 289 insertions, 0 deletions
diff --git a/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Client_Task.cpp b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Client_Task.cpp new file mode 100644 index 00000000000..a6d8d9d8202 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Client_Task.cpp @@ -0,0 +1,30 @@ +// +// $Id$ +// + +#include "Client_Task.h" + +Client_Task::Client_Task (Benchmark::RoundTripClient_ptr roundtrip) + : roundtrip_(Benchmark::RoundTripClient::_duplicate(roundtrip)) +{ +} + +int +Client_Task::svc (void) +{ + //Creat the Controller + Benchmark::Controller_var controller = this->roundtrip_->provide_controller(); + + //check if controller is non nil + if (CORBA::is_nil (controller.in ())) + ACE_ERROR_RETURN ((LM_DEBUG, + "Nil Benchmark::Controller reference \n"), + 1); + + ACE_DEBUG ((LM_DEBUG, "Sending Trigger\n")); + + //send out the trigger message + controller->start(); + + return 0; +} diff --git a/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Client_Task.h b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Client_Task.h new file mode 100644 index 00000000000..e3330a76307 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Client_Task.h @@ -0,0 +1,29 @@ +// +// $Id$ +// + +#ifndef CLIENT_TASK_H +#define CLIENT_TASK_H +#include /**/ "ace/pre.h" + +#include "RoundTripClientC.h" +#include "ace/Task.h" + +/// Implement the Test::Client_Task interface +class Client_Task : public ACE_Task_Base +{ +public: + /// Constructor + Client_Task (Benchmark::RoundTripClient_ptr roundtrip); + + /// The service method + virtual int svc (void); + +private: + + /// The object reference used for this test + Benchmark::RoundTripClient_var roundtrip_; +}; + +#include /**/ "ace/post.h" +#endif /* CLIENT_TASK_H */ diff --git a/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc new file mode 100644 index 00000000000..40927889016 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc @@ -0,0 +1,18 @@ +// $Id$ + +project (Multi_Threaded_client) : ciao_client_dnc, valuetype , strategies { + exename = client + after += RoundTripClient_stub + libs += RoundTripClient_stub Benchmark_stub + libpaths += .. + includes += ../RoundTripClient + avoids += ace_for_tao + + IDL_Files { + } + + Source_Files { + client.cpp + Client_Task.cpp + } +} diff --git a/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/NOTE.txt b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/NOTE.txt new file mode 100644 index 00000000000..a0ae140a0ee --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/NOTE.txt @@ -0,0 +1,15 @@ +$Id$ + +PRE Condition: +============= +This test assumes that there is an appropriate svc.conf file present in +$CIAO_ROOOT/tools/ComponentServer. Moreover, the Component Server does not +curerntly expose interfaces to configure multi-threading. Hence, this +experiment, will produce the desired results *only* when this feature has been +added in CIAO. Till then, the server will run in single-threaded mode. + +Similarly, the client also requires the svc.conf file that enables +multi-threading. This file is present in this directory. + +The svc.conf file required for this experiment can be obtained from +$TAO_ROOT/performance-tests/Latency/Thread_Pool diff --git a/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/README b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/README new file mode 100644 index 00000000000..0cadcfc8e51 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/README @@ -0,0 +1,12 @@ +/** + +@page Multi_Threaded README File + + This black box experiment measures "multi-threading" support present in CIAO. +In this test, a client component spawns four threads that concurrently invoke operations +on the server. The latency, throughput and jitter for each thread is printed out. The +motivation of this test is to observe scalability when a ComponentServer receives +multiple requests from parallel clients. A sister test, ../Multi_Process documents +behavior as parallel clients (separate processes) invoke requests on the server. + +*/ diff --git a/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/client.cpp b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/client.cpp new file mode 100644 index 00000000000..92bf6aecd2d --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/client.cpp @@ -0,0 +1,93 @@ +// +// $Id$ +// + +//============================================================== +/** + * @file client.cpp + * + * This is a client program that also acts as an Event Trigger. Four client tasks simultaneously + * send out trigger to the ClientRoundTrip component to start the latency measurements in + * parallel. This test is used to test scalability as the number of client components increase + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + */ +//=============================================================== + +#include "Client_Task.h" +#include "tao/Strategies/advanced_resource.h" + +//IOR of the components +const char *ior1 = "file://comp1.ior"; +const char *ior2 = "file://comp2.ior"; +const char *ior3 = "file://comp3.ior"; +const char *ior4 = "file://comp4.ior"; + + +int +main (int argc, char *argv[]) +{ + try + { + + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, + ""); + + // Resolve HomeFinder interface + CORBA::Object_var obj1 + = orb->string_to_object (ior1); + + CORBA::Object_var obj2 + = orb->string_to_object (ior2); + + CORBA::Object_var obj3 + = orb->string_to_object (ior3); + + CORBA::Object_var obj4 + = orb->string_to_object (ior4); + + if (CORBA::is_nil (obj1.in ()) || + CORBA::is_nil (obj2.in ()) || + CORBA::is_nil (obj3.in ()) || + CORBA::is_nil (obj4.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Nil Benchmark::RoundtripClient reference \n"), + 1); + } + + //Narrow to appropriate interfaces + Benchmark::RoundTripClient_var client1= + Benchmark::RoundTripClient::_narrow (obj1.in()); + + Benchmark::RoundTripClient_var client2= + Benchmark::RoundTripClient::_narrow (obj1.in()); + + Benchmark::RoundTripClient_var client3= + Benchmark::RoundTripClient::_narrow (obj1.in()); + + Benchmark::RoundTripClient_var client4= + Benchmark::RoundTripClient::_narrow (obj1.in()); + + //Create Tasks + Client_Task task1(client1.in()); + Client_Task task2(client2.in()); + Client_Task task3(client3.in()); + Client_Task task4(client4.in()); + + task1.activate(THR_NEW_LWP | THR_JOINABLE); + task2.activate(THR_NEW_LWP | THR_JOINABLE); + task3.activate(THR_NEW_LWP | THR_JOINABLE); + task4.activate(THR_NEW_LWP | THR_JOINABLE); + + task1.thr_mgr()->wait(); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception Caught:"); + return 1; + } + return 0; +} diff --git a/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/run_test.pl b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/run_test.pl new file mode 100755 index 00000000000..fe52b35d6a2 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/run_test.pl @@ -0,0 +1,87 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +# +# @@ Run this script from ../descriptors/ instead. +# + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$status = 0; +$daemon_ior = PerlACE::LocalFile ("daemon.ior"); +$am_ior = PerlACE::LocalFile ("am.ior"); + +$ACE_ROOT=$ENV{'ACE_ROOT'}; +$CIAO_ROOT=$ENV{'CIAO_ROOT'}; + +unlink $daemon_ior; +unlink $am_ior; + +# CIAO Daemon command line arguments +$daemon_args = "-c $CIAO_ROOT/tools/ComponentServer/svc.conf -ORBEndpoint iiop://localhost:10000 -o $daemon_ior -i CIAO_Installation_Data.ini -n $CIAO_ROOT/tools/ComponentServer/ComponentServer"; + +# CIAO Daemon command line arguments +$daemon_args2 = "-c $CIAO_ROOT/tools/ComponentServer/svc.conf -ORBEndpoint iiop://localhost:12000 -o $daemon_ior -i CIAO_Installation_Data.ini -n $CIAO_ROOT/tools/ComponentServer/ComponentServer"; + +$assembly_manager_args = "-o $am_ior -c test.dat"; + +$ad_args = " -k file://$am_ior -a Multi_Threaded.cad"; + +# CIAO daemon process definition +$DS = new PerlACE::Process ("$CIAO_ROOT/tools/Daemon/CIAO_Daemon", + "$daemon_args"); + +## Starting up the CIAO daemon +$DS->Spawn (); +if (PerlACE::waitforfile_timed ($daemon_ior, 15) == -1) { + print STDERR "ERROR: Could not find daemon ior file <$daemon_ior>\n"; + $DS->Kill (); + exit 1; +} + +# CIAO daemon process definition +$DS2 = new PerlACE::Process ("$CIAO_ROOT/tools/Daemon/CIAO_Daemon", + "$daemon_args2"); + +## Starting up the CIAO daemon +$DS2->Spawn (); +if (PerlACE::waitforfile_timed ($daemon_ior, 15) == -1) { + print STDERR "ERROR: Could not find daemon ior file <$daemon_ior>\n"; + $DS->Kill (); + exit 1; +} + +$AM = new PerlACE::Process("$CIAO_ROOT/tools/Assembly_Deployer/Assembly_Manager", + $assembly_manager_args); +$AM->Spawn (); +if (PerlACE::waitforfile_timed ($am_ior, 15) == -1) { + print STDERR "ERROR: Could not find assembly ior file <$am_ior>\n"; + $AM->Kill (); + exit 1; +} + +$AD = new PerlACE::Process("$CIAO_ROOT/tools/Assembly_Deployer/Assembly_Deployer", + $ad_args); +$AD->Spawn (); + +sleep (5); + +#Start the client to send the trigger message +$CL = new PerlACE::Process ("../Multi_Threaded/client", ""); +$CL->SpawnWaitKill(60); + +$AM->Kill (); +$AD->Kill (); +$DS->Kill (); +$CL->Kill (); +$DS2->Kill (); + +unlink $daemon_ior; +unlink $am_ior; + +exit $status; diff --git a/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/svc.conf b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/svc.conf new file mode 100644 index 00000000000..46ff5409fdf --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/Multi_Threaded/svc.conf @@ -0,0 +1,5 @@ +# +# $Id$ +# +static Advanced_Resource_Factory "-ORBReactorMaskSignals 0 -ORBFlushingStrategy blocking" +static Client_Strategy_Factory "-ORBTransportMuxStrategy EXCLUSIVE -ORBClientConnectionHandler RW" |
