Changeset 9d14c3


Ignore:
Timestamp:
Jul 2, 2012, 7:54:12 AM (12 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:
50d095
Parents:
425fc6
git-author:
Frederik Heber <heber@…> (03/04/12 20:26:06)
git-committer:
Frederik Heber <heber@…> (07/02/12 07:54:12)
Message:

FIX: Renamed SendResultsOperation -> ReceiveResultsOperation in file and class.

Location:
src/Fragmentation/Automation
Files:
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Automation/Controller/Commands/ReceiveResultsOperation.cpp

    r425fc6 r9d14c3  
    77
    88/*
    9  * SendResultsOperation.cpp
     9 * ReceiveResultsOperation.cpp
    1010 *
    1111 *  Created on: Dec 11, 2011
     
    3333#include "Results/FragmentResult.hpp"
    3434
    35 #include "Controller/Commands/SendResultsOperation.hpp"
     35#include "Controller/Commands/ReceiveResultsOperation.hpp"
    3636
    3737/** Handle connect operation to send results.
     
    4040 * \param endpoint_iterator endpoint of the connection
    4141 */
    42 void SendResultsOperation::handle_connect(const boost::system::error_code& e,
     42void ReceiveResultsOperation::handle_connect(const boost::system::error_code& e,
    4343    boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
    4444{
     
    4747  {
    4848    // Successfully established connection. Give choice.
    49     enum ControllerChoices choice = SendResults;
     49    enum ControllerChoices choice = ReceiveResults;
    5050    connection_.async_write(choice,
    51       boost::bind(&SendResultsOperation::handle_ReceivingResults, this,
     51      boost::bind(&ReceiveResultsOperation::handle_ReceivingResults, this,
    5252      boost::asio::placeholders::error));
    5353  } else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator()) {
     
    5656    boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
    5757    connection_.socket().async_connect(endpoint,
    58       boost::bind(&SendResultsOperation::handle_connect, this,
     58      boost::bind(&ReceiveResultsOperation::handle_connect, this,
    5959      boost::asio::placeholders::error, ++endpoint_iterator));
    6060  } else {
     
    6767}
    6868
    69 /** Callback function when results have been received.
     69/** Callback function when preparing to receive results
    7070 *
    7171 * \param e error code if something went wrong
    7272 */
    73 void SendResultsOperation::handle_ReceivingResults(const boost::system::error_code& e)
     73void ReceiveResultsOperation::handle_ReceivingResults(const boost::system::error_code& e)
    7474{
    7575  Info info(__FUNCTION__);
    7676  if (!e)
    7777  {
    78      // The connection::async_read() function will automatically
    79      // decode the data that is written to the underlying socket.
    80      LOG(1, "INFO: Sending "+toString(results.size())+" results ...");
    81      connection_.async_read(results,
    82         boost::bind(&SendResultsOperation::handle_ReceivedResults, this,
    83         boost::asio::placeholders::error));
     78    // The connection::async_read() function will automatically
     79    // decode the data that is written to the underlying socket.
     80    LOG(1, "INFO: Sending "+toString(results.size())+" results ...");
     81    connection_.async_read(results,
     82      boost::bind(&ReceiveResultsOperation::handle_ReceivedResults, this,
     83      boost::asio::placeholders::error));
    8484  }
    8585  else
     
    8989    ELOG(1, e.message());
    9090  }
    91 
    92   // Since we are not starting a new operation the io_service will run out of
    93   // work to do and the client will exit.
    9491}
    95 
    9692
    9793/** Callback function when results have been received.
     
    9995 * \param e error code if something went wrong
    10096 */
    101 void SendResultsOperation::handle_ReceivedResults(const boost::system::error_code& e)
     97void ReceiveResultsOperation::handle_ReceivedResults(const boost::system::error_code& e)
    10298{
    10399  Info info(__FUNCTION__);
     
    105101  LOG(1, "INFO: Received "+toString(results.size())+" results.");
    106102
    107   AsyncOperation::handle_FinishOperation(e);
     103  ReceiveResultsOperation::handle_FinishOperation(e);
    108104}
    109105
     
    113109 * \return vector of results for the added jobs (\sa addJobs()).
    114110 */
    115 std::vector<FragmentResult::ptr> SendResultsOperation::getResults()
     111std::vector<FragmentResult::ptr> ReceiveResultsOperation::getResults()
    116112{
    117113  Info info(__FUNCTION__);
  • src/Fragmentation/Automation/Controller/Commands/ReceiveResultsOperation.hpp

    r425fc6 r9d14c3  
    11/*
    2  * SendResultsOperation.hpp
     2 * ReceiveResultsOperation.hpp
    33 *
    44 *  Created on: Dec 11, 2011
     
    66 */
    77
    8 #ifndef FRAGMENTCONTROLLER_SENDRESULTSOPERATION_HPP_
    9 #define FRAGMENTCONTROLLER_SENDRESULTSOPERATION_HPP_
     8#ifndef FRAGMENTCONTROLLER_RECEIVERESULTSOPERATION_HPP_
     9#define FRAGMENTCONTROLLER_RECEIVERESULTSOPERATION_HPP_
    1010
    1111// include config.h
     
    2323#include "Controller/Commands/AsyncOperation.hpp"
    2424
    25 class SendResultsOperation : public AsyncOperation  {
     25class ReceiveResultsOperation : public AsyncOperation  {
    2626public:
    27   /// Constructor for class SendResultsOperation.
    28   SendResultsOperation(Connection &_connection) :
    29     AsyncOperation(std::string("sendresults"), _connection) {}
    30   /// Destructor for class SendResultsOperation
    31   ~SendResultsOperation() {}
     27  /// Constructor for class ReceiveResultsOperation.
     28  ReceiveResultsOperation(Connection &_connection) :
     29    AsyncOperation(std::string("receiveresults"), _connection) {}
     30  /// Destructor for class ReceiveResultsOperation
     31  ~ReceiveResultsOperation() {}
    3232
    3333public:
     
    5050};
    5151
    52 #endif /* FRAGMENTCONTROLLER_SENDRESULTSOPERATION_HPP_ */
     52#endif /* FRAGMENTCONTROLLER_RECEIVERESULTSOPERATION_HPP_ */
  • src/Fragmentation/Automation/Controller/FragmentController.cpp

    r425fc6 r9d14c3  
    3030#include "Controller/Commands/CheckResultsOperation.hpp"
    3131#include "Controller/Commands/GetNextJobIdOperation.hpp"
     32#include "Controller/Commands/ReceiveResultsOperation.hpp"
    3233#include "Controller/Commands/SendJobsOperation.hpp"
    33 #include "Controller/Commands/SendResultsOperation.hpp"
    3434#include "Controller/Commands/ShutdownOperation.hpp"
    3535
     
    4949  Commands.registerInstance(new CheckResultsOperation(connection_));
    5050  Commands.registerInstance(new GetNextJobIdOperation(connection_));
     51  Commands.registerInstance(new ReceiveResultsOperation(connection_));
    5152  Commands.registerInstance(new SendJobsOperation(connection_));
    52   Commands.registerInstance(new SendResultsOperation(connection_));
    5353  Commands.registerInstance(new ShutdownOperation(connection_));
    5454}
  • src/Fragmentation/Automation/ControllerChoices.hpp

    r425fc6 r9d14c3  
    2020  SendJobs,
    2121  CheckState,
    22   SendResults,
     22  ReceiveResults,
    2323  ShutdownControllerSocket
    2424};
  • src/Fragmentation/Automation/FragmentScheduler.cpp

    r425fc6 r9d14c3  
    374374      break;
    375375    }
    376     case SendResults:
     376    case ReceiveResults:
    377377    {
    378378      const std::vector<FragmentResult::ptr> results = JobsQueue.getAllResults();
  • src/Fragmentation/Automation/Makefile.am

    r425fc6 r9d14c3  
    4848  Controller/Commands/GetNextJobIdOperation.cpp \
    4949  Controller/Commands/ObtainJobOperation.cpp \
     50  Controller/Commands/ReceiveResultsOperation.cpp \
    5051  Controller/Commands/RemoveFromPoolOperation.cpp \
    5152  Controller/Commands/SendJobsOperation.cpp \
    5253  Controller/Commands/SendJobToWorkerOperation.cpp \
    53   Controller/Commands/SendResultsOperation.cpp \
    5454  Controller/Commands/ShutdownOperation.cpp \
    5555  Controller/Commands/ShutdownWorkerOperation.cpp \
     
    6565  Controller/Commands/ObtainJobOperation.hpp \
    6666  Controller/Commands/Operation.hpp \
     67  Controller/Commands/ReceiveResultsOperation.hpp \
    6768  Controller/Commands/RemoveFromPoolOperation.hpp \
    6869  Controller/Commands/SendJobsOperation.hpp \
    6970  Controller/Commands/SendJobToWorkerOperation.hpp \
    70   Controller/Commands/SendResultsOperation.hpp \
    7171  Controller/Commands/ShutdownOperation.hpp \
    7272  Controller/Commands/ShutdownWorkerOperation.hpp \
  • src/Fragmentation/Automation/controller.cpp

    r425fc6 r9d14c3  
    4242#include "Controller/Commands/CheckResultsOperation.hpp"
    4343#include "Controller/Commands/GetNextJobIdOperation.hpp"
     44#include "Controller/Commands/ReceiveResultsOperation.hpp"
    4445#include "Controller/Commands/SendJobsOperation.hpp"
    45 #include "Controller/Commands/SendResultsOperation.hpp"
    4646#include "Controller/Commands/ShutdownOperation.hpp"
    4747#include "Jobs/MPQCCommandJob.hpp"
     
    197197    const std::string &service)
    198198{
    199   SendResultsOperation *sendres = static_cast<SendResultsOperation *>(
    200       controller.Commands.getByName("sendresults"));
    201   (*sendres)(host, service);
     199  ReceiveResultsOperation *receiveres = static_cast<ReceiveResultsOperation *>(
     200      controller.Commands.getByName("receiveresults"));
     201  (*receiveres)(host, service);
    202202}
    203203
     
    208208void printreceivedresults(FragmentController &controller)
    209209{
    210   SendResultsOperation *sendres = static_cast<SendResultsOperation *>(
    211       controller.Commands.getByName("sendresults"));
    212   std::vector<FragmentResult::ptr> results = sendres->getResults();
     210  ReceiveResultsOperation *receiveres = static_cast<ReceiveResultsOperation *>(
     211      controller.Commands.getByName("receiveresults"));
     212  std::vector<FragmentResult::ptr> results = receiveres->getResults();
    213213  for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
    214214      iter != results.end(); ++iter)
     
    222222void printreceivedmpqcresults(FragmentController &controller, const std::string &KeySetFilename)
    223223{
    224   SendResultsOperation *sendres = static_cast<SendResultsOperation *>(
    225       controller.Commands.getByName("sendresults"));
    226   std::vector<FragmentResult::ptr> results = sendres->getResults();
     224  ReceiveResultsOperation *receiveres = static_cast<ReceiveResultsOperation *>(
     225      controller.Commands.getByName("receiveresults"));
     226  std::vector<FragmentResult::ptr> results = receiveres->getResults();
    227227
    228228  // parse in KeySetfile
Note: See TracChangeset for help on using the changeset viewer.