| 1 | /* | 
|---|
| 2 | * MPQCJob.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: Feb 05, 2012 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef MPQCCOMMANDJOB_HPP_ | 
|---|
| 9 | #define MPQCCOMMANDJOB_HPP_ | 
|---|
| 10 |  | 
|---|
| 11 | // include config.h | 
|---|
| 12 | #ifdef HAVE_CONFIG_H | 
|---|
| 13 | #include <config.h> | 
|---|
| 14 | #endif | 
|---|
| 15 |  | 
|---|
| 16 | #include <boost/serialization/export.hpp> | 
|---|
| 17 |  | 
|---|
| 18 | #include <string> | 
|---|
| 19 |  | 
|---|
| 20 | #ifdef HAVE_JOBMARKET | 
|---|
| 21 | #include "JobMarket/Results/FragmentResult.hpp" | 
|---|
| 22 | #include "JobMarket/Jobs/SystemCommandJob.hpp" | 
|---|
| 23 | #else | 
|---|
| 24 | #include "Jobs/JobMarket/FragmentResult.hpp" | 
|---|
| 25 | #include "Jobs/JobMarket/SystemCommandJob.hpp" | 
|---|
| 26 | #endif | 
|---|
| 27 |  | 
|---|
| 28 | #include "Fragmentation/Summation/Containers/MPQCData.hpp" | 
|---|
| 29 |  | 
|---|
| 30 | class MPQCCommandJobTest; | 
|---|
| 31 | class MPQCCommandFragmentController; | 
|---|
| 32 |  | 
|---|
| 33 | /** This class calls mpqc for solving a specific Hartree Fock problem. | 
|---|
| 34 | * | 
|---|
| 35 | */ | 
|---|
| 36 | class MPQCCommandJob : public SystemCommandJob | 
|---|
| 37 | { | 
|---|
| 38 | //!> grant unit test access | 
|---|
| 39 | friend class MPQCCommandJobTest; | 
|---|
| 40 | //!> grant access to controller | 
|---|
| 41 | friend class MPQCCommandFragmentController; | 
|---|
| 42 | public: | 
|---|
| 43 | MPQCCommandJob(const std::string &_inputfile, const JobId_t _JobId, const std::string &_command = std::string("mpqc")); | 
|---|
| 44 | ~MPQCCommandJob(); | 
|---|
| 45 |  | 
|---|
| 46 | bool operator==(const MPQCCommandJob &other) const; | 
|---|
| 47 |  | 
|---|
| 48 | bool operator!=(const MPQCCommandJob &other) const { | 
|---|
| 49 | return !(*this == other); | 
|---|
| 50 | } | 
|---|
| 51 |  | 
|---|
| 52 | private: | 
|---|
| 53 | //!> Allow controller access to changing the commands | 
|---|
| 54 | void setCommand(const std::string &_command) | 
|---|
| 55 | { command = _command; } | 
|---|
| 56 |  | 
|---|
| 57 | //!> Allow controller access to changing the suffix | 
|---|
| 58 | void setSuffix(const std::string &_suffix) | 
|---|
| 59 | { suffix = _suffix; } | 
|---|
| 60 |  | 
|---|
| 61 | //!> private default cstor only for serializatio | 
|---|
| 62 | MPQCCommandJob(); | 
|---|
| 63 |  | 
|---|
| 64 | friend class boost::serialization::access; | 
|---|
| 65 | // serialization | 
|---|
| 66 | template <typename Archive> | 
|---|
| 67 | void serialize(Archive& ar, const unsigned int version) | 
|---|
| 68 | { | 
|---|
| 69 | ar & boost::serialization::base_object<SystemCommandJob>(*this); | 
|---|
| 70 | ar & data; | 
|---|
| 71 | } | 
|---|
| 72 |  | 
|---|
| 73 | private: | 
|---|
| 74 | //!> class that contains energy and forces and serialization capabilities | 
|---|
| 75 | MPQCData data; | 
|---|
| 76 |  | 
|---|
| 77 | FragmentResult::ptr extractResult(const std::string &resultstring); | 
|---|
| 78 | static const std::string keyword_hartreefock_energy; | 
|---|
| 79 | static const std::string keyword_hartreefock_forces; | 
|---|
| 80 | static const std::string keyword_moellerplesset_energy; | 
|---|
| 81 | static const std::string keyword_moellerplesset_forces; | 
|---|
| 82 | }; | 
|---|
| 83 |  | 
|---|
| 84 | // we need to give this class a unique key for serialization | 
|---|
| 85 | // its is only serialized through its base class FragmentJob | 
|---|
| 86 | BOOST_CLASS_EXPORT_KEY(MPQCCommandJob) | 
|---|
| 87 |  | 
|---|
| 88 | #endif /* MPQCCOMMANDJOB_HPP_ */ | 
|---|