Documentation

Describes the execution environment of the program.

This is an old way of writing singleton.

Static Public Member Functions

static void init (int &argcref, char **&argvref)
 Set the argument count and vector. More...
 
static void set_out (std::ostream *o=nullptr)
 
static void push_out (std::ostream *o=nullptr)
 
static void pop_out ()
 
static void set_err (std::ostream *o=nullptr)
 
static void push_err (std::ostream *o=nullptr)
 
static void pop_err ()
 
static bool initialized ()
 
static int & argc ()
 Return an reference to the argument count. More...
 
static char **& argv ()
 Return an reference to the argument vector. More...
 
static const char * program_name ()
 Return argv[0] with the path removed. More...
 
static const char * hostname ()
 Return the host name. More...
 
static const char * username ()
 Return the user name. More...
 
static std::string getenv (const std::string &name)
 
static std::ostream & outn ()
 Return an ostream that writes from all processes. More...
 
static std::ostream & errn ()
 Return an ostream for error messages that writes from all processes. More...
 
static std::ostream & out0 ()
 
static std::ostream & err0 ()
 
static std::ostream & out0 (TA::World &world)
 Return an ostream that writes from process 0 of the given World. More...
 
static std::ostream & err0 (TA::World &world)
 

Member Function Documentation

◆ argc()

int & ExEnv::argc ( )
static

Return an reference to the argument count.

◆ argv()

char **& ExEnv::argv ( )
static

Return an reference to the argument vector.

◆ err0() [1/2]

std::ostream & ExEnv::err0 ( )
static

Return an ostream for error messages that writes from process 0 of the default World.

Note
FormIO::set_printnode() can be used to specify which process this prints from

◆ err0() [2/2]

std::ostream & ExEnv::err0 ( TA::World &  world)
static

Return an ostream for error messages that writes from process 0 of the given World.

◆ errn()

std::ostream & ExEnv::errn ( )
static

Return an ostream for error messages that writes from all processes.

◆ getenv()

std::string ExEnv::getenv ( const std::string &  name)
static

Return the value of an environment variable. If it does not exist, then an empty string is returned.

◆ hostname()

const char * ExEnv::hostname ( )
static

Return the host name.

◆ init()

void ExEnv::init ( int &  argcref,
char **&  argvref 
)
static

Set the argument count and vector.

◆ initialized()

bool ExEnv::initialized ( )
static
Returns
true if ExEnv has been initialized.

◆ out0() [1/2]

std::ostream & ExEnv::out0 ( )
static

Return an ostream that writes from process 0 of the default World.

Note
FormIO::set_printnode() can be used to specify which process this prints from

◆ out0() [2/2]

std::ostream & ExEnv::out0 ( TA::World &  world)
static

Return an ostream that writes from process 0 of the given World.

◆ outn()

std::ostream & ExEnv::outn ( )
static

Return an ostream that writes from all processes.

◆ pop_err()

void ExEnv::pop_err ( )
static

replaces stderr with the stream used before the most recent call to ExEnv::push_err(), if any

◆ pop_out()

void ExEnv::pop_out ( )
static

replaces stdout with the stream used before the most recent call to ExEnv::push_out(), if any

◆ program_name()

const char * ExEnv::program_name ( )
static

Return argv[0] with the path removed.

◆ push_err()

void ExEnv::push_err ( std::ostream *  o = nullptr)
static

pushes current stderr to a stack and calls ExEnv::set_err(o)

Parameters
opointer to the std::ostream object to be used for standard error

◆ push_out()

void ExEnv::push_out ( std::ostream *  o = nullptr)
static

pushes current stdout to a stack and calls ExEnv::set_out(o)

Parameters
opointer to the std::ostream object to be used for standard output

◆ set_err()

void ExEnv::set_err ( std::ostream *  o = nullptr)
static

Set the stderr stream on this rank to o

Parameters
opointer to the std::ostream object to be used for standard error; if given nullptr will redirect stderr to /dev/null

◆ set_out()

void ExEnv::set_out ( std::ostream *  o = nullptr)
static

Set the stdout stream on this rank to o

Parameters
opointer to the std::ostream object to be used for standard output; if given nullptr will redirect stdout to /dev/null
Note
o will be auto-indented via mpqc::FormIO::autoindent_ostream()

◆ username()

const char * ExEnv::username ( )
static

Return the user name.


The documentation for this class was generated from the following files: