- Timestamp:
- Jun 27, 2012, 4:07:20 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:
- d1dbfc
- Parents:
- bf56f6
- git-author:
- Frederik Heber <heber@…> (02/16/12 11:12:40)
- git-committer:
- Frederik Heber <heber@…> (06/27/12 16:07:20)
- Location:
- src/Fragmentation/Automation
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/Controller/Commands/CheckResultsOperation.cpp
rbf56f6 r6f2bc7 26 26 #include <iostream> 27 27 #include "Connection.hpp" // Must come before boost/serialization headers. 28 #include <boost/serialization/vector.hpp> 28 29 #include "CodePatterns/Info.hpp" 29 30 #include "CodePatterns/Log.hpp" … … 46 47 enum ControllerChoices choice = CheckState; 47 48 connection_.async_write(choice, 48 boost::bind(&CheckResultsOperation::handle_Receive DoneJobs, this,49 boost::bind(&CheckResultsOperation::handle_ReceiveJobInfo, this, 49 50 boost::asio::placeholders::error)); 50 51 } else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator()) { … … 68 69 * \param e error code if something went wrong 69 70 */ 70 void CheckResultsOperation::handle_Receive DoneJobs(const boost::system::error_code& e)71 void CheckResultsOperation::handle_ReceiveJobInfo(const boost::system::error_code& e) 71 72 { 72 73 Info info(__FUNCTION__); … … 75 76 // The connection::async_read() function will automatically 76 77 // decode the data that is written to the underlying socket. 77 LOG(1, "INFO: Checking number ofdone jobs ...");78 connection_.async_read( doneJobs,78 LOG(1, "INFO: Obtaining number of present and done jobs ..."); 79 connection_.async_read(jobInfo, 79 80 boost::bind(&Operation::handle_FinishOperation, this, 80 81 boost::asio::placeholders::error)); … … 88 89 } 89 90 91 /** Getter for jobInfo. 92 * 93 * \sa checkResults() 94 * \param number of present jobs 95 */ 96 size_t CheckResultsOperation::getPresentJobs() const 97 { 98 ASSERT( jobInfo.size() == (size_t)2, 99 "CheckResultsOperation::getPresentJobs() - jobInfo does not contain present and done jobs."); 100 return jobInfo[0]; 101 } 102 103 /** Getter for jobInfo. 104 * 105 * \sa checkResults() 106 * \param number of done jobs 107 */ 108 size_t CheckResultsOperation::getDoneJobs() const 109 { 110 ASSERT( jobInfo.size() == (size_t)2, 111 "CheckResultsOperation::getPresentJobs() - jobInfo does not contain present and done jobs."); 112 return jobInfo[1]; 113 } 114 -
src/Fragmentation/Automation/Controller/Commands/CheckResultsOperation.hpp
rbf56f6 r6f2bc7 21 21 #include "Controller/Commands/Operation.hpp" 22 22 23 23 /** This Operations requests number of present jobs and present results (done 24 * jobs) from the server. 25 * 26 */ 24 27 class CheckResultsOperation : public Operation { 25 28 public: … … 27 30 CheckResultsOperation(Connection &_connection) : 28 31 Operation(std::string("checkresults"), _connection), 29 doneJobs(0)32 jobInfo((size_t)2, 0) 30 33 {} 31 34 /// Destructor for class CheckResultsOperation … … 38 41 39 42 /// Callback function when doneJobs have been received. 40 void handle_Receive DoneJobs(const boost::system::error_code& e);43 void handle_ReceiveJobInfo(const boost::system::error_code& e); 41 44 42 /** Getter for doneJobs. 43 * 44 * \sa checkResults() 45 * \param doneJobs 46 */ 47 size_t getDoneJobs() const 48 { 49 return doneJobs; 50 } 45 /// Getter for presentJobs 46 size_t getPresentJobs() const; 47 48 /// Getter for doneJobs 49 size_t getDoneJobs() const; 51 50 52 51 protected: 53 /// current ly calculated results54 s ize_t doneJobs;52 /// current jobs left to calculate and currently calculated results 53 std::vector<size_t> jobInfo; 55 54 }; 56 55 -
src/Fragmentation/Automation/FragmentScheduler.cpp
rbf56f6 r6f2bc7 66 66 ), 67 67 result( new FragmentResult(JobId::NoJob) ), 68 jobInfo((size_t)2, 0), 68 69 choice(NoOperation), 69 70 Exitflag(OkFlag) … … 259 260 { 260 261 // first update number 261 doneJobs = JobsQueue.getDoneJobs(); 262 jobInfo[0] = JobsQueue.getPresentJobs(); 263 jobInfo[1] = JobsQueue.getDoneJobs(); 262 264 // now we accept connections to check for state of calculations 263 LOG(1, "INFO: Sending state that "+toString( doneJobs)+" jobs are done to controller ...");264 conn->async_write( doneJobs,265 LOG(1, "INFO: Sending state that "+toString(jobInfo[0])+" jobs are present and "+toString(jobInfo[1])+" jobs are done to controller ..."); 266 conn->async_write(jobInfo, 265 267 boost::bind(&FragmentScheduler::handle_CheckResultState, this, 266 268 boost::asio::placeholders::error, conn)); … … 345 347 Info info(__FUNCTION__); 346 348 // do nothing 347 LOG(1, "INFO: Sent that " << doneJobs << " jobs are done.");349 LOG(1, "INFO: Sent that " << jobInfo << " jobs are (scheduled, done)."); 348 350 } 349 351 -
src/Fragmentation/Automation/FragmentScheduler.hpp
rbf56f6 r6f2bc7 97 97 std::vector<FragmentJob::ptr> jobs; 98 98 99 /// number of jobs that are calculated, required for returning status100 s ize_t doneJobs;99 /// number of jobs that are waiting to be and are calculated, required for returning status 100 std::vector<size_t> jobInfo; 101 101 102 102 // choice -
src/Fragmentation/Automation/controller.cpp
rbf56f6 r6f2bc7 106 106 controller.Commands.getByName("checkresults")); 107 107 const size_t doneJobs = checkres->getDoneJobs(); 108 LOG(1, "INFO: " << doneJobs << " jobs are calculated so far."); 108 const size_t presentJobs = checkres->getPresentJobs(); 109 LOG(1, "INFO: #" << presentJobs << " are waiting in the queue and #" << doneJobs << " jobs are calculated so far."); 109 110 } 110 111
Note:
See TracChangeset
for help on using the changeset viewer.