Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cps::Error Class Reference

A class to handle the printing of error messages. More...

#include <error.h>

List of all members.

Public Member Functions

 Error ()
virtual ~Error ()
void Pointer (const char *, const char *, const char *)
 Error message for an uninitialized pointer.
void FileR (const char *, const char *, const char *)
 Error message for failure to open a file to read.
void FileW (const char *, const char *, const char *)
 Error message for failure to open a file to write.
void FileA (const char *, const char *, const char *)
 Error message for failure to open a file to append.
void NotImplemented (const char *, const char *)
 Error message when something is not implemented.
void NotImplemented (const char *, const char *, const char *,...)
 Error message when something is not implemented.
void Hardware (const char *, const char *, const char *,...)
 Error message for hardware failure.
void General (const char *, const char *, const char *,...)
 Error message for miscellaneous failure.
void HdwCheck (const char *, const char *)


Detailed Description

A class to handle the printing of error messages.

Upon encountering an error from which the code cannot recover, one of these methods can be called to print a diagnostic message and exit with a predefined value.

Todo:
Is it worth making things const correct in a fatal class?

Definition at line 40 of file error.h.


Constructor & Destructor Documentation

cps::Error::Error  ) 
 

Definition at line 54 of file error.C.

cps::Error::~Error  )  [virtual]
 

Definition at line 94 of file error.C.


Member Function Documentation

void cps::Error::FileA const char *  class_name,
const char *  func_name,
const char *  file_name
 

Error message for failure to open a file to append.

Prints the message
Error in class name::function name :
can not open file file name to append.
to stdout and to the file phys.error. Exits with -4.

Parameters:
class_name The name of a class.
func_name The name of a function or method.
file_name The name of the file.

Definition at line 207 of file error.C.

References cps::ALL_NODES, cps::Fclose(), cps::Fopen(), cps::Fprintf(), and cps::MPISCU::printf().

Referenced by cps::QPropW::DoLinkSmear(), cps::WspectQuark::dumpData(), cps::WspectMesons::dumpData(), cps::WspectAxialCurrent::dumpData(), cps::WspectQuark::dumpSource(), cps::QuarkPropS::getQuarkPropS(), cps::WspectMesons::print(), cps::FermionVector::print(), cps::WspectExtendedMesons::print(), cps::WspectExtendedMesonsBE::print(), cps::WspectBaryon::print(), cps::WspectAxialCurrent::print(), cps::ForceArg::print(), cps::WspectMesons::print_mp(), cps::FermionVector::printWaveFunc(), cps::QPropW::QPropW(), cps::QPropWGFLfuncSrc::QPropWGFLfuncSrc(), cps::QPropW::RestoreOrgProp(), cps::QPropW::RestoreQPropLs(), cps::QPropW::RestoreQPropLs_ftom(), cps::AlgWline::run(), cps::AlgTcharge::run(), cps::AlgApeSmear2::run(), cps::AlgOlegSmear::run(), cps::AlgHypSmear::run(), cps::AlgKineticSmear::run(), cps::AlgApeSmear::run(), cps::AlgNLStagMeson::run(), cps::AlgStagNonLocal::run(), cps::AlgStagNucleon::run(), cps::AlgStagMomMeson::run(), cps::AlgStagMeson::run(), cps::AlgRect::run(), cps::QPropW::Run(), cps::AlgPlaq::run(), cps::AlgPbp::run(), cps::AlgHmc::run(), cps::AlgHmdR2::run(), cps::AlgHmdR::run(), cps::AlgHmcRHMC::run(), cps::AlgHmcQPQ::run(), cps::AlgHmcPhi::run(), cps::AlgEqState::run(), cps::AlgDens::run(), cps::AlgPbp::runPointSource(), cps::QPropW::SaveQPropLs(), cps::QioControl::startLogging(), cps::Verbose::Warn(), and cps::WspectQuark::WspectQuark().

void cps::Error::FileR const char *  class_name,
const char *  func_name,
const char *  file_name
 

Error message for failure to open a file to read.

Prints the message
Error in class name::function name :
can not open file file name to read.
to stdout and to the file phys.error. Exits with -2.

Parameters:
class_name The name of a class.
func_name The name of a function or method.
file_name The name of the file.

Definition at line 143 of file error.C.

References cps::ALL_NODES, cps::Fclose(), cps::Fopen(), cps::Fprintf(), and cps::MPISCU::printf().

Referenced by cps::SerialIO::load(), cps::ParallelIO::load(), cps::LatRngRead::read(), and cps::ReadLatticeParallel::read().

void cps::Error::FileW const char *  class_name,
const char *  func_name,
const char *  file_name
 

Error message for failure to open a file to write.

Prints the message
Error in class name::function name :
can not open file file name to write.
to stdout and to the file phys.error. Exits with -3.

Parameters:
class_name The name of a class.
func_name The name of a function or method.
file_name The name of the file.

Definition at line 175 of file error.C.

References cps::ALL_NODES, cps::Fclose(), cps::Fopen(), cps::Fprintf(), and cps::MPISCU::printf().

Referenced by cps::SerialIO::store(), and cps::ParallelIO::store().

void cps::Error::General const char *  class_name,
const char *  func_name,
const char *  format,
  ...
 

Error message for miscellaneous failure.

Prints the message
Error in class name::function name :
message
to stdout and to the file phys.error. Exits with -7.

Parameters:
class_name The name of a class.
func_name The name of a function or method.
format A format string for the message (á la printf)
... Optional arguments to the format string.

Definition at line 351 of file error.C.

References cps::ALL_NODES, cps::Fclose(), cps::Fopen(), cps::Fprintf(), cps::MPISCU::printf(), cps::Vfprintf(), and cps::MPISCU::vprintf().

Referenced by cps::AlgActionBilinear::AlgActionBilinear(), cps::AlgActionBoson::AlgActionBoson(), cps::AlgActionFermion::AlgActionFermion(), cps::AlgActionQuotient::AlgActionQuotient(), cps::AlgActionRational::AlgActionRational(), cps::AlgActionRationalQuotient::AlgActionRationalQuotient(), cps::AlgActionRationalSplit::AlgActionRationalSplit(), cps::AlgEig::AlgEig(), cps::AlgHmcPhi::AlgHmcPhi(), cps::AlgHmcQPQ::AlgHmcQPQ(), cps::AlgHmcRHMC::AlgHmcRHMC(), cps::AlgHmdR::AlgHmdR(), cps::AlgHmdR2::AlgHmdR2(), cps::AlgNuc3pt::AlgNuc3pt(), cps::AlgRemez::AlgRemez(), cps::AlgStagMeson::AlgStagMeson(), cps::AlgStagMomMeson::AlgStagMomMeson(), cps::AlgStagNonLocal::AlgStagNonLocal(), cps::AlgStagNucleon::AlgStagNucleon(), cps::AlgStagQuark::AlgStagQuark(), cps::AlgWspect::AlgWspect(), cps::Aots::Aots(), cps::CommandLine::arg(), cps::CommandLine::arg_as_Float(), cps::CommandLine::arg_as_hex(), cps::CommandLine::arg_as_int(), cps::GlobalJobParameter::argc(), cps::GlobalJobParameter::argv(), cps::asqtad_dirac_init_g(), cps::DiracOpWilsonTypes::BiCGstab(), cps::Nuc3pt::Calc3pt(), cps::Meson::calcMeson(), cps::Meson::calcMidPointPion(), cps::Nuc2pt::calcMomNucleon(), cps::Nuc2pt::calcNucleon(), cps::Nuc2pt::calcWallMomNucleon(), cps::LatData::Check(), cps::Nuc3ptArg::check_args(), cps::AlgActionRational::checkApprox(), cps::QPropWFactory::Create(), cps::LatticeFactory::Create(), cps::AlgIntAB::Create(), cps::DiracOp::DiracOp(), cps::QPropW::DoLinkSmear(), cps::WspectQuark::doSinkOperator(), cps::dump_xml::dump_xml(), cps::dwf_dslash_5_plus_slice(), cps::AlgHmcRHMC::dynamicalApprox(), cps::Fwilson::EvolveMomFforce(), cps::Fstag::EvolveMomFforce(), cps::Fp4::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), cps::Fasqtad::EvolveMomFforce(), cps::FdwfBase::Fconvert(), cps::FstagTypes::Fconvert(), cps::FwilsonTypes::Fconvert(), cps::Fstag::FdMdmu(), cps::FdwfBase::FdwfBase(), cps::FermionVector::FermionVector(), cps::Fsmear::Fields(), cps::Lattice::FixGauge(), cps::Lattice::FixGaugeAllocate(), cps::Lattice::FixGaugeFree(), cps::QPropW::FixSol(), cps::Fwilson::Fwilson(), cps::WilsonVector::gamma(), cps::FwilsonTypes::Gamma5(), cps::FermionVector::gaugeFixSink(), cps::FermionVectorTp::GaugeFixSink(), cps::FermionVectorTp::GaussianSmearVector(), cps::getData(), cps::WspectFuzzing::GetLink(), cps::FermionVectorTp::GFWallSource(), cps::Lattice::GsoCheck(), cps::LatData::Init(), cps::LatRanGen::Initialize(), cps::GlobalJobParameter::Initialize(), cps::Nuc3ptStru::InsertOp(), cps::DiracOp::InvCg(), cps::WspectExtendedMesons::isInOpGroup(), cps::WspectExtendedMesonsBE::isInOpGroup(), cps::DiracOp::Jacobi(), cps::FermionVectorTp::LandauGaugeFixSink(), cps::LatData::LatData(), cps::LatMatrix::LatMatrix(), cps::Lattice::Lattice(), cps::GaussianRandomGenerator::load(), cps::mat_inv(), cps::DiracOpWilson::MatInv(), cps::DiracOpDwf::MatInv(), cps::DiracOpClover::MatInv(), cps::DiracOp::MInvCG(), cps::DiracOpWilsonTypes::MultGamma(), cps::AlgGheatBath::NoCheckerBoardRun(), cps::Nuc2pt::Nuc2pt(), cps::NumChkb(), cps::CorrFunc::operator *=(), cps::DTerms::operator()(), cps::Nuc3pt::operator+=(), cps::CorrFunc::operator+=(), cps::Nuc3pt::operator-=(), cps::CorrFunc::operator-=(), cps::LatMatrix::operator=(), cps::LatData::operator=(), cps::ParTrans::ParTrans(), cps::CheckSum::Print(), cps::Diquark::Project(), cps::Nuc2pt::prop_nucleon(), cps::qcdio_norm_row(), cps::qio_init::qio_init(), cps::qload_parameters(), cps::qloadsave_gauge(), cps::GaussianRandomGenerator::Rand(), cps::QPropW::rand_src(), cps::LatRngRead::read(), cps::ReadLatticeParallel::read(), cps::ActionRationalQuotientArg::resize(), cps::ActionRationalArg::resize(), cps::QPropW::RestoreOrgProp(), cps::QPropW::RestoreQPropLs(), cps::QPropW::RestoreQPropLs_ftom(), cps::Lattice::ReTrRect(), cps::Fclover::RHMC_EvolveMomFforce(), cps::DiracOpWilsonTypes::RitzEigMat(), cps::DiracOpWilsonTypes::RitzLatSize(), cps::DiracOpWilsonTypes::RitzMat(), cps::DiracOpStag::RitzMat(), cps::DiracOpP4::RitzMat(), cps::DiracOpAsqtad::RitzMat(), cps::Mom::run(), cps::WspectFuzzing::run(), cps::AlgHypSmear::run(), cps::AlgRotateGauge::run(), cps::AlgPbp::run(), cps::AlgNuc3pt::run(), cps::AlgInst::run(), cps::AlgHmcRHMC::run(), cps::AlgGheatBath::run(), cps::AlgFixGauge::run(), cps::AlgEqState::run(), cps::AlgEig::run(), cps::AlgDens::run(), cps::RunGConverter(), cps::AlgPbp::runPointSource(), cps::CheckSum::SaveCsum(), cps::QPropW::SaveQPropLs(), cps::LatticeContainer::Set(), cps::FermionVectorTp::SetBoxSource(), cps::FermionVectorTp::SetGFPointSource(), cps::FermionVectorTp::SetLandauGaugeMomentaSource(), cps::FermionVectorTp::SetMomSource(), cps::GlobalDataShift::SetOrigin(), cps::FermionVectorTp::SetPointSource(), cps::QPropWSeqProtUSrc::SetSource(), cps::QPropWSeqProtDSrc::SetSource(), cps::QPropWSeqMesSrc::SetSource(), cps::QPropWRandSlabSrc::SetSource(), cps::QPropWRandVolSrc::SetSource(), cps::QPropWRandWallSrc::SetSource(), cps::FermionVectorTp::SetVolSource(), cps::FermionVectorTp::SetWallSource(), cps::QuarkPropS::setWallSrc(), cps::sfree(), cps::GlobalDataShift::Shift(), cps::WilsonMatrix::sigmaR(), cps::Vector::SliceArraySum(), cps::Vector::SliceArraySumFive(), cps::smalloc(), cps::Fp4::Smear(), cps::Fasqtad::Smear(), cps::Lattice::SoCheck(), cps::GaussianRandomGenerator::store(), cps::su3_proj(), cps::QPropW::SwapQPropLs(), cps::WspectMesons::traceDirac(), cps::WspectExtendedMesons::traceDirac(), cps::QPropW::UndoLinkSmear(), cps::wilson_dslash(), cps::LatRngWrite::write(), cps::WriteLatticeParallel::write(), cps::WspectFuzzing::WspectFuzzing(), cps::WspectHyperRectangle::WspectHyperRectangle(), and cps::WspectQuark::WspectQuark().

void cps::Error::Hardware const char *  class_name,
const char *  func_name,
const char *  format,
  ...
 

Error message for hardware failure.

Prints the message
Hardware error in class name::function name :
message
to stdout and to the file phys.error. Exits with -6.

Parameters:
class_name The name of a class.
func_name The name of a function or method.
format A format string for the message (á la printf)
... Optional arguments to the format string.

Definition at line 312 of file error.C.

References cps::ALL_NODES, cps::Fclose(), cps::Fopen(), cps::Fprintf(), cps::MPISCU::printf(), cps::Vfprintf(), and cps::MPISCU::vprintf().

Referenced by cps::QioControl::finishLogging(), cps::QioControl::log(), cps::AlgHmc::run(), cps::AlgHmdR::run(), and cps::AlgHmcPhi::run().

void cps::Error::HdwCheck const char *  ,
const char * 
 

Definition at line 5 of file error_hdwcheck.C.

void cps::Error::NotImplemented const char *  class_name,
const char *  func_name,
const char *  format,
  ...
 

Error message when something is not implemented.

Prints the message
Error in class name::function name :
not implemented.
message
to stdout and to the file phys.error. Exits with -5.

Parameters:
class_name The name of a class.
func_name The name of a function or method.
format A format string for the message (á la printf)
... Optional arguments to the format string.

Todo:
Why not use vprintf rather than vsprintf followed by printf?

Definition at line 273 of file error.C.

References cps::ALL_NODES, cps::Fclose(), cps::Fopen(), cps::Fprintf(), cps::MPISCU::printf(), cps::Vfprintf(), and cps::MPISCU::vprintf().

void cps::Error::NotImplemented const char *  class_name,
const char *  func_name
 

Error message when something is not implemented.

Prints the message
Error in class name::function name :
not implemented.
to stdout and to the file phys.error. Exits with -5.

Parameters:
class_name The name of a class.
func_name The name of a function or method.

Definition at line 238 of file error.C.

References cps::ALL_NODES, cps::Fclose(), cps::Fopen(), cps::Fprintf(), and cps::MPISCU::printf().

Referenced by cps::GpowerRect::AllStaple(), cps::GpowerPlaq::AllStaple(), cps::Gnone::AllStaple(), cps::QPropW::BoxSrcEnd(), cps::QPropW::BoxSrcStart(), cps::QPropW::CG(), cps::DiracOpP4::dMdmu(), cps::QPropW::DoLinkSmear(), cps::DiracOpClover::Dslash(), cps::Lattice::FdMdmu(), cps::Lattice::Fdslash(), cps::Lattice::Ffive2four(), cps::Lattice::Ffour2five(), cps::FPConv::file2host(), cps::Lattice::FixGauge(), cps::Lattice::FixGaugeAllocate(), cps::Fclover::FmatEvlMInv(), cps::Fnone::FsiteOffset(), cps::FdwfBase::FsiteOffset(), cps::Fnone::FsiteOffsetChkb(), cps::FdwfBase::FsiteOffsetChkb(), cps::GpowerPlaq::GactionGradient(), cps::Gnone::GactionGradient(), cps::Lattice::Gamma5(), cps::QPropW::Gauss_N(), cps::QPropW::Gauss_W(), cps::QPropW::GaussArg(), cps::GimprOLSym::GimprOLSym(), cps::FPConv::host2file(), cps::FPConv::ieee2ti(), cps::Lattice::Lattice(), cps::DiracOpClover::Mat(), cps::DiracOpClover::MatDag(), cps::DiracOpClover::MatPcDagOrNot(), cps::QPropWLandauGaugeVolumeSrc::QPropWLandauGaugeVolumeSrc(), cps::QPropWMultGaussSrc::QPropWMultGaussSrc(), cps::DiracOpStag::RitzEigMat(), cps::DiracOpP4::RitzEigMat(), cps::DiracOpAsqtad::RitzEigMat(), cps::FermionVectorTp::SetExpSource(), cps::FermionVectorTp::SetGFLfuncSource(), and cps::IntConv::testHostFormat().

void cps::Error::Pointer const char *  class_name,
const char *  func_name,
const char *  ptr_name
 

Error message for an uninitialized pointer.

Prints the message
Error in class name::function name :
pointer pointer name is not initialized.
to stdout and to the file phys.error. Exits with -1.

Parameters:
class_name The name of a class whose method is being entered.
func_name The name of a function or method.
ptr_name The variable name of the pointer.

Definition at line 110 of file error.C.

References cps::ALL_NODES, cps::Fclose(), cps::Fopen(), cps::Fprintf(), and cps::MPISCU::printf().

Referenced by cps::Alg::Alg(), cps::AlgDens::AlgDens(), cps::AlgEig::AlgEig(), cps::AlgEqState::AlgEqState(), cps::AlgFixGauge::AlgFixGauge(), cps::AlgGheatBath::AlgGheatBath(), cps::AlgHmcPhi::AlgHmcPhi(), cps::AlgHmcQPQ::AlgHmcQPQ(), cps::AlgHmd::AlgHmd(), cps::AlgHmdR::AlgHmdR(), cps::AlgHQPotential::AlgHQPotential(), cps::AlgInst::AlgInst(), cps::AlgMom::AlgMom(), cps::AlgNLStagMeson::AlgNLStagMeson(), cps::AlgNoise::AlgNoise(), cps::AlgNuc3pt::AlgNuc3pt(), cps::AlgOlegSmear::AlgOlegSmear(), cps::AlgOverRelax::AlgOverRelax(), cps::AlgPbp::AlgPbp(), cps::AlgPlaq::AlgPlaq(), cps::AlgPot::AlgPot(), cps::AlgPot2::AlgPot2(), cps::AlgRect::AlgRect(), cps::AlgSmear::AlgSmear(), cps::AlgSmear2::AlgSmear2(), cps::AlgStagMeson::AlgStagMeson(), cps::AlgStagMomMeson::AlgStagMomMeson(), cps::AlgStagNonLocal::AlgStagNonLocal(), cps::AlgStagNucleon::AlgStagNucleon(), cps::AlgStagQuark::AlgStagQuark(), cps::AlgWline::AlgWline(), cps::AlgWspect::AlgWspect(), cps::QPropW::Allocate(), cps::QPropWRand::AllocateRsrc(), cps::Fwilson::BhamiltonNode(), cps::FdwfBase::BhamiltonNode(), cps::Fclover::BhamiltonNode(), cps::Nuc3pt::Calc3pt(), cps::DiracOpWilson::CalcHmdForceVecs(), cps::DiracOpDwf::CalcHmdForceVecs(), cps::DiracOpClover::CalcHmdForceVecs(), cps::QPropW::CG(), cps::clover_init(), cps::WspectExtendedMesons::collect(), cps::Lattice::Convert(), cps::CorrFunc::CorrFunc(), cps::DiracOpP4::DiracOpP4(), cps::DiracOpStag::DiracOpStag(), cps::QPropW::DoLinkSmear(), cps::WspectQuark::doSinkOperator(), cps::dwf_init(), cps::WspectMesons::Everything(), cps::Fwilson::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), cps::Fclover::Fclover(), cps::Fwilson::FeigSolv(), cps::Fclover::FeigSolv(), cps::FermionVector::FermionVector(), cps::FermionVectorTp::FermionVectorTp(), cps::FwilsonTypes::FhamiltonNode(), cps::FdwfBase::FhamiltonNode(), cps::Lattice::FixGauge(), cps::Lattice::FixGaugeAllocate(), cps::FixHPlane::FixHPlane(), cps::FdwfBase::Freflex(), cps::FermionVectorTp::GaussianSmearVector(), cps::get1Data(), cps::glb_sum_internal2(), cps::HadronPropS::HadronPropS(), cps::HyperPlane::HyperPlane(), cps::Gsum64Ext::Init(), cps::Mom::Init(), cps::LatRanGen::Initialize(), cps::Nuc3ptStru::InsertOp(), cps::DiracOp::InvCg(), cps::DiracOp::Jacobi(), cps::Lattice::Lattice(), cps::LinkBuffer::LinkBuffer(), cps::DiracOpWilsonTypes::MatDagMat(), cps::DiracOpWilson::MatHerm(), cps::DiracOpDwf::MatHerm(), cps::DiracOpClover::MatHerm(), cps::DiracOpWilson::MatInv(), cps::DiracOpStag::MatInv(), cps::DiracOpP4::MatInv(), cps::DiracOpDwf::MatInv(), cps::QPropW::MeasConAxialOld(), cps::QPropW::MeasJ5qPion(), cps::NLocalPropS::NLocalPropS(), cps::NLSMesonPropS::NLSMesonPropS(), cps::Vector::NormSqArraySliceSum(), cps::CorrFunc::operator=(), cps::p4_dirac_init_g(), cps::QuarkPropSMng::qadd(), cps::QPropW::QPropW(), cps::QPropWGFLfuncSrc::QPropWGFLfuncSrc(), cps::QuarkPropSMng::QuarkPropSMng(), cps::QPropW::ReLoad(), cps::QPropW::RestoreQProp(), cps::QPropW::RestoreQPropLs_ftom(), cps::DiracOpWilsonTypes::RitzEig(), cps::DiracOpStagTypes::RitzEig(), cps::WspectFuzzing::run(), cps::AlgNLStagMeson::run(), cps::AlgStagNonLocal::run(), cps::AlgStagNucleon::run(), cps::AlgStagMomMeson::run(), cps::AlgStagMeson::run(), cps::QPropW::Run(), cps::AlgPbp::run(), cps::AlgFixGauge::run(), cps::AlgEig::run(), cps::AlgPbp::runPointSource(), cps::CommonArg::set_filename(), cps::CommonArg::set_label(), cps::Fwilson::SetPhi(), cps::FdwfBase::SetPhi(), cps::Fclover::SetPhi(), cps::QuarkPropS::setupQuarkPropS(), cps::QPropWRand::ShiftPropBackward(), cps::QPropW::ShiftPropBackward(), cps::QPropWRand::ShiftPropForward(), cps::QPropW::ShiftPropForward(), cps::smalloc(), cps::QPropW::UndoLinkSmear(), cps::wilson_compat_init(), cps::WspectAxialCurrent::WspectAxialCurrent(), cps::WspectExtendedMesons::WspectExtendedMesons(), cps::WspectExtendedMesonsBE::WspectExtendedMesonsBE(), cps::WspectField::WspectField(), cps::WspectFuzzing::WspectFuzzing(), cps::WspectMomenta::WspectMomenta(), cps::WspectQuark::WspectQuark(), and cps::NLSMesonPropS::~NLSMesonPropS().


The documentation for this class was generated from the following files:
Generated on Mon Jan 19 10:31:24 2009 for Columbia Physics System by  doxygen 1.3.9.1