[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [modeller_usage] loops iterations and various DOPE scores



Starr Hazard wrote:
Here are the last lines of a typical log file. This run stopped after reading 236 files out of 1000 loop files. I have finished all of what I wanted to do by reading the files in smaller batches. In all cases the log files record a similar memory problem

Yes, you're absolutely right: Modeller is running out of memory. This is because the Python interface is creating some circular references, so the objects aren't being cleaned up properly. You have three options:

1. Do what you did already - split the job into smaller batches.
2. Do what I suggested - move the creation of the mdl and aln objects
   outside of the loop.
3. Apply the (attached) patch to your Modeller 8v1 distribution, which
   should fix the problem.

	Ben Webb, Modeller Caretaker
--
             http://www.salilab.org/modeller/
Modeller mail list: http://salilab.org/mailman/listinfo/modeller_usage
Index: modlib/modeller/model.py
===================================================================
--- modlib/modeller/model.py	(revision 2848)
+++ modlib/modeller/model.py	(working copy)
@@ -14,12 +14,10 @@
     dope_restraints = None
 
     def __init__(self, env, io=None, aln=None, libs=None, **vars):
-        self.add_members(('_model__modpt', 'env', 'top', '_model__sched',
-                          '_model__gprsr'))
+        self.add_members(('_model__modpt', 'env', 'top', '_model__gprsr'))
         self.__modpt = _modeller.new_model()
         self.env = env.copy()
         self.top = top.top(self.env)
-        self.__sched = schedule(self)
         self.group_restraints = self.env.group_restraints
         if len(vars) > 0:
           self.read(io, aln, libs, **vars)
@@ -321,7 +319,7 @@
     def __get_segments(self):
         return segmentlist(self)
     def __get_schedule(self):
-        return self.__sched
+        return schedule(self)
     def __get_restraints(self):
         return restraints(self)
     def __get_symmetry(self):
Index: modlib/modeller/environ.py
===================================================================
--- modlib/modeller/environ.py	(revision 2848)
+++ modlib/modeller/environ.py	(working copy)
@@ -453,8 +453,7 @@
     auto_overhang = False
 
     def __init__(self, rand_seed=None, restyp_lib_file=None, copy=None):
-        self.add_members(('io', 'top', 'edat', 'libs', 'group_restraints'))
-        self.top = top.top(self)
+        self.add_members(('io', 'edat', 'libs', 'group_restraints'))
         self.group_restraints = None
         if copy:
             self.libs = copy.libs
@@ -477,12 +476,14 @@
         return environ(copy=self)
 
     def system(self, command):
-        return self.top.system('environ.system', command=command)
+        top = top.top(self)
+        return top.system('environ.system', command=command)
 
     def dendrogram(self, **vars):
-        return self.top.dendrogram('environ.dendrogram', **vars)
+        top = top.top(self)
+        return top.dendrogram('environ.dendrogram', **vars)
 
     def principal_components(self, matrix_file, file):
-        return self.top.principal_components('environ.principal_components',
-                                             matrix_file=matrix_file,
-                                             file=file)
+        top = top.top(self)
+        return top.principal_components('environ.principal_components',
+                                        matrix_file=matrix_file, file=file)