Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
t_cpu_i Class Reference

#include <cpu.h>

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 set_nCPU (long n)
long nCPU () const
void set_used_nCPU (long n)
long used_nCPU () const
bool lgMPI () const
void set_MPIMode (MPI_state mode)
MPI_state MPIMode () const
void set_nRANK (long n)
long nRANK () const
bool lgMaster () const
bool lgMPI_talk () const
void set_ExecName (const string &name)
void disableBacktrace ()
void enableBacktrace ()
void GenerateBacktrace (void *ptr)
void PrintBacktrace (const string &s, bool lgPrintSeed=true)
const string & ExecName () const
const char * host_name () const
void printDataPath (const string &pattern) const
string chDirSeparator () const
bool firstOpen () const
bool foundCSMismatch () const
const string & chExitStatus (exit_type s) const
void initPath ()

Private Member Functions

void p_assertValidPath ()
void enable_traps () const
void p_splitPath (const string &path, string &head, string &tail) const
void p_getPathList (const string &fname, vector< string > &PathList, access_scheme scheme, bool lgRead) const
void p_getFileList (vector< string > &results, const string &pattern, bool lgStrip) const
void p_getchecksums (const string &fname)

Static Private Member Functions

static void signal_handler (int sig, siginfo_t *, void *ptr)

Private Attributes

union { 
   char   c [4] 
   int32   i 
endian
sys_float test_float
double test_double
int32 Float_SNaN_Value
int64 Double_SNaN_Value
long n_avail_CPU
long n_use_CPU
bool p_lgMPI
MPI_state p_MPIMode
long n_rank
string p_ExecName
vector< string > chTraceback
char HostName [STDLEN]
vector< string > chSearchPath
string p_chCloudyRoot
char p_chDirSeparator
int nFileDone
int nCSMismatch
map< string, string > checksum_expct
bool lgPathInitialized
bool p_suppressBacktrace
vector< string > p_exit_status

Friends

void getFileList (vector< string > &results, const string &pattern)
FILE * open_data (const string &fname, const string &mode, access_scheme scheme=AS_DEFAULT, string *rpath=nullptr)
void open_data (fstream &stream, const string &fname, ios_base::openmode mode, access_scheme scheme=AS_DEFAULT, string *rpath=nullptr)
MPI_File open_data (const string &fname, int mode, access_scheme scheme=AS_DEFAULT, string *rpath=nullptr)
void check_data (const string &fpath, const string &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)

Constructor & Destructor Documentation

◆ t_cpu_i()

Member Function Documentation

◆ big_endian()

bool t_cpu_i::big_endian ( ) const
inline

References endian.

Referenced by t_cpu_i().

◆ chDirSeparator()

string t_cpu_i::chDirSeparator ( ) const
inline

References p_chDirSeparator.

◆ chExitStatus()

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

References p_exit_status.

◆ disableBacktrace()

void t_cpu_i::disableBacktrace ( )
inline

References p_suppressBacktrace.

◆ enable_traps()

void t_cpu_i::enable_traps ( ) const
private

Referenced by t_cpu_i().

◆ enableBacktrace()

void t_cpu_i::enableBacktrace ( )
inline

References p_suppressBacktrace.

◆ ExecName()

const string & t_cpu_i::ExecName ( ) const
inline

References p_ExecName.

◆ firstOpen()

bool t_cpu_i::firstOpen ( ) const
inline

References nFileDone.

◆ foundCSMismatch()

bool t_cpu_i::foundCSMismatch ( ) const
inline

References nCSMismatch.

◆ GenerateBacktrace()

void t_cpu_i::GenerateBacktrace ( void * ptr)

◆ host_name()

const char * t_cpu_i::host_name ( ) const
inline

References HostName.

◆ initPath()

void t_cpu_i::initPath ( )

◆ lgMaster()

bool t_cpu_i::lgMaster ( ) const
inline

References n_rank.

Referenced by lgMPI_talk().

◆ lgMPI()

bool t_cpu_i::lgMPI ( ) const
inline

References p_lgMPI.

◆ lgMPI_talk()

bool t_cpu_i::lgMPI_talk ( ) const
inline

References lgMaster(), MS_GRID, and p_MPIMode.

Here is the call graph for this function:

◆ little_endian()

bool t_cpu_i::little_endian ( ) const
inline

References endian.

Referenced by t_cpu_i().

◆ min_double()

double t_cpu_i::min_double ( ) const
inline

References test_double.

◆ min_float()

sys_float t_cpu_i::min_float ( ) const
inline

References test_float.

◆ MPIMode()

MPI_state t_cpu_i::MPIMode ( ) const
inline

References p_MPIMode.

◆ nCPU()

long t_cpu_i::nCPU ( ) const
inline

References n_avail_CPU.

◆ nRANK()

long t_cpu_i::nRANK ( ) const
inline

References n_rank.

◆ p_assertValidPath()

void t_cpu_i::p_assertValidPath ( )
private

aborts if search path is not set up

References EXIT_FAILURE, fprintf(), and lgPathInitialized.

Here is the call graph for this function:

◆ p_getchecksums()

void t_cpu_i::p_getchecksums ( const string & fname)
private

References checksum_expct, DEBUG_ENTRY, FindAndReplace(), mode_r, open_data, and p_chDirSeparator.

Referenced by initPath().

Here is the call graph for this function:

◆ p_getFileList()

void t_cpu_i::p_getFileList ( vector< string > & results,
const string & pattern,
bool lgStrip ) const
private

References chSearchPath, DEBUG_ENTRY, getFileListSub(), lgPathInitialized, and p_splitPath().

Referenced by printDataPath().

Here is the call graph for this function:

◆ p_getPathList()

void t_cpu_i::p_getPathList ( const string & fname,
vector< string > & PathList,
access_scheme scheme,
bool lgRead ) const
private

References AS_LOCAL_ONLY, AS_LOCAL_ONLY_TRY, cdEXIT, chSearchPath, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), i, ioQQQ, and p_chDirSeparator.

Here is the call graph for this function:

◆ p_splitPath()

void t_cpu_i::p_splitPath ( const string & path,
string & head,
string & tail ) const
inlineprivate

References p_chDirSeparator.

Referenced by p_getFileList().

◆ PrintBacktrace()

void t_cpu_i::PrintBacktrace ( const string & s,
bool lgPrintSeed = true )

References chTraceback, fprintf(), i, ioQQQ, and ran.

Here is the call graph for this function:

◆ printDataPath()

void t_cpu_i::printDataPath ( const string & pattern) const

References chSearchPath, fprintf(), i, ioQQQ, lgPathInitialized, and p_getFileList().

Here is the call graph for this function:

◆ set_ExecName()

void t_cpu_i::set_ExecName ( const string & name)
inline

References p_ExecName.

◆ set_MPIMode()

void t_cpu_i::set_MPIMode ( MPI_state mode)
inline

References p_MPIMode.

◆ set_nCPU()

void t_cpu_i::set_nCPU ( long n)
inline

References n_avail_CPU.

◆ set_nRANK()

void t_cpu_i::set_nRANK ( long n)
inline

References n_rank.

◆ set_signal_handlers()

void t_cpu_i::set_signal_handlers ( )

References DEBUG_ENTRY, NULL, and signal_handler().

Referenced by t_cpu_i().

Here is the call graph for this function:

◆ set_used_nCPU()

void t_cpu_i::set_used_nCPU ( long n)
inline

References n_use_CPU.

◆ signal_handler()

void t_cpu_i::signal_handler ( int sig,
siginfo_t * ,
void * ptr )
staticprivate

References cpu, and signal_handler().

Referenced by set_signal_handlers(), and signal_handler().

Here is the call graph for this function:

◆ used_nCPU()

long t_cpu_i::used_nCPU ( ) const
inline

References n_use_CPU.

◆ check_data

void check_data ( const string & fpath,
const string & fname )
friend

◆ getFileList

void getFileList ( vector< string > & results,
const string & pattern )
friend

References cpu.

◆ open_data [1/3]

FILE * open_data ( const string & fname,
const string & mode,
access_scheme scheme = AS_DEFAULT,
string * rpath = nullptr )
friend

◆ open_data [2/3]

MPI_File open_data ( const string & fname,
int mode,
access_scheme scheme = AS_DEFAULT,
string * rpath = nullptr )
friend

◆ open_data [3/3]

void open_data ( fstream & stream,
const string & fname,
ios_base::openmode mode,
access_scheme scheme = AS_DEFAULT,
string * rpath = nullptr )
friend

◆ set_NaN [1/4]

void set_NaN ( double & x)
friend

References cpu.

◆ set_NaN [2/4]

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

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

References cpu.

◆ set_NaN [4/4]

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

References cpu, and i.

Member Data Documentation

◆ c

char t_cpu_i::c[4]

◆ checksum_expct

map<string,string> t_cpu_i::checksum_expct
private

the map of the checksums of all the data files

Referenced by p_getchecksums().

◆ chSearchPath

vector<string> t_cpu_i::chSearchPath
private

the default search path to the data files

Referenced by initPath(), p_getFileList(), p_getPathList(), and printDataPath().

◆ chTraceback

vector<string> t_cpu_i::chTraceback
private

the generated traceback will be stored here to be printed later

Referenced by PrintBacktrace().

◆ Double_SNaN_Value

int64 t_cpu_i::Double_SNaN_Value
private

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

Referenced by t_cpu_i().

◆ HostName

char t_cpu_i::HostName[STDLEN]
private

the name of the computer, not detected on all systems

Referenced by host_name(), and t_cpu_i().

◆ i

int32 t_cpu_i::i

◆ lgPathInitialized

bool t_cpu_i::lgPathInitialized
private

is the search path initialized?

Referenced by initPath(), p_assertValidPath(), p_getFileList(), printDataPath(), 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

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

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

◆ n_use_CPU

long t_cpu_i::n_use_CPU
private

the number of used CPUs

Referenced by set_used_nCPU(), and used_nCPU().

◆ nCSMismatch

int t_cpu_i::nCSMismatch
private

how many modified data files were found?

Referenced by foundCSMismatch(), and t_cpu_i().

◆ nFileDone

int t_cpu_i::nFileDone
private

how many data files have been opened?

Referenced by firstOpen(), and t_cpu_i().

◆ p_chCloudyRoot

string t_cpu_i::p_chCloudyRoot
private

the path to the root of the Cloudy installation

Referenced by initPath().

◆ p_chDirSeparator

char t_cpu_i::p_chDirSeparator
private

the directory separator character for this OS

Referenced by chDirSeparator(), initPath(), p_getchecksums(), p_getPathList(), p_splitPath(), and t_cpu_i().

◆ p_ExecName

string t_cpu_i::p_ExecName
private

command used to start up Cloudy

Referenced by ExecName(), set_ExecName(), and t_cpu_i().

◆ p_exit_status

vector<string> t_cpu_i::p_exit_status
private

Referenced by chExitStatus(), and t_cpu_i().

◆ p_lgMPI

bool t_cpu_i::p_lgMPI
private

flag whether we are doing an MPI run or not

Referenced by lgMPI(), and t_cpu_i().

◆ p_MPIMode

MPI_state t_cpu_i::p_MPIMode
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

Referenced by lgMPI_talk(), MPIMode(), set_MPIMode(), and t_cpu_i().

◆ p_suppressBacktrace

bool t_cpu_i::p_suppressBacktrace
private

option to suppress backtrace

Referenced by disableBacktrace(), enableBacktrace(), and t_cpu_i().

◆ test_double

double t_cpu_i::test_double
private

Referenced by min_double(), and t_cpu_i().

◆ test_float

sys_float t_cpu_i::test_float
private

Referenced by min_float(), and t_cpu_i().


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