Columbia Physics System  5.0.16..1
Functions | Variables
cps::MPISCU Namespace Reference

Namespace for the MPI emulations of the SCU. More...

Functions

void set_pe_grid (int x, int y, int z, int t, int s=1)
 Communicates the processor grid dimensions to the MPI-SCU layer.
void CommsInit ()
 Initialises the MPI communications layer.
void CommsFinalize ()
 Performs a clean exit from the MPI communications layer.
void GlobalSum (Type_tag t, size_t tsize, int n, void *ivec, void *ovec)
 Computes a global sum directly using MPI.
void RaiseError (char *errstr)
 Reports an error.
void RaiseError (const char *errstring)
 Reports an error.
void Trans (void *addr, MPI_Datatype mpi_dt, SCUDir dir, SCUXR sendrx)
 An implementation-specific internal subroutine.
void ParseCommsParam (char *)
 An implementation-specific internal subroutine.
char * CommsStringTokenizer (char *str, const char *tokens, char **tok_pos)
 An implementation-specific internal subroutine.
MPI_Datatype MPITypeConv (Type_tag t, size_t tsize)
 An implementation-specific internal subroutine.
unsigned int ReadSeedFile ()
 An implementation-specific internal subroutine.
int printf (const char *format,...)
 Reimplementation of printf that prints from only a single node.
int fprintf (FILE *stream, const char *format,...)
 Reimplementation of fprintf that prints from only a single node.
int printf_all (const char *format,...)
 Reimplementation of printf that prints on all nodes.
int printf_allid (const char *format,...)
 Reimplementation of printf that prints on all nodes with node ID prefix.
int fprintf_all (FILE *stream, const char *format,...)
 Reimplementation of fprintf that prints on all nodes.
int vprintf (const char *, va_list)
 Reimplementation of vprintf that prints from only a single node.
int vfprintf (FILE *, const char *, va_list)
 Reimplementation of vfprintf that prints from only a single node.
void SCUCommsFinalize (void)
void SCUGlobalSum (Type_tag t, size_t tsize, int n, void *ivec, void *ovec)

Variables

bool Is_Initialised = false
 The global comms-layer initialization flag.

Detailed Description

Namespace for the MPI emulations of the SCU.


Function Documentation

char * cps::MPISCU::CommsStringTokenizer ( char *  str,
const char *  delim,
char **  tok_pos 
)

An implementation-specific internal subroutine.

String tokenizer, coded here to ensure portability:

Definition at line 816 of file sysfunc.C.

Referenced by ParseCommsParam().

int cps::MPISCU::fprintf ( FILE *  stream,
const char *  format,
  ... 
)

Reimplementation of fprintf that prints from only a single node.

Works like fprintf.

Parameters:
streamThe file handle to which to print
formatThe format string
...Optional arguments to the format string

Definition at line 59 of file qcdio_qprintf.C.

References cps::UniqueID(), and vfprintf().

Referenced by PT::asqtad_fat(), cps::dump_xml::close(), cps::Lattice::CompareGaugeField(), wfm::dslash(), cps::dump_xml::dump_xml(), cps::WspectAxialCurrent::dumpData(), cps::WspectMesons::dumpData(), cps::WspectQuark::dumpData(), cps::WspectQuark::dumpSource(), cps::Fopen(), cps::QuarkPropS::getQuarkPropS(), PT::init(), wfm::init(), PT::init_g(), cps::GlobalJobParameter::InitMdwfTuning(), AsqD::InvCg(), AsqD::MdagM(), cps::ForceArg::print(), cps::WspectAxialCurrent::print(), cps::WspectMesons::print(), cps::WspectBaryon::print(), cps::CheckSum::Print(), cps::WspectExtendedMesons::print(), cps::WspectExtendedMesonsBE::print(), cps::WspectMesons::print_mp(), cps::FermionVector::printWaveFunc(), cps::VML::Puts(), RaiseError(), cps::GaussianRandomGenerator::Rand(), cps::AlgRect::run(), cps::AlgWline::run(), cps::AlgPot::run(), cps::AlgPot2::run(), cps::AlgPlaq::run(), cps::AlgEig::run(), cps::AlgEqState::run(), cps::AlgPbp::run(), cps::AlgDens::run(), cps::AlgHmc::run(), cps::AlgHmcPhi::run(), cps::AlgHmcQPQ::run(), cps::AlgHmcRHMC::run(), cps::AlgHmdR::run(), cps::AlgHmdR2::run(), cps::AlgPbp::runPointSource(), SCUGlobalSum(), cps::vml_enum(), cps::vml_enum_string(), cps::vml_enum_val(), PT::vvpd(), cps::dump_xml::write(), and cps::WspectQuark::WspectQuark().

Here is the call graph for this function:

int cps::MPISCU::fprintf_all ( FILE *  stream,
const char *  format,
  ... 
)

Reimplementation of fprintf that prints on all nodes.

Works just like fprintf.

Parameters:
streamThe file handle to which to print
formatThe format string
...Optional arguments to the format string

Definition at line 124 of file qcdio_qprintf.C.

References vfprintf().

Referenced by CommsInit(), ReadSeedFile(), and cps::SCUTransComplete().

Here is the call graph for this function:

MPI_Datatype cps::MPISCU::MPITypeConv ( Type_tag  t,
size_t  tsize 
)

An implementation-specific internal subroutine.

On-the-fly type+size -> MPI_Datatype conversion. There are probably somewhat quicker ways of doing this via look-up tables, but for now, the look-up has been left explicit.

Definition at line 876 of file sysfunc.C.

References RaiseError(), cps::TYPE_IFloat, and cps::TYPE_int.

Referenced by SCUGlobalSum().

Here is the call graph for this function:

void cps::MPISCU::ParseCommsParam ( char *  envvar)

An implementation-specific internal subroutine.

Looks up and parses the run-time user parameters specified via ENVVAR. i.e. Lots of messy string handling et cetera.

Todo:
Currently, all PEs open the file and look up the required information. It would perhaps be quicker to get one PE to look in the file and then distribute the information. In fact, if only one node is capable of I/O, this would be neccessary, so it should be done.

Definition at line 706 of file sysfunc.C.

References CommsStringTokenizer(), cps::Fclose(), cps::Fopen(), NDIM, and RaiseError().

Referenced by CommsInit().

Here is the call graph for this function:

int cps::MPISCU::printf ( const char *  format,
  ... 
)

Reimplementation of printf that prints from only a single node.

Works like printf.

Parameters:
formatThe format string
...Optional arguments to the format string

Definition at line 40 of file qcdio_qprintf.C.

References cps::UniqueID(), and vprintf().

Referenced by cps::MPIRequestManager::AddRequest(), PT::Alloc(), AsqD::Alloc(), asq_print_flops(), PT::asqtad_long(), cps::WspectQuark::CheckSU3(), cps::Verbose::Clock(), cmm_agg_cpp(), cmv_agg_cpp(), cps::WspectExtendedMesons::collect(), cps::WspectExtendedMesonsBE::collect(), wfm::comm_complete(), wfm::comm_init(), wfm::comm_start(), cps::compare_array_relative(), cps::compare_float_relative(), cps::AlgActionRational::compareApprox(), wfm::CoreCount(), cross_over_lin_cpp(), cross_over_look_cpp(), wfm::decom(), AsqD::dirac(), dirac_cmm_jcw_agg_cpp(), dirac_cmv_jcw_agg_cpp(), cps::dirac_cmv_jcw_agg_cpp(), cps::DiracOpStag::DiracOpStag(), cps::WspectQuark::doSinkOperator(), wfm::dslash(), AsqD::Dslash(), cps::WspectMomenta::dumpData(), cps::WspectMesons::Everything(), cps::Fp4::EvolveMomFforce(), PT::FastAlloc(), cps::FdwfBase::FeigSolv(), cps::Fmdwf::FeigSolv(), cps::FermionVector::FermionVector(), cps::Error::FileA(), cps::Error::FileR(), cps::Error::FileW(), cps::WspectExtendedMesons::finish(), cps::WspectExtendedMesonsBE::finish(), cps::Verbose::Flow(), cps::Fstag::FmatEvlInv(), cps::FdwfBase::FsiteOffsetChkb(), cps::Verbose::Func(), cps::Verbose::FuncEnd(), cps::FermionVector::gaugeFixSink(), cps::FermionVectorTp::GaussianSmearVector(), cps::Error::General(), cps::getData(), cps::glb_sum_gimp(), cps::glb_sum_internal(), cps::Lattice::GsoCheck(), cps::Error::Hardware(), cps::Gsum64Ext::Init(), cps::wfm::init(), wfm::init(), AsqD::init(), AsqD::init_g(), cps::WspectExtendedMesons::initWMesonStateTable(), cps::Verbose::Input(), cps::Nuc3ptStru::InsertOp(), AsqD::InvCg(), cps::DiracOp::InvCgShift(), cps::Verbose::LedFlash(), cps::Verbose::LedOff(), cps::Verbose::LedOn(), cps::ParallelIO::load(), cps::DiracOpClover::MatEvlInv(), cps::MatHermElements(), cps::DiracOpDwf::MatInv(), cps::DiracOpP4::MatInv(), cps::DiracOpWilson::MatInv(), cps::DiracOpAsqtad::MatPcDagMatPc(), cps::DiracOpP4::MatPcDagMatPc(), cps::DiracOpClover::MatPcDagOrNot(), cps::wfm::mdag(), AsqD::MdagM(), cps::AlgGheatBath::NoCheckerBoardRun(), cps::AlgGheatBath::NodeCheckerBoardRun(), cps::Error::NotImplemented(), cps::p(), cps::Verbose::Pclear(), cps::Error::Pointer(), PT::PointerErr(), AsqD::PointerErr(), cps::WspectMesons::print(), cps::WspectExtendedMesons::print(), cps::WspectExtendedMesonsBE::print(), cps::Vector::Print(), cps::print_flops(), PT::print_flops(), cps::print_list(), cps::print_time(), cps::Matrix::ProjSU3(), pt_cmm_agg_print(), pt_cmv_cpp(), cps::qio_init::qio_init(), cps::qload_parameters(), cps::RandomGenerator::Rand(), cps::Lattice::RandGaussVector(), cps::ReadLatticeParallel::read(), wfm::recon(), cps::report_flops(), cps::Verbose::RNGSeed(), cps::AlgHQPotential::run(), cps::AlgOverRelax::run(), cps::AlgGheatBath::run(), cps::AlgPot::run(), cps::WspectFuzzing::run(), cps::AlgPbp::run(), cps::AlgDens::run(), cps::AlgWspect::run(), cps::AlgThreePt::run(), cps::AlgWspectExtMeson::run(), cps::AlgHmc::run(), cps::AlgHmcPhi::run(), cps::AlgOlegSmear::run(), cps::AlgHmcQPQ::run(), cps::Verbose::Sclear(), cps::FdwfBase::SetPhi(), cps::Fasqtad::Smear(), cps::Fp4::Smear(), cps::staggered_local_pion(), cps::Start(), cps::ParallelIO::store(), cps::SerialIO::store(), wfm::thread_create(), ti2ieee(), cps::FPConv::ti2ieee(), PT::update_momenta(), PT::vec_cb_pad(), PT::vvpd(), cps::Verbose::Warn(), cps::wfm_scope_assert(), wfm_scope_assert(), cps::wfm_scope_check(), wfm_scope_check(), wilson_dslash_blk_dag0(), wilson_dslash_blk_dag1(), cps::wilson_dslash_vec(), cps::LatRngWrite::write(), cps::WriteLatticeParallel::write(), cps::WspectFuzzing::WspectFuzzing(), cps::WspectQuark::WspectQuark(), cps::LinkBuffer::~LinkBuffer(), cps::qio_init::~qio_init(), cps::qio_readLattice::~qio_readLattice(), cps::qio_readPropagator::~qio_readPropagator(), cps::qio_writeLattice::~qio_writeLattice(), and cps::qio_writePropagator::~qio_writePropagator().

Here is the call graph for this function:

int cps::MPISCU::printf_all ( const char *  format,
  ... 
)

Reimplementation of printf that prints on all nodes.

Works just like printf.

Parameters:
formatThe format string
...Optional arguments to the format string

Definition at line 77 of file qcdio_qprintf.C.

References vprintf().

Referenced by CommsInit().

Here is the call graph for this function:

int cps::MPISCU::printf_allid ( const char *  format,
  ... 
)

Reimplementation of printf that prints on all nodes with node ID prefix.

Works like printf, but prefixes the message with the node ID number and the cartesian coordinates of the node in the node grid.

Parameters:
formatThe format string
...Optional arguments to the format string

Definition at line 94 of file qcdio_qprintf.C.

References cps::GJP, cps::GlobalJobParameter::TnodeCoor(), cps::UniqueID(), vprintf(), cps::GlobalJobParameter::XnodeCoor(), cps::GlobalJobParameter::YnodeCoor(), and cps::GlobalJobParameter::ZnodeCoor().

Here is the call graph for this function:

unsigned int cps::MPISCU::ReadSeedFile ( void  )

An implementation-specific internal subroutine.

Reads a seed for every PE from a file specified during intialisation.

Definition at line 931 of file sysfunc.C.

References CommsInit(), cps::Fclose(), cps::Fopen(), fprintf_all(), Is_Initialised, and RaiseError().

Here is the call graph for this function:

void cps::MPISCU::Trans ( void *  addr,
MPI_Datatype  mpi_dt,
SCUDir  dir,
SCUXR  sendrx 
)

An implementation-specific internal subroutine.

The lowest level MPI comms subroutine, on which all other comms calls are based.

Definition at line 661 of file sysfunc.C.

References cps::MPIRequestManager::AddRequest(), cps::dir, and cps::SCU_SEND.

Referenced by cps::SCUTrans(), and cps::SCUTransAddr().

Here is the call graph for this function:

int cps::MPISCU::vfprintf ( FILE *  f,
const char *  format,
va_list  arg 
)

Reimplementation of vfprintf that prints from only a single node.

Works like vprintf.

Parameters:
formatThe format string
argThe variable argument list.

Definition at line 150 of file qcdio_qprintf.C.

References cps::UniqueID().

Referenced by fprintf(), cps::Fprintf(), fprintf_all(), and cps::Vfprintf().

Here is the call graph for this function:

int cps::MPISCU::vprintf ( const char *  format,
va_list  arg 
)

Reimplementation of vprintf that prints from only a single node.

Works like vprintf.

Parameters:
formatThe format string
argThe variable argument list.

Definition at line 140 of file qcdio_qprintf.C.

References cps::UniqueID().

Referenced by cps::Verbose::Debug(), cps::Error::General(), cps::Error::Hardware(), cps::Verbose::Input(), cps::Error::NotImplemented(), printf(), printf_all(), printf_allid(), cps::Verbose::RNGSeed(), and cps::Verbose::Warn().

Here is the call graph for this function: