diff-perftest-08 [was: Re: [openib-general] Re: Re: diff-perftest-07 replace pp_get_local_lid()]

Bernhard Fischer bernhard at aon.at
Fri May 20 07:35:58 PDT 2005


On Wed, May 18, 2005 at 08:56:31PM +0200, Bernhard Fischer wrote:
>On Wed, May 18, 2005 at 09:44:36PM +0300, Michael S. Tsirkin wrote:
>>Quoting r. Bernhard Fischer <blist at aon.at>:
>>> Subject: Re: Re: diff-perftest-07 replace pp_get_local_lid()

>>Size 0 doesnt make sense for this test since I'm polling on data:
>>no data = nothing to poll upon.
>
>If size 0 and -1 (not 1 as you seem to have read) are illegal (they
>obviously are for malloc) you should check if(size <1){usage();exit(1);}
>Same for the other arguments. I'll send a patchlet if noone did fix
>that by next week.
>
>>-s 1 should work - I'll check tomorrow.

Looking at the code, 1 is the default and not 4096 as advertised (see
attached patch to reflect default of 1 in usage).

o Change usage() to match the actual default of size.
o sparse warning amout non-ANSI function decl of get_cpu_mhz(),
  whitespace in printf while at it.
o Add printing Size, TX-depth and Iters to print_report().
  Without a short description of the workload, it is bit hard to
  interpret the results if one cannot see the command-line used to run
  the tests.
o Check arguments -s and -t
o Trim some whitespace
o Remove odd 'write(sockfd,"foo"...' (What was that good for?)

Signed-off-by: Bernhard Fischer <rep.nop at aon.at>

>
>-s 1 did work for me last time i looked.
>In fact, back then only 1 worked, i got errors for bigger values i tried
>(42,128,256,512,1k,2k,4k,16k,32k,64k,128k,42M etc).

The problem seems to be that i (wrongly) believed in the default size of
4k, so assumed i could run the server without args and pass -s 2 to the
client. This is a wrong assertion as size really defaults to 1.

I can specify -s 940 as the maximum, using 941 gives me "cannot create
QP" in rdma_lat.c. Is this expected? What are the contraints and limits
for size here?


Quick unrelated question:
Is there any limit on the number of cqe's i can pass to mthca_create_cq?
I initially tried 40960 or 4096 but that did not work. I'm now using 64
but would like to use more than those in the future..

-------------- next part --------------
diff -X excl -rduNp gen2.2423.oorig/trunk/src/userspace/perftest/get_clock.c gen2.2423/trunk/src/userspace/perftest/get_clock.c
--- gen2.2423.oorig/trunk/src/userspace/perftest/get_clock.c	2005-05-17 14:38:30.000000000 +0000
+++ gen2.2423/trunk/src/userspace/perftest/get_clock.c	2005-05-20 11:47:06.000000000 +0000
@@ -35,7 +35,7 @@
 #include <unistd.h>
 #include <stdio.h>
 
-double get_cpu_mhz()
+double get_cpu_mhz(void)
 {
 	FILE* f;
 	char buf[256];
@@ -55,7 +55,7 @@ double get_cpu_mhz()
 			continue;
 		}
 		if (mhz != m) {
-			fprintf(stderr,"Conflicting CPU frequency values "
+			fprintf(stderr,"Conflicting CPU frequency values"
 					" detected: %lf != %lf\n",
 					mhz, m);
 			return 0.0;
diff -X excl -rduNp gen2.2423.oorig/trunk/src/userspace/perftest/rdma_lat.c gen2.2423/trunk/src/userspace/perftest/rdma_lat.c
--- gen2.2423.oorig/trunk/src/userspace/perftest/rdma_lat.c	2005-05-20 07:06:11.000000000 +0000
+++ gen2.2423/trunk/src/userspace/perftest/rdma_lat.c	2005-05-20 12:43:51.000000000 +0000
@@ -434,7 +434,7 @@ static void usage(const char *argv0)
 	printf("  -p, --port=<port>      listen on/connect to port <port> (default 18515)\n");
 	printf("  -d, --ib-dev=<dev>     use IB device <dev> (default first device found)\n");
 	printf("  -i, --ib-port=<port>   use port <port> of IB device (default 1)\n");
-	printf("  -s, --size=<size>      size of message to exchange (default 4096)\n");
+	printf("  -s, --size=<size>      size of message to exchange (default 1)\n");
 	printf("  -t, --tx-depth=<dep>   size of tx queue (default 50)\n");
 	printf("  -n, --iters=<iters>    number of exchanges (at least 2, default 1000)\n");
 	printf("  -C, --report-cycles    report times in cpu cycle units (default microseconds)\n");
@@ -468,7 +468,8 @@ static int cycles_compare(const void * a
 }
 
 static void print_report(struct report_options * options,
-			 unsigned int iters, cycles_t *tstamp)
+			 unsigned int iters, cycles_t *tstamp,
+			 struct pingpong_context *ctx)
 {
 	double cycles_to_units;
 	cycles_t median;
@@ -507,6 +508,9 @@ static void print_report(struct report_o
 			printf("%d, %g\n", i + 1, delta[i] / cycles_to_units / 2);
 	}
 
+	printf("Size: %d, TX-depth: %d, Exchanges: %d\n",
+		ctx->size, ctx->tx_depth, iters);
+
 	median = get_median(iters, delta);
 
 	printf("Latency typical: %g %s\n", median / cycles_to_units / 2, units);
@@ -519,8 +523,8 @@ static void print_report(struct report_o
 
 int main(int argc, char *argv[])
 {
-	struct dlist 	  	*dev_list;
-	struct ibv_device 	*ib_dev;
+	struct dlist		*dev_list;
+	struct ibv_device	*ib_dev;
 	struct pingpong_context *ctx;
 	struct pingpong_dest     my_dest;
 	struct pingpong_dest    *rem_dest;
@@ -536,7 +540,7 @@ int main(int argc, char *argv[])
 	int			 client_first_post;
 	int			 sockfd;
 	struct ibv_qp		*qp;
-	struct ibv_send_wr 	*wr;
+	struct ibv_send_wr	*wr;
 	volatile char		*poll_buf;
 	volatile char		*post_buf;
 	struct report_options    report = {};
@@ -555,7 +559,7 @@ int main(int argc, char *argv[])
 			{ .name = "iters",          .has_arg = 1, .val = 'n' },
 			{ .name = "tx-depth",       .has_arg = 1, .val = 't' },
 			{ .name = "report-cycles",  .has_arg = 0, .val = 'C' },
-			{ .name = "report-histogram", .has_arg = 0, .val = 'H' },
+			{ .name = "report-histogram",.has_arg = 0, .val = 'H' },
 			{ .name = "report-unsorted",.has_arg = 0, .val = 'U' },
 			{ 0 }
 		};
@@ -587,10 +591,12 @@ int main(int argc, char *argv[])
 
 		case 's':
 			size = strtol(optarg, NULL, 0);
+			if (size < 1) { usage(argv[0]); return 1; }
 			break;
 
 		case 't':
 			tx_depth = strtol(optarg, NULL, 0);
+			if (tx_depth < 1) { usage(argv[0]); return 1; }
 			break;
 
 		case 'n':
@@ -674,7 +680,6 @@ int main(int argc, char *argv[])
 			"RKey %#08x VAddr %#016Lx\n",
 			my_dest.lid, my_dest.qpn, my_dest.psn,
 			my_dest.rkey, my_dest.vaddr);
-	
 
 	if (servername) {
 		sockfd = pp_client_connect(servername, port);
@@ -707,7 +712,6 @@ int main(int argc, char *argv[])
 		rem_dest = pp_server_exch_dest(sockfd, &my_dest);
 	}
 
-	write(sockfd, "done", sizeof "done");
 	close(sockfd);
 
 	wr = &ctx->wr;
@@ -784,7 +788,7 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	print_report(&report, iters, tstamp);
+	print_report(&report, iters, tstamp, ctx);
 
 	free(tstamp);
 	return 0;


More information about the general mailing list