- Timestamp:
- May 4, 2012, 2:19:06 PM (13 years ago)
- 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:
- a1b77d
- Parents:
- c7deca
- git-author:
- Frederik Heber <heber@…> (11/24/11 20:21:20)
- git-committer:
- Frederik Heber <heber@…> (05/04/12 14:19:06)
- Location:
- src/Fragmentation/Automation
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/FragmentJob.cpp
rc7deca r7b22e9 18 18 #endif 19 19 20 // boost asio needs specific operator new 21 #include <boost/asio.hpp> 22 #include <boost/date_time/posix_time/posix_time.hpp> 23 20 24 #include "CodePatterns/MemDebug.hpp" 21 25 26 #include "CodePatterns/Info.hpp" 27 #include "CodePatterns/Log.hpp" 28 #include "CodePatterns/toString.hpp" 22 29 #include "FragmentJob.hpp" 30 #include "FragmentResult.hpp" 23 31 24 32 /** Constructor for class FragmentJob. … … 46 54 {} 47 55 56 /** Work routine of this FragmentJob. 57 * 58 * This function encapsulates all the work that has to be done to generate 59 * a FragmentResult. Hence, the FragmentWorker does not need to know anything 60 * about the operation: it just receives it and executes this function. 61 * 62 * \return result of this job 63 */ 64 FragmentResult FragmentJob::Work() 65 { 66 Info info((std::string(__FUNCTION__)+std::string(", id #")+toString(getId())).c_str()); 67 FragmentResult s(getId()); 68 69 boost::asio::io_service io; 70 boost::asio::deadline_timer t(io, boost::posix_time::seconds(1)); 71 LOG(1, "INFO: Deadline timer will now wait for 1 seconds."); 72 t.wait(); 73 LOG(1, "INFO: Deadline timer is done."); 74 75 return s; 76 } 77 48 78 /** Comparator for class FragmentJob. 49 79 * \param other instance to compare to -
src/Fragmentation/Automation/FragmentJob.hpp
rc7deca r7b22e9 18 18 #include "boost/serialization/array.hpp" 19 19 20 #include "FragmentResult.hpp" 20 21 #include "JobId.hpp" 21 22 #include "types.hpp" … … 42 43 ~FragmentJob(); 43 44 45 FragmentResult Work(); 46 44 47 bool operator==(const FragmentJob &other) const; 45 48 -
src/Fragmentation/Automation/Makefile.am
rc7deca r7b22e9 36 36 atexit.cpp \ 37 37 FragmentJob.cpp \ 38 FragmentResult.cpp \ 38 39 FragmentWorker.cpp \ 39 40 JobId.cpp \ … … 44 45 Connection.hpp \ 45 46 FragmentJob.hpp \ 47 FragmentResult.hpp \ 46 48 FragmentWorker.hpp \ 47 49 JobId.hpp -
src/Fragmentation/Automation/unittests/FragmentJobUnitTest.cpp
rc7deca r7b22e9 29 29 30 30 #include "FragmentJob.hpp" 31 #include "FragmentResult.hpp" 32 #include "JobId.hpp" 31 33 32 34 #include "CodePatterns/Assert.hpp" … … 72 74 } 73 75 76 /** UnitTest for Work() 77 */ 78 void FragmentJobTest::WorkTest() 79 { 80 FragmentJob testJob(command, 1); 81 FragmentJob othertestJob(command, 2); 82 83 FragmentResult testResult(testJob.Work()); 84 FragmentResult othertestResult(othertestJob.Work()); 85 86 CPPUNIT_ASSERT_EQUAL( (JobId_t)1, testResult.getId() ); 87 CPPUNIT_ASSERT_EQUAL( (JobId_t)2, othertestResult.getId() ); 88 } 89 74 90 /** UnitTest for serialization 75 91 */ -
src/Fragmentation/Automation/unittests/FragmentJobUnitTest.hpp
rc7deca r7b22e9 25 25 CPPUNIT_TEST ( equalityTest ); 26 26 CPPUNIT_TEST ( serializationTest ); 27 CPPUNIT_TEST ( WorkTest ); 27 28 CPPUNIT_TEST_SUITE_END(); 28 29 … … 32 33 void equalityTest(); 33 34 void serializationTest(); 35 void WorkTest(); 34 36 35 37 private: -
src/Fragmentation/Automation/unittests/Makefile.am
rc7deca r7b22e9 25 25 $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \ 26 26 $(BOOST_THREAD_LDFLAGS) $(BOOST_THREAD_LIBS) \ 27 $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \ 27 28 ${CodePatterns_LIBS} 28 29 … … 34 35 FragmentJob.cpp \ 35 36 FragmentJob.hpp \ 37 unittests/stubs/FragmentResultStub.cpp \ 38 FragmentResult.hpp \ 36 39 JobId.cpp \ 37 40 JobId.hpp 38 41 FragmentJobUnitTest_LDADD = \ 39 ${FRAGMENTATIONLIBS} \ 40 $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) 42 $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \ 43 $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \ 44 ${CodePatterns_LIBS} 41 45 42 46 FragmentQueueUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl … … 53 57 JobId.cpp \ 54 58 JobId.hpp 55 FragmentQueueUnitTest_LDADD = $(FRAGMENTATIONAUTOMATIONLIBS) 59 FragmentQueueUnitTest_LDADD = \ 60 $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \ 61 $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \ 62 ${CodePatterns_LIBS} 56 63 57 64 FragmentResultUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl … … 65 72 JobId.hpp 66 73 FragmentResultUnitTest_LDADD = \ 67 ${FRAGMENTATIONLIBS} \ 68 $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) 74 $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \ 75 $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \ 76 ${CodePatterns_LIBS} 69 77 70 78
Note:
See TracChangeset
for help on using the changeset viewer.