Ignore:
Timestamp:
Nov 27, 2012, 8:35:34 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:
ffe057
Parents:
3dd32f
git-author:
Frederik Heber <heber@…> (08/27/12 16:00:03)
git-committer:
Frederik Heber <heber@…> (11/27/12 08:35:34)
Message:

longrangeData nows needs its own MatrixNrLookup, since job ids are different.

File:
1 edited

Legend:

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

    r3dd32f r343401  
    211211  for (std::vector<JobId_t>::const_iterator iter = jobids.begin();
    212212      iter != jobids.end(); ++iter) {
     213    LOG(3, "DEBUG: Inserting (" << *iter << "," << FragmentCounter << ").");
    213214#ifndef NDEBUG
    214215    std::pair< std::map< JobId_t, size_t >::iterator, bool> inserter =
     
    503504}
    504505
     506template <typename T>
     507std::vector<JobId_t> extractJobIds(const std::map<JobId_t, T> &iddata)
     508{
     509  // create a vector of all job ids
     510  std::vector<JobId_t> jobids;
     511  std::transform(iddata.begin(),iddata.end(),
     512      std::back_inserter(jobids),
     513      boost::bind(&std::map<JobId_t,T>::value_type::first, boost::lambda::_1 )
     514  );
     515  return jobids;
     516}
     517
    505518/** Print MPQCData from received results.
    506519 *
     
    520533    SamplingGrid &full_sample)
    521534{
    522   // create a vector of all job ids
    523   std::vector<JobId_t> jobids;
    524   std::transform(fragmentData.begin(),fragmentData.end(),
    525       std::back_inserter(jobids),
    526       boost::bind( &std::map<JobId_t,MPQCData>::value_type::first, boost::lambda::_1 )
    527   );
    528 
    529535  // create lookup from job nr to fragment number
    530   size_t FragmentCounter = 0;
    531   const std::map< JobId_t, size_t > MatrixNrLookup =
    532       createMatrixNrLookup(jobids, FragmentCounter);
     536  size_t MPQCFragmentCounter = 0;
     537  const std::vector<JobId_t> mpqcjobids = extractJobIds<MPQCData>(fragmentData);
     538  const std::map< JobId_t, size_t > MPQCMatrixNrLookup =
     539      createMatrixNrLookup(mpqcjobids, MPQCFragmentCounter);
     540
     541  size_t VMGFragmentCounter = 0;
     542  const std::vector<JobId_t> vmgjobids = extractJobIds<VMGData>(longrangeData);
     543  const std::map< JobId_t, size_t > VMGMatrixNrLookup =
     544      createMatrixNrLookup(vmgjobids, VMGFragmentCounter);
    533545
    534546  // initialise keysets
     
    539551    std::stringstream filename;
    540552    filename << FRAGMENTPREFIX << KEYSETFILE;
    541     if (!KeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter)) return false;
     553    if (!KeySet.ParseKeySets(KeySetFilename, filename.str(), MPQCFragmentCounter)) return false;
    542554  }
    543555
     
    546558    std::stringstream filename;
    547559    filename << FRAGMENTPREFIX << FORCESFILE;
    548     if (!ForceKeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter)) return false;
     560    if (!ForceKeySet.ParseKeySets(KeySetFilename, filename.str(), MPQCFragmentCounter)) return false;
    549561  }
    550562
     
    561573    std::vector<MPQCDataEnergyMap_t> Result_Energy_fused(
    562574        OrthogonalSumUpPerLevel<MPQCDataEnergyMap_t, MPQCDataEnergyVector_t>(
    563             fragmentData, MatrixNrLookup, container, subsetmap));
     575            fragmentData, MPQCMatrixNrLookup, container, subsetmap));
    564576    std::vector<MPQCDataGridMap_t> Result_Grid_fused(
    565577      OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCDataGridVector_t>(
    566           fragmentData, MatrixNrLookup, container, subsetmap));
     578          fragmentData, MPQCMatrixNrLookup, container, subsetmap));
    567579    std::vector<MPQCDataTimeMap_t> Result_Time_fused(
    568580      SumUpPerLevel<MPQCDataTimeMap_t, MPQCDataTimeVector_t>(
    569           fragmentData, MatrixNrLookup, container, subsetmap));
     581          fragmentData, MPQCMatrixNrLookup, container, subsetmap));
    570582    std::vector<MPQCDataFragmentMap_t> Result_Fragment_fused(
    571583      OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCDataFragmentVector_t>(
    572           fragmentData, MatrixNrLookup, container, subsetmap));
     584          fragmentData, MPQCMatrixNrLookup, container, subsetmap));
    573585
    574586    // force has extra converter
     
    580592                MPQCData_Force_fused,
    581593                container->getContainer(),
    582                 MatrixNrLookup,
     594                MPQCMatrixNrLookup,
    583595                Result_Force_fused);
    584596    boost::mpl::for_each<MPQCDataForceVector_t>(boost::ref(forceSummer));
     
    591603                VMGData_Potential_fused,
    592604                container->getContainer(),
    593                 MatrixNrLookup);
     605                VMGMatrixNrLookup);
    594606    potentialSummer(subsetmap->getMaximumSubsetLevel());
    595607    OrthogonalFullSummator<VMGDataMap_t, VMGDataFused::energy_potential> epotentialSummer(
     
    597609                VMGData_Potential_fused,
    598610                container->getContainer(),
    599                 MatrixNrLookup);
     611                VMGMatrixNrLookup);
    600612    epotentialSummer(subsetmap->getMaximumSubsetLevel());
    601613    SamplingGrid full_sample = fullsolutionData.sampled_potential;
     
    609621                VMGData_Potential_fused,
    610622                container->getContainer(),
    611                 MatrixNrLookup);
     623                VMGMatrixNrLookup);
    612624    elongSummer(subsetmap->getMaximumSubsetLevel());
    613625    double e_long = fullsolutionData.e_long;
Note: See TracChangeset for help on using the changeset viewer.