[Chimera-users] different behavior of the Win and OS-X version seen in case of surface calculations

Tom Goddard goddard at sonic.net
Mon Dec 15 10:50:58 PST 2014


Hi Marek,

  It is curious that the crashes happen much more frequently on 64-bit Windows than on Mac or Linux.   Here are a couple ideas why that may be.  First the surface calculation code which we got from Michel Sanner is about 20,000 lines, I think originally in Fortran and later converted to C, and is sufficiently complex that we never have figured out the bugs that cause it to crash.  When Chimera says the surface calculation failed it means the program crashed due to some bug — Chimera runs the surface calculation in a separate process so that when it crashes Chimera does not also crash.

  So why would the Windows version crash more?  One guess is that Mac, Linux and Windows are all hitting the same errors, but they become fatal on Windows, because the Windows memory allocator is more sensitive to overwriting its memory. Often programs crash by accidentally writing to the wrong place in memory, and it may happen more often on Windows for this code that that overwrite hits something critical. I believe that 32-bit Windows Chimera does not crash in the surface calculation nearly as often (maybe 2x less frequently) so that is odd.  Another idea is 64-bit Windows is unique in the operating system world in that “long” integers are 32-bits while other 64-bit operating systems make them 64-bit.  This can cause crashes when code tries to convert a memory pointer (64-bit) to a long integer and later back to a pointer.  Another way in which numerical calculations on Intel chips can lead to different results is that that floating point unit has 80-bit precision, while memory saves the float double precision values as 64-bit.  Depending on how the code compiler allocated floating point unit registers it may do more or less of computing a numerical expression entirely in registers without truncating to 64-bits.  So I think different compilers and degrees of optimization can produce slightly different numbers for numerical results.  I think this is unlikely to matter for surface calculation, although for solving non-linear equations say, those small differences can explode into very different results.  A possible cause of the surface calculation errors is that this kind of “computational geometry” code (it rolls a ball over atom spheres to find where the ball can reach — that is how the surface is defined) are prone to difficult problems where one part of the calculation may decide a point (say the intersection of 3 spheres) lies inside a sphere while another part of the code computes the same point and decides it is outside the same sphere due to limited floating point precision.

  In summary, we don’t know why 64-bit Windows crashes much more often (5x more often?) than Mac and Linux.  But there are lots of reasons that might explain it.  I’d give you the code to examine, but unfortunately it is the one and only part of Chimera that is proprietary and we are not allowed to redistribute it.

	Tom



> On Dec 15, 2014, at 9:54 AM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
> 
> Hi Marek,
> Even though the code is identical, these are numerical failures which are (a) rather unpredictable, and (b) may vary between platforms due to small rounding differences, as discussed here:
> 
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/surfprobs.html>
> 
> Sorry for the problems,
> Elaine
> -----
> Elaine C. Meng, Ph.D.                       
> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> 
> On Dec 15, 2014, at 6:02 AM, Marek Maly <marek.maly at ujep.cz> wrote:
> 
>> Hello,
>> 
>> I found already several times the differences between
>> 
>> OS-X and Win version of Chimera (1.10.).
>> 
>> Problem is regarding the ability to calculate molecular surface.
>> 
>> There are some cases when Win version of Chimera 1.10 is not able to
>> calculate molecular surface of some more complicated molecular structure
>> (e.g. protein) but on the other hand the OS-X version of Chimera (again 1.10)
>> is able to do it (although writes warning that there was some partial problems).
>> 
>> Moreover when I create PY session of such molecule with surface calculated/visualized under OS-X
>> and then I want to open this session under Win version it is opened but without the surface
>> and writes many errors into the log - see below.
>> 
>> In both versions I am using default settings (no special changes in parameters important
>> for the surface calc.).
>> 
>> How is this different behavior of the same program under Win and OS-X possible ? Do you have any recommendation how to eliminate this problem ?
>> 
>> Thank you in advance,
>> 
>>        Best wishes,
>> 
>>               Marek
>> 
>> Here is the err list after the attempt to load into Win Chimera 1.10 session containing "problematic" molecule with surface calculated under OS-X version of the Chimera 1.10
>> 
>> *****
>> 
>> C:\Program Files\Chimera 1.10\bin\mscalc.exe 1.400000 2.000000 0
>> MSMSLIB 1.3 started on Local PC
>> Copyright M.F. Sanner (March 2000)
>> Compilation flags
>> Surface calculation failed, mscalc returned code 5.
>> 
>> Surface calculation frequently fails for large, multi-chain structures. The calculation may be successful if the chains are treated individually, by using the "split" command before generating a surface.  If splitting is not desired or the structure is already a single chain, changing molecular surface parameters in the Selection Inspector or (before surface creation) the New Surfaces category of Preferences may allow the calculation to succeed. More details are given at
>> 
>> http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/surfprobs.html
>> 
>> Traceback (most recent call last):
>> File "gB_2G_S16_A.py", line 2669, in <module>
>>   restoreCoreModels()
>> File "gB_2G_S16_A.py", line 2654, in restoreCoreModels
>>   restoreSurfaces(surfInfo)
>> File "C:\Program Files\Chimera 1.10\share\SimpleSession\versions\v40.py", line 55, in restoreSurfaces
>>   elif len(customColors) != len(s.triangleData()[0]):
>> TypeError: 'NoneType' object has no attribute '__getitem__'
>> Error restoring core models:
>> TypeError: 'NoneType' object has no attribute '__getitem__'
>> 
>> File "C:\Program Files\Chimera 1.10\share\SimpleSession\versions\v40.py", line 55, in restoreSurfaces
>>   elif len(customColors) != len(s.triangleData()[0]):
>> 
>> See reply log for Python traceback.
>> 
>> 
>> Traceback (most recent call last):
>> File "gB_2G_S16_A.py", line 3025, in <module>
>>   restoreRemainder()
>> File "gB_2G_S16_A.py", line 3020, in restoreRemainder
>>   restoreSilhouettes(silhouettes)
>> File "C:\Program Files\Chimera 1.10\share\SimpleSession\versions\v62.py", line 265, in restoreSilhouettes
>>   model = idLookup(modelID)
>> File "C:\Program Files\Chimera 1.10\share\SimpleSession\versions\v23.py", line 162, in idLookup
>>   return globals.sessionMap[sesID]
>> KeyError: 27136
>> Error restoring post-model state:
>> KeyError: 27136
>> 
>> File "C:\Program Files\Chimera 1.10\share\SimpleSession\versions\v23.py", line 162, in idLookup
>>   return globals.sessionMap[sesID]
>> 
>> See reply log for Python traceback.
>> 
>> 
>> Warning: Could not restore surface color on surface model
>> with id 0.0 because that surface was not restored.
>> C:\Program Files\Chimera 1.10\bin\lib\site-packages\matplotlib\axes.py:2369: UserWarning: Attempting to set identical left==right results
>> in singular transformations; automatically expanding.
>> left=1, right=1
>> + 'left=%s, right=%s') % (left, right))
>> 
>> 
>> 
>> -- 
>> Tato zpráva byla vytvořena převratným poštovním klientem Opery: http://www.opera.com/mail/
>> _______________________________________________
>> Chimera-users mailing list
>> Chimera-users at cgl.ucsf.edu
>> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>> 
> 
> 
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
> 




More information about the Chimera-users mailing list