- This topic has 2 replies, 2 voices, and was last updated 12 years ago by Anonymous.
November 9, 2011 at 5:50 pm #1078Anonymous
I am having trouble calling other movers from the protocol I created and cannot find a solution. Maybe it is obvious again, but I cannot see it.
I modified the minirosetta routine to call my protocol (SymEns), which looks like the following code. This works fine and indeed generates useful output.
SymEnsProtocolOP assembly_mover = new SymEnsProtocol;
protocols::moves::symmetry::SetupForSymmetryMoverOP setup_mover = new protocols::moves::symmetry::SetupForSymmetryMover;
protocols::symmetric_docking::SymDockProtocolOP dock_mover = new protocols::symmetric_docking::SymDockProtocol;
protocols::moves::SequenceMoverOP seq_mover = new protocols::moves::SequenceMover;
seq_mover->add_mover( assembly_mover );
seq_mover->add_mover( setup_mover );
seq_mover->add_mover( dock_mover );
protocols::jd2::JobDistributor::get_instance()->go( seq_mover );
If I want to apply the very same movers from within my protocol, by using:
setup_mover->apply( pose );
dock_mover->apply( pose );
I just get a segmentation fault as soon as the setup_mover (SetupForSymmetryMover) is called/applied.
The reason for doing this is, that I want to pass a variable from my protocol to the symmetric_docking protocol.
Thanks a lot.
November 9, 2011 at 6:32 pm #6235Anonymous
I don’t have enough information to help you debug. There are any number of reasons you might be getting a segfault. If you are interested in writing code, you would be well-served to compile in debug mode (warning, it’s slow to compile and slow to run) and learn to use a debugger; that will unequivocally tell you where the segfault is.
Are the setup_mover and dock_mover being constructed in your code in an identical fashion to how they are constructed in the code snippet above (default constructor)? If that is the case it’s tough to imagine what might be going wrong.
November 10, 2011 at 3:42 pm #6243Anonymous
Thanks for the suggestion. I compiled in debug mode. That actually helped. I will make myself familiar with XCode and use that for the future.
It was a very stupid mistake. I constructed the movers two times; once in the header file and once in the “.cc” file itself.
- You must be logged in to reply to this topic.