cloudy
trunk
|
#include "mpi_utilities.h"
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 | CD_ALIGN 16 |
#define | __func__ DEBUG_ENTRY.name() |
#define | NORETURN /*@noreturn@*/ |
#define | FALLTHROUGH (void)0 |
#define | ALIGNED(X) __attribute__ ((aligned(X))) |
#define | RESTRICT |
#define | UNLIKELY(x) (x) |
#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_DEFAULT, AS_DATA_ONLY_TRY, AS_LOCAL_DATA_TRY, AS_LOCAL_ONLY_TRY, AS_DATA_ONLY, AS_DATA_OPTIONAL, AS_LOCAL_DATA, AS_LOCAL_ONLY, AS_SILENT_TRY } |
Functions | |
FILE * | open_data (const char *fname, const char *mode, access_scheme scheme=AS_DEFAULT) |
void | open_data (fstream &stream, const char *fname, ios_base::openmode mode, access_scheme scheme=AS_DEFAULT) |
MPI_File | open_data (const char *fname, int mode, access_scheme scheme=AS_DEFAULT) |
void | check_data (const char *fpath, const char *fname) |
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 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 |
store CPU specific information
Definition in file cpu.h.
#define __COMP "unknown" |
Definition at line 565 of file cpu.h.
Referenced by t_version::t_version().
#define __COMP_VER 0 |
Definition at line 566 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.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++
#define __OS "unknown" |
Definition at line 641 of file cpu.h.
Referenced by t_version::t_version().
#define CD_ALIGN 16 |
Definition at line 156 of file cpu.h.
Referenced by allocator_avx< T >::allocate(), t_avx_pool::p_alloc(), and VecIntegrator< Integrand, Method >::sum().
#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(), and prt_constants().
#define INT16_MIN (-INT16_MAX - 1) |
Definition at line 25 of file cpu.h.
Referenced by prt_constants().
#define INT32_MAX 2147483647L |
Definition at line 49 of file cpu.h.
Referenced by getrf_wrapper(), getrs_wrapper(), and prt_constants().
#define INT32_MIN (-INT32_MAX - 1) |
Definition at line 52 of file cpu.h.
Referenced by prt_constants().
#define UINT16_MAX 65535 |
Definition at line 37 of file cpu.h.
Referenced by prt_constants().
#define UINT32_MAX 4294967295UL |
Definition at line 64 of file cpu.h.
Referenced by prt_constants().
#define UNLIKELY | ( | x | ) | (x) |
Definition at line 473 of file cpu.h.
Referenced by lgNucleiConserved().
#define UNUSED /*@unused@*/ |
Definition at line 14 of file cpu.h.
Referenced by ParseTable(), read_SH98_He1_cross_sections(), and SaveHeat().
enum access_scheme |
flag used as third parameter for open_data, indicates how data files are searched AS_DEFAULT: use default behavior: AS_DATA_ONLY for reading, AS_LOCAL_ONLY for writing AS_DATA_ONLY: search only in the data directories, not in the current working directory AS_DATA_OPTIONAL: same as AS_DATA_ONLY, except that the precense of the file is optional 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_DEFAULT | |
AS_DATA_ONLY_TRY | |
AS_LOCAL_DATA_TRY | |
AS_LOCAL_ONLY_TRY | |
AS_DATA_ONLY | |
AS_DATA_OPTIONAL | |
AS_LOCAL_DATA | |
AS_LOCAL_ONLY | |
AS_SILENT_TRY |
void check_data | ( | const char * | fpath, |
const char * | fname | ||
) |
Definition at line 878 of file cpu.cpp.
References cpu, DEBUG_ENTRY, fprintf(), t_cpu::i(), Singleton< t_version >::Inst(), ioQQQ, t_prt::lgPrintTime, MD5datastream(), t_cpu_i::md5sum_expct, mode_r, t_cpu_i::nMD5Mismatch, and prt.
Referenced by open_data().
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 977 of file cpu.cpp.
Referenced by ParseCrashDo().
bool MyIsnan | ( | const double & | x | ) |
detect quiet and signaling NaNs in double precision FP
Definition at line 992 of file cpu.cpp.
References t_cpu_i::big_endian(), cpu, t_cpu::i(), and t_cpu_i::little_endian().
FILE* open_data | ( | const char * | fname, |
const char * | mode, | ||
access_scheme | scheme = AS_DEFAULT |
||
) |
Definition at line 765 of file cpu.cpp.
References AbortErrorMessage(), AS_DATA_ONLY, AS_DATA_OPTIONAL, AS_DEFAULT, AS_LOCAL_DATA, AS_LOCAL_ONLY, check_data(), check_mult_path(), cpu, DEBUG_ENTRY, t_cpu_i::getPathList(), t_cpu::i(), lgAbort, t_cpu_i::nFileDone, and sys_fopen().
Referenced by append_file(), atmdat_CHIANTI_readin(), atmdat_LAMDA_readin(), atmdat_STOUT_readin(), Badnell_rec_init(), cdGetLineList(), cdInput(), cdMain(), cdOutput(), cdRead(), check_grid_file(), CloudyPrintReference(), ContBandsCreate(), CoStarInitialize(), database_readin(), DatabasePrintReference(), DrivePump(), DumpAtmosphere(), GetStandardHeLines(), GridGatherOutputParallel(), GridGatherOutputSequential(), diatomics::H2_CollidRateRead(), diatomics::H2_Read_hminus_distribution(), diatomics::H2_Read_LTE_cooling_per_H2(), diatomics::H2_ReadDissocEnergies(), diatomics::H2_ReadDissprob(), diatomics::H2_ReadEnergies(), diatomics::H2_ReadTransprob(), HeCollidSetup(), HelikeTransProbSetup(), HyperfineCreate(), t_yield::init_yield(), InitGrid(), input_readvector(), InterpolateGridCoStar(), InterpolateRectGrid(), iso_recomb_setup(), lgCompileAtmosphere(), lgFileReadable(), lgOptimize_do(), lgValidASCIIFile(), lgValidBinFile(), bands_file::load(), LoadIsotopes(), main(), MD5datafile(), MD5file(), mie_read_mix(), mie_read_opc(), mie_read_rfi(), mie_read_szd(), mie_write_opc(), open_abn_file(), optimize_phymir(), phymir_state< X, Y, NP, NSTR >::p_execute_job_parallel(), phymir_state< X, Y, NP, NSTR >::p_rd_state(), t_gaunt::p_read_table(), t_mesh::p_ReadResolution(), phymir_state< X, Y, NP, NSTR >::p_wr_state(), ParseDrive(), ParseInit(), ParseState(), ParseTable(), plot_sparsity(), pnegopc(), process_output(), qheat(), RauchInitialize(), RauchReadMPP(), rd_block(), read_data(), read_Helike_cross_sections(), read_Hummer_Storey(), read_level2_lines(), read_mewe_gbar(), diatomics::Read_Mol_Diss_cross_sections(), read_SH98_He1_cross_sections(), read_species_file(), read_UTA_lines(), ReadAugerData(), ReadBadnellAIData(), ReadTable(), save_opacity(), saveFITSfile(), SaveGrid(), StarburstInitialize(), state_get_put(), t_ADfA::t_ADfA(), vary_input(), and wr_block().
void open_data | ( | fstream & | stream, |
const char * | fname, | ||
ios_base::openmode | mode, | ||
access_scheme | scheme = AS_DEFAULT |
||
) |
Definition at line 803 of file cpu.cpp.
References AbortErrorMessage(), AS_DATA_ONLY, AS_DATA_OPTIONAL, AS_DEFAULT, AS_LOCAL_DATA, AS_LOCAL_ONLY, ASSERT, check_data(), check_mult_path(), cpu, DEBUG_ENTRY, t_cpu_i::getPathList(), t_cpu::i(), lgAbort, and t_cpu_i::nFileDone.
MPI_File open_data | ( | const char * | fname, |
int | mode, | ||
access_scheme | scheme = AS_DEFAULT |
||
) |
Definition at line 838 of file cpu.cpp.
References AbortErrorMessage(), AS_DATA_ONLY, AS_DATA_OPTIONAL, AS_DEFAULT, AS_LOCAL_DATA, AS_LOCAL_ONLY, check_data(), check_mult_path(), cpu, DEBUG_ENTRY, t_cpu_i::getPathList(), t_cpu::i(), lgAbort, MPI_ERR_INTERN, MPI_FILE_NULL, MPI_File_open, mpi_mode_r, MPI_SUCCESS, and t_cpu_i::nFileDone.
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 906 of file cpu.cpp.
References cpu, t_cpu_i::Float_SNaN_Value, and t_cpu::i().
Referenced by t_ionbal::alloc(), Amsterdam_Method(), ConvInitSolution(), invalidate_array(), MyMalloc_base(), iter_track::p_clear1(), t_gaunt::p_gauntff_vec(), ParseBlackbody(), ParseCrashDo(), and t_hmi::zero().
void set_NaN | ( | sys_float | x[], |
long | n | ||
) |
Definition at line 914 of file cpu.cpp.
References cpu, t_cpu_i::Float_SNaN_Value, and t_cpu::i().
void set_NaN | ( | double & | x | ) |
Definition at line 932 of file cpu.cpp.
References cpu, t_cpu_i::Double_SNaN_Value, and t_cpu::i().
void set_NaN | ( | double | x[], |
long | n | ||
) |
Definition at line 949 of file cpu.cpp.
References cpu, t_cpu_i::Double_SNaN_Value, and t_cpu::i().
const double BIGDOUBLE = DBL_MAX/100. |
DBL_MAX is 1.797e308 on wintel so BIGDOUBLE is 1.797e306
Definition at line 249 of file cpu.h.
Referenced by atmdat_CHIANTI_readin(), t_timesc::calc_therm_timesc(), conorm(), CS_l_mixing_PS64(), exp10(), iso_collide(), iso_set_ion_rates(), ParseDynaWind(), ParseTable(), prt_constants(), and RandGauss().
set something that is too small to max of quantity and SMALLFLOAT, but then compare with SMALLFLOAT
Definition at line 244 of file cpu.h.
Referenced by ContSetIntensity(), ConvFail(), database_prep(), DynaNewStep(), DynaStartZone(), exp10f(), ffun(), t_LineSave::findline(), diatomics::H2_DR(), diatomics::init(), iter_end_check(), IterStart(), mole_get_equilibrium_condition(), mole_partition_function(), mole_solve(), ParseBlackbody(), ParseConstant(), ParseElement(), PrintSpectrum(), prt_constants(), SumDensities(), and t_dynamics::zero().
|
static |
Definition at line 427 of file cpu.h.
Referenced by AbortErrorMessage(), cdInit(), cdMain(), cdPrepareExit(), cdTalk(), check_data(), load_balance::finalize(), grid_do(), GridGatherOutput(), GridGatherOutputParallel(), gridXspec(), load_balance::init(), InitDefaultsPreparse(), iter_end_check(), lgCheckMonitors(), lgOptimize_do(), main(), MD5string(), mie_read_opc(), mie_write_opc(), MyIsnan(), open_data(), optimize_phymir(), OUT_OF_RANGE(), phymir_state< X, Y, NP, NSTR >::p_execute_job(), phymir_state< X, Y, NP, NSTR >::p_process_output(), phymir_state< X, Y, NP, NSTR >::p_wr_state(), ParseCommands(), ParseGrid(), ParseOptimize(), ParsePrint(), ParseSet(), process_output(), prt_constants(), PrtComment(), ReadTable(), SaveDo(), SaveGrid(), set_NaN(), t_cpu_i::signal_handler(), t_version::t_version(), and vary_input().
const ios_base::openmode mode_a = ios_base::out | ios_base::app |
Definition at line 269 of file cpu.h.
Referenced by check_grid_file().
const ios_base::openmode mode_ap = ios_base::in | ios_base::out | ios_base::app |
const ios_base::openmode mode_r = ios_base::in |
Definition at line 267 of file cpu.h.
Referenced by atmdat_CHIANTI_readin(), check_data(), check_grid_file(), CloudyPrintReference(), DatabasePrintReference(), t_cpu_i::getMD5sums(), input_readvector(), lgValidASCIIFile(), MD5datafile(), MD5file(), t_gaunt::p_read_table(), RauchReadMPP(), read_species_file(), and ReadBadnellAIData().
const ios_base::openmode mode_rp = ios_base::in | ios_base::out |
const ios_base::openmode mode_w = ios_base::out | ios_base::trunc |
Definition at line 268 of file cpu.h.
Referenced by vary_input().
const ios_base::openmode mode_wp = ios_base::in | ios_base::out | ios_base::trunc |
const double SMALLDOUBLE = DBL_MIN*100. |
Definition at line 250 of file cpu.h.
Referenced by conorm(), ConvInitSolution(), ffun(), IonHydro(), iso_collide(), iso_radrecomb_from_cross_section(), iso_satellite_update(), ParseMonitorResults(), PrintSpectrum(), prt_constants(), PrtOneMonitor(), and RT_OTS_Update().
FLT_MIN is 1.175494351e-38 on wintel, so SMALLFLOAT is 1.175e-36
Definition at line 246 of file cpu.h.
Referenced by AbundancesPrt(), AbundancesSet(), AgeCheck(), atmdat_LAMDA_readin(), cdB21cm(), cdTemp(), collision_strength_VF01(), ContCreatePointers(), ContRate(), ContSetIntensity(), ConvBase(), ConvEdenIoniz(), ConvInitSolution(), ConvPresTempEdenIoniz(), CS_l_mixing_PS64(), CS_l_mixing_PS64_expI(), database_prep(), dBase_solve(), DynaNewStep(), DynaStartZone(), H21_cm_pops(), diatomics::H2_LevelPops(), diatomics::H2_PunchDo(), diatomics::H2_RadPress(), diatomics::H2_Solomon_rate(), hydro_transprob(), IncidentContinuumHere(), diatomics::init(), InitCoreload(), ion_photo(), ion_trim(), ion_trim2(), ion_trim_validate(), 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(), IterStart(), lgElemsConserved(), lgStatesConserved(), lines(), t_mean::MeanInc(), t_mean::MeanIon(), molcol(), mole_effects(), mole_h_fixup(), mole_h_rate_diagnostics(), mole_h_reactions(), OccupationNumberLine(), OpacityAddTotal(), Atom_LevelN::operator()(), optimize_func(), TransitionProxy::outline(), ParseConstant(), ParseCosmicRays(), ParseMonitorResults(), ParseSet(), ParseStop(), PressureRadiationLine(), PresTotCurrent(), PrintRatio(), prt_constants(), prt_smooth_predictions(), PrtComment(), PrtFinal(), PrtHeader(), PrtLinePres(), radius_first(), radius_increment(), radius_next(), RT_continuum(), RT_diffuse(), RT_line_all_escape(), RT_line_fine_opacity(), RT_line_one_escape(), RT_line_one_fine(), RT_OTS(), RT_recom_effic(), RT_tau_init(), save_line(), SaveDo(), SaveHeat(), SDIV(), SecIoniz(), GroupMap::setup(), setXtraRatesFe2(), stepDensity(), pseudo_cont::sumBand(), species_bands::sumBand(), TexcLine(), and t_radius::zero().
const int STDLEN = 32 |
Definition at line 252 of file cpu.h.
Referenced by t_cpu_i::t_cpu_i().