README for the "test2" example directory.
$Id: README,v 1.4 1995/12/18 21:10:26 spreitze Exp $

[ Copyright (c) 1995 Xerox Corporation.  All Rights Reserved.  

  Unlimited use, reproduction, and distribution of this software is
  permitted.  Any copy of this software must include both the above
  copyright notice of Xerox Corporation and this paragraph.  Any
  distribution of this software must comply with all applicable United
  States export control laws.  This software is made available AS IS,
  and XEROX CORPORATION DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS FOR A PARTICULAR PURPOSE, AND NOTWITHSTANDING ANY OTHER
  PROVISION CONTAINED HEREIN, ANY LIABILITY FOR DAMAGES RESULTING FROM
  THE SOFTWARE OR ITS USE IS EXPRESSLY DISCLAIMED, WHETHER ARISING IN
  CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, EVEN IF
  XEROX CORPORATION IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ]

This directory is intended for tests of non-mainstream features.  There are currently two: a test of concurrent protocols, and a test of ASYNCHRONOUS methods.  Both examples are available only in C.


I.  Concurrent Protocols

The concurrent protocol test consists of two objects that call each other in a mutual recursion of selectable depth (and constant branching factor of 2).  They compute a Fibbonacci number according to the definition (Fib(n) = Fib(n-1) + Fib(n-2)), with each recursive call going between the two objects.

The concurrent protocol test consists of one program, `fp`; command line arguments tell it whether to be a server or client.  The arguments to the client say which Fibbonacci is to be computed.  Both sides take optional arguments specifying "pinfo" and "tinfo".  The test is most interesting when a concurrent "pinfo" is given.

To build the concurrent protocol test,

% ilumkmf
% make fp

To run the server,

% setenv ILU_DEBUG SUNRPCRM
% ./fp
Usage: ./fp [-p pinfo] [-t tinfo [tinfo...]] (-s | -c n)
% ./fp -p bcsunrpc -s
ILU version 1.8.  Copyright 1990-1994 Xerox Corporation.
ilu_SetDebugLevel:  setting debug mask from 0x0 to 0x80000
sunrpcrm(c4230): CreateMooring(lower=c32c0)
my SBH = 'ilu:Fibber-Test-Server/it;ilu%3Ai5P8tLpwvh+a8ordp1Z3rnZVdlF;bcsunrpc_2_0x61a78_1266674080@sunrpcrm=tcp_13.2.116.14_2188'
Serving...

Then run the client

% setenv ILU_DEBUG SUNRPCRM
% ./fp -p bcsunrpc -c 4
ILU version 1.8.  Copyright 1990-1994 Xerox Corporation.
ilu_SetDebugLevel:  setting debug mask from 0x0 to 0x80000
sunrpcrm(c4240): CreateMooring(lower=c32e8)
my SBH = 'ilu:augustus.3886.30d5d5a0.4ef5/it;ilu%3Ai5P8tLpwvh+a8ordp1Z3rnZVdlF;bcsunrpc_2_0x61a78_1266674080@sunrpcrm=tcp_13.2.116.14_2193'
sunrpcrm:NewTrans(lower=c59f0) = c5a78
sunrpcrm(c5a78): BeginMessage(output)
sunrpcrm(c5a78): EndMessage(output, flush=1, last chunkSize=140)
sunrpcrm(c5a78): BeginMessage(input)
sunrpcrm(c5a78): Read 28 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5a78): Parse header of length 24 chunk (last=1), 24 in buffer.
sunrpcrm(c5a78): EndMessage(input)
sunrpcrm(c5a78): BeginMessage(output)
sunrpcrm(c5a78): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm:NewTrans(lower=c9bf0) = c9cc0
sunrpcrm(c9cc0): BeginMessage(input)
sunrpcrm(c9cc0): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9cc0): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c9cc0): EndMessage(input)
fib(2, 3, 1)
sunrpcrm(c5a78): BeginMessage(output)
sunrpcrm(c5a78): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm(c9cc0): BeginMessage(input)
sunrpcrm(c9cc0): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9cc0): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c9cc0): EndMessage(input)
fib(4, 1) => 1
sunrpcrm(c9cc0): BeginMessage(output)
sunrpcrm(c9cc0): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c9cc0): BeginMessage(input)
sunrpcrm(c9cc0): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9cc0): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c9cc0): EndMessage(input)
fib(4, 0) => 1
sunrpcrm(c9cc0): BeginMessage(output)
sunrpcrm(c9cc0): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c5a78): BeginMessage(input)
sunrpcrm(c5a78): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5a78): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c5a78): EndMessage(input)
fib(2, 3, 2)
sunrpcrm(c5a78): BeginMessage(output)
sunrpcrm(c5a78): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm(c5a78): BeginMessage(input)
sunrpcrm(c5a78): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5a78): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c5a78): EndMessage(input)
fib(2, 3) => 3
sunrpcrm(c9cc0): BeginMessage(output)
sunrpcrm(c9cc0): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c5a78): BeginMessage(input)
sunrpcrm(c5a78): Read 0 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9cc0): BeginMessage(input)
sunrpcrm(c9cc0): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9cc0): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c9cc0): EndMessage(input)
fib(2, 2, 1)
sunrpcrm(c5a78): BeginMessage(output)
sunrpcrm(c5a78): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm(c5a78): BeginMessage(input)
sunrpcrm(c5a78): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5a78): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c5a78): EndMessage(input)
fib(2, 2, 2)
sunrpcrm(c5a78): BeginMessage(output)
sunrpcrm(c5a78): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm(c5a78): BeginMessage(input)
sunrpcrm(c5a78): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5a78): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c5a78): EndMessage(input)
fib(2, 2) => 2
sunrpcrm(c9cc0): BeginMessage(output)
sunrpcrm(c9cc0): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c5a78): BeginMessage(input)
sunrpcrm(c5a78): Read 0 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5a78): BeginMessage(input)
sunrpcrm(c5a78): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5a78): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c5a78): EndMessage(input)
Fib(4) = 5
augustus% 

which should provoke output like the following on the server:

sunrpcrm:NewTrans(lower=c5268) = c5338
sunrpcrm(c5338): BeginMessage(input)
sunrpcrm(c5338): Read 144 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5338): Parse header of length 140 chunk (last=1), 140 in buffer.
sunrpcrm(c5338): EndMessage(input)
sunrpcrm(c5338): BeginMessage(output)
sunrpcrm(c5338): EndMessage(output, flush=1, last chunkSize=24)
sunrpcrm(c5338): BeginMessage(input)
sunrpcrm(c5338): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5338): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c5338): EndMessage(input)
fib(1, 4, 1)
sunrpcrm:NewTrans(lower=c94d8) = c9d40
sunrpcrm(c9d40): BeginMessage(output)
sunrpcrm(c9d40): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm(c5338): BeginMessage(input)
sunrpcrm(c5338): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5338): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c5338): EndMessage(input)
fib(3, 2, 1)
sunrpcrm(c9d40): BeginMessage(output)
sunrpcrm(c9d40): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm(c9d40): BeginMessage(input)
sunrpcrm(c9d40): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9d40): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c9d40): EndMessage(input)
fib(3, 2, 2)
sunrpcrm(c9d40): BeginMessage(output)
sunrpcrm(c9d40): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm(c9d40): BeginMessage(input)
sunrpcrm(c9d40): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9d40): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c9d40): EndMessage(input)
fib(3, 2) => 2
sunrpcrm(c5338): BeginMessage(output)
sunrpcrm(c5338): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c9d40): BeginMessage(input)
sunrpcrm(c9d40): Read 0 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5338): BeginMessage(input)
sunrpcrm(c5338): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5338): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c5338): EndMessage(input)
fib(3, 1) => 1
sunrpcrm(c5338): BeginMessage(output)
sunrpcrm(c5338): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c9d40): BeginMessage(input)
sunrpcrm(c9d40): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9d40): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c9d40): EndMessage(input)
fib(1, 4, 2)
sunrpcrm(c9d40): BeginMessage(output)
sunrpcrm(c9d40): EndMessage(output, flush=1, last chunkSize=316)
sunrpcrm(c5338): BeginMessage(input)
sunrpcrm(c5338): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5338): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c5338): EndMessage(input)
fib(3, 1) => 1
sunrpcrm(c5338): BeginMessage(output)
sunrpcrm(c5338): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c5338): BeginMessage(input)
sunrpcrm(c5338): Read 320 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5338): Parse header of length 316 chunk (last=1), 316 in buffer.
sunrpcrm(c5338): EndMessage(input)
fib(3, 0) => 1
sunrpcrm(c5338): BeginMessage(output)
sunrpcrm(c5338): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c9d40): BeginMessage(input)
sunrpcrm(c9d40): Read 36 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c9d40): Parse header of length 32 chunk (last=1), 32 in buffer.
sunrpcrm(c9d40): EndMessage(input)
fib(1, 4) => 5
sunrpcrm(c5338): BeginMessage(output)
sunrpcrm(c5338): EndMessage(output, flush=1, last chunkSize=32)
sunrpcrm(c5338): BeginMessage(input)
sunrpcrm(c5338): Read 0 more bytes, in addition to 0 previous, of next chunk (incl header).
sunrpcrm(c5338): No more messages incoming.
sunrpcrm(c5338): Close(lower=c5268)

Check that "sunrpcrm:NewTrans" is printed only twice on each side; that's evidence that multiple calls are sometimes outstanding on connections.


II.  ASYNCHRONOUS Methods

The ASYNCHRONOUS method test involves two methods: a ASYNCHRONOUS and a normal (synchronous) one.  The client consists of two nested loops.  Each iteration of the outer loop calls the ASYNCHRONOUS method NSEND times (this is the inner loop), and then the synchronous method once.  The outer loop is repeated NSYNC times.  On each call, the client passes the time (ilu_FineTime, to be specific) of the start of the call, and the server records the time at which the actual method executes.  The client sleeps for 1 second after each call on the ASYNCHRONOUS method, to give clean separations of the times.  The synchronous method returns this record of pairs of times, and clears the timing buffer for the next series.  The client prints out the pairs of times.  If the ASYNCHRONOUS feature is working, you should see that in each series all call times precede all serving times.

The server takes optional arguments specifying pinfo and tinfo.

To build the ASYNCHRONOUS method test,

% ilumkmf
% make bsvr bclnt

To run the server,

% ./bsvr -help
Usage: ./bsvr [-p pinfo] [-t tinfo]
% ./bsvr -p bsunrpc
SBH = 'ilu:Batcher-Server/it;ilu%3Ak-lmMaRANKW88bREv8w2Uuu9erm;bsunrpc_2_0x61a78_1903640186@sunrpcrm=tcp_13.2.116.14_2197'

Then run the client:

% ./bclnt
Usage: ./bclnt n-syncs n-sends-per-sync
% ./bclnt 3 3
Ans(0) = 4
        808701766.206907->808701769.241622
        808701767.219225->808701769.242611
        808701768.230319->808701769.243263
        808701769.239055->808701769.243915

Ans(1) = 4
        808701769.264150->808701772.291410
        808701770.269161->808701772.292069
        808701771.281031->808701772.292706
        808701772.289489->808701772.293348

Ans(2) = 4
        808701772.307187->808701775.332846
        808701773.309603->808701775.333504
        808701774.319827->808701775.334145
        808701775.330895->808701775.334786

% 
