- Timestamp:
- Jun 29, 2012, 8:01:45 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:
- 7dd8bc
- Parents:
- fe95b7
- git-author:
- Frederik Heber <heber@…> (03/04/12 15:55:32)
- git-committer:
- Frederik Heber <heber@…> (06/29/12 08:01:45)
- Location:
- src/Fragmentation/Automation
- Files:
-
- 20 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/Controller/CommandRegistry.cpp
rfe95b7 rf98c8e 34 34 {} 35 35 36 CONSTRUCT_REGISTRY( Operation)36 CONSTRUCT_REGISTRY(AsyncOperation) -
src/Fragmentation/Automation/Controller/CommandRegistry.hpp
rfe95b7 rf98c8e 14 14 #endif 15 15 16 #include "Controller/Commands/ Operation.hpp"16 #include "Controller/Commands/AsyncOperation.hpp" 17 17 #include "CodePatterns/Registry.hpp" 18 18 19 class CommandRegistry : public Registry< Operation>19 class CommandRegistry : public Registry<AsyncOperation> 20 20 { 21 21 public: -
src/Fragmentation/Automation/Controller/Commands/AsyncOperation.cpp
rfe95b7 rf98c8e 7 7 8 8 /* 9 * Operation.cpp9 * AsyncOperation.cpp 10 10 * 11 11 * Created on: Nov 11, 2011 … … 30 30 #include "CodePatterns/Log.hpp" 31 31 32 #include "Controller/Commands/ Operation.hpp"32 #include "Controller/Commands/AsyncOperation.hpp" 33 33 34 34 35 /** Constructor for class Operation.35 /** Constructor for class AsyncOperation. 36 36 * 37 37 * \param _name name for this Operation for retrieval from a registry 38 38 * \param _connection connection to operate on 39 39 */ 40 Operation::Operation(const std::string &_name, Connection &_connection) :40 AsyncOperation::AsyncOperation(const std::string &_name, Connection &_connection) : 41 41 connection_(_connection), 42 42 name(_name), … … 44 44 {} 45 45 46 /** Destructor for class Operation.46 /** Destructor for class AsyncOperation. 47 47 * 48 48 */ 49 Operation::~Operation()49 AsyncOperation::~AsyncOperation() 50 50 {} 51 51 … … 54 54 * \param e error code if something went wrong 55 55 */ 56 void Operation::handle_FinishOperation(const boost::system::error_code& e)56 void AsyncOperation::handle_FinishOperation(const boost::system::error_code& e) 57 57 { 58 58 Info info(__FUNCTION__); 59 59 if (!e) 60 60 { 61 LOG(1, "INFO: Operation completed.");61 LOG(1, "INFO: AsyncOperation completed."); 62 62 } 63 63 else … … 76 76 * 77 77 */ 78 void Operation::disconnect()78 void AsyncOperation::disconnect() 79 79 { 80 80 connection_.socket().close(); 81 81 } 82 82 83 void Operation::operator()(const std::string& _host, const std::string& _service)83 void AsyncOperation::operator()(const std::string& _host, const std::string& _service) 84 84 { 85 85 Info info(__FUNCTION__); … … 94 94 std::cout << "Connecting to endpoint " << endpoint << " ..." << std::endl; 95 95 connection_.socket().async_connect(endpoint, 96 boost::bind(& Operation::handle_connect, this,96 boost::bind(&AsyncOperation::handle_connect, this, 97 97 boost::asio::placeholders::error, ++endpoint_iterator)); 98 98 } -
src/Fragmentation/Automation/Controller/Commands/AsyncOperation.hpp
rfe95b7 rf98c8e 1 1 /* 2 * Operation.hpp2 * AsyncOperation.hpp 3 3 * 4 4 * Created on: Nov 11, 2011 … … 6 6 */ 7 7 8 #ifndef FRAGMENTCONTROLLER_ OPERATION_HPP_9 #define FRAGMENTCONTROLLER_ OPERATION_HPP_8 #ifndef FRAGMENTCONTROLLER_ASYNCOPERATION_HPP_ 9 #define FRAGMENTCONTROLLER_ASYNCOPERATION_HPP_ 10 10 11 11 // include config.h … … 20 20 #include "Connection.hpp" 21 21 22 class Operation {22 class AsyncOperation { 23 23 public: 24 Operation(const std::string &_name, Connection &_connection);25 virtual ~ Operation();24 AsyncOperation(const std::string &_name, Connection &_connection); 25 virtual ~AsyncOperation(); 26 26 public: 27 27 /// The Connection to the server. … … 68 68 }; 69 69 70 #endif /* FRAGMENTCONTROLLER_ OPERATION_HPP_ */70 #endif /* FRAGMENTCONTROLLER_ASYNCOPERATION_HPP_ */ -
src/Fragmentation/Automation/Controller/Commands/CheckResultsOperation.hpp
rfe95b7 rf98c8e 19 19 #include "Connection.hpp" 20 20 21 #include "Controller/Commands/ Operation.hpp"21 #include "Controller/Commands/AsyncOperation.hpp" 22 22 23 23 /** This Operations requests number of present jobs and present results (done … … 25 25 * 26 26 */ 27 class CheckResultsOperation : public Operation {27 class CheckResultsOperation : public AsyncOperation { 28 28 public: 29 29 /// Constructor for class CheckResultsOperation. 30 30 CheckResultsOperation(Connection &_connection) : 31 Operation(std::string("checkresults"), _connection),31 AsyncOperation(std::string("checkresults"), _connection), 32 32 jobInfo((size_t)2, 0) 33 33 {} -
src/Fragmentation/Automation/Controller/Commands/EnrollInPoolOperation.cpp
rfe95b7 rf98c8e 91 91 LOG(2, "DEBUG: Enrollment failed."); 92 92 93 Operation::handle_FinishOperation(e);93 AsyncOperation::handle_FinishOperation(e); 94 94 } -
src/Fragmentation/Automation/Controller/Commands/EnrollInPoolOperation.hpp
rfe95b7 rf98c8e 21 21 #include "Connection.hpp" 22 22 23 #include "Controller/Commands/ Operation.hpp"23 #include "Controller/Commands/AsyncOperation.hpp" 24 24 #include "Jobs/FragmentJob.hpp" 25 25 #include "Results/FragmentResult.hpp" 26 26 #include "WorkerAddress.hpp" 27 27 28 class EnrollInPoolOperation : public Operation {28 class EnrollInPoolOperation : public AsyncOperation { 29 29 public: 30 30 /// Constructor for class EnrollInPoolOperation. 31 31 EnrollInPoolOperation(Connection &_connection, const WorkerAddress &_address) : 32 Operation(std::string("enrollinpool"),_connection),32 AsyncOperation(std::string("enrollinpool"),_connection), 33 33 address(_address), 34 34 flag(Success) -
src/Fragmentation/Automation/Controller/Commands/GetNextJobIdOperation.cpp
rfe95b7 rf98c8e 101 101 102 102 // and finish operation 103 Operation::handle_FinishOperation(e);103 AsyncOperation::handle_FinishOperation(e); 104 104 } 105 105 -
src/Fragmentation/Automation/Controller/Commands/GetNextJobIdOperation.hpp
rfe95b7 rf98c8e 18 18 #include "Connection.hpp" 19 19 20 #include "Controller/Commands/ Operation.hpp"20 #include "Controller/Commands/AsyncOperation.hpp" 21 21 #include "JobId.hpp" 22 22 #include "types.hpp" … … 26 26 * 27 27 */ 28 class GetNextJobIdOperation : public Operation {28 class GetNextJobIdOperation : public AsyncOperation { 29 29 public: 30 30 /// Constructor for class GetNextJobIdOperation. 31 31 GetNextJobIdOperation(Connection &_connection) : 32 Operation(std::string("getnextjobid"), _connection),32 AsyncOperation(std::string("getnextjobid"), _connection), 33 33 nextid(JobId::IllegalJob) 34 34 {} -
src/Fragmentation/Automation/Controller/Commands/ObtainJobOperation.cpp
rfe95b7 rf98c8e 66 66 LOG(1, "INFO: Received job #" << job->getId() << "."); 67 67 68 Operation::handle_FinishOperation(e);68 AsyncOperation::handle_FinishOperation(e); 69 69 } -
src/Fragmentation/Automation/Controller/Commands/ObtainJobOperation.hpp
rfe95b7 rf98c8e 21 21 #include "Connection.hpp" 22 22 23 #include "Controller/Commands/ Operation.hpp"23 #include "Controller/Commands/AsyncOperation.hpp" 24 24 #include "Jobs/FragmentJob.hpp" 25 25 #include "Results/FragmentResult.hpp" 26 26 27 class ObtainJobOperation : public Operation {27 class ObtainJobOperation : public AsyncOperation { 28 28 public: 29 29 /// Constructor for class ObtainJobOperation. 30 30 ObtainJobOperation(Connection &_connection) : 31 Operation(std::string("obtainjob"),_connection) {}31 AsyncOperation(std::string("obtainjob"),_connection) {} 32 32 /// Destructor for class ObtainJobOperation 33 33 ~ObtainJobOperation() {} -
src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.cpp
rfe95b7 rf98c8e 107 107 jobs.clear(); 108 108 109 Operation::handle_FinishOperation(e);109 AsyncOperation::handle_FinishOperation(e); 110 110 } 111 111 -
src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.hpp
rfe95b7 rf98c8e 21 21 #include "Jobs/FragmentJob.hpp" 22 22 23 #include "Controller/Commands/ Operation.hpp"23 #include "Controller/Commands/AsyncOperation.hpp" 24 24 25 class ReceiveJobsOperation : public Operation {25 class ReceiveJobsOperation : public AsyncOperation { 26 26 public: 27 27 /// Constructor for class ReceiveJobsOperation. 28 28 ReceiveJobsOperation(Connection &_connection) : 29 Operation(std::string("receivejobs"), _connection) {}29 AsyncOperation(std::string("receivejobs"), _connection) {} 30 30 /// Destructor for class ReceiveJobsOperation 31 31 ~ReceiveJobsOperation() {} -
src/Fragmentation/Automation/Controller/Commands/SendJobToWorkerOperation.hpp
rfe95b7 rf98c8e 20 20 #include "Connection.hpp" 21 21 22 #include "Controller/Commands/ Operation.hpp"22 #include "Controller/Commands/AsyncOperation.hpp" 23 23 #include "Jobs/FragmentJob.hpp" 24 24 #include "Jobs/SystemCommandJob.hpp" 25 25 #include "WorkerAddress.hpp" 26 26 27 class SendJobToWorkerOperation : public Operation {27 class SendJobToWorkerOperation : public AsyncOperation { 28 28 public: 29 29 /// Constructor for class SendJobToWorkerOperation. 30 30 SendJobToWorkerOperation(Connection &_connection) : 31 Operation(std::string("sendjobtoworker"),_connection),31 AsyncOperation(std::string("sendjobtoworker"),_connection), 32 32 job( new SystemCommandJob(std::string("/bin/true"), std::string("donothing"), JobId::NoJob) ) 33 33 {} -
src/Fragmentation/Automation/Controller/Commands/SendResultsOperation.cpp
rfe95b7 rf98c8e 105 105 LOG(1, "INFO: Received "+toString(results.size())+" results."); 106 106 107 Operation::handle_FinishOperation(e);107 AsyncOperation::handle_FinishOperation(e); 108 108 } 109 109 -
src/Fragmentation/Automation/Controller/Commands/SendResultsOperation.hpp
rfe95b7 rf98c8e 21 21 #include "Results/FragmentResult.hpp" 22 22 23 #include "Controller/Commands/ Operation.hpp"23 #include "Controller/Commands/AsyncOperation.hpp" 24 24 25 class SendResultsOperation : public Operation {25 class SendResultsOperation : public AsyncOperation { 26 26 public: 27 27 /// Constructor for class SendResultsOperation. 28 28 SendResultsOperation(Connection &_connection) : 29 Operation(std::string("sendresults"), _connection) {}29 AsyncOperation(std::string("sendresults"), _connection) {} 30 30 /// Destructor for class SendResultsOperation 31 31 ~SendResultsOperation() {} -
src/Fragmentation/Automation/Controller/Commands/ShutdownOperation.hpp
rfe95b7 rf98c8e 20 20 #include "Connection.hpp" 21 21 22 #include "Controller/Commands/ Operation.hpp"22 #include "Controller/Commands/AsyncOperation.hpp" 23 23 24 class ShutdownOperation : public Operation {24 class ShutdownOperation : public AsyncOperation { 25 25 public: 26 26 /// Constructor for class ShutdownOperation. 27 27 ShutdownOperation(Connection &_connection) : 28 Operation(std::string("shutdown"),_connection) {}28 AsyncOperation(std::string("shutdown"),_connection) {} 29 29 /// Destructor for class ShutdownOperation 30 30 ~ShutdownOperation() {} -
src/Fragmentation/Automation/Controller/Commands/SubmitResultOperation.cpp
rfe95b7 rf98c8e 89 89 if (!e) { 90 90 LOG(1, "INFO: result #" << result->getId() << " sent."); 91 Operation::handle_FinishOperation(e);91 AsyncOperation::handle_FinishOperation(e); 92 92 } else { 93 93 // An error occurred. Log it and return. Since we are not starting a new -
src/Fragmentation/Automation/Controller/Commands/SubmitResultOperation.hpp
rfe95b7 rf98c8e 21 21 #include "Connection.hpp" 22 22 23 #include "Controller/Commands/ Operation.hpp"23 #include "Controller/Commands/AsyncOperation.hpp" 24 24 #include "Jobs/FragmentJob.hpp" 25 25 #include "Results/FragmentResult.hpp" 26 26 #include "WorkerAddress.hpp" 27 27 28 class SubmitResultOperation : public Operation {28 class SubmitResultOperation : public AsyncOperation { 29 29 public: 30 30 /// Constructor for class SubmitResultOperation. 31 31 SubmitResultOperation(Connection &_connection, const WorkerAddress &_address) : 32 Operation(std::string("submitresult"),_connection),32 AsyncOperation(std::string("submitresult"),_connection), 33 33 result( new FragmentResult(JobId::NoJob, std::string("EmptyResult")) ), 34 34 address(_address), -
src/Fragmentation/Automation/Controller/FragmentController.cpp
rfe95b7 rf98c8e 28 28 29 29 #include "Controller/FragmentController.hpp" 30 #include "Controller/Commands/Operation.hpp"31 30 #include "Controller/Commands/CheckResultsOperation.hpp" 32 31 #include "Controller/Commands/GetNextJobIdOperation.hpp" -
src/Fragmentation/Automation/Makefile.am
rfe95b7 rf98c8e 43 43 44 44 FRAGMENTATIONCOMMANDSSOURCE = \ 45 Controller/Commands/AsyncOperation.cpp \ 45 46 Controller/Commands/CheckResultsOperation.cpp \ 46 47 Controller/Commands/EnrollInPoolOperation.cpp \ 47 48 Controller/Commands/GetNextJobIdOperation.cpp \ 48 49 Controller/Commands/ObtainJobOperation.cpp \ 49 Controller/Commands/Operation.cpp \50 50 Controller/Commands/ReceiveJobsOperation.cpp \ 51 51 Controller/Commands/SendJobToWorkerOperation.cpp \ … … 56 56 FRAGMENTATIONCOMMANDSHEADER = \ 57 57 ControllerChoices.hpp \ 58 Controller/Commands/AsyncOperation.hpp \ 58 59 Controller/Commands/CheckResultsOperation.hpp \ 59 60 Controller/Commands/EnrollInPoolOperation.hpp \ 60 61 Controller/Commands/GetNextJobIdOperation.hpp \ 61 62 Controller/Commands/ObtainJobOperation.hpp \ 62 Controller/Commands/Operation.hpp \63 63 Controller/Commands/ReceiveJobsOperation.hpp \ 64 64 Controller/Commands/SendJobToWorkerOperation.hpp \ -
src/Fragmentation/Automation/Pool/PoolWorker.cpp
rfe95b7 rf98c8e 69 69 enrollOp(connection_, address), 70 70 submitOp(connection_, address), 71 submitresult(boost::bind(& Operation::operator(),71 submitresult(boost::bind(&AsyncOperation::operator(), 72 72 boost::ref(submitOp), 73 73 _host, _service))
Note:
See TracChangeset
for help on using the changeset viewer.