[ofa-general] [PATCH 1/5][v1.2] dtest/dapltest: fix compiler warnings, add _GNU_SOURCE to test application builds

Arlin Davis arlin.r.davis at intel.com
Mon Sep 1 19:25:54 PDT 2008


Patch set to cleanup all warnings and fix fedora build issues.

dtest/dapltest: fix all compiler warnings, cleanup test code, build with -Wall, -D_GNU_SOURCE.

Signed-off by: Arlin Davis ardavis at ichips.intel.com
---
 test/dapltest/Makefile.am        |    2 +-
 test/dapltest/cmd/dapl_netaddr.c |    2 +-
 test/dapltest/test/dapl_limit.c  |  125 ++++++++++++++++++--------------------
 test/dtest/Makefile.am           |    2 +-
 test/dtest/dtest.c               |   62 ++++++++-----------
 5 files changed, 89 insertions(+), 104 deletions(-)

diff --git a/test/dapltest/Makefile.am b/test/dapltest/Makefile.am
index 1a19c53..d826f80 100755
--- a/test/dapltest/Makefile.am
+++ b/test/dapltest/Makefile.am
@@ -3,7 +3,7 @@ INCLUDES =  -I include \
 	    -I $(srcdir)/../../dat/include
          
 bin_PROGRAMS = dapltest
-
+dapltest_CFLAGS = -g -Wall -D_GNU_SOURCE
 dapltest_SOURCES =				\
 	cmd/dapl_main.c				\
 	cmd/dapl_params.c			\
diff --git a/test/dapltest/cmd/dapl_netaddr.c b/test/dapltest/cmd/dapl_netaddr.c
index a306335..e1600d5 100644
--- a/test/dapltest/cmd/dapl_netaddr.c
+++ b/test/dapltest/cmd/dapl_netaddr.c
@@ -90,7 +90,7 @@ DT_NetAddrLookupHostAddress (DAT_IA_ADDRESS_PTR	to_netaddr,
 		whatzit = "service unavailable";
 		break;
 	    }
-#if !defined(WIN32)
+#if !defined(WIN32) && defined(__USE_GNU)
 	    case EAI_ADDRFAMILY:
 	    {
 		whatzit = "node has no address in this family";
diff --git a/test/dapltest/test/dapl_limit.c b/test/dapltest/test/dapl_limit.c
index f619edd..e308bef 100644
--- a/test/dapltest/test/dapl_limit.c
+++ b/test/dapltest/test/dapl_limit.c
@@ -36,13 +36,13 @@
 
 static bool
 more_handles (DT_Tdep_Print_Head *phead,
-	     DAT_HANDLE **old_ptrptr,	/* pointer to current pointer	*/
+	     void **old_ptrptr,	/* pointer to current pointer	*/
 	     unsigned int *old_count,	/* number  pointed to	     	*/
 	     unsigned int size)		/* size of one datum		*/
 {
     unsigned int count	     = *old_count;
-    DAT_HANDLE  *old_handles = *old_ptrptr;
-    DAT_HANDLE  *handle_tmp  = DT_Mdep_Malloc (count * 2 * size);
+    void *old_handles = *old_ptrptr;
+    void *handle_tmp  = DT_Mdep_Malloc (count * 2 * size);
 
     if (!handle_tmp)
     {
@@ -166,9 +166,9 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    DAT_EVD_HANDLE  ia_async_handle;
 	}
 	OneOpen;
-	unsigned int  count	= START_COUNT;
-	OneOpen	     *hdlptr	= (OneOpen *)
-				    DT_Mdep_Malloc (count * sizeof (*hdlptr));
+	unsigned int count = START_COUNT;
+	void *hptr = DT_Mdep_Malloc (count * sizeof(OneOpen));
+	OneOpen	*hdlptr	= (OneOpen *)hptr;
 
 	/* IA Exhaustion test loop */
 	if (hdlptr)
@@ -181,14 +181,13 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    {
 		DT_Mdep_Schedule();
 		if (w == count
-		    && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				    &count,
-				    sizeof (*hdlptr)))
+		    && !more_handles (phead, &hptr, &count, sizeof(*hdlptr)))
 		{
 		    DT_Tdep_PT_Printf (phead, "%s: IAs opened: %d\n", module, w);
 		    retval = true;
 		    break;
 		}
+		hdlptr	= (OneOpen *)hptr;
 		/* Specify that we want to get back an async EVD.  */
 		hdlptr[w].ia_async_handle = DAT_HANDLE_NULL;
 		ret = dat_ia_open (cmd->device_name,
@@ -265,9 +264,9 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	/*
 	 * See how many PZs we can create
 	 */
-	unsigned int   count	= START_COUNT;
-	DAT_PZ_HANDLE *hdlptr	= (DAT_PZ_HANDLE *)
-				    DT_Mdep_Malloc (count * sizeof (*hdlptr));
+	unsigned int count = START_COUNT;
+	void *hptr = DT_Mdep_Malloc (count * sizeof(DAT_PZ_HANDLE));
+	DAT_PZ_HANDLE *hdlptr = (DAT_PZ_HANDLE *)hptr;
 
 	/* PZ Exhaustion test loop */
 	if (hdlptr)
@@ -282,14 +281,13 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    {
 		DT_Mdep_Schedule();
 		if (w == count
-		    && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				    &count,
-				    sizeof (*hdlptr)))
+		    && !more_handles(phead, &hptr, &count, sizeof(*hdlptr)))
 		{
 		    DT_Tdep_PT_Printf (phead, "%s: PZs created: %d\n", module, w);
 		    retval = true;
 		    break;
 		}
+		hdlptr = (DAT_PZ_HANDLE *)hptr;
 		ret = dat_pz_create (hdl_sets[w % cmd->width].ia_handle,
 				    &hdlptr[w]);
 		if (ret != DAT_SUCCESS)
@@ -363,10 +361,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	/*
 	 * See how many CNOs we can create
 	 */
-	unsigned int   count	= START_COUNT;
-	DAT_CNO_HANDLE *hdlptr	= (DAT_CNO_HANDLE *)
-				    DT_Mdep_Malloc (count * sizeof (*hdlptr));
-
+	unsigned int count = START_COUNT;
+	void *hptr = DT_Mdep_Malloc (count * sizeof(DAT_CNO_HANDLE));
+	DAT_CNO_HANDLE *hdlptr = (DAT_CNO_HANDLE *)hptr;
+				    
 	/* CNO Exhaustion test loop */
 	if (hdlptr)
 	{
@@ -380,14 +378,13 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    {
 		DT_Mdep_Schedule();
 		if (w == count
-		    && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				    &count,
-				    sizeof (*hdlptr)))
+		    && !more_handles(phead, &hptr, &count, sizeof (*hdlptr)))
 		{
 		    DT_Tdep_PT_Printf (phead, "%s: CNOs created: %d\n", module, w);
 		    retval = true;
 		    break;
 		}
+		hdlptr = (DAT_CNO_HANDLE *)hptr;
 		ret = dat_cno_create (hdl_sets[w % cmd->width].ia_handle,
 				    DAT_OS_WAIT_PROXY_AGENT_NULL,
 				    &hdlptr[w]);
@@ -484,9 +481,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	/*
 	 * See how many EVDs we can create
 	 */
-	unsigned int   count	= START_COUNT;
-	DAT_EVD_HANDLE *hdlptr	= (DAT_EVD_HANDLE *)
-				    DT_Mdep_Malloc (count * sizeof (*hdlptr));
+	unsigned int count = START_COUNT;
+	void *hptr = DT_Mdep_Malloc(count * sizeof(DAT_EVD_HANDLE));
+	DAT_EVD_HANDLE *hdlptr = (DAT_EVD_HANDLE *)hptr;
+				    
 	DAT_EVD_FLAGS flags	= (   DAT_EVD_DTO_FLAG
 				    | DAT_EVD_RMR_BIND_FLAG
 				    | DAT_EVD_CR_FLAG);
@@ -519,14 +517,13 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    {
 		DT_Mdep_Schedule();
 		if (w == count
-		    && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				    &count,
-				    sizeof (*hdlptr)))
+		    && !more_handles(phead, &hptr, &count, sizeof(*hdlptr)))
 		{
 		    DT_Tdep_PT_Printf (phead, "%s: EVDs created: %d\n", module, w);
 		    retval = true;
 		    break;
 		}
+		hdlptr = (DAT_EVD_HANDLE *)hptr;
 		ret = DT_Tdep_evd_create (hdl_sets[w % cmd->width].ia_handle,
 				    DFLT_QLEN,
 				    hdl_sets[w % cmd->width].cno_handle,
@@ -603,9 +600,9 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	/*
 	 * See how many EPs we can create
 	 */
-	unsigned int   count	= START_COUNT;
-	DAT_EP_HANDLE *hdlptr	= (DAT_EP_HANDLE *)
-				    DT_Mdep_Malloc (count * sizeof (*hdlptr));
+	unsigned int count = START_COUNT;
+	void *hptr = DT_Mdep_Malloc(count * sizeof(DAT_EP_HANDLE));
+	DAT_EP_HANDLE *hdlptr = (DAT_EP_HANDLE *)hptr;
 
 	/* EP Exhaustion test loop */
 	if (hdlptr)
@@ -618,14 +615,13 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    {
 		DT_Mdep_Schedule();
 		if (w == count
-		    && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				    &count,
-				    sizeof (*hdlptr)))
+		    && !more_handles(phead, &hptr, &count, sizeof(*hdlptr)))
 		{
 		    DT_Tdep_PT_Printf (phead, "%s: EPs created: %d\n", module, w);
 		    retval = true;
 		    break;
 		}
+		hdlptr = (DAT_EP_HANDLE *)hptr;
 		ret = dat_ep_create (hdl_sets[w % cmd->width].ia_handle,
 				    hdl_sets[w % cmd->width].pz_handle,
 				    hdl_sets[w % cmd->width].evd_handle,
@@ -674,11 +670,11 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	/*
 	 * See how many RSPs we can create
 	 */
-	unsigned int   count	= START_COUNT;
-	DAT_RSP_HANDLE *hdlptr	= (DAT_RSP_HANDLE *)
-				    DT_Mdep_Malloc (count * sizeof (*hdlptr));
-	DAT_EP_HANDLE *epptr	= (DAT_EP_HANDLE *)
-				    DT_Mdep_Malloc (count * sizeof (*epptr));
+	unsigned int count = START_COUNT;
+	void *hptr = DT_Mdep_Malloc(count * sizeof (DAT_RSP_HANDLE));
+	DAT_RSP_HANDLE *hdlptr	= (DAT_RSP_HANDLE *)hptr;
+	void *eptr = DT_Mdep_Malloc(count * sizeof (DAT_EP_HANDLE));			   
+	DAT_EP_HANDLE *epptr = (DAT_EP_HANDLE *)eptr;
 
 	/* RSP Exhaustion test loop */
 	if (hdlptr)
@@ -695,23 +691,21 @@ limit_test ( DT_Tdep_Print_Head *phead,
 		    unsigned int count1 = count;
 		    unsigned int count2 = count;
 
-		    if (!more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				       &count1,
-				       sizeof (*hdlptr)))
+		    if (!more_handles(phead, &hptr, &count1, sizeof(*hdlptr)))
 		    {
 			DT_Tdep_PT_Printf (phead, "%s: RSPs created: %d\n", module, w);
 			retval = true;
 			break;
 		    }
-		    if (!more_handles (phead, (DAT_HANDLE **) &epptr,
-				       &count2,
-				       sizeof (*epptr)))
+		    hdlptr = (DAT_RSP_HANDLE *)hptr;
+		    
+		    if (!more_handles (phead, &eptr, &count2, sizeof(*epptr)))
 		    {
 			DT_Tdep_PT_Printf (phead, "%s: RSPs created: %d\n", module, w);
 			retval = true;
 			break;
 		    }
-
+		    epptr = (DAT_EP_HANDLE *)eptr;
 		    if (count1 != count2)
 		    {
 			DT_Tdep_PT_Printf (phead, "%s: Mismatch in allocation of handle arrays at
point %d\n",
@@ -810,9 +804,9 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	/*
 	 * See how many PSPs we can create
 	 */
-	unsigned int   count	= START_COUNT;
-	DAT_PSP_HANDLE *hdlptr	= (DAT_PSP_HANDLE *)
-				    DT_Mdep_Malloc (count * sizeof (*hdlptr));
+	unsigned int count = START_COUNT;
+	void *hptr = DT_Mdep_Malloc (count * sizeof (DAT_PSP_HANDLE));
+	DAT_PSP_HANDLE *hdlptr	= (DAT_PSP_HANDLE *)hptr;
 
 	/* PSP Exhaustion test loop */
 	if (hdlptr)
@@ -825,14 +819,13 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    {
 		DT_Mdep_Schedule();    
 		if (w == count
-		    && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				    &count,
-				    sizeof (*hdlptr)))
+		    && !more_handles (phead, &hptr, &count, sizeof(*hdlptr)))
 		{
 		    DT_Tdep_PT_Printf (phead, "%s: PSPs created: %d\n", module, w);
 		    retval = true;
 		    break;
 		}
+		hdlptr = (DAT_PSP_HANDLE *)hptr;
 		ret = dat_psp_create (hdl_sets[w % cmd->width].ia_handle,
 				    CONN_QUAL0 + w,
 				    hdl_sets[w % cmd->width].evd_handle,
@@ -936,10 +929,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	/*
 	 * See how many LMRs we can create
 	 */
-	unsigned int   count	= START_COUNT;
-	Bpool	     **hdlptr	= (Bpool **)
-				    DT_Mdep_Malloc (count * sizeof (*hdlptr));
-
+	unsigned int count = START_COUNT;
+	void *hptr = DT_Mdep_Malloc (count * sizeof(Bpool*)); 
+	Bpool **hdlptr = (Bpool **)hptr;
+				    
 	/* LMR Exhaustion test loop */
 	if (hdlptr)
 	{
@@ -951,9 +944,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    {
 		DT_Mdep_Schedule();
 		if (w == count
-		    && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				    &count,
-				    sizeof (*hdlptr)))
+		    && !more_handles (phead, &hptr, &count, sizeof(*hdlptr)))
 		{
 		    DT_Tdep_PT_Printf (phead, "%s: no memory for LMR handles\n",
 					module);
@@ -961,6 +952,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
 		    retval = true;
 		    break;
 		}
+		hdlptr = (Bpool **)hptr;
 		/*
 		 * Let BpoolAlloc do the hard work; this means that
 		 * we're testing unique memory registrations rather
@@ -1012,14 +1004,15 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	 * We are posting the same buffer 'cnt' times, deliberately,
 	 * but that should be OK.
 	 */
-	unsigned int   count	= START_COUNT;
-	DAT_LMR_TRIPLET *hdlptr	= (DAT_LMR_TRIPLET *)
-			DT_Mdep_Malloc (count * cmd->width * sizeof (*hdlptr));
+	unsigned int count = START_COUNT;
+	void *hptr = 
+		DT_Mdep_Malloc(count * cmd->width * sizeof(DAT_LMR_TRIPLET));
+	DAT_LMR_TRIPLET *hdlptr	= (DAT_LMR_TRIPLET *)hptr;
 
 	/* Recv-Post Exhaustion test loop */
 	if (hdlptr)
 	{
-	    unsigned int  w		= 0;
+	    unsigned int  w	= 0;
 	    unsigned int  i  	= 0;
 	    unsigned int  done	= 0;
 
@@ -1028,9 +1021,8 @@ limit_test ( DT_Tdep_Print_Head *phead,
 	    {
 		DT_Mdep_Schedule();
 		if (w == count
-		    && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
-				    &count,
-				    cmd->width * sizeof (*hdlptr)))
+		    && !more_handles (phead, &hptr, &count,
+				    cmd->width * sizeof(*hdlptr)))
 		{
 		    DT_Tdep_PT_Printf (phead, "%s: no memory for IOVs \n",
 					module);
@@ -1042,6 +1034,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
 		    done = retval = true;
 		    break;
 		}
+		hdlptr = (DAT_LMR_TRIPLET *)hptr;
 		for (i = 0;  i < cmd->width;  i++)
 		{
 		    DAT_LMR_TRIPLET  *iovp = &hdlptr[w * cmd->width + i];
diff --git a/test/dtest/Makefile.am b/test/dtest/Makefile.am
index fcb9b4e..fb605ba 100755
--- a/test/dtest/Makefile.am
+++ b/test/dtest/Makefile.am
@@ -1,5 +1,5 @@
 bin_PROGRAMS = dtest
 dtest_SOURCES = dtest.c
+dtest_CFLAGS = -g -Wall -D_GNU_SOURCE
 INCLUDES =  -I $(srcdir)/../../dat/include 
 dtest_LDADD = $(srcdir)/../../dat/udat/libdat.la
-
diff --git a/test/dtest/dtest.c b/test/dtest/dtest.c
index 039b6bf..a93f878 100755
--- a/test/dtest/dtest.c
+++ b/test/dtest/dtest.c
@@ -50,6 +50,7 @@
 #define DAPL_PROVIDER "OpenIB-cma"
 #endif
 
+#define F64x "%"PRIx64""
 #define MAX_POLLING_CNT 50000
 #define MAX_RDMA_RD    4
 #define MAX_PROCS      1000
@@ -142,7 +143,6 @@ struct {
 } time;
 
 /* defaults */
-static int  parent=1;
 static int  connected=0;
 static int  burst=10;
 static int  server=1;
@@ -151,17 +151,13 @@ static int  polling=0;
 static int  poll_count=0;
 static int  rdma_wr_poll_count=0;
 static int  rdma_rd_poll_count[MAX_RDMA_RD]={0};
-static int  pin_memory=0;
 static int  delay=0;
 static int  buf_len=RDMA_BUFFER_SIZE;
 static int  use_cno=0;
-static int  post_recv_count=MSG_BUF_COUNT;
 static int  recv_msg_index=0;
 static int  burst_msg_posted=0;
 static int  burst_msg_index=0;
 
-static pid_t   child[MAX_PROCS+1];
-
 /* forward prototypes */
 const char * DT_RetToString (DAT_RETURN ret_value);
 const char * DT_EventToSTr (DAT_EVENT_NUMBER event_code);
@@ -188,7 +184,7 @@ DAT_RETURN     do_ping_pong_msg( void );
 #define LOGPRINTF(_format, _aa...) \
        if (verbose)               \
            printf(_format, ##_aa)
-
+int
 main(int argc, char **argv)
 {
        int i,c;
@@ -358,12 +354,12 @@ main(int argc, char **argv)
        inet_ntop(AF_INET, 
 	         &((struct sockaddr_in *)ep_param.local_ia_address_ptr)->sin_addr, 
 		 addr_str, sizeof(addr_str));
-       printf("\n%d Query EP: LOCAL addr %s port %d\n", getpid(), 
+       printf("\n%d Query EP: LOCAL addr %s port "F64x"\n", getpid(), 
 	       addr_str, ep_param.local_port_qual);
        inet_ntop(AF_INET, 
 	         &((struct sockaddr_in *)ep_param.remote_ia_address_ptr)->sin_addr, 
 		 addr_str, sizeof(addr_str));
-       printf("%d Query EP: REMOTE addr %s port %d\n", getpid(), 
+       printf("%d Query EP: REMOTE addr %s port "F64x"\n", getpid(), 
 	       addr_str, ep_param.remote_port_qual);
        fflush(stdout);
 
@@ -492,6 +488,7 @@ cleanup:
        /* free rdma buffers */
        free(rbuf);
        free(sbuf);
+       return(0);
 }
 
 
@@ -577,7 +574,7 @@ send_msg(  void                   *data,
 
        if ((event.event_data.dto_completion_event_data.transfered_length != size ) ||
            (event.event_data.dto_completion_event_data.user_cookie.as_64 != 0xaaaa )) {
-           fprintf(stderr, "%d: ERROR: DTO len %d or cookie " PRIx64 "\n",
+           fprintf(stderr, "%d: ERROR: DTO len "F64x" or cookie "F64x"\n",
                getpid(),
                event.event_data.dto_completion_event_data.transfered_length,
                event.event_data.dto_completion_event_data.user_cookie.as_64 );
@@ -599,7 +596,6 @@ DAT_RETURN
 connect_ep( char *hostname, int conn_id )
 {
        DAT_SOCK_ADDR           remote_addr;
-       DAT_EP_ATTR             ep_attr;
        DAT_RETURN              ret;
        DAT_REGION_DESCRIPTION  region;
        DAT_EVENT               event;
@@ -611,7 +607,7 @@ connect_ep( char *hostname, int conn_id )
 
      /* Register send message buffer */
     LOGPRINTF("%d Registering send Message Buffer %p, len %d\n",
-               getpid(), &rmr_send_msg, sizeof(DAT_RMR_TRIPLET) );
+               getpid(), &rmr_send_msg, (int)sizeof(DAT_RMR_TRIPLET));
     region.for_va = &rmr_send_msg;
     ret = dat_lmr_create(   h_ia,
                            DAT_MEM_TYPE_VIRTUAL,
@@ -800,7 +796,8 @@ connect_ep( char *hostname, int conn_id )
     rmr_send_msg.target_address = (DAT_VADDR)(unsigned long)rbuf;
     rmr_send_msg.segment_length = RDMA_BUFFER_SIZE;
 
-    printf("%d Send RMR to remote: snd_msg: r_key_ctx=%x,pad=%x,va=%llx,len=0x%x\n",
+    printf("%d Send RMR to remote: snd_msg: r_key_ctx=%x,pad=%x, "
+	   "va="F64x",len="F64x"\n",
            getpid(), rmr_send_msg.rmr_context, rmr_send_msg.pad,
            rmr_send_msg.target_address, rmr_send_msg.segment_length );
 
@@ -862,16 +859,17 @@ connect_ep( char *hostname, int conn_id )
                sizeof( DAT_RMR_TRIPLET )) ||
        (event.event_data.dto_completion_event_data.user_cookie.as_64 !=
                recv_msg_index) ) {
-       fprintf(stderr,"ERR recv event: len=%d cookie=" PRIx64 " expected %d/%d\n",
+       fprintf(stderr,"ERR recv event: len=%d cookie="F64x" expected %d/%d\n",
            (int)event.event_data.dto_completion_event_data.transfered_length,
-           (int)event.event_data.dto_completion_event_data.user_cookie.as_64,
-           sizeof(DAT_RMR_TRIPLET), recv_msg_index );
+           event.event_data.dto_completion_event_data.user_cookie.as_64,
+           (int)sizeof(DAT_RMR_TRIPLET), recv_msg_index );
        return( DAT_ABORT );
     }
 
     r_iov = rmr_recv_msg[ recv_msg_index ];
 
-    printf("%d Received RMR from remote: r_iov: r_key_ctx=%x,pad=%x,va=%llx,len=0x%x\n",
+    printf("%d Received RMR from remote: r_iov: r_key_ctx=%x,pad=%x "
+	   ",va="F64x",len="F64x"\n",
            getpid(), r_iov.rmr_context, r_iov.pad,
            r_iov.target_address, r_iov.segment_length );
 
@@ -887,7 +885,6 @@ disconnect_ep()
     DAT_RETURN ret;
     DAT_EVENT  event;
     DAT_COUNT  nmore;
-    int                i,flush_cnt;
 
     if (connected) {
 
@@ -962,13 +959,11 @@ disconnect_ep()
 DAT_RETURN
 do_rdma_write_with_msg( )
 {
-       DAT_REGION_DESCRIPTION  region;
        DAT_EVENT               event;
        DAT_COUNT               nmore;
        DAT_LMR_TRIPLET         l_iov[MSG_IOV_COUNT];
        DAT_RMR_TRIPLET         r_iov;
        DAT_DTO_COOKIE          cookie;
-       DAT_RMR_CONTEXT         their_context;
        DAT_RETURN              ret;
        int                     i;
 
@@ -994,7 +989,7 @@ do_rdma_write_with_msg( )
 	   l_iov[i].virtual_address = (DAT_VADDR)(unsigned long)
 					(&sbuf[l_iov[i].segment_length*i]);
 
-	   LOGPRINTF("%d rdma_write iov[%d] buf=%p,len=%d\n", 
+	   LOGPRINTF("%d rdma_write iov[%d] buf=%p,len="F64x"\n", 
 			getpid(), i, &sbuf[l_iov[i].segment_length*i],
 			l_iov[i].segment_length);
        }
@@ -1081,17 +1076,17 @@ do_rdma_write_with_msg( )
 
        if ( (event.event_data.dto_completion_event_data.transfered_length != sizeof(
DAT_RMR_TRIPLET )) ||
             (event.event_data.dto_completion_event_data.user_cookie.as_64 != recv_msg_index) ) { +
-           fprintf(stderr,"unexpected event data for receive: len=%d cookie=" PRIx64 " exp
%d/%d\n",
+           fprintf(stderr,"unexpected event data for receive: len=%d cookie="F64x" exp %d/%d\n",
                (int)event.event_data.dto_completion_event_data.transfered_length,
-               (int)event.event_data.dto_completion_event_data.user_cookie.as_64,
-               sizeof(DAT_RMR_TRIPLET), recv_msg_index );
+               event.event_data.dto_completion_event_data.user_cookie.as_64,
+               (int)sizeof(DAT_RMR_TRIPLET), recv_msg_index );
 
            return( DAT_ABORT );
        }
 
        r_iov = rmr_recv_msg[ recv_msg_index ];
 
-       printf("%d Received RMR from remote: r_iov: ctx=%x,pad=%x,va=%p,len=0x%x\n",
+       printf("%d Received RMR from remote: r_iov: ctx=%x,pad=%x,va=%p,len="F64x"\n",
                    getpid(), r_iov.rmr_context,
             r_iov.pad,
             (void*)(unsigned long)r_iov.target_address,
@@ -1112,13 +1107,11 @@ do_rdma_write_with_msg( )
 DAT_RETURN
 do_rdma_read_with_msg( )
 {
-       DAT_REGION_DESCRIPTION  region;
        DAT_EVENT               event;
        DAT_COUNT               nmore;
        DAT_LMR_TRIPLET         l_iov;
        DAT_RMR_TRIPLET         r_iov;
        DAT_DTO_COOKIE          cookie;
-       DAT_RMR_CONTEXT         their_context;
        DAT_RETURN              ret;
        int                     i;
 
@@ -1191,9 +1184,9 @@ do_rdma_read_with_msg( )
 	    }
 	    if ((event.event_data.dto_completion_event_data.transfered_length != buf_len ) ||
 		(event.event_data.dto_completion_event_data.user_cookie.as_64 != 0x9999 )) {
-		fprintf(stderr, "%d: ERROR: DTO len %d or cookie " PRIx64 "\n", 
+		fprintf(stderr, "%d: ERROR: DTO len %d or cookie "F64x"\n", 
 			getpid(),
-			event.event_data.dto_completion_event_data.transfered_length,
+			(int)event.event_data.dto_completion_event_data.transfered_length,
 			event.event_data.dto_completion_event_data.user_cookie.as_64 );
 		return( DAT_ABORT );
 	    }
@@ -1273,17 +1266,17 @@ do_rdma_read_with_msg( )
        if ( (event.event_data.dto_completion_event_data.transfered_length != sizeof(
DAT_RMR_TRIPLET )) ||
             (event.event_data.dto_completion_event_data.user_cookie.as_64 != recv_msg_index) ) {
 
-           fprintf(stderr,"unexpected event data for receive: len=%d cookie=" PRIx64 " exp
%d/%d\n",
+           fprintf(stderr,"unexpected event data for receive: len=%d cookie="F64x" exp %d/%d\n",
                (int)event.event_data.dto_completion_event_data.transfered_length,
-               (int)event.event_data.dto_completion_event_data.user_cookie.as_64,
-               sizeof(DAT_RMR_TRIPLET), recv_msg_index );
+               event.event_data.dto_completion_event_data.user_cookie.as_64,
+               (int)sizeof(DAT_RMR_TRIPLET), recv_msg_index );
 
            return( DAT_ABORT );
        }
 
        r_iov = rmr_recv_msg[ recv_msg_index ];
 
-       printf("%d Received RMR from remote: r_iov: ctx=%x,pad=%x,va=%p,len=0x%x\n",
+       printf("%d Received RMR from remote: r_iov: ctx=%x,pad=%x,va=%p,len="F64x"\n",
                getpid(), r_iov.rmr_context, r_iov.pad,
                (void*)(unsigned long)r_iov.target_address, r_iov.segment_length );
 
@@ -1425,9 +1418,9 @@ do_ping_pong_msg( )
            != buf_len) ||
            (event.event_data.dto_completion_event_data.user_cookie.as_64
            != burst_msg_index) )  {
-           fprintf(stderr,"ERR: recv event: len=%d cookie=" PRIx64 " exp %d/%d\n",
+           fprintf(stderr,"ERR: recv event: len=%d cookie="F64x" exp %d/%d\n",
                (int)event.event_data.dto_completion_event_data.transfered_length,
-               (int)event.event_data.dto_completion_event_data.user_cookie.as_64,
+               event.event_data.dto_completion_event_data.user_cookie.as_64,
                buf_len, burst_msg_index );
 
            return( DAT_ABORT );
@@ -1760,7 +1753,6 @@ const char *
 DT_RetToString (DAT_RETURN ret_value)
 {
     const char *major_msg, *minor_msg;
-    int sz;
 
     dat_strerror (ret_value, &major_msg, &minor_msg);
 
-- 
1.5.2.5





More information about the general mailing list