Changes made for the PIAF Server at D0


Mask- Link with User Libraries- Debug User Functions- Others- Piaf Server Versions

Mask algorithm and Piaf Mask

Mask is direct-access file with the name *.mask. It uses one bit (1 or 0) to represent the selection of an event or not. Masks are interesting when a time consuming selection algorithm is used to select Ntuple events. Once you make a mask, it can be used to replace selection functions or cuts completely. If you use a mask as your selection algorithm, PAW/PIAF spends almost as little amount of time as no selection function case to do nt/plot.

In PAW, piaf mask was not impremented. e.g. you could not create a mask file and use it in PIAF server. I impremented mask facility into PIAF recently. The use of PIAF mask differs the PAW mask only that each time open a PIAF mask, (option N, U and default) just add //piaf/ in front of a mask name, then you can use the mask without //piaf/ just like a local mask.

For piaf mask, writing a mask only allowed in sequential mode. Reading a mask can be done in both parallel and sequential mode. Usually you make a piaf mask file in piaf sequential mode, then use it in piaf parallel mode.

Notice:

In order to use PIAF mask, you have to use impremented PAW to connect to the piaf server. e.g.
PAW HTML in D0 SGI clusters. PAW in VMS platform doesn't have this feature.

Examples:

	PAW> conn piaf d0cha 96a 
		connect to the piaf server version 96a on D0 challenge A 
	PAW> mode seq
		set sequential mode for making a new mask or update a mask
	PAW> cd //chain
	PAW> mask/file //piaf/spool2/yourname/test n 
		creates a new mask in d0cha on file 
		~/piaf/spool2/yourname/test.mask 
		
		once you open a mask file with option N, U or default,
		you can just use mask name without any path
	PAW> nt/pl 1.x z<0.4.and.select.f(1.)>>test(2)
		record selection rules to mask test bit 2 
	PAW> mask/close test 
		close mask test
	PAW> mode par
		change PIAF to parallel mode
	PAW> mask/file //piaf/spool2/yourname/test
		open mask test in PIAF for READ only (default)
	PAW> nt/pl 1.x test(2)
		test(2) can replace z<0.4.and.select.f(1.) completely
	PAW> nt/pl 1.x test(2) 1000 
		plot the first 1000 events
Mask is specific to a chain or a Ntuple file, type "help mask" in PAW to see the detailed help information. Note that /ntuple/mask command in versions before PAW 96a has been replaced by a full set of commands such as /ntuple/mask/file, /ntuple/mask/close, /ntuple/mask/list etc.

Link with User Libraries

Adding 77 to the selection function will invoke the native f77 compiler and dynamically link the routines to Piaf. In your selection function, you can call functions defined in your own or other libraries. In order to let Piaf know where are those libraries, you need to create a "piaf.setup" file in your home directory at Challenge.

Sample of piaf.setup file:

	# sample piaf.setup file
	# change to your own libraries
	# 
	setenv D0UNIX /d0library/unix/unix.a
	setenv MYLIB1 /proj4/whatever/mylib1.a
	setenv MYLIB2 /path/mylib2.a
	setenv USERLIB "$MYLIB1 $MYLIB2 $D0UNIX -lcurses"
The only important environment variable is USERLIB, you must define this one. Notice that the orders of subroutines in your own libraries is important. The called routine should follow calling routine when you build your own library.


Debug User Functions

You can debug your user selection function when using piaf server, include in your user function statements like:
		logical start
		save start
		data start /.true./
	
		if (start) then
		    start = .false.
		    call ask_deb('d0sgi6')
		endif
		
		......
The argument of routine ask_deb is the name of the graphics terminal you use. When you issue the PAW command like
	PAW> nt/pl 1.x selection.f77(1.0)
Piaf server will invoke Case Vision Debugger and pop up several windows in your graphics terminal, follow the instructions to do the debugging.

When use debug feature of piaf server, please use it in sequential mode.


Others

Changes here are invisible to a normal PAW/PIAF user. They just improve the PIAF server efficiencies.


Piaf Server Versions

There are three Piaf Server Versions available for use:

Versions
How to Use
default
PAW> conn piaf d0cha
96a
PAW> conn piaf d0cha 96a
debug
PAW> conn piaf d0cha debug

Notice:


dongzhao@fnal.gov