From 8f6938f40a02d260633fea0109d8582c5b869b37 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 19 Apr 2013 10:21:03 +0200 Subject: [PATCH 1/5] send: Add network bandwidth benchmark Copy from `~buczek/src/small/send.c`. --- send/send.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 send/send.c diff --git a/send/send.c b/send/send.c new file mode 100644 index 00000000..d7beef0d --- /dev/null +++ b/send/send.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef IPPORT_DISCARD +#define IPPORT_DISCARD 9 +#endif + +void usage() { + fprintf(stderr,"usage: send host [port]\n"); + exit(EXIT_FAILURE); +} + +static int gotAlarm=0; + +void sigAlarm() { + gotAlarm=1; +} + +void setLinger(int s) +{ + int status; + struct linger linger = {1,300}; /* on, seconds */ + /* DigitalUnix bug : close does not + return error if timeout. */ + + status = setsockopt(s,SOL_SOCKET,SO_LINGER,&linger,sizeof(linger)); + if (status<0) {perror("setsockopt");exit(EXIT_FAILURE);} +} + +static char buffer[8192]; + + +main(int argc,char *argv[]) { + + char *host; + short port; + struct hostent *he; + struct sockaddr_in sin; + int s; + int i; + int status; + int byteCount; + double bps; + struct timeval startTime; + struct timeval endTime; + double elapsed; + + + int seconds=10; + + if (argc<2 || argc>3) usage(); + host=argv[1]; + port = argc==3 ? atoi(argv[2]) : IPPORT_DISCARD; + + memset(buffer,0xA3,sizeof(buffer)); + + he=gethostbyname(host); + + if (!he) {fprintf(stderr,"unknown host: %s\n",host);exit(EXIT_FAILURE);} + + host=(char *)he->h_name; + + s=socket(he->h_addrtype,SOCK_STREAM,0); + if (s<0) {perror("socket");exit(EXIT_FAILURE);} + + setLinger(s); + + memset((void *)&sin,0,sizeof(sin)); + sin.sin_family = he->h_addrtype; + sin.sin_port = htons(port); + memcpy(&sin.sin_addr,he->h_addr,he->h_length); + + status=connect(s,(struct sockaddr *)&sin,sizeof(sin)); + if (status<0) {perror("connect");exit(EXIT_FAILURE);} + + signal(SIGALRM,sigAlarm); + alarm(seconds); + + byteCount=0; + + status = gettimeofday(&startTime,NULL); + if (status<0) {perror("gettimeofday");exit(EXIT_FAILURE);} + + fprintf(stderr,"start : %d.%d\n",startTime.tv_sec,startTime.tv_usec); + + while (1) { + int len; + + len = send(s,buffer,sizeof(buffer),0); + if (len<=0) { + if (errno == EINTR) break; + perror("send");exit(EXIT_FAILURE); + } +/* fprintf(stderr,"len: %d\n",len); */ +/* write(2,"#",1); */ + byteCount += len; + if (gotAlarm) break;; + } + +/* + + status = gettimeofday(&endTime,NULL); + if (status<0) {perror("gettimeofday");exit(EXIT_FAILURE);} + fprintf(stderr,"shutdown : %d.%d\n",endTime.tv_sec,endTime.tv_usec); + + status = shutdown(s,SHUT_RDWR); + if (status<0) {perror("shutdown");exit(EXIT_FAILURE);} + +*/ + + status = gettimeofday(&endTime,NULL); + if (status<0) {perror("gettimeofday");exit(EXIT_FAILURE);} + fprintf(stderr,"close : %d.%d\n",endTime.tv_sec,endTime.tv_usec); + + status = close(s); + if (status<0) {perror("close");exit(EXIT_FAILURE);} + + status = gettimeofday(&endTime,NULL); + if (status<0) {perror("gettimeofday");exit(EXIT_FAILURE);} + fprintf(stderr,"done : %d.%d\n",endTime.tv_sec,endTime.tv_usec); + + { double sec; + sec = endTime.tv_sec - startTime.tv_sec + + (double)(endTime.tv_usec - startTime.tv_usec)/1000000; + printf ("%d bytes in %f seconds\n",byteCount,sec); + printf ("%f bytes / seconds\n",(double)byteCount/sec); + printf ("%f bits / seconds\n",(double)byteCount*8/sec); + printf ("%f kBit/s / seconds\n",(double)byteCount*8/1000/sec); + printf ("%f MBit/s / seconds\n",(double)byteCount*8/1000000/sec); + } +} From d7f0aa3def1b7b66679f07e939a57ec26c428ceb Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Fri, 18 Mar 2022 15:20:33 +0100 Subject: [PATCH 2/5] =?UTF-8?q?send:=20Specify=20int=20as=20main()?= =?UTF-8?q?=E2=80=99s=20return=20type=20and=20include=20string.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the warnings below: $ make send cc send.c -o send send.c:41:1: warning: return type defaults to ‘int’ [-Wimplicit-int] main(int argc,char *argv[]) { ^~~~ send.c: In function ‘main’: send.c:63:5: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration] memset(buffer,0xA3,sizeof(buffer)); ^~~~~~ send.c:63:5: warning: incompatible implicit declaration of built-in function ‘memset’ send.c:63:5: note: include ‘’ or provide a declaration of ‘memset’ send.c:79:5: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration] memcpy(&sin.sin_addr,he->h_addr,he->h_length); ^~~~~~ send.c:79:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ send.c:79:5: note: include ‘’ or provide a declaration of ‘memcpy’ Reported-by: gcc (GCC) 7.5.0 --- send/send.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/send/send.c b/send/send.c index d7beef0d..a6ee435e 100644 --- a/send/send.c +++ b/send/send.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -38,7 +39,7 @@ void setLinger(int s) static char buffer[8192]; -main(int argc,char *argv[]) { +int main(int argc,char *argv[]) { char *host; short port; From 907197f35f0b604958686ae4d2b6c3195449f96e Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Fri, 18 Mar 2022 15:31:51 +0100 Subject: [PATCH 3/5] send: Strip trailing spaces --- send/send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/send/send.c b/send/send.c index a6ee435e..be1e0897 100644 --- a/send/send.c +++ b/send/send.c @@ -57,7 +57,7 @@ int main(int argc,char *argv[]) { int seconds=10; - if (argc<2 || argc>3) usage(); + if (argc<2 || argc>3) usage(); host=argv[1]; port = argc==3 ? atoi(argv[2]) : IPPORT_DISCARD; @@ -79,7 +79,7 @@ int main(int argc,char *argv[]) { sin.sin_port = htons(port); memcpy(&sin.sin_addr,he->h_addr,he->h_length); - status=connect(s,(struct sockaddr *)&sin,sizeof(sin)); + status=connect(s,(struct sockaddr *)&sin,sizeof(sin)); if (status<0) {perror("connect");exit(EXIT_FAILURE);} signal(SIGALRM,sigAlarm); From a842a947cc2b5fd586709ce384b0355b83efbf13 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Fri, 18 Mar 2022 15:23:41 +0100 Subject: [PATCH 4/5] send: Build, track and install executable Build with `make send`, add it to the git archive, and install it to `/usr/bin`. --- install.sh | 1 + send/send | Bin 0 -> 35552 bytes 2 files changed, 1 insertion(+) create mode 100755 send/send diff --git a/install.sh b/install.sh index 7cea9c86..a660abd2 100755 --- a/install.sh +++ b/install.sh @@ -244,6 +244,7 @@ install_exec slowio/slowio-mem-control "$DESTDIR$sysconfdir/s install_exec slowio/slowio "$DESTDIR$usr_sbindir/slowio" install_data misc_systemd_units/fix-lpp.service "$DESTDIR$systemdunitdir/fix-lpp.service" install_exec misc_etc_files/mxq/gpu-policy "$DESTIDIR$sysconfdir/mxq/gpu-policy" +install_exec send/send "$DESTDIR$usr_bindir/send" postinstall exit diff --git a/send/send b/send/send new file mode 100755 index 0000000000000000000000000000000000000000..b337babeb5c34a51bedc33dcd802563024120cce GIT binary patch literal 35552 zcmeHw33yz^m2TbcmUL|`wpvmN!fS2}5`Z0cR2tJ8TY+gd_yL|F2us z-D*qoX5Rb0w|t*3=+>!I=bSoq>eQ*_Uf;ek(6!NJ7(!nzu}&~|O|f61oVyUm-Y>HX z*D4BxUsQ=okqe9me|}lQ)PZz*%;gm5)KqkCq~trH%1^lb$T9E7U5JJ9o=&xfOv#tN z{0el^!C6jLr^4&x$(KV=<%QSJ9P)mdjO58g=v33C>hn3}!smAYl|HZZ*J&mnZ6g{S zaeqbgKEbznl#J zukdYCe633y!L3XD63}UvgBCi~eRe7Mq+L|`|18nn)vfiM!Jb0fQ>DsGqH%brclD~q z;c)%%P;_j(e!O*c{pwW>iC9C6teS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s`$H7oDPu9|E((x8D4*tV@Q(e{h4z7Yb}c|7$tF zMnNXO@cSLoCMUVqNm6&sr_(o3lF6_4MfWQHnd;X9e-D7NwElYCeO&STeVWoqv$EpP zK(l^D?hxUw`St!)7m${hPTc@B?36h76H1^jt1!DgB{T4g7DvwYOERUNS=XW&_^;pY z@O?1L;j`2c&UwJpI+&Zh+`)ZFJB}jB=5JN?XWQ@Q-44SCd7zYWX?~q{DE Date: Fri, 18 Mar 2022 15:33:19 +0100 Subject: [PATCH 5/5] send: Make `byteCount` unsigned long Currently, negative benchmark values are shown: @ira$ send okeanos 34141 start : 1647613816.868339 close : 1647613826.868524 done : 1647613826.874427 -1209148824 bytes in 10.006088 seconds -120841314.207910 bytes / seconds -966730513.663282 bits / seconds -966730.513663 kBit/s / seconds -966.730514 MBit/s / seconds With 10 Gbit/s, in 10 s seconds theoretically up to 12.5 GB could be transferred. But a 32-bit (signed) integer can at maximum store the number (2147483648 - 1), and the unsigned integer around 4.3 million, still too small. Therefore, use unsigned long to be able to store the number bytes without overflow for the foreseeable future. Now we have: @ira$ ./send okeanos 34141 start : 1647626064.313421 close : 1647626074.313503 done : 1647626074.317791 10534190976 bytes in 10.004370 seconds 1052958954.536867 bytes / seconds 8423671636.294939 bits / seconds 8423671.636295 kBit/s / seconds 8423.671636 MBit/s / seconds Resolves: https://github.molgen.mpg.de/mariux64/mariux64-issues/issues/23 --- send/send | Bin 35552 -> 35552 bytes send/send.c | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/send/send b/send/send index b337babeb5c34a51bedc33dcd802563024120cce..da1fe50ea76ca26b6e75fbd9406b474f627fb8d6 100755 GIT binary patch delta 1425 zcmb7^T}T{P6vyu!cdMh-8Fh6ig*vg=eECsJKVQmh>y(=&QcPlEg$R;h2q{S$qQuH( zZKfMK47Q86(ma$lg+N+DK|2qz65L%AVhgqyDkQ!cLc$~~G%Ut$Y`4>M#?90;5a__p zoVoX$-~WHk%+A7yurMNw7Ev)*NW3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