From 1afbcc6fa34335e77e089ddc5d67d069d3189ea7 Mon Sep 17 00:00:00 2001 From: bustico Date: Tue, 8 Apr 2008 14:42:23 +0000 Subject: * fix a bug with the behavior of send system call in non blocking mode in some rare case * simplify ivythroutput and his fileset --- doc/NEWS | 79 ++++++++++++++++++++++++ doc/ivy-c-functions.1 | 168 +++++++++++++++++++++++++------------------------- doc/ivy-c.1 | 147 ++++++++++++++++++++++--------------------- doc/ivyprobe.1 | 80 ++++++++++++------------ 4 files changed, 276 insertions(+), 198 deletions(-) (limited to 'doc') diff --git a/doc/NEWS b/doc/NEWS index e69de29..bbd6dd4 100644 --- a/doc/NEWS +++ b/doc/NEWS @@ -0,0 +1,79 @@ +What's new in 3.11 release ? + +1. Overview +Firstly, all changes are internal, no api change. Changes are only some fixes, several speed optimizations for agent sending lot of messages, socket mode set to 'non blocking', and a perfmeter tool. +2.Non blocking mode for sending messages +Ivy library used to send messages with socket in standard blocking mode. There is numerous problems doing this : +1.all agents on a bus are blocked by the slowest one, so just one slow agent can block all others. +2.When establishing connexion, if two agents have to exchange lot of regexps, a deadlock will occurs in non blocking mode. +3.In non blocking mode, if an agent is not consuming messages as fast as you sent it to him, local ivy library behavior consists in buffering the messages in a fifo until the fifo is considered to big, after that, new messages will be lost and be sent until slow client consumes all his buffered messages. + +3. Speed optimizations +There is two kind of optimization in 3.11 version : +1.using smarter data structure : “hashtable of lists” instead of “lists of lists” +2.using multiprocess/multicore power, parallelizing the most cpu intensive task of ivy library : regexps filtering is now done concurrent, thanks to openmp api. Since openmp is not available on all compilers, the generation of omp version of the lib is optional, and is done with make omp at src level. This will generate omp version of static and dynamic lib, omp version of ivyprobe and ivythroughput. Ompenmp generation as been successfully tested only on linux intel with gcc 4.2 and up, and with intel icc. +3.On a quad proc box, speedup is between 3 and 10 using ivyomp3.11 vs ivy3.9 + +4. behavior changes between 3.9 en 3.11 + +Openmp version of the lib should have exactly same behavior than classic one, but switching the behavior of socket sending to non blocking and local buffering brings new type of events that could be sent to main application : the C type IvyApplicationEvent which was already existing with “IvyApplicationConnected, IvyApplicationDisconnected”, hash been augmented with +“IvyApplicationCongestion, IvyApplicationDecongestion, IvyApplicationFifoFull” +there meanings are : +IvyApplicationCongestion : distant agent is two slow, and message are locally buffered +IvyApplicationDecongestion : distant agent behavior become normal again +IvyApplicationFifoFull : distant agent is still two slow, and fifo has reach maximum size, subsequent messages sent to this agent will be lost. + + +example : +main (int argc, char **argv) +{ +. + IvyInit ("IvyThroughputEmit", "IvyThroughputEmit Ready", congestCB, NULL,NULL,NULL); +. +} + +. +. + +void congestCB ( IvyClientPtr app, void *user_data, IvyApplicationEvent event ) +{ + string appName = IvyGetApplicationName( app ); + + switch ( event ) { + case IvyApplicationCongestion: + printf("Application:%s : Congestion\n", appName.c_str()); + break; + case IvyApplicationDecongestion: + printf("Application:%s : DEcongestion\n", appName.c_str()); + break; + case IvyApplicationFifoFull: + printf("Application:%s : FIFO PLEINE, MESSAGES PERDUS !!!\n", appName.c_str()); + break; + case IvyApplicationConnected: + // printf("Application:%s : Connected\n", appName.c_str()); + case IvyApplicationDisconnected: + // printf("Application:%s : Disconnected\n", appName.c_str()); + break; + } +} + +5.a new tool for measuring performance : ivythroughput + ./ivythroughput_omp -v -t tp -R 500 -M 5000 -n4-d 60 + +this will initiate a bench : 10 clients are created, they will bind 500 regexps of the file testivy/regexp.txt, then the emitter process will periodically send 5000 messages of the file + testivy/messages.ivy, and this will be displayed : +[ivy 3.11] envoyer [34124/5000] messages filtres par 500 regexps a 4 clients prends 0.4 seconde + +possibles options are : +usage: ivythroughput_omp [options] + -b bus defines the Ivy bus to which to connect to, defaults to 127:2010 + -v prints the ivy release number + -t type of test : ml or ml2 (memory leak) or tp (throughput) + -r regexfile read list of regexp's from file + -p each client will prepends regexp with uniq string to simulate N clients with different regexps + -m messageFile read list of messages from file + -R restrict to R firsts regexps instead of all the regexp in the regexp file + -M restrict to M firsts messages instead of all the message in the message file + -n number of clients + -d duration of the test in seconds + diff --git a/doc/ivy-c-functions.1 b/doc/ivy-c-functions.1 index d54bb77..1c58f0c 100644 --- a/doc/ivy-c-functions.1 +++ b/doc/ivy-c-functions.1 @@ -1,50 +1,50 @@ -'\" -'\" Ivy, C interface \- library managing connexions to a software bus -'\" -'\" Copyright (C) 1997-2006 -'\" Centre d'tudes de la Navigation Arienne -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" -'\" # Start an argument description -.de AP -.ie !"\\$4"" .TP \\$4 -.el \{\ -. ie !"\\$2"" .TP \\n()Cu -. el .TP 15 -.\} -.ie !"\\$3"" \{\ -.ta \\n()Au \\n()Bu -\&\\$1 \\fI\\$2\\fP (\\$3) -.\".b -.\} -.el \{\ -.br -.ie !"\\$2"" \{\ -\&\\$1 \\fI\\$2\\fP -.\} -.el \{\ -\&\\fI\\$1\\fP -.\} -.\} -.. -'\" # define tabbing values for .AP -.de AS -.nr )A 10n -.if !"\\$1"" .nr )A \\w'\\$1'u+3n -.nr )B \\n()Au+15n -.\" -.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n -.nr )C \\n()Bu+\\w'(in/out)'u+2n -.. -'\" # BS - start boxed text -'\" # ^y = starting y location -'\" # ^b = 1 -.TH Ivy-c-3.9 1 3.9 "Ivy-c-3.9 Library Functions" -.SH NAME -IvyInit, IvyStart, IvyStop, IvyBindMsg, IvyUnbindMsg, IvyBindDirectMsg, +.\" '\" +.\" '\" Ivy, C interface \- library managing connexions to a software bus +.\" '\" +.\" '\" Copyright (C) 1997-2006 +.\" +.\" '\" +.\" '\" See the file "license.terms" for information on usage and redistribution +.\" '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +.\" '\" +.\" '\" +.\" '\" # Start an argument description +.\" .de AP +.\" .ie !"\\$4"" .TP \\$4 +.\" .el \{\ +.\" . ie !"\\$2"" .TP \\n()Cu +.\" . el .TP 15 +.\" .\} +.\" .ie !"\\$3"" \{\ +.\" .ta \\n()Au \\n()Bu +.\" \&\\$1 \\fI\\$2\\fP (\\$3) +.\" +.\" .\} +.\" .el \{\ +.\" .br +.\" .ie !"\\$2"" \{\ +.\" \&\\$1 \\fI\\$2\\fP +.\" .\} +.\" .el \{\ +.\" \&\\fI\\$1\\fP +.\" .\} +.\" .\} +.\" .. +.\" '\" # define tabbing values for .AP +.\" .de AS +.\" .nr )A 10n +.\" .if !"\\$1"" .nr )A \\w'\\$1'u+3n +.\" .nr )B \\n()Au+15n +.\" +.\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n +.\" .nr )C \\n()Bu+\\w'(in/out)'u+2n +.\" .. +.\" '\" # BS - start boxed text +.\" '\" # ^y = starting y location +.\" '\" # ^b = 1 +.TH "Ivy-c-3.11" "1" "3.11" "Francois-Regis Colin, Stephane Chatty" "library" +.SH "NAME" +IvyInit, IvyStart, IvyStop, IvyBindMsg, IvyChangeMsg, IvyUnbindMsg, IvyBindDirectMsg, IvySendMsg, IvySendDirectMsg, IvySendDieMsg, IvySendError, IvyGetApplicationName, IvyGetApplicationHost, IvyGetApplication, IvyGetApplicationList, IvyGetApplicationMessages, IvyDefaultApplicationCallback, IvySetFilter, IvySetBindCallback, @@ -52,11 +52,12 @@ IvyChannelInit, IvyChannelStop, IvyChannelAdd, IvyChannelRemove, IvyMainLoop, IvyChannelDelete, IvyChannelHandleRead, IvyChannelHandleExcpt, IvySetBeforeSelectHook, IvySetAfterSelectHook, IvyXtChannelAppContext, -.SH SYNOPSIS +.SH "SYNOPSIS" useful set of library functions for communicating between different processes through a software bus -.nf +.nf .sp +void \fBIvyInit(\fIAppName, ready, callback, data, die_callback, die_data\fB)\fR .sp void @@ -126,9 +127,9 @@ static void .sp void \fBIvyXtChannelAppContext(\fIcntx\fB)\fR -.SH ARGUMENTS +.SH "ARGUMENTS" Only main functions are detailed in this section -.SH +.SH "" \fBIvyInit\fR: Initialisation of a connection .sp @@ -145,30 +146,30 @@ user data last change callback before die .AP void *die_data in user data -.SH Example: -\fBIvyInit ("PLN-SERVER", "PLN-READY", NULL, NULL, NULL);\fR -.SH +.SH "Example:" +\fBIvyInit ("PLN\-SERVER", "PLN\-READY", NULL, NULL, NULL);\fR +.SH "" \fBIvyStart\fR: Initialisation of TCP/UPD port and sending of a broadcast handshake on every network .AP const_char *bus in Bus to be used (format : network list followed by broadcast port). -.SH Example: +.SH "Example:" the given bus can be a string like 123.231,123.123:2000 or 123.231 or :2000. If no argument is specified, then the environment variable \fBIVYBUS\fR is checked, else the default value : 127.255.255.255:2010 is used (broadcast on the local machine). -.nf +.nf \fBIvyStart ("143.196.53.255:2001");\fR -.SH +.SH "" \fBIvyBindMsg\fR: Message binding .AP MsgCallback callback in .AP void *user_data in .AP const_char *regexp in .AP MsgRcvPtr id out -.SH Example: +.SH "Example:" \fBIvyBindMsg (StartTimeCallback, 0, "^CLOCK Start time=(.*)");\fR -.nf +.nf In this example the function \fBStartTimeCallback\fR will be called each time the string \fBCLOCK Start time=(.*)\fR will be emitted on the bus. @@ -176,34 +177,34 @@ There is a special syntax for specifying numeric interval, in this case the interval is locally transformed in a pcre regexp. syntax is \fB(?Imin#max[fi])\fR. min and max are the bounds, by default the regexp match decimal number, but if max bound is -followed by 'i', the regexp match only integers ex : \fB(?I-10#20), (?I20#25i)\fR +followed by 'i', the regexp match only integers ex : \fB(?I\-10#20), (?I20#25i)\fR Note that due to the regexp generator limitation (which will perhaps be raised eventually) the bounds are always integers. -.SH +.SH "" \fBIvyUnbindMsg\fR: Message unbinding .AP MsgRcvPtr id in ident of the message to unbind -.SH +.SH "" \fBIvySendMsg\fR: Sending a message .AP const_char* fmt in String to be sent on the bus -.SH Example: -\fBIvySendMsg ("SECTOR:%s.AIRCRAFT:%s Entered", sectorname, pln->indicatif);\fR -.SH +.SH "Example:" +\fBIvySendMsg ("SECTOR:%s.AIRCRAFT:%s Entered", sectorname, pln\->indicatif);\fR +.SH "" \fBIvyChannelAdd\fR: .AP HANDLE fd in .AP void *data in .AP ChannelHandleDelete handle_delete in .AP ChannelHandleRead handle_read in .AP Channel out out -.SH Example: +.SH "Example:" \fBIvyChannelAdd (0, NULL, NULL, HandleStdin);\fR: .VE -.BE -.SH DESCRIPTION -.PP +.B E +.SH "DESCRIPTION" +.PP These functions provide facilities for connecting applications on a software bus and managing messages exchanges among them. Each time an application initializes a connection on the bus, a @@ -211,9 +212,9 @@ Each time an application initializes a connection on the bus, a list of the messages subscribed by this application is dispatched. The format for the messages is free. -.SH EXAMPLE +.SH "EXAMPLE" Connection of the application \fBIVYPROBE\fR on a given bus -.nf +.nf .DS @@ -241,28 +242,27 @@ Connection of the application \fBIVYPROBE\fR on a given bus }; .DE -.SH FILES +.SH "FILES" .I /usr/include/ivy.h -.nf +.nf .I /usr/include/ivyloop.h -.nf +.nf .I /usr/include/ivysocket.h -.SH ENVIRONMENT +.SH "ENVIRONMENT" .I IVYBUS -.nf -.I IVYDOMAINS -.SH DIAGNOSTICS +.nf +.SH "DIAGNOSTICS" error messages displayed -.SH BUGS +.SH "BUGS" none reported yet! -.SH AUTHORS -Francois-Regis Colin +.SH "AUTHORS" +Francois\-Regis Colin Stephane Chatty -.SH SEE ALSO +.SH "SEE ALSO" ivyprobe (1) .sp -For further details, please refer to the Ivy html page at http://www.tls.cena.fr/pii/produits/Ivy.html -.SH NOTES +For further details, please refer to the Ivy html page at http://www.tls.cena.fr/products/ivy/ +.SH "NOTES" In case of any comment or bug report on this library, please contact ivy@tls.cena.fr diff --git a/doc/ivy-c.1 b/doc/ivy-c.1 index c67e96e..db9bb86 100644 --- a/doc/ivy-c.1 +++ b/doc/ivy-c.1 @@ -1,96 +1,95 @@ -'\" -'\" Ivy, C interface \- library managing connexions to a software bus -'\" -'\" Copyright (C) 1997-1999 -'\" Centre d'tudes de la Navigation Arienne -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" -'\" # Start an argument description -.de AP -.ie !"\\$4"" .TP \\$4 -.el \{\ -. ie !"\\$2"" .TP \\n()Cu -. el .TP 15 -.\} -.ie !"\\$3"" \{\ -.ta \\n()Au \\n()Bu -\&\\$1 \\fI\\$2\\fP (\\$3) -.\".b -.\} -.el \{\ -.br -.ie !"\\$2"" \{\ -\&\\$1 \\fI\\$2\\fP -.\} -.el \{\ -\&\\fI\\$1\\fP -.\} -.\} -.. -'\" # define tabbing values for .AP -.de AS -.nr )A 10n -.if !"\\$1"" .nr )A \\w'\\$1'u+3n -.nr )B \\n()Au+15n -.\" -.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n -.nr )C \\n()Bu+\\w'(in/out)'u+2n -.. -'\" # BS - start boxed text -'\" # ^y = starting y location -'\" # ^b = 1 -.TH Ivy-c-3.9 1 3.9 "Ivy-c-3.9 Interface" -.SH NAME -ivy-c - a software bus library -.SH SYNOPSIS -Ivy-c provides a useful set of C library functions for communicating between different +.\" '\" +.\" '\" Ivy, C interface \- library managing connexions to a software bus +.\" '\" +.\" '\" Copyright (C) 1997-1999 +.\" +.\" '\" +.\" '\" See the file "license.terms" for information on usage and redistribution +.\" '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +.\" '\" +.\" '\" +.\" '\" # Start an argument description +.\" .de AP +.\" .ie !"\\$4"" .TP \\$4 +.\" .el \{\ +.\" . ie !"\\$2"" .TP \\n()Cu +.\" . el .TP 15 +.\" .\} +.\" .ie !"\\$3"" \{\ +.\" .ta \\n()Au \\n()Bu +.\" \&\\$1 \\fI\\$2\\fP (\\$3) +.\" +.\" .\} +.\" .el \{\ +.\" .br +.\" .ie !"\\$2"" \{\ +.\" \&\\$1 \\fI\\$2\\fP +.\" .\} +.\" .el \{\ +.\" \&\\fI\\$1\\fP +.\" .\} +.\" .\} +.\" .. +.\" '\" # define tabbing values for .AP +.\" .de AS +.\" .nr )A 10n +.\" .if !"\\$1"" .nr )A \\w'\\$1'u+3n +.\" .nr )B \\n()Au+15n +.\" +.\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n +.\" .nr )C \\n()Bu+\\w'(in/out)'u+2n +.\" .. +.\" '\" # BS - start boxed text +.\" '\" # ^y = starting y location +.\" '\" # ^b = 1 +.TH "Ivy-c-3.11" "1" "3.11" "Francois-Regis Colin, Stephane Chatty" "library" +.SH "NAME" +ivy\-c \- a software bus library +.SH "SYNOPSIS" +Ivy\-c provides a useful set of C library functions for communicating between different processes through a software bus -.SH DESCRIPTION +.SH "DESCRIPTION" Ivy is a software bus, ie a system that allows any software component to freely exchange data. The basic principle of a software bus is to ease the rapid implementation of new agents, and to manage a dynamic collection of agents on the bus: agents connect, send and receive messages, and disconnect without perturbing the overall functionment of the bus. Each time an application initializes a connection on the bus, a "ready" message is sent to all other applications already connected, and the list of the messages subscribed by this application is dispatched. The format for the messages is free. -.nf +.nf The essential functions of Ivy are: -.nf +.nf .I Connexion -.nf -.I Message sending -.nf +.nf .I Message subscription -.nf +.nf .I Main loop - -.SH FILES +.nf +.I Message sending +.SH "FILES" .I /usr/include/ivy.h -.nf +.nf .I /usr/include/ivyloop.h -.nf +.nf .I /usr/include/ivysocket.h -.SH ENVIRONMENT -.I IVYBUS -.nf -.I IVYDOMAINS -.SH DIAGNOSTICS +.SH "ENVIRONMENT" +\fIIVYBUS\fR ipv4 network adress xxx.xxx.xxx.xxx\fB:\fRport number example : 127.255.255.255:2000 +.nf + +.SH "DIAGNOSTICS" error messages displayed -.SH BUGS +.SH "BUGS" none reported yet! -.SH AUTHORS -.nf -Francois-Regis Colin -.nf +.SH "AUTHORS" +.nf +Francois\-Regis Colin +.nf Stephane Chatty -.SH SEE ALSO +.SH "SEE ALSO" ivyprobe (1) -ivy-c-functions (1) +ivy\-c\-functions (1) .sp -For further details, please refer to the Ivy html page at http:// www.tls.cena.fr/pii/produits/Ivy.html -.SH NOTES +For further details, please refer to the Ivy html page at http://www.tls.cena.fr/products/ivy/ +.SH "NOTES" In case of any comment or bug report on this library, please contact ivy@tls.cena.fr diff --git a/doc/ivyprobe.1 b/doc/ivyprobe.1 index 9c79cf6..0feeea8 100644 --- a/doc/ivyprobe.1 +++ b/doc/ivyprobe.1 @@ -1,36 +1,36 @@ -.\" -.\" -.\" Ivy probe, an Ivy agent for monitoring exchanges on a bus -.\" -.\" Copyright 1998-2000 -.\" Centre d'Etudes de la Navigation Aerienne -.\" -.\" man page -.\" -.\" Authors: Stephane Chatty -.\" -.\" $Id$ -.\" -.\" Please refer to file version.h for the -.\" copyright notice regarding this software -.\" -.TH IVYPROBE 1 1/29/99 -.SH NAME -ivyprobe - an Ivy agent for monitoring exchanges on a bus +.\" +.\" +.\" Ivy probe, an Ivy agent for monitoring exchanges on a bus +.\" +.\" Copyright 1998-2000 +.\" Centre d'Etudes de la Navigation Aerienne +.\" +.\" man page +.\" +.\" Authors: Stephane Chatty +.\" +.\" $Id$ +.\" +.\" Please refer to file version.h for the +.\" copyright notice regarding this software +.\" +.TH "IVYPROBE" "1" "1/29/99" "Stephane Chatty" "utility" +.SH "NAME" +ivyprobe \- an Ivy agent for monitoring exchanges on a bus -.SH SYNOPSIS -.B ivyprobe [-b bus] [regexps] +.SH "SYNOPSIS" +.B ivyprobe [\-b bus] [regexps] -.SH DESCRIPTION -.B +.SH "DESCRIPTION" +.B ivyprobe connects to an Ivy bus and allows you to send and receive messages through a text interface. This is mainly useful for testing and debugging Ivy applications. -.SH OPTIONS +.SH "OPTIONS" .TP 6 -.B -b bus +.B \-b bus defines the Ivy bus to which to connect to. The syntax of bus addresses is .I [network[,network]][:port], where @@ -46,7 +46,7 @@ and the default network is ie. loopback on the local host. -.TP +.TP .B regexps is a (possibly empty) list of regular expressions that define subscriptions. .B ivyprobe @@ -56,7 +56,7 @@ messages that will be emitted on the bus by other applications. Do not forget to protect your regexps with quotes if you use brackets or the * sign, otherwise your shell will interpret them. -.SH EXAMPLES +.SH "EXAMPLES" .B ivyprobe '(.*)' will print all messages exchanged on the bus, with their full contents. @@ -70,53 +70,53 @@ will print .I World. -.SH LINE COMMANDS +.SH "LINE COMMANDS" .B ivyprobe accepts instructions on its command line once launched: .TP 6 -.I EOF (Ctrl-D) +.I EOF (Ctrl\-D) will make .B ivyprobe quit. -.TP +.TP .I All lines that do not start with a dot will be interpreted as messages to be broadcasted on the bus. -.TP +.TP .I \.help will print the list of possible commands. -.TP +.TP .I \.quit will make .B ivyprobe exit. -.TP +.TP .I \.bind 'regexp' will create a new subscription, that will add up to those passed at launch time. -.TP +.TP .I \.who will list all applcations present on the bus. -.TP +.TP .I \.die appname will ask application .I appname to quit, if present on the bus. -.TP +.TP .I \.direct appname id 'msg' will send a direct message to .I appname, if present on the bus. -.TP +.TP .I \.where appname will tell you on what host is .I appname, if present on the bus. -.SH BUGS +.SH "BUGS" .B ivyprobe has no prompt for its command line. -.SH SEE ALSO -.PP +.SH "SEE ALSO" +.PP Ivy (1) -- cgit v1.1