| [cc276e] | 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 | 
 | 
|---|
| [545446] | 16 | #include <boost/serialization/export.hpp>
 | 
|---|
 | 17 | 
 | 
|---|
| [cc276e] | 18 | #include <string>
 | 
|---|
 | 19 | 
 | 
|---|
| [1dfe00] | 20 | #ifdef HAVE_JOBMARKET
 | 
|---|
| [a10cc0] | 21 | #include "JobMarket/Results/FragmentResult.hpp"
 | 
|---|
 | 22 | #include "JobMarket/Jobs/SystemCommandJob.hpp"
 | 
|---|
| [1dfe00] | 23 | #else
 | 
|---|
 | 24 | #include "Jobs/JobMarket/FragmentResult.hpp"
 | 
|---|
 | 25 | #include "Jobs/JobMarket/SystemCommandJob.hpp"
 | 
|---|
 | 26 | #endif
 | 
|---|
| [cc276e] | 27 | 
 | 
|---|
| [fbf143] | 28 | #include "Fragmentation/Summation/Containers/MPQCData.hpp"
 | 
|---|
| [cc276e] | 29 | 
 | 
|---|
 | 30 | class MPQCCommandJobTest;
 | 
|---|
| [d6a7b9] | 31 | class MPQCCommandFragmentController;
 | 
|---|
| [cc276e] | 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;
 | 
|---|
| [d6a7b9] | 40 |   //!> grant access to controller
 | 
|---|
 | 41 |   friend class MPQCCommandFragmentController;
 | 
|---|
| [cc276e] | 42 | public:
 | 
|---|
| [917be8] | 43 |   MPQCCommandJob(const std::string &_inputfile, const JobId_t _JobId, const std::string &_command = std::string("mpqc"));
 | 
|---|
| [cc276e] | 44 |   ~MPQCCommandJob();
 | 
|---|
 | 45 | 
 | 
|---|
| [545446] | 46 |   bool operator==(const MPQCCommandJob &other) const;
 | 
|---|
 | 47 | 
 | 
|---|
 | 48 |   bool operator!=(const MPQCCommandJob &other) const {
 | 
|---|
 | 49 |     return !(*this == other);
 | 
|---|
 | 50 |   }
 | 
|---|
 | 51 | 
 | 
|---|
 | 52 | private:
 | 
|---|
| [d6a7b9] | 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 | 
 | 
|---|
| [545446] | 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 | 
 | 
|---|
| [cc276e] | 73 | private:
 | 
|---|
 | 74 |   //!> class that contains energy and forces and serialization capabilities
 | 
|---|
 | 75 |   MPQCData data;
 | 
|---|
 | 76 | 
 | 
|---|
 | 77 |   FragmentResult::ptr extractResult(const std::string &resultstring);
 | 
|---|
| [306f60] | 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;
 | 
|---|
| [cc276e] | 82 | };
 | 
|---|
 | 83 | 
 | 
|---|
| [545446] | 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)
 | 
|---|
| [cc276e] | 87 | 
 | 
|---|
 | 88 | #endif /* MPQCCOMMANDJOB_HPP_ */
 | 
|---|