[gpaw-users] re-running same calculation and how to properly tear down a calculation
Ask Hjorth Larsen
asklarsen at gmail.com
Fri Nov 16 16:06:35 CET 2012
Hi Nick
2012/11/16 Nichols A. Romero <naromero at alcf.anl.gov>:
> Hi,
>
> I am trying to track down a subtle GPAW reproducibility issue.
>
> I am repeating the same calculation within a single instance of the GPAW Python interpreter, but I am not sure that I am cleaning up correctly after each calculation. I thought if I did:
>
> del calc
> del bulk
>
> at the end of the calculation it would release the memory, but apparently it is not because the calculation is running out of memory after the first iteration.
>
> Here is my script:
> http://en.pastebin.ca/2252090
I can't say exactly what's going wrong. If it's somehow related to
cyclic references, you can check whether the garbage collection occurs
as appropriate by puting a print statement in the __del__ method in
gpaw/output.py. If it gets printed, it means the GPAW object was
garbage collected. If it doesn't, that would be a problem. You can
also remove (or rename) the __del__ method so that there's no "magic"
in case that helps or manually do bulk.set_calculator(None).
Or use the sys.getrefcount to check whether something is pointing to
the old objects.
Regards
Ask
More information about the gpaw-users
mailing list