Changeset 9948a7 for src/Fragmentation
- Timestamp:
- May 17, 2012, 3:21:54 PM (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:
- 96c83b
- Parents:
- d6fe76
- git-author:
- Frederik Heber <heber@…> (12/11/11 16:59:08)
- git-committer:
- Frederik Heber <heber@…> (05/17/12 15:21:54)
- Location:
- src/Fragmentation/Automation/Controller
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/Controller/Commands/CheckResultsOperation.cpp
rd6fe76 r9948a7 24 24 25 25 #include <boost/bind.hpp> 26 #include <boost/foreach.hpp>27 26 #include <iostream> 28 27 #include "Connection.hpp" // Must come before boost/serialization headers. … … 38 37 * \param endpoint_iterator endpoint of the connection 39 38 */ 40 void CheckResultsOperation::handle_connect _check(const boost::system::error_code& e,39 void CheckResultsOperation::handle_connect(const boost::system::error_code& e, 41 40 boost::asio::ip::tcp::resolver::iterator endpoint_iterator) 42 41 { … … 54 53 boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator; 55 54 connection_.socket().async_connect(endpoint, 56 boost::bind(&CheckResultsOperation::handle_connect _check, this,55 boost::bind(&CheckResultsOperation::handle_connect, this, 57 56 boost::asio::placeholders::error, ++endpoint_iterator)); 58 57 } else { … … 89 88 } 90 89 91 /** Internal function to connect to the endpoint of the server asynchronuously.92 *93 * We require internal connetion_ and host and service to be set up for this.94 */95 void CheckResultsOperation::connect_check()96 {97 Info info(__FUNCTION__);98 // Resolve the host name into an IP address.99 boost::asio::ip::tcp::resolver::iterator endpoint_iterator = getEndpointIterator();100 boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;101 102 // Start an asynchronous connect operation.103 std::cout << "Connecting to endpoint " << endpoint << " to check " << std::endl;104 connection_.socket().async_connect(endpoint,105 boost::bind(&CheckResultsOperation::handle_connect_check, this,106 boost::asio::placeholders::error, ++endpoint_iterator));107 }108 109 /** Prepares the calculation of the results for the current jobs.110 */111 void CheckResultsOperation::operator()()112 {113 Info info(__FUNCTION__);114 // connect115 connect_check();116 //disconnect117 disconnect();118 }119 120 void CheckResultsOperation::handle_connect(const boost::system::error_code& e,121 boost::asio::ip::tcp::resolver::iterator endpoint_iterator)122 {}123 -
src/Fragmentation/Automation/Controller/Commands/CheckResultsOperation.hpp
rd6fe76 r9948a7 33 33 34 34 public: 35 // placing receive jobs operations into an io_service36 virtual void operator()();37 38 35 // virtual function pointer to the connection handler 39 36 virtual void handle_connect(const boost::system::error_code& e, 40 37 boost::asio::ip::tcp::resolver::iterator endpoint_iterator); 41 38 42 /// Handle completion of a CheckResults operation.43 void handle_connect_check(const boost::system::error_code& e,44 boost::asio::ip::tcp::resolver::iterator endpoint_iterator);45 46 39 /// Callback function when doneJobs have been received. 47 40 void handle_ReceiveDoneJobs(const boost::system::error_code& e); 48 49 /// internal function to connect to server and check done jobs50 void connect_check();51 41 52 42 /** Getter for doneJobs. -
src/Fragmentation/Automation/Controller/Commands/Operation.cpp
rd6fe76 r9948a7 96 96 } 97 97 98 void Operation:: testfunction(const std::string& _host, const std::string& _service)98 void Operation::operator()(const std::string& _host, const std::string& _service) 99 99 { 100 100 Info info(__FUNCTION__); -
src/Fragmentation/Automation/Controller/Commands/Operation.hpp
rd6fe76 r9948a7 29 29 30 30 // virtual function pointer to the operation to do 31 v irtual void operator()() = 0;31 void operator()(const std::string& _host, const std::string& _service); 32 32 33 33 // virtual function pointer to the connection handler 34 34 virtual void handle_connect(const boost::system::error_code& e, 35 35 boost::asio::ip::tcp::resolver::iterator endpoint_iterator) = 0; 36 37 void testfunction(const std::string& _host, const std::string& _service);38 36 39 37 /// Handle completion of an operation. -
src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.cpp
rd6fe76 r9948a7 41 41 * \param endpoint_iterator endpoint of the connection 42 42 */ 43 void ReceiveJobsOperation::handle_connect _calc(const boost::system::error_code& e,43 void ReceiveJobsOperation::handle_connect(const boost::system::error_code& e, 44 44 boost::asio::ip::tcp::resolver::iterator endpoint_iterator) 45 45 { … … 57 57 boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator; 58 58 connection_.socket().async_connect(endpoint, 59 boost::bind(&ReceiveJobsOperation::handle_connect _calc, this,59 boost::bind(&ReceiveJobsOperation::handle_connect, this, 60 60 boost::asio::placeholders::error, ++endpoint_iterator)); 61 61 } else { … … 110 110 } 111 111 112 /** Internal function to connect to the endpoint of the server asynchronuously.113 *114 * We require internal connetion_ and host and service to be set up for this.115 */116 void ReceiveJobsOperation::connect_calc()117 {118 Info info(__FUNCTION__);119 // Resolve the host name into an IP address.120 boost::asio::ip::tcp::resolver::iterator endpoint_iterator = getEndpointIterator();121 boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;122 123 // Start an asynchronous connect operation.124 std::cout << "Connecting to endpoint " << endpoint << " to calc " << std::endl;125 connection_.socket().async_connect(endpoint,126 boost::bind(&ReceiveJobsOperation::handle_connect_calc, this,127 boost::asio::placeholders::error, ++endpoint_iterator));128 }129 130 112 /** Place number of jobs into this controller. 131 113 * … … 140 122 } 141 123 142 /** Prepares the calculation of the results for the current jobs.143 */144 void ReceiveJobsOperation::operator()()145 {146 Info info(__FUNCTION__);147 // connect148 connect_calc();149 //disconnect150 disconnect();151 }152 153 void ReceiveJobsOperation::handle_connect(const boost::system::error_code& e,154 boost::asio::ip::tcp::resolver::iterator endpoint_iterator)155 {}156 -
src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.hpp
rd6fe76 r9948a7 32 32 33 33 public: 34 /// Placing receive jobs operations into an io_service35 virtual void operator()();36 37 34 // virtual function pointer to the connection handler 38 35 virtual void handle_connect(const boost::system::error_code& e, 39 36 boost::asio::ip::tcp::resolver::iterator endpoint_iterator); 40 37 41 /// Handle completion of a calculate operation.42 void handle_connect_calc(const boost::system::error_code& e,43 boost::asio::ip::tcp::resolver::iterator endpoint_iterator);44 45 38 /// Callback function when bunch of jobs have been sent. 46 39 void handle_SendJobs(const boost::system::error_code& e); 47 48 /// internal function to connect to server and send jobs for calculation49 void connect_calc();50 40 51 41 /// Setter for jobs -
src/Fragmentation/Automation/Controller/Commands/SendResultsOperation.cpp
rd6fe76 r9948a7 24 24 25 25 #include <boost/bind.hpp> 26 #include <boost/foreach.hpp>27 26 #include <iostream> 28 27 #include <vector> … … 41 40 * \param endpoint_iterator endpoint of the connection 42 41 */ 43 void SendResultsOperation::handle_connect _get(const boost::system::error_code& e,42 void SendResultsOperation::handle_connect(const boost::system::error_code& e, 44 43 boost::asio::ip::tcp::resolver::iterator endpoint_iterator) 45 44 { … … 57 56 boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator; 58 57 connection_.socket().async_connect(endpoint, 59 boost::bind(&SendResultsOperation::handle_connect _get, this,58 boost::bind(&SendResultsOperation::handle_connect, this, 60 59 boost::asio::placeholders::error, ++endpoint_iterator)); 61 60 } else { … … 108 107 } 109 108 110 /** Internal function to connect to the endpoint of the server asynchronuously.111 *112 * We require internal connetion_ and host and service to be set up for this.113 */114 void SendResultsOperation::connect_get()115 {116 Info info(__FUNCTION__);117 // Resolve the host name into an IP address.118 boost::asio::ip::tcp::resolver::iterator endpoint_iterator = getEndpointIterator();119 boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;120 121 // Start an asynchronous connect operation.122 std::cout << "Connecting to endpoint " << endpoint << " to get results " << std::endl;123 connection_.socket().async_connect(endpoint,124 boost::bind(&SendResultsOperation::handle_connect_get, this,125 boost::asio::placeholders::error, ++endpoint_iterator));126 }127 128 109 /** Getter for results. 129 110 * … … 136 117 return results; 137 118 } 138 139 /** Function to initiate receival of results.140 *141 */142 void SendResultsOperation::operator()()143 {144 // connect145 connect_get();146 //disconnect147 disconnect();148 }149 150 void SendResultsOperation::handle_connect(const boost::system::error_code& e,151 boost::asio::ip::tcp::resolver::iterator endpoint_iterator)152 {} -
src/Fragmentation/Automation/Controller/Commands/SendResultsOperation.hpp
rd6fe76 r9948a7 32 32 33 33 public: 34 // placing receive jobs operations into an io_service35 virtual void operator()();36 37 34 // virtual function pointer to the connection handler 38 35 virtual void handle_connect(const boost::system::error_code& e, 39 boost::asio::ip::tcp::resolver::iterator endpoint_iterator);40 41 /// Handle completion of a GetResults operation.42 void handle_connect_get(const boost::system::error_code& e,43 36 boost::asio::ip::tcp::resolver::iterator endpoint_iterator); 44 37 … … 48 41 /// Callback function when results have been received. 49 42 void handle_ReceivedResults(const boost::system::error_code& e); 50 51 /// internal function to connect to server and receive calculated results52 void connect_get();53 43 54 44 /// Getter for results -
src/Fragmentation/Automation/Controller/Commands/ShutdownOperation.cpp
rd6fe76 r9948a7 24 24 25 25 #include <boost/bind.hpp> 26 #include <boost/foreach.hpp>27 26 #include <iostream> 28 27 #include "Connection.hpp" // Must come before boost/serialization headers. … … 38 37 * \param endpoint_iterator endpoint of the connection 39 38 */ 40 void ShutdownOperation::handle_connect _shutdown(const boost::system::error_code& e,39 void ShutdownOperation::handle_connect(const boost::system::error_code& e, 41 40 boost::asio::ip::tcp::resolver::iterator endpoint_iterator) 42 41 { … … 54 53 boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator; 55 54 connection_.socket().async_connect(endpoint, 56 boost::bind(&ShutdownOperation::handle_connect _shutdown, this,55 boost::bind(&ShutdownOperation::handle_connect, this, 57 56 boost::asio::placeholders::error, ++endpoint_iterator)); 58 57 } else { … … 64 63 } 65 64 } 66 67 /** Internal function to connect to the endpoint of the server asynchronuously.68 *69 * We require internal connetion_ and host and service to be set up for this.70 */71 void ShutdownOperation::connect_shutdown()72 {73 Info info(__FUNCTION__);74 // Resolve the host name into an IP address.75 boost::asio::ip::tcp::resolver::iterator endpoint_iterator = getEndpointIterator();76 boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;77 78 // Start an asynchronous connect operation.79 std::cout << "Connecting to endpoint " << endpoint << " to get results " << std::endl;80 connection_.socket().async_connect(endpoint,81 boost::bind(&ShutdownOperation::handle_connect_shutdown, this,82 boost::asio::placeholders::error, ++endpoint_iterator));83 }84 85 /** Function to initiate shutdown of server.86 *87 */88 void ShutdownOperation::operator()()89 {90 // connect91 connect_shutdown();92 //disconnect93 disconnect();94 }95 96 void ShutdownOperation::handle_connect(const boost::system::error_code& e,97 boost::asio::ip::tcp::resolver::iterator endpoint_iterator)98 {} -
src/Fragmentation/Automation/Controller/Commands/ShutdownOperation.hpp
rd6fe76 r9948a7 31 31 32 32 public: 33 // placing receive jobs operations into an io_service34 virtual void operator()();35 36 33 // virtual function pointer to the connection handler 37 34 virtual void handle_connect(const boost::system::error_code& e, 38 35 boost::asio::ip::tcp::resolver::iterator endpoint_iterator); 39 40 /// Handle completion of a Shutdown operation.41 void handle_connect_shutdown(const boost::system::error_code& e,42 boost::asio::ip::tcp::resolver::iterator endpoint_iterator);43 44 /// internal function to connect to server and receive calculated results45 void connect_shutdown();46 36 }; 47 37 -
src/Fragmentation/Automation/Controller/JobAdder.cpp
rd6fe76 r9948a7 67 67 } 68 68 controller.addJobs(jobs); 69 controller.recjobs( );69 controller.recjobs(argv[1], argv[2]); 70 70 { 71 71 Info info("io_service"); -
src/Fragmentation/Automation/Controller/ResultChecker.cpp
rd6fe76 r9948a7 59 59 FragmentController controller(io_service, argv[1], argv[2]); 60 60 61 controller.checkres( );61 controller.checkres(argv[1], argv[2]); 62 62 { 63 63 Info info("io_service"); -
src/Fragmentation/Automation/Controller/ResultGetter.cpp
rd6fe76 r9948a7 67 67 } 68 68 69 controller.sendres( );69 controller.sendres(argv[1], argv[2]); 70 70 { 71 71 Info info("io_service"); -
src/Fragmentation/Automation/Controller/Shutdowner.cpp
rd6fe76 r9948a7 59 59 FragmentController controller(io_service, argv[1], argv[2]); 60 60 61 controller.shutdown( );61 controller.shutdown(argv[1], argv[2]); 62 62 { 63 63 Info info("io_service");
Note:
See TracChangeset
for help on using the changeset viewer.