source: src/Jobs/MPQCCommandJob.hpp@ 67a9d5

Last change on this file since 67a9d5 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
RevLine 
[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
30class MPQCCommandJobTest;
[d6a7b9]31class MPQCCommandFragmentController;
[cc276e]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;
[d6a7b9]40 //!> grant access to controller
41 friend class MPQCCommandFragmentController;
[cc276e]42public:
[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
52private:
[019b96]53 friend class MPQCCommandFragmentController;
[d6a7b9]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
[019b96]62private:
[545446]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
[cc276e]75private:
76 //!> class that contains energy and forces and serialization capabilities
77 MPQCData data;
78
79 FragmentResult::ptr extractResult(const std::string &resultstring);
[306f60]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;
[cc276e]84};
85
[545446]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)
[cc276e]89
90#endif /* MPQCCOMMANDJOB_HPP_ */
Note: See TracBrowser for help on using the repository browser.