diff options
author | sergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-22 02:39:35 +0000 |
---|---|---|
committer | sergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-22 02:39:35 +0000 |
commit | de06aade812972fad42df2cbda097697714a0534 (patch) | |
tree | da0fc45b0baad1aee65492244cce921bbc7e5c60 | |
parent | 6d4b0faad001928b3908464119028882018bd8ec (diff) | |
download | ATCD-de06aade812972fad42df2cbda097697714a0534.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/ChangeLog-98c | 10 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 67 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h | 3 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp | 5 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp | 54 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 67 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h | 3 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp | 5 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/server.cpp | 54 |
9 files changed, 218 insertions, 50 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index dab7abaed55..d4d7663c0c1 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,13 @@ +Sat Mar 21 20:34:39 1998 Sergio Flores <sergio@lambada.cs.wustl.edu> + + * tests/Cubit/TAO/MT_Cubit/server.cpp: + * tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp: + * tests/Cubit/TAO/MT_Cubit/Task_Client.h: + * tests/Cubit/TAO/MT_Cubit/Task_Client.cpp: added option to + disable use of the name service. hacked the code for platforms + that don't support floating point math. Added Quantify start/stop + primitives around CORBA calls. + Sat Mar 21 11:00:40 1998 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> * tao/corbacom.h: Moved the CORBA_SEQUENCE stuff back into the diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index 052e817af29..d4beb636d59 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -45,15 +45,19 @@ Task_State::Task_State (int argc, char **argv) global_jitter_array_ (0), factory_ior_ (0), shutdown_ (0), - oneway_ (0) + oneway_ (0), + use_name_service_ (1) { ACE_OS::strcpy (server_host_, "localhost"); - ACE_Get_Opt opts (argc, argv, "h:n:t:p:d:rk:xo"); + ACE_Get_Opt opts (argc, argv, "sh:n:t:p:d:rk:xo"); int c; int datatype; while ((c = opts ()) != -1) switch (c) { + case 's': + use_name_service_ = 0; + break; case 'k': factory_ior_ = ACE_OS::strdup (opts.optarg); break; @@ -112,6 +116,7 @@ Task_State::Task_State (int argc, char **argv) " [-k factory_ior_key]" " [-x] // makes a call to servant to shutdown" " [-o] // makes client use oneway calls instead" + " [-s] // makes client *NOT* use the name service" "\n", argv [0])); } // thread_count_ + 1 because there is one utilization thread also @@ -193,7 +198,12 @@ Client::get_high_priority_jitter () { double difference = ts_->global_jitter_array_ [0][i] - average; jitter += difference * difference; } +// @@ This is a *hack*, we need to implement sqrt without double's. +#if defined (ACE_LACKS_FLOATING_POINT) + return 1; +#else /* ! ACE_LACKS_FLOATING_POINT */ return sqrt (jitter / (double) (ts_->loop_count_ - 1)); +#endif /* ! ACE_LACKS_FLOATING_POINT */ } double @@ -247,6 +257,8 @@ Client::svc (void) return -1; } +if (ts_->use_name_service_ != 0) +{ naming_obj = orb->resolve_initial_references ("NameService"); @@ -258,6 +270,7 @@ Client::svc (void) this->naming_context_ = CosNaming::NamingContext::_narrow (naming_obj.in (), env); } + } { #if defined (ACE_HAS_THREADS) @@ -475,6 +488,12 @@ Client::run_tests (Cubit_ptr cb, double latency = 0; double sleep_time = (1/frequency) * (1000 * 1000); double delta = 0; + +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); + quantify_clear_data (); +#endif + // Make the calls in a loop. for (i = 0; i < loop_count; i++) @@ -493,7 +512,17 @@ Client::run_tests (Cubit_ptr cb, // Cube an octet. CORBA::Octet arg_octet = func (i), ret_octet = 0; +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif + ret_octet = cb->cube_octet (arg_octet, env); + +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif + if (env.exception () != 0) { env.print_exception ("call to cube_octet()\n"); @@ -518,8 +547,17 @@ Client::run_tests (Cubit_ptr cb, CORBA::Short arg_short = func (i), ret_short; +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif + ret_short = cb->cube_short (arg_short, env); +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif + if (env.exception () != 0) { env.print_exception ("call to cube_short()\n"); @@ -546,8 +584,17 @@ Client::run_tests (Cubit_ptr cb, CORBA::Long arg_long = func (i), ret_long; +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif + ret_long = cb->cube_long (arg_long, env); +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif + if (env.exception () != 0) { env.print_exception ("call to cube_long()\n"); @@ -575,8 +622,17 @@ Client::run_tests (Cubit_ptr cb, arg_struct.s = func (i); arg_struct.o = func (i); +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif + ret_struct = cb->cube_struct (arg_struct, env); +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif + if (env.exception () != 0) { env.print_exception ("call to cube_struct()\n"); @@ -602,7 +658,14 @@ Client::run_tests (Cubit_ptr cb, else { call_count++; +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif cb->noop (env); +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif if (env.exception () != 0) { env.print_exception ("oneway call noop()\n"); diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h index 70c58134bd6..3a4567e964a 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h @@ -137,6 +137,9 @@ public: 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. }; class Client : public ACE_Task<ACE_SYNCH> diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp index 8bcdecce530..ac1d1060353 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp @@ -54,7 +54,12 @@ Util_Thread::run_computations (void) u_long original = CUBIT_ARBIT_NUMBER; u_long n = original; u_long test_done = 1; +// @@ This is a *hack*, we need to implement sqrt and ceil without double's. +#if defined (ACE_LACKS_FLOATING_POINT) + u_long sqrt_n = n/10; +#else /* ! ACE_LACKS_FLOATING_POINT */ u_long sqrt_n = (u_long) ceil (sqrt (n)); +#endif /* ! ACE_LACKS_FLOATING_POINT */ u_long i; for (i = 2; i <= sqrt_n; i++) diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp index b5856d545b6..4c1995ad29b 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp @@ -15,6 +15,12 @@ #include "server.h" +// Global options used to configure various parameters. +static char *hostname = NULL; +static int base_port = 0; +static int num_of_objs = 1; +static u_int use_name_service = 1; + Cubit_Task::Cubit_Task (void) { // No-op. @@ -152,32 +158,35 @@ Cubit_Task::initialize_orb (void) } TAO_CHECK_ENV; + if (use_name_service == 0) + return 0; + CORBA::Object_var naming_obj = - this->orb_->resolve_initial_references ("NameService"); + 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); - + 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); + 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; - } - + 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); - + this->naming_context_->bind_new_context (cubit_context_name, TAO_TRY_ENV); + if (TAO_TRY_ENV.exception() != 0) { #if 0 // un comment when Andy fixes exception marshalling bug. @@ -487,22 +496,20 @@ Cubit_Factory_Task::initialize_orb (void) return 0; } -// Global options used to configure various parameters. -static char *hostname = NULL; -static int base_port = 0; -static int num_of_objs = 1; - // Parses the command line arguments and returns an error status. static int parse_args (int argc, char *argv[]) { - ACE_Get_Opt opts (argc, argv, "h:p:t:"); + ACE_Get_Opt opts (argc, argv, "sh:p:t:"); int c; while ((c = opts ()) != -1) switch (c) { + case 's': + use_name_service = 0; + break; case 'h': hostname = opts.optarg; ACE_DEBUG ((LM_DEBUG, "h\n")); @@ -518,9 +525,10 @@ parse_args (int argc, char *argv[]) default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s" - " -p port" - " -h my_hostname" - " -t num_objects" + " [-s Means NOT to use the name service] " + " [-p <port>]" + " [-h <my_hostname>]" + " [-t <num_objects>]" "\n", argv [0]), 1); } diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index 052e817af29..d4beb636d59 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -45,15 +45,19 @@ Task_State::Task_State (int argc, char **argv) global_jitter_array_ (0), factory_ior_ (0), shutdown_ (0), - oneway_ (0) + oneway_ (0), + use_name_service_ (1) { ACE_OS::strcpy (server_host_, "localhost"); - ACE_Get_Opt opts (argc, argv, "h:n:t:p:d:rk:xo"); + ACE_Get_Opt opts (argc, argv, "sh:n:t:p:d:rk:xo"); int c; int datatype; while ((c = opts ()) != -1) switch (c) { + case 's': + use_name_service_ = 0; + break; case 'k': factory_ior_ = ACE_OS::strdup (opts.optarg); break; @@ -112,6 +116,7 @@ Task_State::Task_State (int argc, char **argv) " [-k factory_ior_key]" " [-x] // makes a call to servant to shutdown" " [-o] // makes client use oneway calls instead" + " [-s] // makes client *NOT* use the name service" "\n", argv [0])); } // thread_count_ + 1 because there is one utilization thread also @@ -193,7 +198,12 @@ Client::get_high_priority_jitter () { double difference = ts_->global_jitter_array_ [0][i] - average; jitter += difference * difference; } +// @@ This is a *hack*, we need to implement sqrt without double's. +#if defined (ACE_LACKS_FLOATING_POINT) + return 1; +#else /* ! ACE_LACKS_FLOATING_POINT */ return sqrt (jitter / (double) (ts_->loop_count_ - 1)); +#endif /* ! ACE_LACKS_FLOATING_POINT */ } double @@ -247,6 +257,8 @@ Client::svc (void) return -1; } +if (ts_->use_name_service_ != 0) +{ naming_obj = orb->resolve_initial_references ("NameService"); @@ -258,6 +270,7 @@ Client::svc (void) this->naming_context_ = CosNaming::NamingContext::_narrow (naming_obj.in (), env); } + } { #if defined (ACE_HAS_THREADS) @@ -475,6 +488,12 @@ Client::run_tests (Cubit_ptr cb, double latency = 0; double sleep_time = (1/frequency) * (1000 * 1000); double delta = 0; + +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); + quantify_clear_data (); +#endif + // Make the calls in a loop. for (i = 0; i < loop_count; i++) @@ -493,7 +512,17 @@ Client::run_tests (Cubit_ptr cb, // Cube an octet. CORBA::Octet arg_octet = func (i), ret_octet = 0; +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif + ret_octet = cb->cube_octet (arg_octet, env); + +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif + if (env.exception () != 0) { env.print_exception ("call to cube_octet()\n"); @@ -518,8 +547,17 @@ Client::run_tests (Cubit_ptr cb, CORBA::Short arg_short = func (i), ret_short; +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif + ret_short = cb->cube_short (arg_short, env); +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif + if (env.exception () != 0) { env.print_exception ("call to cube_short()\n"); @@ -546,8 +584,17 @@ Client::run_tests (Cubit_ptr cb, CORBA::Long arg_long = func (i), ret_long; +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif + ret_long = cb->cube_long (arg_long, env); +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif + if (env.exception () != 0) { env.print_exception ("call to cube_long()\n"); @@ -575,8 +622,17 @@ Client::run_tests (Cubit_ptr cb, arg_struct.s = func (i); arg_struct.o = func (i); +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif + ret_struct = cb->cube_struct (arg_struct, env); +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif + if (env.exception () != 0) { env.print_exception ("call to cube_struct()\n"); @@ -602,7 +658,14 @@ Client::run_tests (Cubit_ptr cb, else { call_count++; +#if defined (USE_QUANTIFY) + /* start recording quantify data from here */ + quantify_start_recording_data (); +#endif cb->noop (env); +#if defined (USE_QUANTIFY) + quantify_stop_recording_data(); +#endif if (env.exception () != 0) { env.print_exception ("oneway call noop()\n"); diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h index 70c58134bd6..3a4567e964a 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h +++ b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h @@ -137,6 +137,9 @@ public: 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. }; class Client : public ACE_Task<ACE_SYNCH> diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp index 8bcdecce530..ac1d1060353 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/Util_Thread.cpp @@ -54,7 +54,12 @@ Util_Thread::run_computations (void) u_long original = CUBIT_ARBIT_NUMBER; u_long n = original; u_long test_done = 1; +// @@ This is a *hack*, we need to implement sqrt and ceil without double's. +#if defined (ACE_LACKS_FLOATING_POINT) + u_long sqrt_n = n/10; +#else /* ! ACE_LACKS_FLOATING_POINT */ u_long sqrt_n = (u_long) ceil (sqrt (n)); +#endif /* ! ACE_LACKS_FLOATING_POINT */ u_long i; for (i = 2; i <= sqrt_n; i++) diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp index b5856d545b6..4c1995ad29b 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp @@ -15,6 +15,12 @@ #include "server.h" +// Global options used to configure various parameters. +static char *hostname = NULL; +static int base_port = 0; +static int num_of_objs = 1; +static u_int use_name_service = 1; + Cubit_Task::Cubit_Task (void) { // No-op. @@ -152,32 +158,35 @@ Cubit_Task::initialize_orb (void) } TAO_CHECK_ENV; + if (use_name_service == 0) + return 0; + CORBA::Object_var naming_obj = - this->orb_->resolve_initial_references ("NameService"); + 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); - + 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); + 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; - } - + 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); - + this->naming_context_->bind_new_context (cubit_context_name, TAO_TRY_ENV); + if (TAO_TRY_ENV.exception() != 0) { #if 0 // un comment when Andy fixes exception marshalling bug. @@ -487,22 +496,20 @@ Cubit_Factory_Task::initialize_orb (void) return 0; } -// Global options used to configure various parameters. -static char *hostname = NULL; -static int base_port = 0; -static int num_of_objs = 1; - // Parses the command line arguments and returns an error status. static int parse_args (int argc, char *argv[]) { - ACE_Get_Opt opts (argc, argv, "h:p:t:"); + ACE_Get_Opt opts (argc, argv, "sh:p:t:"); int c; while ((c = opts ()) != -1) switch (c) { + case 's': + use_name_service = 0; + break; case 'h': hostname = opts.optarg; ACE_DEBUG ((LM_DEBUG, "h\n")); @@ -518,9 +525,10 @@ parse_args (int argc, char *argv[]) default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s" - " -p port" - " -h my_hostname" - " -t num_objects" + " [-s Means NOT to use the name service] " + " [-p <port>]" + " [-h <my_hostname>]" + " [-t <num_objects>]" "\n", argv [0]), 1); } |