Changeset f0da45


Ignore:
Timestamp:
Aug 30, 2012, 3:37:35 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
0d2f18
Parents:
59076a
Message:

Gathering of data (e.g. sampling electron density) goes into extra timing in MPQCData.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/bin/mpqc/mpqc.cc

    r59076a rf0da45  
    14711471  // here, we may gather the results
    14721472  // we start to fill the MPQC_Data object
     1473  if (tim.nonnull()) tim->enter("gather");
    14731474  {
    14741475     Ref<Wavefunction> wfn;
     
    14881489//     }
    14891490     // print the energy
    1490      data.energies.total = mole->energy();
     1491     data.energies.total = wfn->energy();
    14911492     data.energies.nuclear_repulsion = wfn->nuclear_repulsion_energy();
    14921493     {
     
    16131614     }
    16141615     grad = NULL;
    1615      {
    1616        // times obtain from key "mpqc" which should be the first
    1617        double *cpu_time = new double[tim->nregion()];
    1618        double *wall_time = new double[tim->nregion()];
    1619        double *flops = new double[tim->nregion()];
    1620        tim->get_cpu_times(cpu_time);
    1621        tim->get_wall_times(wall_time);
    1622        tim->get_flops(flops);
    1623        if (cpu_time != NULL)
    1624          data.times.cputime = cpu_time[0];
    1625        if (wall_time != NULL)
    1626          data.times.walltime = wall_time[0];
    1627        if (flops != NULL)
    1628          data.times.flops = flops[0];
    1629        delete[] cpu_time;
    1630        delete[] wall_time;
    1631        delete[] flops;
    1632      }
    16331616
    16341617     {
     
    17761759     }
    17771760     scf = 0;
     1761     if (tim.nonnull()) tim->exit("gather");
     1762     {
     1763       // times obtain from key "mpqc" which should be the first
     1764       const int nregion = tim->nregion();
     1765       std::cout << "There are " << nregion << " timed regions." << std::endl;
     1766       double *cpu_time = new double[nregion];
     1767       double *wall_time = new double[nregion];
     1768       double *flops = new double[nregion];
     1769       const char **region_names = new const char*[nregion];
     1770       tim->get_region_names(region_names);
     1771       // find "gather"
     1772       size_t gather_region=0;
     1773       for (;gather_region<nregion;++gather_region) {
     1774         std::cout << "Comparing " << region_names[gather_region] << " and 'gather'" << std::endl;
     1775         if (strcmp(region_names[gather_region], "gather") == 0)
     1776           break;
     1777       }
     1778       if (gather_region == nregion)
     1779         gather_region = nregion;
     1780       tim->get_cpu_times(cpu_time);
     1781       tim->get_wall_times(wall_time);
     1782       tim->get_flops(flops);
     1783       if (cpu_time != NULL) {
     1784         data.times.total_cputime = cpu_time[0];
     1785         data.times.gather_cputime = cpu_time[nregion];
     1786       }
     1787       if (wall_time != NULL) {
     1788         data.times.total_walltime = wall_time[0];
     1789         data.times.gather_walltime = wall_time[nregion];
     1790       }
     1791       if (flops != NULL) {
     1792         data.times.total_flops = flops[0];
     1793         data.times.gather_flops = flops[nregion];
     1794       }
     1795       delete[] cpu_time;
     1796       delete[] wall_time;
     1797       delete[] flops;
     1798     }
    17781799
    17791800//     // GaussianShell is the actual orbital functions it seems ...
Note: See TracChangeset for help on using the changeset viewer.