GSI Forum - RDF feed
type: channel
description: GSI Helmholtzzentrum für Schwerionenforschung
items: still trouble with Geane
items: Re: still trouble with Geane
items: Re: patch for Geane

still trouble with Geane
type: item
description: Hi Geane experts, I still hit numerical errors in Geane. There could be more, but here is a list for the moment which trigger floating point exceptions: 1) erpremc/trscsd.F line 148 2) erpremc/trsdsc.F line 76 3) erpremc/trsdsc.F line 138 We need to figure out a way how to avoid these. I want to point out that this is not something that just happens in here at TUM. It will happen to everybody who will use Geane with tracks of the same geometry we tested in the last weeks. I solved these cases locally at TUM in the following way: For cases 1) and 3) I check whether ABS(S(J)).GT.1E30 and then I set IERR=1 and RETURN to ertrak. In ertrak I check for IERR.NE.0 and I set x2(1)=-1.E30 and I jump to the end with GOTO 99. For case number 2) I check whether the argument for the ASIN call in line 76 is ABS(TN(3)).GT.1 and I abort in the same fashion. In FairGeanePro I check for x2[0]<-1.E29 and I return kFALSE from all Propagates which call Ertrak. This is not an elegant solution. However it is one I could do without changing the interface. This has to be fixed in our global copy of geant3. Since the ertrak routine, does not have an error flag for returning, I do not know what the best solution is. Please discuss this with me here on the forum and it would be great if you could send fixes to our group, because we have set up a lot of code for extensive testing. This is one of the last steps we need to go for having a stable tracking. Lia, could you please also communicate this message to Profs. Rotondi and Fontana in case they are not on the forum? Cheers, Christian
date: 2009-04-11T14:49:44-00:00

Re: still trouble with Geane
type: item
description: Quote: Lia, could you please also communicate this message to Profs. Rotondi and Fontana in case they are not on the forum? Hi Christian, ok, I can forward your message and I will discuss this with Prof. Rotondi and will let you know Ciao, Lia.
creator: Lia Lavezzi
date: 2009-04-16T09:49:20-00:00

Re: still trouble with Geane
type: item
description: Hi Christian, I talked to Prof. Rotondi about these problems. First of all, concerning the errors: 1) erpremc/trscsd.F line 148 and 3) erpremc/trsdsc.F line 138 he suggests to try changing the line: RD(J)=S(J) with: RD(J)=SNGL(S(J)) (and in the same way the RC(J)=S(J)) in order to convert the double precision variable to single precision one. Could you try this and tell us if the error is still there, please? In addition to this, can you please send me the macro/macros to be able to reproduce these errors? ...in this way we can make tests ourselves. Prof. Rotondi' s idea is also to modify GEANE in order to be able to handle the tracking error... do I remember correctly that you already modified a bit the FORTRAN code? If so, can you please summarize your changes? Thank you very much, Lia.
creator: Lia Lavezzi
date: 2009-04-17T08:44:40-00:00

Re: still trouble with Geane
type: item
description: Hi Lia, thanks for your effort. I dont think the SNGL solution will help. I tried it and then the SNGL causes the FPE, if the argument is out of range. Another way of limiting the size was also tried out by me: If I make a check before assigning S(J) and limit it in size, e.g.: IF(S(J).GT.1.E30)S(J)=1.E30 IF(S(J).LT.-1.E30)S(J)=-1.E30 I dont get any errors anymore at this place. But what happens is that the error just moves to another place. I want to say this: If the value becomes GT.1.E30 the track fit will be useless anyway. So we should abort the propagation in this case. I want to suggest that you bring the an IERR flag in ertrack to the interface, so that we can abort the fit in the fortran code and than just detect the error in FairGeanePro. This is the only clean solution in my mind. I produced an example for you to reproduce the error. Here is what needs to be done to run it: Copy from genfit/benchmark the files benchmark.geo and media_pnd.geo to your geometry directory. The media file contains the vacuum2 material suggested by you some months ago. Then from your work directory, run genfit/benchmark/runTpcMC.C which will just do one event. This will only be used for material and B-field description in the actual test. Then run: genfit/benchmark/runGeaneTest.C This should crash with an FPE at event#7. I made my own signal handler in GeaneTestTask.cxx to allow core dumping. So, if you do ulimit -c unlimited before, you will get a core file in your workdir. You can debug this with gdb root.exe core and then do 'where' to see the place where it happens. In this example you will get the crash first in erpremc/trsdsc.F in #6 0xb6e7f230 in asin () from /lib/tls/i686/cmov/libm.so.6 #7 0xb281ca8f in trsdsc_ (pd=0xb2bac2b0, rd=0xb2babbb0, pc=0xbf82e1c4, rc=0xb2babbb0, h=0xb2bac770, ch=@0xb2a2beb8, ierr=@0xbf82e214, spu=@0xbf82e200, dj=0xb2bac800, dk=0xb2bac80c) at erpremc/trsdsc.F:76 #8 0xb2812a59 in ertrak_ (x1=0xb7b3228, p1=0xb7b3234, x2=0xb7b319c, p2=0xb7b31a8, ip…
date: 2009-04-20T14:09:18-00:00

Re: still trouble with Geane
type: item
description: Hi again, now for my diffs of the fortran code: --- ../../../fairsoft_orig/transport/geant3/erpremc/trscsd.F 2008-06-19 08:35:10.000000000 +0200 +++ erpremc/trscsd.F 2009-04-11 16:04:46.000000000 +0200 @@ -145,11 +145,13 @@ C DO 25 I=1,5 DO 20 K=I,5 J=J+1 + IF(ABS(S(J)).GT.1E30) GOTO 901 RD(J)=S(J) 20 CONTINUE 25 CONTINUE C RETURN + C C *** ERROR EXITS C --- ../../../fairsoft_orig/transport/geant3/erpremc/trsdsc.F 2008-06-19 08:35:10.000000000 +0200 +++ erpremc/trsdsc.F 2009-04-11 16:05:01.000000000 +0200 @@ -73,6 +73,7 @@ C 5 CONTINUE C PC(1)=PD(1) + IF(ABS(TN(3)).GT.1) GOTO 99 PC(2)=ASIN(TN(3)) IF (ABS (TN(1)) .LT. 1.E-30) TN(1) = 1.E-30 PC(3) = ATAN2 (TN(2),TN(1)) @@ -135,11 +136,14 @@ C DO 25 I=1,5 DO 20 K=I,5 J=J+1 + IF(ABS(S(J)).GT.1E30) GOTO 99 RC(J)=S(J) 20 CONTINUE 25 CONTINUE C RETURN + 99 IERR=1 + RETURN C C *** ERROR EXITS C And finally the ertrak.F file. But please remember: I dont have the possibility to bring the IERR out of the trsxsx.F routines to the outside world, this is why I encode the crash information in the x2 (final point). But I think you can solve this with the interface. Honestly, I just lack the skills.... --- ../../../fairsoft_orig/transport/geant3/erdecks/ertrak.F 2008-06-19 08:35:21.000000000 +0200 +++ erdecks/ertrak.F 2009-04-11 16:05:18.000000000 +0200 @@ -162,9 +162,17 @@ CALL VZERO (DUM,15) CALL TRSCSD (ERPIN(1), DUM(1), ERPIN(1), DUM(1), HI(1), + CHARGE, IERR, SPU, ERPLI(1,1), ERPLI(1,2)) + IF(IERR.NE.0) THEN + x2(1)=-1E30; + GOTO 99 + ENDIF IF (LEONLY) GOTO 35 CALL TRSDSC (ERPIN(1), ERRIN(1), DUM(1), ERRIN(1), HI(1), + CHARGE, IERR, SPU, ERPLI(1,1), ERPLI(1,2)) + IF(IERR.NE.0) THEN + x2(1)=-1E30; + GOTO 99 + ENDIF DO 29 I = 1, 5 DO 28 J = 1, 5 ASDSC(I,J) = A(I,J) These diffs are made with diff -rup, so you can copy pase them to a file and I apply them with the patch comman if you wish. But they are so little that it'll be better to implement them yourself. Cheers, Christian
date: 2009-04-20T14:21:46-00:00

Re: still trouble with Geane
type: item
description: Hi again, in my instructions on how to reproduce the error I forgot something: you need to include the directory genfit/benchmark in your global CMakeLists.txt since it isnt built by default, because nobody needs it usually. Cheers, Christian
date: 2009-04-20T14:45:37-00:00

Re: still trouble with Geane
type: item
description: Hi Christian, we made some changes in geane (listed below). Can you please run your tests with these changes and tell us if they are successful? Here is the list of the changes you should do in geant3. For erpremc/trscsd.F and trsdsc.F we just made your ones; in addition to these we also made modifications in: TGeant3/TGeant3.cxx and .h, erdecks/ertrak.F, comad/gcomad.F and geant321/ertrio.F. The rationale is the following: to assure a minimal impact and to not perturb the non PANDA current users of GEANE, we added to the GEANE common ERTRIO a labelled common ERTRIO1 containing three error flags. We use only IERTR for the moment. Therefore, the unaware user will not detect the change, apart from a standard error message from ERTRAK when the FP exception happens. The common modification required some interventions on the TGeant3 package. In our interface we manage the ertrio1 common and skip the hit when IERTR=1, as you suggested. For trscsd.F: --- erpremc.orig/trscsd.F 2009-04-23 16:55:02.000000000 +0200 +++ erpremc/trscsd.F 2009-04-23 17:07:29.000000000 +0200 @@ -145,6 +145,7 @@ C DO 25 I=1,5 DO 20 K=I,5 J=J+1 + IF(ABS(S(J)).GT.1E30) GOTO 901 RD(J)=S(J) 20 CONTINUE 25 CONTINUE and for trsdsc.F: --- erpremc.orig/trsdsc.F 2009-04-23 16:55:02.000000000 +0200 +++ erpremc/trsdsc.F 2009-04-23 17:10:06.000000000 +0200 @@ -73,6 +73,7 @@ C 5 CONTINUE C PC(1)=PD(1) + IF(ABS(TN(3)).GT.1) GOTO 99 PC(2)=ASIN(TN(3)) IF (ABS (TN(1)) .LT. 1.E-30) TN(1) = 1.E-30 PC(3) = ATAN2 (TN(2),TN(1)) @@ -135,6 +136,7 @@ C DO 25 I=1,5 DO 20 K=I,5 J=J+1 + IF(ABS(S(J)).GT.1E30) GOTO 99 RC(J)=S(J) 20 CONTINUE 25 CONTINUE @@ -142,6 +144,9 @@ C RETURN C C *** ERROR EXITS -C +C + 99 IERR=1 + RETURN +* END * For erdecks/ertrak.F: --- erdecks.orig/ertrak.F 2009-04-23 16:55:31.000000000 +0200 +++ erdecks/ertrak.F 2009-04-23 17:05:04.000000000 +0200 @@ -73,6 +73,8 @@ * * *** Decode character option * + IERTR=0 +* CHOPTI = CHOPT CALL UOPTC (CHOPT, 'BELMOPVX', IOPT) * @@ -162,9 +164,25 @@ CALL VZERO (DUM,…
creator: Lia Lavezzi
date: 2009-04-24T12:22:37-00:00

Re: still trouble with Geane
type: item
description: Hi Lia, thanks for your effort. Could you please send a patch file which I can apply to new copy of geant3. You can obtain it with: diff -u --recursive --new-file pathToOriginalGeant3 pathToYourNewGeane > patch.txt Then it will be easy to test. Like this it is a lot of work. Thanks, Christian
date: 2009-04-27T17:16:30-00:00

Re: still trouble with Geane
type: item
description: Hi Christian, sorry for the late reply. I attach here the file patch.txt, I hope this is ok to make your tests... if something' s still missing please tell me! Ciao, Lia.
creator: Lia Lavezzi
date: 2009-04-28T14:41:12-00:00

Re: still trouble with Geane
type: item
description: Hi, I tested your patch now. For me it works just fine. If it could find its way into the external packages that would be great. - I will remove the theta<0.4deg cut from GeaneTrackRep. - I will put Lia's changes to FairGeanePro, but I will protext them with an #ifndef #else thing, which will be default to still work with the 'old' version of geane. Then when one patches the geane, we can just change this flag and then remove the old code, once everybody has changed their Geane. As a more general comment: I think we will have more cases where FPEs could occur in all the other trXXYY.F. So, if we could have the external packages source code in a repository that would be so useful, for future fixes as they become necessary. But now the interface is great to the C++ code and these fixes will be quick and painless! Thanks a lot to the Pavia group. Please thank your Porfessors in case they dont read this. Cheers, CHristian
date: 2009-04-30T10:19:32-00:00

Re: still trouble with Geane
type: item
description: Thank you to you Christian! Nice to hear that the patch works: at this point, if there are no objections, we would send the changes to CERN in order to add them to the new geane version. Ciao, Lia.
creator: Lia Lavezzi
date: 2009-05-04T10:06:50-00:00

Re: still trouble with Geane
type: item
description: Sure thing Lia. You're most welcome. One question to Mohammad: How are your plans of handling external packages source code in the future? I am sure we will need to make some fixes here and there to that code. Cheers, Christian
date: 2009-05-04T11:37:48-00:00

Re: still trouble with Geane
type: item
description: Hi, It is planed for end of May. Mohammad
creator: Mohammad Al-Turany
date: 2009-05-04T15:57:20-00:00

Re: still trouble with Geane
type: item
description: Dear all, Since it might take some time before the updates will be implemented and consequently in the next release of the external packages, I propose to prepare a new tarball of the external packages which only includes patches with the fixes related to Geane (no other updates). In preparation for the Torino meeting, we can place this tarball on the Wiki site, so that users and developers have enough time to install it. Meanwhile, we (.... eh, well lets say Mohammad) can work on the next official release of the external packages with -hopefully- an update from the vmc/root developers including Christian's and Lia's fixes and many more other new goodies. Lia would you be able to prepare a patched version of the external packages? Note that the external packages will also be on subversion at the end of the month as Mohammad already announced, but with the main reason to make sure that the pandaroot releases will be coupled to the corresponding external packages. Concerning bug fixes in any code of the external packages, I would find it of utmost important that these fixes are (eventually) made in the original code in agreement with the responsible authors in order not to deviate from their developments. I realize that this does cause some extra overhead, but on the long run it will pay off. Kind wishes and keep up the nice work! Johan.
creator: Johan Messchendorp
date: 2009-05-04T19:41:55-00:00

Re: still trouble with Geane
type: item
description: If I remember well, there was even a sort of bug in VMC while propagating some track ids of secondaries, disappearing tracks, or something similar. Maybe Mohammad could comment on it, if I remember well the bug was quite "important" and I think it should be solved in the next ext packages release (or pre-release).
creator: StefanoSpataro
date: 2009-05-05T07:49:57-00:00

Re: still trouble with Geane
type: item
description: Hi, I am preparing the needed files to apply the patch to geant3: I just need a few time to test if the patching procedure works. Since, however, it seems that a new error handling might be needed (see GEANE on 64bit Ubuntu 9.04 [message #8403] in the forum) I would check if this requires some further modifications before providing the patch. Regards, Lia.
creator: Lia Lavezzi
date: 2009-05-05T11:29:12-00:00

Re: still trouble with Geane
type: item
description: Hi, yes it sounds like a good idea to use the new error flag mechanism for these cases also. Christian
date: 2009-05-05T12:00:09-00:00

Re: still trouble with Geane
type: item
description: Hi, Ok, perfect. It might also be a good idea to make a QA macro which would do some rigourous tests for all the machines involved in the nightly builds. Best wishes, Johan.
creator: Johan Messchendorp
date: 2009-05-05T16:00:13-00:00

Re: patch for Geane
type: item
description: Hi all, I sent the patch for GEANE to Rene Brun and he has just inserted it in geant3 SVN trunk Ciao, Lia.
creator: Lia Lavezzi
date: 2009-06-12T14:23:46-00:00