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

Functions for doing file IO on a parallel machine


Enumerations

enum  cps::FileIoType { cps::ZERO_ONLY, cps::ADD_ID, cps::ALL_NODES }
 Type of IO. More...

Functions

FILE * cps::Fopen (FileIoType type, const char *filename, const char *mode)
 Opens a file.
int cps::Fclose (FileIoType type, FILE *stream)
 Closes a file.
size_t cps::Fwrite (const void *ptr, size_t size, size_t n, FILE *stream)
 Prints to a file.
size_t cps::Fread (void *ptr, size_t size, size_t n, FILE *stream)
int cps::Fprintf (FileIoType type, FILE *stream, const char *format,...)
 Read & Write from a file.
int cps::Vfprintf (FileIoType type, FILE *stream, const char *format, va_list ap)
 Prints a variable-length argument list to a file.
FILE * cps::Fopen (const char *filename, const char *mode)
 Opens a file.
int cps::Fclose (FILE *stream)
 Closes a file.
int cps::Fprintf (FILE *stream, const char *format,...)
 Prints to a file.
int cps::Vfprintf (FILE *stream, const char *format, va_list ap)
 Prints a variable-length argument list to a file.

Enumeration Type Documentation

enum FileIoType
 

Type of IO.

Enumeration values:
ZERO_ONLY  Write from a single node only.
ADD_ID  Each node writes to a seperate file which has the node ID number appended to its name.
ALL_NODES 

Definition at line 82 of file qcdio.h.


Function Documentation

int Fclose FILE *  stream  )  [inline]
 

Closes a file.

This works like fclose in the C standard library

Parameters:
stream The file handle to close.
Returns:
Normally, EOF or zero on error, but if the file was opened by a single node and this function is called by a different node (in which case stream will be the dummy file handle), then 1 is returned.

Definition at line 195 of file qcdio.h.

References ZERO_ONLY.

Referenced by cps::asqtad_dirac_init(), cps::asqtad_dirac_init_g(), cps::MPISCU::ParseCommsParam(), and cps::MPISCU::ReadSeedFile().

int cps::Fclose FileIoType  type,
FILE *  stream
 

Closes a file.

This works like fclose in the C standard library

Parameters:
type Ignored.
stream The file handle to close.
Returns:
Normally, EOF or zero on error, but if the file was opened by a single node and this function is called by a different node (in which case stream will be the dummy file handle), then 1 is returned.

Definition at line 27 of file file_io.C.

Referenced by cps::VML::Destroy(), cps::WspectMesons::DiracAlgebra(), cps::QPropW::DoLinkSmear(), cps::WspectQuark::dumpData(), cps::WspectMesons::dumpData(), cps::WspectAxialCurrent::dumpData(), cps::WspectQuark::dumpSource(), cps::Fwilson::FeigSolv(), cps::Error::FileA(), cps::Error::FileR(), cps::Error::FileW(), cps::Error::General(), cps::QuarkPropS::getQuarkPropS(), cps::Error::Hardware(), cps::Error::NotImplemented(), cps::Error::Pointer(), 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::QPropWGFLfuncSrc::QPropWGFLfuncSrc(), cps::DiracOpWilsonTypes::RitzEig(), 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::AlgPot2::run(), cps::AlgPot::run(), cps::AlgPlaq::run(), cps::AlgPbp::run(), cps::AlgHmc::run(), cps::AlgHQPotential::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(), cps::Verbose::Warn(), cps::LatRngWrite::write(), cps::WriteLatticeParallel::write(), and cps::WspectQuark::WspectQuark().

FILE* Fopen const char *  filename,
const char *  mode
[inline]
 

Opens a file.

This works like fopen in the C standard library, except that on a parallel machine just one node does the IO

Parameters:
filename the main name of the file
mode the IO mode (as for fopen)
Postcondition:
Only one node opens the file. A dummy handle is returned on other nodes.

Definition at line 183 of file qcdio.h.

References ZERO_ONLY.

Referenced by cps::asqtad_dirac_init(), cps::asqtad_dirac_init_g(), cps::MPISCU::CommsInit(), cps::MPISCU::ParseCommsParam(), and cps::MPISCU::ReadSeedFile().

FILE * cps::Fopen FileIoType  type,
const char *  filename,
const char *  mode
 

Opens a file.

This works like fopen in the C standard library, except that on a parallel machine we can decide whether just one node does the IO, or whether each node performs IO to a seperate file which has the node number appended to its name.

Parameters:
type What sort of IO to do.
filename the main name of the file
mode the IO mode (as for fopen)
Returns:
The handle of the closed file, or NULL on failure.
Precondition:
In the mode where all nodes open a file, the length of the final filename, i.e. filename with a '.' and the node number appended, cannot exceed 200 characters.
Postcondition:
The file is opened by all nodes or just one. In the latter case a dummy file handle is returned.

Definition at line 8 of file file_io.C.

References cps::MPISCU::fprintf(), cps::UniqueID(), and ZERO_ONLY.

Referenced by cps::WspectMesons::DiracAlgebra(), cps::QPropW::DoLinkSmear(), cps::WspectQuark::dumpData(), cps::WspectMesons::dumpData(), cps::WspectAxialCurrent::dumpData(), cps::WspectQuark::dumpSource(), cps::Fwilson::FeigSolv(), cps::Error::FileA(), cps::Error::FileR(), cps::Error::FileW(), cps::Error::General(), cps::QuarkPropS::getQuarkPropS(), cps::Error::Hardware(), cps::Error::NotImplemented(), cps::Error::Pointer(), 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::QPropWGFLfuncSrc::QPropWGFLfuncSrc(), cps::DiracOpWilsonTypes::RitzEig(), 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::AlgPot2::run(), cps::AlgPot::run(), cps::AlgPlaq::run(), cps::AlgPbp::run(), cps::AlgHmc::run(), cps::AlgHQPotential::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(), cps::Verbose::Warn(), cps::LatRngWrite::write(), cps::WriteLatticeParallel::write(), and cps::WspectQuark::WspectQuark().

int cps::Fprintf FILE *  stream,
const char *  format,
  ...
 

Prints to a file.

This works like fprint in the C standard library, except that on a parallel machine we can decide whether just one node does the IO, or whether each node performs IO to a seperate file which has the node number appended to its name.

Parameters:
stream The file handle
format Format string - as in the C standard library fprintf
... Parameters, as in the C standard library fprintf
Returns:
Normally, the number of bytes written, but if the file was opened in ZERO_ONLY mode and this function is called by a different mode (in which case stream will be the dummy file handle), then 1 is returned.

Definition at line 41 of file file_io.C.

References cps::MPISCU::vfprintf().

Referenced by cps::asqtad_dirac_init(), cps::asqtad_dirac_init_g(), cps::CorrFunc::print(), and cps::Gamma::printTag().

int cps::Fprintf FileIoType  type,
FILE *  stream,
const char *  format,
  ...
 

Read & Write from a file.

This works like fread & fwrite in the C standard library, except that on a parallel machine we can decide whether just one node does the IO, or whether each node performs IO to a seperate file which has the node number appended to its name.

Parameters:
stream The file handle
Returns:
Normally, the number of elements written, but if the file was opened in ZERO_ONLY mode and this function is called by a different mode (in which case stream will be the dummy file handle), then n is returned from Fwrite().

Definition at line 32 of file file_io.C.

References cps::MPISCU::vfprintf().

Referenced by cps::WspectMesons::DiracAlgebra(), cps::QPropW::DoLinkSmear(), cps::WspectQuark::dumpData(), cps::WspectMesons::dumpData(), cps::WspectAxialCurrent::dumpData(), cps::WspectQuark::dumpSource(), cps::Fwilson::FeigSolv(), cps::Error::FileA(), cps::Error::FileR(), cps::Error::FileW(), cps::Error::General(), cps::QuarkPropS::getQuarkPropS(), cps::Error::Hardware(), cps::Error::NotImplemented(), cps::Error::Pointer(), cps::WspectMesons::print(), cps::WspectExtendedMesons::print(), cps::WspectExtendedMesonsBE::print(), cps::WspectBaryon::print(), cps::WspectAxialCurrent::print(), cps::Nuc3pt::Print(), cps::Nuc2pt::Print(), cps::ForceArg::print(), cps::WspectMesons::print_mp(), cps::WspectGinfo::printSite(), cps::WspectGinfo::printSpinor(), cps::Nuc3ptGammaR::PrintTheTag(), cps::Nuc3ptStru::PrintTheTag(), cps::FermionVector::printWaveFunc(), cps::VML::Puts(), cps::QPropWGFLfuncSrc::QPropWGFLfuncSrc(), cps::DiracOpWilsonTypes::RitzEig(), cps::AlgWline::run(), cps::AlgTcharge::run(), cps::AlgApeSmear2::run(), cps::AlgOlegSmear::run(), cps::AlgHypSmear::run(), cps::AlgKineticSmear::run(), cps::AlgApeSmear::run(), cps::AlgRect::run(), cps::QPropW::Run(), cps::AlgPot2::run(), cps::AlgPot::run(), cps::AlgPlaq::run(), cps::AlgPbp::run(), cps::AlgNuc3pt::run(), cps::AlgHmc::run(), cps::AlgHQPotential::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(), cps::Verbose::Warn(), and cps::WspectQuark::WspectQuark().

size_t cps::Fread void *  ptr,
size_t  size,
size_t  n,
FILE *  stream
 

Definition at line 40 of file file_io.C.

size_t cps::Fwrite const void *  ptr,
size_t  size,
size_t  n,
FILE *  stream
 

Prints to a file.

This works like fprint in the C standard library, except that on a parallel machine we can decide whether just one node does the IO, or whether each node performs IO to a seperate file which has the node number appended to its name.

Parameters:
type Ignored
stream The file handle
format Format string - as in the C standard library fprintf
... Parameters, as in the C standard library fprintf
Returns:
Normally, the number of bytes written, but if the file was opened in ZERO_ONLY mode and this function is called by a different mode (in which case stream will be the dummy file handle), then 1 is returned.

Definition at line 35 of file file_io.C.

int Vfprintf FILE *  stream,
const char *  format,
va_list  ap
[inline]
 

Prints a variable-length argument list to a file.

This works like vfprint in the C standard library, except that on a parallel machine we can decide whether just one node does the IO, or whether each node performs IO to a seperate file which has the node number appended to its name.

Parameters:
stream The file handle
format Format string - as in the C standard library fprintf
ap Parameter liss, as in the C standard library fprintf
Returns:
Normally, the number of bytes written, but if the file was opened in ZERO_ONLY mode and this function is called by a different mode, then 1 is returned.

Definition at line 228 of file qcdio.h.

References ZERO_ONLY.

int cps::Vfprintf FileIoType  type,
FILE *  stream,
const char *  format,
va_list  ap
 

Prints a variable-length argument list to a file.

This works like vfprint in the C standard library, except that on a parallel machine we can decide whether just one node does the IO, or whether each node performs IO to a seperate file which has the node number appended to its name.

Parameters:
type Ignored
stream The file handle
format Format string - as in the C standard library fprintf
ap Parameter liss, as in the C standard library fprintf
Returns:
Normally, the number of bytes written, but if the file was opened in ZERO_ONLY mode and this function is called by a different mode (in which case stream will be the dummy file handle), then 1 is returned.

Definition at line 50 of file file_io.C.

References cps::MPISCU::vfprintf().

Referenced by cps::Error::General(), cps::Error::Hardware(), cps::Error::NotImplemented(), and cps::Verbose::Warn().


Generated on Sat Oct 10 14:11:52 2009 for Columbia Physics System by  doxygen 1.3.9.1