#include <QMCManager.h>
Public Member Functions | |
QMCManager () | |
Creates an uninitialized instance of this class. | |
~QMCManager () | |
Destroys this object, cleans up the memory, and closes all open streams. | |
void | initialize (int argc, char **argv) |
Initializes this object and loads the input data for the calculation. | |
void | finalize () |
Prepares the calculation to terminate. | |
bool | run (bool equilibrate) |
Performs a QMC calculation. | |
void | optimize () |
Optimizes the parameters in a variational QMC (VMC) calculation using the correlated sampling method. | |
void | zeroOut () |
Zeroes out all of the statistical data calculated by this object. | |
void | resetTimers () |
Useful for resetting the timers for every optimization step. | |
void | writeRestart (string filename) |
Writes the restart file for the calculation. | |
void | writeRestart () |
Writes the restart file for the calculation. | |
void | writeBFDensity () |
Writes the basis function density for the calculation. | |
void | writeForces () |
Writes the calculated forces for the calculation. | |
void | writeTimingData (ostream &strm) |
Writes the timing data to a stream. | |
QMCInput * | getInputData () |
Gets the input data for the calculation. | |
ostream * | getResultsOutputStream () |
Gets the stream for outputting results from a calculation. | |
Static Public Member Functions | |
static void | receiveSignal (signalType signal) |
Call this function when you want QMCManager to change its signal flags. | |
Private Member Functions | |
void | initializeMPI () |
Initializes MPI on this processor for a parallel calculation. | |
void | initializeOutputs () |
Initialize the output streams for the calculation. | |
void | finalizeOutputs () |
Finalize the output streams for the calculation. | |
void | writeCheckpoint () |
Writes the checkpoint file for this node to disk. | |
void | writeTransientProperties (int label) |
Writes the current statistics for the calculated properties to a file. | |
void | initializeCalculationState (long int iseed) |
Initializes the state of this object. | |
string | sendAllProcessorsInputFileName (char **argv) |
Send all of the processors the input file name. | |
void | sendAllProcessorsACommand (int command) |
Send all of the processors a command in the form of an integer. | |
void | gatherProperties () |
Gathers the statistics of the calculated properties from all the processors and saves the result in Properties_total. | |
void | gatherExtraProperties () |
Gathers the statistics of the calculated properties from all the processors. | |
void | gatherDensities () |
Gathers the statistics for the basis function densities from all the processors and saves the result in Properties_total. | |
void | gatherForces () |
Gathers the statistics for the forces from all the processors and saves the result in fwProperties_total. | |
void | gatherHistograms () |
Gathers the electron density histograms from all the processors. | |
void | writeElectronDensityHistograms () |
Writes out the electron density histograms to files. | |
void | synchronizeDMCEnsemble () |
The global results are collected and sent to all processors, where they are used to update the estimated energy, trial energy, and effective time step. | |
int | pollForACommand () |
Checks to see if a command is waiting for this processor. | |
void | writeEnergyResultsSummary (ostream &strm) |
Writes a summary of the energy statistics to a stream. | |
void | writeEnergyResultsHeader (ostream &strm) |
void | checkTerminationCriteria () |
Checks to see if any of the termination criteria for the calculation have been satisfied. | |
void | checkMaxStepsTerminationCriteria () |
Checks to see if the total number of QMC steps performed by the calculation exceeds the maximum value set in the input. | |
void | checkMaxTimeTerminationCriteria () |
Checks if we have run the calculation for a long enough period of time, as specified by max_time in the input. | |
void | checkConvergenceBasedTerminationCriteria () |
Checks to see if the energy standard deviation has converged sufficiently to terminate. | |
void | equilibration_step () |
void | updateEstimatedEnergy (QMCProperties *Properties) |
Updates the estimated value of the energy. | |
void | updateTrialEnergy (double totalWeight, int nwalkers_original) |
Updates the diffusion QMC (DMC) trial energy. | |
void | updateEffectiveTimeStep (QMCProperties *Properties) |
Updates the effective time step used for diffusion QMC (DMC). | |
void | synchronizationBarrier () |
Forces all processors to synchronize at this point. | |
void | writeXML (ostream &strm) |
Writes the state of this object to an XML stream. | |
bool | readXML (istream &strm) |
Loads the state of this object from an XML stream. | |
Private Attributes | |
QMCRun | QMCnode |
Walkers plus the basic functionality needed to build a QMC calculation. | |
QMCStopwatches | localTimers |
Input data for the calculation. | |
QMCStopwatches | globalTimers |
Global code timers for the calculation. | |
bool | equilibrating |
true if the calculation is equilibrating and false otherwise. | |
bool | done |
true if the current QMC calculation is done and flase otherwise. | |
unsigned long | iteration |
Iteration in the QMC calculation this processor is on. | |
QMCProperties | Properties_total |
Storage location for global statistical properties on the root node and scratch space on other nodes. | |
QMCPropertyArrays | fwProperties_total |
Same purpose as Properties_total, except that this one holds the properties collected as future walking properties. | |
QMCProperties | equilibrationProperties |
Local statistical properties calculated during the equilibration phase of the calculation. | |
ofstream * | qmcRslts |
An output stream for writing the results of the calculation to. | |
ofstream * | qmcOut |
An output stream for writing the progress of the calculation to. | |
Array1D< double > | pllSpinHistogram_total |
Storage location for the global parallel spin histogram on the root node and scratch space on other nodes. | |
Array1D< double > | oppSpinHistogram_total |
Storage location for the global opposite spin histogram on the root node and scratch space on other nodes. | |
Array1D< Array1D< double > > | alphaHistograms_total |
Storage location for the global alpha one electron histograms on the root node and scratch space on other nodes. | |
Array1D< Array1D< double > > | betaHistograms_total |
Storage location for the global beta one electron histograms on the root node and scratch space on other nodes. | |
Array1D< Array1D< double > > | pllxCorrelationDiagram_total |
Storage location for the global parallel pair x coordinate correlation diagram on the root node and scratch space on the other nodes. | |
Array1D< Array1D< double > > | pllyCorrelationDiagram_total |
Storage location for the global parallel pair y coordinate correlation diagram on the root node and scratch space on the other nodes. | |
Array1D< Array1D< double > > | pllzCorrelationDiagram_total |
Storage location for the global parallel pair z coordinate correlation diagram on the root node and scratch space on the other nodes. | |
Array1D< Array1D< double > > | oppxCorrelationDiagram_total |
Storage location for the global opposite pair x coordinate correlation diagram on the root node and scratch space on the other nodes. | |
Array1D< Array1D< double > > | oppyCorrelationDiagram_total |
Storage location for the global opposite pair y coordinate correlation diagram on the root node and scratch space on the other nodes. | |
Array1D< Array1D< double > > | oppzCorrelationDiagram_total |
Storage location for the global opposite pair z coordinate correlation diagram on the root node and scratch space on the other nodes. | |
Static Private Attributes | |
static bool | SIGNAL_SAYS_QUIT = false |
These are signal flags. | |
static bool | REDUCE_ALL_NOW = false |
static bool | INCREASE_TIME = false |
static bool | PRINT_SIG_INFO = false |
Friends | |
ostream & | operator<< (ostream &strm, QMCManager &rhs) |
Writes the current QMC results calculated by this object to an output stream in a human readable format. |
This allows a QMC calculation to be run and parameters to be optimized.
Definition at line 53 of file QMCManager.h.
QMCManager::QMCManager | ( | ) |
Creates an uninitialized instance of this class.
Definition at line 43 of file QMCManager.cpp.
References QMCStopwatches::getTotalTimeStopwatch(), localTimers, and Stopwatch::start().
QMCManager::~QMCManager | ( | ) |
Destroys this object, cleans up the memory, and closes all open streams.
Definition at line 48 of file QMCManager.cpp.
References finalizeOutputs().
void QMCManager::initialize | ( | int | argc, | |
char ** | argv | |||
) |
Initializes this object and loads the input data for the calculation.
argc | number of command line arguments. | |
argv | command line arguments. |
Definition at line 53 of file QMCManager.cpp.
References QMCFlags::calculate_bf_density, done, QMCInput::flags, fwProperties_total, QMCMolecule::getNumberAtoms(), QMCWavefunction::getNumberBasisFunctions(), QMCNuclearForces::getNumBins(), globalInput, QMCRun::initialize(), initializeCalculationState(), initializeMPI(), initializeOutputs(), QMCFlags::iseed, iteration, QMCInput::Molecule, QMCFlags::nuclear_derivatives, QMCnode, sendAllProcessorsInputFileName(), QMCPropertyArrays::setCalcDensity(), QMCPropertyArrays::setCalcForces(), and QMCInput::WF.
Referenced by qmcbeaver().
void QMCManager::finalize | ( | ) |
Prepares the calculation to terminate.
Definition at line 182 of file QMCManager.cpp.
References QMCInput::flags, QMCRun::getEquilibrationStopwatch(), QMCStopwatches::getEquilibrationStopwatch(), QMCRun::getPropagationStopwatch(), QMCStopwatches::getPropagationStopwatch(), globalInput, globalTimers, localTimers, QMCStopwatches::MPI_REDUCE, QMCStopwatches::MPI_TYPE, QMCnode, QMCStopwatches::stop(), QMCRun::stopTimers(), and QMCFlags::use_equilibration_array.
Referenced by qmcbeaver(), and run().
bool QMCManager::run | ( | bool | equilibrate | ) |
Performs a QMC calculation.
The specifics of the calculation are prescribed in the input.
Allow the reallocation of memory since the number of parameters might be different than we had in the previous run.
Whether the run was successfully completed. If we got an energy greater than zero, then we'll assume that the optimization failed. If we kept running, the output files would explode with error messages.
Definition at line 670 of file QMCManager.cpp.
References QMCFlags::base_file_name, QMCFlags::calculate_bf_density, QMCFlags::calculate_Derivatives, QMCRun::calculateElectronDensities(), QMCFlags::checkpoint, QMCFlags::checkpoint_interval, checkTerminationCriteria(), done, QMCFlags::dt, QMCFlags::dt_equilibration, QMCFlags::dt_run, QMCProperties::energy, QMCFlags::equilibrate_first_opt_step, equilibrating, equilibration_step(), QMCFlags::equilibration_steps, equilibrationProperties, finalize(), QMCInput::flags, gatherDensities(), gatherExtraProperties(), gatherForces(), gatherHistograms(), gatherProperties(), QMCProperty::getAverage(), QMCStopwatches::getEquilibrationStopwatch(), QMCInput::getNumberAIParameters(), QMCRun::getNumberOfWalkers(), QMCRun::getPopulationSizeBiasCorrectionFactor(), QMCStopwatches::getPropagationStopwatch(), QMCRun::getProperties(), getResultsOutputStream(), QMCRun::getTimeStepProperties(), QMCStopwatches::getTotalTimeStopwatch(), QMCRun::getWeights(), globalInput, INCREASE_TIME, QMCRun::initializeFunction(), iteration, localTimers, QMCFlags::max_time_steps, QMCFlags::mpipoll_interval, QMCFlags::mpireduce_interval, QMCFlags::my_rank, QMCProperties::newSample(), QMCFlags::nuclear_derivatives, QMCFlags::number_of_walkers_initial, QMCFlags::optimize_Psi, QMCFlags::output_interval, QMCFlags::parallelization_method, pollForACommand(), QMCFlags::print_config_frequency, QMCFlags::print_configs, PRINT_SIG_INFO, QMCFlags::print_transient_properties, QMCFlags::print_transient_properties_interval, QMCInput::printAISummary(), Properties_total, QMC_REDUCE, QMC_REDUCE_ALL, QMC_SYNCHRONIZE, QMC_TERMINATE, QMC_WORK_STEP, QMCnode, qmcOut, REDUCE_ALL_NOW, QMCFlags::run_type, sendAllProcessorsACommand(), QMCFlags::set_debug, SIGNAL_SAYS_QUIT, Stopwatch::start(), QMCRun::startTimers(), QMCRun::step(), Stopwatch::stop(), QMCRun::stopTimers(), QMCFlags::synchronize_dmc_ensemble, QMCFlags::synchronize_dmc_ensemble_interval, synchronizeDMCEnsemble(), updateEffectiveTimeStep(), updateEstimatedEnergy(), QMCRun::updateHFPotential(), updateTrialEnergy(), QMCFlags::use_equilibration_array, QMCFlags::use_hf_potential, QMCFlags::write_all_energies_out, QMCFlags::write_electron_densities, writeCheckpoint(), writeElectronDensityHistograms(), QMCRun::writeEnergies(), writeEnergyResultsHeader(), writeEnergyResultsSummary(), writeRestart(), writeTimingData(), writeTransientProperties(), zeroOut(), and QMCProperties::zeroOut().
Referenced by qmcbeaver().
void QMCManager::optimize | ( | ) |
Optimizes the parameters in a variational QMC (VMC) calculation using the correlated sampling method.
Definition at line 1189 of file QMCManager.cpp.
References QMCProperties::energy, QMCFlags::equilibration_steps, QMCInput::flags, fwProperties_total, QMCProperty::getNumberSamples(), QMCStopwatches::getOptimizationStopwatch(), QMCRun::getProperties(), globalInput, iteration, QMCInput::JP, localTimers, QMCFlags::my_rank, QMCInput::openConfigFile(), QMCCorrelatedSamplingVMCOptimization::optimize(), QMCFlags::optimize_Psi, QMCFlags::print_config_frequency, Properties_total, QMCnode, qmcRslts, Stopwatch::start(), Stopwatch::stop(), and QMCFlags::use_equilibration_array.
Referenced by qmcbeaver().
void QMCManager::zeroOut | ( | ) |
Zeroes out all of the statistical data calculated by this object.
Definition at line 2313 of file QMCManager.cpp.
References equilibrationProperties, fwProperties_total, Properties_total, QMCnode, QMCPropertyArrays::zeroOut(), QMCRun::zeroOut(), and QMCProperties::zeroOut().
Referenced by qmcbeaver(), and run().
void QMCManager::resetTimers | ( | ) | [inline] |
Useful for resetting the timers for every optimization step.
Definition at line 100 of file QMCManager.h.
References localTimers, and QMCStopwatches::reset().
Referenced by qmcbeaver().
void QMCManager::writeRestart | ( | string | filename | ) |
Writes the restart file for the calculation.
filename | the name of the file to write the input into |
Definition at line 1818 of file QMCManager.cpp.
References QMCInput::flags, globalInput, QMCFlags::input_file_name, QMCFlags::my_rank, QMCFlags::optimize_Psi, writeEnergyResultsHeader(), and writeEnergyResultsSummary().
Referenced by qmcbeaver().
void QMCManager::writeRestart | ( | ) |
Writes the restart file for the calculation.
Uses the Input.flags.restart_file_name as filename.
Definition at line 1813 of file QMCManager.cpp.
References QMCInput::flags, globalInput, and QMCFlags::restart_file_name.
Referenced by run().
void QMCManager::writeBFDensity | ( | ) |
Writes the basis function density for the calculation.
Definition at line 1868 of file QMCManager.cpp.
References QMCPropertyArrays::chiDensity, QMCFlags::density_file_name, QMCInput::flags, fwProperties_total, QMCWavefunction::getNumberBasisFunctions(), globalInput, and QMCInput::WF.
Referenced by qmcbeaver().
void QMCManager::writeForces | ( | ) |
Writes the calculated forces for the calculation.
Definition at line 1882 of file QMCManager.cpp.
References Array1D< T >::dim1(), QMCInput::flags, QMCFlags::force_file_name, fwProperties_total, globalInput, and QMCPropertyArrays::nuclearForces.
Referenced by qmcbeaver().
void QMCManager::writeTimingData | ( | ostream & | strm | ) |
Writes the timing data to a stream.
This is only valid after finalize
is called and only on the root node.
strm | stream to write timing information to. |
Definition at line 1774 of file QMCManager.cpp.
References QMCProperties::energy, QMCInput::flags, QMCProperty::getNumberSamples(), QMCStopwatches::getPropagationStopwatch(), QMCStopwatches::getTotalTimeStopwatch(), globalInput, globalTimers, iteration, localTimers, QMCFlags::number_of_walkers_initial, Properties_total, QMCFlags::set_debug, and Stopwatch::timeUS().
Referenced by qmcbeaver(), and run().
QMCInput * QMCManager::getInputData | ( | ) |
Gets the input data for the calculation.
Definition at line 2303 of file QMCManager.cpp.
References globalInput.
ostream * QMCManager::getResultsOutputStream | ( | ) |
Gets the stream for outputting results from a calculation.
Definition at line 2308 of file QMCManager.cpp.
References qmcRslts.
Referenced by qmcbeaver(), and run().
void QMCManager::receiveSignal | ( | signalType | signal | ) | [static] |
Call this function when you want QMCManager to change its signal flags.
Definition at line 2093 of file QMCManager.cpp.
References INCREASE_TIME, PRINT_SIG_INFO, SIG_INCREASE, SIG_NOTHING, SIG_QUIT, SIG_REDUCE, and SIGNAL_SAYS_QUIT.
Referenced by atSignalCallback().
void QMCManager::initializeMPI | ( | ) | [private] |
Initializes MPI on this processor for a parallel calculation.
Definition at line 88 of file QMCManager.cpp.
References QMCInput::flags, globalInput, QMCFlags::my_rank, and QMCFlags::nprocs.
Referenced by initialize().
void QMCManager::initializeOutputs | ( | ) | [private] |
Initialize the output streams for the calculation.
Definition at line 114 of file QMCManager.cpp.
References QMCInput::flags, globalInput, QMCFlags::my_rank, QMCInput::openConfigFile(), QMCFlags::output_file_name, qmcOut, qmcRslts, and QMCFlags::results_file_name.
Referenced by initialize().
void QMCManager::finalizeOutputs | ( | ) | [private] |
Finalize the output streams for the calculation.
Definition at line 166 of file QMCManager.cpp.
References QMCInput::flags, globalInput, QMCFlags::my_rank, qmcOut, and qmcRslts.
Referenced by ~QMCManager().
void QMCManager::writeCheckpoint | ( | ) | [private] |
Writes the checkpoint file for this node to disk.
Definition at line 1912 of file QMCManager.cpp.
References QMCFlags::checkout_file_name, QMCInput::flags, globalInput, StringManipulation::intToString(), QMCFlags::my_rank, QMCFlags::temp_dir, and writeXML().
Referenced by run().
void QMCManager::writeTransientProperties | ( | int | label | ) | [private] |
Writes the current statistics for the calculated properties to a file.
label | label to indicate which set of transient properties this is. |
Definition at line 1756 of file QMCManager.cpp.
References QMCFlags::base_file_name, QMCInput::flags, globalInput, and StringManipulation::intToString().
Referenced by run().
void QMCManager::initializeCalculationState | ( | long int | iseed | ) | [private] |
Initializes the state of this object.
If checkpoint files are provided and designated to be used, the state is loaded from them; otherwise, the state is randomly generated according to the prescription in the input data.
iseed | the value read in from the input file |
Definition at line 2017 of file QMCManager.cpp.
References QMCFlags::checkin_file_name, QMCFlags::equilibrate_first_opt_step, equilibrating, QMCInput::flags, QMCStopwatches::getInitializationStopwatch(), globalInput, Random::initialize(), StringManipulation::intToString(), localTimers, QMCFlags::my_rank, QMCFlags::optimize_Psi, QMCnode, QMCRun::randomlyInitializeWalkers(), readXML(), Stopwatch::start(), Stopwatch::stop(), QMCFlags::temp_dir, QMCFlags::use_available_checkpoints, writeEnergyResultsSummary(), QMCFlags::zero_out_checkpoint_statistics, and QMCRun::zeroOut().
Referenced by initialize().
string QMCManager::sendAllProcessorsInputFileName | ( | char ** | argv | ) | [private] |
Send all of the processors the input file name.
argv | input from the command line where the first element is the file name. |
Definition at line 2272 of file QMCManager.cpp.
References QMCInput::flags, globalInput, and QMCFlags::my_rank.
Referenced by initialize().
void QMCManager::sendAllProcessorsACommand | ( | int | command | ) | [private] |
Send all of the processors a command in the form of an integer.
command | command to be sent to all processors. |
Definition at line 207 of file QMCManager.cpp.
References QMCInput::flags, QMCStopwatches::getSendCommandStopwatch(), globalInput, localTimers, QMCFlags::nprocs, Stopwatch::start(), and Stopwatch::stop().
Referenced by run().
void QMCManager::gatherProperties | ( | ) | [private] |
Gathers the statistics of the calculated properties from all the processors and saves the result in Properties_total.
Definition at line 305 of file QMCManager.cpp.
References equilibrating, QMCStopwatches::getGatherPropertiesStopwatch(), QMCRun::getProperties(), localTimers, QMCProperties::MPI_REDUCE, QMCProperties::MPI_TYPE, Properties_total, QMCnode, Stopwatch::start(), Stopwatch::stop(), synchronizationBarrier(), QMCRun::zeroOut(), and QMCProperties::zeroOut().
void QMCManager::gatherExtraProperties | ( | ) | [private] |
Gathers the statistics of the calculated properties from all the processors.
These are the non-critical properties, no decisions are made based on this data, so we shouldn't collect the data so often.
Definition at line 237 of file QMCManager.cpp.
References Array2D< T >::array(), Array1D< T >::array(), QMCPropertyArrays::cs_Energies, QMCPropertyArrays::der, Array2D< T >::dim1(), Array1D< T >::dim1(), Array2D< T >::dim2(), fwProperties_total, QMCRun::getFWProperties(), QMCStopwatches::getGatherPropertiesStopwatch(), QMCPropertyArrays::hess, localTimers, QMCProperty::MPI_REDUCE, QMCProperty::MPI_TYPE, QMCPropertyArrays::numDerHessSamples, QMCPropertyArrays::props, QMCnode, Stopwatch::start(), Stopwatch::stop(), and QMCPropertyArrays::zeroOut().
Referenced by run().
void QMCManager::gatherDensities | ( | ) | [private] |
Gathers the statistics for the basis function densities from all the processors and saves the result in Properties_total.
Definition at line 344 of file QMCManager.cpp.
References Array1D< T >::array(), QMCPropertyArrays::chiDensity, fwProperties_total, QMCRun::getFWProperties(), QMCStopwatches::getGatherPropertiesStopwatch(), QMCWavefunction::getNumberBasisFunctions(), globalInput, localTimers, QMCProperty::MPI_REDUCE, QMCProperty::MPI_TYPE, QMCnode, Stopwatch::start(), Stopwatch::stop(), and QMCInput::WF.
Referenced by run().
void QMCManager::gatherForces | ( | ) | [private] |
Gathers the statistics for the forces from all the processors and saves the result in fwProperties_total.
Definition at line 366 of file QMCManager.cpp.
References Array1D< T >::array(), Array1D< T >::dim1(), fwProperties_total, QMCRun::getFWProperties(), QMCStopwatches::getGatherPropertiesStopwatch(), localTimers, QMCProperty::MPI_REDUCE, QMCProperty::MPI_TYPE, QMCPropertyArrays::nuclearForces, QMCnode, Stopwatch::start(), and Stopwatch::stop().
Referenced by run().
void QMCManager::gatherHistograms | ( | ) | [private] |
Gathers the electron density histograms from all the processors.
Definition at line 389 of file QMCManager.cpp.
References Array1D< T >::allocate(), alphaHistograms_total, Array1D< T >::array(), betaHistograms_total, Array1D< T >::deallocate(), Array1D< T >::dim1(), QMCInput::flags, QMCRun::getAlphaHistograms(), QMCRun::getBetaHistograms(), QMCStopwatches::getGatherPropertiesStopwatch(), QMCWavefunction::getNumberElectrons(), QMCRun::getOppSpinHistogram(), QMCRun::getOppxCorrelationDiagram(), QMCRun::getOppyCorrelationDiagram(), QMCRun::getOppzCorrelationDiagram(), QMCRun::getPllSpinHistogram(), QMCRun::getPllxCorrelationDiagram(), QMCRun::getPllyCorrelationDiagram(), QMCRun::getPllzCorrelationDiagram(), globalInput, localTimers, QMCInput::Molecule, QMCFlags::my_rank, QMCMolecule::NucleiTypes, oppSpinHistogram_total, oppxCorrelationDiagram_total, oppyCorrelationDiagram_total, oppzCorrelationDiagram_total, pllSpinHistogram_total, pllxCorrelationDiagram_total, pllyCorrelationDiagram_total, pllzCorrelationDiagram_total, QMCnode, Stopwatch::start(), Stopwatch::stop(), QMCInput::WF, QMCFlags::writeOppxCorrelationDiagram, QMCFlags::writeOppyCorrelationDiagram, QMCFlags::writeOppzCorrelationDiagram, QMCFlags::writePllxCorrelationDiagram, QMCFlags::writePllyCorrelationDiagram, and QMCFlags::writePllzCorrelationDiagram.
Referenced by run().
void QMCManager::writeElectronDensityHistograms | ( | ) | [private] |
Writes out the electron density histograms to files.
Definition at line 1291 of file QMCManager.cpp.
References alphaHistograms_total, QMCFlags::base_file_name, betaHistograms_total, Array1D< T >::deallocate(), Array1D< T >::dim1(), QMCInput::flags, QMCRun::getdr(), QMCWavefunction::getNumberElectrons(), globalInput, QMCInput::Molecule, QMCMolecule::NucleiTypes, oppSpinHistogram_total, oppxCorrelationDiagram_total, QMCFlags::oppxCorrelationDiagramMax, QMCFlags::oppxCorrelationDiagramMin, oppyCorrelationDiagram_total, QMCFlags::oppyCorrelationDiagramMax, QMCFlags::oppyCorrelationDiagramMin, oppzCorrelationDiagram_total, QMCFlags::oppzCorrelationDiagramMax, QMCFlags::oppzCorrelationDiagramMin, PI, pllSpinHistogram_total, pllxCorrelationDiagram_total, QMCFlags::pllxCorrelationDiagramMax, QMCFlags::pllxCorrelationDiagramMin, pllyCorrelationDiagram_total, QMCFlags::pllyCorrelationDiagramMax, QMCFlags::pllyCorrelationDiagramMin, pllzCorrelationDiagram_total, QMCFlags::pllzCorrelationDiagramMax, QMCFlags::pllzCorrelationDiagramMin, QMCnode, QMCInput::WF, QMCFlags::writeOppxCorrelationDiagram, QMCFlags::writeOppyCorrelationDiagram, QMCFlags::writeOppzCorrelationDiagram, QMCFlags::writePllxCorrelationDiagram, QMCFlags::writePllyCorrelationDiagram, and QMCFlags::writePllzCorrelationDiagram.
Referenced by run().
void QMCManager::synchronizeDMCEnsemble | ( | ) | [private] |
The global results are collected and sent to all processors, where they are used to update the estimated energy, trial energy, and effective time step.
Definition at line 327 of file QMCManager.cpp.
References QMCStopwatches::getCommunicationSynchronizationStopwatch(), QMCRun::getProperties(), localTimers, QMCProperties::MPI_REDUCE, QMCProperties::MPI_TYPE, Properties_total, QMCnode, Stopwatch::start(), Stopwatch::stop(), and QMCProperties::zeroOut().
int QMCManager::pollForACommand | ( | ) | [private] |
Checks to see if a command is waiting for this processor.
If there is a command waiting, the integer value of the command is returned, if not, -1 is returned.
Definition at line 633 of file QMCManager.cpp.
References QMCStopwatches::getCommandPollingStopwatch(), localTimers, Stopwatch::start(), and Stopwatch::stop().
Referenced by run().
void QMCManager::writeEnergyResultsSummary | ( | ostream & | strm | ) | [private] |
Writes a summary of the energy statistics to a stream.
strm | output stream to write the energy statistics summary to. |
Definition at line 1675 of file QMCManager.cpp.
References QMCProperties::acceptanceProbability, QMCProperties::distanceMovedAccepted, QMCFlags::dt_effective, QMCProperties::energy, QMCFlags::energy_trial, equilibrating, QMCFlags::equilibration_steps, QMCInput::flags, QMCProperty::getAverage(), QMCProperty::getCorrelationLength(), QMCRun::getNumberOfWalkers(), QMCProperty::getNumberSamples(), QMCProperty::getSeriallyCorrelatedVariance(), QMCProperty::getShortString(), QMCProperty::getStandardDeviation(), QMCRun::getWeights(), globalInput, iteration, Properties_total, QMCnode, and QMCFlags::run_type.
Referenced by initializeCalculationState(), run(), and writeRestart().
void QMCManager::writeEnergyResultsHeader | ( | ostream & | strm | ) | [private] |
Definition at line 1649 of file QMCManager.cpp.
References QMCInput::flags, globalInput, and QMCFlags::run_type.
Referenced by run(), and writeRestart().
void QMCManager::checkTerminationCriteria | ( | ) | [private] |
Checks to see if any of the termination criteria for the calculation have been satisfied.
Definition at line 2126 of file QMCManager.cpp.
References checkConvergenceBasedTerminationCriteria(), checkMaxStepsTerminationCriteria(), and checkMaxTimeTerminationCriteria().
Referenced by run().
void QMCManager::checkMaxStepsTerminationCriteria | ( | ) | [private] |
Checks to see if the total number of QMC steps performed by the calculation exceeds the maximum value set in the input.
Definition at line 2133 of file QMCManager.cpp.
References done, QMCInput::flags, QMCWavefunction::getNumberElectrons(), globalInput, iteration, QMCFlags::max_time_steps, QMCFlags::one_e_per_iter, and QMCInput::WF.
Referenced by checkTerminationCriteria().
void QMCManager::checkMaxTimeTerminationCriteria | ( | ) | [private] |
Checks if we have run the calculation for a long enough period of time, as specified by max_time in the input.
Definition at line 2158 of file QMCManager.cpp.
References done, QMCFlags::dt_run, QMCProperties::energy, QMCInput::flags, QMCProperty::getNumberSamples(), globalInput, QMCFlags::max_time, and Properties_total.
Referenced by checkTerminationCriteria().
void QMCManager::checkConvergenceBasedTerminationCriteria | ( | ) | [private] |
Checks to see if the energy standard deviation has converged sufficiently to terminate.
The desired convergence is specified in the input.
Definition at line 2172 of file QMCManager.cpp.
References QMCFlags::desired_convergence, done, QMCProperties::energy, QMCInput::flags, QMCProperty::getNumberSamples(), QMCProperty::getStandardDeviation(), globalInput, and Properties_total.
Referenced by checkTerminationCriteria().
void QMCManager::equilibration_step | ( | ) | [private] |
Definition at line 1223 of file QMCManager.cpp.
References QMCFlags::CKAnnealingEquilibration1_parameter, QMCFlags::dt, QMCFlags::dt_equilibration, QMCFlags::dt_run, equilibrating, QMCFlags::equilibration_function, QMCFlags::equilibration_steps, QMCInput::flags, globalInput, iteration, QMCFlags::old_walker_acceptance_parameter, QMCnode, and QMCRun::zeroOut().
Referenced by run().
void QMCManager::updateEstimatedEnergy | ( | QMCProperties * | Properties | ) | [private] |
Updates the estimated value of the energy.
Definition at line 2182 of file QMCManager.cpp.
References QMCProperties::energy, QMCFlags::energy_estimated, equilibrating, QMCInput::flags, QMCProperty::getAverage(), QMCProperty::getNumberSamples(), and globalInput.
void QMCManager::updateTrialEnergy | ( | double | totalWeight, | |
int | nwalkers_original | |||
) | [private] |
Updates the diffusion QMC (DMC) trial energy.
Definition at line 2197 of file QMCManager.cpp.
References QMCFlags::dt_effective, QMCFlags::energy_estimated, QMCFlags::energy_trial, equilibrating, QMCInput::flags, globalInput, QMCFlags::lock_trial_energy, and QMCFlags::population_control_parameter.
void QMCManager::updateEffectiveTimeStep | ( | QMCProperties * | Properties | ) | [private] |
Updates the effective time step used for diffusion QMC (DMC).
Definition at line 2234 of file QMCManager.cpp.
References QMCFlags::dt, QMCFlags::dt_effective, QMCInput::flags, fwProperties_total, QMCDerivativeProperties::getEffectiveTimeStep(), and globalInput.
void QMCManager::synchronizationBarrier | ( | ) | [private] |
Forces all processors to synchronize at this point.
Definition at line 2256 of file QMCManager.cpp.
References QMCStopwatches::getCommunicationSynchronizationStopwatch(), localTimers, Stopwatch::start(), and Stopwatch::stop().
Referenced by gatherProperties().
void QMCManager::writeXML | ( | ostream & | strm | ) | [private] |
Writes the state of this object to an XML stream.
strm | XML stream |
Definition at line 1895 of file QMCManager.cpp.
References equilibrating, QMCRun::getNumberOfWalkers(), QMCnode, QMCRun::toXML(), and Random::writeXML().
Referenced by writeCheckpoint().
bool QMCManager::readXML | ( | istream & | strm | ) | [private] |
Loads the state of this object from an XML stream.
The input stream must be formatted exactly like the output from toXML
because it is not intelligent.
strm | XML stream |
Definition at line 1947 of file QMCManager.cpp.
References equilibrating, QMCInput::flags, gatherProperties(), QMCRun::getProperties(), QMCRun::getWeights(), globalInput, iteration, QMCFlags::number_of_walkers, QMCFlags::number_of_walkers_initial, Properties_total, QMCnode, QMCRun::readXML(), Random::readXML(), QMCFlags::run_type, QMCFlags::synchronize_dmc_ensemble, synchronizeDMCEnsemble(), updateEffectiveTimeStep(), updateEstimatedEnergy(), and updateTrialEnergy().
Referenced by initializeCalculationState().
ostream& operator<< | ( | ostream & | strm, | |
QMCManager & | rhs | |||
) | [friend] |
Writes the current QMC results calculated by this object to an output stream in a human readable format.
Definition at line 2322 of file QMCManager.cpp.
bool QMCManager::SIGNAL_SAYS_QUIT = false [static, private] |
These are signal flags.
Since system signaling can only call static functions, we translate any signal information into these flags, which QMCManager can look at during some decision.
Definition at line 167 of file QMCManager.h.
Referenced by receiveSignal(), and run().
bool QMCManager::REDUCE_ALL_NOW = false [static, private] |
bool QMCManager::INCREASE_TIME = false [static, private] |
bool QMCManager::PRINT_SIG_INFO = false [static, private] |
QMCRun QMCManager::QMCnode [private] |
Walkers plus the basic functionality needed to build a QMC calculation.
Definition at line 175 of file QMCManager.h.
Referenced by equilibration_step(), finalize(), gatherDensities(), gatherExtraProperties(), gatherForces(), gatherHistograms(), gatherProperties(), initialize(), initializeCalculationState(), optimize(), readXML(), run(), synchronizeDMCEnsemble(), writeElectronDensityHistograms(), writeEnergyResultsSummary(), writeXML(), and zeroOut().
QMCStopwatches QMCManager::localTimers [private] |
Input data for the calculation.
QMCInput Input; Local code timers for this node.
Definition at line 186 of file QMCManager.h.
Referenced by finalize(), gatherDensities(), gatherExtraProperties(), gatherForces(), gatherHistograms(), gatherProperties(), initializeCalculationState(), optimize(), pollForACommand(), QMCManager(), resetTimers(), run(), sendAllProcessorsACommand(), synchronizationBarrier(), synchronizeDMCEnsemble(), and writeTimingData().
QMCStopwatches QMCManager::globalTimers [private] |
Global code timers for the calculation.
This is only valid after finalize
is called and only on the root node.
Definition at line 192 of file QMCManager.h.
Referenced by finalize(), and writeTimingData().
bool QMCManager::equilibrating [private] |
true
if the calculation is equilibrating and false
otherwise.
Definition at line 198 of file QMCManager.h.
Referenced by equilibration_step(), gatherProperties(), initializeCalculationState(), readXML(), run(), updateEstimatedEnergy(), updateTrialEnergy(), writeEnergyResultsSummary(), and writeXML().
bool QMCManager::done [private] |
true
if the current QMC calculation is done and flase
otherwise.
This only applies to the QMC calculation and not the optimization.
Definition at line 205 of file QMCManager.h.
Referenced by checkConvergenceBasedTerminationCriteria(), checkMaxStepsTerminationCriteria(), checkMaxTimeTerminationCriteria(), initialize(), and run().
unsigned long QMCManager::iteration [private] |
Iteration in the QMC calculation this processor is on.
The equilibration time is included in the iteration number.
Definition at line 211 of file QMCManager.h.
Referenced by checkMaxStepsTerminationCriteria(), equilibration_step(), initialize(), optimize(), readXML(), run(), writeEnergyResultsSummary(), and writeTimingData().
QMCProperties QMCManager::Properties_total [private] |
Storage location for global statistical properties on the root node and scratch space on other nodes.
Definition at line 217 of file QMCManager.h.
Referenced by checkConvergenceBasedTerminationCriteria(), checkMaxTimeTerminationCriteria(), gatherProperties(), operator<<(), optimize(), readXML(), run(), synchronizeDMCEnsemble(), writeEnergyResultsSummary(), writeTimingData(), and zeroOut().
Same purpose as Properties_total, except that this one holds the properties collected as future walking properties.
It turned out to be too annoying to include dynamic arrays in QMCProperties. This permits the amount of data in QMCProperties to be known at compile time while permitting fwProperties_total to depend on information from the input file. This difference is important for how MPI reduces the properties.
Definition at line 228 of file QMCManager.h.
Referenced by gatherDensities(), gatherExtraProperties(), gatherForces(), initialize(), operator<<(), optimize(), updateEffectiveTimeStep(), writeBFDensity(), writeForces(), and zeroOut().
Local statistical properties calculated during the equilibration phase of the calculation.
Definition at line 234 of file QMCManager.h.
ofstream* QMCManager::qmcRslts [private] |
An output stream for writing the results of the calculation to.
Definition at line 239 of file QMCManager.h.
Referenced by finalizeOutputs(), getResultsOutputStream(), initializeOutputs(), and optimize().
ofstream* QMCManager::qmcOut [private] |
An output stream for writing the progress of the calculation to.
Definition at line 244 of file QMCManager.h.
Referenced by finalizeOutputs(), initializeOutputs(), and run().
Array1D<double> QMCManager::pllSpinHistogram_total [private] |
Storage location for the global parallel spin histogram on the root node and scratch space on other nodes.
Definition at line 250 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D<double> QMCManager::oppSpinHistogram_total [private] |
Storage location for the global opposite spin histogram on the root node and scratch space on other nodes.
Definition at line 256 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D< Array1D<double> > QMCManager::alphaHistograms_total [private] |
Storage location for the global alpha one electron histograms on the root node and scratch space on other nodes.
Definition at line 262 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D< Array1D<double> > QMCManager::betaHistograms_total [private] |
Storage location for the global beta one electron histograms on the root node and scratch space on other nodes.
Definition at line 268 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D< Array1D<double> > QMCManager::pllxCorrelationDiagram_total [private] |
Storage location for the global parallel pair x coordinate correlation diagram on the root node and scratch space on the other nodes.
Definition at line 274 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D< Array1D<double> > QMCManager::pllyCorrelationDiagram_total [private] |
Storage location for the global parallel pair y coordinate correlation diagram on the root node and scratch space on the other nodes.
Definition at line 280 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D< Array1D<double> > QMCManager::pllzCorrelationDiagram_total [private] |
Storage location for the global parallel pair z coordinate correlation diagram on the root node and scratch space on the other nodes.
Definition at line 286 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D< Array1D<double> > QMCManager::oppxCorrelationDiagram_total [private] |
Storage location for the global opposite pair x coordinate correlation diagram on the root node and scratch space on the other nodes.
Definition at line 292 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D< Array1D<double> > QMCManager::oppyCorrelationDiagram_total [private] |
Storage location for the global opposite pair y coordinate correlation diagram on the root node and scratch space on the other nodes.
Definition at line 298 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().
Array1D< Array1D<double> > QMCManager::oppzCorrelationDiagram_total [private] |
Storage location for the global opposite pair z coordinate correlation diagram on the root node and scratch space on the other nodes.
Definition at line 304 of file QMCManager.h.
Referenced by gatherHistograms(), and writeElectronDensityHistograms().