Ignore:
Timestamp:
Apr 22, 2010, 2:00:03 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
423c7b
Parents:
c43766
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
  • molecuilder/src/joiner.cpp

    rc43766 r1f2e46  
    4747  bool NoHessian = false;
    4848
    49   Log() << Verbose(0) << "Joiner" << endl;
    50   Log() << Verbose(0) << "======" << endl;
     49  DoLog(0) && (Log() << Verbose(0) << "Joiner" << endl);
     50  DoLog(0) && (Log() << Verbose(0) << "======" << endl);
    5151
    5252  // Get the command line options
    5353  if (argc < 3) {
    54     Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> [elementsdb]" << endl;
    55     Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl;
    56     Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl;
    57     Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl;
     54    DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> [elementsdb]" << endl);
     55    DoLog(0) && (Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl);
     56    DoLog(0) && (Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl);
     57    DoLog(0) && (Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl);
    5858    return 1;
    5959  } else {
     
    7777  if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0)) {
    7878    NoHCorrection = true;
    79     Log() << Verbose(0) << "No HCorrection matrices found, skipping these." << endl;
     79    DoLog(0) && (Log() << Verbose(0) << "No HCorrection matrices found, skipping these." << endl);
    8080  }
    8181  if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1;
    8282  if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix, 0,0)) {
    8383    NoHessian = true;
    84     Log() << Verbose(0) << "No hessian matrices found, skipping these." << endl;
     84    DoLog(0) && (Log() << Verbose(0) << "No hessian matrices found, skipping these." << endl);
    8585  }
    8686  if (periode != NULL) { // also look for PAS values
     
    146146  for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
    147147    // --------- sum up energy --------------------
    148     Log() << Verbose(0) << "Summing energy of order " << BondOrder+1 << " ..." << endl;
     148    DoLog(0) && (Log() << Verbose(0) << "Summing energy of order " << BondOrder+1 << " ..." << endl);
    149149    if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return 1;
    150150    if (!NoHCorrection) {
     
    155155      if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return 1;
    156156    // --------- sum up Forces --------------------
    157     Log() << Verbose(0) << "Summing forces of order " << BondOrder+1 << " ..." << endl;
     157    DoLog(0) && (Log() << Verbose(0) << "Summing forces of order " << BondOrder+1 << " ..." << endl);
    158158    if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return 1;
    159159    if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return 1;
    160160    // --------- sum up Hessian --------------------
    161161    if (!NoHessian) {
    162       Log() << Verbose(0) << "Summing Hessian of order " << BondOrder+1 << " ..." << endl;
     162      DoLog(0) && (Log() << Verbose(0) << "Summing Hessian of order " << BondOrder+1 << " ..." << endl);
    163163      if (!HessianFragments.SumSubManyBodyTerms(Hessian, KeySet, BondOrder)) return 1;
    164164      if (!Hessian.SumSubHessians(HessianFragments, KeySet, BondOrder, 1.)) return 1;
    165165    }
    166166    if (periode != NULL) { // also look for PAS values
    167       Log() << Verbose(0) << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl;
     167      DoLog(0) && (Log() << Verbose(0) << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl);
    168168      if (!ShieldingFragments.SumSubManyBodyTerms(Shielding, KeySet, BondOrder)) return 1;
    169169      if (!Shielding.SumSubForces(ShieldingFragments, KeySet, BondOrder, 1.)) return 1;
     
    179179    prefix.str(" ");
    180180    prefix << dir << OrderSuffix << (BondOrder+1);
    181     Log() << Verbose(0) << "Writing files " << argv[1] << prefix.str() << ". ..." << endl;
     181    DoLog(0) && (Log() << Verbose(0) << "Writing files " << argv[1] << prefix.str() << ". ..." << endl);
    182182    // energy
    183183    if (!Energy.WriteLastMatrix(argv[1], (prefix.str()).c_str(), EnergySuffix)) return 1;
     
    244244  delete(periode);
    245245  Free(&dir);
    246   Log() << Verbose(0) << "done." << endl;
     246  DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    247247  return 0;
    248248};
Note: See TracChangeset for help on using the changeset viewer.