GSIM BUGS- Known Problems and Fixes


Introduction

Ok, so nobody is perfect, but at least a lot of the known problems with gsim (used to crash after a few events) have been solved. This is the main BUG LIST. The first group of bugs are real bugs that should be fixed as soon as possible. The second set of bugs are known idiocyncracies that are either not fixable or too much effort to fix. They usually have a work-around which is mentioned also.
 I'm sure these lists are incomplete, so please, email me if you know of a bug or have a fix for a bug: maurik holtrop (at) unh edu.


Known Idiocyncracies

LINUX - gsim_int won't link:

The interactive version of GSIM, gsim_int, requires the MOTIF libraries to be installed on your system. If you don't have these libraries (libXm.a) gsim_int will not compile with the standard options. This problem will still occur if you have bought MOTIF (probably from Red Hat http://www.redhat.com ) but did not get the "MOTIF aware" CERN libraries. The errors you'll get is: This means that you have a copy of CERNLIB that does not have the MOTIF "turned on". The paw++ part of the libraries is missing because the standard copy of cernlib for Linux doesn't have these. You'll need to fix this. There are two solutions:
  1. Go ftp to cern and get the latest CERNLIB (97a) with motif turned on and make sure MOTIF is installed on your system.
  2. Compile gsim_int with the command: make exe NO_MOTIF=true
Solution 1) will give you a gsim_int with full funcionality, and the ability to popup those cute Motif windows. Solution 2) is for all you hard core GEANT fans who would only use the command line anyway.

IBM - AIX - Problems:

IBM RS6000 systems running AIX have some peculiarities. First of all there is an error in the IBM math library. The signgam function is defined twice, fortunately the linker allow us to still link, though with a warning message. The following code fragment shows the problem:

program testgamma
X=0.12345
XLG=lgamma(X)
write(6,*)X,XLG
end

This program compiles and links but gives the following linking error:

jlaba1|misc>f77 -o tg testgamma.F 
** testgamma   === End of Compilation 1 ===
1501-510  Compilation successful for file Ftestgamma.f.
ld: 0711-224 WARNING: Duplicate symbol: signgam
ld: 0711-341 WARNING: Replaced XTY_CM symbol signgam requires an
        alignment more strict than the alignment of the symbol that
replaces it.
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
There is nothing we can do about this. I've send email to the systems people.

Next there is a problem with the CERNLIBs, first of all cernlib/95a is broken, so don't use it. I can't recommend using an older version than that. Currently the main distribution is linked with the 96a release of CERNLIB, which is the one that works. Note that the program "cernlib" which is supposed to give the libraries to include for use with CERNLIBs does not work on IBMs at TJNAF. As of 6/18/97 the cernlib/97a should also work, after I have added the -ldl library in the link list.


GSIM Crashes when displaying tracks:

I have seen gsim crash on most platforms (AIX, SunOS, HP, Linux) under the following conditions:
  1. The tracks are displayed. I.e. swit 1 2 was set.
  2. Background simulation was turned on, and/or
  3. An electron or other particle creates a major shower by hitting a solid.
This problem seems to stem from the graphing subsystem runing out of "Zebra" space. The conditions listed above mean that gsim is trying to display a LARGE number of tracks. At some point it runs out of memory, gives a zebra banks dump and exits. There are no known fixes to this problem, except turning off track displaying. I don't recommend increasing the size of the PAWC and GCBANK commons in the main distribution, since the code takes up too much memory already. (However you may wish to experiment with these on your own copy of gsim if you insist on a picture.)


Adding or Decreasing the amount of  Zebra space.

Adding (or decreasing) the amount of Zebra space used by GSIM is relatively easy. Since GSIM (and CERNLIBS) is mostly written in FORTRAN, the memory allocation can not be (easily) performed after the program is compiled. To change the memory allocated, you have to edit the FORTRAN file.

Follow these steps:

  1. Checkout a copy of gsim_bat from CVS (see CVS help).
  2. Modify the line (50 in the current version):
          parameter (max_zebra=3000000)         !zebra common block size
    to the needed size for zebra, i.e. replace 3000000 with 6000000 or 1000000
  3. Recompile the code by running "make" in the directory.
You should now have a new copy of gsim_bat in your $TOP_DIR/bin/$OS_NAME directory with the required space allocated.

A quick test compares  a 1E6 version of gsim with a 3E6 version, on a dual PIII at 850Mhz with 512 Mb of memory. (The gsim_bat code has more than sufficient memory in either version.) I run gsim_bat with a generic like ffread file, and a test test of data.

                Speed                       Memory Used Total - Resident
1E6      1.0943  sec/event           40392 kb           20496 kb
3E6       1.1001 sec/event           48204 kb           20708 kb

So as far as I can tell the speed is not affected and the size grew only marginally. The resident size (the part of the code actually in memory) did not grow appreciably at all.


For comments or questions: holtrop(at)jlab.org