[ofw] FW: [patch] Updated ibv_XXXX_bw/ ibv_XXXX_lat tools - ibv_send_bw, ibv_send_lat

Irena Kruchkovsky irena at mellanox.co.il
Wed Sep 1 08:35:19 PDT 2010


Attached are the differences between the new tools and the Linux version of them.

Ibv_send_bw

3,4c3,4
<  * Copyright (c) 2005 Mellanox Technologies Ltd.  All rights reserved.
<  * Copyright (c) 2009 HNR Consulting.  All rights reserved.
---
>  * Copyright (c) 2006 Mellanox Technologies Ltd.  All rights reserved.
>  * Copyright (c) 2008-2009 Intel Corporation.  All rights reserved.
6,10c6,7
<  * This software is available to you under a choice of one of two
<  * licenses.  You may choose to be licensed under the terms of the GNU
<  * General Public License (GPL) Version 2, available from the file
<  * COPYING in the main directory of this source tree, or the
<  * OpenIB.org BSD license below:
---
>  * This software is available to you under the OpenIB.org BSD license
>  * below:
27c24
<  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
---
>  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
33,34d29
<  *
<  * $Id$
37,40d31
< #if HAVE_CONFIG_H
< #  include <config.h>
< #endif /* HAVE_CONFIG_H */
<
43d33
< #include <unistd.h>
50a41,44
> #include <windows.h>
>
> #include <ws2tcpip.h>
> #include <winsock2.h>
52c46,48
< #include "get_clock.h"
---
>
> #include "..\..\tools\perftests\user\get_clock.h"
> #include "..\..\etc\user\getopt.c"
54a51
> #include "l2w.h"
60c57
< static int sl;
---
> static uint8_t sl;
185c182
<             my_dest->psn  = lrand48() & 0xffffff;
---
>             my_dest->psn  = rand() & 0xffffff;
213c210
<             if(params->sockfd < 0) {
---
>             if (params->sockfd == INVALID_SOCKET) {
284c281
<             free(ctx->buf);
---
>             posix_memfree(ctx->buf);
312c309
<             ctx->buf = memalign(page_size,m_size);
---
>             posix_memalign(&(ctx->buf),page_size, m_size);
399d395
<             memset(&attr, 0, sizeof attr);
400a397
>             memset(&attr, 0, sizeof attr);
434c431
<                             attr.ah_attr.grh.sgid_index = user_parm->gid_index;
---
>                             attr.ah_attr.grh.sgid_index = (uint8_t)(user_parm->gid_index);
619c616
<                                              cycles_t *tposted, cycles_t *tcompleted, int noPeak, int no_cpu_freq_fail)
---
>                                              cycles_t *tposted, cycles_t *tcompleted, int noPeak, int no_cpu_freq_fail, MachineType machine)
623c620
<             int i, j;
---
>             unsigned int i, j;
628d624
<
635a632
>
644c641
<             cycles_to_units = get_cpu_mhz(no_cpu_freq_fail) * 1000000;
---
>             cycles_to_units = get_cpu_mhz();
648,649c645,652
<             printf(REPORT_FMT,size,iters,!(noPeak) * tsize * cycles_to_units / opt_delta / 0x100000,
<                    tsize * iters * cycles_to_units /(tcompleted[iters - 1] - tposted[0]) / 0x100000);
---
>
>             if (machine == SERVER)
>                             printf(" %7d    %d            N\\A             %7.2f\n",size,iters,
>                             (uint64_t)tsize * iters * cycles_to_units /(tcompleted[iters - 1] - tposted[0]) / 0x100000);
>             else
>                             printf(REPORT_FMT,size,iters,!(noPeak) * tsize * cycles_to_units / opt_delta / 0x100000,
>                (uint64_t)tsize * iters * cycles_to_units /(tcompleted[iters - 1] - tposted[0]) / 0x100000);
>
899c902
< int main(int argc, char *argv[])
---
> int __cdecl main(int argc, char *argv[])
909c912
<             long long                              size = 65536;
---
>             unsigned int                       size = 65536;
912c915
<             int                           noPeak = 1;
---
>             int                           noPeak = 0;
922a926,928
>             SYSTEM_INFO si;
>             GetSystemInfo(&si);
>
945,965c951,971
<                                             { .name = "port",           .has_arg = 1, .val = 'p' },
<                                             { .name = "ib-dev",         .has_arg = 1, .val = 'd' },
<                                             { .name = "ib-port",        .has_arg = 1, .val = 'i' },
<                                             { .name = "mtu",            .has_arg = 1, .val = 'm' },
<                                             { .name = "connection",     .has_arg = 1, .val = 'c' },
<                                             { .name = "size",           .has_arg = 1, .val = 's' },
<                                             { .name = "iters",          .has_arg = 1, .val = 'n' },
<                                             { .name = "tx-depth",       .has_arg = 1, .val = 't' },
<                                             { .name = "inline_size",    .has_arg = 1, .val = 'I' },
<                                             { .name = "rx-depth",       .has_arg = 1, .val = 'r' },
<                                             { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
<                                             { .name = "sl",             .has_arg = 1, .val = 'S' },
<                                             { .name = "gid-index",      .has_arg = 1, .val = 'x' },
<                                             { .name = "MGID",           .has_arg = 1, .val = 'M' },
<                                             { .name = "all",            .has_arg = 0, .val = 'a' },
<                                             { .name = "bidirectional",  .has_arg = 0, .val = 'b' },
<                                             { .name = "version",        .has_arg = 0, .val = 'V' },
<                                             { .name = "events",         .has_arg = 0, .val = 'e' },
<                                             { .name = "noPeak",         .has_arg = 0, .val = 'N' },
<                                             { .name = "CPU-freq",       .has_arg = 0, .val = 'F' },
<                                             { .name = "mcg",            .has_arg = 1, .val = 'g' },
---
>                                             { "port",                               1, NULL, 'p' },
>                                             { "ib-dev",         1, NULL, 'd' },
>                                             { "ib-port",        1, NULL, 'i' },
>                                             { "mtu",            1, NULL, 'm' },
>                                             { "connection",     1, NULL, 'c' },
>                                             { "size",           1, NULL, 's' },
>                                             { "iters",          1, NULL, 'n' },
>                                             { "tx-depth",       1, NULL, 't' },
>                                             { "inline_size",    1, NULL, 'I' },
>                                             { "rx-depth",       1, NULL, 'r' },
>                                             { "qp-timeout",     1, NULL, 'u' },
>                                             { "sl",             1, NULL, 'S' },
>                                             { "gid-index",      1, NULL, 'x' },
>                                             { "MGID",           1, NULL, 'M' },
>                                             { "all",            0, NULL, 'a' },
>                                             { "bidirectional",  0, NULL, 'b' },
>                                             { "version",        0, NULL, 'V' },
>                                             { "events",         0, NULL, 'e' },
>                                             { "noPeak",         0, NULL, 'N' },
>                                             { "CPU-freq",       0, NULL, 'F' },
>                                             { "mcg",            1, NULL, 'g' },
994c1000
<                                             mcg_params.user_mgid = strdupa(optarg);
---
>                                             mcg_params.user_mgid = _strdup(optarg);
997c1003
<                                             ib_devname = strdupa(optarg);
---
>                                             ib_devname = _strdup(optarg);
1016c1022
<                                             user_param.ib_port = strtol(optarg, NULL, 0);
---
>                                             user_param.ib_port = (uint8_t)(strtol(optarg, NULL, 0));
1024c1030
<                                             size = strtoll(optarg, NULL, 0);
---
>                                             size = strtol(optarg, NULL, 0);
1081c1087
<                                             user_param.qp_timeout = strtol(optarg, NULL, 0);
---
>                                             user_param.qp_timeout = (uint8_t)(strtol(optarg, NULL, 0));
1085c1091
<                                             sl = strtol(optarg, NULL, 0);
---
>                                             sl = (uint8_t)(strtol(optarg, NULL, 0));
1096c1102
<                             servername = strdupa(argv[optind]);
---
>                             servername = _strdup(argv[optind]);
1104a1111
>             user_param.rx_depth = user_param.iters < user_param.rx_depth ? user_param.iters : user_param.rx_depth ;
1146,1148c1153
<             srand48(getpid() * time(NULL));
<
<             page_size = sysconf(_SC_PAGESIZE);
---
>             page_size = si.dwPageSize;
1275c1280
<                                             print_report(user_param.iters, size, user_param.duplex, tposted, tcompleted, noPeak, no_cpu_freq_fail);
---
>                                             print_report(user_param.iters, size, user_param.duplex, tposted, tcompleted, noPeak, no_cpu_freq_fail, user_param.machine);
1292c1297,1298
<                             print_report(user_param.iters, size, user_param.duplex, tposted, tcompleted, noPeak, no_cpu_freq_fail);
---
>                             printf("machine %d noPeak %d\n",user_param.machine, noPeak);
>                             print_report(user_param.iters, size, user_param.duplex, tposted, tcompleted, noPeak, no_cpu_freq_fail, user_param.machine);

Ibv_send_lat

3,5c3,4
<  * Copyright (c) 2005 Mellanox Technologies Ltd.  All rights reserved.
<  * Copyright (c) 2005 Hewlett Packard, Inc (Grant Grundler)
<  * Copyright (c) 2009 HNR Consulting.  All rights reserved.
---
>  * Copyright (c) 2006 Mellanox Technologies Ltd.  All rights reserved.
>  * Copyright (c) 2008-2009 Intel Corporation.  All rights reserved.
7,11c6,7
<  * This software is available to you under a choice of one of two
<  * licenses.  You may choose to be licensed under the terms of the GNU
<  * General Public License (GPL) Version 2, available from the file
<  * COPYING in the main directory of this source tree, or the
<  * OpenIB.org BSD license below:
---
>  * This software is available to you under the OpenIB.org BSD license
>  * below:
28c24
<  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
---
>  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
34,35d29
<  *
<  * $Id$
38,41d31
< #if HAVE_CONFIG_H
< #include <config.h>
< #endif /* HAVE_CONFIG_H */
<
44c34
< #include <unistd.h>
---
>
49a40
> #include <windows.h>
51c42,47
< #include "get_clock.h"
---
> #include <ws2tcpip.h>
> #include <winsock2.h>
>
>
> #include "..\..\tools\perftests\user\get_clock.h"
> #include "..\..\etc\user\getopt.c"
53a50
> #include "l2w.h"
159c156
<             my_dest->psn       = lrand48() & 0xffffff;
---
>             my_dest->psn       = rand() & 0xffffff;
189c186
<             if(params->sockfd < 0) {
---
>             if (params->sockfd == INVALID_SOCKET) {
199,273d195
< /*static int destroy_ctx_resources(struct pingpong_context *ctx,
<                                                                                                                              struct perftest_parameters  *param)  {
<
<             int i;
<             int test_result = 0;
<
<             if (ctx->ah) {
<                             if (ibv_destroy_ah(ctx->ah)) {
<                                             fprintf(stderr, "failed to destroy AH\n");
<                                             test_result = 1;
<                             }
<             }
<
<             if (param->use_mcg) {
<                             for (i=0; i < param->num_of_qps_in_mcg; i++) {
<                                             if (ibv_detach_mcast(ctx->mcg_qp[i],&ctx->dgid,MCG_LID)) {
<                                                             fprintf(stderr, "failed to deatttached QP\n");
<                                                             test_result = 1;
<                                             }
<                                             if (ibv_destroy_qp(ctx->mcg_qp[i])) {
<                                                             fprintf(stderr, "failed to destroy QP\n");
<                                                             test_result = 1;
<                                             }
<                             }
<                             free(ctx->mcg_qp);
<             }
<             if (ibv_destroy_qp(ctx->qp)) {
<                             fprintf(stderr, "failed to destroy QP\n");
<                             test_result = 1;
<             }
<
<             if (ctx->mr) {
<                             if (ibv_dereg_mr(ctx->mr)) {
<                                             fprintf(stderr, "failed to deregister MR\n");
<                                             test_result = 1;
<                             }
<             }
<
<             if (ctx->buf)
<                             free(ctx->buf);
<
<             if (ctx->rcq) {
<                             if (ibv_destroy_cq(ctx->rcq)) {
<                                             fprintf(stderr, "failed to destroy Receive CQ\n");
<                                             test_result = 1;
<                             }
<             }
<
<             if (ctx->scq) {
<                             if (ibv_destroy_cq(ctx->scq)) {
<                                             fprintf(stderr, "failed to destroy Send CQ\n");
<                                             test_result = 1;
<                             }
<             }
<
<             if (ctx->pd) {
<                             if (ibv_dealloc_pd(ctx->pd)) {
<                                             fprintf(stderr, "failed to deallocate PD\n");
<                                             test_result = 1;
<                             }
<             }
<
<             if (ctx->context) {
<                             if (ibv_close_device(ctx->context)) {
<                                             fprintf(stderr, "failed to close device context\n");
<                                             test_result = 1;
<                             }
<             }
<             free(tstamp);
<             return test_result;
< }*/
<
< /******************************************************************************
<  *
<  ******************************************************************************/
310c232
<             ctx->buf = memalign(page_size, 2*SIZE(user_parm->connection_type,size));
---
>             posix_memalign(&(ctx->buf),page_size, 2*SIZE(user_parm->connection_type,size));
433c355
<                             attr.ah_attr.sl             = user_parm->sl;
---
>                             attr.ah_attr.sl             = (uint8_t)(user_parm->sl);
437c359
<                             attr.ah_attr.grh.sgid_index = user_parm->gid_index;
---
>                             attr.ah_attr.grh.sgid_index = (uint8_t)(user_parm->gid_index);
577,601d498
< /*
<  * When there is an
<  *         odd number of samples, the median is the middle number.
<  *         even number of samples, the median is the mean of the
<  *                         two middle numbers.
<  *
<  */
< static inline cycles_t get_median(int n, cycles_t delta[])
< {
<             if ((n - 1) % 2)
<                             return(delta[n / 2] + delta[n / 2 - 1]) / 2;
<             else
<                             return delta[n / 2];
< }
<
< static int cycles_compare(const void *aptr, const void *bptr)
< {
<             const cycles_t *a = aptr;
<             const cycles_t *b = bptr;
<             if (*a < *b) return -1;
<             if (*a > *b) return 1;
<             return 0;
<
< }
<
624c521
<                             cycles_to_units = get_cpu_mhz(no_cpu_freq_fail);
---
>                             cycles_to_units = get_cpu_mhz()/1000000;
785c682
< int main(int argc, char *argv[])
---
> int __cdecl main(int argc, char *argv[])
791c688
<             struct report_options      report = {};
---
>             struct report_options      report;
800a698,700
>
>             SYSTEM_INFO si;
>             GetSystemInfo(&si);
824,845c724,745
<                                             { .name = "port",           .has_arg = 1, .val = 'p' },
<                                             { .name = "connection",     .has_arg = 1, .val = 'c' },
<                                             { .name = "mtu",            .has_arg = 1, .val = 'm' },
<                                             { .name = "ib-dev",         .has_arg = 1, .val = 'd' },
<                                             { .name = "ib-port",        .has_arg = 1, .val = 'i' },
<                                             { .name = "size",           .has_arg = 1, .val = 's' },
<                                             { .name = "iters",          .has_arg = 1, .val = 'n' },
<                                             { .name = "tx-depth",       .has_arg = 1, .val = 't' },
<                                             { .name = "inline_size",    .has_arg = 1, .val = 'I' },
<                                             { .name = "qp-timeout",     .has_arg = 1, .val = 'u' },
<                                             { .name = "sl",             .has_arg = 1, .val = 'S' },
<                                             { .name = "gid-index",      .has_arg = 1, .val = 'x' },
<                                             { .name = "signal",         .has_arg = 0, .val = 'l' },
<                                             { .name = "all",            .has_arg = 0, .val = 'a' },
<                                             { .name = "report-cycles",  .has_arg = 0, .val = 'C' },
<                                             { .name = "report-histogram",.has_arg = 0, .val = 'H'},
<                                             { .name = "report-unsorted",.has_arg = 0, .val = 'U' },
<                                             { .name = "version",        .has_arg = 0, .val = 'V' },
<                                             { .name = "events",         .has_arg = 0, .val = 'e' },
<                                             { .name = "mcg",            .has_arg = 1, .val = 'g' },
<                                             { .name = "MGID",           .has_arg = 1, .val = 'M' },
<                                             { .name = "CPU-freq",       .has_arg = 0, .val = 'F' },
---
>                                             { "port",             1, NULL, 'p' },
>                                             { "connection",       1, NULL, 'c' },
>                                             { "mtu",              1, NULL, 'm' },
>                                             { "ib-dev",           1, NULL, 'd' },
>                                             { "ib-port",          1, NULL, 'i' },
>                                             { "size",             1, NULL, 's' },
>                                             { "iters",            1, NULL, 'n' },
>                                             { "tx-depth",         1, NULL, 't' },
>                                             { "inline_size",      1, NULL, 'I' },
>                                             { "qp-timeout",       1, NULL, 'u' },
>                                             { "sl",               1, NULL, 'S' },
>                                             { "gid-index",        1, NULL, 'x' },
>                                             { "signal",           0, NULL, 'l' },
>                                             { "all",              0, NULL, 'a' },
>                                             { "report-cycles",    0, NULL, 'C' },
>                                             { "report-histogram", 0, NULL, 'H'},
>                                             { "report-unsorted",  0, NULL, 'U' },
>                                             { "version",          0, NULL, 'V' },
>                                             { "events",           0, NULL, 'e' },
>                                             { "mcg",              1, NULL, 'g' },
>                                             { "MGID",             1, NULL, 'M' },
>                                             { "CPU-freq",         0, NULL, 'F' },
880c780
<                                             mcg_params.user_mgid = strdupa(optarg);
---
>                                             mcg_params.user_mgid = _strdup(optarg);
896c796
<                                             ib_devname = strdupa(optarg);
---
>                                             ib_devname = _strdup(optarg);
900c800
<                                             user_param.ib_port = strtol(optarg, NULL, 0);
---
>                                             user_param.ib_port = (uint8_t)(strtol(optarg, NULL, 0));
964c864
<                                             user_param.qp_timeout = strtol(optarg, NULL, 0);
---
>                                             user_param.qp_timeout = (uint8_t)(strtol(optarg, NULL, 0));
979c879
<                             servername = strdupa(argv[optind]);
---
>                             servername = _strdup(argv[optind]);
1026,1027c926
<             srand48(getpid() * time(NULL));
<             page_size = sysconf(_SC_PAGESIZE);
---
>             page_size = si.dwPageSize;

From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Irena Kruchkovsky
Sent: Tuesday, August 31, 2010 3:40 PM
To: ofw at lists.openfabrics.org
Subject: [ofw] [patch] Updated ibv_XXXX_bw/ ibv_XXXX_lat tools - ibv_send_bw, ibv_send_lat


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/3dd1df00/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_send.patch
Type: application/octet-stream
Size: 129930 bytes
Desc: ibv_send.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/3dd1df00/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001..txt
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/3dd1df00/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_send_bw_from_linux.diff
Type: application/octet-stream
Size: 7028 bytes
Desc: ibv_send_bw_from_linux.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/3dd1df00/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_send_lat_from_linux.diff
Type: application/octet-stream
Size: 7792 bytes
Desc: ibv_send_lat_from_linux.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/3dd1df00/attachment-0002.obj>


More information about the ofw mailing list