- Timestamp:
- Dec 10, 2012, 10:10:58 AM (12 years ago)
- 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:
- 4f056e
- Parents:
- 86cfac5
- git-author:
- Frederik Heber <heber@…> (08/31/12 17:19:30)
- git-committer:
- Frederik Heber <heber@…> (12/10/12 10:10:58)
- Location:
- src
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
r86cfac5 r27594e 49 49 #include "Fragmentation/Automation/createMatrixNrLookup.hpp" 50 50 #include "Fragmentation/Automation/extractJobIds.hpp" 51 #include "Fragmentation/Automation/FragmentationChargeDensity.hpp" 51 52 #include "Fragmentation/Automation/FragmentationResults.hpp" 52 53 #include "Fragmentation/Automation/MPQCFragmentController.hpp" … … 62 63 #include "Fragmentation/KeySet.hpp" 63 64 #include "Fragmentation/KeySetsContainer.hpp" 64 #include "Fragmentation/Summation/OrthogonalSumUpPerLevel.hpp"65 65 #include "Fragmentation/Summation/writeTable.hpp" 66 66 #include "Graph/DepthFirstSearchAnalysis.hpp" … … 69 69 #include "Jobs/MPQCData.hpp" 70 70 #include "Jobs/MPQCData_printKeyNames.hpp" 71 #include "Jobs/Grid/SamplingGrid.hpp"72 71 #ifdef HAVE_VMG 73 72 #include "Jobs/VMGDebugGridJob.hpp" … … 211 210 return true; 212 211 } 212 213 213 /** Print MPQCData from received results. 214 214 * 215 * @param fragmentData MPQCData resulting from the jobs, each associated to a job215 * @param fragmentData MPQCData resulting from the jobs, associated to job id 216 216 * @param KeySetFilename filename with keysets to associate forces correctly 217 217 * @param NoAtoms total number of atoms 218 * @param full_sample summed up charge density of electrons from fragments on return 219 * @param full_fragment summed up positions and charges of nuclei from fragments on return 220 */ 221 bool sumUpChargeDensity( 222 const std::map<JobId_t,MPQCData> &fragmentData, 218 * @param full_sample summed up charge from fragments on return 219 */ 220 bool printReceivedMPQCResults( 221 const std::map<JobId_t, MPQCData> &fragmentData, 223 222 const std::string &KeySetFilename, 224 std::vector<SamplingGrid> &full_sample, 225 Fragment &full_fragment) 223 size_t NoAtoms) 226 224 { 227 225 // create a vector of all job ids … … 234 232 // create lookup from job nr to fragment number 235 233 size_t FragmentCounter = 0; 236 const std::map< JobId_t, size_t > MatrixNrLookup =237 createMatrixNrLookup(jobids, FragmentCounter);238 239 // initialise keysets240 KeySetsContainer KeySet;241 {242 // else needs keysets without hydrogens243 std::stringstream filename;244 filename << FRAGMENTPREFIX << KEYSETFILE;245 if (!KeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter)) return false;246 }247 248 /// prepare for OrthogonalSummation249 250 // convert KeySetContainer to IndexSetContainer251 IndexSetContainer::ptr container(new IndexSetContainer(KeySet));252 // create the map of all keysets253 SubsetMap::ptr subsetmap(new SubsetMap(*container));254 255 /// convert all MPQCData to MPQCDataMap_t256 std::vector<MPQCDataGridMap_t> Result_Grid_fused(257 OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCData, MPQCDataGridVector_t>(258 fragmentData, MatrixNrLookup, container, subsetmap));259 std::vector<MPQCDataFragmentMap_t> Result_Fragment_fused(260 OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCData, MPQCDataFragmentVector_t>(261 fragmentData, MatrixNrLookup, container, subsetmap));262 // obtain full grid263 full_sample.clear();264 full_sample.reserve(Result_Grid_fused.size());265 for (std::vector<MPQCDataGridMap_t>::const_iterator iter = ++Result_Grid_fused.begin();266 iter !=Result_Grid_fused.end();267 ++iter)268 full_sample.push_back(boost::fusion::at_key<MPQCDataFused::sampled_grid>((*iter)));269 full_fragment = boost::fusion::at_key<MPQCDataFused::fragment>(Result_Fragment_fused.back());270 271 return true;272 }273 274 /** Print MPQCData from received results.275 *276 * @param fragmentData MPQCData resulting from the jobs, associated to job id277 * @param KeySetFilename filename with keysets to associate forces correctly278 * @param NoAtoms total number of atoms279 * @param full_sample summed up charge from fragments on return280 */281 bool printReceivedMPQCResults(282 const std::map<JobId_t, MPQCData> &fragmentData,283 const std::string &KeySetFilename,284 size_t NoAtoms)285 {286 // create a vector of all job ids287 std::vector<JobId_t> jobids;288 std::transform(fragmentData.begin(),fragmentData.end(),289 std::back_inserter(jobids),290 boost::bind( &std::map<JobId_t,MPQCData>::value_type::first, boost::lambda::_1 )291 );292 293 // create lookup from job nr to fragment number294 size_t FragmentCounter = 0;295 234 const std::map< JobId_t, size_t > MatrixNrLookup= 296 235 createMatrixNrLookup(jobids, FragmentCounter); 297 298 236 299 237 // place results into maps … … 467 405 // obtain combined charge density 468 406 LOG(1, "INFO: Parsing fragment files from " << params.path.get() << "."); 469 std::vector<SamplingGrid> full_sample; // have charges from level 2 onward summed up 470 Fragment full_fragment; 471 sumUpChargeDensity( 407 FragmentationChargeDensity summedChargeDensity( 472 408 fragmentData, 473 params.path.get(), 474 full_sample, 475 full_fragment); 409 params.path.get()); 410 const std::vector<SamplingGrid> full_sample = summedChargeDensity.getFullSampledGrid(); 476 411 477 412 // Phase Four: obtain more ids 478 vmgcontroller.requestIds(fragmentData.size()+full_sample.size()); 413 const size_t NoJobs = fragmentData.size()+full_sample.size(); 414 vmgcontroller.requestIds(NoJobs); 479 415 480 416 // Phase Five: create VMGJobs 481 417 const size_t near_field_cells = params.near_field_cells.get(); 482 if (!vmgcontroller.createLongRangeJobs(fragmentData, full_sample, full_fragment, near_field_cells)) 418 if (!vmgcontroller.createLongRangeJobs( 419 fragmentData, 420 full_sample, 421 summedChargeDensity.getFragment(), near_field_cells)) 483 422 return Action::failure; 484 423 485 424 // Phase Six: calculate result 486 vmgcontroller.waitforResults( fragmentData.size()+full_sample.size());425 vmgcontroller.waitforResults(NoJobs); 487 426 std::map<JobId_t, VMGData> longrangeData; 488 427 vmgcontroller.getResults(longrangeData); 489 ASSERT( fragmentData.size()+full_sample.size()== longrangeData.size(),428 ASSERT( NoJobs == longrangeData.size(), 490 429 "FragmentationFragmentationAutomationAction::performCall() - number of MPQCresults+" 491 +toString(full_sample.size())+" "+toString(fragmentData.size()+full_sample.size()) 430 +toString(full_sample)+" " 431 +toString(NoJobs) 492 432 +" and VMGresults "+toString(longrangeData.size())+" don't match."); 493 433 -
src/Fragmentation/Automation/Makefile.am
r86cfac5 r27594e 4 4 FRAGMENTATIONAUTOMATIONSOURCE = \ 5 5 Fragmentation/Automation/createMatrixNrLookup.cpp \ 6 Fragmentation/Automation/FragmentationChargeDensity.cpp \ 6 7 Fragmentation/Automation/FragmentationResults.cpp \ 7 8 Fragmentation/Automation/MPQCFragmentController.cpp \ … … 17 18 Fragmentation/Automation/createMatrixNrLookup.hpp \ 18 19 Fragmentation/Automation/extractJobIds.hpp \ 20 Fragmentation/Automation/FragmentationChargeDensity.hpp \ 19 21 Fragmentation/Automation/FragmentationResults.hpp \ 20 22 Fragmentation/Automation/MPQCFragmentController.hpp \
Note:
See TracChangeset
for help on using the changeset viewer.