cps::MPISCU Namespace Reference

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

Functions

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 set_pe_grid (int x, int y, int z, int t, int s)
void CommsInit ()
void SCUCommsFinalize (void)
void SCUGlobalSum (Type_tag t, size_t tsize, int n, void *ivec, void *ovec)
void RaiseError (char *errstr)
void RaiseError (const char *errstring)
void Trans (void *addr, MPI_Datatype mpi_dt, SCUDir dir, SCUXR sendrx)
void ParseCommsParam (char *envvar)
char * CommsStringTokenizer (char *str, const char *delim, char **tok_pos)
MPI_Datatype MPITypeConv (Type_tag t, size_t tsize)
unsigned int ReadSeedFile (void)

Variables

bool Is_Initialised = false
 Whether the MPI-SCU layer has been initialised.

Detailed Description

Namespace for the MPI emulations of the SCU.


Function Documentation

void cps::MPISCU::CommsInit (  ) 

This function finds the parameters relevant for the parallel decomposition of the lattice, sets up the communications layer and defines the grid topology.

It also defines a root node (which is useful for IO) and opens logfiles (if required).

Definition at line 413 of file sysfunc.C.

References cps::Fopen(), fprintf_all(), Is_Initialised, NDIM, ParseCommsParam(), printf_all(), and RaiseError().

Referenced by cps::CoorS(), cps::CoorT(), cps::CoorX(), cps::CoorY(), cps::CoorZ(), cps::NumNodes(), ReadSeedFile(), SCUGlobalSum(), cps::SeedS(), cps::SizeS(), cps::SizeT(), cps::SizeX(), cps::SizeY(), cps::SizeZ(), cps::sync(), and cps::UniqueID().

Here is the call graph for this function:

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

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:
stream The file handle to which to print
format The 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::WspectQuark::dumpData(), cps::WspectMesons::dumpData(), cps::WspectAxialCurrent::dumpData(), cps::WspectQuark::dumpSource(), cps::QuarkPropS::getQuarkPropS(), PT::init(), wfm::init(), PT::init_g(), cps::GlobalJobParameter::InitMdwfTuning(), AsqD::InvCg(), cps::DiracOp::InvLowModeProj(), cps::DiracOpP4::MatPcDagMatPc(), AsqD::MdagM(), cps::CheckSum::Print(), cps::WspectMesons::print(), cps::WspectExtendedMesons::print(), cps::WspectExtendedMesonsBE::print(), cps::WspectBaryon::print(), cps::WspectAxialCurrent::print(), cps::WspectMesons::print_mp(), cps::FermionVector::printWaveFunc(), cps::VML::Puts(), RaiseError(), cps::GaussianRandomGenerator::Rand(), cps::AlgWline::run(), cps::AlgRect::run(), cps::AlgPot2::run(), cps::AlgPot::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::AlgEig::run(), cps::AlgDens::run(), cps::AlgPbp::runPointSource(), SCUGlobalSum(), cps::test_checksum(), cps::vml_enum(), cps::vml_enum_string(), cps::vml_enum_val(), 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:
stream The file handle to which to print
format The 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 
)

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().

Referenced by SCUGlobalSum().

Here is the call graph for this function:

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

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:
format The 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::AlgMuon::AlgMuon(), PT::Alloc(), AsqD::Alloc(), bfm_evo< Float >::allocCompactFermion(), asq_print_flops(), PT::asqtad_long(), cps::AlgMuon::AxialConsLoc(), bfm_evo< Float >::bicg_M(), bfm_evo< Float >::bicgstab_M(), bfm_evo< Float >::Booee(), mixed_cg::cg_MdagM_single_precnd(), DMA_Descriptor::checkIfReadyToInject(), cps::WspectQuark::CheckSU3(), cps::Verbose::Clock(), cmm_agg_cpp(), cmv_agg_cpp(), cps::WspectExtendedMesons::collect(), cps::WspectExtendedMesonsBE::collect(), wfm::comm_complete(), majorityVote::comm_gsum(), wfm::comm_init(), wfm::comm_start(), cps::compare_array_relative(), cps::compare_float_relative(), cps::AlgActionRational::compareApprox(), cps::EigenContainer::compress(), bfm_evo< Float >::compute_force(), wfm::CoreCount(), cross_over_lin_cpp(), cross_over_look_cpp(), wfm::decom(), bfm_evo< Float >::deflate(), AsqD::dirac(), dirac_cmm_jcw_agg_cpp(), dirac_cmv_jcw_agg_cpp(), cps::dirac_cmv_jcw_agg_cpp(), cps::DiracOpStag::DiracOpStag(), DMA_CounterGetOffsetFromBase(), cps::WspectQuark::doSinkOperator(), wfm::dslash(), AsqD::Dslash(), DMA_Descriptor::dump(), DMA_DescriptorBase::dump(), cps::WilsonMatrix::dump(), cps::WspectMomenta::dumpData(), bfm_evo< Float >::Eig_CGNE_prec(), cps::WspectMesons::Everything(), cps::Fp4::EvolveMomFforce(), cps::Fmdwf::FeigSolv(), cps::FdwfBase::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::four_s_loop_dwf_m5inv_dag0(), cps::FdwfBase::FsiteOffsetChkb(), cps::Verbose::Func(), cps::Verbose::FuncEnd(), cps::FermionVector::gaugeFixSink(), cps::FermionVectorTp::GaussianSmearVector(), bfm_evo< Float >::gcr_M(), cps::Error::General(), cps::getData(), EigCGController< Float >::getInstance(), cps::glb_sum_gimp(), cps::glb_sum_internal(), bfm_evo< Float >::gmres_M(), cps::Lattice::GsoCheck(), cps::Error::Hardware(), bfm_evo< T >::HD_CGNE_M(), 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(), KillJob(), cps::Verbose::LedFlash(), cps::Verbose::LedOff(), cps::Verbose::LedOn(), cps::DiracOpClover::MatEvlInv(), cps::MatHermElements(), cps::DiracOpWilson::MatInv(), cps::DiracOpP4::MatInv(), cps::DiracOpNaive::MatInv(), cps::DiracOpDwf::MatInv(), cps::DiracOpP4::MatPcDagMatPc(), cps::DiracOpAsqtad::MatPcDagMatPc(), cps::DiracOpClover::MatPcDagOrNot(), cps::wfm::mdag(), AsqD::MdagM(), cps::Lattice::mult_su3_links_by_mag_field(), cps::naive_dslash(), cps::EigenContainer::nev_check(), cps::AlgGheatBath::NoCheckerBoardRun(), cps::AlgGheatBath::NodeCheckerBoardRun(), cps::Error::NotImplemented(), cps::p(), cps::Verbose::Pclear(), cps::Error::Pointer(), PT::PointerErr(), AsqD::PointerErr(), cps::Vector::Print(), cps::WspectMesons::print(), cps::WspectExtendedMesons::print(), cps::WspectExtendedMesonsBE::print(), cps::print_asctime_(), cps::print_flops(), PT::print_flops(), cps::print_list(), cps::print_time(), cps::Matrix::ProjSU3(), pt_cmm_agg_print(), pt_cmv_cpp(), cps::qload_parameters(), cps::RandomGenerator::Rand(), cps::Lattice::RandGaussVector(), cps::ReadU1LatticeParallel::read(), cps::ReadLatticeParallel::read(), wfm::recon(), cps::report_flops(), bfm_evo< Float >::ritz(), cps::DiracOpMobius::RitzMat(), cps::Verbose::RNGSeed(), cps::WspectFuzzing::run(), cps::AlgWspect::run(), cps::AlgWspectExtMeson::run(), cps::AlgThreePt::run(), cps::AlgOlegSmear::run(), cps::AlgPot::run(), cps::AlgPbp::run(), cps::AlgOverRelax::run(), cps::AlgHmc::run(), cps::AlgHQPotential::run(), cps::AlgHmcQPQ::run(), cps::AlgHmcPhi::run(), cps::AlgGheatBath::run(), cps::AlgFourierPropDis::run(), cps::AlgDens::run(), cps::AlgMuon::run_jk_sub(), cps::AlgMuon::run_jk_sub_step1(), cps::AlgMuon::run_jk_sub_step1_mom(), cps::AlgMuon::run_jk_sub_step2(), cps::AlgMuon::run_jk_sub_step2_mom(), cps::AlgMuon::run_lbl(), cps::AlgMuon::run_sub(), cps::Verbose::Sclear(), HDCGInstance::SetDefault(), EigCGController< Float >::setInstance(), cps::FdwfBase::SetPhi(), cps::Fp4::Smear(), cps::Fasqtad::Smear(), spi_init(), cps::staggered_local_pion(), cps::Start(), wfm::thread_create(), bfm_evo< Float >::threaded_alloc(), mixed_cg::threaded_cg_mixed_M(), mixed_cg::threaded_cg_mixed_MdagM(), mixed_cg::threaded_convFermion(), cps::FPConv::ti2ieee(), ti2ieee(), cps::AlgMuon::two_point(), PT::update_momenta(), cps::AlgMuon::VacPolConsLocLoopPtSrc(), cps::AlgMuon::VacPolConsLocLowMode(), cps::AlgMuon::VacPolConsLocPtSrc(), cps::AlgMuon::VacPolConsLocTwistedBC(), cps::Verbose::Warn(), cps::wfm_scope_assert(), wfm_scope_assert(), cps::wfm_scope_check(), wfm_scope_check(), cps::wilson_dslash(), wilson_dslash_blk_dag0(), wilson_dslash_blk_dag1(), cps::wilson_dslash_vec(), cps::LatRngWrite::write(), cps::WriteU1LatticeParallel::write(), cps::WriteLatticeParallel::write(), cps::WspectFuzzing::WspectFuzzing(), cps::WspectQuark::WspectQuark(), cps::LinkBuffer::~LinkBuffer(), cps::qio_readGenericFields::~qio_readGenericFields(), cps::qio_readLattice::~qio_readLattice(), cps::qio_readPropagator::~qio_readPropagator(), cps::qio_writeGenericFields::~qio_writeGenericFields(), 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:
format The 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:
format The 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:

void cps::MPISCU::RaiseError ( const char *  errstring  ) 

Prints an error message to stdout and causes the program to exit immediately with the value EXIT_FAILURE.

Parameters:
errstr The messsage.

Definition at line 645 of file sysfunc.C.

References RaiseError().

Here is the call graph for this function:

void cps::MPISCU::RaiseError ( char *  errstr  ) 

Prints an error message to stdout and causes the program to exit immediately with the value EXIT_FAILURE.

Parameters:
errstr The messsage.

Definition at line 625 of file sysfunc.C.

References fprintf(), and Is_Initialised.

Referenced by CommsInit(), MPITypeConv(), ParseCommsParam(), RaiseError(), ReadSeedFile(), and SCUGlobalSum().

Here is the call graph for this function:

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

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().

Referenced by cps::Seed().

Here is the call graph for this function:

void cps::MPISCU::SCUCommsFinalize ( void   ) 

Definition at line 570 of file sysfunc.C.

References Is_Initialised.

void cps::MPISCU::set_pe_grid ( int  x,
int  y,
int  z,
int  t,
int  s 
)

If MPI is started outwith the MPI-SCU layer then this function should be used to tell the MPI-SCU layer what the grid dimensions are. This mechanism need and should not be used if the MPI parameters are read from a file. This function can only be called once; if it is called again it does nothing.

Parameters:
x The grid dimension in the X direction.
y The grid dimension in the Y direction.
z The grid dimension in the Z direction.
t The grid dimension in the T direction.

Definition at line 386 of file sysfunc.C.

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

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

Definition at line 661 of file sysfunc.C.

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

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:
format The format string
arg The 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:
format The format string
arg The 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:


Variable Documentation

Whether the MPI-SCU layer has been initialised.

The initial value of the global comms-layer initialization flag is FALSE, indicating that the communications system has not been set up.

Definition at line 52 of file sysfunc.C.

Referenced by CommsInit(), cps::CoorS(), cps::CoorT(), cps::CoorX(), cps::CoorY(), cps::CoorZ(), cps::NumNodes(), RaiseError(), ReadSeedFile(), SCUCommsFinalize(), SCUGlobalSum(), cps::SeedS(), cps::SizeS(), cps::SizeT(), cps::SizeX(), cps::SizeY(), cps::SizeZ(), cps::sync(), and cps::UniqueID().


Generated on 19 Mar 2015 for Columbia Physics System by  doxygen 1.6.1