Re: [AMBER] Memory footprint goes on increasing: pytraj traj.iterchunk used, distances between bonds calculation

From: Nhai <nhai.qn.gmail.com>
Date: Sun, 12 Mar 2017 16:41:00 -0400

Hi

iterchunk is not well written and I don't find it useful much.

can you try:

for frame in traj:
    dosomething(...)

But I will have a look at the iterchunk stuff. Thanks.

Hai

> On Mar 12, 2017, at 4:17 PM, SHAILESH KUMAR <shaile27_sit.jnu.ac.in> wrote:
>
> Dear all,
>
> I am trying to process a big trajectory which can not fit in memory my
> computer. So, I tried using Iterating over the full trajectory using
> iterchunk method in pytraj. In each iteration bond lengths are calculated
> for the frames in chunk, and can be written to a file (which currently is
> disable for memory profiling purpose) for further analysis because memory
> footprint of the process keeps on growing.
>
> Its pseudo code can be as follows:
>
> traj = ptraj.iterload(trajfile, prmtopfile, frame_slice=slice_info)
>
> for chunk in traj.iterchunk(chunk_size, start=0, start=-1):
> bnd_vals = pt.distance(chunk, bnd_list, dtype='ndarray')
> # do process bnd_vals() ## curently disabled
> gc.collect()
>
> But on memory profiling it was observed that memory keeps on increasing in
> ievery iteration of chunks. Which indicates memory leak in
> bnd_vals = pt.distance(chunk, bnd_list, dtype='ndarray')
> but why is not clear to me. May be I am doing something wrong and not able
> to spot it, or there is memory leak somewhere (may be in api).
>
>
> Now I ask for help, if any one can help me to sort it out, it would be a
> great favor. For reproduciblity i am attaching simplified code, with
> necessary input files except trajectory, i can share it using dropbox when
> needed. This test dataset corresponds to a small molecule. Actual problem
> is to do similar for actual protein molecules.
> <profile.log>
> <dummy-code.py>
> <INR.DFS.tree>
> <INR.lig.gas.leap.prmtop>
> <INR.pdb>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Sun Mar 12 2017 - 14:00:02 PDT
Custom Search