28 #ifndef _util_misc_exenv_h
29 #define _util_misc_exenv_h
33 #include <mpqc_config.h>
37 #include <util/misc/formio.h>
48 static int initialized_;
51 static char hostname_[256];
52 static char username_[9];
57 static std::ostream *out_;
58 static std::ostream *nullstream_;
61 static void init(
int &argcref,
char **&argvref);
65 static int &
argc() {
return *argc_; }
67 static char **&
argv() {
return *argv_; }
71 static const char *
hostname() {
return hostname_; }
73 static const char *
username() {
return username_; }
79 static void set_out(std::ostream *o) { SCFormIO::init_ostream(*o);out_=o; }
81 static std::ostream &
outn() {
if (!out_)set_out(&std::cout);
return *out_; }
85 static std::ostream &
out0();
90 static size_t memory() {
return mem_; }
92 static int nproc() {
return nproc_; }
static std::string getenv_string(const char *name)
Return the value of an environment variable.
static const char * username()
Return the user name.
Definition: exenv.h:73
static size_t memory()
The amount of memory on this node.
Definition: exenv.h:90
static int & argc()
Return an reference to the argument count.
Definition: exenv.h:65
static const char * hostname()
Return the host name.
Definition: exenv.h:71
static std::ostream & err0()
Return an ostream for error messages that writes from node 0.
Definition: exenv.h:87
static char **& argv()
Return an reference to the argument vector.
Definition: exenv.h:67
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:83
static int initialized()
Return nonzero if ExEnv has been initialized.
Definition: exenv.h:63
The ExEnv class is used to find out about how the program is being run.
Definition: exenv.h:46
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:81
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
static int nproc()
The number of processors on this node.
Definition: exenv.h:92
static void init(int &argcref, char **&argvref)
Set the argument count and vector.
Generated at Sun Jan 26 2020 23:24:01 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.