diff options
Diffstat (limited to 'TAO/performance-tests/Thruput')
-rw-r--r-- | TAO/performance-tests/Thruput/TAO/client.cpp | 141 | ||||
-rwxr-xr-x | TAO/performance-tests/Thruput/TAO/run_client | 22 | ||||
-rwxr-xr-x | TAO/performance-tests/Thruput/TAO/run_server | 4 | ||||
-rwxr-xr-x | TAO/performance-tests/Thruput/TAO/run_test | 22 | ||||
-rw-r--r-- | TAO/performance-tests/Thruput/TAO/server.cpp | 14 |
5 files changed, 127 insertions, 76 deletions
diff --git a/TAO/performance-tests/Thruput/TAO/client.cpp b/TAO/performance-tests/Thruput/TAO/client.cpp index cff958b7411..04a3ccceede 100644 --- a/TAO/performance-tests/Thruput/TAO/client.cpp +++ b/TAO/performance-tests/Thruput/TAO/client.cpp @@ -16,6 +16,7 @@ // ============================================================================ #include "ace/ACE.h" +#include "ace/Read_Buffer.h" #include "ttcpC.h" #include "ttcp_decl.h" @@ -23,14 +24,16 @@ ACE_RCSID(TAO, client, "$Id$") int print_usage (void); +char * read_ior (char *filename); char Usage[] = "Usage: client [-options] \n" "Common options:\n" "-i <ior> Object reference string that the server outputs when started\n" + " -f ior_file" "-l ## length of bufs read from or written to network (default 8192)\n" "-v verbose: print more statistics\n" "-d ## debug level\n" - "-f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga\n" + "-m X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga\n" "-L ## Output file name to store results\n" "-S ## Total Data Size to be sent\n" "-q <type> Send Sequence: Enumeration for various data types:\n" @@ -77,66 +80,69 @@ main (int argc, char *argv[]) ttcp_sequence_ptr ttcp_seq = 0; // obj reference to TTCP object CORBA::Environment env; // environment - fstream iorfile; + FILE * ior_file; ACE_UNUSED_ARG (objkey); // parse the arguments - ACE_Get_Opt get_opt (argc, argv, "d:vf:l:L:S:q:i:"); // Command line options + ACE_Get_Opt get_opt (argc, argv, "d:vm:l:L:S:q:i:f:"); // Command line options TAO_debug_level = 0; while ((c = get_opt ()) != -1) { switch (c) - { - case 'i': - ior = ACE_OS::strdup (get_opt.optarg); - break; - case 'L': - title = ACE_OS::strdup (get_opt.optarg); - break; - case 'd': - TAO_debug_level = ACE_OS::atoi (get_opt.optarg); - if (TAO_debug_level > 10) - TAO_debug_level = 10; - break; - case 'l': - buflen = ACE_OS::atoi (get_opt.optarg); - break; - case 'v': - verbose = 1; - break; + { + case 'i': + ior = ACE_OS::strdup (get_opt.optarg); + break; + case 'L': + title = ACE_OS::strdup (get_opt.optarg); + break; + case 'd': + TAO_debug_level = ACE_OS::atoi (get_opt.optarg); + if (TAO_debug_level > 10) + TAO_debug_level = 10; + break; + case 'l': + buflen = ACE_OS::atoi (get_opt.optarg); + break; + case 'v': + verbose = 1; + break; + case 'm': + fmt = *get_opt.optarg; + break; + case 'S': /* total source data to send. */ + srcDataSize = ACE_OS::atoi (get_opt.optarg); + break; + case 'q': /* Send sequence of desired data type */ + switch(*get_opt.optarg){ + case 's': + dt = SEND_SHORT; + break; + case 'l': + dt = SEND_LONG; + break; + case 'd': + dt = SEND_DOUBLE; + break; + case 'c': + dt = SEND_CHAR; + break; + case 'o': + dt = SEND_OCTET; + break; + case 'S': + dt = SEND_STRUCT; + break; + case 'C': + dt = SEND_COMPOSITE; + break; + } + break; case 'f': - fmt = *get_opt.optarg; - break; - case 'S': /* total source data to send. */ - srcDataSize = ACE_OS::atoi (get_opt.optarg); + ior = read_ior (get_opt.optarg); break; - case 'q': /* Send sequence of desired data type */ - switch(*get_opt.optarg){ - case 's': - dt = SEND_SHORT; - break; - case 'l': - dt = SEND_LONG; - break; - case 'd': - dt = SEND_DOUBLE; - break; - case 'c': - dt = SEND_CHAR; - break; - case 'o': - dt = SEND_OCTET; - break; - case 'S': - dt = SEND_STRUCT; - break; - case 'C': - dt = SEND_COMPOSITE; - break; - } - break; - default: + default: return print_usage (); } } @@ -168,6 +174,11 @@ main (int argc, char *argv[]) { // if it is a valid obj ref, narrow it to a ttcp_sequence CORBA object ttcp_seq = ttcp_sequence::_narrow (objref, env); + if (env.exception () != 0) + { + env.print_exception ("ttcp_sequence::_narrow"); + return -1; + } if (!CORBA::is_nil (ttcp_seq)) { @@ -196,6 +207,7 @@ main (int argc, char *argv[]) // prep_timer (); // start our time + env.clear (); ttcp_seq->start_timer (env); // ask the server to start its timer if (env.exception () != 0) { @@ -278,3 +290,30 @@ int print_usage (void) ACE_ERROR ((LM_ERROR, "%s\n", Usage)); return -1; } + +char* +read_ior (char *filename) +{ + ACE_HANDLE f_handle; + // Open the file for reading. + f_handle = ACE_OS::open (filename,0); + + if (f_handle == ACE_INVALID_HANDLE) + ACE_ERROR_RETURN ((LM_ERROR, + "Unable to open %s for reading: %p\n", + filename), + 0); + ACE_Read_Buffer ior_buffer (f_handle); + char *data = ior_buffer.read (); + + if (data == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Unable to allocate memory to read ior: %p\n"), + 0); + + char *ior = 0; + ior = ACE_OS::strdup (data); + ior_buffer.alloc ()->free (data); + + return ior; +} diff --git a/TAO/performance-tests/Thruput/TAO/run_client b/TAO/performance-tests/Thruput/TAO/run_client index ee845fcce8c..5d281fef983 100755 --- a/TAO/performance-tests/Thruput/TAO/run_client +++ b/TAO/performance-tests/Thruput/TAO/run_client @@ -5,12 +5,12 @@ # $1 <Test_Name> # $2 <obj_reference_From_Server> -if ($#argv < 2) then - echo "Usage: run_client <Test_Name> <obj_reference_From_Server>" - exit 1 -endif +# if ($#argv < 2) then +# echo "Usage: run_client <Test_Name> <obj_reference_From_Server>" +# exit 1 +# endif -# shorts +#shorts run_test 67108864 128 ./results/REMOTE/$1/sun-iiop.atm1.64 s $2 sleep 5 # longs @@ -23,12 +23,12 @@ sleep 5 run_test 67108864 128 ./results/REMOTE/$1/sun-iiop.atm1.64 d $2 sleep 5 # chars -#run_test 67108864 128 ./results/REMOTE/$1/sun-iiop.atm1.64 c $2 -#sleep 5 +run_test 67108864 128 ./results/REMOTE/$1/sun-iiop.atm1.64 c $2 +sleep 5 # structures run_test 67108864 128 ./results/REMOTE/$1/sun-iiop.atm1.64 S $2 sleep 5 -# Composite Structs -#run_test 67108864 128 ./results/REMOTE/$1/sun-iiop.atm1.64 C $2 -#sleep 5 -# +#Composite Structs +run_test 67108864 128 ./results/REMOTE/$1/sun-iiop.atm1.64 C $2 +sleep 5 + diff --git a/TAO/performance-tests/Thruput/TAO/run_server b/TAO/performance-tests/Thruput/TAO/run_server index 50fdce5df97..d7276405bd9 100755 --- a/TAO/performance-tests/Thruput/TAO/run_server +++ b/TAO/performance-tests/Thruput/TAO/run_server @@ -4,8 +4,8 @@ # -u : use IOR # -f m : output results in Mbps # -b <sock Q size> ** not implemented ** -# -OAhost <host name> ************* must provide this for this version +# -ORBhost <host name> ************* must provide this for this version # -OAthread : use threaded version as opposed to reactive # -server -d 1 -f m -ORBhost `hostname` -ORBobjrefstyle url #-OAthread +./server -d 1 -f m -o ior -ORBhost $1 -ORBdotteddecimaladdresses 1 -ORBobjrefstyle url#-OAthread diff --git a/TAO/performance-tests/Thruput/TAO/run_test b/TAO/performance-tests/Thruput/TAO/run_test index e60f3296371..58cec7bdc1c 100755 --- a/TAO/performance-tests/Thruput/TAO/run_test +++ b/TAO/performance-tests/Thruput/TAO/run_test @@ -2,7 +2,7 @@ # $1 <Total_Data_Size> # $2 <Max_msg_size_in_Kb?> <-- currently not used? $2 == $argv[2] ?? -# $3 <Title_Of_This_Test> +# $3 <Output file name> # $4 <seq_type> # $5 <ior_from_server> @@ -10,10 +10,10 @@ # % run_test 10000 512 mambo\! s iiop:1.0//128.252.165.144:10015/P350892cc000ad963RootPOA/RootPOA_is_BAD/TTCP_IIOP_test # -if ($#argv < 5) then - echo "Usage: run_test <Total_Data_Size> <Max_msg_size> <Title_Of_This_Test> <seq_type> <ior_from_server>" - exit 1 -endif +# if ($#argv < 4) then +# echo "Usage: run_test <Total_Data_Size> <Max_msg_size> <Title_Of_This_Test> <seq_type>" +# exit 1 +# endif # @ msize=1024 @ limit= ($argv[2] * 1024) @@ -21,26 +21,26 @@ endif #echo $msize echo "-->" echo "--> ITERATION #" 1 - echo " client -S" $1 "-f m -l" $msize "-L" $3 "-q" $4 "-i" $5 + echo " client -S" $1 "-m m -l" $msize "-L" $3 "-q" $4 "-f ior" echo "-->" -client -S $1 -f m -l $msize -L $3 -q $4 -i $5 +./client -S $1 -m m -l $msize -L $3 -q $4 -f ior set flag=0 while ($msize <= $limit) if ($flag == 0) goto label echo "-->" echo "--> ITERATION #" 1 - echo " client -S" $1 "-f m -l" $msize "-L" $3 "-q" $4 "-i" $5 + echo " client -S" $1 "-f m -l" $msize "-L" $3 "-q" $4 "-f ior" echo "-->" - client -S $1 -f m -l $msize -L $3 -q $4 -i $5 + ./client -S $1 -m m -l $msize -L $3 -q $4 -f ior label: set flag=1 sleep 5 foreach i (2) echo "-->" echo "--> ITERATION #" $i - echo " client -S" $1 "-f m -l" $msize "-L" $3 "-q" $4 "-i" $5 + echo " client -S" $1 "-f m -l" $msize "-L" $3 "-q" $4 "-f ior" echo "-->" - client -S $1 -f m -l $msize -L $3 -q $4 -i $5 + ./client -S $1 -m m -l $msize -L $3 -q $4 -f ior end echo "---------------------------" @ msize = ($msize * 2) diff --git a/TAO/performance-tests/Thruput/TAO/server.cpp b/TAO/performance-tests/Thruput/TAO/server.cpp index 9a341b8315d..143ffee23c8 100644 --- a/TAO/performance-tests/Thruput/TAO/server.cpp +++ b/TAO/performance-tests/Thruput/TAO/server.cpp @@ -28,6 +28,7 @@ Common options:\n\ -d ## set debug level \n\ -f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga\n\ -L ## Output file name for the data type used\n\n\ +-o ior_filename\ "; CORBA::Long trans = 0; // we are the receiver @@ -74,6 +75,7 @@ main (int argc, char **argv) char *oa_name = "RootPOA"; // name of our OA char *orb_name = "internet"; // name of our ORB CORBA::String str; // for stringified representation of the object reference + FILE *ior_file = 0; ACE_UNUSED_ARG (key); @@ -133,7 +135,7 @@ main (int argc, char **argv) } // for parsing the arguments - ACE_Get_Opt get_opt (argc, argv, "l:vd:f:L:"); + ACE_Get_Opt get_opt (argc, argv, "l:vd:f:L:o:"); TAO_debug_level = 0; for (; (c = get_opt ()) != EOF;) @@ -154,6 +156,10 @@ main (int argc, char **argv) // output format i.e., Mbps, Kbps, etc fmt = *get_opt.optarg; break; + case 'o': + ior_file = ACE_OS::fopen (get_opt.optarg,"w"); + ACE_DEBUG ((LM_DEBUG,"ior_file is %s\n",get_opt.optarg)); + break; } } @@ -203,6 +209,12 @@ main (int argc, char **argv) } ACE_DEBUG ((LM_DEBUG, "stringified obj reference = %s\n", str)); + if (ior_file != 0) + { + // write ior to a file + ACE_OS::fprintf (ior_file,"%s",str); + ACE_OS::fclose (ior_file); + } } #if defined (ACE_HAS_QUANTIFY) |