Program hserver * * HBOOK program creating a "shared memory" * area called 'TEST' * Routine HLIMAP replaces HLIMIT. * NWORDS is the amount of space requested * in the shared area. * parameter(nwords=50000) call hlimap(nwords,'TEST') * call hbook1(1,'test1',100,-3.,3.,0.) call hcopy(1,2,'test2') call hcopy(1,3,'test3') * do 10 i=1,100000000 call rannor(a,b) call hf1(1,a,1.) call hf1(2,b,1.) call hf1(3,a**2+b**2,1.) if(mod(i,100000).eq.0) X print *,' hserver in loop index ',i 10 continue * end $ f77 -L... -l... -ohserver hserver.f $ hserver GLOBAL MEMORY CREATED, offset from LQ = 1037452510 hserver in loop index 100000 hserver in loop index 200000 hserver in loop index 300000 hserver in loop index 400000 hserver in loop index 500000 hserver in loop index 600000 hserver in loop index 700000
PAW > edit shared macro shared ntimes=100 histo/plot 1 K do nt = 1,[ntimes] histo/plot 1 U wait ' ' 1 enddo return PAW > global\_sect TEST PAW > exec shared ntimes=15
Visualise histograms in Unix shared memory
On Unix PAW can be used as an online presenter
using the shared memory facility
(at present on Sun and DecStation only)
and the routines described in section
Figure shows on the left hand side
the program, which fills the histograms.
It is compiled and linked with the f77 command,
and then started.
It writes the lines shown while going through the event loop.
Then PAW is started, communication is established via the command
global_sect TEST,
which declares that the area called 'MAP'
is to be shared for data communication, and the execution
of the KUMAC program shared.kumac
,
shown at the top right of the figure, is initiated.
The output shown on the screen then allows one to follow interactively
(using the Update option 'U'
of the plot command) how the
event generator (the hserver
program) fills histogram number one.
The first fifteen iterations have been captured and are
shown at the bottom right of Fig. .