cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
cpu.cpp File Reference
#include "cdstd.h"
#include <locale.h>
#include "cddefines.h"
#include "path.h"
#include "trace.h"
#include "service.h"
#include "thirdparty.h"
#include "version.h"
#include "prt.h"
Include dependency graph for cpu.cpp:

Go to the source code of this file.

Functions

STATIC NORETURN void AbortErrorMessage (const char *fname, const vector< string > &PathList, access_scheme scheme)
 
STATIC string check_mult_path (const char *fname, const vector< string > &PathList, access_scheme scheme, bool lgRead)
 
FILE * open_data (const char *fname, const char *mode, access_scheme scheme)
 
void open_data (fstream &stream, const char *fname, ios_base::openmode mode, access_scheme scheme)
 
MPI_File open_data (const char *fname, int mode, access_scheme scheme)
 
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

static int cpu_count = 0
 

Detailed Description

implement hardware dependent definitions

Definition in file cpu.cpp.

Function Documentation

STATIC NORETURN void AbortErrorMessage ( const char *  fname,
const vector< string > &  PathList,
access_scheme  scheme 
)

Definition at line 668 of file cpu.cpp.

References AS_DATA_ONLY, AS_DATA_OPTIONAL, cdEXIT, cpu, DEBUG_ENTRY, EXIT_FAILURE, t_cpu_i::firstOpen(), fprintf(), t_cpu::i(), ioQQQ, and t_cpu_i::printDataPath().

Referenced by open_data().

Here is the call graph for this function:

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

Here is the call graph for this function:

STATIC string check_mult_path ( const char *  fname,
const vector< string > &  PathList,
access_scheme  scheme,
bool  lgRead 
)

Definition at line 720 of file cpu.cpp.

References AS_SILENT_TRY, ASSERT, DEBUG_ENTRY, fprintf(), ioQQQ, t_trace::lgTrace, sys_fopen(), TorF(), and trace.

Referenced by open_data().

Here is the call graph for this function:

bool MyIsnan ( const sys_float x)

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

Variable Documentation

int cpu_count = 0
static

Definition at line 54 of file cpu.cpp.

Referenced by t_cpu::t_cpu(), and t_cpu::~t_cpu().