[openib-general] Re: [PATCH] printf fix for dapl/dtest

Steve Wise swise at opengridcomputing.com
Fri Mar 31 10:50:15 PST 2006


Looks good.

> Steve, Arlin, do either of you see problems with this? If not, I'll 
> check it in.
> 
> Index: dtest.c
> ===================================================================
> --- dtest.c	(revision 5935)
> +++ dtest.c	(working copy)
> @@ -33,6 +33,7 @@
>   */
>  #include <stdio.h>
>  #include <stdlib.h>
> +#include <string.h>
>  #include <netdb.h>
>  #include <sys/socket.h>
>  #include <netinet/in.h>
> @@ -40,6 +41,7 @@
>  #include <arpa/inet.h>
>  #include <sys/mman.h>
>  #include <getopt.h>
> +#include <inttypes.h>
>  
>  #ifndef DAPL_PROVIDER
>  #define DAPL_PROVIDER "OpenIB-ib0"
> @@ -546,7 +548,7 @@
>  
>         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 %x\n",
> +           fprintf(stderr, "%d: ERROR: DTO len %d or cookie " PRIx64 "\n",
>                 getpid(),
>                 event.event_data.dto_completion_event_data.transfered_length,
>                 event.event_data.dto_completion_event_data.user_cookie.as_64 );
> @@ -833,7 +835,7 @@
>                 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=%d expected %d/%d\n",
> +       fprintf(stderr,"ERR recv event: len=%d cookie=" PRIx64 " 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 );
> @@ -1045,7 +1047,7 @@
>  
>         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=%d exp %d/%d\n",
> +           fprintf(stderr,"unexpected event data for receive: len=%d cookie=" PRIx64 " 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 );
> @@ -1155,7 +1157,7 @@
>  	    }
>  	    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 %x\n", 
> +		fprintf(stderr, "%d: ERROR: DTO len %d or cookie " PRIx64 "\n", 
>  			getpid(),
>  			event.event_data.dto_completion_event_data.transfered_length,
>  			event.event_data.dto_completion_event_data.user_cookie.as_64 );
> @@ -1237,7 +1239,7 @@
>         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=%d exp %d/%d\n",
> +           fprintf(stderr,"unexpected event data for receive: len=%d cookie=" PRIx64 " 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 );
> @@ -1272,9 +1274,9 @@
>      DAT_DTO_COOKIE     cookie;
>      DAT_LMR_TRIPLET    l_iov;
>      DAT_RETURN         ret;
> -    int                        i;
> -    unsigned char      *snd_buf;
> -    unsigned char      *rcv_buf;
> +    int                i;
> +    char               *snd_buf;
> +    char               *rcv_buf;
>  
>      printf("\n %d PING DATA with SEND MSG\n\n",getpid());
>  
> @@ -1389,7 +1391,7 @@
>             != buf_len) ||
>             (event.event_data.dto_completion_event_data.user_cookie.as_64
>             != burst_msg_index) )  {
> -           fprintf(stderr,"ERR: recv event: len=%d cookie=%d exp %d/%d\n",
> +           fprintf(stderr,"ERR: recv event: len=%d cookie=" PRIx64 " 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,
>                 buf_len, burst_msg_index );




More information about the general mailing list