Ignore:
Timestamp:
Jun 29, 2012, 1:23:14 PM (13 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:
aec098
Parents:
a8f54b6
git-author:
Frederik Heber <heber@…> (05/21/12 07:14:59)
git-committer:
Frederik Heber <heber@…> (06/29/12 13:23:14)
Message:

FragmentScheduler now uses WorkerChoices for handling connection workers.

  • Workers always first send address, then their choice and depending on this we branch into various handlers.
  • SubmitResultOperation and EnrollInPoolOperation now correctly give choice after sending address.
  • handle_enrolled uses getNextIdleWorker() to mark indirectly as busy. This is temporary.
  • we do not resubmit if Max_Attempts is 1.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Automation/FragmentScheduler.hpp

    ra8f54b6 r9a3f84  
    2929#include "Pool/WorkerPool.hpp"
    3030#include "WorkerAddress.hpp"
     31#include "WorkerChoices.hpp"
    3132
    3233/** FragmentScheduler serves FragmentJobs to Workers and accepts commands from
     
    6061      pool(_pool),
    6162      result( new FragmentResult(JobId::NoJob) ),
    62       callback_sendJobToWorker(_callback)
     63      callback_sendJobToWorker(_callback),
     64      choice(NoWorkerOperation)
    6365    {}
    6466    virtual ~WorkerListener_t() {}
     
    6870    void handle_Accept(const boost::system::error_code& e, connection_ptr conn);
    6971
     72    /// Handle completion of Worker operation to read choice
     73    void handle_ReadChoice(const boost::system::error_code& e, connection_ptr conn);
     74
    7075    /// Worker callback function when job has been sent.
    71     void handle_checkAddress(const boost::system::error_code& e, connection_ptr conn);
     76    void handle_ReadAddress(const boost::system::error_code& e, connection_ptr conn);
    7277
    7378    /// Worker callback function when new worker has enrolled.
     
    7681    /// Worker callback function when result has been received.
    7782    void handle_ReceiveResultFromWorker(const boost::system::error_code& e, connection_ptr conn);
     83
     84    /// Worker callback function when invalid result has been received.
     85    void handle_RejectResultFromWorker(const boost::system::error_code& e, connection_ptr conn);
    7886  private:
     87    //!> static entity to indicate to clients that the queue is empty.
     88    static FragmentJob::ptr NoJob;
     89
    7990    //!> address of new Worker
    8091    WorkerAddress address;
     
    8697    WorkerPool &pool;
    8798
    88     /// result that is received from the client.
     99    //!> result that is received from the client.
    89100    FragmentResult::ptr result;
    90101
     
    92103    boost::function<void (const WorkerAddress&, FragmentJob::ptr&)> callback_sendJobToWorker;
    93104
    94     // static entity to indicate to clients that the queue is empty.
    95     static FragmentJob::ptr NoJob;
     105    //!> choice
     106    enum WorkerChoices choice;
    96107  };
    97108
     
    136147    FragmentQueue & JobsQueue;
    137148
    138     /// bunch of jobs received from controller before placed in JobsQueue
     149    //!> bunch of jobs received from controller before placed in JobsQueue
    139150    std::vector<FragmentJob::ptr> jobs;
    140151
    141     /// number of jobs that are waiting to be and are calculated, required for returning status
     152    //!> number of jobs that are waiting to be and are calculated, required for returning status
    142153    std::vector<size_t> jobInfo;
    143154
    144     // choice
     155    //!> choice
    145156    enum ControllerChoices choice;
    146157
     
    154165
    155166private:
    156   /// Queue with data to be sent to each client.
     167  //!> Queue with data to be sent to each client.
    157168  FragmentQueue JobsQueue;
    158169
Note: See TracChangeset for help on using the changeset viewer.