Changeset a5c293 for ThirdParty/JobMarket/src
- Timestamp:
- Apr 10, 2018, 6:42:56 AM (7 years ago)
- Branches:
- AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
- Children:
- cdfb6f
- Parents:
- 1e58bb
- git-author:
- Frederik Heber <frederik.heber@…> (04/07/18 21:52:17)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/10/18 06:42:56)
- Location:
- ThirdParty/JobMarket/src/JobMarket
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ThirdParty/JobMarket/src/JobMarket/Controller/FragmentController.cpp
r1e58bb ra5c293 173 173 const std::string &service) 174 174 { 175 GetNumberWorkersOperation * checkres = static_cast<GetNumberWorkersOperation *>(175 GetNumberWorkersOperation *numberworkers = static_cast<GetNumberWorkersOperation *>( 176 176 Commands.getByName("numberworkers")); 177 (* checkres)(host, service);177 (*numberworkers)(host, service); 178 178 } 179 179 … … 197 197 std::vector<size_t> FragmentController::getNumberOfWorkers() 198 198 { 199 const GetNumberWorkersOperation * const checkres = static_cast<const GetNumberWorkersOperation *>(199 const GetNumberWorkersOperation * const numberworkers = static_cast<const GetNumberWorkersOperation *>( 200 200 Commands.getByName("numberworkers")); 201 return checkres->get();201 return numberworkers->get(); 202 202 } 203 203 … … 214 214 Commands.getByName("removeallresults")); 215 215 (*removeall)(host, service); 216 setExitflagFromStatus(*removeall); 216 217 } 217 218 … … 228 229 Commands.getByName("removealljobs")); 229 230 (*removeall)(host, service); 231 setExitflagFromStatus(*removeall); 230 232 } 231 233 … … 242 244 Commands.getByName("removeallworker")); 243 245 (*removeall)(host, service); 246 setExitflagFromStatus(*removeall); 244 247 } 245 248 … … 304 307 job->setId(_newid); 305 308 } 309 310 /** helper function to set exit flag from SyncOperations' status. 311 * 312 * \param op operation whose status to check 313 */ 314 void FragmentController::setExitflagFromStatus(const Operation &op) 315 { 316 if (op.getStatus() == Operation::success) 317 setExitflag(ExitflagContainer::OkFlag); 318 else 319 setExitflag(ExitflagContainer::ErrorFlag); 320 } -
ThirdParty/JobMarket/src/JobMarket/Controller/FragmentController.hpp
r1e58bb ra5c293 73 73 boost::function<void ()> failed; 74 74 75 void setExitflagFromStatus(const Operation &op); 76 75 77 private: 76 78 //!> grant this specifically made proxy access to jobids -
ThirdParty/JobMarket/src/JobMarket/Operations/SyncOperation.cpp
r1e58bb ra5c293 48 48 // Start an asynchronous connect operation. 49 49 LOG(3, "DEBUG: Connecting synchronously to endpoint " << endpoint << " ..."); 50 connection_.socket().connect(endpoint); 50 boost::system::error_code ec; 51 connection_.socket().connect(endpoint, ec); 52 if (ec) { 53 ELOG(1, ec.message()); 54 status = Operation::error; 55 } 51 56 } else { 52 57 status = Operation::error; … … 60 65 void SyncOperation::disconnect() 61 66 { 62 connection_.socket().close(); 67 boost::system::error_code ec; 68 connection_.socket().close(ec); 69 if (ec) { 70 ELOG(1, ec.message()); 71 status = Operation::error; 72 } 63 73 } 64 74 … … 78 88 79 89 // call virtual function to continue 80 internal(); 90 if (status == Operation::running) 91 internal(); 81 92 82 93 // disconnect 83 disconnect(); 94 if (status == Operation::running) 95 disconnect(); 84 96 85 97 if (status == Operation::running)
Note:
See TracChangeset
for help on using the changeset viewer.