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;
278void getFileList(vector<string>& results,
const string& pattern);
281 string* rpath=
nullptr );
283void check_data(
const string& fpath,
const string& fname );
303# ifdef SIGNAL_HANDLER
304 struct sigaction p_action;
305 struct sigaction p_default;
354 void p_splitPath(
const string& path,
string& head,
string& tail )
const
357 if( ptr != string::npos )
359 head = path.substr(0, ++ptr);
360 tail = path.substr(ptr);
369 void p_getFileList(vector<string>& results,
const string& pattern,
bool lgStrip)
const;
380# ifdef SIGNAL_HANDLER
381 const struct sigaction* action()
const {
return &p_action; }
382 const struct sigaction* deflt()
const {
return &p_default; }
412 friend void getFileList(vector<string>& results,
const string& pattern);
414 friend void open_data( fstream& stream,
const string& fname, ios_base::openmode mode,
access_scheme scheme,
417 friend void check_data(
const string& fpath,
const string& fname );
421 friend void set_NaN(
double &x);
422 friend void set_NaN(
double x[],
long n);
471#define NORETURN __declspec(noreturn)
472#elif defined(__GNUC__) || ( defined(__INTEL_COMPILER) && defined(__linux__) || defined(__SUNPRO_CC) )
473#define NORETURN __attribute__ ((noreturn))
478#define FALLTHROUGH (void)0
482#define FALLTHROUGH __attribute__ ((fallthrough))
487#define ALIGNED(X) __declspec(align(X))
489#define ALIGNED(X) __attribute__ ((aligned(X)))
497#define LIKELY(x) __builtin_expect((x),1)
500#define RESTRICT __restrict
504#define UNLIKELY(x) (x)
508#define UNLIKELY(x) __builtin_expect((x),0)
516#define DO_EXPAND(VAL) VAL ## 1
517#define EXPAND(VAL) DO_EXPAND(VAL)
522#if defined __INTEL_COMPILER
524# define __COMP_VER __INTEL_COMPILER
528#elif defined __PATHSCALE__
529# define __COMP "pathCC"
530# define __COMP_VER __PATHCC__ * 100 + __PATHCC_MINOR__ * 10 + __PATHCC_PATCHLEVEL__
534#elif defined __OPENCC__
535# define __COMP "Open64"
536# if EXPAND(__OPENCC_PATCHLEVEL__) == 1
537# define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10
539# define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10 + __OPENCC_PATCHLEVEL__
544#elif defined __clang__
545# define __COMP "clang++"
546# define __COMP_VER __clang_major__ * 100 + __clang_minor__ * 10 + __clang_patchlevel__
549#elif defined __GNUC__
551# if defined(__GNUC_PATCHLEVEL__)
552# define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
554# define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
558# define __COMP "Portland Group"
559# if defined(__PGIC__)
560# define __COMP_VER (__PGIC__ * 100 + __PGIC_MINOR__ * 10 + __PGIC_PATCHLEVEL__)
567#elif defined(__sgi) && defined(_COMPILER_VERSION)
568# define __COMP "MIPSpro"
569# define __COMP_VER _COMPILER_VERSION
572#elif defined __HP_aCC
573# define __COMP "HP aCC"
574# define __COMP_VER __HP_aCC
578# define __COMP "DEC CC"
579# define __COMP_VER __DECC_VER
582#elif defined _MSC_VER
584# define __COMP_VER _MSC_VER
587#elif defined __SUNPRO_CC
588# define __COMP "Solaris Studio"
589# define __COMP_VER __SUNPRO_CC
593# define __COMP "unknown"
601# define __OS "Linux (IA32)"
602# elif defined __amd64
603# define __OS "Linux (AMD64)"
605# define __OS "Linux (IA64)"
606# elif defined __ppc__
607# define __OS "Linux (PowerPC)"
609# define __OS "Linux (other)"
613#elif defined macintosh
614# define __OS "Mac OS 9"
617#elif defined __MACOSX__
618# define __OS "Mac OS X"
621#elif defined __APPLE__
622# define __OS "Apple MacOS"
630# define __OS "Solaris"
638# define __OS "Ultrix"
641#elif defined __FreeBSD__
642# define __OS "FreeBSD"
644#elif defined __NetBSD__
645# define __OS "NetBSD"
647#elif defined __OpenBSD__
648# define __OS "OpenBSD"
660#elif defined __CYGWIN__
661# define __OS "Cygwin"
669# define __OS "unknown"
675# if defined(__GNUC_EXCL__) && ((__GNUC__ < 4 ) || \
676 (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || \
677 (__GNUC__ == 4 && __GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ == 0))
678# 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."
681# if defined(__clang_major__) && ((__clang_major__ < 3 ) || \
682 (__clang_major__ == 3 && __clang_minor__ < 3))
683# 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."
686# if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1500
687# 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."
690# if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
691# 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:131
#define NULL
Definition cddefines.h:116
exit_type
Definition cddefines.h:164
float realnum
Definition cddefines.h:128
void disableBacktrace()
Definition cpu.h:399
void enableBacktrace()
Definition cpu.h:400
bool lgMPI_talk() const
Definition cpu.h:397
char HostName[STDLEN]
Definition cpu.h:326
bool lgPathInitialized
Definition cpu.h:340
bool firstOpen() const
Definition cpu.h:407
double test_double
Definition cpu.h:298
void printDataPath(const string &pattern) const
Definition cpu.cpp:550
int32 i
Definition cpu.h:294
bool p_suppressBacktrace
Definition cpu.h:344
bool lgMPI() const
Definition cpu.h:391
const string & chExitStatus(exit_type s) const
Definition cpu.h:409
void initPath()
Definition cpu.cpp:242
void p_getFileList(vector< string > &results, const string &pattern, bool lgStrip) const
Definition cpu.cpp:784
void p_getchecksums(const string &fname)
Definition cpu.cpp:607
void p_assertValidPath()
Definition cpu.cpp:308
const char * host_name() const
Definition cpu.h:404
sys_float min_float() const
Definition cpu.h:377
void set_nRANK(long n)
Definition cpu.h:394
void set_signal_handlers()
Definition cpu.cpp:503
char p_chDirSeparator
Definition cpu.h:332
friend void check_data(const string &fpath, const string &fname)
Definition cpu.cpp:931
bool p_lgMPI
Definition cpu.h:313
static void signal_handler(int sig, siginfo_t *, void *ptr)
Definition cpu.cpp:538
bool lgMaster() const
Definition cpu.h:396
string p_ExecName
Definition cpu.h:322
long used_nCPU() const
Definition cpu.h:390
void set_used_nCPU(long n)
Definition cpu.h:389
void GenerateBacktrace(void *ptr)
Definition cpu.cpp:1267
sys_float test_float
Definition cpu.h:297
double min_double() const
Definition cpu.h:378
bool big_endian() const
Definition cpu.h:374
union t_cpu_i::@106376237137230054305215133036150131221143322223 endian
map< string, string > checksum_expct
Definition cpu.h:338
int32 Float_SNaN_Value
Definition cpu.h:300
void set_ExecName(const string &name)
Definition cpu.h:398
friend FILE * open_data(const string &fname, const string &mode, access_scheme scheme, string *rpath)
Definition cpu.cpp:815
long nCPU() const
Definition cpu.h:388
t_cpu_i()
Definition cpu.cpp:74
bool little_endian() const
Definition cpu.h:375
void enable_traps() const
Definition cpu.cpp:324
int nFileDone
Definition cpu.h:334
void PrintBacktrace(const string &s, bool lgPrintSeed=true)
Definition cpu.cpp:1274
long nRANK() const
Definition cpu.h:395
friend void set_NaN(sys_float &x)
Definition cpu.cpp:960
void p_splitPath(const string &path, string &head, string &tail) const
Definition cpu.h:354
void set_nCPU(long n)
Definition cpu.h:387
MPI_state MPIMode() const
Definition cpu.h:393
friend void getFileList(vector< string > &results, const string &pattern)
Definition cpu.cpp:810
vector< string > p_exit_status
Definition cpu.h:349
void set_MPIMode(MPI_state mode)
Definition cpu.h:392
long n_use_CPU
Definition cpu.h:311
bool foundCSMismatch() const
Definition cpu.h:408
long n_rank
Definition cpu.h:320
vector< string > chTraceback
Definition cpu.h:324
string p_chCloudyRoot
Definition cpu.h:330
int nCSMismatch
Definition cpu.h:336
char c[4]
Definition cpu.h:293
void p_getPathList(const string &fname, vector< string > &PathList, access_scheme scheme, bool lgRead) const
Definition cpu.cpp:577
string chDirSeparator() const
Definition cpu.h:406
const string & ExecName() const
Definition cpu.h:403
long n_avail_CPU
Definition cpu.h:309
int64 Double_SNaN_Value
Definition cpu.h:301
MPI_state p_MPIMode
Definition cpu.h:318
vector< string > chSearchPath
Definition cpu.h:328
~t_cpu()
Definition cpu.cpp:65
t_cpu()
Definition cpu.cpp:58
t_cpu_i & i()
Definition cpu.h:428
static t_cpu_i * m_i
Definition cpu.h:426
static t_cpu cpu
Definition cpu.h:436
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:1014
const ios_base::openmode UNUSED mode_wpb
Definition cpu.h:273
void check_data(const string &fpath, const string &fname)
Definition cpu.cpp:931
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:815
const ios_base::openmode UNUSED mode_rb
Definition cpu.h:269
void set_NaN(sys_float &x)
Definition cpu.cpp:960
const ios_base::openmode UNUSED mode_wb
Definition cpu.h:270
void getFileList(vector< string > &results, const string &pattern)
Definition cpu.cpp:810
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:465
static const bool value
Definition cpu.h:461