Changeset 69c733 for src


Ignore:
Timestamp:
Nov 14, 2012, 10:01:46 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:
88c2c1
Parents:
8a8c8c
git-author:
Frederik Heber <heber@…> (07/15/12 12:54:01)
git-committer:
Frederik Heber <heber@…> (11/14/12 10:01:46)
Message:

Added second part to FragmentationAutomationAction that calculates long-range part.

  • we create VMGJobs, as of now with a lot of 0 as sampled_grid.
  • added HAVE_VMG to compile on VMGJob only if vmg is available.
  • new option DoLongrange to FragmentationAutomationAction to deactivate long-range calculations by default.
Location:
src/Actions/FragmentationAction
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/FragmentationAutomationAction.cpp

    r8a8c8c r69c733  
    6161#include "Jobs/MPQCData.hpp"
    6262#include "Jobs/MPQCData_printKeyNames.hpp"
     63#ifdef HAVE_VMG
     64#include "Jobs/VMGJob.hpp"
     65#endif
    6366#include "molecule.hpp"
    6467#include "World.hpp"
     
    448451}
    449452
     453#ifdef HAVE_VMG
     454bool createLongRangeJobs(
     455    FragmentController &controller,
     456    const FragmentationFragmentationAutomationAction::FragmentationFragmentationAutomationParameters &params,
     457    const size_t NoJobs)
     458{
     459  const int GRID = pow(2,5);
     460  std::vector<FragmentJob::ptr> jobs;
     461  std::vector< double > sampled_input (GRID*GRID*GRID, 0.);
     462  for (size_t i=0; i< NoJobs; ++i) {
     463    const JobId_t next_id = controller.getAvailableId();
     464    LOG(1, "INFO: Creating VMGJob.");
     465    FragmentJob::ptr testJob( new VMGJob(next_id, sampled_input) );
     466    jobs.push_back(testJob);
     467  }
     468  controller.addJobs(jobs);
     469  controller.sendJobs(params.host.get(), params.port.get());
     470  return true;
     471}
     472#endif
     473
    450474void WaitforResults(
    451475    boost::asio::io_service &io_service,
     
    483507  RunService(io_service, "Requesting ids");
    484508
    485   // Phase Two: create and add jobs
     509  // Phase Two: create and add MPQCJobs
    486510  if (!createJobsFromFiles(controller, params, jobfiles))
    487511    return Action::failure;
    488   RunService(io_service, "Adding jobs");
     512  RunService(io_service, "Adding MPQCJobs");
    489513
    490514  // Phase Three: calculate result
    491515  WaitforResults(io_service, controller, params, jobfiles.size());
    492 
    493   // Phase Three: get result
    494516  controller.receiveResults(params.host.get(), params.port.get());
    495   RunService(io_service, "Phase Four");
    496 
    497   // Final phase: print result
     517  RunService(io_service, "Requesting short-range results");
     518
     519  // print intermediate short-range results
    498520  {
    499521    LOG(1, "INFO: Parsing fragment files from " << params.path.get() << ".");
    500     std::vector<FragmentResult::ptr> results = controller.getReceivedResults();
     522    std::vector<FragmentResult::ptr> MPQCresults = controller.getReceivedResults();
    501523    printReceivedMPQCResults(
    502         results,
     524        MPQCresults,
    503525        params.path.get(),
    504526        getNoAtomsFromAdjacencyFile(params.path.get()));
    505527  }
     528
     529#ifdef HAVE_VMG
     530  if (params.DoLongrange.get()) {
     531  // Phase Four: obtain more ids
     532  requestIds(controller, params, jobfiles.size()+1); // one more for the big job
     533  RunService(io_service, "Requesting ids");
     534
     535  // Phase Five: create VMGJobs
     536  if (!createLongRangeJobs(controller, params, jobfiles.size()+1))
     537    return Action::failure;
     538  RunService(io_service, "Adding VMGJobs");
     539
     540  // Phase Six: calculate result
     541  WaitforResults(io_service, controller, params, jobfiles.size()+1);
     542  controller.receiveResults(params.host.get(), params.port.get());
     543  RunService(io_service, "Requesting long-range results");
     544  std::vector<FragmentResult::ptr> VMGresults = controller.getReceivedResults();
     545  }
     546#endif
    506547  size_t Exitflag = controller.getExitflag();
    507548
  • src/Actions/FragmentationAction/FragmentationAutomationAction.def

    r8a8c8c r69c733  
    2020// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    2121// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
    22 #define paramtypes (std::vector< boost::filesystem::path >)(std::string)(std::string)(std::string)(boost::filesystem::path)
    23 #define paramtokens ("fragment-jobs")("fragment-path")("server-address")("server-port")("fragment-executable")
    24 #define paramdescriptions ("vector of fragment files")("prefix of each fragment file")("hostname of server")("controller port of server")("executable to launch on clients")
    25 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT("127.0.0.1"))(PARAM_DEFAULT("1026"))(NOPARAM_DEFAULT)
    26 #define paramreferences (jobfiles)(path)(host)(port)(executable)
     22#define paramtypes (std::vector< boost::filesystem::path >)(std::string)(std::string)(std::string)(boost::filesystem::path)(bool)
     23#define paramtokens ("fragment-jobs")("fragment-path")("server-address")("server-port")("fragment-executable")("DoLongrange")
     24#define paramdescriptions ("vector of fragment files")("prefix of each fragment file")("hostname of server")("controller port of server")("executable to launch on clients")("whether to calculate long-range contributions")
     25#define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT("127.0.0.1"))(PARAM_DEFAULT("1026"))(NOPARAM_DEFAULT)(PARAM_DEFAULT("0"))
     26#define paramreferences (jobfiles)(path)(host)(port)(executable)(DoLongrange)
    2727#define paramvalids \
    2828(STLVectorValidator< std::vector< boost::filesystem::path > >(ParserFileValidator() && FilePresentValidator())) \
     
    3030(DummyValidator< std::string >()) \
    3131(DummyValidator< std::string >()) \
    32 (DummyValidator< boost::filesystem::path >())
     32(DummyValidator< boost::filesystem::path >()) \
     33(DummyValidator< bool >())
    3334
    3435#undef statetypes
Note: See TracChangeset for help on using the changeset viewer.