source: src/Jobs/MPQCCommandJob.hpp@ 019b96

Last change on this file since 019b96 was 019b96, checked in by Frederik Heber <heber@…>, 11 years ago

SystemCommandJob now allows for resetting the command in derived classes.

  • command is just protected.
  • MPQCCommandJob::resetCommand() allows overwrite to MPQCCommandFragmentController.
  • MPQCCommandFragmentController::addJobsFromQueue() allows setting of new command.
  • FragmentationAutomationAction::performCalls() sets params.executable.
  • Property mode set to 100644
File size: 2.4 KB
Line 
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
30class MPQCCommandJobTest;
31class MPQCCommandFragmentController;
32
33/** This class calls mpqc for solving a specific Hartree Fock problem.
34 *
35 */
36class MPQCCommandJob : public SystemCommandJob
37{
38 //!> grant unit test access
39 friend class MPQCCommandJobTest;
40 //!> grant access to controller
41 friend class MPQCCommandFragmentController;
42public:
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
52private:
53 friend class MPQCCommandFragmentController;
54 //!> Allow controller access to changing the commands
55 void setCommand(const std::string &_command)
56 { command = _command; }
57
58 //!> Allow controller access to changing the suffix
59 void setSuffix(const std::string &_suffix)
60 { suffix = _suffix; }
61
62private:
63 //!> private default cstor only for serializatio
64 MPQCCommandJob();
65
66 friend class boost::serialization::access;
67 // serialization
68 template <typename Archive>
69 void serialize(Archive& ar, const unsigned int version)
70 {
71 ar & boost::serialization::base_object<SystemCommandJob>(*this);
72 ar & data;
73 }
74
75private:
76 //!> class that contains energy and forces and serialization capabilities
77 MPQCData data;
78
79 FragmentResult::ptr extractResult(const std::string &resultstring);
80 static const std::string keyword_hartreefock_energy;
81 static const std::string keyword_hartreefock_forces;
82 static const std::string keyword_moellerplesset_energy;
83 static const std::string keyword_moellerplesset_forces;
84};
85
86// we need to give this class a unique key for serialization
87// its is only serialized through its base class FragmentJob
88BOOST_CLASS_EXPORT_KEY(MPQCCommandJob)
89
90#endif /* MPQCCOMMANDJOB_HPP_ */
Note: See TracBrowser for help on using the repository browser.