12#define UNUSED __attribute__ ((unused))
20# define INT8_MIN (-INT8_MAX - 1)
23#if SCHAR_MAX == INT8_MAX
24 typedef signed char int8;
26# error "failed to define int8, please report this to gary@uky.edu"
33#if UCHAR_MAX == UINT8_MAX
34 typedef unsigned char uint8;
36# error "failed to define uint8, please report this to gary@uky.edu"
40# define INT16_MAX 32767
43# define INT16_MIN (-INT16_MAX - 1)
46#if SHRT_MAX == INT16_MAX
47 typedef short int int16;
48#elif INT_MAX == INT16_MAX
51# error "failed to define int16, please report this to gary@uky.edu"
55# define UINT16_MAX 65535
58#if USHRT_MAX == UINT16_MAX
59 typedef unsigned short int uint16;
60#elif UINT_MAX == UINT16_MAX
61 typedef unsigned int uint16;
63# error "failed to define uint16, please report this to gary@uky.edu"
67# define INT32_MAX 2147483647L
70# define INT32_MIN (-INT32_MAX - 1)
73#if INT_MAX == INT32_MAX
75#elif LONG_MAX == INT32_MAX
76 typedef long int int32;
78# error "failed to define int32, please report this to gary@uky.edu"
82# define UINT32_MAX 4294967295UL
85#if UINT_MAX == UINT32_MAX
86 typedef unsigned int uint32;
87#elif ULONG_MAX == UINT32_MAX
88 typedef unsigned long int uint32;
90# error "failed to define uint32, please report this to gary@uky.edu"
94# define INT64_MAX 9223372036854775807LL
97# define INT64_MIN (-INT64_MAX - 1)
100#if LONG_MAX == INT64_MAX
101 typedef long int int64;
102#elif LLONG_MAX == INT64_MAX
103 typedef long long int int64;
105# error "failed to define int64, please report this to gary@uky.edu"
109# define UINT64_MAX 18446744073709551615ULL
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;
117# error "failed to define uint64, please report this to gary@uky.edu"
132inline int posix_memalign(
void **p,
size_t a,
size_t s)
134 *p = _aligned_malloc(s, a);
135 return ( *p ==
NULL ) ? errno : 0;
183#if defined(_ARCH_PPC) || defined(__POWERPC__) || defined(__powerpc__) || defined(PPC)
194#if defined(unix) || defined(__unix__)
200#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
205#if defined(linux) || defined(__linux)
220#if defined(__GNUC__) && ! ( defined(__ICC) || defined(__PATHSCALE__) || defined(__OPENCC__) || defined(__clang__) )
221#define __GNUC_EXCL__ 1
225#if defined(__linux) || defined(__APPLE__) || (defined(__CYGWIN__) && !defined(__CYGWIN32__))
226#define SIGNAL_HANDLER 1
262const ios_base::openmode
mode_r = ios_base::in;
263const ios_base::openmode
mode_w = ios_base::out | ios_base::trunc;
264const ios_base::openmode
mode_a = ios_base::out | ios_base::app;
265const ios_base::openmode
mode_rp = ios_base::in | ios_base::out;
266const ios_base::openmode
mode_wp = ios_base::in | ios_base::out | ios_base::trunc;
267const ios_base::openmode
mode_ap = ios_base::in | ios_base::out | ios_base::app;
280 string* rpath=
nullptr );
282void check_data(
const string& fpath,
const string& fname );
302# ifdef SIGNAL_HANDLER
303 struct sigaction p_action;
304 struct sigaction p_default;
361# ifdef SIGNAL_HANDLER
362 const struct sigaction* action()
const {
return &p_action; }
363 const struct sigaction* deflt()
const {
return &p_default; }
390 size_t i = strlen(path);
400 friend void open_data( fstream& stream,
const string& fname, ios_base::openmode mode,
access_scheme scheme,
403 friend void check_data(
const string& fpath,
const string& fname );
407 friend void set_NaN(
double &x);
408 friend void set_NaN(
double x[],
long n);
457#define NORETURN __declspec(noreturn)
458#elif defined(__GNUC__) || ( defined(__INTEL_COMPILER) && defined(__linux__) || defined(__SUNPRO_CC) )
459#define NORETURN __attribute__ ((noreturn))
464#define FALLTHROUGH (void)0
468#define FALLTHROUGH __attribute__ ((fallthrough))
473#define ALIGNED(X) __declspec(align(X))
475#define ALIGNED(X) __attribute__ ((aligned(X)))
483#define LIKELY(x) __builtin_expect((x),1)
486#define RESTRICT __restrict
490#define UNLIKELY(x) (x)
494#define UNLIKELY(x) __builtin_expect((x),0)
502#define DO_EXPAND(VAL) VAL ## 1
503#define EXPAND(VAL) DO_EXPAND(VAL)
508#if defined __INTEL_COMPILER
510# define __COMP_VER __INTEL_COMPILER
514#elif defined __PATHSCALE__
515# define __COMP "pathCC"
516# define __COMP_VER __PATHCC__ * 100 + __PATHCC_MINOR__ * 10 + __PATHCC_PATCHLEVEL__
520#elif defined __OPENCC__
521# define __COMP "Open64"
522# if EXPAND(__OPENCC_PATCHLEVEL__) == 1
523# define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10
525# define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10 + __OPENCC_PATCHLEVEL__
530#elif defined __clang__
531# define __COMP "clang++"
532# define __COMP_VER __clang_major__ * 100 + __clang_minor__ * 10 + __clang_patchlevel__
535#elif defined __GNUC__
537# if defined(__GNUC_PATCHLEVEL__)
538# define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
540# define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
544# define __COMP "Portland Group"
545# if defined(__PGIC__)
546# define __COMP_VER (__PGIC__ * 100 + __PGIC_MINOR__ * 10 + __PGIC_PATCHLEVEL__)
553#elif defined(__sgi) && defined(_COMPILER_VERSION)
554# define __COMP "MIPSpro"
555# define __COMP_VER _COMPILER_VERSION
558#elif defined __HP_aCC
559# define __COMP "HP aCC"
560# define __COMP_VER __HP_aCC
564# define __COMP "DEC CC"
565# define __COMP_VER __DECC_VER
568#elif defined _MSC_VER
570# define __COMP_VER _MSC_VER
573#elif defined __SUNPRO_CC
574# define __COMP "Solaris Studio"
575# define __COMP_VER __SUNPRO_CC
579# define __COMP "unknown"
587# define __OS "Linux (IA32)"
588# elif defined __amd64
589# define __OS "Linux (AMD64)"
591# define __OS "Linux (IA64)"
592# elif defined __ppc__
593# define __OS "Linux (PowerPC)"
595# define __OS "Linux (other)"
599#elif defined macintosh
600# define __OS "Mac OS 9"
603#elif defined __MACOSX__
604# define __OS "Mac OS X"
607#elif defined __APPLE__
608# define __OS "Apple MacOS"
616# define __OS "Solaris"
624# define __OS "Ultrix"
627#elif defined __FreeBSD__
628# define __OS "FreeBSD"
630#elif defined __NetBSD__
631# define __OS "NetBSD"
633#elif defined __OpenBSD__
634# define __OS "OpenBSD"
646#elif defined __CYGWIN__
647# define __OS "Cygwin"
655# define __OS "unknown"
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."
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."
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."
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."
float sys_float
Definition cddefines.h:130
#define NULL
Definition cddefines.h:115
exit_type
Definition cddefines.h:151
float realnum
Definition cddefines.h:127
void disableBacktrace()
Definition cpu.h:380
void enableBacktrace()
Definition cpu.h:381
void appendDirSeparator(char *path) const
Definition cpu.h:388
bool lgMPI_talk() const
Definition cpu.h:378
char HostName[STDLEN]
Definition cpu.h:325
bool lgPathInitialized
Definition cpu.h:339
bool firstOpen() const
Definition cpu.h:394
double test_double
Definition cpu.h:297
int32 i
Definition cpu.h:293
bool p_suppressBacktrace
Definition cpu.h:343
bool lgMPI() const
Definition cpu.h:372
const string & chExitStatus(exit_type s) const
Definition cpu.h:396
void initPath()
Definition cpu.cpp:239
void p_assertValidPath()
Definition cpu.cpp:305
const char * host_name() const
Definition cpu.h:385
sys_float min_float() const
Definition cpu.h:358
void set_nRANK(long n)
Definition cpu.h:375
void set_signal_handlers()
Definition cpu.cpp:500
char p_chDirSeparator
Definition cpu.h:331
union t_cpu_i::@335252263203230214344271132321122252266310132251 endian
friend void check_data(const string &fpath, const string &fname)
Definition cpu.cpp:838
bool p_lgMPI
Definition cpu.h:312
static void signal_handler(int sig, siginfo_t *, void *ptr)
Definition cpu.cpp:535
bool lgMaster() const
Definition cpu.h:377
string p_ExecName
Definition cpu.h:321
long used_nCPU() const
Definition cpu.h:371
void getPathList(const string &fname, vector< string > &PathList, access_scheme scheme, bool lgRead) const
Definition cpu.cpp:558
void set_used_nCPU(long n)
Definition cpu.h:370
void GenerateBacktrace(void *ptr)
Definition cpu.cpp:1178
sys_float test_float
Definition cpu.h:296
double min_double() const
Definition cpu.h:359
bool big_endian() const
Definition cpu.h:355
map< string, string > checksum_expct
Definition cpu.h:337
int32 Float_SNaN_Value
Definition cpu.h:299
void set_ExecName(const string &name)
Definition cpu.h:379
friend FILE * open_data(const string &fname, const string &mode, access_scheme scheme, string *rpath)
Definition cpu.cpp:722
long nCPU() const
Definition cpu.h:369
t_cpu_i()
Definition cpu.cpp:71
bool little_endian() const
Definition cpu.h:356
void enable_traps() const
Definition cpu.cpp:321
int nFileDone
Definition cpu.h:333
void PrintBacktrace(const string &s, bool lgPrintSeed=true)
Definition cpu.cpp:1185
long nRANK() const
Definition cpu.h:376
friend void set_NaN(sys_float &x)
Definition cpu.cpp:871
void set_nCPU(long n)
Definition cpu.h:368
MPI_state MPIMode() const
Definition cpu.h:374
vector< string > p_exit_status
Definition cpu.h:348
void set_MPIMode(MPI_state mode)
Definition cpu.h:373
long n_use_CPU
Definition cpu.h:310
void printDataPath() const
Definition cpu.cpp:547
bool foundCSMismatch() const
Definition cpu.h:395
long n_rank
Definition cpu.h:319
vector< string > chTraceback
Definition cpu.h:323
string p_chCloudyRoot
Definition cpu.h:329
int nCSMismatch
Definition cpu.h:335
char c[4]
Definition cpu.h:292
string chDirSeparator() const
Definition cpu.h:387
const string & ExecName() const
Definition cpu.h:384
long n_avail_CPU
Definition cpu.h:308
void getchecksums(const string &fname)
Definition cpu.cpp:588
int64 Double_SNaN_Value
Definition cpu.h:300
MPI_state p_MPIMode
Definition cpu.h:317
vector< string > chSearchPath
Definition cpu.h:327
~t_cpu()
Definition cpu.cpp:62
t_cpu()
Definition cpu.cpp:55
t_cpu_i & i()
Definition cpu.h:414
static t_cpu_i * m_i
Definition cpu.h:412
static t_cpu cpu
Definition cpu.h:422
const int STDLEN
Definition cpu.h:241
const realnum BIGFLOAT
Definition cpu.h:233
const ios_base::openmode mode_r
Definition cpu.h:262
const ios_base::openmode mode_a
Definition cpu.h:264
access_scheme
Definition cpu.h:257
@ AS_LOCAL_ONLY
Definition cpu.h:258
@ AS_OPTIONAL
Definition cpu.h:257
@ AS_TRY
Definition cpu.h:257
@ AS_SILENT_TRY
Definition cpu.h:257
@ AS_LOCAL_ONLY_TRY
Definition cpu.h:258
@ AS_DEFAULT
Definition cpu.h:257
void posix_memalign_free(void *p)
Definition cpu.h:143
const double BIGDOUBLE
Definition cpu.h:238
const ios_base::openmode UNUSED mode_apb
Definition cpu.h:274
bool MyIsnan(const sys_float &x)
Definition cpu.cpp:925
const ios_base::openmode UNUSED mode_wpb
Definition cpu.h:273
void check_data(const string &fpath, const string &fname)
Definition cpu.cpp:838
const ios_base::openmode UNUSED mode_rpb
Definition cpu.h:272
const ios_base::openmode mode_rp
Definition cpu.h:265
const ios_base::openmode mode_w
Definition cpu.h:263
FILE * open_data(const string &fname, const string &mode, access_scheme scheme=AS_DEFAULT, string *rpath=nullptr)
Definition cpu.cpp:722
const ios_base::openmode UNUSED mode_rb
Definition cpu.h:269
void set_NaN(sys_float &x)
Definition cpu.cpp:871
const ios_base::openmode UNUSED mode_wb
Definition cpu.h:270
const double SMALLDOUBLE
Definition cpu.h:239
const ios_base::openmode mode_wp
Definition cpu.h:266
const ios_base::openmode UNUSED mode_ab
Definition cpu.h:271
const ios_base::openmode mode_ap
Definition cpu.h:267
#define UNUSED
Definition cpu.h:9
const realnum SMALLFLOAT
Definition cpu.h:235
void * MPI_File
Definition mpi_utilities.h:74
MPI_state
Definition mpi_utilities.h:7
@ MS_GRID
Definition mpi_utilities.h:7
static const bool value
Definition cpu.h:451
static const bool value
Definition cpu.h:447