cloudy trunk
Loading...
Searching...
No Matches
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 UNUSED   /*@unused@*/
#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)
#define DO_EXPAND(VAL)
#define 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

UNUSED 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 UNUSED mode_rb = mode_r | ios_base::binary
const ios_base::openmode UNUSED mode_wb = mode_w | ios_base::binary
const ios_base::openmode UNUSED mode_ab = mode_a | ios_base::binary
const ios_base::openmode UNUSED mode_rpb = mode_rp | ios_base::binary
const ios_base::openmode UNUSED mode_wpb = mode_wp | ios_base::binary
const ios_base::openmode UNUSED 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

◆ __COMP

#define __COMP   "unknown"

Definition at line 479 of file cpu.h.

Referenced by t_version::t_version().

◆ __COMP_VER

#define __COMP_VER   0

Definition at line 480 of file cpu.h.

Referenced by t_version::t_version().

◆ __func__

#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. failsafe for obsolete or buggy systems to assure that the POSIX symbol linux is defined on SGI IA64 systems, icc calls itself ecc... this is needed to discriminate between g++ and icc/pathCC/openCC/clang++

Definition at line 182 of file cpu.h.

◆ __OS

#define __OS   "unknown"

Definition at line 555 of file cpu.h.

Referenced by t_version::t_version().

◆ DO_EXPAND

#define DO_EXPAND ( VAL)
Value:
VAL ## 1

Definition at line 402 of file cpu.h.

◆ EXPAND

#define EXPAND ( VAL)
Value:
#define DO_EXPAND(VAL)
Definition cpu.h:402

Definition at line 403 of file cpu.h.

◆ INT16_MAX

#define INT16_MAX   32767

some definitions for integers with a guaranteed number of bits

Definition at line 22 of file cpu.h.

Referenced by iso_continuum_lower().

◆ INT16_MIN

#define INT16_MIN   (-INT16_MAX - 1)

Definition at line 25 of file cpu.h.

◆ INT32_MAX

#define INT32_MAX   2147483647L

Definition at line 49 of file cpu.h.

Referenced by getrf_wrapper(), and getrs_wrapper().

◆ INT32_MIN

#define INT32_MIN   (-INT32_MAX - 1)

Definition at line 52 of file cpu.h.

◆ NORETURN

#define NORETURN   /*@noreturn@*/

◆ RESTRICT

#define RESTRICT

Definition at line 386 of file cpu.h.

◆ UINT16_MAX

#define UINT16_MAX   65535

Definition at line 37 of file cpu.h.

◆ UINT32_MAX

#define UINT32_MAX   4294967295UL

Definition at line 64 of file cpu.h.

◆ UINT64_MAX

#define UINT64_MAX   18446744073709551615UL

Definition at line 99 of file cpu.h.

◆ UNLIKELY

#define UNLIKELY ( x)
Value:
(x)

Definition at line 387 of file cpu.h.

Referenced by lgNucleiConserved().

◆ UNUSED

#define UNUSED   /*@unused@*/

Definition at line 14 of file cpu.h.

Referenced by ParseSet(), and read_SH98_He1_cross_sections().

Enumeration Type Documentation

◆ access_scheme

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 207 of file cpu.h.

Function Documentation

◆ MyIsnan() [1/2]

bool MyIsnan ( const double & x)

detect quiet and signaling NaNs in double precision FP

Definition at line 768 of file cpu.cpp.

References cpu.

◆ MyIsnan() [2/2]

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 753 of file cpu.cpp.

Referenced by ParseCrashDo().

◆ open_data() [1/2]

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

Definition at line 335 of file cpu.cpp.

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().

◆ open_data() [2/2]

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

Definition at line 336 of file cpu.cpp.

◆ set_NaN() [1/4]

void set_NaN ( double & x)

Definition at line 340 of file cpu.cpp.

◆ set_NaN() [2/4]

void set_NaN ( double x[],
long n )

Definition at line 341 of file cpu.cpp.

◆ set_NaN() [3/4]

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 338 of file cpu.cpp.

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

◆ set_NaN() [4/4]

void set_NaN ( sys_float x[],
long n )

Definition at line 339 of file cpu.cpp.

Variable Documentation

◆ BIGDOUBLE

const double BIGDOUBLE = DBL_MAX/100.

DBL_MAX is 1.797e308 on wintel so BIGDOUBLE is 1.797e306

Definition at line 194 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().

◆ BIGFLOAT

UNUSED const realnum BIGFLOAT = numeric_limits<realnum>::max()/realnum(100.f)

◆ cpu

◆ mode_a

const ios_base::openmode mode_a = ios_base::out | ios_base::app

Definition at line 214 of file cpu.h.

Referenced by check_grid_file().

◆ mode_ab

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

Definition at line 221 of file cpu.h.

◆ mode_ap

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

Definition at line 217 of file cpu.h.

◆ mode_apb

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

Definition at line 224 of file cpu.h.

◆ mode_r

◆ mode_rb

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

Definition at line 219 of file cpu.h.

◆ mode_rp

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

Definition at line 215 of file cpu.h.

◆ mode_rpb

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

Definition at line 222 of file cpu.h.

◆ mode_w

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

Definition at line 213 of file cpu.h.

Referenced by vary_input().

◆ mode_wb

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

Definition at line 220 of file cpu.h.

◆ mode_wp

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

Definition at line 216 of file cpu.h.

◆ mode_wpb

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

Definition at line 223 of file cpu.h.

◆ SMALLDOUBLE

◆ SMALLFLOAT

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 191 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(), SDIV(), SetDeuteriumIonization(), GroupMap::setup(), stepDensity(), TexcLine(), and zero().

◆ STDLEN

const int STDLEN = 32

Definition at line 197 of file cpu.h.

Referenced by t_cpu_i::t_cpu_i().