#include <cpu.h>
Public Member Functions | |
t_cpu () | |
bool | big_endian () const |
bool | little_endian () const |
sys_float | min_float () const |
double | min_double () const |
void | setAssertAbort (bool val) |
bool | lgAssertAbort () const |
void | set_nCPU (long n) |
long | nCPU () const |
void | set_MPI () |
bool | lgMPI () const |
void | set_MPISingleRankMode (bool mode) |
bool | lgMPISingleRankMode () const |
void | set_nRANK (long n) |
long | nRANK () const |
bool | lgMaster () const |
bool | lgMPI_talk () const |
const char * | host_name () const |
void | printDataPath () const |
bool | firstOpen () const |
Private Member Functions | |
void | enable_traps () const |
void | getPathList (const char *fname, vector< string > &PathList, access_scheme scheme) const |
Static Private Member Functions | |
static void | signal_handler (int sig) |
Private Attributes | |
union { | |
char c [4] | |
int32 i | |
} | endian |
sys_float | test_float |
double | test_double |
int32 | Float_SNaN_Value |
int32 | Double_SNaN_Value [2] |
bool | p_lgAssertAbort |
long | n_avail_CPU |
bool | p_lgMPI |
bool | p_lgMPISingleRankMode |
long | n_rank |
char | HostName [STDLEN] |
vector< string > | chSearchPath |
int | nFileDone |
Friends | |
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) |
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) |
Definition at line 217 of file cpu.h.
t_cpu::t_cpu | ( | ) |
Definition at line 40 of file cpu.cpp.
References big_endian(), chSearchPath, CLOUDY_DATA_PATH, DEBUG_ENTRY, Double_SNaN_Value, enable_traps(), endian, Float_SNaN_Value, HostName, i, ioPrnErr, ioQQQ, ioStdin, lgPrnErr, little_endian(), n_avail_CPU, n_rank, nFileDone, p_lgAssertAbort, p_lgMPI, p_lgMPISingleRankMode, signal_handler(), Split(), SPM_RELAX, STDLEN, test_double, and test_float.
bool t_cpu::big_endian | ( | ) | const [inline] |
Definition at line 269 of file cpu.h.
References endian.
Referenced by mie_read_opc(), mie_write_opc(), MyIsnan(), ReadTable(), SaveDo(), and t_cpu().
void t_cpu::enable_traps | ( | ) | const [private] |
Definition at line 255 of file cpu.cpp.
Referenced by signal_handler(), and t_cpu().
bool t_cpu::firstOpen | ( | ) | const [inline] |
void t_cpu::getPathList | ( | const char * | fname, | |
vector< string > & | PathList, | |||
access_scheme | scheme | |||
) | const [private] |
Definition at line 454 of file cpu.cpp.
References AS_DATA_LOCAL, AS_DATA_LOCAL_TRY, AS_DATA_ONLY, AS_DATA_ONLY_TRY, AS_DATA_OPTIONAL, AS_LOCAL_DATA, AS_LOCAL_DATA_TRY, AS_LOCAL_ONLY, AS_LOCAL_ONLY_TRY, chSearchPath, cpu, DEBUG_ENTRY, i, and TotalInsanity().
Referenced by open_data().
const char* t_cpu::host_name | ( | ) | const [inline] |
bool t_cpu::lgAssertAbort | ( | ) | const [inline] |
bool t_cpu::lgMaster | ( | ) | const [inline] |
Definition at line 308 of file cpu.h.
References n_rank.
Referenced by lgMPI_talk(), lgOptimize_do(), main(), phymir_state< X, Y, NP, NSTR >::p_process_output(), phymir_state< X, Y, NP, NSTR >::p_wr_state(), and vary_input().
bool t_cpu::lgMPI | ( | ) | const [inline] |
Definition at line 303 of file cpu.h.
References p_lgMPI.
Referenced by cdMain(), grid_do(), GridGatherInCloudy(), lgCheckMonitors(), optimize_func(), optimize_phymir(), ParseSave(), and vary_input().
bool t_cpu::lgMPI_talk | ( | ) | const [inline] |
Definition at line 309 of file cpu.h.
References lgMaster(), and lgMPISingleRankMode().
Referenced by cdInit(), cdMain(), cdTalk(), gridXspec(), iter_end_check(), lgOptimize_do(), ParseCommands(), and SaveDo().
bool t_cpu::lgMPISingleRankMode | ( | ) | const [inline] |
Definition at line 305 of file cpu.h.
References p_lgMPISingleRankMode.
Referenced by InitDefaultsPreparse(), lgMPI_talk(), and ParseOptimize().
bool t_cpu::little_endian | ( | ) | const [inline] |
double t_cpu::min_double | ( | ) | const [inline] |
sys_float t_cpu::min_float | ( | ) | const [inline] |
long t_cpu::nCPU | ( | ) | const [inline] |
Definition at line 301 of file cpu.h.
References n_avail_CPU.
Referenced by grid_do(), InitDefaultsPreparse(), main(), optimize_phymir(), phymir_state< X, Y, NP, NSTR >::p_execute_job(), and ParseOptimize().
long t_cpu::nRANK | ( | ) | const [inline] |
Definition at line 307 of file cpu.h.
References n_rank.
Referenced by cdMain(), and phymir_state< X, Y, NP, NSTR >::p_execute_job().
void t_cpu::printDataPath | ( | ) | const |
Definition at line 446 of file cpu.cpp.
References chSearchPath, cpu, i, and ioQQQ.
Referenced by AbortErrorMessage(), and ParsePrint().
void t_cpu::set_MPI | ( | ) | [inline] |
void t_cpu::set_MPISingleRankMode | ( | bool | mode | ) | [inline] |
void t_cpu::set_nCPU | ( | long | n | ) | [inline] |
void t_cpu::set_nRANK | ( | long | n | ) | [inline] |
void t_cpu::setAssertAbort | ( | bool | val | ) | [inline] |
Definition at line 280 of file cpu.h.
References p_lgAssertAbort, and signal_handler().
Referenced by cdMain(), and ParseSet().
void t_cpu::signal_handler | ( | int | sig | ) | [static, private] |
Definition at line 434 of file cpu.cpp.
References cpu, and enable_traps().
Referenced by setAssertAbort(), and t_cpu().
void open_data | ( | fstream & | stream, | |
const char * | fname, | |||
ios_base::openmode | mode, | |||
access_scheme | scheme | |||
) | [friend] |
FILE* open_data | ( | const char * | fname, | |
const char * | mode, | |||
access_scheme | scheme | |||
) | [friend] |
void set_NaN | ( | sys_float & | x | ) | [friend] |
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()
set_NaN - set variable or array to SNaN
vector<string> t_cpu::chSearchPath [private] |
the default search path to the data files
Definition at line 259 of file cpu.h.
Referenced by getPathList(), printDataPath(), and t_cpu().
int32 t_cpu::Double_SNaN_Value[2] [private] |
union { ... } t_cpu::endian [private] |
alias an int32 to 4 chars to test if we are on a big-endian or little-endian CPU the array cpu.endian.c[] is initialized in cdInit()
Referenced by big_endian(), little_endian(), and t_cpu().
int32 t_cpu::Float_SNaN_Value [private] |
char t_cpu::HostName[STDLEN] [private] |
the name of the computer, not detected on all systems
Definition at line 257 of file cpu.h.
Referenced by host_name(), and t_cpu().
int32 t_cpu::i |
Definition at line 224 of file cpu.h.
Referenced by getPathList(), printDataPath(), and t_cpu().
long t_cpu::n_avail_CPU [private] |
the number of available CPUs on the system, not detected on all systems
Definition at line 246 of file cpu.h.
Referenced by nCPU(), set_nCPU(), and t_cpu().
long t_cpu::n_rank [private] |
the rank number in an MPI run, -1 otherwise
Definition at line 255 of file cpu.h.
Referenced by lgMaster(), nRANK(), set_nRANK(), and t_cpu().
int t_cpu::nFileDone [private] |
Definition at line 260 of file cpu.h.
Referenced by firstOpen(), open_data(), and t_cpu().
bool t_cpu::p_lgAssertAbort [private] |
should a failed assert raise SIGABRT so that we can catch it in a debugger?
Definition at line 243 of file cpu.h.
Referenced by lgAssertAbort(), setAssertAbort(), and t_cpu().
bool t_cpu::p_lgMPI [private] |
bool t_cpu::p_lgMPISingleRankMode [private] |
flag indicating whether each rank runs its own model true means that each rank runs a different sim (e.g. in a grid) false means that all ranks cooperate on the same sim this flag is moot in a non-MPI run
Definition at line 253 of file cpu.h.
Referenced by lgMPISingleRankMode(), set_MPISingleRankMode(), and t_cpu().
double t_cpu::test_double [private] |
Definition at line 228 of file cpu.h.
Referenced by min_double(), and t_cpu().
sys_float t_cpu::test_float [private] |
Definition at line 227 of file cpu.h.
Referenced by min_float(), and t_cpu().