|
Last change
on this file since 0eb774e was 0eb774e, checked in by Frederik Heber <heber@…>, 13 years ago |
|
MPQCJob and MPQCData now contain information how to sample the density.
|
-
Property mode
set to
100644
|
|
File size:
1.6 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * MPQCJob.h
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Jul 10, 2012
|
|---|
| 5 | * Author: heber
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef MPQCJOB_H_
|
|---|
| 9 | #define MPQCJOB_H_
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | // include config.h
|
|---|
| 13 | #ifdef HAVE_CONFIG_H
|
|---|
| 14 | #include <config.h>
|
|---|
| 15 | #endif
|
|---|
| 16 |
|
|---|
| 17 | #include "boost/serialization/export.hpp"
|
|---|
| 18 |
|
|---|
| 19 | #include "JobMarket/Jobs/FragmentJob.hpp"
|
|---|
| 20 |
|
|---|
| 21 | #include <string>
|
|---|
| 22 |
|
|---|
| 23 | /** This class encapsulates a MPQC Job.
|
|---|
| 24 | *
|
|---|
| 25 | */
|
|---|
| 26 | class MPQCJob : public FragmentJob
|
|---|
| 27 | {
|
|---|
| 28 | public:
|
|---|
| 29 | MPQCJob(
|
|---|
| 30 | const JobId_t _JobId,
|
|---|
| 31 | const std::string &_inputfile,
|
|---|
| 32 | const double _begin[3],
|
|---|
| 33 | const double _size,
|
|---|
| 34 | const int _level) :
|
|---|
| 35 | FragmentJob(_JobId),
|
|---|
| 36 | inputfile(_inputfile),
|
|---|
| 37 | size(0.),
|
|---|
| 38 | level(0)
|
|---|
| 39 | {}
|
|---|
| 40 | virtual ~MPQCJob() {}
|
|---|
| 41 |
|
|---|
| 42 | FragmentResult::ptr Work();
|
|---|
| 43 |
|
|---|
| 44 | private:
|
|---|
| 45 | //!> contents of the input file
|
|---|
| 46 | const std::string inputfile;
|
|---|
| 47 | //!> offset of grid
|
|---|
| 48 | double begin[3];
|
|---|
| 49 | //!> size of grid, i.e. edge length of cubic(!) domain
|
|---|
| 50 | const double size;
|
|---|
| 51 | //!> level, i.e. \f$2^{\text{level}}\f$ grid points per axis
|
|---|
| 52 | const int level;
|
|---|
| 53 |
|
|---|
| 54 | private:
|
|---|
| 55 | /** private default cstor for serialization only
|
|---|
| 56 | */
|
|---|
| 57 | MPQCJob() :
|
|---|
| 58 | FragmentJob(JobId::IllegalJob),
|
|---|
| 59 | size(0.),
|
|---|
| 60 | level(0)
|
|---|
| 61 | {}
|
|---|
| 62 |
|
|---|
| 63 | friend class boost::serialization::access;
|
|---|
| 64 | // serialization
|
|---|
| 65 | template <typename Archive>
|
|---|
| 66 | void serialize(Archive& ar, const unsigned int version)
|
|---|
| 67 | {
|
|---|
| 68 | ar & boost::serialization::base_object<FragmentJob>(*this);
|
|---|
| 69 | ar & const_cast<std::string &>(inputfile);
|
|---|
| 70 | int i;
|
|---|
| 71 | for (i=0; i<3; ++i)
|
|---|
| 72 | ar & begin[i];
|
|---|
| 73 | ar & const_cast<double &>(size);
|
|---|
| 74 | ar & const_cast<int &>(level);
|
|---|
| 75 | }
|
|---|
| 76 | };
|
|---|
| 77 |
|
|---|
| 78 | // we need to give this class a unique key for serialization
|
|---|
| 79 | // its is only serialized through its base class FragmentJob
|
|---|
| 80 | BOOST_CLASS_EXPORT_KEY(MPQCJob)
|
|---|
| 81 |
|
|---|
| 82 | #endif /* MPQCJOB_H_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.