Calling A Protocol From Another Protocol

Member Site Forums Rosetta 3 Rosetta 3 – Build/Install Calling A Protocol From Another Protocol

Viewing 2 reply threads
  • Author
    • #1078


        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.

      • #6235

          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.

        • #6243

            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.

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.