- 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:
- af81f8
- Parents:
- b5ebb5
- git-author:
- Frederik Heber <heber@…> (10/23/11 20:20:19)
- git-committer:
- Frederik Heber <heber@…> (05/04/12 14:19:06)
- Location:
- src/Fragmentation/Automation
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/FragmentJob.cpp
rb5ebb5 rb05673 26 26 */ 27 27 FragmentJob::FragmentJob() : 28 outputfile(""),29 JobId(-1)28 JobId(-1), 29 outputfile("") 30 30 {} 31 31 … … 36 36 */ 37 37 FragmentJob::FragmentJob(const std::string &_outputfile, const JobId_t _JobId) : 38 outputfile(_outputfile),39 JobId(_JobId)38 JobId(_JobId), 39 outputfile(_outputfile) 40 40 {} 41 41 … … 52 52 bool FragmentJob::operator==(const FragmentJob &other) const 53 53 { 54 return (outputfile == other.outputfile) && ( JobId == JobId);54 return (outputfile == other.outputfile) && (getId() == other.getId()); 55 55 } 56 57 const JobId_t FragmentJob::getId() const58 {59 return JobId;60 } -
src/Fragmentation/Automation/FragmentJob.hpp
rb5ebb5 rb05673 16 16 #include <string> 17 17 18 #include "boost/serialization/a ccess.hpp"18 #include "boost/serialization/array.hpp" 19 19 20 #include "JobId.hpp" 20 21 #include "types.hpp" 21 22 … … 28 29 * transfered to a scheduler (server) and be deserialized by the Worker. 29 30 */ 30 class FragmentJob 31 class FragmentJob : public JobId 31 32 { 32 33 friend class FragmentWorker; … … 42 43 } 43 44 44 const JobId_t getId() const; 45 //!> string containing the configuration file for the solver 46 std::string outputfile; 45 47 46 48 private: … … 50 52 void serialize(Archive& ar, const unsigned int version) 51 53 { 54 ar & boost::serialization::base_object<JobId>(*this); 52 55 ar & outputfile; 53 ar & JobId;54 56 } 55 56 private:57 //!> string containing the configuration file for the solver58 std::string outputfile;59 //!> unique id of this job (used for the temporary filename) and associating result60 JobId_t JobId;61 57 }; 62 58 -
src/Fragmentation/Automation/FragmentQueue.cpp
rb5ebb5 rb05673 100 100 { 101 101 /// check for presence 102 ResultMap::iterator iter = results.find( jobid);102 ResultMap::iterator iter = results.find(result.getId()); 103 103 ASSERT(iter != results.end(), 104 "FragmentQueue::pushResult() - job "+toString( jobid)+" is not known to us.");104 "FragmentQueue::pushResult() - job "+toString(result.getId())+" is not known to us."); 105 105 ASSERT(iter->second == NoResult, 106 "FragmentQueue::pushResult() - is not waiting for the result of job "+toString( jobid)+".");106 "FragmentQueue::pushResult() - is not waiting for the result of job "+toString(result.getId())+"."); 107 107 /// and overwrite NoResult in found entry 108 108 iter->second = result; -
src/Fragmentation/Automation/FragmentResult.cpp
rb5ebb5 rb05673 25 25 /** Constructor of class FragmentResult. 26 26 * 27 * \param id id of FragmntJob associated to this FragmentResult.27 * \param _id id of FragmntJob associated to this FragmentResult. 28 28 */ 29 29 FragmentResult::FragmentResult(const JobId_t _id) : 30 id(_id),30 JobId(_id), 31 31 result(std::string("Nothing")) 32 32 {} … … 36 36 */ 37 37 FragmentResult::FragmentResult(const FragmentResult &other) : 38 id(other.id),38 JobId(other.getId()), 39 39 result(other.result) 40 40 {} … … 46 46 {} 47 47 48 /** Equality operator: Equal if both ids are the same48 /** Equality operator: Equal if both JobIds are the same 49 49 * 50 50 * \param other instance to check against 51 * \return true - both ids are the same, false - ids are not the same.51 * \return true - both JobIds are the same, false - JobIds are not the same. 52 52 */ 53 53 bool FragmentResult::operator==(const FragmentResult &other) const 54 54 { 55 return id == other.id;55 return getId() == other.getId(); 56 56 } 57 57 58 58 /** Assigment operator. 59 59 * 60 * \note We can't use default assigment because of const member FragmentResult:: id.60 * \note We can't use default assigment because of const member FragmentResult::JobId. 61 61 * 62 62 * \param other instance to make equal to … … 66 66 /// check self-assignment 67 67 if (this != &other) { 68 const_cast<JobId_t &>(id) = other.id;68 setId(other.getId()); 69 69 result = other.result; 70 70 } -
src/Fragmentation/Automation/FragmentResult.hpp
rb5ebb5 rb05673 16 16 17 17 #include <string> 18 19 #include "boost/serialization/array.hpp" 20 21 #include "JobId.hpp" 18 22 #include "types.hpp" 19 23 … … 21 25 * 22 26 */ 23 class FragmentResult 27 class FragmentResult : public JobId 24 28 { 25 29 public: … … 33 37 { return !(*this == other); } 34 38 35 36 //!> this job's unique id37 const JobId_t id;38 39 //!> result 39 40 std::string result; 41 42 private: 43 friend class boost::serialization::access; 44 // serialization 45 template <typename Archive> 46 void serialize(Archive& ar, const unsigned int version) 47 { 48 ar & boost::serialization::base_object<JobId>(*this); 49 ar & result; 50 } 40 51 }; 41 52 -
src/Fragmentation/Automation/FragmentWorker.cpp
rb5ebb5 rb05673 88 88 void FragmentWorker::handle_read(const boost::system::error_code& e) 89 89 { 90 90 Info info(__FUNCTION__); 91 91 if (!e) 92 92 { … … 96 96 std::cout << "Job number " << i << "\n"; 97 97 std::cout << " output: " << jobs_[i].outputfile << "\n"; 98 std::cout << " id: " << jobs_[i]. JobId<< "\n";98 std::cout << " id: " << jobs_[i].getId() << "\n"; 99 99 } 100 100 } -
src/Fragmentation/Automation/Makefile.am
rb5ebb5 rb05673 13 13 AM_CPPFLAGS = ${BOOST_CPPFLAGS} ${CodePatterns_CFLAGS} 14 14 15 INCLUDES = -I$(top_srcdir)/src/unittests -I$(top_srcdir)/src/Actions -I$(top_srcdir)/src/UIElements -I$(top_srcdir)/LinearAlgebra/src16 17 15 bin_PROGRAMS += Server Worker 18 16 19 S erver_SOURCES= \17 SERVERSOURCE = \ 20 18 atexit.cpp \ 19 FragmentJob.cpp \ 20 FragmentScheduler.cpp \ 21 JobId.cpp \ 22 Server.cpp 23 24 SERVERHEADER = \ 21 25 atexit.hpp \ 22 26 Connection.hpp \ 27 FragmentJob.hpp \ 28 FragmentScheduler.hpp \ 29 JobId.hpp 30 31 WORKERSOURCE = \ 32 atexit.cpp \ 23 33 FragmentJob.cpp \ 34 FragmentWorker.cpp \ 35 JobId.cpp \ 36 Worker.cpp 37 38 WORKERHEADER = \ 39 atexit.hpp \ 40 Connection.hpp \ 24 41 FragmentJob.hpp \ 25 FragmentScheduler.cpp \ 26 FragmentScheduler.hpp \ 27 Server.cpp 42 FragmentWorker.hpp \ 43 JobId.hpp 44 45 Server_SOURCES = $(SERVERSOURCE) $(SERVERHEADER) 28 46 Server_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS) 29 47 Server_CXXFLAGS = $(AM_CPPFLAGS) … … 35 53 ${CodePatterns_LIBS} 36 54 37 Worker_SOURCES = \ 38 atexit.cpp \ 39 atexit.hpp \ 40 Connection.hpp \ 41 FragmentJob.cpp \ 42 FragmentJob.hpp \ 43 FragmentWorker.cpp \ 44 FragmentWorker.hpp \ 45 Worker.cpp 55 Worker_SOURCES = $(WORKERSOURCE) $(WORKERHEADER) 46 56 Worker_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS) 47 57 Worker_CXXFLAGS = $(AM_CPPFLAGS) -
src/Fragmentation/Automation/unittests/Makefile.am
rb5ebb5 rb05673 17 17 18 18 FRAGMENTATIONAUTOMATIONLIBS = \ 19 $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \ 19 20 $(BOOST_THREAD_LDFLAGS) $(BOOST_THREAD_LIBS) \ 20 21 ${CodePatterns_LIBS} … … 30 31 FragmentQueue.hpp \ 31 32 FragmentResult.cpp \ 32 FragmentResult.hpp 33 FragmentResult.hpp \ 34 JobId.cpp \ 35 JobId.hpp 33 36 FragmentQueueUnitTest_LDADD = $(FRAGMENTATIONAUTOMATIONLIBS) 34 37
Note:
See TracChangeset
for help on using the changeset viewer.