cloudy trunk
Loading...
Searching...
No Matches
t_cpu_i Class Reference

#include <cpu.h>

Collaboration diagram for t_cpu_i:

Public Member Functions

 t_cpu_i ()
bool big_endian () const
bool little_endian () const
sys_float min_float () const
double min_double () const
void set_signal_handlers ()
void setAssertAbort (bool val)
bool lgAssertAbort () const
void set_nCPU (long n)
long nCPU () const
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
char chDirSeparator () const
bool firstOpen () const
const string & chExitStatus (exit_type s) 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
char p_chDirSeparator
int nFileDone
vector< string > p_exit_status

Friends

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)

Detailed Description

Definition at line 231 of file cpu.h.

Constructor & Destructor Documentation

◆ t_cpu_i()

Member Function Documentation

◆ big_endian()

bool t_cpu_i::big_endian ( ) const
inline

Definition at line 287 of file cpu.h.

References endian.

Referenced by t_cpu_i().

◆ chDirSeparator()

char t_cpu_i::chDirSeparator ( ) const
inline

Definition at line 331 of file cpu.h.

References p_chDirSeparator.

◆ chExitStatus()

const string & t_cpu_i::chExitStatus ( exit_type s) const
inline

Definition at line 333 of file cpu.h.

References p_exit_status.

◆ enable_traps()

void t_cpu_i::enable_traps ( ) const
private

Definition at line 293 of file cpu.cpp.

Referenced by t_cpu_i().

◆ firstOpen()

bool t_cpu_i::firstOpen ( ) const
inline

Definition at line 332 of file cpu.h.

References nFileDone.

◆ getPathList()

void t_cpu_i::getPathList ( const char * fname,
vector< string > & PathList,
access_scheme scheme ) const
private

◆ host_name()

const char * t_cpu_i::host_name ( ) const
inline

Definition at line 329 of file cpu.h.

References HostName.

◆ lgAssertAbort()

bool t_cpu_i::lgAssertAbort ( ) const
inline

Definition at line 318 of file cpu.h.

References p_lgAssertAbort.

◆ lgMaster()

bool t_cpu_i::lgMaster ( ) const
inline

Definition at line 327 of file cpu.h.

References n_rank.

Referenced by lgMPI_talk().

◆ lgMPI()

bool t_cpu_i::lgMPI ( ) const
inline

Definition at line 322 of file cpu.h.

References p_lgMPI.

◆ lgMPI_talk()

bool t_cpu_i::lgMPI_talk ( ) const
inline

Definition at line 328 of file cpu.h.

References lgMaster(), and lgMPISingleRankMode().

Here is the call graph for this function:

◆ lgMPISingleRankMode()

bool t_cpu_i::lgMPISingleRankMode ( ) const
inline

Definition at line 324 of file cpu.h.

References p_lgMPISingleRankMode.

Referenced by lgMPI_talk().

◆ little_endian()

bool t_cpu_i::little_endian ( ) const
inline

Definition at line 288 of file cpu.h.

References endian.

Referenced by t_cpu_i().

◆ min_double()

double t_cpu_i::min_double ( ) const
inline

Definition at line 291 of file cpu.h.

References test_double.

◆ min_float()

sys_float t_cpu_i::min_float ( ) const
inline

Definition at line 290 of file cpu.h.

References test_float.

◆ nCPU()

long t_cpu_i::nCPU ( ) const
inline

Definition at line 321 of file cpu.h.

References n_avail_CPU.

◆ nRANK()

long t_cpu_i::nRANK ( ) const
inline

Definition at line 326 of file cpu.h.

References n_rank.

◆ printDataPath()

void t_cpu_i::printDataPath ( ) const

Definition at line 524 of file cpu.cpp.

References chSearchPath, i, and ioQQQ.

◆ set_MPISingleRankMode()

void t_cpu_i::set_MPISingleRankMode ( bool mode)
inline

Definition at line 323 of file cpu.h.

References p_lgMPISingleRankMode.

◆ set_nCPU()

void t_cpu_i::set_nCPU ( long n)
inline

Definition at line 320 of file cpu.h.

References n_avail_CPU.

◆ set_nRANK()

void t_cpu_i::set_nRANK ( long n)
inline

Definition at line 325 of file cpu.h.

References n_rank.

◆ set_signal_handlers()

void t_cpu_i::set_signal_handlers ( )

Definition at line 477 of file cpu.cpp.

References DEBUG_ENTRY, and signal_handler().

Referenced by t_cpu_i().

Here is the call graph for this function:

◆ setAssertAbort()

void t_cpu_i::setAssertAbort ( bool val)
inline

Definition at line 300 of file cpu.h.

References p_lgAssertAbort, and signal_handler().

Here is the call graph for this function:

◆ signal_handler()

void t_cpu_i::signal_handler ( int sig)
staticprivate

Definition at line 512 of file cpu.cpp.

References cpu, and signal_handler().

Referenced by set_signal_handlers(), setAssertAbort(), and signal_handler().

Here is the call graph for this function:

◆ open_data [1/2]

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

◆ open_data [2/2]

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

◆ set_NaN [1/4]

void set_NaN ( double & x)
friend

Definition at line 708 of file cpu.cpp.

References cpu.

◆ set_NaN [2/4]

void set_NaN ( double x[],
long n )
friend

Definition at line 725 of file cpu.cpp.

References cpu, and i.

◆ set_NaN [3/4]

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

Definition at line 682 of file cpu.cpp.

References cpu.

◆ set_NaN [4/4]

void set_NaN ( sys_float x[],
long n )
friend

Definition at line 690 of file cpu.cpp.

References cpu, and i.

Field Documentation

◆ c

char t_cpu_i::c[4]

Definition at line 237 of file cpu.h.

◆ chSearchPath

vector<string> t_cpu_i::chSearchPath
private

the default search path to the data files

Definition at line 273 of file cpu.h.

Referenced by printDataPath(), and t_cpu_i().

◆ Double_SNaN_Value

int32 t_cpu_i::Double_SNaN_Value[2]
private

Definition at line 248 of file cpu.h.

Referenced by t_cpu_i().

◆ [union]

union { ... } t_cpu_i::endian

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

◆ Float_SNaN_Value

int32 t_cpu_i::Float_SNaN_Value
private

Definition at line 244 of file cpu.h.

Referenced by t_cpu_i().

◆ HostName

char t_cpu_i::HostName[STDLEN]
private

the name of the computer, not detected on all systems

Definition at line 271 of file cpu.h.

Referenced by host_name(), and t_cpu_i().

◆ i

int32 t_cpu_i::i

Definition at line 238 of file cpu.h.

Referenced by getPathList(), printDataPath(), set_NaN, set_NaN, and t_cpu_i().

◆ n_avail_CPU

long t_cpu_i::n_avail_CPU
private

the number of available CPUs on the system, not detected on all systems

Definition at line 260 of file cpu.h.

Referenced by nCPU(), set_nCPU(), and t_cpu_i().

◆ n_rank

long t_cpu_i::n_rank
private

the rank number in an MPI run, -1 otherwise

Definition at line 269 of file cpu.h.

Referenced by lgMaster(), nRANK(), set_nRANK(), and t_cpu_i().

◆ nFileDone

int t_cpu_i::nFileDone
private

Definition at line 276 of file cpu.h.

Referenced by firstOpen(), and t_cpu_i().

◆ p_chDirSeparator

char t_cpu_i::p_chDirSeparator
private

the directory separator character for this OS

Definition at line 275 of file cpu.h.

Referenced by chDirSeparator(), and t_cpu_i().

◆ p_exit_status

vector<string> t_cpu_i::p_exit_status
private

Definition at line 281 of file cpu.h.

Referenced by chExitStatus(), and t_cpu_i().

◆ p_lgAssertAbort

bool t_cpu_i::p_lgAssertAbort
private

should a failed assert raise SIGABRT so that we can catch it in a debugger?

Definition at line 257 of file cpu.h.

Referenced by lgAssertAbort(), setAssertAbort(), and t_cpu_i().

◆ p_lgMPI

bool t_cpu_i::p_lgMPI
private

flag whether we are doing an MPI run or not

Definition at line 262 of file cpu.h.

Referenced by lgMPI(), and t_cpu_i().

◆ p_lgMPISingleRankMode

bool t_cpu_i::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 267 of file cpu.h.

Referenced by lgMPISingleRankMode(), set_MPISingleRankMode(), and t_cpu_i().

◆ test_double

double t_cpu_i::test_double
private

Definition at line 242 of file cpu.h.

Referenced by min_double(), and t_cpu_i().

◆ test_float

sys_float t_cpu_i::test_float
private

Definition at line 241 of file cpu.h.

Referenced by min_float(), and t_cpu_i().


The documentation for this class was generated from the following files: