Ignore:
Timestamp:
Apr 22, 2010, 2:00:03 PM (15 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:
299554
Parents:
6613ec
Message:

Huge change: Log() << Verbose(.) --> DoLog(.) && (Log() << Verbose(.) << ...);

Most of the files are affected, but this is necessary as if DoLog() says verbosity is not enough, all the stream operators won"t get executed which saves substantial amount of computation time.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_correlation.cpp

    r6613ec ra67d19  
    4646      while (Walker->next != (*MolWalker)->end) {
    4747        Walker = Walker->next;
    48         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     48        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    4949        if ((type1 == NULL) || (Walker->type == type1)) {
    5050          for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
    5151            if ((*MolOtherWalker)->ActiveFlag) {
    52               Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;
     52              DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);
    5353              atom *OtherWalker = (*MolOtherWalker)->start;
    5454              while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
    5555                OtherWalker = OtherWalker->next;
    56                 Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;
     56                DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl);
    5757                if (Walker->nr < OtherWalker->nr)
    5858                  if ((type2 == NULL) || (OtherWalker->type == type2)) {
     
    104104      while (Walker->next != (*MolWalker)->end) {
    105105        Walker = Walker->next;
    106         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     106        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    107107        if ((type1 == NULL) || (Walker->type == type1)) {
    108108          periodicX.CopyVector(Walker->node);
     
    117117                for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
    118118                  if ((*MolOtherWalker)->ActiveFlag) {
    119                     Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;
     119                    DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);
    120120                    atom *OtherWalker = (*MolOtherWalker)->start;
    121121                    while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
    122122                      OtherWalker = OtherWalker->next;
    123                       Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;
     123                      DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl);
    124124                      if (Walker->nr < OtherWalker->nr)
    125125                        if ((type2 == NULL) || (OtherWalker->type == type2)) {
     
    164164
    165165  if (molecules->ListOfMolecules.empty()) {
    166     Log() << Verbose(1) <<"No molecule given." << endl;
     166    DoLog(1) && (Log() << Verbose(1) <<"No molecule given." << endl);
    167167    return outmap;
    168168  }
     
    170170  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
    171171    if ((*MolWalker)->ActiveFlag) {
    172       Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
    173       atom *Walker = (*MolWalker)->start;
    174       while (Walker->next != (*MolWalker)->end) {
    175         Walker = Walker->next;
    176         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     172      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
     173      atom *Walker = (*MolWalker)->start;
     174      while (Walker->next != (*MolWalker)->end) {
     175        Walker = Walker->next;
     176        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    177177        if ((type == NULL) || (Walker->type == type)) {
    178178          distance = Walker->node->PeriodicDistance(point, World::get()->cell_size);
    179           Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
     179          DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl);
    180180          outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
    181181        }
     
    204204
    205205  if (molecules->ListOfMolecules.empty()) {
    206     Log() << Verbose(1) <<"No molecule given." << endl;
     206    DoLog(1) && (Log() << Verbose(1) <<"No molecule given." << endl);
    207207    return outmap;
    208208  }
     
    212212      double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size);
    213213      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    214       Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
    215       atom *Walker = (*MolWalker)->start;
    216       while (Walker->next != (*MolWalker)->end) {
    217         Walker = Walker->next;
    218         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     214      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
     215      atom *Walker = (*MolWalker)->start;
     216      while (Walker->next != (*MolWalker)->end) {
     217        Walker = Walker->next;
     218        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    219219        if ((type == NULL) || (Walker->type == type)) {
    220220          periodicX.CopyVector(Walker->node);
     
    228228                checkX.MatrixMultiplication(FullMatrix);
    229229                distance = checkX.Distance(point);
    230                 Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
     230                DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl);
    231231                outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
    232232              }
     
    263263  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
    264264    if ((*MolWalker)->ActiveFlag) {
    265       Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl;
     265      DoLog(1) && (Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl);
    266266      atom *Walker = (*MolWalker)->start;
    267267      while (Walker->next != (*MolWalker)->end) {
     
    276276      }
    277277    } else
    278       Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl;
     278      DoLog(1) && (Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl);
    279279
    280280
     
    307307
    308308  if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) {
    309     Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl;
     309    DoLog(1) && (Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl);
    310310    return outmap;
    311311  }
     
    317317      double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size);
    318318      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    319       Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
    320       atom *Walker = (*MolWalker)->start;
    321       while (Walker->next != (*MolWalker)->end) {
    322         Walker = Walker->next;
    323         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     319      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
     320      atom *Walker = (*MolWalker)->start;
     321      while (Walker->next != (*MolWalker)->end) {
     322        Walker = Walker->next;
     323        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    324324        if ((type == NULL) || (Walker->type == type)) {
    325325          periodicX.CopyVector(Walker->node);
Note: See TracChangeset for help on using the changeset viewer.