AFLOW
 
Loading...
Searching...
No Matches
aflow_xhost.h
Go to the documentation of this file.
1// ***************************************************************************
2// * *
3// * Aflow STEFANO CURTAROLO - Duke University 2003-2024 *
4// * *
5// ***************************************************************************
6
7#ifndef AUROSTD_XHOST_H
8#define AUROSTD_XHOST_H
9
10#include <sstream>
11#include <string>
12#include <sys/types.h>
13#include <vector>
14
16
17#define XPID XHOST.sPID
18#define XPGID XHOST.sPGID
19#define XTID XHOST.sTID
20
21#define XHOST_vGlobal_MAX 256
22#define XHOST_aflowlib_icsd XHOST.vGlobal_string.at(23)
23#define XHOST_aflowlib_lib0 XHOST.vGlobal_string.at(24)
24#define XHOST_aflowlib_lib1 XHOST.vGlobal_string.at(25)
25#define XHOST_aflowlib_lib2 XHOST.vGlobal_string.at(26)
26#define XHOST_aflowlib_lib3 XHOST.vGlobal_string.at(27)
27#define XHOST_aflowlib_lib4 XHOST.vGlobal_string.at(28)
28#define XHOST_aflowlib_lib5 XHOST.vGlobal_string.at(29)
29#define XHOST_aflowlib_lib6 XHOST.vGlobal_string.at(30)
30#define XHOST_aflowlib_lib7 XHOST.vGlobal_string.at(31)
31#define XHOST_aflowlib_lib8 XHOST.vGlobal_string.at(32)
32#define XHOST_aflowlib_lib9 XHOST.vGlobal_string.at(33)
33//#define XHOST_AUID XHOST.vGlobal_string.at(34)
34//#define XHOST_AURL XHOST.vGlobal_string.at(35)
35//#define XHOST_LOOP XHOST.vGlobal_string.at(36)
36#define XHOST_Library_ICSD_ALL XHOST.vGlobal_string.at(38)
37// string Library_ICSD_ALL; // the complete library
38
39#define XHOST_vLIBS XHOST.vvLIBS
40#define XHOST_vAURL XHOST.vvLIBS.at(0)
41#define XHOST_vAUID XHOST.vvLIBS.at(1)
42#define XHOST_vLOOP XHOST.vvLIBS.at(2)
43#define XHOST_LIBRARY_JSONL XHOST.vGlobal_string.at(3)
44
45#define vVASP_POTCAR_DIRECTORIES XHOST.vvGlobal_string.at(4)
46#define vAFLOW_LIBRARY_DIRECTORIES XHOST.vvGlobal_string.at(5)
47#define vAFLOW_PROJECTS_DIRECTORIES XHOST.vvGlobal_string.at(6)
48#define XHOST_vLibrary_ICSD XHOST.vvGlobal_string.at(7)
49#define XHOST_vLibrary_ICSD_ALL XHOST.vvGlobal_string.at(8)
50#define XHOST_Library_CALCULATED_ICSD_LIB XHOST.vvGlobal_string.at(9)
51#define XHOST_Library_CALCULATED_ICSD_RAW XHOST.vvGlobal_string.at(10)
52#define XHOST_Library_CALCULATED_LIB0_LIB XHOST.vvGlobal_string.at(11)
53#define XHOST_Library_CALCULATED_LIB0_RAW XHOST.vvGlobal_string.at(12)
54#define XHOST_Library_CALCULATED_LIB1_LIB XHOST.vvGlobal_string.at(13)
55#define XHOST_Library_CALCULATED_LIB1_RAW XHOST.vvGlobal_string.at(14)
56#define XHOST_Library_CALCULATED_LIB2_LIB XHOST.vvGlobal_string.at(15)
57#define XHOST_Library_CALCULATED_LIB2_RAW XHOST.vvGlobal_string.at(16)
58#define XHOST_Library_CALCULATED_LIB3_LIB XHOST.vvGlobal_string.at(17)
59#define XHOST_Library_CALCULATED_LIB3_RAW XHOST.vvGlobal_string.at(18)
60#define XHOST_Library_CALCULATED_LIB4_LIB XHOST.vvGlobal_string.at(19)
61#define XHOST_Library_CALCULATED_LIB4_RAW XHOST.vvGlobal_string.at(20)
62#define XHOST_Library_CALCULATED_LIB5_LIB XHOST.vvGlobal_string.at(21)
63#define XHOST_Library_CALCULATED_LIB5_RAW XHOST.vvGlobal_string.at(22)
64#define XHOST_Library_CALCULATED_LIB6_LIB XHOST.vvGlobal_string.at(23)
65#define XHOST_Library_CALCULATED_LIB6_RAW XHOST.vvGlobal_string.at(24)
66#define XHOST_Library_CALCULATED_LIB7_LIB XHOST.vvGlobal_string.at(25)
67#define XHOST_Library_CALCULATED_LIB7_RAW XHOST.vvGlobal_string.at(26)
68#define XHOST_Library_CALCULATED_LIB8_LIB XHOST.vvGlobal_string.at(27)
69#define XHOST_Library_CALCULATED_LIB8_RAW XHOST.vvGlobal_string.at(28)
70#define XHOST_Library_CALCULATED_LIB9_LIB XHOST.vvGlobal_string.at(29)
71#define XHOST_Library_CALCULATED_LIB9_RAW XHOST.vvGlobal_string.at(30)
72
73// vector<string> vLibrary_ICSD; // ordered by #species
74// vector<string> vLibrary_ICSD_ALL; // line by line
75
76// all the at(N) need to be sequetial !!!
77#define XHOST_ElectronStoppingPower_txt XHOST.vGlobal_string.at(82)
78#define XHOST_PhotonCrossSection_txt XHOST.vGlobal_string.at(83)
79#define XHOST_PhotonStoppingPower_txt XHOST.vGlobal_string.at(84)
80#define XHOST_ICSD_List_txt XHOST.vGlobal_string.at(85)
81#define XHOST_AFLOW_PSEUDOPOTENTIALS XHOST.vGlobal_string.at(86)
82#define XHOST_AFLOW_PSEUDOPOTENTIALS_TXT XHOST.vGlobal_string.at(87)
83#define XHOST_AFLOW_PSEUDOPOTENTIALS_LIST_TXT XHOST.vGlobal_string.at(88)
84#define XHOST_f144468a7ccc2d3a72ba44000715efdb XHOST.vGlobal_string.at(90)
85
86// LOADENTRIES DEFAULTS
87#define _AFLOW_LIB_MAX_ 10 //LIB11 does not exist yet, modify accordingly
88
89#define XHOST_LIBRARY_LIB0 XHOST.vGlobal_uint.at(0)
90#define XHOST_LIBRARY_LIB1 XHOST.vGlobal_uint.at(1)
91#define XHOST_LIBRARY_LIB2 XHOST.vGlobal_uint.at(2)
92#define XHOST_LIBRARY_LIB3 XHOST.vGlobal_uint.at(3)
93#define XHOST_LIBRARY_LIB4 XHOST.vGlobal_uint.at(4)
94#define XHOST_LIBRARY_LIB5 XHOST.vGlobal_uint.at(5)
95#define XHOST_LIBRARY_LIB6 XHOST.vGlobal_uint.at(6)
96#define XHOST_LIBRARY_LIB7 XHOST.vGlobal_uint.at(7)
97#define XHOST_LIBRARY_LIB8 XHOST.vGlobal_uint.at(8)
98#define XHOST_LIBRARY_LIB9 XHOST.vGlobal_uint.at(9)
99#define XHOST_LIBRARY_ICSD XHOST.vGlobal_uint.at(10)
100#define XHOST_LIBRARY_AUID XHOST.vGlobal_uint.at(11)
101
102// --------------------------------------------------------------------------
103// this is a container of general global choices
104class _XHOST {
105 public:
106 // constructor destructor // constructor/destructor
107 _XHOST(); // default, just allocate
108 ~_XHOST(); // kill everything
109 // _XHOST(const _XHOST& b); // constructor copy
110 const _XHOST& operator=(const _XHOST &b); // copy
111 // BOOT
112 int PGID,PID,TID; // aflow_init.cpp PID/TID number //CO20200508 //SD20220329 PGID number
113 std::ostringstream ostrPGID,ostrPID,ostrTID; // aflow_init.cpp PID/TID in ostringstream... //CO20200508
114 std::string sPGID,sPID,sTID; // aflow_init.cpp [PID=12345678] [TID=12345678]
115 bool showPGID,showPID,showTID; // aflow_init.cpp check if --showPID
116 // machinery
117 bool QUIET; //CO20220630 - can be overridden by LOGGER_WHITELIST/_BLACKLIST, modifiable within functions
118 bool QUIET_GLOBAL; //CO20220630 - exclusively for --quiet (headless server), do not set/unset inside code (GLOBAL SILENCE)
119 bool QUIET_CERR; //CO20220630 - silences cerr exclusively // extra quiet SC20210617
120 bool QUIET_COUT; //CO20220630 - silences cout exclusively // extra quiet SC20210617
122 std::vector<std::string> LOGGER_WHITELIST; //HE+ME20220305 - for logging
123 std::vector<std::string> LOGGER_BLACKLIST; //HE+ME20220305 - for logging
124 bool GENERATE_AFLOWIN_ONLY; //CT20180719
125 bool POSTPROCESS; //CO20200624 - generic postprocessing, including --lib2raw and --lib2lib
126 bool ARUN_POSTPROCESS; //CT20181212 - this is for the --postprocess flag needed for AEL/AGL, can be extended to other modules too
127 bool AVOID_RUNNING_VASP; //CO20200624
128 bool PSEUDOPOTENTIAL_GENERATOR; //SC20200327
129 // HARDWARE/SOFTWARE
131 std::string Find_Parameters;
133 // ARGUMENTS
134 std::vector<std::string> argv; // argv of line command
135 // SERVERS
137 long double RAM,RAM_MB,RAM_GB;
139 int CPU_active; //ME20220130
140 std::string CPU_Model;
141 std::string CPU_MHz;
142 std::vector<double> vTemperatureCore;
144 long int Date;
145 std::string Day,Month,Year;
146 std::string Copyright_Years; // =string("2003-YEAR_FROM_DATE");
147 // MULTHREADS
148 // bool PTHREADS_FLAG; // run pthread YES/NO
149 // int PTHREADS_MAX; // how many MAX threads I can use default or --np
150 // int PTHREADS_RUNNING; // how many threads are actually running
151 // vector<pthread_t> thread; // the actual thread
152 // vector<int> iret; // the thread runnings
153 // vector<bool> thread_busy; // is the thread busy
154 // COMMANDS
155 std::vector<std::string> vcmd;
156 // RAM CHECK
157 double maxmem;
158 // FUNCTIONS
159 std::string command(const std::string& command);
160 bool is_command(const std::string& command);
161 // AFLOW STUFF
162 // vflag_aflow.flag("LOOP");
163 // vflag_aflow.flag("CLEAN");
164 // vflag_aflow.isflag*"XCLEAN");
169 // QUEQUE STUFF
172 bool is_MACHINE_FULTON_MARYLOU; // some flags
173 // Library_CALCULATED*
174 std::vector<uint> vGlobal_uint; // parameters uint
175 std::vector<std::string> vGlobal_string; // parameters as strings
176 std::vector<std::vector<std::string> > vvGlobal_string; // parameters as vector strings
177 std::vector<std::vector<std::string> > vvLIBS; // parameters as vector strings
178 // vector<string> vLibrary_ICSD; // ordered by #species (needs to be allocated)
179 // vector<string> vLibrary_ICSD_ALL; // line by line
180 // string Library_ICSD_ALL; // the complete library
181 // vector<string> vVASP_POTCAR_DIRECTORIES;
182 // vector<string> vAFLOW_LIBRARY_DIRECTORIES;
183 // vector<string> vAFLOW_PROJECTS_DIRECTORIES;
184 // AFLOW flags/options
185 aurostd::xoption vflag_aflow; // argv/argc options following the xoption structure
186 aurostd::xoption vflag_pflow; // argv/argc options following the xoption structure
187 aurostd::xoption vflag_outreach; // argv/argc options following the xoption structure
188 aurostd::xoption vflag_control; // argv/argc options following the xoption structure
189 aurostd::xoption vschema; // keywords, names, units etc etc
191 // USUAL COMMANDS
192 std::vector<std::string> vcat; // cat, bzcat, xzcat, gzcat
193 std::vector<std::string> vext; // "", .bz2, .xz, .gz
194 std::vector<std::string> vzip; // "", bzip2, xz, gzip
195 // AFLOWRC
196 std::string aflowrc_filename;
197 std::string aflowrc_content;
198 std::vector<std::string> vaflowrc;
199 aurostd::xoption adefault; // default xoption
200 // AFLOWSYM
201 bool SKEW_TEST; //DX20171019
202 double SKEW_TOL; //DX20171019
203 // xstructure
204 bool READ_SPIN_FROM_ATOMLABEL; //SD20220316
205 // WEB MODE
206 //[CO20200404 - overload with --www]bool WEB_MODE; //CO20190401
207 private: //
208 void free(); // free space
209 void copy(const _XHOST& b); //
210 void clear(); // free space
211};
212
213// max is 128
214extern _XHOST XHOST; // this will be global
215
216#endif //AUROSTD_XHOST_H
_XHOST XHOST
unsigned uint
Definition aurostd.h:39
std::vector< uint > vGlobal_uint
bool AVOID_RUNNING_VASP
std::vector< std::string > vaflowrc
std::string group
std::vector< double > vTemperatureCore
std::vector< std::vector< std::string > > vvLIBS
std::string aflowrc_filename
std::string hostname
std::string aflowrc_content
bool QUIET_CERR
int PBS_NNODES
std::string user
double SKEW_TOL
int CPU_Cores
const _XHOST & operator=(const _XHOST &b)
bool READ_SPIN_FROM_ATOMLABEL
std::vector< std::string > LOGGER_WHITELIST
std::vector< std::vector< std::string > > vvGlobal_string
std::vector< std::string > argv
std::ostringstream ostrPID
std::string sPID
uint AFLOW_RUNXnumber
std::string shell
std::string command(const std::string &command)
bool QUIET_GLOBAL
std::string Day
bool AFLOW_RUNXflag
bool is_SLURM
void copy(const _XHOST &b)
int SLURM_NTASKS
bool ARUN_POSTPROCESS
std::vector< std::string > vzip
long int Date
std::string progname
aurostd::xoption adefault
aurostd::xoption vflag_aflow
bool is_command(const std::string &command)
bool sensors_allowed
std::string Month
bool PSEUDOPOTENTIAL_GENERATOR
aurostd::xoption vflag_outreach
bool GENERATE_AFLOWIN_ONLY
std::vector< std::string > LOGGER_BLACKLIST
std::ostringstream ostrTID
int PBS_NUM_PPN
std::ostringstream ostrPGID
long double RAM_MB
bool POSTPROCESS
std::string AFLOW_MATERIALS_SERVER
int SLURM_CPUS_ON_NODE
aurostd::xoption vschema
std::string Find_Parameters
std::string home
int CPU_active
std::string sTID
aurostd::xoption vschema_internal
long double RAM
bool showTID
aurostd::xoption vflag_control
long double Time_starting
void free()
bool SKEW_TEST
std::string Copyright_Years
std::vector< std::string > vext
bool is_PBS
std::string CPU_MHz
bool DEBUG
bool AFLOW_MULTIflag
std::string machine_type
std::string Year
std::string tmpfs
long double RAM_GB
std::string sPGID
std::string AFLOW_WEB_SERVER
double maxmem
bool MPI
std::string CPU_Model
aurostd::xoption vflag_pflow
std::vector< std::string > vGlobal_string
long double Time_now
bool showPGID
bool QUIET_COUT
int SLURM_NNODES
void clear()
std::vector< std::string > vcat
bool QUIET
bool showPID
bool is_MACHINE_FULTON_MARYLOU
bool TEST
std::vector< std::string > vcmd
bool AFLOW_RUNDIRflag