source: src/JobMarket/Operations/Controllers/CheckResultsOperation.hpp@ 404d2b

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_JobMarket Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 404d2b was 404d2b, checked in by Frederik Heber <heber@…>, 8 years ago

Squashed 'ThirdParty/JobMarket/' content from commit e194722

git-subtree-dir: ThirdParty/JobMarket
git-subtree-split: e19472277e62c493f6c10f1483fe21e64c1039e9

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[404d2b]1/*
2 * CheckResultsOperation.hpp
3 *
4 * Created on: Dec 11, 2011
5 * Author: heber
6 */
7
8#ifndef FRAGMENTCONTROLLER_CHECKRESULTSOPERATION_HPP_
9#define FRAGMENTCONTROLLER_CHECKRESULTSOPERATION_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <boost/asio.hpp>
17#include <set>
18#include <string>
19
20#include "JobMarket/Connection.hpp"
21
22#include "JobMarket/Operations/AsyncOperation.hpp"
23#include "JobMarket/types.hpp"
24
25/** This Operations requests number of present jobs and present results (done
26 * jobs) from the server.
27 *
28 */
29class CheckResultsOperation : public AsyncOperation {
30public:
31 /// Constructor for class CheckResultsOperation.
32 CheckResultsOperation(Connection &_connection,
33 const boost::function<void ()> _callback_on_success = NoOpCallback,
34 const boost::function<void ()> _callback_on_failure = NoOpCallback) :
35 AsyncOperation(std::string("checkresults"), _connection, _callback_on_success, _callback_on_failure),
36 jobids(emptyids),
37 jobInfo((size_t)2, 0)
38 {}
39 /// Destructor for class CheckResultsOperation
40 ~CheckResultsOperation() {}
41
42public:
43 // virtual function pointer to the connection handler
44 virtual void handle_connect(const boost::system::error_code& e,
45 boost::asio::ip::tcp::resolver::iterator endpoint_iterator);
46
47 /// Callback function when sending jobids to know state of.
48 void handle_SendJobIds(const boost::system::error_code& e);
49
50 /// Callback function when doneJobs have been received.
51 void handle_ReceiveJobInfo(const boost::system::error_code& e);
52
53 /// Setter for internal vector of jobids to check
54 void setJobIds(const std::set<JobId_t> &_jobids)
55 { const_cast<std::set<JobId_t> &>(jobids) = _jobids; }
56
57 /// Getter for presentJobs
58 size_t getPresentJobs() const;
59
60 /// Getter for doneJobs
61 size_t getDoneJobs() const;
62
63protected:
64 //!> internal ref to the jobids to check
65 const std::set<JobId_t> &jobids;
66
67 /// current jobs left to calculate and currently calculated results
68 std::vector<size_t> jobInfo;
69
70private:
71 //!> internal empty ids vector to use as default ref
72 static const std::set<JobId_t> emptyids;
73
74};
75
76#endif /* FRAGMENTCONTROLLER_CHECKRESULTSOPERATION_HPP_ */
Note: See TracBrowser for help on using the repository browser.