[openib-general] [kDAPL] fix kdapltest to support ia64 and add return value
James Lentini
jlentini at netapp.com
Thu May 5 10:25:38 PDT 2005
Revision 2258 contains fixes to kdapltest for the IA64 platform from
Itamar. Thanks Itamar!
If anyone continues to experience problems with DAPL on IA64 systems,
please let me know.
james
---------- Forwarded message ----------
Date: Thu, 5 May 2005 16:08:47 +0300
From: Itamar <itamar at mellanox.co.il>
To: James.Lentini at netapp.com
Subject: fix kdapltest to support ia64 and add return value
This patch is based on gen2 svn rev 2257
new feature in kdapltest
1) add return value to tests (-T T,-T P,-T S)
2) move double code from kernel to user
Signed-off-by: Itamar Rabenstein <itamar at mellanox.co.il>
Index: dapltest/test/dapl_performance_util.c
===================================================================
--- dapltest/test/dapl_performance_util.c (revision 2257)
+++ dapltest/test/dapl_performance_util.c (working copy)
@@ -254,6 +254,8 @@ DT_Performance_Test_Create (
test_ptr->ep_context.op.Rdma_Address = 0;
test_ptr->ep_context.port = test_ptr->base_port;
test_ptr->ep_context.pipeline_len = pipeline_len;
+ // update pipeline_len
+ pt_ptr->Params.Client_Stats_P.pipeline_len = pipeline_len;
return true;
}
@@ -284,6 +286,7 @@ DT_Performance_Test_Destroy (
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: Warning: Bpool destroy fails\n",
test_ptr->base_port);
/* carry on trying, regardless */
+ g_status = 1;
}
}
@@ -297,6 +300,7 @@ DT_Performance_Test_Destroy (
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: Warning: Bpool destroy fails\n",
test_ptr->base_port);
/* carry on trying, regardless */
+ g_status = 1;
}
}
@@ -315,12 +319,14 @@ DT_Performance_Test_Destroy (
test_ptr->base_port,
DT_RetToString (ret));
/* carry on trying, regardless */
+ g_status = 1;
}
else if (!DT_disco_event_wait ( phead, test_ptr->conn_evd_hdl,
&ep_handle))
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: bad disconnect event\n",
test_ptr->base_port);
+ g_status = 1;
}
}
@@ -333,6 +339,7 @@ DT_Performance_Test_Destroy (
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_ep_free error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* carry on trying, regardless */
+ g_status = 1;
}
}
@@ -345,6 +352,7 @@ DT_Performance_Test_Destroy (
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_free (conn) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
if (is_server)
@@ -357,6 +365,7 @@ DT_Performance_Test_Destroy (
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_free (creq) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
}
@@ -368,6 +377,7 @@ DT_Performance_Test_Destroy (
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_free (reqt) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
if (test_ptr->recv_evd_hdl)
@@ -378,6 +388,7 @@ DT_Performance_Test_Destroy (
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_free (recv) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
@@ -390,6 +401,7 @@ DT_Performance_Test_Destroy (
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_pz_free error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
Index: dapltest/test/dapl_performance_client.c
===================================================================
--- dapltest/test/dapl_performance_client.c (revision 2257)
+++ dapltest/test/dapl_performance_client.c (working copy)
@@ -53,18 +53,21 @@ DT_Performance_Test_Client (
&test_ptr) )
{
DT_Tdep_PT_Debug (1,(phead,"Client: Resource Creation Failed\n"));
- connected = 0;
+ g_status = 1;
+ connected = 0;
}
else if ( !DT_Performance_Test_Client_Connect (phead, test_ptr) )
{
DT_Tdep_PT_Debug (1,(phead,"Client: Connection Failed\n"));
- connected = 0;
+ g_status = 1;
+ connected = 0;
}
-
+ params_ptr->Client_Stats_P.pipeline_len = pt_ptr->Params.Client_Stats_P.pipeline_len;
if ( connected )
{
if ( !DT_Performance_Test_Client_Exchange (params_ptr,phead, test_ptr) )
{
+ g_status = 1;
DT_Tdep_PT_Debug (1,(phead,"Client: Test Failed\n"));
}
}
@@ -233,31 +236,8 @@ DT_Performance_Test_Client_Phase1 (
{
return false;
}
-
- /* calculate CPU utilization */
- {
- unsigned long int system;
- unsigned long int user;
- unsigned long int idle;
- unsigned long int total;
-
- system = post_cpu_stat.system - pre_cpu_stat.system;
- user = post_cpu_stat.user - pre_cpu_stat.user;
- idle = post_cpu_stat.idle - pre_cpu_stat.idle;
-
- total = system + user + idle;
-
- if ( 0 == total )
- {
- stats->cpu_utilization = 0.0;
- }
- else
- {
- stats->cpu_utilization = (double)1.0 - ((double) idle / (double) total );
- stats->cpu_utilization *= 100.0;
- }
- }
-
+ stats->post_cpu_stat = post_cpu_stat;
+ stats->pre_cpu_stat = pre_cpu_stat;
return true;
}
@@ -502,7 +482,7 @@ DT_Performance_Test_Client_Exchange (
{
return false;
}
- DT_performance_stats_print (params_ptr,phead, &stats, test_ptr->cmd, test_ptr);
-
+ stats.pipeline_len = params_ptr->Client_Stats_P.pipeline_len;
+ params_ptr->Client_Stats_P = stats;
return true;
}
Index: dapltest/test/dapl_execute.c
===================================================================
--- dapltest/test/dapl_execute.c (revision 2257)
+++ dapltest/test/dapl_execute.c (working copy)
@@ -32,6 +32,8 @@
#include "dapl_quit_cmd.h"
#include "dapl_limit_cmd.h"
+int g_status;
+
void
DT_Execute_Test (Params_t *params_ptr)
{
Index: dapltest/test/dapl_transaction_stats.c
===================================================================
--- dapltest/test/dapl_transaction_stats.c (revision 2257)
+++ dapltest/test/dapl_transaction_stats.c (working copy)
@@ -101,73 +101,3 @@ DT_update_transaction_stats (Transaction
transaction_stats->bytes_rdma_write += bytes_rdma_write;
DT_Mdep_Unlock (&transaction_stats->lock);
}
-
-/*
- *
- */
-void
-DT_print_transaction_stats (DT_Tdep_Print_Head *phead,
- Transaction_Stats_t * transaction_stats,
- unsigned int num_threads,
- unsigned int num_EPs)
-{
- double time_s;
- double mbytes_send;
- double mbytes_recv;
- double mbytes_rdma_read;
- double mbytes_rdma_write;
- int total_ops;
- DT_Mdep_Lock (&transaction_stats->lock);
- time_s = (double) (transaction_stats->time_ms) / 1000;
- if (time_s == 0.0)
- {
- DT_Tdep_PT_Printf (phead,
- "----- Test completed successfully, but cannot calculate stats as not\n"
- "----- enough time has lapsed.\n"
- "----- Try running the test with more iterations.\n");
- goto unlock_and_return;
- }
- mbytes_send = (double) transaction_stats->bytes_send / 1000 / 1000;
- mbytes_recv = (double) transaction_stats->bytes_recv / 1000 / 1000;
- mbytes_rdma_read = (double) transaction_stats->bytes_rdma_read / 1000 / 1000;
- mbytes_rdma_write = (double) transaction_stats->bytes_rdma_write / 1000 / 1000;
- total_ops = transaction_stats->num_ops;
-
- if ( 0 == total_ops )
- {
- DT_Tdep_PT_Printf (phead, "----- Test completed successfully, but no operations!\n");
- goto unlock_and_return;
- }
-
- DT_Tdep_PT_Printf (phead, "----- Stats ---- : %u threads, %u EPs\n",
- num_threads, num_EPs);
- DT_Tdep_PT_Printf (phead, "Total WQE : %7d.%02d WQE/Sec\n",
- whole (total_ops / time_s),
- hundredths (total_ops / time_s));
- DT_Tdep_PT_Printf (phead, "Total Time : %7d.%02d sec\n",
- whole (time_s),
- hundredths (time_s));
- DT_Tdep_PT_Printf (phead, "Total Send : %7d.%02d MB - %7d.%02d MB/Sec\n",
- whole (mbytes_send),
- hundredths (mbytes_send),
- whole (mbytes_send / time_s),
- hundredths (mbytes_send / time_s));
- DT_Tdep_PT_Printf (phead, "Total Recv : %7d.%02d MB - %7d.%02d MB/Sec\n",
- whole (mbytes_recv),
- hundredths (mbytes_recv),
- whole (mbytes_recv / time_s),
- hundredths (mbytes_recv / time_s));
- DT_Tdep_PT_Printf (phead, "Total RDMA Read : %7d.%02d MB - %7d.%02d MB/Sec\n",
- whole (mbytes_rdma_read),
- hundredths (mbytes_rdma_read),
- whole (mbytes_rdma_read / time_s),
- hundredths (mbytes_rdma_read / time_s));
- DT_Tdep_PT_Printf (phead, "Total RDMA Write : %7d.%02d MB - %7d.%02d MB/Sec\n",
- whole (mbytes_rdma_write),
- hundredths (mbytes_rdma_write),
- whole (mbytes_rdma_write / time_s),
- hundredths (mbytes_rdma_write / time_s));
-
-unlock_and_return:
- DT_Mdep_Unlock (&transaction_stats->lock);
-}
Index: dapltest/test/dapl_server.c
===================================================================
--- dapltest/test/dapl_server.c (revision 2257)
+++ dapltest/test/dapl_server.c (working copy)
@@ -65,6 +65,7 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"NOTICE: server already started for this NIC: %s\n",
Server_Cmd->dapl_name);
+ g_status = 1;
return;
}
temp_list = temp_list->next;
@@ -75,6 +76,7 @@ DT_cs_Server (Params_t * params_ptr)
if (temp_list == 0)
{
DT_Tdep_PT_Printf (phead, "no memory for server_list\n");
+ g_status = 1;
return;
}
strcpy (temp_list->devicename, Server_Cmd->dapl_name);
@@ -111,6 +113,7 @@ DT_cs_Server (Params_t * params_ptr)
Server_Cmd->dapl_name,
DT_RetToString (ret));
ps_ptr->ia_handle = DAT_HANDLE_NULL;
+ g_status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: IA %s opened\n", module, Server_Cmd->dapl_name));
@@ -124,6 +127,7 @@ DT_cs_Server (Params_t * params_ptr)
module,
DT_RetToString (ret));
ps_ptr->pz_handle = DAT_HANDLE_NULL;
+ g_status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: PZ created\n", module));
@@ -140,6 +144,7 @@ DT_cs_Server (Params_t * params_ptr)
"%s: dat_evd_create (recv) failed %s\n",
module, DT_RetToString (ret));
ps_ptr->recv_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto server_exit;
}
ret = DT_Tdep_evd_create (ps_ptr->ia_handle,
@@ -153,6 +158,7 @@ DT_cs_Server (Params_t * params_ptr)
"%s: dat_evd_create (send) failed %s\n",
module, DT_RetToString (ret));
ps_ptr->reqt_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto server_exit;
}
ret = DT_Tdep_evd_create (ps_ptr->ia_handle,
@@ -166,6 +172,7 @@ DT_cs_Server (Params_t * params_ptr)
"%s: dat_evd_create (cr) failed %s\n",
module, DT_RetToString (ret));
ps_ptr->creq_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto server_exit;
}
ret = DT_Tdep_evd_create (ps_ptr->ia_handle,
@@ -179,6 +186,7 @@ DT_cs_Server (Params_t * params_ptr)
"%s: dat_evd_create (conn) failed %s\n",
module, DT_RetToString (ret));
ps_ptr->conn_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto server_exit;
}
@@ -197,6 +205,7 @@ DT_cs_Server (Params_t * params_ptr)
module,
DT_RetToString (ret));
ps_ptr->ep_handle = DAT_HANDLE_NULL;
+ g_status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: EP created\n", module));
@@ -214,6 +223,7 @@ DT_cs_Server (Params_t * params_ptr)
module,
DT_RetToString (ret));
ps_ptr->psp_handle = DAT_HANDLE_NULL;
+ g_status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: PSP created\n", module));
@@ -238,6 +248,7 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"%s: no memory for command buffer pool.\n",
module);
+ g_status = 1;
goto server_exit;
}
@@ -291,6 +302,7 @@ DT_cs_Server (Params_t * params_ptr)
/* Gather whatever info we want about defaults */
if (!DT_query (pt_ptr, ps_ptr->ia_handle, ps_ptr->ep_handle))
{
+ g_status = 1;
goto server_exit;
}
@@ -305,6 +317,7 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"%s: cannot post ClientInfo recv buffer\n",
module);
+ g_status = 1;
goto server_exit;
}
if (!DT_post_recv_buffer (phead,
@@ -316,6 +329,7 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"%s: cannot post Transaction_Cmd_t recv buffer\n",
module);
+ g_status = 1;
goto server_exit;
}
@@ -339,6 +353,7 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"CR Check failed, file %s line %d\n", __FILE__,
__LINE__);
+ g_status = 1;
goto server_exit;
}
@@ -350,6 +365,7 @@ DT_cs_Server (Params_t * params_ptr)
"%s: dat_cr_accept error: %s\n",
module,
DT_RetToString (ret));
+ g_status = 1;
goto server_exit;
}
@@ -362,6 +378,7 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"%s: error awaiting conn-established event\n",
module);
+ g_status = 1;
goto server_exit;
}
@@ -384,6 +401,7 @@ DT_cs_Server (Params_t * params_ptr)
dto_cookie,
"Client_Info_Recv"))
{
+ g_status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: Got Client_Info\n", module));
@@ -408,6 +426,7 @@ DT_cs_Server (Params_t * params_ptr)
dto_cookie,
"Client_Cmd_Recv"))
{
+ g_status = 1;
goto server_exit;
}
@@ -481,6 +500,7 @@ DT_cs_Server (Params_t * params_ptr)
if (pt_ptr->thread == 0)
{
DT_Tdep_PT_Printf (phead, "no memory to create thread\n");
+ g_status = 1;
goto server_exit;
}
break;
@@ -513,6 +533,7 @@ DT_cs_Server (Params_t * params_ptr)
if (pt_ptr->thread == 0)
{
DT_Tdep_PT_Printf (phead, "no memory to create thread\n");
+ g_status = 1;
goto server_exit;
}
/* take the performance test lock to serialize */
@@ -538,6 +559,7 @@ DT_cs_Server (Params_t * params_ptr)
if (DT_Thread_Start (pt_ptr->thread) == false)
{
DT_Tdep_PT_Debug (1,(phead,"failed to start test thread\n"));
+ g_status = 1;
goto server_exit;
}
@@ -556,6 +578,7 @@ DT_cs_Server (Params_t * params_ptr)
"DAPLTEST VERSION MISMATCH",
DAPLTEST_VERSION,
pt_ptr->Client_Info.dapltest_version);
+ g_status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: Version OK!\n", module));
@@ -573,6 +596,7 @@ DT_cs_Server (Params_t * params_ptr)
DT_Bpool_GetBuffSize (ps_ptr->bpool, 2)))
{
DT_Tdep_PT_Printf (phead, "%s: cannot send Server_Info\n", module);
+ g_status = 1;
goto server_exit;
}
/* reap the send and verify it */
@@ -587,6 +611,7 @@ DT_cs_Server (Params_t * params_ptr)
dto_cookie,
"Server_Info_Send"))
{
+ g_status = 1;
goto server_exit;
}
@@ -604,11 +629,13 @@ DT_cs_Server (Params_t * params_ptr)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ep_disconnect fails: %s\n",
module, DT_RetToString (ret));
+ g_status = 1;
goto server_exit;
}
if (!DT_disco_event_wait ( phead, ps_ptr->conn_evd_hdl, NULL))
{
DT_Tdep_PT_Printf (phead, "%s: bad disconnect event\n", module);
+ g_status = 1;
goto server_exit;
}
@@ -658,6 +685,7 @@ server_exit:
DT_Tdep_PT_Printf (phead, "%s: dat_ep_disconnect fails: %s\n",
module, DT_RetToString (ret));
/* keep trying */
+ g_status = 1;
}
else if (!DT_disco_event_wait ( phead,
ps_ptr->conn_evd_hdl,
@@ -666,6 +694,7 @@ server_exit:
DT_Tdep_PT_Printf (phead,
"%s: bad disconnect event\n",
module);
+ g_status = 1;
}
}
@@ -677,6 +706,7 @@ server_exit:
DT_Tdep_PT_Printf (phead,
"%s: error destroying buffer pool\n", module);
/* keep trying */
+ g_status = 1;
}
}
@@ -690,6 +720,7 @@ server_exit:
module,
DT_RetToString (ret));
/* keep trying */
+ g_status = 1;
}
}
@@ -702,6 +733,7 @@ server_exit:
DT_Tdep_PT_Printf (phead, "%s: dat_ep_free error: %s\n",
module, DT_RetToString (ret));
/* keep trying */
+ g_status = 1;
}
}
@@ -715,6 +747,7 @@ server_exit:
"%s: dat_evd_free (conn) error: %s\n",
module, DT_RetToString (ret));
/* keep trying */
+ g_status = 1;
}
}
if (ps_ptr->creq_evd_hdl)
@@ -726,6 +759,7 @@ server_exit:
"%s: dat_evd_free (creq) error: %s\n",
module, DT_RetToString (ret));
/* keep trying */
+ g_status = 1;
}
}
if (ps_ptr->reqt_evd_hdl)
@@ -737,6 +771,7 @@ server_exit:
"%s: dat_evd_free (reqt) error: %s\n",
module, DT_RetToString (ret));
/* keep trying */
+ g_status = 1;
}
}
if (ps_ptr->recv_evd_hdl)
@@ -748,6 +783,7 @@ server_exit:
"%s: dat_evd_free (recv) error: %s\n",
module, DT_RetToString (ret));
/* keep trying */
+ g_status = 1;
}
}
@@ -760,6 +796,7 @@ server_exit:
DT_Tdep_PT_Printf (phead, "%s: dat_pz_free error: %s\n",
module, DT_RetToString (ret));
/* keep trying */
+ g_status = 1;
}
}
@@ -773,12 +810,14 @@ server_exit:
DT_Tdep_PT_Printf (phead,
"%s: dat_ia_close (graceful) error: %s\n",
module, DT_RetToString (ret));
+ g_status = 1;
ret = dat_ia_close (ps_ptr->ia_handle, DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
"%s: dat_ia_close (abrupt) error: %s\n",
module, DT_RetToString (ret));
+ g_status = 1;
}
/* keep trying */
}
Index: dapltest/test/dapl_performance_stats.c
===================================================================
--- dapltest/test/dapl_performance_stats.c (revision 2257)
+++ dapltest/test/dapl_performance_stats.c (working copy)
@@ -36,7 +36,6 @@ DT_performance_stats_init (
stats->post_ctxt_switch_num = 0;
stats->reap_ctxt_switch_num = 0;
- stats->cpu_utilization = 0.0;
stats->time_ts = 0;
stats->posts_sans_ctxt.num = 0;
@@ -168,8 +167,6 @@ DT_performance_stats_combine (
dest->reap_ctxt_switch_num =
src_b->reap_ctxt_switch_num + src_b->reap_ctxt_switch_num;
- dest->cpu_utilization = DT_max (src_a->cpu_utilization,
- src_b->cpu_utilization);
dest->time_ts = DT_max (src_a->time_ts, src_b->time_ts);
DT_performance_stats_data_combine (&dest->posts_sans_ctxt,
@@ -194,203 +191,3 @@ DT_performance_stats_combine (
}
-double
-DT_performance_stats_data_print (
- DT_Tdep_Print_Head *phead,
- Performance_Stats_Data_t *data,
- double cpu_mhz)
-{
- double average;
-
- average = (int64_t)data->total_ts / (data->num * cpu_mhz);
-
- DT_Tdep_PT_Printf (phead,
- " Arithmetic mean : %d.%d us\n"
- " maximum : %d.%d us\n"
- " minimum : %d.%d us\n",
- DT_whole(average),DT_hundredths(average),
- DT_whole((int64_t)data->max_ts / cpu_mhz),DT_hundredths((int64_t)data->max_ts / cpu_mhz),
- DT_whole((int64_t)data->min_ts / cpu_mhz),DT_hundredths((int64_t)data->min_ts / cpu_mhz));
- return average;
-}
-
-
-void
-DT_performance_stats_print (
- Params_t *params_ptr,
- DT_Tdep_Print_Head *phead,
- Performance_Stats_t *stats,
- Performance_Cmd_t *cmd,
- Performance_Test_t *test)
-{
- double cpu_mhz;
- double time_s;
- double mbytes;
- double ops_per_sec;
- double bandwidth;
- double latency;
- double time_per_post;
- double time_per_reap;
-
- cpu_mhz = params_ptr->cpu_mhz;
- latency = 0;
-#if defined(WIN32)
- /*
- * The Microsoft compiler is unable to do a 64 bit conversion when
- * working with double. time_ts is a 64 bit value, so we
- * potentially lose precision, so limit it to the Windows
- * platform. Trying to do the operation below without casting
- * a 64 bit value to an unsigned int results in the error when
- * using Visual C 6.0:
- *
- * Compiler Error C2520: conversion from unsigned __int64 to
- * double not implemented, use signed __int64.
- *
- * Note that signed __int64 doesn't work either!
- */
- time_s = (double) ((unsigned int)stats->time_ts / (1000000.0 * cpu_mhz));
-#else
- time_s = (double) (stats->time_ts / (1000000.0 * cpu_mhz));
-#endif
- mbytes = (double) (1.0 * stats->bytes) / 1024 / 1024;
-
- if ( 0.0 == time_s )
- {
- DT_Tdep_PT_Printf (phead, "Error determining time\n");
- return;
- }
- else if ( 0 == stats->num_ops )
- {
- DT_Tdep_PT_Printf (phead, "Error determining number of operations\n");
- return;
- }
- else if ( 0.0 == cpu_mhz )
- {
- DT_Tdep_PT_Printf (phead, "Error determining CPU speed\n");
- return;
- }
-
- ops_per_sec = stats->num_ops / time_s;
- bandwidth = mbytes / time_s;
- DT_Tdep_PT_Printf (phead, "------------------------- Statistics -------------------------\n");
- DT_Tdep_PT_Printf (phead,
- " Mode : %s\n"
- " Operation Type : %s\n"
- " Number of Operations : %u\n"
- " Segment Size : %u\n"
- " Number of Segments : %u bytes\n"
- " Pipeline Length : %u\n\n",
- DT_PerformanceModeToString (cmd->mode),
- DT_TransferTypeToString (cmd->op.transfer_type),
- cmd->num_iterations,
- cmd->op.seg_size,
- cmd->op.num_segs,
- test->ep_context.pipeline_len);
-
- DT_Tdep_PT_Printf (phead,
- " Total Time : %d.%d sec\n"
- " Total Data Exchanged : %d.%d MB\n"
- " CPU Utilization : %d.%d\n"
- " Operation Throughput : %d.%d ops/sec\n"
- " Bandwidth : %d.%d MB/sec\n",
- DT_whole(time_s),DT_hundredths(time_s),
- DT_whole(mbytes),DT_hundredths(mbytes),
- DT_whole(stats->cpu_utilization),DT_hundredths(stats->cpu_utilization),
- DT_whole(ops_per_sec),DT_hundredths(ops_per_sec),
- DT_whole(bandwidth),DT_hundredths(bandwidth));
-
- DT_Tdep_PT_Printf (phead, "\nLatency\n");
-
- if ( stats->latency.num )
- {
- latency = DT_performance_stats_data_print (phead,
- &stats->latency,
- cpu_mhz);
- }
- DT_Tdep_PT_Printf (phead, "\n"
- "Time Per Post\n"
- " %u posts without context switches\n",
- stats->posts_sans_ctxt.num);
-
- if ( stats->posts_sans_ctxt.num )
- {
- DT_performance_stats_data_print (phead,
- &stats->posts_sans_ctxt,
- cpu_mhz);
- }
-
- DT_Tdep_PT_Printf (phead, "\n"
- " %u posts with context switches\n",
- stats->posts_with_ctxt.num);
-
- if ( stats->posts_with_ctxt.num )
- {
- DT_Tdep_PT_Printf (phead, " %u number of context switches\n",
- stats->post_ctxt_switch_num);
- DT_performance_stats_data_print (phead,
- &stats->posts_with_ctxt,
- cpu_mhz);
- }
-
- DT_Tdep_PT_Printf (phead, "\n"
- "Time Per Reap\n"
- " %u reaps without context switches\n",
- stats->reaps_sans_ctxt.num);
-
- if ( stats->reaps_sans_ctxt.num )
- {
- DT_performance_stats_data_print (phead,
- &stats->reaps_sans_ctxt,
- cpu_mhz);
- }
-
-
- DT_Tdep_PT_Printf (phead, "\n"
- " %u reaps with context switches\n",
- stats->reaps_with_ctxt.num);
-
- if ( stats->reaps_with_ctxt.num )
- {
- DT_Tdep_PT_Printf (phead, "\n"
- " %u number of context switches\n",
- stats->reap_ctxt_switch_num);
-
- DT_performance_stats_data_print (phead,
- &stats->reaps_with_ctxt,
- cpu_mhz);
- }
-
- time_per_post =
- (int64_t) (stats->posts_sans_ctxt.total_ts + stats->posts_with_ctxt.total_ts) /
- (cpu_mhz * (stats->posts_sans_ctxt.num + stats->posts_with_ctxt.num));
-
- time_per_reap =
- (int64_t) (stats->reaps_sans_ctxt.total_ts + stats->reaps_with_ctxt.total_ts) /
- (cpu_mhz * (stats->reaps_sans_ctxt.num + stats->reaps_with_ctxt.num));
-
- DT_Tdep_PT_Printf (phead,
- "\nNOTE: 1 MB = 1024 KB = 1048576 B \n");
- DT_Tdep_PT_Printf (phead,
- "---------------------------------------------------------------------\n");
- DT_Tdep_PT_Printf (phead,
- "raw: %s, %u, %u, %u, %u, %d.%d, %d.%d, %d.%d, %d.%d, %d.%d, %d.%d \n",
- DT_TransferTypeToString (cmd->op.transfer_type),
- cmd->num_iterations,
- cmd->op.seg_size,
- cmd->op.num_segs,
- test->ep_context.pipeline_len,
- DT_whole (stats->cpu_utilization),
- DT_hundredths (stats->cpu_utilization),
- DT_whole (ops_per_sec),
- DT_hundredths (ops_per_sec),
- DT_whole (bandwidth),
- DT_hundredths (bandwidth),
- DT_whole (latency),
- DT_hundredths (latency),
- DT_whole (time_per_post),
- DT_hundredths (time_per_post),
- DT_whole (time_per_reap),
- DT_hundredths (time_per_reap));
- DT_Tdep_PT_Printf (phead,
- "---------------------------------------------------------------------\n");
-}
Index: dapltest/test/dapl_transaction_test.c
===================================================================
--- dapltest/test/dapl_transaction_test.c (revision 2257)
+++ dapltest/test/dapl_transaction_test.c (working copy)
@@ -74,6 +74,7 @@ DT_Transaction_Test_Client (Per_Test_Dat
remote_ia_addr))
{
DT_Tdep_PT_Printf (phead, "Client: Cannot Create Test!\n");
+ g_status = 1;
break;
}
}
@@ -83,11 +84,6 @@ DT_Transaction_Test_Client (Per_Test_Dat
{
DT_Mdep_Sleep (100);
}
-
- DT_print_transaction_stats (phead,
- &pt_ptr->Client_Stats,
- cmd->num_threads,
- cmd->eps_per_thread);
}
@@ -117,6 +113,7 @@ DT_Transaction_Test_Server (void *params
(DAT_IA_ADDRESS_PTR) 0))
{
DT_Tdep_PT_Printf (phead, "Server: Cannot Create Test!\n");
+ g_status = 1;
break;
}
}
@@ -248,6 +245,7 @@ DT_Transaction_Main (void *param)
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_pz_create error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
test_ptr->pz_handle = DAT_HANDLE_NULL;
+ g_status = 1;
goto test_failure;
}
@@ -262,6 +260,7 @@ DT_Transaction_Main (void *param)
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (recv) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
test_ptr->recv_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto test_failure;
}
@@ -275,6 +274,7 @@ DT_Transaction_Main (void *param)
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (request) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
test_ptr->reqt_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto test_failure;
}
@@ -291,6 +291,7 @@ DT_Transaction_Main (void *param)
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (cr) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
test_ptr->creq_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto test_failure;
}
}
@@ -305,6 +306,7 @@ DT_Transaction_Main (void *param)
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (conn) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
test_ptr->conn_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto test_failure;
}
@@ -319,6 +321,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: no memory for EP context\n",
test_ptr->base_port);
+ g_status = 1;
goto test_failure;
}
@@ -367,6 +370,7 @@ DT_Transaction_Main (void *param)
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_ep_create #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
test_ptr->ep_context[i].ep_handle = DAT_HANDLE_NULL;
+ g_status = 1;
goto test_failure;
}
@@ -389,6 +393,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: no memory for remote memory buffers\n",
test_ptr->base_port);
+ g_status = 1;
goto test_failure;
}
@@ -419,6 +424,7 @@ DT_Transaction_Main (void *param)
buff_size))
{
/* error message printed by DT_post_recv_buffer */
+ g_status = 1;
goto test_failure;
}
if (!DT_post_recv_buffer ( phead,
@@ -428,6 +434,7 @@ DT_Transaction_Main (void *param)
SYNC_BUFF_SIZE))
{
/* error message printed by DT_post_recv_buffer */
+ g_status = 1;
goto test_failure;
}
@@ -454,6 +461,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_rsp_create #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
+ g_status = 1;
goto test_failure;
}
}
@@ -468,6 +476,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_psp_create #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
+ g_status = 1;
goto test_failure;
}
@@ -529,6 +538,7 @@ DT_Transaction_Main (void *param)
&cr_handle,
"Server") )
{
+ g_status = 1;
goto test_failure;
}
@@ -537,6 +547,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_query #%d error:(%x) %s\n",
test_ptr->base_port, i, ret, DT_RetToString (ret));
+ g_status = 1;
}
else
{
@@ -563,6 +574,7 @@ DT_Transaction_Main (void *param)
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_accept #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
/* cr_handle consumed on failure */
+ g_status = 1;
goto test_failure;
}
@@ -573,6 +585,7 @@ DT_Transaction_Main (void *param)
&event_num))
{
/* error message printed by DT_conn_event_wait */
+ g_status = 1;
goto test_failure;
}
/* throw away single-use PSP */
@@ -581,6 +594,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_rsp_free #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
+ g_status = 1;
goto test_failure;
}
@@ -597,6 +611,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_psp_create #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
+ g_status = 1;
goto test_failure;
}
@@ -607,6 +622,7 @@ DT_Transaction_Main (void *param)
&cr_handle,
"Server") )
{
+ g_status = 1;
goto test_failure;
}
@@ -615,6 +631,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_query #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
+ g_status = 1;
}
else
{
@@ -643,6 +660,7 @@ DT_Transaction_Main (void *param)
test_ptr->base_port, i, DT_RetToString (ret));
/* cr_handle consumed on failure */
(void) dat_psp_free (test_ptr->ep_context[i].psp_handle);
+ g_status = 1;
goto test_failure;
}
@@ -654,6 +672,7 @@ DT_Transaction_Main (void *param)
{
/* error message printed by DT_cr_event_wait */
(void) dat_psp_free (&test_ptr->ep_context[i].psp_handle);
+ g_status = 1;
goto test_failure;
}
@@ -663,6 +682,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_psp_free #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
+ g_status = 1;
goto test_failure;
}
} /* end short-lived PSP */
@@ -695,6 +715,7 @@ retry:
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_ep_connect #%d error: %s (0x%x)\n",
test_ptr->base_port, i, DT_RetToString (ret), ret);
+ g_status = 1;
goto test_failure;
}
@@ -736,6 +757,7 @@ retry:
buff_size))
{
/* error message printed by DT_post_recv_buffer */
+ g_status = 1;
goto test_failure;
}
if (!DT_post_recv_buffer ( phead,
@@ -745,6 +767,7 @@ retry:
SYNC_BUFF_SIZE))
{
/* error message printed by DT_post_recv_buffer */
+ g_status = 1;
goto test_failure;
}
}
@@ -758,6 +781,7 @@ retry:
}
}
/* error message printed by DT_cr_event_wait */
+ g_status = 1;
goto test_failure;
}
@@ -819,6 +843,7 @@ retry:
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: no memory for buffers (RDMA/RD)\n",
test_ptr->base_port);
+ g_status = 1;
goto test_failure;
}
if (!us)
@@ -854,6 +879,7 @@ retry:
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: no memory for buffers (RDMA/WR)\n",
test_ptr->base_port);
+ g_status = 1;
goto test_failure;
}
if (!us)
@@ -888,6 +914,7 @@ retry:
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: no memory for buffers (S/R)\n",
test_ptr->base_port);
+ g_status = 1;
goto test_failure;
}
@@ -967,6 +994,7 @@ retry:
test_ptr->is_server ? "Client_Mem_Info_Send"
: "Server_Mem_Info_Send"))
{
+ g_status = 1;
goto test_failure;
}
@@ -990,6 +1018,7 @@ retry:
test_ptr->is_server ? "Client_Mem_Info_Recv"
: "Server_Mem_Info_Recv"))
{
+ g_status = 1;
goto test_failure;
}
@@ -1037,6 +1066,8 @@ retry:
* Finally! Run the test.
*/
success = DT_Transaction_Run (phead, test_ptr);
+ g_status = !success;
+ //leave the qp open for debug and dont close the test
// while (1) {
// DT_Mdep_Sleep(1000);
// }
@@ -1065,6 +1096,7 @@ test_failure:
{
DT_Tdep_PT_Printf (phead, "test[" F64x "]: Warning: Bpool destroy fails\n",
test_ptr->base_port);
+ g_status = 1;
/* carry on trying, regardless */
}
}
@@ -1079,6 +1111,7 @@ test_failure:
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: Warning: Bpool destroy fails\n",
test_ptr->base_port);
+ g_status = 1;
/* carry on trying, regardless */
}
}
@@ -1100,6 +1133,7 @@ test_failure:
success ? "graceful" : "abrupt",
i, DT_RetToString (ret));
/* carry on trying, regardless */
+ g_status = 1;
}
}
@@ -1117,6 +1151,7 @@ test_failure:
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: bad disconnect event\n",
test_ptr->base_port);
+ g_status = 1;
}
else
{
@@ -1165,6 +1200,7 @@ test_failure:
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_ep_free #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
/* carry on trying, regardless */
+ g_status = 1;
}
}
} /* end foreach per-EP context */
@@ -1181,6 +1217,7 @@ test_failure:
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_free (conn) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
if (pt_ptr->local_is_server)
@@ -1193,6 +1230,7 @@ test_failure:
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_free (creq) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
}
@@ -1204,6 +1242,7 @@ test_failure:
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_free (reqt) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
if (test_ptr->recv_evd_hdl)
@@ -1214,6 +1253,7 @@ test_failure:
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_free (recv) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
@@ -1226,6 +1266,7 @@ test_failure:
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_pz_free error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
/* fall through, keep trying */
+ g_status = 1;
}
}
@@ -1892,51 +1933,3 @@ DT_Print_Transaction_Test (DT_Tdep_Print
test_ptr->stats.stat_bytes_rdma_write);
}
-
-/*------------------------------------------------------------------------------ */
-void
-DT_Print_Transaction_Stats (DT_Tdep_Print_Head *phead, Transaction_Test_t * test_ptr)
-{
- double time;
- double mbytes_send;
- double mbytes_recv;
- double mbytes_rdma_read;
- double mbytes_rdma_write;
- int total_ops;
- time = (double) (test_ptr->stats.end_time - test_ptr->stats.start_time) / 1000;
- mbytes_send = (double) test_ptr->stats.stat_bytes_send / 1024 / 1024;
- mbytes_recv = (double) test_ptr->stats.stat_bytes_recv / 1024 / 1024;
- mbytes_rdma_read = (double) test_ptr->stats.stat_bytes_rdma_read / 1024 / 1024;
- mbytes_rdma_write = (double) test_ptr->stats.stat_bytes_rdma_write / 1024 / 1024;
- total_ops = test_ptr->cmd->num_ops * test_ptr->cmd->num_iterations;
-
- DT_Tdep_PT_Printf (phead, "Test[: " F64x "] ---- Stats ----\n", test_ptr->base_port);
- DT_Tdep_PT_Printf (phead, "Iterations : %u\n", test_ptr->cmd->num_iterations);
- DT_Tdep_PT_Printf (phead, "Ops : %7d.%02d Ops/Sec\n",
- whole (total_ops / time),
- hundredths (total_ops / time));
- DT_Tdep_PT_Printf (phead, "Time : %7d.%02d sec\n",
- whole (time),
- hundredths (time));
- DT_Tdep_PT_Printf (phead, "Sent : %7d.%02d MB - %7d.%02d MB/Sec\n",
- whole (mbytes_send),
- hundredths (mbytes_send),
- whole (mbytes_send / time),
- hundredths (mbytes_send / time));
- DT_Tdep_PT_Printf (phead, "Recv : %7d.%02d MB - %7d.%02d MB/Sec\n",
- whole (mbytes_recv),
- hundredths (mbytes_recv),
- whole (mbytes_recv / time),
- hundredths (mbytes_recv / time));
- DT_Tdep_PT_Printf (phead, "RDMA Read : %7d.%02d MB - %7d.%02d MB/Sec\n",
- whole (mbytes_rdma_read),
- hundredths (mbytes_rdma_read),
- whole (mbytes_rdma_read / time),
- hundredths (mbytes_rdma_read / time));
- DT_Tdep_PT_Printf (phead, "RDMA Write : %7d.%02d MB - %7d.%02d MB/Sec\n",
- whole (mbytes_rdma_write),
- hundredths (mbytes_rdma_write),
- whole (mbytes_rdma_write / time),
- hundredths (mbytes_rdma_write / time));
-}
-
Index: dapltest/test/dapl_performance_server.c
===================================================================
--- dapltest/test/dapl_performance_server.c (revision 2257)
+++ dapltest/test/dapl_performance_server.c (working copy)
@@ -49,6 +49,7 @@ DT_Performance_Test_Server (
{
DT_Tdep_PT_Printf (phead, "Server: Resource Creation Failed\n");
success = 0;
+ g_status = 1;
}
if ( 1 == success )
{
@@ -56,6 +57,7 @@ DT_Performance_Test_Server (
{
success = 0;
DT_Tdep_PT_Printf (phead, "Server: Connection Failed\n");
+ g_status = 1;
}
}
@@ -64,6 +66,7 @@ DT_Performance_Test_Server (
if ( ! DT_Performance_Test_Server_Exchange (phead, test_ptr) )
{
success = 0;
+ g_status = 1;
DT_Tdep_PT_Printf (phead, "Server: Test Failed\n");
}
}
@@ -196,6 +199,7 @@ DT_Performance_Test_Server_Connect (
* this thread is ready to wait for a connection request
* from the remote end.
*/
+
DT_Mdep_wait_object_wakeup (&test_ptr->pt_ptr->synch_wait_object);
DT_Tdep_PT_Debug (1,(phead,"Server[" F64x "]: Listen on PSP port 0x" F64x "\n",
Index: dapltest/test/dapl_util.c
===================================================================
--- dapltest/test/dapl_util.c (revision 2257)
+++ dapltest/test/dapl_util.c (working copy)
@@ -49,29 +49,6 @@ DT_RetToString (DAT_RETURN ret_value)
return errmsg;
}
-/*
- * Map DAT_RETURN values to readable strings,
- * but don't assume the values are zero-based or contiguous.
- */
-const char *
-DT_TransferTypeToString (DT_Transfer_Type type)
-{
- static char *DT_Type[] =
- {
- "RR",
- "RW",
- "SR"
- };
-
- if ( (0 <= type) && (type <= 2) )
- {
- return DT_Type[type];
- }
- else
- {
- return "Error: Unkown Transfer Type";
- }
-}
/*
Index: dapltest/test/dapl_client.c
===================================================================
--- dapltest/test/dapl_client.c (revision 2257)
+++ dapltest/test/dapl_client.c (working copy)
@@ -77,6 +77,7 @@ DT_cs_Client (Params_t * params_ptr,
if (!pt_ptr)
{
DT_Tdep_PT_Printf (phead, "%s: no memory for Per_Test_Data\n", module);
+ g_status = 1;
return;
}
DT_MemListInit (pt_ptr); /* init MemlistLock and memListHead */
@@ -106,7 +107,8 @@ DT_cs_Client (Params_t * params_ptr,
dapl_name,
DT_RetToString (ret));
ia_handle = DAT_HANDLE_NULL;
- goto client_exit;
+ g_status = 1;
+ goto client_exit;
}
DT_Tdep_PT_Debug (1,(phead, "%s: IA %s opened\n", module, dapl_name));
@@ -119,6 +121,7 @@ DT_cs_Client (Params_t * params_ptr,
module,
DT_RetToString (ret));
pz_handle = DAT_HANDLE_NULL;
+ g_status = 1;
goto client_exit;
}
@@ -136,6 +139,7 @@ DT_cs_Client (Params_t * params_ptr,
module,
DT_RetToString (ret));
recv_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto client_exit;
}
ret = DT_Tdep_evd_create (ia_handle,
@@ -150,6 +154,7 @@ DT_cs_Client (Params_t * params_ptr,
module,
DT_RetToString (ret));
reqt_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto client_exit;
}
ret = DT_Tdep_evd_create (ia_handle,
@@ -164,6 +169,7 @@ DT_cs_Client (Params_t * params_ptr,
module,
DT_RetToString (ret));
conn_evd_hdl = DAT_HANDLE_NULL;
+ g_status = 1;
goto client_exit;
}
@@ -182,6 +188,7 @@ DT_cs_Client (Params_t * params_ptr,
module,
DT_RetToString (ret));
ep_handle = DAT_HANDLE_NULL;
+ g_status = 1;
goto client_exit;
}
DT_Tdep_PT_Debug (1, (phead, "%s: EP created\n", module));
@@ -193,6 +200,7 @@ DT_cs_Client (Params_t * params_ptr,
if (!DT_query (pt_ptr, ia_handle, ep_handle) ||
!DT_check_params (pt_ptr, module))
{
+ g_status = 1;
goto client_exit;
}
@@ -212,6 +220,7 @@ DT_cs_Client (Params_t * params_ptr,
DT_Tdep_PT_Printf (phead,
"%s: no memory for command buffer pool.\n",
module);
+ g_status = 1;
goto client_exit;
}
@@ -237,6 +246,7 @@ retry_repost:
DT_Tdep_PT_Printf (phead,
"%s: cannot post Server_Info recv buffer.\n",
module);
+ g_status = 1;
goto client_exit;
}
@@ -256,6 +266,7 @@ retry:
"%s: Cannot connect Endpoint %s\n",
module,
DT_RetToString (ret));
+ g_status = 1;
goto client_exit;
}
@@ -296,6 +307,7 @@ retry:
}
}
DT_Tdep_PT_Printf (phead, "%s: bad connection event\n", module);
+ g_status = 1;
goto client_exit;
}
@@ -320,6 +332,7 @@ retry:
DT_Bpool_GetBuffSize (bpool, 1)))
{
DT_Tdep_PT_Printf (phead, "%s: cannot send Client_Info\n", module);
+ g_status = 1;
goto client_exit;
}
/* reap the send and verify it */
@@ -335,6 +348,7 @@ retry:
dto_cookie,
"Client_Info_Send"))
{
+ g_status = 1;
goto client_exit;
}
@@ -375,6 +389,7 @@ retry:
default:
{
DT_Tdep_PT_Printf (phead, "Unknown Test Type\n");
+ g_status = 1;
goto client_exit;
}
}
@@ -387,6 +402,7 @@ retry:
DT_Bpool_GetBuffSize (bpool, 2)))
{
DT_Tdep_PT_Printf (phead, "%s: cannot send Command\n", module);
+ g_status = 1;
goto client_exit;
}
/* reap the send and verify it */
@@ -403,6 +419,7 @@ retry:
dto_cookie,
"Client_Cmd_Send"))
{
+ g_status = 1;
goto client_exit;
}
@@ -418,6 +435,7 @@ retry:
dto_cookie,
"Server_Info_Recv"))
{
+ g_status = 1;
goto client_exit;
}
@@ -436,6 +454,7 @@ retry:
module,
pt_ptr->Server_Info.dapltest_version,
DAPLTEST_VERSION);
+ g_status = 1;
goto client_exit;
}
DT_Tdep_PT_Debug (1,(phead, "%s: Version OK!\n", module));
@@ -459,6 +478,12 @@ retry:
DT_Transaction_Test_Client (pt_ptr,
ia_handle,
server_netaddr);
+ params_ptr->Client_Stats_T.bytes_rdma_read = pt_ptr->Client_Stats.bytes_rdma_read;
+ params_ptr->Client_Stats_T.bytes_rdma_write = pt_ptr->Client_Stats.bytes_rdma_write;
+ params_ptr->Client_Stats_T.bytes_recv = pt_ptr->Client_Stats.bytes_recv;
+ params_ptr->Client_Stats_T.bytes_send = pt_ptr->Client_Stats.bytes_send;
+ params_ptr->Client_Stats_T.num_ops = pt_ptr->Client_Stats.num_ops;
+ params_ptr->Client_Stats_T.time_ms = pt_ptr->Client_Stats.time_ms;
break;
}
@@ -503,11 +528,13 @@ client_exit:
"%s: dat_ep_disconnect (abrupt) error: %s\n",
module,
DT_RetToString (ret));
+ g_status = 1;
}
else if (did_connect &&
!DT_disco_event_wait (phead, conn_evd_hdl, NULL))
{
DT_Tdep_PT_Printf (phead, "%s: bad disconnect event\n", module);
+ g_status = 1;
}
}
@@ -536,6 +563,7 @@ client_exit:
module,
DT_RetToString (ret));
/* keep going */
+ g_status = 1;
}
}
@@ -550,6 +578,7 @@ client_exit:
module,
DT_RetToString (ret));
/* keep going */
+ g_status = 1;
}
}
if (reqt_evd_hdl)
@@ -562,6 +591,7 @@ client_exit:
module,
DT_RetToString (ret));
/* keep going */
+ g_status = 1;
}
}
if (recv_evd_hdl)
@@ -574,6 +604,7 @@ client_exit:
module,
DT_RetToString (ret));
/* keep going */
+ g_status = 1;
}
}
@@ -588,6 +619,7 @@ client_exit:
module,
DT_RetToString (ret));
/* keep going */
+ g_status = 1;
}
}
@@ -602,6 +634,7 @@ client_exit:
"%s: dat_ia_close (graceful) error: %s\n",
module,
DT_RetToString (ret));
+ g_status = 1;
ret = dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
@@ -609,6 +642,7 @@ client_exit:
"%s: dat_ia_close (abrupt) error: %s\n",
module,
DT_RetToString (ret));
+ g_status = 1;
}
/* keep going */
}
@@ -623,8 +657,4 @@ client_exit:
DT_PrintMemList (pt_ptr); /* check if we return all space allocated */
DT_Mdep_LockDestroy (&pt_ptr->MemListLock);
DT_Free_Per_Test_Data (pt_ptr);
-
- DT_Tdep_PT_Printf (phead,
- "%s: ========== End of Work -- Client Exiting\n",
- module);
}
Index: dapltest/include/dapl_tdep.h
===================================================================
--- dapltest/include/dapl_tdep.h (revision 2257)
+++ dapltest/include/dapl_tdep.h (working copy)
@@ -41,7 +41,7 @@ DT_Tdep_Init ( void ) ;
void
DT_Tdep_End ( void ) ;
-void
+int
DT_Tdep_Execute_Test ( Params_t *params_ptr ) ;
DAT_RETURN
Index: dapltest/include/dapl_proto.h
===================================================================
--- dapltest/include/dapl_proto.h (revision 2257)
+++ dapltest/include/dapl_proto.h (working copy)
@@ -49,6 +49,8 @@
#endif
#include "dapl_mdep.h"
+#include "dapl_transaction_stats.h"
+#include "dapl_performance_stats.h"
#include "dapl_tdep_print.h"
#include "dapl_bpool.h"
#include "dapl_client_info.h"
@@ -62,7 +64,6 @@
#include "dapl_limit_cmd.h"
#include "dapl_memlist.h"
#include "dapl_params.h"
-#include "dapl_performance_stats.h"
#include "dapl_performance_test.h"
#include "dapl_quit_cmd.h"
#include "dapl_server_info.h"
@@ -70,9 +71,9 @@
#include "dapl_test_data.h"
#include "dapl_transaction_cmd.h"
#include "dapl_transaction_test.h"
-#include "dapl_transaction_stats.h"
#include "dapl_version.h"
+extern int g_status;
/*
* Prototypes
*/
@@ -125,15 +126,9 @@ void DT_init_transaction_stat
void DT_transaction_stats_set_ready (DT_Tdep_Print_Head* phead,
Transaction_Stats_t* transaction_stats);
-void DT_transaction_stats2_set_ready (DT_Tdep_Print_Head* phead,
- Transaction_Stats_t* transaction_stats);
-
bool DT_transaction_stats_wait_for_all (DT_Tdep_Print_Head* phead,
Transaction_Stats_t* transaction_stats);
-bool DT_transaction_stats2_wait_for_all (DT_Tdep_Print_Head* phead,
- Transaction_Stats_t* transaction_stats);
-
void DT_update_transaction_stats (Transaction_Stats_t * transaction_stats,
unsigned int num_ops,
unsigned int time_ms,
@@ -142,8 +137,7 @@ void DT_update_transaction_st
unsigned int bytes_rdma_read,
unsigned int bytes_rdma_write);
-void DT_print_transaction_stats (DT_Tdep_Print_Head* phead,
- Transaction_Stats_t* transaction_stats,
+void DT_print_transaction_stats (Transaction_Stats2_t* transaction_stats,
unsigned int num_threads,
unsigned int num_EPs);
@@ -320,16 +314,11 @@ void DT_performance_stats_com
Performance_Stats_t * src_a,
Performance_Stats_t * src_b);
-double DT_performance_stats_data_print (DT_Tdep_Print_Head* phead,
- Performance_Stats_Data_t* data,
- double cpu_mhz);
-
-void DT_performance_stats_print (Params_t * params_ptr,
- DT_Tdep_Print_Head* phead,
- Performance_Stats_t * stats,
- Performance_Cmd_t * cmd,
- Performance_Test_t * test);
+double DT_performance_stats_data_print (Performance_Stats_Data_t *data,
+ double cpu_mhz);
+void DT_performance_stats_print (Performance_Stats_t *stats,
+ Performance_Cmd_t *cmd);
/* dapl_server.c */
void DT_cs_Server (Params_t * params_ptr);
@@ -498,9 +487,6 @@ bool DT_Transaction_Validatio
int iteration);
void DT_Print_Transaction_Test (DT_Tdep_Print_Head* phead,
Transaction_Test_t* test_ptr);
-void DT_Print_Transaction_Stats (DT_Tdep_Print_Head* phead,
- Transaction_Test_t* test_ptr);
-
/* dapl_transaction_util.c */
bool DT_handle_post_recv_buf (DT_Tdep_Print_Head* phead,
Ep_Context_t * ep_context,
Index: dapltest/include/dapl_transaction_stats.h
===================================================================
--- dapltest/include/dapl_transaction_stats.h (revision 2257)
+++ dapltest/include/dapl_transaction_stats.h (working copy)
@@ -44,4 +44,16 @@ typedef struct
unsigned int bytes_rdma_read;
unsigned int bytes_rdma_write;
} Transaction_Stats_t;
+
+typedef struct
+{
+ unsigned int wait_count;
+ unsigned int num_ops;
+ unsigned int time_ms;
+ unsigned int bytes_send;
+ unsigned int bytes_recv;
+ unsigned int bytes_rdma_read;
+ unsigned int bytes_rdma_write;
+} Transaction_Stats2_t;
+
#endif
Index: dapltest/include/dapl_performance_stats.h
===================================================================
--- dapltest/include/dapl_performance_stats.h (revision 2257)
+++ dapltest/include/dapl_performance_stats.h (working copy)
@@ -50,13 +50,15 @@ typedef struct
int64_t bytes;
unsigned int post_ctxt_switch_num;
unsigned int reap_ctxt_switch_num;
- double cpu_utilization;
DT_Mdep_TimeStamp time_ts;
Performance_Stats_Data_t posts_sans_ctxt;
Performance_Stats_Data_t posts_with_ctxt;
Performance_Stats_Data_t reaps_sans_ctxt;
Performance_Stats_Data_t reaps_with_ctxt;
Performance_Stats_Data_t latency;
+ DT_CpuStat pre_cpu_stat;
+ DT_CpuStat post_cpu_stat;
+ DAT_COUNT pipeline_len;
} Performance_Stats_t;
#endif
Index: dapltest/include/dapl_params.h
===================================================================
--- dapltest/include/dapl_params.h (revision 2257)
+++ dapltest/include/dapl_params.h (working copy)
@@ -66,8 +66,9 @@ typedef struct
void * phead;
bool local_is_little_endian;
bool debug;
- double cpu_mhz;
DAT_MEM_TYPE mem_type;
+ Transaction_Stats2_t Client_Stats_T;
+ Performance_Stats_t Client_Stats_P;
} Params_t;
#endif
Index: dapltest/cmd/dapl_main.c
===================================================================
--- dapltest/cmd/dapl_main.c (revision 2257)
+++ dapltest/cmd/dapl_main.c (working copy)
@@ -42,6 +42,7 @@ int
dapltest (int argc, char *argv[])
{
Params_t *params_ptr;
+ int status;
/* check memory leaking */
/*
@@ -72,7 +73,7 @@ dapltest (int argc, char *argv[])
DT_Mdep_printf ("Cannot allocate memory for Params structure\n");
return ( 1 );
}
-
+ memset((void *)params_ptr, 0, sizeof (Params_t));
DT_Tdep_Init (); /* init (kdapl/udapl)test-dependent code */
DT_Endian_Init (); /* init endian of local machine */
DT_Mdep_Init (); /* init OS, libraries, etc. */
@@ -87,10 +88,10 @@ dapltest (int argc, char *argv[])
DT_Mdep_printf ("Command line syntax error\n");
return 1;
}
- params_ptr->cpu_mhz = DT_Mdep_GetCpuMhz ();
/* call the test-dependent code for invoking the actual test */
- DT_Tdep_Execute_Test (params_ptr);
+ status = DT_Tdep_Execute_Test (params_ptr);
+ printf("TEST return code = %d \n",status);
/* cleanup */
DT_Mdep_End ();
@@ -108,7 +109,7 @@ dapltest (int argc, char *argv[])
* alloc_count); DT_Mdep_LockDestroy(&Alloc_Count_Lock);
*/
- return ( 0 );
+ return status;
}
Index: dapltest/cmd/dapl_performance_cmd.c
===================================================================
--- dapltest/cmd/dapl_performance_cmd.c (revision 2257)
+++ dapltest/cmd/dapl_performance_cmd.c (working copy)
@@ -327,3 +327,235 @@ DT_Performance_Cmd_Print (
cmd->op.seg_size);
}
+const char *
+DT_TransferTypeToString (DT_Transfer_Type type)
+{
+ static char *DT_Type[] =
+ {
+ "RR",
+ "RW",
+ "SR"
+ };
+
+ if ( (0 <= type) && (type <= 2) )
+ {
+ return DT_Type[type];
+ }
+ else
+ {
+ return "Error: Unkown Transfer Type";
+ }
+}
+
+double
+DT_performance_stats_data_print (Performance_Stats_Data_t *data,
+ double cpu_mhz)
+{
+ double average;
+
+ average = (int64_t)data->total_ts / (data->num * cpu_mhz);
+
+ printf(" Arithmetic mean : %d.%d us\n"
+ " maximum : %d.%d us\n"
+ " minimum : %d.%d us\n",
+ DT_whole(average),DT_hundredths(average),
+ DT_whole((int64_t)data->max_ts / cpu_mhz),DT_hundredths((int64_t)data->max_ts / cpu_mhz),
+ DT_whole((int64_t)data->min_ts / cpu_mhz),DT_hundredths((int64_t)data->min_ts / cpu_mhz));
+ return average;
+}
+
+
+void
+DT_performance_stats_print (
+ Performance_Stats_t *stats,
+ Performance_Cmd_t *cmd)
+{
+ double cpu_mhz;
+ double time_s;
+ double mbytes;
+ double ops_per_sec;
+ double bandwidth;
+ double latency;
+ double time_per_post;
+ double time_per_reap;
+
+ /* calculate CPU utilization */
+ unsigned long int system;
+ unsigned long int user;
+ unsigned long int idle;
+ unsigned long int total;
+ double cpu_utilization;
+ system = stats->post_cpu_stat.system - stats->pre_cpu_stat.system;
+ user = stats->post_cpu_stat.user - stats->pre_cpu_stat.user;
+ idle = stats->post_cpu_stat.idle - stats->pre_cpu_stat.idle;
+
+ total = system + user + idle;
+
+ if ( 0 == total )
+ {
+ cpu_utilization = 0.0;
+ }
+ else
+ {
+ cpu_utilization = (double)1.0 - ((double) idle / (double) total );
+ cpu_utilization *= 100.0;
+ }
+
+ cpu_mhz = DT_Mdep_GetCpuMhz ();
+ latency = 0;
+#if defined(WIN32)
+ /*
+ * The Microsoft compiler is unable to do a 64 bit conversion when
+ * working with double. time_ts is a 64 bit value, so we
+ * potentially lose precision, so limit it to the Windows
+ * platform. Trying to do the operation below without casting
+ * a 64 bit value to an unsigned int results in the error when
+ * using Visual C 6.0:
+ *
+ * Compiler Error C2520: conversion from unsigned __int64 to
+ * double not implemented, use signed __int64.
+ *
+ * Note that signed __int64 doesn't work either!
+ */
+ time_s = (double) ((unsigned int)stats->time_ts / (1000000.0 * cpu_mhz));
+#else
+ time_s = (double) (stats->time_ts / (1000000.0 * cpu_mhz));
+#endif
+ mbytes = (double) (1.0 * stats->bytes) / 1024 / 1024;
+
+ if ( 0.0 == time_s )
+ {
+ printf( "Error determining time\n");
+ return;
+ }
+ else if ( 0 == stats->num_ops )
+ {
+ printf( "Error determining number of operations\n");
+ return;
+ }
+ else if ( 0.0 == cpu_mhz )
+ {
+ printf( "Error determining CPU speed\n");
+ return;
+ }
+
+ ops_per_sec = stats->num_ops / time_s;
+ bandwidth = mbytes / time_s;
+ printf( "------------------------- Statistics -------------------------\n");
+ printf(
+ " Mode : %s\n"
+ " Operation Type : %s\n"
+ " Number of Operations : %u\n"
+ " Segment Size : %u\n"
+ " Number of Segments : %u bytes\n"
+ " Pipeline Length : %u\n\n",
+ DT_PerformanceModeToString (cmd->mode),
+ DT_TransferTypeToString (cmd->op.transfer_type),
+ cmd->num_iterations,
+ cmd->op.seg_size,
+ cmd->op.num_segs,
+ stats->pipeline_len);
+
+ printf(
+ " Total Time : %d.%d sec\n"
+ " Total Data Exchanged : %d.%d MB\n"
+ " CPU Utilization : %d.%d\n"
+ " Operation Throughput : %d.%d ops/sec\n"
+ " Bandwidth : %d.%d MB/sec\n",
+ DT_whole(time_s),DT_hundredths(time_s),
+ DT_whole(mbytes),DT_hundredths(mbytes),
+ DT_whole(cpu_utilization),DT_hundredths(cpu_utilization),
+ DT_whole(ops_per_sec),DT_hundredths(ops_per_sec),
+ DT_whole(bandwidth),DT_hundredths(bandwidth));
+
+ printf( "\nLatency\n");
+
+ if ( stats->latency.num )
+ {
+ latency = DT_performance_stats_data_print (&stats->latency,
+ cpu_mhz);
+ }
+ printf( "\n"
+ "Time Per Post\n"
+ " %u posts without context switches\n",
+ stats->posts_sans_ctxt.num);
+
+ if ( stats->posts_sans_ctxt.num )
+ {
+ DT_performance_stats_data_print (&stats->posts_sans_ctxt,
+ cpu_mhz);
+ }
+
+ printf( "\n"
+ " %u posts with context switches\n",
+ stats->posts_with_ctxt.num);
+
+ if ( stats->posts_with_ctxt.num )
+ {
+ printf( " %u number of context switches\n",
+ stats->post_ctxt_switch_num);
+ DT_performance_stats_data_print (&stats->posts_with_ctxt,
+ cpu_mhz);
+ }
+
+ printf( "\n"
+ "Time Per Reap\n"
+ " %u reaps without context switches\n",
+ stats->reaps_sans_ctxt.num);
+
+ if ( stats->reaps_sans_ctxt.num )
+ {
+ DT_performance_stats_data_print (&stats->reaps_sans_ctxt,
+ cpu_mhz);
+ }
+
+
+ printf( "\n"
+ " %u reaps with context switches\n",
+ stats->reaps_with_ctxt.num);
+
+ if ( stats->reaps_with_ctxt.num )
+ {
+ printf( "\n"
+ " %u number of context switches\n",
+ stats->reap_ctxt_switch_num);
+
+ DT_performance_stats_data_print (&stats->reaps_with_ctxt,
+ cpu_mhz);
+ }
+
+ time_per_post =
+ (int64_t) (stats->posts_sans_ctxt.total_ts + stats->posts_with_ctxt.total_ts) /
+ (cpu_mhz * (stats->posts_sans_ctxt.num + stats->posts_with_ctxt.num));
+
+ time_per_reap =
+ (int64_t) (stats->reaps_sans_ctxt.total_ts + stats->reaps_with_ctxt.total_ts) /
+ (cpu_mhz * (stats->reaps_sans_ctxt.num + stats->reaps_with_ctxt.num));
+
+ printf(
+ "\nNOTE: 1 MB = 1024 KB = 1048576 B \n");
+ printf(
+ "---------------------------------------------------------------------\n");
+ printf(
+ "raw: %s, %u, %u, %u, %u, %d.%d, %d.%d, %d.%d, %d.%d, %d.%d, %d.%d \n",
+ DT_TransferTypeToString (cmd->op.transfer_type),
+ cmd->num_iterations,
+ cmd->op.seg_size,
+ cmd->op.num_segs,
+ stats->pipeline_len,
+ DT_whole (cpu_utilization),
+ DT_hundredths (cpu_utilization),
+ DT_whole (ops_per_sec),
+ DT_hundredths (ops_per_sec),
+ DT_whole (bandwidth),
+ DT_hundredths (bandwidth),
+ DT_whole (latency),
+ DT_hundredths (latency),
+ DT_whole (time_per_post),
+ DT_hundredths (time_per_post),
+ DT_whole (time_per_reap),
+ DT_hundredths (time_per_reap));
+ printf(
+ "---------------------------------------------------------------------\n");
+}
+
Index: dapltest/cmd/dapl_transaction_cmd.c
===================================================================
--- dapltest/cmd/dapl_transaction_cmd.c (revision 2257)
+++ dapltest/cmd/dapl_transaction_cmd.c (working copy)
@@ -507,4 +507,72 @@ DT_Transaction_Cmd_Print (Transaction_Cm
cmd->op[i].reap_send_on_recv);
}
}
+/*
+ *
+ */
+void
+DT_print_transaction_stats (Transaction_Stats2_t * transaction_stats,
+ unsigned int num_threads,
+ unsigned int num_EPs)
+{
+ double time_s;
+ double mbytes_send;
+ double mbytes_recv;
+ double mbytes_rdma_read;
+ double mbytes_rdma_write;
+ int total_ops;
+ // DT_Mdep_Lock (&transaction_stats->lock);
+ time_s = (double) (transaction_stats->time_ms) / 1000;
+ if (time_s == 0.0)
+ {
+ printf("----- Test completed successfully, but cannot calculate stats as not\n"
+ "----- enough time has lapsed.\n"
+ "----- Try running the test with more iterations.\n");
+ goto unlock_and_return;
+ }
+ mbytes_send = (double) transaction_stats->bytes_send / 1000 / 1000;
+ mbytes_recv = (double) transaction_stats->bytes_recv / 1000 / 1000;
+ mbytes_rdma_read = (double) transaction_stats->bytes_rdma_read / 1000 / 1000;
+ mbytes_rdma_write = (double) transaction_stats->bytes_rdma_write / 1000 / 1000;
+ total_ops = transaction_stats->num_ops;
+
+ if ( 0 == total_ops )
+ {
+ printf("----- Test completed successfully, but no operations!\n");
+ goto unlock_and_return;
+ }
+
+ printf("----- Stats ---- : %u threads, %u EPs\n",
+ num_threads, num_EPs);
+ printf( "Total WQE : %7d.%02d WQE/Sec\n",
+ whole (total_ops / time_s),
+ hundredths (total_ops / time_s));
+ printf( "Total Time : %7d.%02d sec\n",
+ whole (time_s),
+ hundredths (time_s));
+ printf( "Total Send : %7d.%02d MB - %7d.%02d MB/Sec\n",
+ whole (mbytes_send),
+ hundredths (mbytes_send),
+ whole (mbytes_send / time_s),
+ hundredths (mbytes_send / time_s));
+ printf( "Total Recv : %7d.%02d MB - %7d.%02d MB/Sec\n",
+ whole (mbytes_recv),
+ hundredths (mbytes_recv),
+ whole (mbytes_recv / time_s),
+ hundredths (mbytes_recv / time_s));
+ printf( "Total RDMA Read : %7d.%02d MB - %7d.%02d MB/Sec\n",
+ whole (mbytes_rdma_read),
+ hundredths (mbytes_rdma_read),
+ whole (mbytes_rdma_read / time_s),
+ hundredths (mbytes_rdma_read / time_s));
+ printf( "Total RDMA Write : %7d.%02d MB - %7d.%02d MB/Sec\n",
+ whole (mbytes_rdma_write),
+ hundredths (mbytes_rdma_write),
+ whole (mbytes_rdma_write / time_s),
+ hundredths (mbytes_rdma_write / time_s));
+ printf("========== End of Work -- Client Exiting\n");
+unlock_and_return:
+return;
+ //DT_Mdep_Unlock (&transaction_stats->lock);
+}
Index: dapltest/mdep/linux/dapl_mdep_user.h
===================================================================
--- dapltest/mdep/linux/dapl_mdep_user.h (revision 2257)
+++ dapltest/mdep/linux/dapl_mdep_user.h (working copy)
@@ -40,10 +40,17 @@
#include <string.h>
#include <sys/times.h>
-#ifdef __ia64__
+#if defined(__ia64__)
+/* In suse 2.6.5 cant use timex.h BUG of suse */
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
#include <asm/timex.h>
+#else
+#include <asm/ia64regs.h>
+#endif
#endif
+
/* Default Device Name */
#define DT_MdepDeviceName "ia0a"
@@ -114,20 +121,31 @@ typedef unsigned long long int DT_Mdep
static _INLINE_ DT_Mdep_TimeStamp
DT_Mdep_GetTimeStamp ( void )
{
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__)
DT_Mdep_TimeStamp x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
-#else
-
-#ifdef __ia64__
+#elif defined(__x86_64__)
+ unsigned low, high;
+ unsigned long long val;
+ __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high));
+ val = high;
+ val = (val << 32) | low;
+ return val;
+#elif defined(__ia64__)
+/* In suse 2.6.5 cant use timex.h BUG of suse */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
unsigned long x;
-
x = get_cycles ();
return x;
#else
-#error "Non-Pentium Linux - unimplemented"
+ u_int64_t ia64_intri_res;
+ asm volatile ("mov %0=ar%1" : "=r" (ia64_intri_res) \
+ : "i"(_IA64_REG_AR_ITC - _IA64_REG_AR_KR0));
+ return ia64_intri_res;
#endif
+#else
+#error "Non-Pentium Linux - unimplemented"
#endif
}
Index: dapltest/kdapl/kdapl_module.c
===================================================================
--- dapltest/kdapl/kdapl_module.c (revision 2257)
+++ dapltest/kdapl/kdapl_module.c (working copy)
@@ -43,7 +43,8 @@ MODULE_AUTHOR("James Lentini");
static int kdapltest_major;/* device major number */
static DT_Mdep_LockType kdapltest_lock; /* lock global test structs */
static int kdapltest_num; /* unique test invocation number */
-
+static Transaction_Stats2_t Client_Stats_T;
+static Performance_Stats_t Client_Stats_P;
static void
DT_Tdep_Test_Thread (Params_t *user_params);
@@ -87,6 +88,7 @@ static int kdapltest_ioctl (struct inode
rval = -ENOMEM;
break;
}
+ memset((void *)local_params, 0, sizeof (Params_t));
if (copy_from_user (local_params,
(void __user *)param,
sizeof (Params_t)))
@@ -108,13 +110,40 @@ static int kdapltest_ioctl (struct inode
rval = -ENOMEM;
break;
}
-
+ g_status = 0;
kernel_thread ((void*)DT_Tdep_Test_Thread,
(void*)local_params,
0);
rval = instance;
break;
}
+ case KDAPL_IOCTL_END_TEST:
+ {
+ int status = g_status;
+ if (copy_to_user((int *) param,
+ &status, sizeof status)) {
+ rval = -EFAULT;
+ }
+ break;
+ }
+ case KDAPL_IOCTL_GET_STAT_T:
+ {
+ Transaction_Stats2_t Client_Stats_local = Client_Stats_T;
+ if (copy_to_user((Transaction_Stats2_t *) param,
+ &Client_Stats_local, sizeof(Transaction_Stats2_t))) {
+ rval = -EFAULT;
+ }
+ break;
+ }
+ case KDAPL_IOCTL_GET_STAT_P:
+ {
+ Performance_Stats_t Client_Stats_local = Client_Stats_P;
+ if (copy_to_user((Performance_Stats_t *) param,
+ &Client_Stats_local, sizeof(Performance_Stats_t))) {
+ rval = -EFAULT;
+ }
+ break;
+ }
case KDAPL_IOCTL_GET_PRINTF:
{
if (copy_from_user (&print_ioctl,
@@ -160,6 +189,12 @@ DT_Tdep_Test_Thread (Params_t *user_para
MOD_INC_USE_COUNT;
#endif
DT_Execute_Test (user_params);
+ if (user_params->test_type == TRANSACTION_TEST) {
+ Client_Stats_T = user_params->Client_Stats_T;
+ }
+ if (user_params->test_type == PERFORMANCE_TEST) {
+ Client_Stats_P = user_params->Client_Stats_P;
+ }
DT_Tdep_PT_Printf (user_params->phead, ""); /* indicate done */
DT_Mdep_Free (user_params);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
Index: dapltest/kdapl/kdapl_tdep_user.c
===================================================================
--- dapltest/kdapl/kdapl_tdep_user.c (revision 2257)
+++ dapltest/kdapl/kdapl_tdep_user.c (working copy)
@@ -55,12 +55,14 @@ DT_Tdep_End (void)
close (fd);
}
-void
+int
DT_Tdep_Execute_Test (Params_t *params_ptr)
{
DT_get_printf_ioctl print_ioctl;
char buffer[PRINT_MAX];
-
+ int status;
+ Transaction_Stats2_t Client_Stats_T;
+ Performance_Stats_t Client_Stats_P;
print_ioctl.buffer = &buffer[0];
print_ioctl.cookie = ioctl (fd, KDAPL_IOCTL_START_TEST, params_ptr);
if (print_ioctl.cookie < 0)
@@ -72,5 +74,22 @@ DT_Tdep_Execute_Test (Params_t *params_p
{
printf ("%s", &buffer[0]);
}
+ if (params_ptr->test_type == TRANSACTION_TEST) {
+ print_ioctl.cookie = ioctl (fd, KDAPL_IOCTL_GET_STAT_T, &Client_Stats_T);
+ DT_print_transaction_stats(&Client_Stats_T,params_ptr->u.Transaction_Cmd.num_iterations,
+ params_ptr->u.Transaction_Cmd.eps_per_thread);
+ }
+
+ if (params_ptr->test_type == PERFORMANCE_TEST) {
+ print_ioctl.cookie = ioctl (fd, KDAPL_IOCTL_GET_STAT_P, &Client_Stats_P);
+ DT_performance_stats_print (&Client_Stats_P, &(params_ptr->u.Performance_Cmd));
+ }
+ print_ioctl.cookie = ioctl (fd, KDAPL_IOCTL_END_TEST, &status);
printf ("TEST INSTANCE %d\n", print_ioctl.cookie);
+ if (print_ioctl.cookie < 0)
+ {
+ fprintf (stderr, "IOCTL failed: errno %d\n", errno);
+ exit (1);
+ }
+ return status;
}
Index: dapltest/kdapl/kdapl_ioctl.h
===================================================================
--- dapltest/kdapl/kdapl_ioctl.h (revision 2257)
+++ dapltest/kdapl/kdapl_ioctl.h (working copy)
@@ -31,7 +31,9 @@
#define KDAPL_IOCTL_BASE (0x2828)
#define KDAPL_IOCTL_START_TEST (KDAPL_IOCTL_BASE + 0)
#define KDAPL_IOCTL_GET_PRINTF (KDAPL_IOCTL_BASE + 1)
-
+#define KDAPL_IOCTL_END_TEST (KDAPL_IOCTL_BASE + 2)
+#define KDAPL_IOCTL_GET_STAT_T (KDAPL_IOCTL_BASE + 3)
+#define KDAPL_IOCTL_GET_STAT_P (KDAPL_IOCTL_BASE + 4)
#define PRINT_MAX 256
typedef struct
{
Index: dapltest/kdapl/Makefile
===================================================================
--- dapltest/kdapl/Makefile (revision 2257)
+++ dapltest/kdapl/Makefile (working copy)
@@ -61,12 +61,7 @@ clean :
#--------------------------------------------------------------------------
else
-#need to define flag hard-float in i686 arch only
IS_i686 = $(shell uname -m)
-ifeq (${IS_i686},i686)
-# Override -msoft-float in arch/i386/Makefile
-EXTRA_CFLAGS += -mhard-float
-endif
ifeq (${IS_i686},x86_64)
EXTRA_CFLAGS += -msse
endif
--
Itamar
More information about the general
mailing list