Changeset 45cdce6 for src


Ignore:
Timestamp:
Aug 20, 2014, 12:58:30 PM (10 years ago)
Author:
Frederik Heber <heber@…>
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:
3a33e3
Parents:
4e65af
git-author:
Frederik Heber <heber@…> (08/13/14 15:08:14)
git-committer:
Frederik Heber <heber@…> (08/20/14 12:58:30)
Message:

MPQCCommandFragmentController supports FragmentationAutomationAction being a Process.

  • i.e. it also calls an update handler when more results have been received.
Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/FragmentationAutomationAction.cpp

    r4e65af r45cdce6  
    108108}
    109109
    110 #ifdef HAVE_JOBMARKET
    111110static void updateSteps(Process &p, const size_t step, const size_t total)
    112111{
     
    114113  p.setCurrStep(step);
    115114}
    116 #endif
    117115
    118116ActionState::ptr FragmentationFragmentationAutomationAction::performCall() {
     
    178176        );
    179177    LOG(1, "INFO: Added " << NoJobs << " from FragmentJobsQueue.");
     178
     179    // prepare process
     180    setMaxSteps(NumberJobs);
     181    mpqccontroller.setUpdateHandler(
     182        boost::bind(&updateSteps, boost::ref(*this), _1, _2)
     183        );
     184    start();
    180185    mpqccontroller.run();
     186    stop();
    181187
    182188    // get back the results and place them in shortrangedata
  • src/Fragmentation/Automation/MPQCCommandFragmentController.cpp

    r4e65af r45cdce6  
    8888void MPQCCommandFragmentController::run()
    8989{
     90  const size_t NoExpectedResults = queue.size();
    9091  // take jobs from queue and add them
    9192  std::vector<FragmentResult::ptr> resultvector;
     
    106107    // store result
    107108    resultvector.push_back(result);
     109    handler(resultvector.size(), NoExpectedResults);
    108110  }
    109111
  • src/Fragmentation/Automation/MPQCCommandFragmentController.hpp

    r4e65af r45cdce6  
    1616
    1717#include <boost/filesystem/path.hpp>
     18#include <boost/function.hpp>
    1819
    1920#include <list>
     
    3940  ~MPQCCommandFragmentController()
    4041  {}
     42
     43  typedef boost::function<void (const size_t,const size_t)> update_handler_t;
     44
     45  void setUpdateHandler(update_handler_t _handler)
     46  {
     47    handler = _handler;
     48  }
    4149
    4250  /** Command Controller to fill its hold of jobs from FragmentJobQueue.
     
    102110  //!> type-specific result container
    103111  ResultContainer<MPQCData> results;
     112
     113  //!> update handler that is called in waitforResults()
     114  update_handler_t handler;
    104115};
    105116
Note: See TracChangeset for help on using the changeset viewer.