|
Very large ntuples should be created "disk resident". By default CWN are created that way but RWN are not. An other FAQ explain how to do this for RWN. But creating the ntuple "disk resident" is not enough to make it "very large". If you get one of the following error message:
RZOUT: current RZ file cannot support > 64K records
or individual directories > 64K
RZOUT: previous cycle(s) for this key ( 30) deleted
RZOUT: please consult ZEBRA manual for further details
or:
RZOUT: "Request exceeds quota"this indicates that some parameters must be tuned in order to bypass these limits:
Example:
COMMON/QUEST/IQUEST(100)
IQUEST(10)=64000
CALL HROPEN(lun,......,'NQ',4096,istat)
will create a file with a maximum of 64000 records of 4096 words. With this
technique the largest number of records you can have in an HBOOK file
will be 64000 (2**16).
Important note: It is very important to initialise IQUEST(10) just before the call to HROPEN. The QUEST common block is used a lot in the whole CERNLIB, and in particular in HBOOK, so if the value of IQUEST(10) is defined too far from the call to HROPEN, very likely it will not have the expected value when needed.
Program Quota
Parameter (Nwpawc=150000, Nvars=17)
Character*8 Chtags(Nvars)
Dimension Event(Nvars)
Common/Pawc/Paw(Nwpawc)
*
Equivalence (Event(1) ,X1) , (Event(2),Y1) , (Event(3) ,Z1)
Equivalence (Event(4) ,Enrgy1), (Event(5),Eloss1)
Equivalence (Event(6) ,X2) , (Event(7),Y2) , (Event(8) ,Z2)
Equivalence (Event(9) ,Enrgy2), (Event(10),Eloss2)
Equivalence (Event(11),X3) , (Event(12),Y3) , (Event(13),Z3)
Equivalence (Event(14),Enrgy3), (Event(15),Eloss3)
Equivalence (Event(16),X4) , (Event(17),Y4)
*
Common /QUEST/ Iquest(100)
Data Chtags/'X1','Y1','Z1','Energy1','Eloss1',
+ 'X2','Y2','Z2','Energy2','Eloss2',
+ 'X3','Y3','Z3','Energy3','Eloss3',
+ 'X4','Y4'/
*
Call Hlimit(Nwpawc)
*
Iquest(10) = 256000
Call Hropen (1,'QUOTA','quota.hbook','NQE',1024,ISTAT)
If (Istat.Ne.0) Stop
*
Call Hbookn (10,'A simple Ntuple',Nvars,'//QUOTA',10000,Chtags)
*
Do I=1, 5000000
Call Rannor(X1,Y1)
X1 = Float(I)
Z1 = Sqrt(X1*X1+Y1*Y1)
Enrgy1 = 50. + 10.*X1
Eloss1 = 10. * Abs(Y1)
Call Rannor (X2,Y2)
Z2 = Sqrt(X2*X2+Y2*Y2)
Enrgy2 = 50. + 10.*X2
Eloss2 = 10. * Abs(Y2)
Call Rannor(X3,Y3)
Z3 = SQRT(X3*X3+Y3*Y3)
Enrgy3 = 50. + 10.*X3
Eloss3 = 10. * Abs(Y3)
Call Rannor(X4,Y4)
Call Hfn(10,Event)
Enddo
Call Hrout(0,Icycle,' ')
Call Hrend('QUOTA')
End
When you run this example you get:
$ ./quota
RZMAKE. new RZ format selected.
This file will not be readable with versions of RZ prior to release 94B
$ ls -l quota.hbook
-rw-r--r-- 1 couet olivier 340918272 Dec 13 12:06 quota.hbook
$
The C version of this program is:
#include <stdlib.h>
#include <stdio.h>
#include <cfortran.h>
#include <math.h>
#include <packlib.h>
#include <kernlib.h>
#define Nwpawc 150000
#define Nvars 17
typedef float PAWC_DEF[Nwpawc];
#define PAWC COMMON_BLOCK(PAWC,pawc)
COMMON_BLOCK_DEF(PAWC_DEF,PAWC);
typedef struct {int iquest[100];} quest_def;
#define QUEST COMMON_BLOCK(QUEST,quest)
COMMON_BLOCK_DEF(quest_def,QUEST);
main()
{
int i, Icycle, istat;
int record_size = 1024;
float Event[Nvars];
char Chtags[17][8]={"X1","Y1","Z1","Energy1","Eloss1",
"X2","Y2","Z2","Energy2","Eloss2",
"X3","Y3","Z3","Energy3","Eloss3",
"X4","Y4"};
HLIMIT(Nwpawc);
QUEST.iquest[9] = 256000;
HROPEN(1,"QUOTA","quota.hbook","NQE",record_size,istat);
HBOOKN(10,"A simple Ntuple",Nvars,"//QUOTA",10000,Chtags);
for (i=1; i<=5000000; i++) {
RANNOR(Event[0],Event[1]);
Event[0] = (float)i;
Event[2] = sqrt(Event[0]*Event[0]+Event[1]*Event[1]);
Event[3] = 50. + 10.*Event[0];
Event[4] = 10. * abs(Event[1]);
RANNOR (Event[5],Event[6]);
Event[7] = sqrt(Event[5]*Event[5]+Event[6]*Event[6]);
Event[8] = 50. + 10.*Event[5];
Event[9] = 10. * abs(Event[6]);
RANNOR(Event[10],Event[11]);
Event[12] = sqrt(Event[10]*Event[10]+Event[11]*Event[11]);
Event[13] = 50. + 10.*Event[10];
Event[14] = 10. * abs(Event[11]);
RANNOR(Event[15],Event[16]);
HFN(10,Event);
}
HROUT(0,Icycle," ");
HREND("QUOTA");
KUCLOS(1," ",1);
}
![]() | Release Notes | Known bugs | FAQs | Contributions | Tutorial | Reference manual | Down load | Miscellaneous |