next up previous contents index
Next: Describing the columns Up: More general Ntuples: Previous: Performance

Booking a CWN

 

The booking is performed in two stages. Firstly, a call to HBNT is made to declare the Ntuple identifier and title. Secondly, one or more calls are made to HBNAME or HBNAMC to describe the variables that are to be stored in the Ntuple. Routine HBNAMC is used to define CHARACTER variables, while all other variable types are defined with routine HBNAME.

CALL HBNT (ID,CHTITL,CHOPT)

Action: Books a CWN.

Input parameters:
ID
Identifier of the Ntuple.
CHTITL
Character variable specifying the title associated to the Ntuple.
CHOPT
Character variable specifying the desired options.
' '
for disk resident Ntuples (default).
'D'
idem as ' '.
'M'
for memory resident Ntuples.

The CWN will be stored in the current HBOOK directory. The variables to be stored in the Ntuple will be specified with routine HBNAME or HBNAMC described below.

When the CWN will be filled with HFNT, the memory buffers associated with each column will be written to the file and directory corresponding to the current working directory when HBNT was called. Remember that when routine HROPEN is called, the current working directory is automatically set to the top directory of that file. It is therefore convenient to call HBNT immediately after HROPEN. If this was not the case, routine HCDIR must be called prior to HBNT to set the current working directory. When the Ntuple has been filled (via calls to HFNT) the resident buffers in memory as well as the Ntuple header must be written to the file with a call to HROUT. Before calling HROUT, the current working directory must be set to the current directory when HBNT was called.

CALL HBSET (CHOPT,IVAL,IERR*)

Action: Set global Ntuple options.

Input parameters:
CHOPT
Character variable specifying the parameter to set.
'BSIZE'
Set the buffer size. For each variable (i.e. column) a buffer of BSIZE words is created in memory. The default for BSIZE is 1024.
IVAL
Value for the parameter specified with CHOPT.
Output parameters:
IERR
Error return code (=0 means no errors).

If the total memory in /PAWC/,    allocated via HLIMIT is not sufficient to accomodate all the column buffers of BSIZE words, then HBNT will automatically reduce the buffer size in such a way that all buffers can fit into memory. It is strongly recommended to allocate enough memory to /PAWC/ in such a way that each column buffer is at least equal to the block size of the file. A simple rule of thumb in the case of no data compression is to have NWPAWC>NCOL*LREC, where NWPAWC is the total number of words allocated by HLIMIT, LREC is the block size of the file in machine words as given in the call to HROPEN and NCOL is the number of columns.


next up previous contents index
Next: Describing the columns Up: More general Ntuples: Previous: Performance

Last update: Tue May 16 09:09:27 METDST 1995