Changeset ac9ca4 for src/Actions
- Timestamp:
- Apr 15, 2013, 10:28:22 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:
- 4f44ae
- Parents:
- dd0c8f
- git-author:
- Frederik Heber <heber@…> (03/04/13 13:54:11)
- git-committer:
- Frederik Heber <heber@…> (04/15/13 10:28:22)
- Location:
- src/Actions/FragmentationAction
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAction.cpp
rdd0c8f rac9ca4 39 39 #include "CodePatterns/Log.hpp" 40 40 #include "Fragmentation/Exporters/ExportGraph_ToFiles.hpp" 41 #ifdef HAVE_JOBMARKET 42 #include "Fragmentation/Exporters/ExportGraph_ToJobs.hpp" 43 #endif 41 44 #include "Fragmentation/Fragmentation.hpp" 42 45 #include "Fragmentation/Graph.hpp" … … 167 170 } 168 171 169 // store molecule's fragment to file170 172 { 171 173 const enum HydrogenSaturation saturation = params.DoSaturation.get() ? DoSaturate : DontSaturate; 172 174 const enum HydrogenTreatment treatment = params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen; 173 ExportGraph_ToFiles exporter(TotalGraph, treatment, saturation); 174 exporter.setPrefix(params.prefix.get()); 175 exporter.setOutputTypes(params.types.get()); 176 exporter(); 175 if (params.types.get().size() != 0) { 176 // store molecule's fragment to file 177 ExportGraph_ToFiles exporter(TotalGraph, treatment, saturation); 178 exporter.setPrefix(params.prefix.get()); 179 exporter.setOutputTypes(params.types.get()); 180 exporter(); 181 } else { 182 #ifdef HAVE_JOBMARKET 183 // store molecule's fragment in FragmentJobQueue 184 ExportGraph_ToJobs exporter(TotalGraph, treatment, saturation); 185 exporter.setLevel(params.level.get()); 186 exporter(); 187 #else 188 ELOG(1, "No output file types specified and JobMarket support is not compiled in."); 189 return Action::failure; 190 #endif 191 } 177 192 } 178 193 -
src/Actions/FragmentationAction/FragmentationAction.def
rdd0c8f rac9ca4 13 13 #include "Parameters/Validators/DummyValidator.hpp" 14 14 #include "Parameters/Validators/GenericValidators.hpp" 15 #include "Parameters/Validators/RangeValidator.hpp" 15 16 #include "Parameters/Validators/STLVectorValidator.hpp" 16 17 #include "Parameters/Validators/Specific/BoxLengthValidator.hpp" … … 20 21 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 21 22 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 22 #define paramtypes (std::string)(double)(unsigned int)(bool)(bool)(std::vector<std::string>) 23 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types") 24 #define paramdescriptions ("prefix of each fragment file")("distance in space")("order of a discretization, dissection, ...")("do saturate dangling bonds with hydrogen")("whether to exclude hydrogen in the bond graph dissection or not")("type(s) of parsers that output fragment config files") 25 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))( PARAM_DEFAULT(std::vector<std::string>(1, std::string("pcp"))))26 #define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types) 23 #define paramtypes (std::string)(double)(unsigned int)(bool)(bool)(std::vector<std::string>)(unsigned int) 24 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types")("grid-level") 25 #define paramdescriptions ("prefix of each fragment file")("distance in space")("order of a discretization, dissection, ...")("do saturate dangling bonds with hydrogen")("whether to exclude hydrogen in the bond graph dissection or not")("type(s) of parsers that output fragment config files")("resolution of density sampling multigrid") 26 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))(NOPARAM_DEFAULT)(PARAM_DEFAULT(5)) 27 #define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types)(level) 27 28 #define paramvalids \ 28 29 (DummyValidator< std::string >()) \ … … 31 32 (DummyValidator< bool >()) \ 32 33 (DummyValidator< bool >()) \ 33 (STLVectorValidator< std::vector<std::string> >(1, 10, ParserTypeValidator())) 34 (STLVectorValidator< std::vector<std::string> >(0, 10, ParserTypeValidator())) \ 35 (RangeValidator< unsigned int >(1, 10)) 34 36 35 37 #undef statetypes -
src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
rdd0c8f rac9ca4 57 57 #include "Fragmentation/Automation/extractJobIds.hpp" 58 58 #include "Fragmentation/Automation/FragmentationChargeDensity.hpp" 59 #include "Fragmentation/Automation/FragmentJobQueue.hpp" 59 60 #include "Fragmentation/Automation/FragmentationResults.hpp" 60 61 #include "Fragmentation/Automation/MPQCFragmentController.hpp" … … 478 479 // TODO: Have io_service run in second thread and merge with current again eventually 479 480 481 // check some things prior to work 482 enum OutputType_t { 483 ToFiles, 484 ToJobs, 485 ToNone 486 }; 487 enum OutputType_t outputtype = ToNone; 488 if (params.jobfiles.get().size() != 0) { 489 // we got no job files, hence we use FragmentJobQueue 490 if (params.path.get().size() == 0) { 491 ELOG(1, "Missing path to fragment files."); 492 return Action::failure; 493 } 494 outputtype = ToFiles; 495 496 // parse in fragment-jobs if given 497 if(!FragmentJobQueue::getInstance().addJobsFromFiles( 498 params.jobfiles.get(), 499 params.level.get())) 500 return Action::failure; 501 } else { 502 if (params.path.get().size() != 0) { 503 ELOG(2, "Path to fragment given although we use FragmentJobQueue."); 504 } 505 outputtype = ToJobs; 506 } 507 480 508 size_t Exitflag = 0; 481 509 std::map<JobId_t, MPQCData> fragmentData; 482 510 { 511 const size_t NumberJobs = FragmentJobQueue::getInstance().size(); 483 512 MPQCFragmentController mpqccontroller(io_service); 484 513 mpqccontroller.setHost(params.host.get()); 485 514 mpqccontroller.setPort(params.port.get()); 486 mpqccontroller.setLevel(params.level.get());487 515 // Phase One: obtain ids 488 std::vector< boost::filesystem::path > jobfiles = params.jobfiles.get(); 489 mpqccontroller.requestIds(jobfiles.size()); 490 491 // Phase Two: create and add MPQCJobs 492 if (!mpqccontroller.addJobsFromFiles(params.executable.get().string(), jobfiles)) 493 return Action::failure; 516 mpqccontroller.requestIds(NumberJobs); 517 518 // Phase Two: add MPQCJobs and send 519 mpqccontroller.addJobsFromQueue(); 520 mpqccontroller.run(); 494 521 495 522 // Phase Three: calculate result 496 mpqccontroller.waitforResults( jobfiles.size());523 mpqccontroller.waitforResults(NumberJobs); 497 524 mpqccontroller.getResults(fragmentData); 498 525 … … 572 599 573 600 // append all keysets to homology file 574 if ( Exitflag == 0) {601 if ((Exitflag == 0) && (!params.homology_file.get().empty())) { 575 602 const boost::filesystem::path &homology_file = params.homology_file.get(); 576 603 if (homology_file.string() != "") { -
src/Actions/FragmentationAction/FragmentationAutomationAction.def
rdd0c8f rac9ca4 24 24 #define paramtokens ("fragment-jobs")("fragment-path")("server-address")("server-port")("fragment-executable")("grid-level")("near-field-cells")("interpolation-degree")("DoLongrange")("homology-file") 25 25 #define paramdescriptions ("vector of fragment files")("prefix of each fragment file")("hostname of server")("controller port of server")("executable to launch on clients")("resolution of multigrid")("number of cells used in smearing out core charge")("interpolation degree for getting the nuclei potential from the grid")("whether to calculate long-range contributions")("path to file containing homology containerto append to") 26 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT("127.0.0.1"))( PARAM_DEFAULT("1026"))(NOPARAM_DEFAULT)(PARAM_DEFAULT(5))(PARAM_DEFAULT(3))(PARAM_DEFAULT(3))(PARAM_DEFAULT("0"))(PARAM_DEFAULT(""))26 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT("127.0.0.1"))(NOPARAM_DEFAULT)(PARAM_DEFAULT("mpqc"))(PARAM_DEFAULT(5))(PARAM_DEFAULT(3))(PARAM_DEFAULT(3))(PARAM_DEFAULT("0"))(PARAM_DEFAULT("")) 27 27 #define paramreferences (jobfiles)(path)(host)(port)(executable)(level)(near_field_cells)(interpolation_degree)(DoLongrange)(homology_file) 28 28 #define paramvalids \ -
src/Actions/FragmentationAction/StoreSaturatedFragmentAction.def
rdd0c8f rac9ca4 20 20 #define paramtokens ("store-saturated-fragment")("DoSaturate")("output-types") 21 21 #define paramdescriptions ("name of fragment file")("do saturate dangling bonds with hydrogen")("type(s) of parsers that output fragment config files") 22 #define paramdefaults (NOPARAM_DEFAULT)(PARAM_DEFAULT(true))( PARAM_DEFAULT(std::vector<std::string>(1, std::string("pcp"))))22 #define paramdefaults (NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(NOPARAM_DEFAULT) 23 23 #define paramreferences (prefix)(DoSaturation)(types) 24 24 #define paramvalids \
Note:
See TracChangeset
for help on using the changeset viewer.