Changeset 7ca772 for src/Fragmentation
- Timestamp:
- Jun 22, 2012, 8:19:29 AM (13 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 246d97
- Parents:
- 50f418
- git-author:
- Frederik Heber <heber@…> (12/12/11 08:32:27)
- git-committer:
- Frederik Heber <heber@…> (06/22/12 08:19:29)
- Location:
- src/Fragmentation/Automation
- Files:
-
- 3 added
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/Controller/FragmentController.cpp
r50f418 r7ca772 29 29 #include "Controller/FragmentController.hpp" 30 30 #include "Controller/Commands/Operation.hpp" 31 #include "Controller/Commands/CheckResultsOperation.hpp" 32 #include "Controller/Commands/ReceiveJobsOperation.hpp" 33 #include "Controller/Commands/SendResultsOperation.hpp" 34 #include "Controller/Commands/ShutdownOperation.hpp" 31 35 32 36 /** Constructor of class FragmentController. … … 38 42 FragmentController::FragmentController( 39 43 boost::asio::io_service& io_service) : 40 connection_(io_service), 41 recjobs(connection_), 42 checkres(connection_), 43 sendres(connection_), 44 shutdown(connection_) 44 connection_(io_service) 45 45 { 46 46 Info info(__FUNCTION__); 47 48 // insert commands into registry 49 Commands.registerInstance(new CheckResultsOperation(connection_)); 50 Commands.registerInstance(new ReceiveJobsOperation(connection_)); 51 Commands.registerInstance(new SendResultsOperation(connection_)); 52 Commands.registerInstance(new ShutdownOperation(connection_)); 47 53 } 48 54 … … 51 57 */ 52 58 FragmentController::~FragmentController() 53 {} 59 { 60 Commands.cleanup(); 61 } 54 62 63 /** Getter for Exitflag of all any Operation. 64 * 65 * We simply go through all of them and check which failed. 66 * 67 * @return Combined Exitflag of all Operations in \a Commands. 68 */ 69 size_t FragmentController::getExitflag() const 70 { 71 for (CommandRegistry::const_iterator iter = Commands.getBeginIter(); 72 iter != Commands.getEndIter(); ++iter) 73 if ((iter->second)->getExitflag() != 0) 74 return (iter->second)->getExitflag(); 75 return 0; 76 } 77 -
src/Fragmentation/Automation/Controller/FragmentController.hpp
r50f418 r7ca772 22 22 #include "FragmentResult.hpp" 23 23 24 #include "Controller/Commands/Operation.hpp" 25 #include "Controller/Commands/CheckResultsOperation.hpp" 26 #include "Controller/Commands/ReceiveJobsOperation.hpp" 27 #include "Controller/Commands/SendResultsOperation.hpp" 28 #include "Controller/Commands/ShutdownOperation.hpp" 24 #include "Controller/CommandRegistry.hpp" 29 25 30 26 /** The FragmentController sends bunches of jobs to a FragmentScheduler, … … 43 39 ~FragmentController(); 44 40 41 /// getter for operations exit flag. 42 size_t getExitflag() const; 43 45 44 protected: 46 45 /// The Connection to the server. … … 48 47 49 48 public: 50 51 ReceiveJobsOperation recjobs; 52 CheckResultsOperation checkres; 53 SendResultsOperation sendres; 54 ShutdownOperation shutdown; 55 56 // get the exit flag of the last operations 57 size_t getExitflag() const 58 { 59 if (recjobs.getExitflag() != 0) 60 return recjobs.getExitflag(); 61 if (checkres.getExitflag() != 0) 62 return checkres.getExitflag(); 63 if (sendres.getExitflag() != 0) 64 return sendres.getExitflag(); 65 if (shutdown.getExitflag() != 0) 66 return shutdown.getExitflag(); 67 return 0; 68 } 69 49 /// Registry with all commands of this controller 50 CommandRegistry Commands; 70 51 }; 71 52 -
src/Fragmentation/Automation/Makefile.am
r50f418 r7ca772 31 31 FRAGMENTATIONAUTOMATIONSOURCE = \ 32 32 atexit.cpp \ 33 Controller/CommandRegistry.cpp \ 33 34 Controller/FragmentController.cpp \ 34 35 Controller/Commands/CheckResultsOperation.cpp \ … … 42 43 Connection.hpp \ 43 44 ControllerChoices.hpp \ 45 Controller/CommandRegistry.hpp \ 44 46 Controller/FragmentController.hpp \ 45 47 Controller/Commands/CheckResultsOperation.hpp \ … … 59 61 AM_CPPFLAGS = ${BOOST_CPPFLAGS} ${CodePatterns_CFLAGS} 60 62 61 bin_PROGRAMS += JobAdder ResultChecker ResultGetter Server Shutdowner Worker63 bin_PROGRAMS += Controller Server Worker 62 64 63 65 CONTROLLERSOURCE = … … 82 84 FragmentWorker.hpp 83 85 84 JobAdder_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) Controller/JobAdder.cpp 85 JobAdder_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS) 86 JobAdder_CXXFLAGS = $(AM_CPPFLAGS) 87 JobAdder_LDADD = \ 88 libMolecuilderFragmentationAutomation.la \ 89 libMolecuilderFragmentJobs.la \ 90 $(BOOST_ASIO_LIBS) \ 91 $(BOOST_SERIALIZATION_LIBS) \ 92 $(BOOST_THREAD_LIBS) \ 93 $(BOOST_SYSTEM_LIBS) \ 94 ${CodePatterns_LIBS} 95 96 ResultChecker_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) Controller/ResultChecker.cpp 97 ResultChecker_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS) 98 ResultChecker_CXXFLAGS = $(AM_CPPFLAGS) 99 ResultChecker_LDADD = \ 100 libMolecuilderFragmentationAutomation.la \ 101 libMolecuilderFragmentJobs.la \ 102 $(BOOST_ASIO_LIBS) \ 103 $(BOOST_SERIALIZATION_LIBS) \ 104 $(BOOST_THREAD_LIBS) \ 105 $(BOOST_SYSTEM_LIBS) \ 106 ${CodePatterns_LIBS} 107 108 ResultGetter_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) Controller/ResultGetter.cpp 109 ResultGetter_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS) 110 ResultGetter_CXXFLAGS = $(AM_CPPFLAGS) 111 ResultGetter_LDADD = \ 86 Controller_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) controller.cpp 87 Controller_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS) 88 Controller_CXXFLAGS = $(AM_CPPFLAGS) 89 Controller_LDADD = \ 112 90 libMolecuilderFragmentationAutomation.la \ 113 91 libMolecuilderFragmentJobs.la \ … … 130 108 ${CodePatterns_LIBS} 131 109 132 Shutdowner_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) Controller/Shutdowner.cpp133 Shutdowner_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)134 Shutdowner_CXXFLAGS = $(AM_CPPFLAGS)135 Shutdowner_LDADD = \136 libMolecuilderFragmentationAutomation.la \137 libMolecuilderFragmentJobs.la \138 $(BOOST_ASIO_LIBS) \139 $(BOOST_SERIALIZATION_LIBS) \140 $(BOOST_THREAD_LIBS) \141 $(BOOST_SYSTEM_LIBS) \142 ${CodePatterns_LIBS}143 144 110 Worker_SOURCES = $(WORKERSOURCE) $(WORKERHEADER) 145 111 Worker_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)
Note:
See TracChangeset
for help on using the changeset viewer.