ArtPoon / kamphir

Phylogenetic inference using a tree-shape kernel in an Approximate Bayesian Computation framework
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Maximum recursion depth crash #45

Closed ArtPoon closed 9 years ago

ArtPoon commented 9 years ago
Traceback (most recent call last):
  File "kamphir.py", line 759, in <module>
    decay=args.toldecay)
  File "kamphir.py", line 490, in abc_mcmc
    next_score, tree = self.evaluate()  # returns None if simulations fail
  File "kamphir.py", line 431, in evaluate
    for tree in trees]
  File "kamphir.py", line 29, in apply_async
    return pool.apply_async(run_dill_encoded, (dill.dumps((fun, args)),))
  File "/Library/Python/2.7/site-packages/dill-0.2.1-py2.7.egg/dill/dill.py", line 143, in dumps
    dump(obj, file, protocol, byref)
  File "/Library/Python/2.7/site-packages/dill-0.2.1-py2.7.egg/dill/dill.py", line 136, in dump
    pik.dump(obj)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 224, in dump
    self.save(obj)

...

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 331, in save
    self.save_reduce(obj=obj, *rv)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 419, in save_reduce
    save(state)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/Library/Python/2.7/site-packages/dill-0.2.1-py2.7.egg/dill/dill.py", line 504, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 648, in save_dict
    self.memoize(obj)
RuntimeError: maximum recursion depth exceeded
ArtPoon commented 9 years ago

Example invocation:

python kamphir.py PANGEA settings/pangea.json /Users/art/git/pangea/data/February2015/Regional/hyphy/root2tip/150129_PANGEAsim_Regional_FirstObj_scA_SIMULATED_all.nwk scA-adj.log -delimiter _ -ncores 5 -nthreads 5 -nreps 5 -tscale 0.142857 -tol0 0.03 -mintol 0.01
ArtPoon commented 9 years ago

This might be a duplicate of #18.

rmcclosk commented 9 years ago

The default recursion depth in python is quite small, 1000 I believe. It's probably trying to save a tree with depth > 1000. Fastest thing would be:

import sys
sys.setrecursionlimit(10000)
ArtPoon commented 9 years ago

Ok, looks good.