OVITO Forum

OVITO => Support Forum => Topic started by: mlen on March 09, 2019, 06:43:57 AM

Title: Fatal Python error: deallocating None
Post by: mlen on March 09, 2019, 06:43:57 AM
Dear everyone,

I am working with the 08-Mar-19 development build of Ovito 3.0.0-dev349. I've installed it in my home directory under Ovito-3.0.0. I am running Ovito's Python interpreter on a cluster with the CentOS flavor of Linux and a Slurm job scheduler. My LAMMPS dump file is unwrapped. It contains a single molecule with 1815 atoms and 100,001 timesteps. The total file size is approximately 6GB. I am basically defining my own modifier to calculate the distance between the minimum x value and the maximum x value. My code is below:

Code: [Select]
from ovito.io import import_file, export_file
import sys, numpy

node = import_file(sys.argv[1], multiple_frames=True)
outputfile = sys.argv[2]

def ComputeLx(frame, data):
    x = data.particles['Position'][:,0]
    data.attributes['Lx'] = numpy.max(x) - numpy.min(x)

node.modifiers.append(ComputeLx)

export_file(node, outputfile, 'txt/attr', multiple_frames=True, columns=['Timestep', 'Lx'])

It is executed using the following (the default ovito-3.0.0-dev349-x86_64 directory is renamed as Ovito-3.0.0):

Code: [Select]
~/Ovito-3.0.0/bin/ovitos calclxfromovito.py A.lammpstrj lx.out

Upon executing my code, my output file contains 10% of the expected data and I receive the following error message:

Code: [Select]
Fatal Python error: deallocating None

Current thread 0x00002acc74210c40 (most recent call first):
  File "/home/Ovito-3.0.0/lib/python3.6/_weakrefset.py", line 38 in __init__
  File "/home/Ovito-3.0.0/lib/python3.6/abc.py", line 145 in __new__
  File "/home/Ovito-3.0.0/bin/../lib/ovito/plugins/python/ovito/data/data_collection.py", line 54 in _DataCollection_attributes
  File "calclxfromovito.py", line 16 in ComputeLx
  File "/home/Ovito-3.0.0/bin/../lib/ovito/plugins/python/ovito/io/export_file.py", line 184 in export_file
  File "calclxfromovito.py", line 20 in <module>
Aborted (core dumped)

I haven't had much luck with determining what the issue is, but my first guess would be that there is a memory leak? I've tested the following items so far:

I may not have covered everything on my user end, so I am open to suggestions of anything else I should try.

Kind regards,
Michelle
Title: Re: Fatal Python error: deallocating None
Post by: Constanze Kalcher on March 15, 2019, 09:47:13 AM
Dear Michelle,

thanks for letting us know, we are looking into this.

-Constanze
Title: Re: Fatal Python error: deallocating None
Post by: Alexander Stukowski on March 15, 2019, 02:32:09 PM
Hi Michelle,

It turned out that this error is due to a bug buried deep down in the Python interface layer of Ovito. It took me a while to figure out what is going on, because the bug only leads to a visible problem after creating a new global attribute in the DataCollection.attributes dictionary more than approx. 10,000 times.

I've fixed the bug in the source code:

https://gitlab.com/stuko/ovito/commit/d4f42c1a4723ff2460dcca9d7a91e5294e42a87e

You can download the new build 3.0.0-dev352 for Linux, which should solve the problem.

-Alex
Title: Re: Fatal Python error: deallocating None
Post by: mlen on March 15, 2019, 08:29:59 PM
Dear Constanze and Alex,

Thank you so much for finding the issue. I will download the new Linux build and test it out. Have a great weekend!

Cheers,
Michelle