| 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 | #include "JobMarket/Results/FragmentResult.hpp"
 | 
|---|
| 21 | #include "JobMarket/Jobs/SystemCommandJob.hpp"
 | 
|---|
| 22 | 
 | 
|---|
| 23 | #include "Fragmentation/Summation/Containers/MPQCData.hpp"
 | 
|---|
| 24 | 
 | 
|---|
| 25 | class MPQCCommandJobTest;
 | 
|---|
| 26 | 
 | 
|---|
| 27 | /** This class calls mpqc for solving a specific Hartree Fock problem.
 | 
|---|
| 28 |  *
 | 
|---|
| 29 |  */
 | 
|---|
| 30 | class MPQCCommandJob : public SystemCommandJob
 | 
|---|
| 31 | {
 | 
|---|
| 32 |   //!> grant unit test access
 | 
|---|
| 33 |   friend class MPQCCommandJobTest;
 | 
|---|
| 34 | public:
 | 
|---|
| 35 |   MPQCCommandJob(const std::string &_inputfile, const JobId_t _JobId, const std::string &_command = std::string("mpqc"));
 | 
|---|
| 36 |   ~MPQCCommandJob();
 | 
|---|
| 37 | 
 | 
|---|
| 38 |   bool operator==(const MPQCCommandJob &other) const;
 | 
|---|
| 39 | 
 | 
|---|
| 40 |   bool operator!=(const MPQCCommandJob &other) const {
 | 
|---|
| 41 |     return !(*this == other);
 | 
|---|
| 42 |   }
 | 
|---|
| 43 | 
 | 
|---|
| 44 | private:
 | 
|---|
| 45 |   //!> private default cstor only for serializatio
 | 
|---|
| 46 |   MPQCCommandJob();
 | 
|---|
| 47 | 
 | 
|---|
| 48 |   friend class boost::serialization::access;
 | 
|---|
| 49 |   // serialization
 | 
|---|
| 50 |   template <typename Archive>
 | 
|---|
| 51 |   void serialize(Archive& ar, const unsigned int version)
 | 
|---|
| 52 |   {
 | 
|---|
| 53 |     ar & boost::serialization::base_object<SystemCommandJob>(*this);
 | 
|---|
| 54 |     ar & data;
 | 
|---|
| 55 |   }
 | 
|---|
| 56 | 
 | 
|---|
| 57 | private:
 | 
|---|
| 58 |   //!> class that contains energy and forces and serialization capabilities
 | 
|---|
| 59 |   MPQCData data;
 | 
|---|
| 60 | 
 | 
|---|
| 61 |   FragmentResult::ptr extractResult(const std::string &resultstring);
 | 
|---|
| 62 |   static const std::string keyword_hartreefock_energy;
 | 
|---|
| 63 |   static const std::string keyword_hartreefock_forces;
 | 
|---|
| 64 |   static const std::string keyword_moellerplesset_energy;
 | 
|---|
| 65 |   static const std::string keyword_moellerplesset_forces;
 | 
|---|
| 66 | };
 | 
|---|
| 67 | 
 | 
|---|
| 68 | // we need to give this class a unique key for serialization
 | 
|---|
| 69 | // its is only serialized through its base class FragmentJob
 | 
|---|
| 70 | BOOST_CLASS_EXPORT_KEY(MPQCCommandJob)
 | 
|---|
| 71 | 
 | 
|---|
| 72 | #endif /* MPQCCOMMANDJOB_HPP_ */
 | 
|---|