[ofa-general] [PATCH] uDAPL dtest - add provider option, set default to OpenIB-cma

Arlin Davis arlin.r.davis at intel.com
Tue Mar 13 16:58:26 PDT 2007


add provider option to dtest, set default to OpenIB-cma (applied - master and ofed_1_2)

Signed-off by: Arlin Davis ardavis at ichips.intel.com


diff --git a/test/dtest/dtest.c b/test/dtest/dtest.c
index 86b70cc..690915d 100644
--- a/test/dtest/dtest.c
+++ b/test/dtest/dtest.c
@@ -44,7 +44,7 @@
 #include <inttypes.h>
 
 #ifndef DAPL_PROVIDER
-#define DAPL_PROVIDER "OpenIB-ib0"
+#define DAPL_PROVIDER "OpenIB-cma"
 #endif
 
 #define MAX_POLLING_CNT 50000
@@ -107,6 +107,7 @@ static DAT_VLEN           registered_size_send_msg;
 static DAT_VADDR          registered_addr_send_msg;
 static DAT_EP_ATTR        ep_attr;
 char                      hostname[256] = {0};
+char                      provider[256] = DAPL_PROVIDER;
 
 /* rdma pointers */
 char   *rbuf = NULL;
@@ -189,7 +190,7 @@ main(int argc, char **argv)
        DAT_RETURN  ret;
 
        /* parse arguments */
-       while ((c = getopt(argc, argv, "scvpb:d:B:h:")) != -1)
+       while ((c = getopt(argc, argv, "scvpb:d:B:h:P:")) != -1)
        {
                switch(c)
                {
@@ -225,6 +226,9 @@ main(int argc, char **argv)
                                server = 0;
                                strcpy (hostname, optarg);
                                break;
+                       case 'P':
+                               strcpy (provider, optarg);
+                               break;
                        default:
                                print_usage();
                                exit(-12);
@@ -232,9 +236,9 @@ main(int argc, char **argv)
        }
 
        if (!server) {
-               printf("%d Running as client\n",getpid()); fflush(stdout);
+               printf("%d Running as client - %s\n",getpid(),provider); fflush(stdout);
        } else {
-               printf("%d Running as server\n",getpid()); fflush(stdout);
+               printf("%d Running as server - %s\n",getpid(),provider); fflush(stdout);
        }
 
        /* allocate send and receive buffers */
@@ -250,7 +254,7 @@ main(int argc, char **argv)
        /* dat_ia_open, dat_pz_create */
        h_async_evd = DAT_HANDLE_NULL;
        start = get_time();
-       ret = dat_ia_open( DAPL_PROVIDER, 8, &h_async_evd, &h_ia );
+       ret = dat_ia_open( provider, 8, &h_async_evd, &h_ia );
        stop = get_time();
        time.open += ((stop - start)*1.0e6);
        if(ret != DAT_SUCCESS) {
@@ -1802,6 +1806,7 @@ void print_usage()
     printf("b: buf length to allocate\n");
     printf("B: burst count, rdma and msgs \n");
     printf("h: hostname\n");
+    printf("P: provider (default=OpenIB-cma)\n");
     printf("\n");
 }
 




More information about the general mailing list