pipes in NEMO:


Standard UNIX pipes are often use in NEMO to stream data from one task
to another, e.g.

	mkplummer - 1000 | integrator - - tstop=10 | snapplot - nxy=4,4


This does have some limitations, e.g. it is hard to fork/split a
data-stream and run two streams in the standard unix shell, and
perhaps even harder to shunt data and feed it back into the stream a
little earlier, like a feedback loop.


Here is an example of how to feedback some data earlier in the stream, in a
particular situation of an integrator that needs a background potential,
of which the parameters are derived from the snapshot at a slightly delayed
time (due to the nature of how pipes work)


   mkplummer  - 1000 |\
      gyrfalcON - - potname=plummerv potpars=0,1,1,0.1 potfile=plummerv.dat |\
      snapcore - potfile=plummerv.dat

It should be clear that the integration is not necessarely exactly repeatable,
not a particularly wishful situation.

To study this example, look at two new codes for this:

1) $NEMO/src/orbit/potential/data/plummerv.c

	this implements an example of a plummer sphere potential (derived from plummer.c), 
	but at regular intervals (as roughly set by potpars[3]) it will attempt to read a  
	so-called "plummerv" binary structured datafile and recompute the plummer parameters.



2) $NEMO/src/nbody/reduc/snapcore.c

	this implements an example how to read snapshots that came out of the 
	integrator (or anything along the pipe, see example above), and compute
	new plummer parameters and write them into a "plummerv" binary structured
	datafile.



Potential problems:
  - the reader could try to open when the writer is "in the middle", causing bad
    data to be read. Could do file locking, or use a shared memory segment instead.
    since it's via stropen(), stropen should offer that as an option.

    I've run this test a number of times, and didn't run into this problem, however
    i oddly enough ran out of I/O slots. 

    it's also one of these potential places where Heisenbug's can creap in. By
    adding or removing printf() statements the code runs quicker, the pipe produces
    the "tmr" file at a different rate and you get different results.

  - the potfile= example in snapcore.c does not retain a history, in case the
    user wants that, so it has to be kept another way. In the current example 
    the numbers in snapcore and plummerv are printed to <stderr> and can be 
    easily compared for heisebugs or synchronization problems.

  - since i could not get the dynamic object loader work with stat64() [in the
    fexist routine in plummerv.c], currently you probably should make a dummy file
    plummerv.dat, e.g. as shown in the following simple shell script:


#! /bin/csh -f
#
 
set t=0
set m=1
set r=0.2
set out=plummerv.dat
 
rsf in=- out=$out << EOF
set plummerv
  double Time $t
  double Mass $m
  double Radius $r
tes
EOF
tsf $out


    however if the timing is good, and dt not too small (?), it appears to work
    without the bootstrapping need.



tcppipe:

   lets take this example 
				     mkplummer - 1000 | tsf -
   and let both sides of the pipe done on different machines

 currently we do:
   start sending on machine A:       mkplummer - 1000 | tcppipe
   then receive in machine B:        tcppipe A | tsf -


 in the future we could think of a unique type approach:

	on A:	mkplummer + 1000
	on B:	tsf +A

 which defaults to port 
 A full syntax could be:		+host:port/bufsize
