Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cpu.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2023 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef CPU_H_
5 #define CPU_H_
6 
9 #define UNUSED /*@unused@*/
10 #ifdef __GNUC__
11 #undef UNUSED
12 #define UNUSED __attribute__ ((unused)) /*@unused@*/
13 #endif
14 
16 #ifndef INT8_MAX
17 # define INT8_MAX 127
18 #endif
19 #ifndef INT8_MIN
20 # define INT8_MIN (-INT8_MAX - 1)
21 #endif
22 
23 #if SCHAR_MAX == INT8_MAX
24  typedef signed char int8;
25 #else
26 # error "failed to define int8, please report this to gary@uky.edu"
27 #endif
28 
29 #ifndef UINT8_MAX
30 # define UINT8_MAX 255
31 #endif
32 
33 #if UCHAR_MAX == UINT8_MAX
34  typedef unsigned char uint8;
35 #else
36 # error "failed to define uint8, please report this to gary@uky.edu"
37 #endif
38 
39 #ifndef INT16_MAX
40 # define INT16_MAX 32767
41 #endif
42 #ifndef INT16_MIN
43 # define INT16_MIN (-INT16_MAX - 1)
44 #endif
45 
46 #if SHRT_MAX == INT16_MAX
47  typedef short int int16;
48 #elif INT_MAX == INT16_MAX
49  typedef int int16;
50 #else
51 # error "failed to define int16, please report this to gary@uky.edu"
52 #endif
53 
54 #ifndef UINT16_MAX
55 # define UINT16_MAX 65535
56 #endif
57 
58 #if USHRT_MAX == UINT16_MAX
59  typedef unsigned short int uint16;
60 #elif UINT_MAX == UINT16_MAX
61  typedef unsigned int uint16;
62 #else
63 # error "failed to define uint16, please report this to gary@uky.edu"
64 #endif
65 
66 #ifndef INT32_MAX
67 # define INT32_MAX 2147483647L
68 #endif
69 #ifndef INT32_MIN
70 # define INT32_MIN (-INT32_MAX - 1)
71 #endif
72 
73 #if INT_MAX == INT32_MAX
74  typedef int int32;
75 #elif LONG_MAX == INT32_MAX
76  typedef long int int32;
77 #else
78 # error "failed to define int32, please report this to gary@uky.edu"
79 #endif
80 
81 #ifndef UINT32_MAX
82 # define UINT32_MAX 4294967295UL
83 #endif
84 
85 #if UINT_MAX == UINT32_MAX
86  typedef unsigned int uint32;
87 #elif ULONG_MAX == UINT32_MAX
88  typedef unsigned long int uint32;
89 #else
90 # error "failed to define uint32, please report this to gary@uky.edu"
91 #endif
92 
93 #ifndef INT64_MAX
94 # define INT64_MAX 9223372036854775807LL
95 #endif
96 #ifndef INT64_MIN
97 # define INT64_MIN (-INT64_MAX - 1)
98 #endif
99 
100 #if LONG_MAX == INT64_MAX
101  typedef long int int64;
102 #elif LLONG_MAX == INT64_MAX
103  typedef long long int int64;
104 #else
105 # error "failed to define int64, please report this to gary@uky.edu"
106 #endif
107 
108 #ifndef UINT64_MAX
109 # define UINT64_MAX 18446744073709551615ULL
110 #endif
111 
112 #if ULONG_MAX == UINT64_MAX
113  typedef unsigned long int uint64;
114 #elif ULLONG_MAX == UINT64_MAX
115  typedef unsigned long long int uint64;
116 #else
117 # error "failed to define uint64, please report this to gary@uky.edu"
118 #endif
119 
120 #ifdef __AVX__
121 # ifdef __AVX512F__
122 # define CD_ALIGN 64
123 # else
124 # define CD_ALIGN 32
125 # endif
126 #else
127 # define CD_ALIGN 16
128 #endif
129 
130 #ifdef _MSC_VER
131 // posix_memalign not defined on windows
132 inline int posix_memalign(void **p, size_t a, size_t s)
133 {
134  *p = _aligned_malloc(s, a);
135  return ( *p == NULL ) ? errno : 0;
136 }
137 
138 inline void posix_memalign_free(void *p)
139 {
140  _aligned_free(p);
141 }
142 #else
143 inline void posix_memalign_free(void *p)
144 {
145  free(p);
146 }
147 #endif
148 
170 #ifdef cray
171 #ifndef __cray
172 #define __cray 1
173 #endif
174 #endif
175 
177 #ifdef __x86_64
178 #ifndef __amd64
179 #define __amd64 1
180 #endif
181 #endif
182 
183 #if defined(_ARCH_PPC) || defined(__POWERPC__) || defined(__powerpc__) || defined(PPC)
184 #ifndef __ppc__
185 #define __ppc__ 1
186 #endif
187 #endif
188 
194 #if defined(unix) || defined(__unix__)
195 #ifndef __unix
196 #define __unix 1
197 #endif
198 #endif
199 
200 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
201 #define __AnyBSD__ 1
202 #endif
203 
205 #if defined(linux) || defined(__linux)
206 #ifndef __linux__
207 #define __linux__ 1
208 #endif
209 #endif
210 
212 #ifdef __ECC
213 #ifndef __ICC
214 #define __ICC __ECC
215 #endif
216 #endif
217 
219 #undef __GNUC_EXCL__
220 #if defined(__GNUC__) && ! ( defined(__ICC) || defined(__PATHSCALE__) || defined(__OPENCC__) || defined(__clang__) )
221 #define __GNUC_EXCL__ 1
222 #endif
223 
224 #undef SIGNAL_HANDLER
225 #if defined(__linux) || defined(__APPLE__) || (defined(__CYGWIN__) && !defined(__CYGWIN32__))
226 #define SIGNAL_HANDLER 1
227 #endif
228 
229 /* safe, small, numbers for the float and double */
232 /*FLT_MAX is 3.40e38 on wintel, so BIGFLOAT is 3.40e36 */
236 
238 const double BIGDOUBLE = DBL_MAX/100.;
239 const double SMALLDOUBLE = DBL_MIN*100.;
240 
241 const int STDLEN = 32;
242 
259 
260 // the C++ openmodes below give the exact equivalent of the C modes "r", "w", "a", etc.
261 // the "+" sign in the C mode has been replaced by "p", so, e.g., mode_rpb is equivalent to "r+b"
262 const ios_base::openmode mode_r = ios_base::in;
263 const ios_base::openmode mode_w = ios_base::out | ios_base::trunc;
264 const ios_base::openmode mode_a = ios_base::out | ios_base::app;
265 const ios_base::openmode mode_rp = ios_base::in | ios_base::out;
266 const ios_base::openmode mode_wp = ios_base::in | ios_base::out | ios_base::trunc;
267 const ios_base::openmode mode_ap = ios_base::in | ios_base::out | ios_base::app;
268 
269 const ios_base::openmode UNUSED mode_rb = mode_r | ios_base::binary;
270 const ios_base::openmode UNUSED mode_wb = mode_w | ios_base::binary;
271 const ios_base::openmode UNUSED mode_ab = mode_a | ios_base::binary;
272 const ios_base::openmode UNUSED mode_rpb = mode_rp | ios_base::binary;
273 const ios_base::openmode UNUSED mode_wpb = mode_wp | ios_base::binary;
274 const ios_base::openmode UNUSED mode_apb = mode_ap | ios_base::binary;
275 
276 #include "mpi_utilities.h"
277 
278 FILE* open_data( const string& fname, const string& mode, access_scheme scheme=AS_DEFAULT, string* rpath=nullptr );
279 void open_data( fstream& stream, const string& fname, ios_base::openmode mode, access_scheme scheme=AS_DEFAULT,
280  string* rpath=nullptr );
281 MPI_File open_data( const string& fname, int mode, access_scheme scheme=AS_DEFAULT, string* rpath=nullptr );
282 void check_data( const string& fpath, const string& fname );
283 
284 /* this class is deliberately kept global so that the constructor is executed before
285  * any of the user code; this assures a correct FP environment right from the start */
286 class t_cpu_i
287 {
290  union
291  {
292  char c[4];
293  int32 i;
294  } endian;
295 
297  double test_double;
298 
301 
302 # ifdef SIGNAL_HANDLER
303  struct sigaction p_action;
304  struct sigaction p_default;
305 # endif
306 
310  long n_use_CPU;
312  bool p_lgMPI;
319  long n_rank;
321  string p_ExecName;
323  vector<string> chTraceback;
327  vector<string> chSearchPath;
337  map<string,string> checksum_expct;
341  void p_assertValidPath();
344 
345  void enable_traps() const;
346  static void signal_handler(int sig, siginfo_t*, void* ptr);
347 
348  vector<string> p_exit_status;
349 
350  void getPathList( const string& fname, vector<string>& PathList, access_scheme scheme, bool lgRead ) const;
351  void getchecksums( const string& fname );
352 public:
353  t_cpu_i();
354 
355  bool big_endian() const { return ( endian.i == 0x12345678 ); }
356  bool little_endian() const { return ( endian.i == 0x78563412 ); }
357 
358  sys_float min_float() const { return test_float; }
359  double min_double() const { return test_double; }
360 
361 # ifdef SIGNAL_HANDLER
362  const struct sigaction* action() const { return &p_action; }
363  const struct sigaction* deflt() const { return &p_default; }
364 # endif
365 
366  void set_signal_handlers();
367 
368  void set_nCPU(long n) { n_avail_CPU = n; }
369  long nCPU() const { return n_avail_CPU; }
370  void set_used_nCPU(long n) { n_use_CPU = n; }
371  long used_nCPU() const { return n_use_CPU; }
372  bool lgMPI() const { return p_lgMPI; }
373  void set_MPIMode( MPI_state mode ) { p_MPIMode = mode; }
374  MPI_state MPIMode() const { return p_MPIMode; }
375  void set_nRANK(long n) { n_rank = n; }
376  long nRANK() const { return n_rank; }
377  bool lgMaster() const { return ( n_rank == 0 ); }
378  bool lgMPI_talk() const { return lgMaster() || p_MPIMode == MS_GRID; }
379  void set_ExecName(const string& name) { p_ExecName = name; }
382  void GenerateBacktrace(void* ptr);
383  void PrintBacktrace(const string& s, bool lgPrintSeed = true);
384  const string& ExecName() const { return p_ExecName; }
385  const char *host_name() const { return HostName; }
386  void printDataPath() const;
387  string chDirSeparator() const { return string(1,p_chDirSeparator); }
388  void appendDirSeparator(char *path) const
389  {
390  size_t i = strlen(path);
391  path[i++] = p_chDirSeparator;
392  path[i] = '\0';
393  }
394  bool firstOpen() const { return ( nFileDone == 0 ); }
395  bool foundCSMismatch() const { return ( nCSMismatch > 0 ); }
396  const string& chExitStatus(exit_type s) const { return p_exit_status[s]; }
397 
398  void initPath();
399  friend FILE* open_data( const string& fname, const string& mode, access_scheme scheme, string* rpath );
400  friend void open_data( fstream& stream, const string& fname, ios_base::openmode mode, access_scheme scheme,
401  string* rpath );
402  friend MPI_File open_data( const string& fname, int mode, access_scheme scheme, string* rpath );
403  friend void check_data( const string& fpath, const string& fname );
404 
405  friend void set_NaN(sys_float &x);
406  friend void set_NaN(sys_float x[], long n);
407  friend void set_NaN(double &x);
408  friend void set_NaN(double x[], long n);
409 };
410 class t_cpu
411 {
412  static t_cpu_i *m_i;
413 public:
415  {
416  return *m_i;
417  }
418  t_cpu();
419  ~t_cpu();
420 };
421 // Generate a (static) instance of this variable in *every* file.
422 static t_cpu cpu;
423 
424 // The static (class) pointer is set in the first of these. Obviously
425 // this is not thread safe...
426 
427 // Better engineered variants are available in Alexandrescu's book;
428 // better yet to reduce the number of globals and file-statics so
429 // this can just be initialized at the start of main().
430 
432 void set_NaN(sys_float &x);
433 void set_NaN(sys_float x[], /* x[n] */
434  long n);
435 void set_NaN(double &x);
436 void set_NaN(double x[], /* x[n] */
437  long n);
438 
440 bool MyIsnan(const sys_float &x);
441 bool MyIsnan(const double &x);
442 
443 // class for detecting if two types are the same, can also be used in static_assert():
444 // static_assert( SameType<decltype(var), bool>::value, "type of var must be bool" );
445 template<class T1, class T2> struct SameType
446 {
447  static const bool value = false;
448 };
449 template<class T> struct SameType<T,T>
450 {
451  static const bool value = true;
452 };
453 
454 /* Apply compiler directive saying that current routine does not
455  return as modifier, as in "NORETURN void MyExit() { ... }" */
456 #ifdef _MSC_VER
457 #define NORETURN __declspec(noreturn) /*@noreturn@*/
458 #elif defined(__GNUC__) || ( defined(__INTEL_COMPILER) && defined(__linux__) || defined(__SUNPRO_CC) )
459 #define NORETURN __attribute__ ((noreturn)) /*@noreturn@*/
460 #else
461 #define NORETURN /*@noreturn@*/
462 #endif
463 
464 #define FALLTHROUGH (void)0
465 #ifdef __GNUC_EXCL__
466 #if (__GNUC__ >= 7)
467 #undef FALLTHROUGH
468 #define FALLTHROUGH __attribute__ ((fallthrough))
469 #endif
470 #endif
471 
472 #ifdef _MSC_VER
473 #define ALIGNED(X) __declspec(align(X))
474 #else
475 #define ALIGNED(X) __attribute__ ((aligned(X)))
476 #endif
477 
478 #define RESTRICT
479 #define LIKELY(x) (x)
480 #ifdef __GNUC__
481 #if (__GNUC__ >= 3)
482 #undef LIKELY
483 #define LIKELY(x) __builtin_expect((x),1)
484 #endif
485 #undef RESTRICT
486 #define RESTRICT __restrict
487 #else
488 #endif
489 
490 #define UNLIKELY(x) (x)
491 #ifdef __GNUC__
492 #if (__GNUC__ >= 3)
493 #undef UNLIKELY
494 #define UNLIKELY(x) __builtin_expect((x),0)
495 #endif
496 #endif
497 
498 /* Some hackery needed to test if a preprocessor macro is empty. Use as follows:
499  * #if EXPAND(SOME_DODGY_MACRO) == 1
500  * get here if SOME_DODGY_MACRO expands to empty string
501  * #endif */
502 #define DO_EXPAND(VAL) VAL ## 1
503 #define EXPAND(VAL) DO_EXPAND(VAL)
504 
505 /* Define __COMP and __COMP_VER macros for all systems */
506 /* the Intel compiler */
507 /* this needs to be before g++ since icc also sets __GNUC__ */
508 #if defined __INTEL_COMPILER
509 # define __COMP "icc"
510 # define __COMP_VER __INTEL_COMPILER
511 
512 /* PathScale EKOPath compiler */
513 /* this needs to be before g++ since pathCC also sets __GNUC__ */
514 #elif defined __PATHSCALE__
515 # define __COMP "pathCC"
516 # define __COMP_VER __PATHCC__ * 100 + __PATHCC_MINOR__ * 10 + __PATHCC_PATCHLEVEL__
517 
518 /* Open64 compiler */
519 /* this needs to be before g++ since openCC also sets __GNUC__ */
520 #elif defined __OPENCC__
521 # define __COMP "Open64"
522 # if EXPAND(__OPENCC_PATCHLEVEL__) == 1
523 # define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10
524 # else
525 # define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10 + __OPENCC_PATCHLEVEL__
526 # endif
527 
528 /* LLVM clang++ */
529 /* this needs to be before g++ since clang++ also sets __GNUC__ */
530 #elif defined __clang__
531 # define __COMP "clang++"
532 # define __COMP_VER __clang_major__ * 100 + __clang_minor__ * 10 + __clang_patchlevel__
533 
534 /* g++ */
535 #elif defined __GNUC__
536 # define __COMP "g++"
537 # if defined(__GNUC_PATCHLEVEL__)
538 # define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
539 # else
540 # define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
541 # endif
542 
543 #elif defined __PGI
544 # define __COMP "Portland Group"
545 # if defined(__PGIC__)
546 # define __COMP_VER (__PGIC__ * 100 + __PGIC_MINOR__ * 10 + __PGIC_PATCHLEVEL__)
547 # else
548 # define __COMP_VER 0
549 # endif
550 
551 /* SGI MIPSpro */
552 /* this needs to be after g++, since g++ under IRIX also sets _COMPILER_VERSION */
553 #elif defined(__sgi) && defined(_COMPILER_VERSION)
554 # define __COMP "MIPSpro"
555 # define __COMP_VER _COMPILER_VERSION
556 
557 /* HP */
558 #elif defined __HP_aCC
559 # define __COMP "HP aCC"
560 # define __COMP_VER __HP_aCC
561 
562 /* DEC - this one may be broken for C++, no way to test it... */
563 #elif defined __DECC
564 # define __COMP "DEC CC"
565 # define __COMP_VER __DECC_VER
566 
567 /* MS VS */
568 #elif defined _MSC_VER
569 # define __COMP "vs"
570 # define __COMP_VER _MSC_VER
571 
572 /* Oracle Solaris Studio */
573 #elif defined __SUNPRO_CC
574 # define __COMP "Solaris Studio"
575 # define __COMP_VER __SUNPRO_CC
576 
577 /* unknown */
578 #else
579 # define __COMP "unknown"
580 # define __COMP_VER 0
581 #endif
582 
583 /* ---------------------------- OS ---------------------------- */
584 /* linux */
585 #if defined __linux__
586 # if defined __i386
587 # define __OS "Linux (IA32)"
588 # elif defined __amd64
589 # define __OS "Linux (AMD64)"
590 # elif defined __ia64
591 # define __OS "Linux (IA64)"
592 # elif defined __ppc__
593 # define __OS "Linux (PowerPC)"
594 # else
595 # define __OS "Linux (other)"
596 # endif
597 
598 /* macintosh */
599 #elif defined macintosh
600 # define __OS "Mac OS 9"
601 
602 /* macintosh */
603 #elif defined __MACOSX__
604 # define __OS "Mac OS X"
605 
606 /* apple mac, ... */
607 #elif defined __APPLE__
608 # define __OS "Apple MacOS"
609 
610 /* HP */
611 #elif defined hpux
612 # define __OS "HP-UX"
613 
614 /* Oracle Solaris */
615 #elif defined __sun
616 # define __OS "Solaris"
617 
618 /* IBM AIX */
619 #elif defined _AIX
620 # define __OS "AIX"
621 
622 /* Compaq alpha */
623 #elif defined ultrix
624 # define __OS "Ultrix"
625 
626 /* the BSD variants */
627 #elif defined __FreeBSD__
628 # define __OS "FreeBSD"
629 
630 #elif defined __NetBSD__
631 # define __OS "NetBSD"
632 
633 #elif defined __OpenBSD__
634 # define __OS "OpenBSD"
635 
636 /* Windows64 */
637 /* this needs to be before _WIN32 since Windows64 also sets _WIN32 */
638 #elif defined _WIN64
639 # define __OS "Win64"
640 
641 /* Windows */
642 #elif defined _WIN32
643 # define __OS "Win32"
644 
645 /* Cygwin */
646 #elif defined __CYGWIN__
647 # define __OS "Cygwin"
648 
649 /* SGI */
650 #elif defined __sgi
651 # define __OS "IRIX"
652 
653 /* unknown */
654 #else
655 # define __OS "unknown"
656 #endif
657 
658 /* don't perform this check when we are generating dependencies */
659 #ifndef MM
660 /* bomb out if the compiler does not support C++11.... */
661 # if defined(__GNUC_EXCL__) && ((__GNUC__ < 4 ) || \
662  (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || \
663  (__GNUC__ == 4 && __GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ == 0))
664 # error "This version of g++ cannot compile Cloudy! Version 4.8.1 or later is required. See http://wiki.nublado.org/wiki/CompileCode for more details."
665 # endif
666 
667 # if defined(__clang_major__) && ((__clang_major__ < 3 ) || \
668  (__clang_major__ == 3 && __clang_minor__ < 3))
669 # error "This version of clang++ cannot compile Cloudy! Version 3.3 or later is required. See http://wiki.nublado.org/wiki/CompileCode for more details."
670 # endif
671 
672 # if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1500
673 # error "This version of icc cannot compile Cloudy! Version 15.0 or later is required. See http://wiki.nublado.org/wiki/CompileCode for more details."
674 # endif
675 
676 # if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
677 # error "This version of CC cannot compile Cloudy! Version 12.5 or later is required. See http://wiki.nublado.org/wiki/CompileCode for more details."
678 # endif
679 #endif
680 
681 #endif /* CPU_H_ */
long nRANK() const
Definition: cpu.h:376
Definition: cpu.h:445
long n_rank
Definition: cpu.h:319
const ios_base::openmode mode_wp
Definition: cpu.h:266
Definition: cpu.h:257
const string & ExecName() const
Definition: cpu.h:384
int nCSMismatch
Definition: cpu.h:335
void set_used_nCPU(long n)
Definition: cpu.h:370
void set_NaN(sys_float &x)
Definition: cpu.cpp:871
double test_double
Definition: cpu.h:297
const double BIGDOUBLE
Definition: cpu.h:238
union t_cpu_i::@4 endian
friend void set_NaN(sys_float &x)
Definition: cpu.cpp:871
vector< string > chTraceback
Definition: cpu.h:323
MPI_state
Definition: mpi_utilities.h:7
const realnum SMALLFLOAT
Definition: cpu.h:235
map< string, string > checksum_expct
Definition: cpu.h:337
t_cpu_i & i()
Definition: cpu.h:414
FILE * open_data(const string &fname, const string &mode, access_scheme scheme=AS_DEFAULT, string *rpath=nullptr)
Definition: cpu.cpp:722
void disableBacktrace()
Definition: cpu.h:380
bool MyIsnan(const sys_float &x)
Definition: cpu.cpp:925
const double SMALLDOUBLE
Definition: cpu.h:239
MPI_state MPIMode() const
Definition: cpu.h:374
access_scheme
Definition: cpu.h:257
friend FILE * open_data(const string &fname, const string &mode, access_scheme scheme, string *rpath)
Definition: cpu.cpp:722
Definition: cpu.h:286
const ios_base::openmode UNUSED mode_wb
Definition: cpu.h:270
const int STDLEN
Definition: cpu.h:241
void GenerateBacktrace(void *ptr)
Definition: cpu.cpp:1178
static t_cpu_i * m_i
Definition: cpu.h:412
long used_nCPU() const
Definition: cpu.h:371
static void signal_handler(int sig, siginfo_t *, void *ptr)
Definition: cpu.cpp:535
void * MPI_File
Definition: mpi_utilities.h:74
const ios_base::openmode UNUSED mode_rpb
Definition: cpu.h:272
bool big_endian() const
Definition: cpu.h:355
void enableBacktrace()
Definition: cpu.h:381
void set_nRANK(long n)
Definition: cpu.h:375
double min_double() const
Definition: cpu.h:359
char HostName[STDLEN]
Definition: cpu.h:325
bool p_suppressBacktrace
Definition: cpu.h:343
exit_type
Definition: cddefines.h:151
void set_MPIMode(MPI_state mode)
Definition: cpu.h:373
Definition: cpu.h:257
static const bool value
Definition: cpu.h:447
bool little_endian() const
Definition: cpu.h:356
~t_cpu()
Definition: cpu.cpp:62
void PrintBacktrace(const string &s, bool lgPrintSeed=true)
Definition: cpu.cpp:1185
Definition: cpu.h:258
void check_data(const string &fpath, const string &fname)
Definition: cpu.cpp:838
long n_avail_CPU
Definition: cpu.h:308
const ios_base::openmode mode_a
Definition: cpu.h:264
const ios_base::openmode mode_r
Definition: cpu.h:262
Definition: cpu.h:257
string p_ExecName
Definition: cpu.h:321
void p_assertValidPath()
Definition: cpu.cpp:305
long n_use_CPU
Definition: cpu.h:310
int nFileDone
Definition: cpu.h:333
string p_chCloudyRoot
Definition: cpu.h:329
float realnum
Definition: cddefines.h:127
float sys_float
Definition: cddefines.h:130
t_cpu_i()
Definition: cpu.cpp:71
bool foundCSMismatch() const
Definition: cpu.h:395
const realnum BIGFLOAT
Definition: cpu.h:233
void printDataPath() const
Definition: cpu.cpp:547
bool lgMaster() const
Definition: cpu.h:377
int32 Float_SNaN_Value
Definition: cpu.h:299
bool lgPathInitialized
Definition: cpu.h:339
long max(int a, long b)
Definition: cddefines.h:821
bool firstOpen() const
Definition: cpu.h:394
Definition: cpu.h:257
bool lgMPI_talk() const
Definition: cpu.h:378
char p_chDirSeparator
Definition: cpu.h:331
long min(int a, long b)
Definition: cddefines.h:766
const ios_base::openmode UNUSED mode_wpb
Definition: cpu.h:273
#define NULL
Definition: cddefines.h:115
vector< string > p_exit_status
Definition: cpu.h:348
const ios_base::openmode mode_ap
Definition: cpu.h:267
void set_ExecName(const string &name)
Definition: cpu.h:379
const ios_base::openmode UNUSED mode_rb
Definition: cpu.h:269
const ios_base::openmode mode_w
Definition: cpu.h:263
MPI_state p_MPIMode
Definition: cpu.h:317
void posix_memalign_free(void *p)
Definition: cpu.h:143
sys_float min_float() const
Definition: cpu.h:358
int64 Double_SNaN_Value
Definition: cpu.h:300
void getPathList(const string &fname, vector< string > &PathList, access_scheme scheme, bool lgRead) const
Definition: cpu.cpp:558
void set_signal_handlers()
Definition: cpu.cpp:500
bool lgMPI() const
Definition: cpu.h:372
Definition: mpi_utilities.h:7
const ios_base::openmode UNUSED mode_ab
Definition: cpu.h:271
Definition: cpu.h:258
friend void check_data(const string &fpath, const string &fname)
Definition: cpu.cpp:838
void set_nCPU(long n)
Definition: cpu.h:368
char c[4]
Definition: cpu.h:292
Definition: cpu.h:410
const ios_base::openmode UNUSED mode_apb
Definition: cpu.h:274
void appendDirSeparator(char *path) const
Definition: cpu.h:388
void getchecksums(const string &fname)
Definition: cpu.cpp:588
long nCPU() const
Definition: cpu.h:369
void initPath()
Definition: cpu.cpp:239
int32 i
Definition: cpu.h:293
void enable_traps() const
Definition: cpu.cpp:321
sys_float test_float
Definition: cpu.h:296
static t_cpu cpu
Definition: cpu.h:422
bool p_lgMPI
Definition: cpu.h:312
vector< string > chSearchPath
Definition: cpu.h:327
const ios_base::openmode mode_rp
Definition: cpu.h:265
t_cpu()
Definition: cpu.cpp:55
const char * host_name() const
Definition: cpu.h:385
string chDirSeparator() const
Definition: cpu.h:387
const string & chExitStatus(exit_type s) const
Definition: cpu.h:396
#define UNUSED
Definition: cpu.h:9