You are here

Question about the error when using pyrosetta.distributed.io

2 posts / 0 new
Last post
Question about the error when using pyrosetta.distributed.io
#1

I have tried the latest version of Pyrosetta Anaconda python3.6 (PyRosetta4.Release.python36.mac 2019.19+release 5adc612fd9dee20f808a07e761610d95698b0f35) and previous version, PyRosetta4.Release.python36.mac 2019.18+release on MacOS, but run into the same errors when I do, for example,

pose = pyrosetta.distributed.io.pose_from_file(filename=pdb_filename)
NotImplementedError                       Traceback (most recent call last)
<ipython-input-2-fd2301a9c763> in <module>
      3 pyrosetta.init("-ignore_unrecognized_res 1 -extra_res_fa {}".format(ligand_params))
----> 4 pose = pyrosetta.distributed.io.pose_from_file(filename=pdb_filename)
      5 scorefxn = pyrosetta.create_score_function("ref2015")

/anaconda3/lib/python3.6/site-packages/pyrosetta-2019.19+release.5adc612fd9d-py3.6-macosx-10.7-x86_64.egg/pyrosetta/distributed/__init__.py in fwrap(*args, **kwargs)
     67         maybe_init()
     68 
---> 69         return func(*args, **kwargs)
     70 
     71     return fwrap

/anaconda3/lib/python3.6/site-packages/pyrosetta-2019.19+release.5adc612fd9d-py3.6-macosx-10.7-x86_64.egg/pyrosetta/distributed/packed_pose/core.py in wrap(*args, **kwargs)
     74     @functools.wraps(func)
     75     def wrap(*args, **kwargs):
---> 76         return to_packed(func(*args, **kwargs))
     77 
     78     return wrap

/anaconda3/lib/python3.6/functools.py in wrapper(*args, **kw)
    805                             '1 positional argument')
    806 
--> 807         return dispatch(args[0].__class__)(*args, **kw)
    808 
    809     funcname = getattr(func, '__name__', 'singledispatch function')

/anaconda3/lib/python3.6/site-packages/pyrosetta-2019.19+release.5adc612fd9d-py3.6-macosx-10.7-x86_64.egg/pyrosetta/distributed/packed_pose/core.py in to_packed(pose_or_pack)
     81 @singledispatch
     82 def to_packed(pose_or_pack):
---> 83     return PackedPose(pose_or_pack)
     84 
     85 

/anaconda3/lib/python3.6/site-packages/pyrosetta-2019.19+release.5adc612fd9d-py3.6-macosx-10.7-x86_64.egg/pyrosetta/distributed/packed_pose/core.py in __init__(self, pose_or_pack)
     39         """Create a packed pose from pose, pack, or pickled bytes."""
     40         if isinstance(pose_or_pack, pose.Pose):
---> 41             self.pickled_pose = pickle.dumps(pose_or_pack)
     42             self.scores = dict(pose_or_pack.scores)
     43 

/anaconda3/lib/python3.6/site-packages/pyrosetta-2019.19+release.5adc612fd9d-py3.6-macosx-10.7-x86_64.egg/pyrosetta/bindings/pose.py in __pose_getstate__(pose)
     69         return __pose_getstate__(work_pose)
     70 
---> 71     return __cereal_getstate__(pose)
     72 
     73 

/anaconda3/lib/python3.6/site-packages/pyrosetta-2019.19+release.5adc612fd9d-py3.6-macosx-10.7-x86_64.egg/pyrosetta/distributed/__init__.py in fwrap(*args, **kwargs)
     28         with _access_lock:
     29             try:
---> 30                 return func(*args, **kwargs)
     31             finally:
     32                 _logger.debug("with_lock finished: %s", func)

/anaconda3/lib/python3.6/site-packages/pyrosetta-2019.19+release.5adc612fd9d-py3.6-macosx-10.7-x86_64.egg/pyrosetta/distributed/utility/pickle.py in __cereal_getstate__(self)
     35     if not cereal:
     36         raise NotImplementedError(
---> 37             "__cereal_getstate__ requires pyrosetta '--serialization' build.")
     38 
     39     oss = rosetta.std.ostringstream()

NotImplementedError: __cereal_getstate__ requires pyrosetta '--serialization' build.

But when I do the following command, it works perfectly. 

pose = pyrosetta.io.pose_from_file(filename=pdb_filename)

I am wondering how I can solve the problem and what's differnce between pyrosetta.distributed.io and pyrosetta.io.

Thank you.

 

Category: 
Post Situation: 
Sun, 2019-05-19 00:54
cuiyoutian

The pyrosetta.distributed.io package is intended to be used in a distributed computing environment. That is, it's more set up for inter-process communication between different nodes in a HPC cluster. There is some disk-access routines, but things are set up assuming a particular compilation state which is set up for such a distributed computing environment.

pyrosetta.io, on the other hand, is intended primarily for typical io functionality. As such, it doesn't rely as much on the particular interprocess communication state setup.

That's what's behind the error you're seeing. The pyrosetta.distributed.io package assumes you have the "serialization" build of PyRosetta, which contains extra code which allows sending/recieving/storing a compact representation of things like Poses between nodes. Without the special build, the pyrosetta.distributed package chokes. Because pyrosetta.io doesn't need this compact representation, it's able to save things without the special compilation state.

Mon, 2019-06-24 12:54
rmoretti