Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
d0c58d24
Commit
d0c58d24
authored
Apr 15, 2013
by
Ian Barber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #546 from hintjens/master
Throughput perf test was borked, fixed it
parents
f4a07b39
9df7c70a
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
182 additions
and
642 deletions
+182
-642
zmq.txt
doc/zmq.txt
+2
-2
zmq_bind.txt
doc/zmq_bind.txt
+2
-2
zmq_close.txt
doc/zmq_close.txt
+2
-2
zmq_connect.txt
doc/zmq_connect.txt
+2
-2
zmq_ctx_destroy.txt
doc/zmq_ctx_destroy.txt
+2
-1
zmq_ctx_get.txt
doc/zmq_ctx_get.txt
+2
-1
zmq_ctx_new.txt
doc/zmq_ctx_new.txt
+2
-1
zmq_ctx_set.txt
doc/zmq_ctx_set.txt
+2
-1
zmq_ctx_term.txt
doc/zmq_ctx_term.txt
+2
-1
zmq_disconnect.txt
doc/zmq_disconnect.txt
+2
-2
zmq_errno.txt
doc/zmq_errno.txt
+2
-2
zmq_getsockopt.txt
doc/zmq_getsockopt.txt
+2
-2
zmq_init.txt
doc/zmq_init.txt
+2
-2
zmq_inproc.txt
doc/zmq_inproc.txt
+2
-2
zmq_ipc.txt
doc/zmq_ipc.txt
+2
-6
zmq_msg_close.txt
doc/zmq_msg_close.txt
+2
-2
zmq_msg_copy.txt
doc/zmq_msg_copy.txt
+2
-2
zmq_msg_data.txt
doc/zmq_msg_data.txt
+2
-2
zmq_msg_get.txt
doc/zmq_msg_get.txt
+2
-2
zmq_msg_init.txt
doc/zmq_msg_init.txt
+2
-2
zmq_msg_init_data.txt
doc/zmq_msg_init_data.txt
+2
-2
zmq_msg_init_size.txt
doc/zmq_msg_init_size.txt
+2
-2
zmq_msg_more.txt
doc/zmq_msg_more.txt
+2
-2
zmq_msg_move.txt
doc/zmq_msg_move.txt
+2
-2
zmq_msg_recv.txt
doc/zmq_msg_recv.txt
+2
-3
zmq_msg_send.txt
doc/zmq_msg_send.txt
+2
-3
zmq_msg_set.txt
doc/zmq_msg_set.txt
+2
-1
zmq_msg_size.txt
doc/zmq_msg_size.txt
+2
-2
zmq_pgm.txt
doc/zmq_pgm.txt
+3
-2
zmq_poll.txt
doc/zmq_poll.txt
+2
-2
zmq_proxy.txt
doc/zmq_proxy.txt
+2
-1
zmq_recv.txt
doc/zmq_recv.txt
+2
-3
zmq_recvmsg.txt
doc/zmq_recvmsg.txt
+2
-3
zmq_send.txt
doc/zmq_send.txt
+2
-2
zmq_sendmsg.txt
doc/zmq_sendmsg.txt
+2
-3
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+4
-2
zmq_socket.txt
doc/zmq_socket.txt
+4
-2
zmq_socket_monitor.txt
doc/zmq_socket_monitor.txt
+2
-2
zmq_strerror.txt
doc/zmq_strerror.txt
+3
-2
zmq_tcp.txt
doc/zmq_tcp.txt
+2
-2
zmq_term.txt
doc/zmq_term.txt
+2
-2
zmq_unbind.txt
doc/zmq_unbind.txt
+2
-2
zmq_version.txt
doc/zmq_version.txt
+3
-2
inproc_lat.cpp
perf/inproc_lat.cpp
+1
-3
local_lat.cpp
perf/local_lat.cpp
+1
-3
local_thr.cpp
perf/local_thr.cpp
+46
-237
remote_lat.cpp
perf/remote_lat.cpp
+1
-3
remote_thr.cpp
perf/remote_thr.cpp
+40
-308
No files found.
doc/zmq.txt
View file @
d0c58d24
...
...
@@ -215,8 +215,8 @@ members of the 0MQ community and pointers can be found on the 0MQ website.
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
Martin Lucina <martin@lucina.net>, and Pieter Hintjens <ph@imatix.com
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
RESOURCES
...
...
doc/zmq_bind.txt
View file @
d0c58d24
...
...
@@ -98,5 +98,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_close.txt
View file @
d0c58d24
...
...
@@ -48,5 +48,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_connect.txt
View file @
d0c58d24
...
...
@@ -96,5 +96,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_ctx_destroy.txt
View file @
d0c58d24
...
...
@@ -63,4 +63,5 @@ linkzmq:zmq_setsockopt[3]
AUTHORS
-------
This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_ctx_get.txt
View file @
d0c58d24
...
...
@@ -68,4 +68,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_ctx_new.txt
View file @
d0c58d24
...
...
@@ -46,4 +46,5 @@ linkzmq:zmq_ctx_term[3]
AUTHORS
-------
This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_ctx_set.txt
View file @
d0c58d24
...
...
@@ -83,4 +83,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_ctx_term.txt
View file @
d0c58d24
...
...
@@ -63,4 +63,5 @@ linkzmq:zmq_setsockopt[3]
AUTHORS
-------
This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_disconnect.txt
View file @
d0c58d24
...
...
@@ -63,5 +63,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
Martin Lucina <mato@kotelna.sk> and Ian Barber <ian.barber@gmail.com>
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_errno.txt
View file @
d0c58d24
...
...
@@ -46,5 +46,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_getsockopt.txt
View file @
d0c58d24
...
...
@@ -527,5 +527,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_init.txt
View file @
d0c58d24
...
...
@@ -48,5 +48,5 @@ linkzmq:zmq_term[3]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_inproc.txt
View file @
d0c58d24
...
...
@@ -81,5 +81,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_ipc.txt
View file @
d0c58d24
...
...
@@ -86,9 +86,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_msg_close.txt
View file @
d0c58d24
...
...
@@ -51,5 +51,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_copy.txt
View file @
d0c58d24
...
...
@@ -53,5 +53,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_data.txt
View file @
d0c58d24
...
...
@@ -44,5 +44,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_get.txt
View file @
d0c58d24
...
...
@@ -68,5 +68,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Chuck Remes <cremes@mac.com> and Pieter
Hintjens <ph@imatix.com
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_init.txt
View file @
d0c58d24
...
...
@@ -61,5 +61,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_init_data.txt
View file @
d0c58d24
...
...
@@ -81,5 +81,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_init_size.txt
View file @
d0c58d24
...
...
@@ -54,5 +54,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_more.txt
View file @
d0c58d24
...
...
@@ -61,5 +61,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Chuck Remes <cremes@mac.com> and Pieter
Hintjens <ph@imatix.com
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_move.txt
View file @
d0c58d24
...
...
@@ -48,5 +48,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_msg_recv.txt
View file @
d0c58d24
...
...
@@ -120,6 +120,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This man page was written by Martin Sustrik <sustrik@250bpm.com>, Martin
Lucina <martin@lucina.net>, and Pieter Hintjens <ph@imatix.com>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_msg_send.txt
View file @
d0c58d24
...
...
@@ -117,6 +117,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_msg_set.txt
View file @
d0c58d24
...
...
@@ -42,4 +42,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_msg_size.txt
View file @
d0c58d24
...
...
@@ -44,5 +44,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_pgm.txt
View file @
d0c58d24
...
...
@@ -156,7 +156,8 @@ linkzmq:zmq_ipc[7]
linkzmq:zmq_inproc[7]
linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_poll.txt
View file @
d0c58d24
...
...
@@ -128,5 +128,5 @@ Your operating system documentation for the _poll()_ system call.
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_proxy.txt
View file @
d0c58d24
...
...
@@ -94,4 +94,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Pieter Hintjens <ph@imatix.com>
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_recv.txt
View file @
d0c58d24
...
...
@@ -86,6 +86,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_recvmsg.txt
View file @
d0c58d24
...
...
@@ -117,6 +117,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This man page was written by Martin Sustrik <sustrik@250bpm.com>, Martin
Lucina <martin@lucina.net> and Pieter Hintjens <ph@imatix.com>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_send.txt
View file @
d0c58d24
...
...
@@ -94,5 +94,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_sendmsg.txt
View file @
d0c58d24
...
...
@@ -112,6 +112,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_setsockopt.txt
View file @
d0c58d24
...
...
@@ -555,5 +555,7 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_socket.txt
View file @
d0c58d24
...
...
@@ -367,5 +367,7 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
Martin Lucina <mato@kotelna.sk>, and Pieter Hintjens <ph@imatix.com>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_socket_monitor.txt
View file @
d0c58d24
...
...
@@ -255,5 +255,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Lourens Naudé <lourens@methodmissing.com>
Changes by Guido Goldstein <github@a-nugget.de>
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_strerror.txt
View file @
d0c58d24
...
...
@@ -51,5 +51,6 @@ linkzmq:zmq[7]
AUTHORS
-------
This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk>.
This page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_tcp.txt
View file @
d0c58d24
...
...
@@ -99,5 +99,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Pieter Hintjens <ph@imatix.com>,
Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_term.txt
View file @
d0c58d24
...
...
@@ -62,5 +62,5 @@ linkzmq:zmq_setsockopt[3]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
doc/zmq_unbind.txt
View file @
d0c58d24
...
...
@@ -61,5 +61,5 @@ linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com>,
Martin Lucina <mato@kotelna.sk> and Ian Barber <ian.barber@gmail.com>
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
doc/zmq_version.txt
View file @
d0c58d24
...
...
@@ -47,7 +47,8 @@ SEE ALSO
--------
linkzmq:zmq[7]
AUTHORS
-------
This
0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk
>.
This
page was written by the 0MQ community. To make a change please
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing
>.
perf/inproc_lat.cpp
View file @
d0c58d24
/*
Copyright (c) 2007-2012 iMatix Corporation
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
...
...
perf/local_lat.cpp
View file @
d0c58d24
/*
Copyright (c) 2007-2012 iMatix Corporation
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
...
...
perf/local_thr.cpp
View file @
d0c58d24
/*
Copyright (c) 2007-2012 iMatix Corporation
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
...
...
@@ -23,143 +21,37 @@
#include "../include/zmq_utils.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include "platform.hpp"
#ifndef ZMQ_HAVE_WINDOWS
#include <sys/time.h>
#endif
#define ZMSG 1
#define DATA 0
typedef
struct
US_TIMER
US_TIMER
;
struct
US_TIMER
{
struct
timeval
time_was
;
struct
timeval
time_now
;
};
/* Records the current timer state
*/
void
tm_init
(
US_TIMER
*
t
){
#if defined ZMQ_HAVE_WINDOWS
// Get the high resolution counter's accuracy.
LARGE_INTEGER
ticksPerSecond
;
QueryPerformanceFrequency
(
&
ticksPerSecond
);
// What time is it?
LARGE_INTEGER
tick
;
if
(
!
QueryPerformanceCounter
(
&
tick
)
)
{
perror
(
"tm_init()"
);
}
// Seconds
t
->
time_now
.
tv_sec
=
(
long
)(
tick
.
QuadPart
/
ticksPerSecond
.
QuadPart
);
// Microseconds
t
->
time_now
.
tv_usec
=
(
long
)(
(
tick
.
QuadPart
-
t
->
time_now
.
tv_sec
*
ticksPerSecond
.
QuadPart
)
*
1000000
/
ticksPerSecond
.
QuadPart
);
#else
if
(
gettimeofday
(
&
t
->
time_now
,
NULL
)
<
0
){
perror
(
"tm_init()"
);}
#endif
t
->
time_was
=
t
->
time_now
;
}
/* Returns the time passed in microsecond precision in seconds since last init
of timer.
*/
float
tm_secs
(
US_TIMER
*
t
){
register
float
seconds
;
#if defined ZMQ_HAVE_WINDOWS
// Get the high resolution counter's accuracy.
LARGE_INTEGER
ticksPerSecond
;
QueryPerformanceFrequency
(
&
ticksPerSecond
);
// What time is it?
LARGE_INTEGER
tick
;
if
(
!
QueryPerformanceCounter
(
&
tick
)
)
{
perror
(
"tm_secs()"
);
}
// Seconds
t
->
time_now
.
tv_sec
=
(
long
)(
tick
.
QuadPart
/
ticksPerSecond
.
QuadPart
);
// Microseconds
t
->
time_now
.
tv_usec
=
(
long
)(
(
tick
.
QuadPart
-
t
->
time_now
.
tv_sec
*
ticksPerSecond
.
QuadPart
)
*
1000000
/
ticksPerSecond
.
QuadPart
);
#else
if
(
gettimeofday
(
&
t
->
time_now
,
NULL
)
<
0
){
perror
(
"tm_secs()"
);}
#endif
seconds
=
(
((
float
)(
t
->
time_now
.
tv_sec
-
t
->
time_was
.
tv_sec
))
+
(((
float
)(
t
->
time_now
.
tv_usec
-
t
->
time_was
.
tv_usec
))
/
1000000.0
));
t
->
time_was
=
t
->
time_now
;
return
(
seconds
);
}
const
char
*
bind_to
;
int
message_count
=
1000
;
int
message_size
=
1024
;
int
threads
=
1
;
int
workers
=
1
;
int
sndbuflen
=
128
*
256
;
int
rcvbuflen
=
128
*
256
;
int
flow
=
ZMQ_PULL
;
int
rec
=
DATA
;
void
my_free
(
void
*
data
,
void
*
hint
)
{
// free (data);
}
int
main
(
int
argc
,
char
*
argv
[])
{
US_TIMER
timer
;
const
char
*
bind_to
;
int
message_count
;
size_t
message_size
;
void
*
ctx
;
void
*
s
;
int
rc
;
int
i
;
void
*
buf
=
NULL
;
if
(
argc
!=
9
)
{
printf
(
"usage: local_thr <bind-to> <message-size> <message-count> <SND buffer> <RCV buffer> <flow (PUSH/PULL)> <rec (ZMSG/DATA)> <zmq-threads>
\n
"
);
zmq_msg_t
msg
;
void
*
watch
;
unsigned
long
elapsed
;
unsigned
long
throughput
;
double
megabits
;
if
(
argc
!=
4
)
{
printf
(
"usage: local_thr <bind-to> <message-size> <message-count>
\n
"
);
return
1
;
}
bind_to
=
argv
[
1
];
message_size
=
atoi
(
argv
[
2
]);
message_count
=
atoi
(
argv
[
3
]);
sndbuflen
=
atoi
(
argv
[
4
]);
rcvbuflen
=
atoi
(
argv
[
5
]);
if
(
!
strcmp
(
argv
[
6
],
"PUSH"
)){
flow
=
ZMQ_PUSH
;
}
if
(
!
strcmp
(
argv
[
6
],
"PULL"
)){
flow
=
ZMQ_PULL
;
}
if
(
!
strcmp
(
argv
[
7
],
"ZMSG"
)){
rec
=
ZMSG
;
}
if
(
!
strcmp
(
argv
[
7
],
"DATA"
)){
rec
=
DATA
;
}
threads
=
atoi
(
argv
[
8
]);
if
(
!
(
buf
=
malloc
(
message_size
))){
perror
(
"malloc"
);
return
-
1
;}
ctx
=
zmq_
ctx_new
(
);
ctx
=
zmq_
init
(
1
);
if
(
!
ctx
)
{
printf
(
"error in zmq_ctx_new: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
rc
=
zmq_ctx_set
(
ctx
,
ZMQ_IO_THREADS
,
threads
);
if
(
rc
)
{
printf
(
"error in zmq_ctx_set: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_init: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
s
=
zmq_socket
(
ctx
,
flow
);
s
=
zmq_socket
(
ctx
,
ZMQ_PULL
);
if
(
!
s
)
{
printf
(
"error in zmq_socket: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
...
...
@@ -168,141 +60,60 @@ int main (int argc, char *argv [])
// Add your socket options here.
// For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.
size_t
rcvbuflenlen
=
(
size_t
)
sizeof
rcvbuflen
;
size_t
sndbuflenlen
=
(
size_t
)
sizeof
sndbuflen
;
rc
=
zmq_setsockopt
(
s
,
ZMQ_RCVBUF
,
&
rcvbuflen
,
rcvbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
rc
=
zmq_setsockopt
(
s
,
ZMQ_SNDBUF
,
&
sndbuflen
,
sndbuflenlen
);
rc
=
zmq_bind
(
s
,
bind_to
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_
setsockopt
: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_
bind
: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
sndbuflen
=
1
;
rc
=
zmq_setsockopt
(
s
,
ZMQ_DELAY_ATTACH_ON_CONNECT
,
&
sndbuflen
,
sndbuflenlen
);
rc
=
zmq_msg_init
(
&
msg
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_
setsockop
t: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_
msg_ini
t: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
sndbuflen
=
2
;
rc
=
zmq_setsockopt
(
s
,
ZMQ_SNDHWM
,
&
sndbuflen
,
sndbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
rc
=
zmq_recvmsg
(
s
,
&
msg
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_recvmsg: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
sndbuflen
=
2
;
rc
=
zmq_setsockopt
(
s
,
ZMQ_RCVHWM
,
&
sndbuflen
,
sndbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
if
(
zmq_msg_size
(
&
msg
)
!=
message_size
)
{
printf
(
"message of incorrect size received
\n
"
);
return
-
1
;
}
watch
=
zmq_stopwatch_start
();
rc
=
zmq_getsockopt
(
s
,
ZMQ_RCVBUF
,
&
rcvbuflen
,
&
rcvbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_getsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
rc
=
zmq_getsockopt
(
s
,
ZMQ_SNDBUF
,
&
sndbuflen
,
&
sndbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_getsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
printf
(
"RCVBUF=%d KB SNDBUF=%d KB adjusted
\n
"
,
rcvbuflen
/
1024
,
sndbuflen
/
1024
);
printf
(
"Threads: %d
\n
"
,
zmq_ctx_get
(
ctx
,
ZMQ_IO_THREADS
));
rc
=
zmq_bind
(
s
,
bind_to
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_bind: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
if
(
!
(
buf
=
malloc
(
message_size
))){
perror
(
"malloc"
);
return
-
1
;}
printf
(
"%sING %s...
\n
"
,
flow
==
ZMQ_PUSH
?
"PUSH"
:
"PULL"
,
rec
?
"ZMQ_MSG"
:
"DATA"
);
tm_init
(
&
timer
);
if
(
flow
==
ZMQ_PULL
){
if
(
rec
==
ZMSG
){
zmq_msg_t
msg
;
rc
=
zmq_msg_init
(
&
msg
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_msg_init: %s
\n
"
,
zmq_strerror
(
errno
));
for
(
i
=
0
;
i
!=
message_count
-
1
;
i
++
)
{
rc
=
zmq_recvmsg
(
s
,
&
msg
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_recvmsg: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
for
(
i
=
0
;
i
!=
message_count
;
i
++
)
{
rc
=
zmq_msg_recv
(
&
msg
,
s
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_recv: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
}
rc
=
zmq_msg_close
(
&
msg
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_msg_close: %s
\n
"
,
zmq_strerror
(
errno
));
if
(
zmq_msg_size
(
&
msg
)
!=
message_size
)
{
printf
(
"message of incorrect size received
\n
"
);
return
-
1
;
}}
else
{
for
(
i
=
0
;
i
!=
message_count
;
i
++
)
{
rc
=
zmq_recv
(
s
,
buf
,
message_size
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_recv: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
}}
}
}
else
{
if
(
rec
==
ZMSG
){
zmq_msg_t
msg
;
for
(
i
=
0
;
i
!=
message_count
;
i
++
)
{
rc
=
zmq_msg_init_data
(
&
msg
,
buf
,
message_size
,
NULL
,
NULL
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_msg_init_data: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
elapsed
=
zmq_stopwatch_stop
(
watch
);
if
(
elapsed
==
0
)
elapsed
=
1
;
rc
=
zmq_msg_send
(
&
msg
,
s
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_send: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
}}
else
{
for
(
i
=
0
;
i
!=
message_count
;
i
++
){
rc
=
zmq_send
(
s
,
buf
,
message_size
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_send: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
}}
rc
=
zmq_msg_close
(
&
msg
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_msg_close: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
float
secs
=
tm_secs
(
&
timer
);
float
total
=
(((
float
)
message_count
)
*
((
float
)
message_size
))
/
(
1024.0
*
1024.0
*
1024.0
);
printf
(
"Message size: %d KBytes, time: %f secs
\n
"
,
(
int
)
message_size
/
1024
,
secs
);
printf
(
"%sed %.3f GB @ %.3f GB/s
\n
"
,
(
flow
==
ZMQ_PULL
)
?
"Pull"
:
"Push"
,
total
,
total
/
secs
);
throughput
=
(
unsigned
long
)
((
double
)
message_count
/
(
double
)
elapsed
*
1000000
);
megabits
=
(
double
)
(
throughput
*
message_size
*
8
)
/
1000000
;
printf
(
"message size: %d [B]
\n
"
,
(
int
)
message_size
);
printf
(
"message count: %d
\n
"
,
(
int
)
message_count
);
printf
(
"mean throughput: %d [msg/s]
\n
"
,
(
int
)
throughput
);
printf
(
"mean throughput: %.3f [Mb/s]
\n
"
,
(
double
)
megabits
);
rc
=
zmq_close
(
s
);
if
(
rc
!=
0
)
{
...
...
@@ -316,7 +127,5 @@ int main (int argc, char *argv [])
return
-
1
;
}
if
(
buf
)
free
(
buf
);
return
0
;
}
perf/remote_lat.cpp
View file @
d0c58d24
/*
Copyright (c) 2007-2012 iMatix Corporation
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
...
...
perf/remote_thr.cpp
View file @
d0c58d24
/*
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2007-2009 iMatix Corporation
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
...
...
@@ -24,337 +22,72 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include "platform.hpp"
#if defined ZMQ_HAVE_WINDOWS
#include <windows.h>
#include <process.h>
#else
#include <unistd.h>
#include <sys/time.h>
#include <pthread.h>
#endif
#define ZMSG 1
#define DATA 0
const
char
*
connect_to
;
int
message_count
=
1000
;
int
message_size
=
1024
;
int
threads
=
1
;
int
workers
=
1
;
int
sndbuflen
=
128
*
256
;
int
rcvbuflen
=
128
*
256
;
int
flow
=
ZMQ_PUSH
;
int
rec
=
DATA
;
typedef
struct
US_TIMER
US_TIMER
;
struct
US_TIMER
{
struct
timeval
time_was
;
struct
timeval
time_now
;
};
/* Records the current timer state
*/
void
tm_init
(
US_TIMER
*
t
){
#if defined ZMQ_HAVE_WINDOWS
// Get the high resolution counter's accuracy.
LARGE_INTEGER
ticksPerSecond
;
QueryPerformanceFrequency
(
&
ticksPerSecond
);
// What time is it?
LARGE_INTEGER
tick
;
if
(
!
QueryPerformanceCounter
(
&
tick
)
)
{
perror
(
"tm_init()"
);
}
// Seconds
t
->
time_now
.
tv_sec
=
(
long
)(
tick
.
QuadPart
/
ticksPerSecond
.
QuadPart
);
// Microseconds
t
->
time_now
.
tv_usec
=
(
long
)(
(
tick
.
QuadPart
-
t
->
time_now
.
tv_sec
*
ticksPerSecond
.
QuadPart
)
*
1000000
/
ticksPerSecond
.
QuadPart
);
#else
if
(
gettimeofday
(
&
t
->
time_now
,
NULL
)
<
0
){
perror
(
"tm_init()"
);}
#endif
t
->
time_was
=
t
->
time_now
;
}
/* Returns the time passed in microsecond precision in seconds since last init
of timer.
*/
float
tm_secs
(
US_TIMER
*
t
){
register
float
seconds
;
#if defined ZMQ_HAVE_WINDOWS
// Get the high resolution counter's accuracy.
LARGE_INTEGER
ticksPerSecond
;
QueryPerformanceFrequency
(
&
ticksPerSecond
);
// What time is it?
LARGE_INTEGER
tick
;
if
(
!
QueryPerformanceCounter
(
&
tick
)
)
{
perror
(
"tm_secs()"
);
}
// Seconds
t
->
time_now
.
tv_sec
=
(
long
)(
tick
.
QuadPart
/
ticksPerSecond
.
QuadPart
);
// Microseconds
t
->
time_now
.
tv_usec
=
(
long
)(
(
tick
.
QuadPart
-
t
->
time_now
.
tv_sec
*
ticksPerSecond
.
QuadPart
)
*
1000000
/
ticksPerSecond
.
QuadPart
);
#else
if
(
gettimeofday
(
&
t
->
time_now
,
NULL
)
<
0
){
perror
(
"tm_secs()"
);}
#endif
seconds
=
(
((
float
)(
t
->
time_now
.
tv_sec
-
t
->
time_was
.
tv_sec
))
+
(((
float
)(
t
->
time_now
.
tv_usec
-
t
->
time_was
.
tv_usec
))
/
1000000.0
));
t
->
time_was
=
t
->
time_now
;
return
seconds
;
}
void
my_free
(
void
*
data
,
void
*
hint
)
{
//free (data);
}
#if defined ZMQ_HAVE_WINDOWS
static
unsigned
int
__stdcall
worker_routine
(
void
*
ctx
)
#else
static
void
*
worker_routine
(
void
*
ctx
)
#endif
int
main
(
int
argc
,
char
*
argv
[])
{
int
rc
,
i
;
void
*
buf
=
NULL
;
const
char
*
connect_to
;
int
message_count
;
int
message_size
;
void
*
ctx
;
void
*
s
;
int
rc
;
int
i
;
zmq_msg_t
msg
;
if
(
!
(
buf
=
malloc
(
message_size
))){
perror
(
"malloc"
);
return
0
;}
if
(
argc
!=
4
)
{
printf
(
"usage: remote_thr <connect-to> <message-size> "
"<message-count>
\n
"
);
return
1
;
}
connect_to
=
argv
[
1
];
message_size
=
atoi
(
argv
[
2
]);
message_count
=
atoi
(
argv
[
3
]);
void
*
s
=
zmq_socket
(
ctx
,
flow
);
ctx
=
zmq_init
(
1
);
if
(
!
ctx
)
{
printf
(
"error in zmq_init: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
s
=
zmq_socket
(
ctx
,
ZMQ_PUSH
);
if
(
!
s
)
{
printf
(
"error in zmq_socket: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
return
-
1
;
}
// Add your socket options here.
// For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.
size_t
rcvbuflenlen
=
(
size_t
)
sizeof
rcvbuflen
;
size_t
sndbuflenlen
=
(
size_t
)
sizeof
sndbuflen
;
rc
=
zmq_setsockopt
(
s
,
ZMQ_RCVBUF
,
&
rcvbuflen
,
rcvbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
rc
=
zmq_setsockopt
(
s
,
ZMQ_SNDBUF
,
&
sndbuflen
,
sndbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
sndbuflen
=
1
;
rc
=
zmq_setsockopt
(
s
,
ZMQ_DELAY_ATTACH_ON_CONNECT
,
&
sndbuflen
,
sndbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
sndbuflen
=
2
;
rc
=
zmq_setsockopt
(
s
,
ZMQ_SNDHWM
,
&
sndbuflen
,
sndbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
sndbuflen
=
2
;
rc
=
zmq_setsockopt
(
s
,
ZMQ_RCVHWM
,
&
sndbuflen
,
sndbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
rc
=
zmq_getsockopt
(
s
,
ZMQ_RCVBUF
,
&
rcvbuflen
,
&
rcvbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_getsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
rc
=
zmq_getsockopt
(
s
,
ZMQ_SNDBUF
,
&
sndbuflen
,
&
sndbuflenlen
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_getsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
printf
(
"RCVBUF=%d KB SNDBUF=%d KB adjusted
\n
"
,
rcvbuflen
/
1024
,
sndbuflen
/
1024
);
rc
=
zmq_connect
(
s
,
connect_to
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_connect: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
printf
(
"%sING %s...
\n
"
,
flow
==
ZMQ_PUSH
?
"PUSH"
:
"PULL"
,
rec
?
"ZMQ_MSG"
:
"DATA"
);
if
(
flow
==
ZMQ_PUSH
){
if
(
rec
==
ZMSG
){
zmq_msg_t
msg
;
for
(
i
=
0
;
i
!=
message_count
;
i
++
)
{
rc
=
zmq_msg_init_data
(
&
msg
,
buf
,
message_size
,
NULL
,
NULL
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_msg_init_data: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
rc
=
zmq_msg_send
(
&
msg
,
s
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_send: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
rc
=
zmq_msg_close
(
&
msg
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_msg_close: %s
\n
"
,
zmq_strerror
(
errno
));
exit
(
1
);
}
}}
else
{
for
(
i
=
0
;
i
!=
message_count
;
i
++
)
{
rc
=
zmq_send
(
s
,
buf
,
message_size
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_send: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
}}
return
-
1
;
}
else
{
if
(
rec
==
ZMSG
){
zmq_msg_t
msg
;
rc
=
zmq_msg_init
(
&
msg
);
for
(
i
=
0
;
i
!=
message_count
;
i
++
)
{
rc
=
zmq_msg_init_size
(
&
msg
,
message_size
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_msg_init: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
printf
(
"error in zmq_msg_init_size: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
rc
=
zmq_sendmsg
(
s
,
&
msg
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_sendmsg: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
rc
=
zmq_msg_close
(
&
msg
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_msg_close: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
for
(
i
=
0
;
i
!=
message_count
;
i
++
)
{
rc
=
zmq_msg_recv
(
&
msg
,
s
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_recv: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
}}
else
{
for
(
i
=
0
;
i
!=
message_count
;
i
++
)
{
rc
=
zmq_recv
(
s
,
buf
,
message_size
,
0
);
if
(
rc
<
0
)
{
printf
(
"error in zmq_recv: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
}}
}
rc
=
zmq_close
(
s
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_close: %s
\n
"
,
zmq_strerror
(
errno
));
return
0
;
}
free
(
buf
);
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
void
*
ctx
;
int
rc
;
int
i
;
if
(
argc
!=
10
)
{
printf
(
"usage: remote_thr <connect-to> <message-size> <message-count> <SND buffer> <RCV buffer> <flow (PUSH/PULL)> <records (ZMSG/DATA)> <zmq-threads> <workers>
\n
"
);
return
1
;
}
connect_to
=
argv
[
1
];
message_size
=
atoi
(
argv
[
2
]);
message_count
=
atoi
(
argv
[
3
]);
sndbuflen
=
atoi
(
argv
[
4
]);
rcvbuflen
=
atoi
(
argv
[
5
]);
if
(
!
strcmp
(
argv
[
6
],
"PUSH"
)){
flow
=
ZMQ_PUSH
;
}
if
(
!
strcmp
(
argv
[
6
],
"PULL"
)){
flow
=
ZMQ_PULL
;
}
if
(
!
strcmp
(
argv
[
7
],
"ZMSG"
)){
rec
=
ZMSG
;
}
if
(
!
strcmp
(
argv
[
7
],
"DATA"
)){
rec
=
DATA
;
}
threads
=
atoi
(
argv
[
8
]);
workers
=
atoi
(
argv
[
9
]);
ctx
=
zmq_ctx_new
();
if
(
!
ctx
)
{
printf
(
"error in zmq_ctx_new: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
rc
=
zmq_ctx_set
(
ctx
,
ZMQ_IO_THREADS
,
threads
);
if
(
rc
)
{
printf
(
"error in zmq_ctx_set: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
printf
(
"Threads: %d, workers %d
\n
"
,
zmq_ctx_get
(
ctx
,
ZMQ_IO_THREADS
),
workers
);
#if defined ZMQ_HAVE_WINDOWS
HANDLE
worker
[
128
];
#else
pthread_t
worker
[
128
];
#endif
US_TIMER
timer
;
tm_init
(
&
timer
);
for
(
i
=
0
;
i
<
workers
;
i
++
)
{
#if defined ZMQ_HAVE_WINDOWS
worker
[
i
]
=
(
HANDLE
)
_beginthreadex
(
NULL
,
0
,
worker_routine
,
ctx
,
0
,
NULL
);
#else
pthread_create
(
&
worker
[
i
],
NULL
,
worker_routine
,
ctx
);
#endif
printf
(
"Worker %d spawned
\n
"
,
i
);
}
for
(
i
=
0
;
i
<
workers
;
i
++
)
{
#if defined ZMQ_HAVE_WINDOWS
WaitForSingleObject
(
worker
[
i
],
INFINITE
);
CloseHandle
(
worker
[
i
]);
#else
pthread_join
(
worker
[
i
],
NULL
);
#endif
printf
(
"Worker %d joined
\n
"
,
i
);
}
float
secs
=
tm_secs
(
&
timer
);
float
total
=
(
(
float
)
workers
)
*
(((
float
)
message_count
)
*
((
float
)
message_size
))
/
(
1024.0
*
1024.0
*
1024.0
);
printf
(
"Message: size: %d KBytes, count: %d/workers(%d), time: %f secs
\n
"
,
(
int
)
message_size
/
1024
,
message_count
,
workers
,
secs
);
printf
(
"%sed %.3f GB @ %.3f GB/s
\n
"
,
(
flow
==
ZMQ_PULL
)
?
"Pull"
:
"Push"
,
total
,
total
/
secs
);
rc
=
zmq_term
(
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_term: %s
\n
"
,
zmq_strerror
(
errno
));
...
...
@@ -363,4 +96,3 @@ int main (int argc, char *argv [])
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment