QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions | Variables
util_quda.cpp File Reference
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <stack>
#include <sstream>
#include <sys/time.h>
#include <enum_quda.h>
#include <util_quda.h>
#include <malloc_quda.h>
Include dependency graph for util_quda.cpp:

Go to the source code of this file.

Functions

QudaVerbosity getVerbosity ()
 
char * getOutputPrefix ()
 
FILE * getOutputFile ()
 
void setVerbosity (QudaVerbosity verbosity)
 
bool getRankVerbosity ()
 This function returns true if the calling rank is enabled for verbosity (e.g., whether printQuda and warningQuda will print out from this rank). More...
 
QudaTune getTuning ()
 Query whether autotuning is enabled or not. Default is enabled but can be overridden by setting QUDA_ENABLE_TUNING=0. More...
 
void setOutputPrefix (const char *prefix)
 
void setOutputFile (FILE *outfile)
 
void pushVerbosity (QudaVerbosity verbosity)
 Push a new verbosity onto the stack. More...
 
void popVerbosity ()
 Pop the verbosity restoring the prior one on the stack. More...
 
void pushOutputPrefix (const char *prefix)
 Push a new output prefix onto the stack. More...
 
void popOutputPrefix ()
 Pop the output prefix restoring the prior one on the stack. More...
 
char * getPrintBuffer ()
 
char * getOmpThreadStr ()
 Returns a string of the form ",omp_threads=$OMP_NUM_THREADS", which can be used for storing the number of OMP threads for CPU functions recorded in the tune cache. More...
 

Variables

static const size_t MAX_PREFIX_SIZE = 100
 
static QudaVerbosity verbosity_ = QUDA_SUMMARIZE
 
static char prefix_ [MAX_PREFIX_SIZE] = ""
 
static FILE * outfile_ = stdout
 
static const int MAX_BUFFER_SIZE = 1000
 
static char buffer_ [MAX_BUFFER_SIZE] = ""
 
static std::stack< QudaVerbosityvstack
 
static std::stack< char * > pstack
 

Function Documentation

◆ getOmpThreadStr()

char* getOmpThreadStr ( )

Returns a string of the form ",omp_threads=$OMP_NUM_THREADS", which can be used for storing the number of OMP threads for CPU functions recorded in the tune cache.

Returns
Returns the string

Definition at line 134 of file util_quda.cpp.

References quda::cublas::init().

Referenced by quda::CalculateY< from_coarse, Float, fineSpin, fineColor, coarseSpin, coarseColor, Arg >::CalculateY().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOutputFile()

FILE* getOutputFile ( )

Definition at line 23 of file util_quda.cpp.

References outfile_.

◆ getOutputPrefix()

char* getOutputPrefix ( )

Definition at line 22 of file util_quda.cpp.

References prefix_.

Referenced by pushOutputPrefix().

Here is the caller graph for this function:

◆ getPrintBuffer()

char* getPrintBuffer ( )

Definition at line 132 of file util_quda.cpp.

References buffer_.

◆ getRankVerbosity()

bool getRankVerbosity ( )

This function returns true if the calling rank is enabled for verbosity (e.g., whether printQuda and warningQuda will print out from this rank).

Returns
Return whether this rank will print

Definition at line 30 of file util_quda.cpp.

References comm_rank(), and quda::cublas::init().

Here is the call graph for this function:

◆ getTuning()

QudaTune getTuning ( )

Query whether autotuning is enabled or not. Default is enabled but can be overridden by setting QUDA_ENABLE_TUNING=0.

Returns
If autotuning is enabled

Definition at line 52 of file util_quda.cpp.

References quda::cublas::init(), QUDA_TUNE_NO, QUDA_TUNE_YES, and tune.

Referenced by quda::GaugePlaq< Float, Gauge >::apply(), quda::DomainWall5D< Float, nDim, nColor, Arg >::apply(), quda::Staggered< Float, nDim, nColor, Arg >::apply(), quda::TwistedMass< Float, nDim, nColor, Arg >::apply(), quda::TwistedClover< Float, nDim, nColor, Arg >::apply(), quda::WilsonClover< Float, nDim, nColor, Arg >::apply(), quda::NdegTwistedMass< Float, nDim, nColor, Arg >::apply(), quda::WilsonCloverPreconditioned< Float, nDim, nColor, Arg >::apply(), quda::DomainWall4D< Float, nDim, nColor, Arg >::apply(), quda::TwistedCloverPreconditioned< Float, nDim, nColor, Arg >::apply(), quda::TwistedMassPreconditioned< Float, nDim, nColor, Arg >::apply(), quda::Wilson< Float, nDim, nColor, Arg >::apply(), quda::Laplace< Float, nDim, nColor, Arg >::apply(), quda::NdegTwistedMassPreconditioned< Float, nDim, nColor, Arg >::apply(), quda::CopySpinor< FloatOut, FloatIn, Ns, Nc, OutOrder, InOrder >::apply(), quda::QudaMemCopy::apply(), quda::blas::copy_ns::CopyCuda< FloatN, N, Output, Input >::apply(), quda::CopyGauge< FloatOut, FloatIn, length, Arg >::apply(), quda::GenericPackGhostLauncher< Float, block_float, Ns, Ms, Nc, Mc, Arg >::apply(), quda::blas::BlasCuda< FloatN, M, SpinorX, SpinorY, SpinorZ, SpinorW, SpinorV, Functor >::apply(), quda::SpinorNoise< real, Ns, Nc, type, Arg >::apply(), quda::blas::MultiBlas< NXZ, FloatN, M, SpinorX, SpinorY, SpinorZ, SpinorW, Functor, T >::apply(), quda::GaugeGauss< Float, Arg >::apply(), quda::CopyGaugeEx< FloatOut, FloatIn, length, OutOrder, InOrder >::apply(), quda::Dslash5< Float, nColor, Arg >::apply(), quda::ShiftColorSpinorField< Output, Input >::apply(), quda::WuppertalSmearing< Float, Ns, Nc, Arg >::apply(), quda::GaugeOvrImpSTOUT< Float, Arg >::apply(), quda::CopyColorSpinor< Ns, Arg >::apply(), quda::blas::MultiReduceCuda< NXZ, doubleN, ReduceType, FloatN, M, SpinorX, SpinorY, SpinorZ, SpinorW, Reducer >::apply(), quda::CalculateY< from_coarse, Float, fineSpin, fineColor, coarseSpin, coarseColor, Arg >::apply(), quda::Pack< Float, nColor, spin_project >::apply(), quda::ExtractGhost< nDim, Arg >::apply(), quda::ExtractGhostEx< Float, length, nDim, dim, Order >::apply(), quda::CopyColorSpinor< 4, Arg >::apply(), quda::blas::ReduceCuda< doubleN, ReduceType, FloatN, M, SpinorX, SpinorY, SpinorZ, SpinorW, SpinorV, Reducer >::apply(), quda::CopySpinorEx< FloatOut, FloatIn, Ns, Nc, OutOrder, InOrder, Basis, extend >::apply(), quda::Gamma< ValueType, basis, dir >::apply(), quda::TwistGamma< Float, nColor, Arg >::apply(), quda::ProjectSU3< Float, G >::apply(), quda::Clover< Float, nSpin, nColor, Arg >::apply(), quda::DslashCoarsePolicyTune::apply(), quda::TwistClover< Float, nSpin, nColor, Arg >::apply(), quda::blas::TileSizeTune< ReducerDiagonal, writeDiagonal, ReducerOffDiagonal, writeOffDiagonal >::apply(), quda::dslash::DslashPolicyTune< Dslash >::apply(), quda::computeMomAction(), quda::DslashCoarsePolicyTune::DslashCoarsePolicyTune(), quda::dslash::DslashPolicyTune< Dslash >::DslashPolicyTune(), quda::forceRecord(), gauge_force_test(), quda::isUnitary(), quda::loadTuneCache(), quda::blas::TileSizeTune< ReducerDiagonal, writeDiagonal, ReducerOffDiagonal, writeOffDiagonal >::TileSizeTune(), and quda::updateMomentum().

Here is the call graph for this function:

◆ getVerbosity()

QudaVerbosity getVerbosity ( )

Definition at line 21 of file util_quda.cpp.

References verbosity_.

Referenced by quda::RNG::AllocateRNG(), quda::GaugePlaq< Float, Gauge >::apply(), quda::TwistedMass< Float, nDim, nColor, Arg >::apply(), quda::DomainWall5D< Float, nDim, nColor, Arg >::apply(), quda::Staggered< Float, nDim, nColor, Arg >::apply(), quda::TwistedClover< Float, nDim, nColor, Arg >::apply(), quda::WilsonClover< Float, nDim, nColor, Arg >::apply(), quda::NdegTwistedMass< Float, nDim, nColor, Arg >::apply(), quda::TwistedCloverPreconditioned< Float, nDim, nColor, Arg >::apply(), quda::WilsonCloverPreconditioned< Float, nDim, nColor, Arg >::apply(), quda::DomainWall4D< Float, nDim, nColor, Arg >::apply(), quda::TwistedMassPreconditioned< Float, nDim, nColor, Arg >::apply(), quda::Wilson< Float, nDim, nColor, Arg >::apply(), quda::Laplace< Float, nDim, nColor, Arg >::apply(), quda::NdegTwistedMassPreconditioned< Float, nDim, nColor, Arg >::apply(), quda::CopySpinor< FloatOut, FloatIn, Ns, Nc, OutOrder, InOrder >::apply(), quda::QudaMemCopy::apply(), quda::blas::copy_ns::CopyCuda< FloatN, N, Output, Input >::apply(), quda::CopyGauge< FloatOut, FloatIn, length, Arg >::apply(), quda::GenericPackGhostLauncher< Float, block_float, Ns, Ms, Nc, Mc, Arg >::apply(), quda::blas::BlasCuda< FloatN, M, SpinorX, SpinorY, SpinorZ, SpinorW, SpinorV, Functor >::apply(), quda::SpinorNoise< real, Ns, Nc, type, Arg >::apply(), quda::blas::MultiBlas< NXZ, FloatN, M, SpinorX, SpinorY, SpinorZ, SpinorW, Functor, T >::apply(), quda::GaugeGauss< Float, Arg >::apply(), quda::Dslash5< Float, nColor, Arg >::apply(), quda::CopyGaugeEx< FloatOut, FloatIn, length, OutOrder, InOrder >::apply(), quda::ShiftColorSpinorField< Output, Input >::apply(), quda::WuppertalSmearing< Float, Ns, Nc, Arg >::apply(), quda::GaugeOvrImpSTOUT< Float, Arg >::apply(), quda::CopyColorSpinor< Ns, Arg >::apply(), quda::blas::MultiReduceCuda< NXZ, doubleN, ReduceType, FloatN, M, SpinorX, SpinorY, SpinorZ, SpinorW, Reducer >::apply(), quda::CalculateY< from_coarse, Float, fineSpin, fineColor, coarseSpin, coarseColor, Arg >::apply(), quda::Pack< Float, nColor, spin_project >::apply(), quda::ExtractGhost< nDim, Arg >::apply(), quda::ExtractGhostEx< Float, length, nDim, dim, Order >::apply(), quda::CopyColorSpinor< 4, Arg >::apply(), quda::blas::ReduceCuda< doubleN, ReduceType, FloatN, M, SpinorX, SpinorY, SpinorZ, SpinorW, SpinorV, Reducer >::apply(), quda::CopySpinorEx< FloatOut, FloatIn, Ns, Nc, OutOrder, InOrder, Basis, extend >::apply(), quda::Gamma< ValueType, basis, dir >::apply(), quda::TwistGamma< Float, nColor, Arg >::apply(), quda::ProjectSU3< Float, G >::apply(), quda::Clover< Float, nSpin, nColor, Arg >::apply(), quda::DslashCoarsePolicyTune::apply(), quda::TwistClover< Float, nSpin, nColor, Arg >::apply(), quda::blas::TileSizeTune< ReducerDiagonal, writeDiagonal, ReducerOffDiagonal, writeOffDiagonal >::apply(), quda::dslash::DslashPolicyTune< Dslash >::apply(), apply_staggered_phase_quda_(), quda::cublas::BatchInvertMatrix(), quda::CG::blocksolve(), quda::MG::buildFreeVectors(), quda::calculateY(), quda::calculateYhat(), cloverQuda(), comm_gdr_blacklist(), comm_peer2peer_init(), quda::TRLM::computeKeptRitz(), quda::computeMomAction(), quda::EigenSolver::computeSVD(), quda::EigenSolver::create(), quda::Dirac::create(), quda::cudaColorSpinorField::create(), quda::MG::createCoarseDirac(), quda::MG::createCoarseSolver(), quda::MG::createSmoother(), quda::EigenSolver::deflate(), quda::deflated_solver::deflated_solver(), quda::EigenSolver::deflateSVD(), quda::Deflation::Deflation(), quda::DiracMobius::DiracMobius(), quda::dslash::DslashPolicyTune< Dslash >::DslashPolicyTune(), dslashQuda(), dslashQuda_4dpc(), dslashQuda_mdwf(), eigensolveQuda(), quda::EigenSolver::EigenSolver(), endQuda(), quda::flushForceMonitor(), quda::forceRecord(), quda::gaugeGauss(), quda::MG::generateNullVectors(), quda::IncEigCG::initCGsolve(), initQudaDevice(), invertMultiShiftQuda(), invertMultiSrcQuda(), invertQuda(), quda::isUnitary(), loadCloverQuda(), quda::EigenSolver::loadFromFile(), loadGaugeQuda(), quda::loadTuneCache(), quda::EigenSolver::loadVectors(), quda::massRescale(), MatDagMatQuda(), MatQuda(), quda::multigrid_solver::multigrid_solver(), OpenMagma(), quda::TRLM::operator()(), quda::CG::operator()(), quda::PreconCG::operator()(), quda::BiCGstab::operator()(), quda::BiCGstabL::operator()(), quda::GCR::operator()(), quda::MR::operator()(), quda::CACG::operator()(), quda::CAGCR::operator()(), quda::SD::operator()(), quda::MultiShiftCG::operator()(), quda::MinResExt::operator()(), quda::IncEigCG::operator()(), performAPEnStep(), performOvrImpSTOUTnStep(), performSTOUTnStep(), performWuppertalnStep(), quda::Solver::PrintStats(), quda::Solver::PrintSummary(), pushVerbosity(), quda::Deflation::reduce(), quda::RNG::Release(), remove_staggered_phase_quda_(), quda::report(), quda::Transfer::reset(), quda::MG::reset(), quda::RNG::RNG(), quda::saveProfile(), quda::saveTuneCache(), quda::EigenSolver::saveVectors(), quda::setDiracParam(), quda::Transfer::Transfer(), quda::updateMomentum(), updateMultigridQuda(), quda::MG::verify(), quda::Deflation::~Deflation(), quda::Dirac::~Dirac(), and quda::MG::~MG().

◆ popOutputPrefix()

void popOutputPrefix ( )

Pop the output prefix restoring the prior one on the stack.

Definition at line 121 of file util_quda.cpp.

References errorQuda, host_free, and setOutputPrefix().

Referenced by quda::MG::operator()(), quda::PreconditionedSolver::operator()(), and quda::MG::popLevel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ popVerbosity()

void popVerbosity ( )

Pop the verbosity restoring the prior one on the stack.

Definition at line 94 of file util_quda.cpp.

References errorQuda, and setVerbosity().

Referenced by cloverQuda(), dslashQuda(), dslashQuda_4dpc(), dslashQuda_mdwf(), dumpMultigridQuda(), eigensolveQuda(), quda::GMResDR::FlexArnoldiProcedure(), invertMultiShiftQuda(), invertMultiSrcQuda(), invertQuda(), loadCloverQuda(), MatDagMatQuda(), MatQuda(), newMultigridQuda(), quda::GCR::operator()(), performWuppertalnStep(), quda::MG::popLevel(), and updateMultigridQuda().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pushOutputPrefix()

void pushOutputPrefix ( const char *  prefix)

Push a new output prefix onto the stack.

Definition at line 105 of file util_quda.cpp.

References getOutputPrefix(), MAX_PREFIX_SIZE, safe_malloc, setOutputPrefix(), and warningQuda.

Referenced by quda::MG::operator()(), quda::PreconditionedSolver::operator()(), and quda::MG::pushLevel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pushVerbosity()

void pushVerbosity ( QudaVerbosity  verbosity)

◆ setOutputFile()

void setOutputFile ( FILE *  outfile)

Definition at line 75 of file util_quda.cpp.

References outfile_.

Referenced by setVerbosityQuda().

Here is the caller graph for this function:

◆ setOutputPrefix()

void setOutputPrefix ( const char *  prefix)

Definition at line 69 of file util_quda.cpp.

References MAX_PREFIX_SIZE, and prefix_.

Referenced by popOutputPrefix(), pushOutputPrefix(), quda::MG::reset(), setVerbosityQuda(), updateMultigridQuda(), and quda::MG::verify().

Here is the caller graph for this function:

◆ setVerbosity()

void setVerbosity ( QudaVerbosity  verbosity)

Definition at line 25 of file util_quda.cpp.

References verbosity, and verbosity_.

Referenced by hisq_force_test(), init(), main(), plaq_test(), popVerbosity(), pushVerbosity(), GaugeAlgTest::SetUp(), setVerbosityQuda(), and SU3test().

Here is the caller graph for this function:

Variable Documentation

◆ buffer_

char buffer_[MAX_BUFFER_SIZE] = ""
static

Definition at line 19 of file util_quda.cpp.

Referenced by getPrintBuffer().

◆ MAX_BUFFER_SIZE

const int MAX_BUFFER_SIZE = 1000
static

Definition at line 18 of file util_quda.cpp.

◆ MAX_PREFIX_SIZE

const size_t MAX_PREFIX_SIZE = 100
static

Definition at line 12 of file util_quda.cpp.

Referenced by pushOutputPrefix(), and setOutputPrefix().

◆ outfile_

FILE* outfile_ = stdout
static

Definition at line 16 of file util_quda.cpp.

Referenced by getOutputFile(), and setOutputFile().

◆ prefix_

char prefix_[MAX_PREFIX_SIZE] = ""
static

Definition at line 15 of file util_quda.cpp.

Referenced by getOutputPrefix(), and setOutputPrefix().

◆ pstack

std::stack<char *> pstack
static

Definition at line 103 of file util_quda.cpp.

◆ verbosity_

QudaVerbosity verbosity_ = QUDA_SUMMARIZE
static

Definition at line 14 of file util_quda.cpp.

Referenced by getVerbosity(), and setVerbosity().

◆ vstack

std::stack<QudaVerbosity> vstack
static

Definition at line 81 of file util_quda.cpp.