Changeset 503acc1


Ignore:
Timestamp:
Apr 15, 2013, 10:30:31 AM (12 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
0cd8cf
Parents:
bae7bc
git-author:
Frederik Heber <heber@…> (03/06/13 19:51:06)
git-committer:
Frederik Heber <heber@…> (04/15/13 10:30:31)
Message:

MPQCJob and MPQCData now have bool to decide whether to sample electron density or not.

  • this passes on DoLongRange from FragmentationAutomationAction.
  • MPQCFragmentController::addJobsFromQueue() now does some more manipulation besides changing the id to something valid.
  • using boost::polymorphic_downcast and boost/cast.hpp (added check to boost.m4).
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    rbae7bc r503acc1  
    156156BOOST_ARRAY
    157157BOOST_BIND
     158BOOST_CAST
    158159BOOST_CONVERSION
    159160BOOST_EXCEPTION
  • m4/boost.m4

    rbae7bc r503acc1  
    490490[BOOST_FIND_HEADER([boost/bind.hpp])])
    491491
     492# BOOST_CAST()
     493# ------------
     494# Look for Boost.Cast
     495BOOST_DEFUN([Cast],
     496[BOOST_FIND_HEADER([boost/cast.hpp])])
    492497
    493498# BOOST_CONVERSION()
  • src/Actions/FragmentationAction/FragmentationAutomationAction.cpp

    rbae7bc r503acc1  
    545545
    546546    // Phase Two: add MPQCJobs and send
    547     mpqccontroller.addJobsFromQueue();
     547    const size_t NoJobs = mpqccontroller.addJobsFromQueue(
     548        params.DoLongrange.get() ? MPQCData::DoSampleDensity : MPQCData::DontSampleDensity);
     549    LOG(1, "INFO: Added " << NoJobs << " from FragmentJobsQueue.");
    548550    mpqccontroller.run();
    549551
  • src/Fragmentation/Automation/MPQCFragmentController.cpp

    rbae7bc r503acc1  
    4141#include "MPQCFragmentController.hpp"
    4242
     43#include <boost/cast.hpp>
    4344#include <boost/filesystem/operations.hpp>
    4445
     
    5051#include "World.hpp"
    5152
    52 bool MPQCFragmentController::addJobsFromQueue()
     53bool MPQCFragmentController::addJobsFromQueue(const MPQCData::DoLongrange_t _DoLongrange)
    5354{
    5455  // give them all valid ids
     
    5758      jobiter != newjobs.end();
    5859      ++jobiter) {
     60    MPQCJob *job = boost::polymorphic_downcast<MPQCJob *>(jobiter->get());
     61    job->DoLongrange = _DoLongrange;
    5962    changeJobId((*jobiter), getAvailableId());
    6063  }
  • src/Fragmentation/Automation/MPQCFragmentController.hpp

    rbae7bc r503acc1  
    4141  /** Command Controller to fill its hold of jobs from FragmentJobQueue.
    4242   *
     43   * \param _DoSampleDensity whether to actually sample the resulting electronic density
    4344   * \return true - jobs obtained, false - queue empty
    4445   */
    45   bool addJobsFromQueue();
     46  bool addJobsFromQueue(const MPQCData::DoLongrange_t _DoLongrange);
    4647
    4748  /** Get results map of calculated jobs.
  • src/Jobs/MPQCData.cpp

    rbae7bc r503acc1  
    4444
    4545MPQCData::MPQCData(const SamplingGridProperties &_props) :
     46  DoLongrange(DontSampleDensity),
    4647  sampled_grid(_props)
    4748{}
    4849
    49 MPQCData::MPQCData()
     50MPQCData::MPQCData() :
     51  DoLongrange(DontSampleDensity)
    5052{}
    5153
  • src/Jobs/MPQCData.hpp

    rbae7bc r503acc1  
    7979  std::vector< vector_type  > forces;
    8080
     81  //!> whether to actually sample the density
     82  enum DoLongrange_t {
     83    DontSampleDensity=0,
     84    DoSampleDensity=1
     85  };
     86  DoLongrange_t DoLongrange;
     87
    8188  /// Density
    8289  SamplingGrid sampled_grid;
     
    118125    ar & forces;
    119126    ar & sampled_grid;
     127    ar & DoLongrange;
    120128    ar & positions;
    121129    ar & charges;
  • src/Jobs/MPQCJob.cpp

    rbae7bc r503acc1  
    4646
    4747#include "CodePatterns/Assert.hpp"
    48 #include "Jobs/MPQCData.hpp"
    4948
    5049
     
    5655    const int _level) :
    5756  FragmentJob(_JobId),
     57  DoLongrange(MPQCData::DontSampleDensity),
    5858  inputfile(_inputfile),
    5959  grid(_begin, _end, _level)
     
    6464
    6565MPQCJob::MPQCJob() :
    66   FragmentJob(JobId::IllegalJob)
     66  FragmentJob(JobId::IllegalJob),
     67  DoLongrange(MPQCData::DontSampleDensity)
    6768{}
    6869
  • src/Jobs/MPQCJob.hpp

    rbae7bc r503acc1  
    2020
    2121#include "Jobs/Grid/SamplingGridProperties.hpp"
     22#include "Jobs/MPQCData.hpp"
    2223
    2324#include <string>
     
    3940  FragmentResult::ptr Work();
    4041
     42  //!> whether to actually sample the density
     43  MPQCData::DoLongrange_t DoLongrange;
     44
    4145private:
    4246  //!> contents of inputfile
     
    5660  {
    5761    ar & boost::serialization::base_object<FragmentJob>(*this);
     62    ar & DoLongrange;
    5863    ar & const_cast<std::string &>(inputfile);
    5964    ar & const_cast<SamplingGridProperties &>(grid);
Note: See TracChangeset for help on using the changeset viewer.