Changeset ad7270 for src


Ignore:
Timestamp:
Dec 16, 2010, 5:32:23 PM (14 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:
2a0a9e3
Parents:
f4d063
git-author:
Frederik Heber <heber@…> (12/15/10 16:26:52)
git-committer:
Frederik Heber <heber@…> (12/16/10 17:32:23)
Message:

Reduced initial verbosity of code.

FIX:

  • initUI() - no more admonishing of missing bond length table.

The following messages have been placed in comments:

  • Registering of Action/Options.
  • Looking for KnownTypes.
  • Stating MenuNames, Separators and submenu creations.
  • No more listing of parsed elements.
  • No more listing of thermostats.

The following messages have been added:

  • prepended scanning arguments in CommandLineParser::scan...().
  • prepended running arguments in CommandLineWindow::display().
  • additional new line after ProgamHeader().
  • correct CommandLine UI setting to occur before arguments are parsed.
  • changed verbosity levels of CommandLineParser::scanforSequenceOfArguments(), also all use DoLog(), i.e. global verbosity makes them be listed again.

NOTE:

  • MemDebug: as delete NULL is safe, we do not warn when this occurs. Also, in Qt this happens a lot.

TESTFIX:

  • setting global verbosity to 1, messed with Standard_Options/1. There we set verbosity to 9 to avoid this in the future.
Location:
src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/CommandAction/BondLengthTableAction.cpp

    rf4d063 rad7270  
    4747  if (configuration->BG == NULL) {
    4848    configuration->BG = new BondGraph(configuration->GetIsAngstroem());
    49     if ((!params.BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName.string()))) {
     49    if ((!params.BondGraphFileName.empty())
     50        && boost::filesystem::exists(params.BondGraphFileName)
     51        && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName.string()))) {
    5052      DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    5153      return Action::success;
  • src/Helpers/MemDebug.cpp

    rf4d063 rad7270  
    509509void operator delete(void *ptr) throw() {
    510510  if(!ptr){
    511     cerr << "Warning: Deleting NULL pointer" << endl;
     511    //cerr << "Warning: Deleting NULL pointer" << endl;
    512512    return;
    513513  }
  • src/ThermoStatContainer.cpp

    rf4d063 rad7270  
    5454  ThermostatTraits<Thermostat> *WoodcockTrait = new ThermostatTraits<Woodcock>();
    5555  availThermostats[WoodcockTrait->getName()] = WoodcockTrait;
    56   for(traitsMap::iterator iter = availThermostats.begin();iter!=availThermostats.end();++iter){
    57     cout << iter->first << endl;
    58   }
     56
     57  // for debugging: list all thermostats
     58//  cout << "List of known thermostats: ";
     59//  for(traitsMap::iterator iter = availThermostats.begin();iter!=availThermostats.end();++iter){
     60//    cout << iter->first << " ";
     61//  }
     62//  cout << endl;
     63
    5964  ASSERT(availThermostats.size()==6,"Not all implemented thermostats referenced!\nDid you check the names in the traits?");
    6065  activeThermostat=new Berendsen();
  • src/UIElements/CommandLineUI/CommandLineParser.cpp

    rf4d063 rad7270  
    9797      const OptionTrait* const currentOption = OptionRegistry::getInstance().getOptionByName(optioniter->first);
    9898      // add the option
    99       std::cout << "Registering Option "
    100           << currentOption->getName()
    101           << " with type '" << currentOption->getTypeName() << "' "
    102           << " with description '" << currentOption->getDescription() << "' ";
    103       if (currentOption->hasShortForm())
    104         std::cout << ", with short form " << currentOption->getShortForm();
    105       else
    106         std::cout << ", with no short form ";
    107       if (currentOption->hasDefaultValue())
    108         std::cout << ", with default value " << currentOption->getDefaultValue();
    109       else
    110         std::cout << ", with no default value ";
    111       std::cout << std::endl;
     99//      std::cout << "Registering Option "
     100//          << currentOption->getName()
     101//          << " with type '" << currentOption->getTypeName() << "' "
     102//          << " with description '" << currentOption->getDescription() << "' ";
     103//      if (currentOption->hasShortForm())
     104//        std::cout << ", with short form " << currentOption->getShortForm();
     105//      else
     106//        std::cout << ", with no short form ";
     107//      if (currentOption->hasDefaultValue())
     108//        std::cout << ", with default value " << currentOption->getDefaultValue();
     109//      else
     110//        std::cout << ", with no default value ";
     111//      std::cout << std::endl;
    112112
    113113      AddOptionToParser(currentOption, (CmdParserLookup["options"]));
     
    116116    if (!ActionAlreadyAdded_flag) {
    117117      // add the action
    118       std::cout << "Registering Action "
    119           << currentAction->Traits.getName()
    120           << " in menu " << currentAction->Traits.getMenuName()
    121           << " with type '" << currentAction->Traits.getTypeName() << "' "
    122           << " with description '" << currentAction->Traits.getDescription() << "' ";
    123       if (currentAction->Traits.hasShortForm())
    124         std::cout << ", with short form " << currentAction->Traits.getShortForm();
    125       else
    126         std::cout << ", with no short form ";
    127       if (currentAction->Traits.hasDefaultValue())
    128         std::cout << ", with default value " << currentAction->Traits.getDefaultValue();
    129       else
    130         std::cout << ", with no default value ";
    131       std::cout  << std::endl;
     118//      std::cout << "Registering Action "
     119//          << currentAction->Traits.getName()
     120//          << " in menu " << currentAction->Traits.getMenuName()
     121//          << " with type '" << currentAction->Traits.getTypeName() << "' "
     122//          << " with description '" << currentAction->Traits.getDescription() << "' ";
     123//      if (currentAction->Traits.hasShortForm())
     124//        std::cout << ", with short form " << currentAction->Traits.getShortForm();
     125//      else
     126//        std::cout << ", with no short form ";
     127//      if (currentAction->Traits.hasDefaultValue())
     128//        std::cout << ", with default value " << currentAction->Traits.getDefaultValue();
     129//      else
     130//        std::cout << ", with no default value ";
     131//      std::cout  << std::endl;
    132132
    133133      ASSERT(CmdParserLookup.find(currentAction->Traits.getMenuName()) != CmdParserLookup.end(),
     
    156156  ASSERT(currentOption != NULL, "CommandLineParser::AddOptionToParser() - currentOption is NULL!");
    157157  // add other options
    158   std::cout << "Adding Action " << currentOption->getName() << " with type " << currentOption->getType()->name() << " and KeyandShortform " << currentOption->getKeyAndShortForm() << " to CommandLineParser." << std::endl;
     158  //std::cout << "Adding Action " << currentOption->getName() << " with type " << currentOption->getType()->name() << " and KeyandShortform " << currentOption->getKeyAndShortForm() << " to CommandLineParser." << std::endl;
    159159  switch(TypeToEnums.getEnumforType(currentOption->getType())) {
    160160    default:
     
    369369{
    370370  std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
     371  DoLog(0) && (Log() << Verbose(0) << "Scanning command line arguments and recognizing Actions." << std::endl);
    371372  // go through all arguments
    372373  for (int i=1;i<argc;i++) {
    373     (std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl);
     374    DoLog(2) && (Log() << Verbose(2) << "Checking on " << argv[i] << std::endl);
    374375    // check whether they
    375376    if (argv[i][0] == '-') { // .. begin with -
    376       (cout << Verbose(1) << "Possible argument: " << argv[i] << endl);
     377      DoLog(2) && (Log() << Verbose(2) << "Possible argument: " << argv[i] << endl);
    377378      if (argv[i][1] == '-') { // .. or --
    378         (cout << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);
     379        DoLog(1) && (Log() << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);
    379380        SequenceOfActions.push_back(&(argv[i][2]));
    380381        //  .. and check that next letter is not numeric, if so insert
     
    382383        std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
    383384        if (iter != ShortFormToActionMap.end()) {
    384           (cout << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);
     385          DoLog(1) && (Log() << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);
    385386          SequenceOfActions.push_back(iter->second);
    386387        }
  • src/UIElements/CommandLineUI/CommandLineWindow.cpp

    rf4d063 rad7270  
    2525#include "CommandLineUI/CommandLineStatusIndicator.hpp"
    2626
     27#include "Helpers/Log.hpp"
     28#include "Helpers/Verbose.hpp"
     29
    2730#include "Actions/Action.hpp"
    2831#include "Actions/ActionRegistry.hpp"
     
    5053
    5154  // go through all possible actions
     55  DoLog(0) && (Log() << Verbose(0) << "Calling Actions ... " << std::endl);
    5256  for (std::list<std::string>::iterator CommandRunner = CommandLineParser::getInstance().SequenceOfActions.begin(); CommandRunner != CommandLineParser::getInstance().SequenceOfActions.end(); ++CommandRunner) {
    53     cout << "Checking presence of " << *CommandRunner << ": ";
    5457    if (ActionRegistry::getInstance().isActionPresentByName(*CommandRunner)) {
    55       cout << "calling " << *CommandRunner << endl;
     58      DoLog(1) && (Log() << Verbose(1)
     59          << "Checking presence of " << *CommandRunner << ": "
     60          << "calling " << *CommandRunner << endl);
    5661      ActionRegistry::getInstance().getActionByName(*CommandRunner)->call();
    5762    } else {
    58       cout << "absent." << endl;
     63      DoLog(1) && (Log() << Verbose(1)
     64          << "Checking presence of " << *CommandRunner << ": "
     65          << "absent." << endl);
    5966    }
    6067  }
  • src/UIElements/CommandLineUI/TypeEnumContainer.cpp

    rf4d063 rad7270  
    6464  TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElementsType;
    6565
    66   ListAllKnownTypes();
     66  // for debugging: list all stored types
     67  //ListAllKnownTypes();
    6768};
    6869
     
    8384    std::cout << " Known type is " << (iter->first)->name() << " or enum " << iter->second << std::endl;
    8485  }
    85   std::cout << "BoxVector type is " << typeid(BoxVector).name() << std::endl;
    86   std::cout << "Vector type is " << typeid(Vector).name() << std::endl;
    87   std::cout << "VectorValue type is " << typeid(VectorValue).name() << std::endl;
    8886}
    8987
     
    9492enum TypeEnumContainer::EnumOfTypes TypeEnumContainer::getEnumforType(const std::type_info *_type)
    9593{
    96   std::cout << "Looking for type " << _type->name() << std::endl;
     94  //std::cout << "Looking for type " << _type->name() << std::endl;
    9795  ASSERT(TypeEnumMap.find(_type) != TypeEnumMap.end(),
    9896      "CommandLineParser::getEnumforType() - cannot find the type as enum!.");
  • src/UIElements/Menu/Menu.cpp

    rf4d063 rad7270  
    7676        const std::string &TopName = iter->second.first;
    7777        const int &MenuPosition = iter->second.second;
    78         std::cout << "MenuName is " << MenuName
    79             << ", TopName is " << TopName
    80             << " and Position is " << MenuPosition
    81             << std::endl;
     78//        std::cout << "MenuName is " << MenuName
     79//            << ", TopName is " << TopName
     80//            << " and Position is " << MenuPosition
     81//            << std::endl;
    8282
    8383        // does it belong to us?
     
    125125void Menu::addSeparator()
    126126{
    127   std::cout << "Creating separator at position " << TopPosition << std::endl;
     127//  std::cout << "Creating separator at position " << TopPosition << std::endl;
    128128  ASSERT( LastItem != SeparatorItem,
    129129      "Menu::populate() - adding another separator after a separator!");
     
    135135void Menu::addSubmenu(const std::string &MenuName, const int MenuPosition)
    136136{
    137   std::cout << "Creating top-level menu " << MenuName
    138       << " at position " << TopPosition << std::endl;
     137//  std::cout << "Creating top-level menu " << MenuName
     138//      << " at position " << TopPosition << std::endl;
    139139  ASSERT (!isPresent(MenuName),
    140140      "Menu::addSubmenu() - trying to add menu "+MenuName+" with already present token!");
  • src/UIElements/Menu/MenuDescription.cpp

    rf4d063 rad7270  
    8989MenuDescription::~MenuDescription()
    9090{
    91   std::cout << "MenuDescription: clearing maps ... " << std::endl;
     91  //std::cout << "MenuDescription: clearing maps ... " << std::endl;
    9292  for (IterableMap::iterator iter = MenuPositionMap->begin(); !MenuPositionMap->empty(); iter = MenuPositionMap->begin())
    9393    MenuPositionMap->erase(iter);
  • src/UIElements/Menu/Qt4/QtMenu.hpp

    rf4d063 rad7270  
    7272        CharRunner != ActionName.end();
    7373        ++CharRunner) {
    74       std::cout << "Current char is " << *CharRunner << std::endl;
     74//      std::cout << "Current char is " << *CharRunner << std::endl;
    7575      if (!Inserted) {
    7676        Inserter = ShortcutMap.insert(
     
    7878            );
    7979        if (Inserter.second) {
    80           std::cout << "Accelerator is " << *CharRunner << std::endl;
     80//          std::cout << "Accelerator is " << *CharRunner << std::endl;
    8181          newname += '&';
    8282          Inserted = true;
  • src/builder_init.cpp

    rf4d063 rad7270  
    6767  cout << "`MoleCuilder - to create and alter molecular systems." << endl;
    6868  cout << "Copyright (C) 2010  University Bonn. All rights reserved." << endl;
     69  cout << endl;
    6970}
    7071
     
    8081  ProgramHeader();
    8182
    82   setVerbosity(0);
     83  setVerbosity(1);
    8384  // need to init the history before any action is created
    8485  ActionHistory::init();
     
    101102  if (World::getInstance().getConfig()->BG == NULL) {
    102103    World::getInstance().getConfig()->BG = new BondGraph(World::getInstance().getConfig()->GetIsAngstroem());
    103     if (World::getInstance().getConfig()->BG->LoadBondLengthTable(BondGraphFileName)) {
    104       DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    105     } else {
    106       DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
     104    if (boost::filesystem::exists(BondGraphFileName)) {
     105      if (World::getInstance().getConfig()->BG->LoadBondLengthTable(BondGraphFileName)) {
     106        DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
     107      } else {
     108        DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
     109      }
    107110    }
    108111  }
    109112  // handle remaining arguments by CommandLineParser
    110113  if (argc>1) {
     114    DoLog(0) && (Log() << Verbose(0) << "Setting UI to CommandLine." << endl);
    111115    CommandLineParser::getInstance().InitializeCommandArguments();
    112116    CommandLineParser::getInstance().Run(argc,argv);
    113     DoLog(0) && (Log() << Verbose(0) << "Setting UI to CommandLine." << endl);
    114117    UIFactory::registerFactory(new CommandLineUIFactory::description());
    115118    UIFactory::makeUserInterface("CommandLine");
  • src/periodentafel.cpp

    rf4d063 rad7270  
    307307    //cout << "First header: " << header1tmp << endl;
    308308    //cout << "Second header: " << header2tmp << endl;
    309     DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
     309//    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
    310310    while (!input.eof()) {
    311311      element *neues = new element;
     
    332332      if ((neues->getNumber() > 0) && (neues->getNumber() < MAX_ELEMENTS)) {
    333333        parsedElements[neues->Z] = neues;
    334         DoLog(0) && (Log() << Verbose(0) << " " << *neues);
     334//        DoLog(0) && (Log() << Verbose(0) << " " << *neues);
    335335      } else {
    336336        DoeLog(2) && (eLog() << Verbose(2) << "Detected empty line or invalid element in elements db, discarding." << endl);
     
    345345      }
    346346    }
    347     DoLog(0) && (Log() << Verbose(0) << endl);
     347//    DoLog(0) && (Log() << Verbose(0) << endl);
    348348  } else {
    349349    DoeLog(1) && (eLog() << Verbose(1) << "Could not open the database." << endl);
Note: See TracChangeset for help on using the changeset viewer.