cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Structures | Macros | Enumerations | Functions | Variables
cpu.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  t_cpu_i
 
class  t_cpu
 

Macros

#define INT16_MAX   32767
 
#define INT16_MIN   (-INT16_MAX - 1)
 
#define UINT16_MAX   65535
 
#define INT32_MAX   2147483647L
 
#define INT32_MIN   (-INT32_MAX - 1)
 
#define UINT32_MAX   4294967295UL
 
#define UINT64_MAX   18446744073709551615UL
 
#define __func__   DEBUG_ENTRY.name()
 
#define NORETURN   /*@noreturn@*/
 
#define RESTRICT
 
#define UNLIKELY(x)   (x)
 
#define UNUSED   /*@unused@*/
 
#define DO_EXPAND(VAL)   VAL ## 1
 
#define EXPAND(VAL)   DO_EXPAND(VAL)
 
#define __COMP   "unknown"
 
#define __COMP_VER   0
 
#define __OS   "unknown"
 

Enumerations

enum  access_scheme {
  AS_DATA_ONLY_TRY, AS_DATA_LOCAL_TRY, AS_LOCAL_DATA_TRY, AS_LOCAL_ONLY_TRY,
  AS_DATA_ONLY, AS_DATA_OPTIONAL, AS_DATA_LOCAL, AS_LOCAL_DATA,
  AS_LOCAL_ONLY, AS_SILENT_TRY
}
 

Functions

FILE * open_data (const char *fname, const char *mode, access_scheme scheme=AS_DATA_ONLY)
 
void open_data (fstream &stream, const char *fname, ios_base::openmode mode, access_scheme scheme=AS_DATA_ONLY)
 
void set_NaN (sys_float &x)
 
void set_NaN (sys_float x[], long n)
 
void set_NaN (double &x)
 
void set_NaN (double x[], long n)
 
bool MyIsnan (const sys_float &x)
 
bool MyIsnan (const double &x)
 

Variables

const realnum BIGFLOAT = numeric_limits<realnum>::max()/realnum(100.f)
 
const realnum SMALLFLOAT = numeric_limits<realnum>::min()*realnum(100.f)
 
const double BIGDOUBLE = DBL_MAX/100.
 
const double SMALLDOUBLE = DBL_MIN*100.
 
const int STDLEN = 32
 
const ios_base::openmode mode_r = ios_base::in
 
const ios_base::openmode mode_w = ios_base::out | ios_base::trunc
 
const ios_base::openmode mode_a = ios_base::out | ios_base::app
 
const ios_base::openmode mode_rp = ios_base::in | ios_base::out
 
const ios_base::openmode mode_wp = ios_base::in | ios_base::out | ios_base::trunc
 
const ios_base::openmode mode_ap = ios_base::in | ios_base::out | ios_base::app
 
const ios_base::openmode mode_rb = mode_r | ios_base::binary
 
const ios_base::openmode mode_wb = mode_w | ios_base::binary
 
const ios_base::openmode mode_ab = mode_a | ios_base::binary
 
const ios_base::openmode mode_rpb = mode_rp | ios_base::binary
 
const ios_base::openmode mode_wpb = mode_wp | ios_base::binary
 
const ios_base::openmode mode_apb = mode_ap | ios_base::binary
 
static t_cpu cpu
 

Detailed Description

store CPU specific information

Definition in file cpu.h.

Macro Definition Documentation

#define __COMP   "unknown"

Definition at line 468 of file cpu.h.

Referenced by t_version::t_version().

#define __COMP_VER   0

Definition at line 469 of file cpu.h.

Referenced by t_version::t_version().

#define __func__   DEBUG_ENTRY.name()

all vendors supply predefined preprocessor symbols to help identify their hardware/operating system/compiler, the following symbols will be used to bracket hardware/OS/compiler specific code:

Sun Sparc: sun DEC Alpha: __alpha SGI Iris: __sgi HP Unix: __hpux Cray: __cray IA32: __i386 AMD64/EM64T: __amd64 UNIX: __unix (includes Linux) Linux: __linux MS Vis C: _MSC_VER Intel compiler: __ICC, __INTEL_COMPILER g++/icc/pathCC: __GNUC (also set by icc and pathCC!) g++: GNUC_EXCL (excludes icc, pathCC)

NOTE: the user should NOT define these symbols at compile time.the Intel EM64T compiler does not set the __amd64 flag... on some UNIX systems only the preprocessor symbol "unix" is predefined (e.g. DEC alpha), on others only "__unix" (e.g. Cray), and on yet others both... This ensures "__unix" is always defined on all UNIX systems.on SGI IA64 systems, icc calls itself ecc... this is needed to discriminate between g++ and icc/pathCC/openCC/clang++

Definition at line 169 of file cpu.h.

#define __OS   "unknown"

Definition at line 544 of file cpu.h.

Referenced by t_version::t_version().

#define DO_EXPAND (   VAL)    VAL ## 1

Definition at line 391 of file cpu.h.

#define EXPAND (   VAL)    DO_EXPAND(VAL)

Definition at line 392 of file cpu.h.

#define INT16_MAX   32767

some definitions for integers with a guaranteed number of bits

Definition at line 16 of file cpu.h.

Referenced by iso_continuum_lower().

#define INT16_MIN   (-INT16_MAX - 1)

Definition at line 19 of file cpu.h.

#define INT32_MAX   2147483647L

Definition at line 43 of file cpu.h.

Referenced by getrf_wrapper(), and getrs_wrapper().

#define INT32_MIN   (-INT32_MAX - 1)

Definition at line 46 of file cpu.h.

#define NORETURN   /*@noreturn@*/

Definition at line 370 of file cpu.h.

#define RESTRICT

Definition at line 373 of file cpu.h.

#define UINT16_MAX   65535

Definition at line 31 of file cpu.h.

#define UINT32_MAX   4294967295UL

Definition at line 58 of file cpu.h.

#define UINT64_MAX   18446744073709551615UL

Definition at line 93 of file cpu.h.

#define UNLIKELY (   x)    (x)

Definition at line 374 of file cpu.h.

Referenced by lgNucleiConserved().

#define UNUSED   /*@unused@*/

Definition at line 384 of file cpu.h.

Referenced by ParseSet(), and read_SH98_He1_cross_sections().

Enumeration Type Documentation

flag used as third parameter for open_data, indicates how data files are searched AS_DATA_ONLY: search only in the data directories, not in the current working directory (default) AS_DATA_OPTIONAL: same as AS_DATA_ONLY, except that the precense of the file is optional AS_DATA_LOCAL: search in data directories first, then in the current working directory AS_LOCAL_DATA: search in the current working directory first, then in the data directories AS_LOCAL_ONLY: search in the current working directory only versions with _TRY appended have the same meaning, except that they don't abort AS_SILENT_TRY: same as AS_LOCAL_ONLY_TRY, but does not write to ioQQQ in trace mode

Enumerator
AS_DATA_ONLY_TRY 
AS_DATA_LOCAL_TRY 
AS_LOCAL_DATA_TRY 
AS_LOCAL_ONLY_TRY 
AS_DATA_ONLY 
AS_DATA_OPTIONAL 
AS_DATA_LOCAL 
AS_LOCAL_DATA 
AS_LOCAL_ONLY 
AS_SILENT_TRY 

Definition at line 194 of file cpu.h.

Function Documentation

bool MyIsnan ( const sys_float x)

detect quiet and signaling NaNs in FP numbers

detect quiet and signaling NaNs in single precision FP

Definition at line 744 of file cpu.cpp.

Referenced by ParseCrashDo().

bool MyIsnan ( const double &  x)

detect quiet and signaling NaNs in double precision FP

Definition at line 759 of file cpu.cpp.

References t_cpu_i::big_endian(), cpu, t_cpu::i(), and t_cpu_i::little_endian().

Here is the call graph for this function:

FILE* open_data ( const char *  fname,
const char *  mode,
access_scheme  scheme = AS_DATA_ONLY 
)

Definition at line 616 of file cpu.cpp.

References AbortErrorMessage(), AS_DATA_LOCAL, AS_DATA_ONLY, AS_DATA_OPTIONAL, AS_LOCAL_DATA, AS_LOCAL_ONLY, AS_SILENT_TRY, cpu, DEBUG_ENTRY, t_cpu_i::getPathList(), t_cpu::i(), ioQQQ, lgAbort, t_trace::lgTrace, t_cpu_i::nFileDone, and trace.

Referenced by append_file(), atmdat_CHIANTI_readin(), atmdat_LAMDA_readin(), atmdat_readin(), atmdat_STOUT_readin(), Badnell_rec_init(), cdGetLineList(), cdInput(), cdOutput(), cdRead(), check_grid_file(), CloudyPrintReference(), ContBandsCreate(), database_readin(), DatabasePrintReference(), FeIIBandsCreate(), FeIICreate(), FillGFF(), GetStandardHeLines(), diatomics::H2_CollidRateRead(), diatomics::H2_Read_hminus_distribution(), diatomics::H2_ReadDissocEnergies(), diatomics::H2_ReadDissprob(), diatomics::H2_ReadEnergies(), diatomics::H2_ReadTransprob(), HeCollidSetup(), HelikeTransProbSetup(), HyperfineCreate(), t_yield::init_yield(), InitGrid(), input_readvector(), iso_recomb_setup(), lgCompileAtmosphere(), lgCompileAtmosphereCoStar(), lgFileReadable(), lgOptimize_do(), lgValidAsciiFile(), lgValidBinFile(), main(), MD5datafile(), MD5file(), mie_read_mix(), mie_read_opc(), mie_read_rfi(), mie_read_szd(), mie_write_opc(), optimize_phymir(), phymir_state< X, Y, NP, NSTR >::p_execute_job_parallel(), phymir_state< X, Y, NP, NSTR >::p_rd_state(), phymir_state< X, Y, NP, NSTR >::p_wr_state(), ParseInit(), ParseSave(), ParseState(), ParseTable(), pnegopc(), process_output(), ptrcer(), RauchInitializeSub(), RauchReadMPP(), rd_block(), read_continuum_mesh(), read_data(), read_Helike_cross_sections(), read_hm05(), diatomics::Read_Mol_Diss_cross_sections(), read_SH98_He1_cross_sections(), read_species_file(), ReadAugerData(), ReadBadnellAIData(), ReadIsotopeFractions(), ReadTable(), save_opacity(), StarburstInitialize(), state_get_put(), t_ADfA::t_ADfA(), t_fe2ovr_la::t_fe2ovr_la(), vary_input(), and wr_block().

Here is the call graph for this function:

void open_data ( fstream &  stream,
const char *  fname,
ios_base::openmode  mode,
access_scheme  scheme = AS_DATA_ONLY 
)
void set_NaN ( sys_float x)

set_NaN - set variable or array to SNaN

define routines for setting single and double precision signaling NaN The bit pattern for an SNaN is implementation defined, but this should work on most modern CPU's. The system definition is preferred, so in C++ this should be replaced by numeric_limits<TYPE>::signaling_NaN()

Definition at line 673 of file cpu.cpp.

References cpu, t_cpu_i::Float_SNaN_Value, and t_cpu::i().

Referenced by Amsterdam_Method(), ConvInitSolution(), invalidate_array(), MyMalloc(), iter_track::p_clear1(), ParseBlackbody(), ParseCrashDo(), SpeciesJunk(), xNI_coll_stren(), and zero().

Here is the call graph for this function:

void set_NaN ( sys_float  x[],
long  n 
)

Definition at line 681 of file cpu.cpp.

References cpu, t_cpu_i::Float_SNaN_Value, and t_cpu::i().

Here is the call graph for this function:

void set_NaN ( double &  x)

Definition at line 699 of file cpu.cpp.

References cpu, t_cpu_i::Double_SNaN_Value, and t_cpu::i().

Here is the call graph for this function:

void set_NaN ( double  x[],
long  n 
)

Definition at line 716 of file cpu.cpp.

References cpu, t_cpu_i::Double_SNaN_Value, and t_cpu::i().

Here is the call graph for this function:

Variable Documentation

const double BIGDOUBLE = DBL_MAX/100.

DBL_MAX is 1.797e308 on wintel so BIGDOUBLE is 1.797e306

Definition at line 181 of file cpu.h.

Referenced by atmdat_CHIANTI_readin(), CS_l_mixing_PS64(), DoBeckert_etal(), DoSutherland(), iso_collide(), iso_set_ion_rates(), ParseDynaWind(), prt_constants(), and RandGauss().

const realnum BIGFLOAT = numeric_limits<realnum>::max()/realnum(100.f)
t_cpu cpu
static
const ios_base::openmode mode_a = ios_base::out | ios_base::app

Definition at line 201 of file cpu.h.

Referenced by check_grid_file().

const ios_base::openmode mode_ab = mode_a | ios_base::binary

Definition at line 208 of file cpu.h.

const ios_base::openmode mode_ap = ios_base::in | ios_base::out | ios_base::app

Definition at line 204 of file cpu.h.

const ios_base::openmode mode_apb = mode_ap | ios_base::binary

Definition at line 211 of file cpu.h.

const ios_base::openmode mode_r = ios_base::in
const ios_base::openmode mode_rb = mode_r | ios_base::binary

Definition at line 206 of file cpu.h.

const ios_base::openmode mode_rp = ios_base::in | ios_base::out

Definition at line 202 of file cpu.h.

const ios_base::openmode mode_rpb = mode_rp | ios_base::binary

Definition at line 209 of file cpu.h.

const ios_base::openmode mode_w = ios_base::out | ios_base::trunc

Definition at line 200 of file cpu.h.

Referenced by vary_input().

const ios_base::openmode mode_wb = mode_w | ios_base::binary

Definition at line 207 of file cpu.h.

const ios_base::openmode mode_wp = ios_base::in | ios_base::out | ios_base::trunc

Definition at line 203 of file cpu.h.

const ios_base::openmode mode_wpb = mode_wp | ios_base::binary

Definition at line 210 of file cpu.h.

const double SMALLDOUBLE = DBL_MIN*100.
const realnum SMALLFLOAT = numeric_limits<realnum>::min()*realnum(100.f)

FLT_MIN is 1.175494351e-38 on wintel, so SMALLFLOAT is 1.175e-36

Definition at line 178 of file cpu.h.

Referenced by AbundancesPrt(), AbundancesSet(), AgeCheck(), atmdat_LAMDA_readin(), atom_levelN(), atom_pop3(), cdB21cm(), cdSPEC2(), cdTemp(), collision_strength_VF01(), ContCreatePointers(), ContRate(), ContSetIntensity(), ConvBase(), ConvEdenIoniz(), ConvInitSolution(), ConvPresTempEdenIoniz(), CoolCarb(), CoolEvaluate(), CoolOxyg(), CS_l_mixing_PS64(), database_prep(), dBase_solve(), DynaNewStep(), DynaStartZone(), FeIILevelPops(), FeIILyaPump(), FeIIRadPress(), FeIISaveLines(), FeIISumBand(), ffun(), H21_cm_pops(), diatomics::H2_LevelPops(), diatomics::H2_PunchDo(), diatomics::H2_RadPress(), diatomics::H2_Solomon_rate(), HeatSum(), hydro_transprob(), IncidentContinuumHere(), diatomics::init(), InitCoreload(), ion_trim(), IonHydro(), iso_collapsed_lifetimes_update(), iso_create(), iso_departure_coefficients(), iso_ionize_recombine(), iso_level(), iso_renorm(), iso_satellite_update(), iso_set_ion_rates(), iter_end_check(), IterEnd(), IterRestart(), lgElemsConserved(), lgStatesConserved(), lines_continuum(), lines_lv1_li_ne(), t_mean::MeanInc(), t_mean::MeanIon(), molcol(), mole_effects(), diatomics::mole_H2_form(), mole_h_fixup(), mole_h_rate_diagnostics(), mole_h_reactions(), OccupationNumberLine(), OpacityAddTotal(), optimize_func(), TransitionProxy::outline(), ParseConstant(), ParseCosmicRays(), ParseMonitorResults(), ParseSet(), ParseStop(), ParseTable(), PressureRadiationLine(), PresTotCurrent(), PrintRatio(), prt_constants(), prt_smooth_predictions(), PrtComment(), PrtFinal(), PrtLinePres(), radius_first(), radius_increment(), radius_next(), RT_continuum(), RT_diffuse(), RT_line_all(), RT_line_fine_opacity(), RT_line_one(), RT_OTS(), RT_recom_effic(), RT_tau_init(), save_colden(), save_line(), SaveDo(), SaveHeat(), SDIV(), SetDeuteriumIonization(), GroupMap::setup(), stepDensity(), TexcLine(), and zero().

const int STDLEN = 32

Definition at line 184 of file cpu.h.

Referenced by t_cpu_i::t_cpu_i().