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

dill crash on cluster #28

Open ArtPoon opened 9 years ago

ArtPoon commented 9 years ago
Traceback (most recent call last):
  File "kamphir.py", line 677, in <module>
    decay=args.toldecay)
  File "kamphir.py", line 427, in abc_mcmc
    cur_score = self.evaluate()
  File "kamphir.py", line 386, in evaluate
    for tree in trees]
  File "kamphir.py", line 25, in apply_async
    return pool.apply_async(run_dill_encoded, (dill.dumps((fun, args)),))

...

  File "/usr/local/lib/python2.7/pickle.py", line 401, in save_reduce
    save(args)
  File "/usr/local/lib/python2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python2.7/pickle.py", line 548, in save_tuple
    save(element)
  File "/usr/local/lib/python2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python2.7/site-packages/dill/dill.py", line 461, in save_function
    if not _locate_function(obj): #, pickler._session):
  File "/usr/local/lib/python2.7/site-packages/dill/dill.py", line 450, in _locate_function
    found = _import_module(obj.__module__ + '.' + obj.__name__, safe=True)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ArtPoon commented 9 years ago

Looks like this is a system-specific issue - I can run the same code on my workstation and it's happily chugging away on Westgrid. Workstation and Bulbasaur cluster are using the same version of dill (0.2.1).

ArtPoon commented 9 years ago

Inserted some print statements into dill.py. Apparently the offending function is _parse_args from argparse. Bypassing this with a try-except and return False throws another exception with obj.__name__ = _parse_args_stats.