- Timestamp:
- Jul 2, 2012, 8:32:04 AM (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:
- d9373b
- Parents:
- 012c98
- git-author:
- Frederik Heber <heber@…> (05/23/12 12:33:01)
- git-committer:
- Frederik Heber <heber@…> (07/02/12 08:32:04)
- Location:
- src/Fragmentation/Automation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/Makefile.am
r012c98 r684bc1 174 174 $(BOOST_ASIO_LIBS) \ 175 175 $(BOOST_SERIALIZATION_LIBS) \ 176 $(BOOST_PROGRAM_OPTIONS_LIBS) \ 176 177 $(BOOST_THREAD_LIBS) \ 177 178 $(BOOST_SYSTEM_LIBS) \ -
src/Fragmentation/Automation/Server.cpp
r012c98 r684bc1 27 27 28 28 #include <boost/lexical_cast.hpp> 29 #include <boost/program_options.hpp> 29 30 #include <iostream> 30 31 … … 41 42 atexit(cleanUp); 42 43 43 setVerbosity(3); 44 // Declare the supported options. 45 boost::program_options::options_description desc("Allowed options"); 46 desc.add_options() 47 ("help,h", "produce help message") 48 ("verbosity,v", boost::program_options::value<size_t>(), "set verbosity level") 49 ("workerport", boost::program_options::value< unsigned short >(), "listen on this port for connecting workers") 50 ("controllerport", boost::program_options::value< unsigned short >(), "listen on this port for connecting controller") 51 ; 52 53 boost::program_options::variables_map vm; 54 boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm); 55 boost::program_options::notify(vm); 56 57 if (vm.count("help")) { 58 std::cout << desc << "\n"; 59 return 1; 60 } 61 62 if (vm.count("verbosity")) { 63 LOG(0, "STATUS: Verbosity level was set to " << vm["verbosity"].as<size_t>() << "."); 64 setVerbosity(vm["verbosity"].as<size_t>()); 65 } else { 66 LOG(0, "STATUS: Verbosity level was not set, defaulting to 3."); 67 setVerbosity(3); 68 } 69 70 unsigned short workerport; 71 if (vm.count("workerport")) { 72 try { 73 workerport = vm["workerport"].as< unsigned short >(); 74 } catch (boost::bad_lexical_cast) { 75 ELOG(1, "Could not read " << workerport << " as digits."); 76 return 255; 77 } 78 LOG(1, "INFO: Using " << workerport << " as listen port for worker."); 79 } else { 80 ELOG(1, "Requiring listen port for worker."); 81 return 255; 82 } 83 84 unsigned short controllerport; 85 if (vm.count("controllerport")) { 86 try { 87 controllerport = vm["controllerport"].as< unsigned short >(); 88 } catch (boost::bad_lexical_cast) { 89 ELOG(1, "Could not read " << controllerport << " as digits."); 90 return 255; 91 } 92 LOG(1, "INFO: Using " << controllerport << " as listen port for controller."); 93 } else { 94 ELOG(1, "Requiring listen port for controller."); 95 return 255; 96 } 44 97 45 98 size_t Exitflag = 0; 46 99 try 47 100 { 48 // Check command line arguments.49 if (argc != 3)50 {51 std::cerr << "Usage: " << argv[0] << " <worker port> <controller port>" << std::endl;52 return 1;53 }54 unsigned short workerport = boost::lexical_cast<unsigned short>(argv[1]);55 unsigned short controllerport = boost::lexical_cast<unsigned short>(argv[2]);56 57 101 boost::asio::io_service io_service; 58 102 FragmentScheduler Server(io_service, workerport, controllerport);
Note:
See TracChangeset
for help on using the changeset viewer.