Changeset 986885
- Timestamp:
- Jun 27, 2012, 4:07:20 PM (13 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:
- 95b384
- Parents:
- 509014
- git-author:
- Frederik Heber <heber@…> (02/22/12 16:41:15)
- git-committer:
- Frederik Heber <heber@…> (06/27/12 16:07:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/controller.cpp
r509014 r986885 27 27 #include "CodePatterns/MemDebug.hpp" 28 28 29 #include <boost/archive/text_oarchive.hpp> 30 #include <boost/archive/text_iarchive.hpp> 29 31 #include <fstream> 30 32 #include <iostream> … … 44 46 #include "Controller/Commands/ShutdownOperation.hpp" 45 47 #include "Jobs/MPQCCommandJob.hpp" 48 #include "Jobs/MPQCCommandJob_MPQCData.hpp" 46 49 #include "Jobs/SystemCommandJob.hpp" 47 50 #include "Results/FragmentResult.hpp" … … 53 56 CheckResultsIndex = 3, 54 57 ReceiveResultsIndex = 4, 55 ShutdownIndex = 5 58 ReceiveMPQCIndex = 5, 59 ShutdownIndex = 6, 56 60 }; 57 61 … … 208 212 } 209 213 214 /** Print received results. 215 * 216 * @param controller FragmentController with CommandRegistry 217 */ 218 void printreceivedmpqcresults(FragmentController &controller, const std::string &KeySetFilename) 219 { 220 SendResultsOperation *sendres = static_cast<SendResultsOperation *>( 221 controller.Commands.getByName("sendresults")); 222 std::vector<FragmentResult::ptr> results = sendres->getResults(); 223 224 // parse in KeySetfile 225 // const size_t MAXBUFFER = 256; 226 std::ifstream inputfile; 227 inputfile.open(KeySetFilename.c_str()); 228 // while (inputfile.getline(buffer, MAXBUFFER)) { 229 // 230 // } 231 inputfile.close(); 232 233 // combine all found data 234 std::vector<MPQCData> fragmentData(results.size()); 235 MPQCData combinedData; 236 237 LOG(2, "DEBUG: Parsing now through " << results.size() << " results."); 238 for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin(); 239 iter != results.end(); ++iter) { 240 LOG(1, "RESULT: job #"+toString((*iter)->getId())+": "+toString((*iter)->result)); 241 MPQCData extractedData; 242 std::stringstream inputstream((*iter)->result); 243 boost::archive::text_iarchive ia(inputstream); 244 ia >> extractedData; 245 LOG(1, "INFO: extracted data is " << extractedData << "."); 246 } 247 } 248 210 249 /** Sends shutdown signal to server 211 250 * … … 255 294 CommandsMap.insert( std::make_pair("checkresults", CheckResultsIndex) ); 256 295 CommandsMap.insert( std::make_pair("receiveresults", ReceiveResultsIndex) ); 296 CommandsMap.insert( std::make_pair("receivempqc", ReceiveMPQCIndex) ); 257 297 CommandsMap.insert( std::make_pair("shutdown", ShutdownIndex) ); 258 298 try … … 301 341 break; 302 342 case ReceiveResultsIndex: 343 break; 344 case ReceiveMPQCIndex: 303 345 break; 304 346 case ShutdownIndex: … … 364 406 break; 365 407 } 408 case ReceiveMPQCIndex: 409 { 410 receiveresults(controller, argv[1], argv[2]); 411 break; 412 } 366 413 case ShutdownIndex: 367 414 { … … 395 442 { 396 443 printreceivedresults(controller); 444 break; 445 } 446 case ReceiveMPQCIndex: 447 { 448 if (argc == 4) { 449 ELOG(1, "'receivempqc' requires one option: [KeySetFilename]."); 450 } else { 451 const std::string KeySetFilename = argv[4]; 452 LOG(1, "INFO: Parsing id associations from " << KeySetFilename << "."); 453 printreceivedmpqcresults(controller, KeySetFilename); 454 } 397 455 break; 398 456 }
Note:
See TracChangeset
for help on using the changeset viewer.