32 #ifndef _util_misc_exenv_h
33 #define _util_misc_exenv_h
41 #include <util/misc/formio.h>
49 static int initialized_;
52 static char hostname_[256];
53 static char username_[9];
58 static std::ostream *out_;
59 static std::ostream *nullstream_;
62 static void init(
int &argcref,
char **&argvref);
66 static int &
argc() {
return *argc_; }
68 static char **&
argv() {
return *argv_; }
72 static const char *
hostname() {
return hostname_; }
74 static const char *
username() {
return username_; }
76 static void set_out(std::ostream *o) { SCFormIO::init_ostream(*o);out_=o; }
78 static std::ostream &
outn() {
if (!out_)set_out(&std::cout);
return *out_; }
82 static std::ostream &
out0();
87 static size_t memory() {
return mem_; }
89 static int nproc() {
return nproc_; }
static const char * username()
Return the user name.
Definition: exenv.h:74
static size_t memory()
The amount of memory on this node.
Definition: exenv.h:87
static int & argc()
Return an reference to the argument count.
Definition: exenv.h:66
static const char * hostname()
Return the host name.
Definition: exenv.h:72
static std::ostream & err0()
Return an ostream for error messages that writes from node 0.
Definition: exenv.h:84
static char **& argv()
Return an reference to the argument vector.
Definition: exenv.h:68
static const char * program_name()
Return argv[0] with the path removed.
static std::ostream & errn()
Return an ostream for error messages that writes from all nodes.
Definition: exenv.h:80
static int initialized()
Return nonzero if ExEnv has been initialized.
Definition: exenv.h:64
The ExEnv class is used to find out about how the program is being run.
Definition: exenv.h:47
static std::ostream & out0()
Return an ostream that writes from node 0.
static std::ostream & outn()
Return an ostream that writes from all nodes.
Definition: exenv.h:78
static int nproc()
The number of processors on this node.
Definition: exenv.h:89
static void init(int &argcref, char **&argvref)
Set the argument count and vector.
Generated at Sun Jan 26 2020 23:33:03 for MPQC
2.3.1 using the documentation package Doxygen
1.8.16.