HBOOK ZFATAL issues

Hi,

First of all I have to mention that I don’t know fortran : all I am able to do is minor code modifications. However, I have to use a program written in fortran, and I am experiencing some errors. Finding the name of René Brun on top of the header files of the routines where the problems seem to occur, I thought this would be the right place to ask for help.

Actually there are two problems, which look quite similar to me (but maybe they are not). I can use several input files, and one of these input files lead to a problem with HGNPAR, two other files lead to a problem with HGNF, and the remaining input files have no problem. The structure of these input files should however be strictly identical, only the number of entries should differ, as well as numerical values.

The error occur within a loop on the entries of an ntuple (if I understand the code correctly), in a call to either HGNPAR or HGNF (see comment above). It occurs at about 90% of the entries. Below are the logs of the errors in both cases.

[code] !!! ZFATAL called from ZSHUNT

!!! ZFATAL reached from ZSHUNT for Case= 4

      IQUEST(11) =     60032             EA80
      IQUEST(12) =  28179540          1ADFC54   T<FC><AD>^A
      IQUEST(13) =         0                0
      IQUEST(14) =         1                1
      IQUEST(15) =  28179540          1ADFC54   T<FC><AD>^A

      Current Store number =  0  (JQDIVI= 2)

1ZEBRA SYSTEM Post-Mortem from ZPOSTM.

/QUEST/
0 2 4996 247 4997 2 416 2
1430803290 538989646 60032 28179540 0 1 28179540 100519
308 5009 20 273 50 1 0 0
0 0 0 0 0 2 51 1
0 0 0 0 0 0 0 2
0 2 1384 F7 1385 2 1A0 2
5548535A 2020544E EA80 1ADFC54 0 1 1ADFC54 188A7
134 1391 14 111 32 1 0 0
0 0 0 0 0 2 33 1
0 0 0 0 0 0 0 2

Last Bank Lifted - COMMON /MZCL/LFW,LS,NIO,ID,NL,NS,ND,IOCH(1)
29983593 29983594 0 HKEY 0 0 76 2000C hex
1C98369 1C9836A 0 59454B48 0 0 4C 2000C

Last Bank analysed - COMMON /MZCN/LFW,LS,NIO,ID,NL,NS,ND
28179537 28179540 1 HID1 1 1 22
1ADFC51 1ADFC54 1 31444948 1 1 16

Map of store 0 /PAWC/

Division Number of times
Kind Max-size Garb-coll.
Mode Position used allowed Wiped user auto Pushd Redcd

1 QDIV1    0 1         2     60078  29999988       0     0     0     0     0
2 QDIV2    1 1  29990872   1811387  29999988       0     0     0     0     0

20 system 1 8 29999988 8560 29999988 0 0 1 0 0

TRACEQ. In-line trace-back still not available.

DZSNAP — ZPOSTM OPTIONS : TCWM.

NAME LQSTOR NQSTRU NQREF NQLINK LQMINR LQ2END JQDVLL JQDVSY NQFEND LOW-1 LOW-N HIGH-1 HIGH-N SYST-1 SYST-N END
/PAWC/ ( E14A1A8) 1 1 1 164 5001 2 20 5 2 60079***********************************
0DZSNAP/ ?? Store fence area corrupt – Address and contents -4 1 ??
0DZSNAP/ ?? Store fence area corrupt – Address and contents -3 1 ??
0DZSNAP/ ?? Store fence area corrupt – Address and contents -2 1 ??
0DZSNAP/ ?? Store fence area corrupt – Address and contents -1 1 ??
0DZSNAP/ ?? Store fence area corrupt – Address and contents 0 1 ??

WORKING SPACE ADR(LQ(0)) = E14A1A8
1 ?- 1

DZSNAP. ----- Store nb. 0 = /PAWC/ Division nb. 1 = QDIV1 --------------------

HLIM. 2 3(QDIV1 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 6 N/U/O/@O 0/ 60032/ 60030/ 3
HCON. 1 19(QDIV1 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 60000 N/U/O/@O 0/ 60032/ 60031/ 19
HIDN. 51 60032(QDIV1 ) SY/US/IO 0/ 0/ 5A5 NL/NS/ND 3/ 2/ 39 N/U/O/@O 0/ 0/ 0/0
. LINKS 19 HCON 3 HLIM 19 HCON

DZSNAP. ----- Store nb. 0 = /PAWC/ Division nb. 2 = QDIV2 --------------------

HCO1. 1 28179489(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 39 N/U/O/@O 0/28179540/28179539/28179489
HID1. 57 28179540(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 22 N/U/O/@O 0/29990853/28179626/28179540
. LINKS 28179489 HCO1
HCO1. 1 28179575(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 39 N/U/O/@O 0/28179626/28179625/28179575
HID1. 56 28179626(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 22 N/U/O/@O28179540/29990853/28179783/28179626
. LINKS 28179575 HCO1
HCO1. 1 28179661(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 110 N/U/O/@O 0/28179783/28179782/28179661
HID1. 55 28179783(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 22 N/U/O/@O28179626/29990853/28179940/28179783
. LINKS 28179661 HCO1
HCO1. 1 28179818(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 110 N/U/O/@O 0/28179940/28179939/28179818
HID1. 54 28179940(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 21 N/U/O/@O28179783/29990853/28180096/28179940
. LINKS 28179818 HCO1
HCO1. 1 28179974(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 110 N/U/O/@O 0/28180096/28180095/28179974
HID1. 53 28180096(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 17 N/U/O/@O28179940/29990853/28240167/28180096
. LINKS 28179974 HCO1
HLIM. 2 28180123(QDIV2 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 26 N/U/O/@O 0/28240167/28240165/28180123
HCON. 1 28180159(QDIV2 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 59995 N/U/O/@O 0/28240167/28240166/28180159
HIDN. 29 28240167(QDIV2 ) SY/US/IO 0/ 270F/ 5A5 NL/NS/ND 3/ 2/ 63 N/U/O/@O28180096/29990853/28300284/28240167
. LINKS 28180159 HCON 28180123 HLIM 28180159 HCON
[…]
HKEY. 2 29983594(QDIV2 ) SY/US/IO 0/ 0/ 2 NL/NS/ND 0/ 0/ 76 N/U/O/@O 0/29989722/29983716/29983594
HLIM. 2 29983680(QDIV2 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 26 N/U/O/@O 0/29989722/29989720/29983680
HCON. 1 29983716(QDIV2 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 5993 N/U/O/@O29983594/29989722/29989721/29983716
1 100519/0308 PAGE 3
HIDN. 50 29989722(QDIV2 ) SY/US/IO 0/ 270F/ 5A5 NL/NS/ND 3/ 2/ 61 N/U/O/@O29983521/29990853/29990851/29989722
. LINKS 29983716 HCON 29983680 HLIM 29983716 HCON
HTAB. 3 29990293(QDIV2 ) SY/US/IO 0/ 0/ 2 NL/NS/ND 500/ 0/ 500 N/U/O/@O 0/29990853/29990850/29990293
+ LINKS 28841298 HIDN 29202000 HIDN 29562702 HIDN 29743053 HIDN 29983521 HIDN 29923404 HIDN 29863287 HIDN
HDIR. 1 29990853(QDIV2 ) SY/US/IO 0/ 0/ 252 NL/NS/ND 50/ 8/ 10 N/U/O/@O 0/ 0/30009033/29990853
REFERENCE links --------------------
9 Z0000000001ADFC54 10 0 11 Z0000000001C99FC5 12 0 13 0
===== 37 WORDS from 6 to 42 all contain 0
STRUCTURAL links --------------------
1 0 3 Z0000000001C99D95 5 0 7 0
2 Z0000000001C99B5A 4 0 6 0 8 0
DATA part of bank --------------------
DATA 1 " PAWC 3 " 5 0 7 0 9 0
2 " 4 " 6 35 8 0 10 0
[/code]

[code] !!! ZFATAL called from MZSDIV
called from MZNEED

!!! ZFATAL reached from MZSDIV for Case= 4

      IQUEST(11) =         0                0
      IQUEST(12) =         4                4
      IQUEST(13) =         0                0
      IQUEST(14) =         0                0

      Current Store number =  0  (JQDIVI= 0)

1ZEBRA SYSTEM Post-Mortem from ZPOSTM.

/QUEST/
0 2 14749 690 14750 2 1261 2
1146313293 538990153 0 4 0 0 7265 100519
910 15190 62 83 50 1 0 0
0 0 0 0 0 2 1 1
0 0 0 0 0 0 0 2
0 2 399D 2B2 399E 2 4ED 2
44535A4D 20205649 0 4 0 0 1C61 188A7
38E 3B56 3E 53 32 1 0 0
0 0 0 0 0 2 1 1
0 0 0 0 0 0 0 2

Last Bank Lifted - COMMON /MZCL/LFW,LS,NIO,ID,NL,NS,ND,IOCH(1)
29974210 29974211 0 HKEY 0 0 243 2000C hex
1C95EC2 1C95EC3 0 59454B48 0 0 F3 2000C

Last Bank analysed - COMMON /MZCN/LFW,LS,NIO,ID,NL,NS,ND
28471209 28471213 0 HIDN 3 2 63
1B26FA9 1B26FAD 0 4E444948 3 2 3F

Map of store 0 /PAWC/

Division Number of times
Kind Max-size Garb-coll.
Mode Position used allowed Wiped user auto Pushd Redcd

1 QDIV1    0 1         2         0  29999988       0     0     0     0     0
2 QDIV2    1 1  29981656   1811554  29999988       0     0     0     0     0

20 system 1 8 29999988 16752 29999988 0 0 1 0 0

TRACEQ. In-line trace-back still not available.

DZSNAP — ZPOSTM OPTIONS : TCWM.

NAME LQSTOR NQSTRU NQREF NQLINK LQMINR LQ2END JQDVLL JQDVSY NQFEND LOW-1 LOW-N HIGH-1 HIGH-N SYST-1 SYST-N END
/PAWC/ ( E14A1A8) 1 1 1 164 5001 2 20 5 2 1***********************************
0DZSNAP/ ?? Store fence area corrupt – Address and contents -4 0 ??
0DZSNAP/ ?? Store fence area corrupt – Address and contents -3 0 ??
0DZSNAP/ ?? Store fence area corrupt – Address and contents -2 0 ??
0DZSNAP/ ?? Store fence area corrupt – Address and contents -1 0 ??
0DZSNAP/ ?? Store fence area corrupt – Address and contents 0 0 ??

WORKING SPACE ADR(LQ(0)) = E14A1A8
1 0

DZSNAP. ----- Store nb. 0 = /PAWC/ Division nb. 1 = QDIV1 --------------------

      -- Division contains no banks --                                                                                        

DZSNAP. ----- Store nb. 0 = /PAWC/ Division nb. 2 = QDIV2 --------------------

HCO1. 1 28170106(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 39 N/U/O/@O 0/28170157/28170156/28170106
HID1. 57 28170157(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 22 N/U/O/@O 0/29981637/28170243/28170157
. LINKS 28170106 HCO1
HCO1. 1 28170192(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 39 N/U/O/@O 0/28170243/28170242/28170192
HID1. 56 28170243(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 22 N/U/O/@O28170157/29981637/28170400/28170243
. LINKS 28170192 HCO1
HCO1. 1 28170278(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 110 N/U/O/@O 0/28170400/28170399/28170278
HID1. 55 28170400(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 22 N/U/O/@O28170243/29981637/28170557/28170400
. LINKS 28170278 HCO1
HCO1. 1 28170435(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 110 N/U/O/@O 0/28170557/28170556/28170435
HID1. 54 28170557(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 21 N/U/O/@O28170400/29981637/28170713/28170557
. LINKS 28170435 HCO1
HCO1. 1 28170591(QDIV2 ) SY/US/IO 1/ 0/31A3 NL/NS/ND 2/ 2/ 110 N/U/O/@O 0/28170713/28170712/28170591
HID1. 53 28170713(QDIV2 ) SY/US/IO 1/ 10/2D15 NL/NS/ND 1/ 1/ 17 N/U/O/@O28170557/29981637/28230784/28170713
. LINKS 28170591 HCO1
HLIM. 2 28170740(QDIV2 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 26 N/U/O/@O 0/28230784/28230782/28170740
HCON. 1 28170776(QDIV2 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 59995 N/U/O/@O 0/28230784/28230783/28170776
HIDN. 29 28230784(QDIV2 ) SY/US/IO 0/ 270F/ 5A5 NL/NS/ND 3/ 2/ 63 N/U/O/@O28170713/29981637/28290901/28230784
. LINKS 28170776 HCON 28170740 HLIM 28170776 HCON
[…]
HKEY. 2 29974211(QDIV2 ) SY/US/IO 0/ 0/ 2 NL/NS/ND 0/ 0/ 243 N/U/O/@O 0/29980506/29974500/29974211
HLIM. 2 29974464(QDIV2 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 26 N/U/O/@O 0/29980506/29980504/29974464
HCON. 1 29974500(QDIV2 ) SY/US/IO 0/ 0/ 3 NL/NS/ND 0/ 0/ 5993 N/U/O/@O29974211/29980506/29980505/29974500
HIDN. 50 29980506(QDIV2 ) SY/US/IO 0/ 270F/ 5A5 NL/NS/ND 3/ 2/ 61 N/U/O/@O29974138/29981637/29981635/29980506
. LINKS 29974500 HCON 29974464 HLIM 29974500 HCON
HTAB. 3 29981077(QDIV2 ) SY/US/IO 0/ 0/ 2 NL/NS/ND 500/ 0/ 500 N/U/O/@O 0/29981637/29981634/29981077
1 100519/0910 PAGE 3
+ LINKS 29312851 HIDN 29613436 HIDN 29793787 HIDN 29974138 HIDN 29914021 HIDN 29853904 HIDN 29733670 HIDN
HDIR. 1 29981637(QDIV2 ) SY/US/IO 0/ 0/ 252 NL/NS/ND 50/ 8/ 10 N/U/O/@O 0/ 0/30009033/29981637
REFERENCE links --------------------
9 Z0000000001ADD7AD 10 0 11 Z0000000001C97BC5 12 0 13 0
===== 37 WORDS from 6 to 42 all contain 0
STRUCTURAL links --------------------
1 0 3 Z0000000001C97995 5 0 7 0
2 Z0000000001C9775A 4 0 6 0 8 0
DATA part of bank --------------------
DATA 1 " PAWC 3 " 5 0 7 0 9 0
2 " 4 " 6 35 8 0 10 0 [/code]

I would be thankful to anyone who could give me an advice of what to look for.

Could you post your hbook file and a short (PAW script) or a small Fortran program reading/processing the file?
Note that you can convert your hbook file to ROOT format by doing

h2root file.hbook file.root
Rene

[quote=“brun”]Could you post your hbook file and a short (PAW script) or a small Fortran program reading/processing the file?[/quote]I’m afraid this will be difficult : the hbook files size is about 250MB, I don’t know PAW neither fortran enough to write my own program, and I’m not sure of the structure of the file… I will try to write a small program though.

Do you have an account at Lyon’s CCALI ?

[quote=“brun”]Note that you can convert your hbook file to ROOT format by doing

h2root file.hbook file.root [/quote]Thanks for the tip ! I will start by checking the problematic entries from ROOT.

No, I do not have an account at this place, but could you simply place your file in a web server or in a public afs?

Rene

The files are available at … and are named accordingly to where they are supposed to fail. Below is a short minimal piece of code that should work.

      program hbookissue

      integer*4 h_nhits,h_i_r,ierror
      integer istat,pawsiz,lun_in_rz,lrecl
      real xtup(13)
      character*120 h_file_in_rz
c      integer iquest
c      common/quest/iquest(100)
      real ws
      parameter(pawsiz=3000000)
      common/pawc/ws(pawsiz)


c initialize HBOOK
      write(*,*) ' Trying HLIMIT'
      CALL HLIMIT (pawsiz)
      write(*,*)  ' Did HLIMIT '


c open the input .rz file
      lun_in_rz = 21
      lrecl = 4096
      h_file_in_rz = 'elec-partic-0.0075-375m-30events-1tev.hbook'
      CALL HROPEN(lun_in_rz,'LUN1',h_file_in_rz,' ',lrecl,istat)
      write(*,*) ' Did HROPEN',h_file_in_rz


c set up the file in local paw memory
      call hcdir('//LUN1',' ')
      call hrin(0,9999999,0)
      call hcdir('//PAWC',' ')


      h_i_r = 1
      call hgnpar(h_i_r,'data') ! set HBOOK to the appropriate ntuple
      call hnoent(h_i_r,h_nhits)
      write (*,*) ' No. of entries in Ntuple for this shell =',h_nhits

      do j = 1,h_nhits

         write(*,*) j
         call hgnf(h_i_r,j,xtup,ierror) ! reads each photon into xtup
         write(*,*) j

      enddo

      end

It should compile correctly and run with :

I have no problems reading your files with hbook or converting them to ROOT via h2root.
Looking again at the error message MZFATAL/MZNEED, it indicates that you have not allocated enough space in memory via “call hlimit(pawsiz)”. What is your value of pawsiz? Could you try with a value like 10000000 ?

Rene

Yes, I have corrected the small piece of code in my previous post so that now it should work. The value of pawsiz is actually 30000000. Unfortunately with this piece of code I cannot reproduce the error for the moment. I will try to elaborate on this code and let you informed.

I have tried to increase pawsiz on the actual code, but it does not seem to help.

Thanks.

sigh

I finally found the solution, which has actually nothing to do with hbook (apart from memory puzzling). A check is missing in the code, which leads an array to be overflowed…

Thanks for your help anyway.