[openib-general] questions and a comment on the perftest package

Or Gerlitz ogerlitz at voltaire.com
Tue Nov 7 00:53:36 PST 2006


Hi Michael,

We have some questions re the statistics of the perftest utils, hope
you can comment on the below.

Also, would you be able to run Lindent on the perftest sources, else
the main loops are very much unreadable...

Or.


--- /dev/null	2006-10-31 15:38:42.428537323 +0200
+++ perftest/read_lat.c	2006-11-07 11:49:06.000000000 +0200
+int run_iter(struct pingpong_context *ctx, struct user_parameters *user_param,
+	     struct pingpong_dest *rem_dest, int size)
+{
+	int scnt, ccnt;
+	int iters;
+	scnt = 0;
+	ccnt = 0;
+	struct ibv_wc wc;
+	int ne;
...
+	if (user_param->servername) {
+		while (scnt < user_param->iters) {
+			struct ibv_send_wr *bad_wr;
+			*post_buf = (char)++scnt;
+			tstamp[scnt - 1] = get_cycles();
+			if (ibv_post_send(qp, wr, &bad_wr)) {
+				fprintf(stderr, "Couldn't post send: scnt=%d\n",
+					scnt);
+				return 11;
+			}
+			if (user_param->use_event) {
...
+			}
+			do {
+				ne = ibv_poll_cq(ctx->cq, 1, &wc);
+			} while (!user_param->use_event && ne < 1);
...

Whouldn't it make more sense to get one time stamp before the i'th posting
and one tstamp after the i'th completion is reaped from the cq?

+static void print_report(struct report_options *options,
+			 unsigned int iters, cycles_t * tstamp, int size)
+{
+	double cycles_to_units;
+	cycles_t median;
+	unsigned int i;
+	const char *units;
+	cycles_t *delta = malloc(iters * sizeof *delta);
+
+	if (!delta) {
+		perror("malloc");
+		return;
+	}
+
+	for (i = 0; i < iters - 1; ++i)
+		delta[i] = tstamp[i + 1] - tstamp[i];
+
....
+	qsort(delta, iters - 1, sizeof *delta, cycles_compare);
+
+	if (options->histogram) {
+		printf("#, %s\n", units);
+		for (i = 0; i < iters - 1; ++i)
+			printf("%d, %g\n", i + 1, delta[i] / cycles_to_units);
+	}
+
+	median = get_median(iters - 1, delta);
+	printf("%7d        %d        %7.2f        %7.2f          %7.2f\n",
+	       size, iters, delta[0] / cycles_to_units,
+	       delta[iters - 3] / cycles_to_units, median / cycles_to_units);

Following the above suggestion would enable to print the avg,min,max,median,std
statistics where now there is this delta approximation which i find less informative.

Or.




More information about the general mailing list