Sierra Toolkit
Version of the Day
|
Classes | |
class | sierra::Env::Startup |
Class Startup is a sentry class for starting the application. It ensures that the command line arguments, platform and MPI are ready to go at the start of the application. More... | |
Enumerations | |
enum | sierra::Env::ExecType { sierra::Env::EXEC_TYPE_WORLD = 0, sierra::Env::EXEC_TYPE_FLUID = 1, sierra::Env::EXEC_TYPE_LAG = 2, sierra::Env::EXEC_TYPE_PEER = 3 } |
Enumeration ExecutableType defines the known types of coordinated executables that operate with a sierra application. Unfortunately, this scheme for coordination is currently defined by Gemini whose implementation forces a limit of two executables, namely it and a fluid code. The startup_multi_exec() function handles the creation of groups which are contiguous processor groups, each with lead processor being the least ranked processor in the group. More... | |
Functions | |
bool | sierra::Env::StartupSierra (int *argc, char ***argv, const char *product_name, const char *build_date_time, ExecType mpi_key=EXEC_TYPE_WORLD, const std::vector< int > *peer_sizes=NULL) |
Initialize MPI related operations for sierra, outputs banner, etc. returns 1 if MPI was initialized, 0 otherwise. More... | |
void | sierra::Env::ShutDownSierra (bool mpiInitFlag) |
void | sierra::Env::reset (MPI_Comm mpi_comm) |
Function reset determines new parallel_size and parallel_rank. Flushes, closes, and reopens log files. More... | |
void | sierra::Env::setMpiCommunicator (MPI_Comm communicator) |
bool | sierra::Env::is_comm_valid () |
const std::string & | sierra::Env::get_param (const char *const option) |
Function query_env_param searches the command line options for the specified option. If not found, a const reference to an empty string is returned. More... | |
void | sierra::Env::set_param (const char *option, const std::string &value) |
Member function set_param assigns the value to the parameter option. More... | |
const std::string & | sierra::Env::product_name () |
Function product_name returns the product's name. This name is used to query the product registry for information concerning this product. More... | |
bool | sierra::Env::developer_mode () |
Function developer_mode returns true if the –developer option was specified on the application command line. More... | |
void | sierra::Env::set_input_file_required (bool value) |
Function set_input_file_required sets whether lack of an input file specification will automatically cause failure. The default behavior corresponds to true. | |
void | sierra::Env::setInputFileName (std::string name) |
std::string | sierra::Env::getInputFileName () |
void | sierra::Env::set_check_subcycle (bool value) |
Function set_check_subcycle sets whether to check input file for subcycling. The default behavior corresponds to false. | |
const std::string & | sierra::Env::architecture () |
Function architecture returns the platform executing this product. This is obtained during startup by searching for a file which contains this information. More... | |
const std::string & | sierra::Env::executable_file () |
Function executable_file returns the path of this executable file. information. More... | |
const std::string & | sierra::Env::executable_date () |
Function executable_date returns the build date of the executable file as a string in the form Mmm dd yyyy hh:mm::ss. More... | |
const std::string & | sierra::Env::startup_date () |
Function startup_date returns the startup date of this application execution. More... | |
double | sierra::Env::start_time () |
Function start_time returns the start time of this application execution. More... | |
double | sierra::Env::wall_now () |
Member function wall_now returns the epoch as a double precision value in seconds to "millisecond" accuracy. More... | |
double | sierra::Env::cpu_now () |
Member function cpu_now returns the accumlated cpu time for the process as a double precision value in seconds to "millisecond" accuracy. More... | |
double | sierra::Env::vm_now () |
Member function vm_now returns the virtual memory in use for the process as a double precision value in bytes. More... | |
const std::string | sierra::Env::working_directory () |
Function working_directory returns the current working directory of this application execution. More... | |
std::ostream & | sierra::Env::output () |
Function output returns the processor output log stream. This stream is connected via an mpi_filebuf to processor 0. Upon output_flush() the output from all processors is collected on processor 0 in a sequential by process and is logged to output file in a non-jumbled manner. More... | |
std::ostream & | sierra::Env::outputP0 () |
Function outputP0 returns the processor output log stream on processor 0 and the null log stream on all other processors. More... | |
std::ostream & | sierra::Env::outputNull () |
Function outputNull returns the null output stream. All data is simply discarded by the buffer associated with this stream. More... | |
const char * | sierra::Env::section_separator () |
Function output_open opens an output file on processor zero for synchronous data output from all processors via the mpi_filebuf class. The output is synchronized via the output_flush() function and maintain in the output stream list so that it is flushed and closed on application rundown. More... | |
const char * | sierra::Env::subsection_separator () |
Function subsection_separator returns a c-style string to be used as a output subsection separator. More... | |
std::string | sierra::Env::section_title (const std::string &title) |
Function section_title returns a section title. The title has date and time concatenated and right justified to the length of the section_separator. The date and time is 20 characters wide, so adjust your titles accordingly. More... | |
void | sierra::Env::output_flush () |
Function output_flush flushes all output on all currently open synchronous outptu files which were opened via output_open. More... | |
void | sierra::Env::output_flush (std::ostream &stream) |
Function output_flush synchronously flushes stream which was created using an mpi_filebuf. More... | |
void | sierra::Env::request_shutdown (bool shutdown) |
bool | sierra::Env::is_shutdown_requested () |
void | sierra::Env::abort () |
Function abort aborts the execution of the sierra application. | |
MPI_Comm | sierra::Env::parallel_comm () |
Function parallel_comm returns the current MPI communicator used by the sierra environment. More... | |
MPI_Comm | sierra::Env::parallel_world_comm () |
Function parallel_world_comm returns the MPI_COMM_WORLD communicator used by the sierra environment in a MPMD parallel application. More... | |
int | sierra::Env::peer_group () |
Function peer_group returns the peer group rank for an application of type EXEC_TYPE_PEER. More... | |
int | sierra::Env::parallel_fluid_master () |
Function parallel_lag_master returns the global rank of the Gemini Euler application. More... | |
int | sierra::Env::parallel_lag_master () |
Function parallel_lag_master returns the global rank of the Sierra lagrangian application. More... | |
int | sierra::Env::parallel_size () |
function parallel_size returns the number of processors in the current mpi communicator. More... | |
int | sierra::Env::parallel_rank () |
function parallel_rank returns the rank of this processor in the current mpi communicator. More... | |
void | sierra::Env::startup_preparallel_platform () |
Function startup_preparallel_platform ... | |
std::string | sierra::Env::hostname () |
Function hostname returns the hostname of the host running the application. More... | |
std::string | sierra::Env::domainname () |
Function domainname returns the domainname of the domain running the application. More... | |
std::string | sierra::Env::username () |
Function username returns the username of the user running the application. More... | |
std::string | sierra::Env::hardware () |
Function hardware returns the hardware type of the host running the application. More... | |
std::string | sierra::Env::osname () |
Function osname returns the operating system nameof the host running the application. More... | |
std::string | sierra::Env::osversion () |
Function osversion returns the hardware type of the host running the application. More... | |
int | sierra::Env::pid () |
Function pid returns the process id of the process running the application. More... | |
int | sierra::Env::pgrp () |
Function pgrp returns the process group id of the process running the application. More... | |
void | sierra::Env::get_heap_info (size_t &heap_size, size_t &largest_free) |
Member function get_heap_info returns the amount of heap memory used in bytes and the largest free block of memory in bytes. More... | |
size_t | sierra::Env::get_heap_usage () |
Function get_heap_usage returns the number of bytes used by the heap. More... | |
size_t | sierra::Env::get_available_memory () |
Function get_available_memory returns an estimation of the amount of memory available to the process. More... | |
void | sierra::Env::get_memory_info (size_t &memory_usage, size_t &faults) |
Function get_memory_info returns the total memory usage of the process and the number of page faults accumulated by the process. More... | |
bool | sierra::Env::path_exists (const std::string &path) |
Function path_exists returns true if the path exists. More... | |
bool | sierra::Env::path_access (const std::string &path, int mode) |
Function path_access returns true if the process has permission to access path with the specified mode. More... | |
bool | sierra::Env::path_read_access (const std::string &path) |
Function path_read_access returns true if the process has read access to the path. More... | |
bool | sierra::Env::path_write_access (const std::string &path) |
Function path_write_access returns true if the process has write access to the path. More... | |
bool | sierra::Env::read_lock (int fd) |
Function read_lock returns true if the process was able to place a shared lock on the specified file descriptor. More... | |
bool | sierra::Env::write_lock (int fd) |
Function write_lock returns true if the process was able to place an exclusive lock on the specified file descriptor. More... | |
bool | sierra::Env::append_lock (int fd) |
Function append_lock returns true if the process was able to place an exclusive lock on the end of the specified file descriptor. Existing records may still be accessed. More... | |
bool | sierra::Env::release_lock (int fd) |
Function release_lock returns true if the process was able to release a lock previously palced on the specified file descriptor. More... | |
void | sierra::Env::activate_signals () |
Function activate_signals enables the signal handlers. | |
void | sierra::Env::deactivate_signals () |
Function deactivate_signals disables the signal handlers. | |
sigjmp_buf * | sierra::Env::get_sigjmpbuf () |
Function get_sigjmpbuf enables signal handling and returns a pointer to the jump buffer for ::sigsetjmp and ::siglongjmp(). More... | |
const std::string & | sierra::Env::get_signal_message () |
Function disable_siglongjmp disables the long jump buffer. When signals are received, they return to the caller without long jumping to the set jump point. More... | |
bool | sierra::Env::HUP_received () |
Function request_shutdown sets the shutdown requested flag so that future calls to shutdown_requested() return true;. | |
bool | sierra::Env::shutdown_requested () |
Function shutdown_requested returns true if an application shutdown has requested via the request_shutdown has been called. More... | |
Enumeration ExecutableType defines the known types of coordinated executables that operate with a sierra application. Unfortunately, this scheme for coordination is currently defined by Gemini whose implementation forces a limit of two executables, namely it and a fluid code. The startup_multi_exec() function handles the creation of groups which are contiguous processor groups, each with lead processor being the least ranked processor in the group.
Modification of the startup_multi_exec() function would need to be made to enable more than the two executable types.
bool sierra::Env::StartupSierra | ( | int * | argc, |
char *** | argv, | ||
const char * | product_name, | ||
const char * | build_date_time, | ||
ExecType | mpi_key = EXEC_TYPE_WORLD , |
||
const std::vector< int > * | peer_sizes = NULL |
||
) |
Initialize MPI related operations for sierra, outputs banner, etc.
returns 1 if MPI was initialized, 0 otherwise.
argc | an int pointer to the main argc. |
argv | a char pointer to the main argv. |
product_name | a char const pointer to the name of the product. |
build_date_time | a char const pointer to DATE " " TIME |
mpi_key | an optional ExecType enumeration specifying the type of executable. Default is a single executable using MPI_COMM_WORLD. Other options result in a split communicator. |
peer_sizes | an optional std::vector<int> const pointer containing the number of processors that each peer communicator ( |
void sierra::Env::reset | ( | MPI_Comm | mpi_comm | ) |
Function reset determines new parallel_size and parallel_rank. Flushes, closes, and reopens log files.
This is a very dangerous method, if the previous communicator had been queried and given to an external library then Sierra and that external library will be out-of-sync. It is strongly recommended that parser-interface singletons do not query and save the communicator.
This capability is provided to support dakota.
mpi_comm | a MPI_Comm value for the new mpi communicator. |
work_dir | a char const pointer to the new working directory. |
const std::string & sierra::Env::get_param | ( | const char *const | option | ) |
Function query_env_param searches the command line options for the specified option. If not found, a const reference to an empty string is returned.
option | a char const pointer to the option to search for. |
void sierra::Env::set_param | ( | const char * | option, |
const std::string & | value | ||
) |
const std::string & sierra::Env::product_name | ( | ) |
bool sierra::Env::developer_mode | ( | ) |
const std::string & sierra::Env::architecture | ( | ) |
const std::string & sierra::Env::executable_file | ( | ) |
const std::string & sierra::Env::executable_date | ( | ) |
const std::string & sierra::Env::startup_date | ( | ) |
double sierra::Env::start_time | ( | ) |
double sierra::Env::wall_now | ( | ) |
Member function wall_now returns the epoch as a double precision value in seconds to "millisecond" accuracy.
Definition at line 261 of file Platform.cpp.
double sierra::Env::cpu_now | ( | ) |
Member function cpu_now returns the accumlated cpu time for the process as a double precision value in seconds to "millisecond" accuracy.
Definition at line 271 of file Platform.cpp.
double sierra::Env::vm_now | ( | ) |
Member function vm_now returns the virtual memory in use for the process as a double precision value in bytes.
Definition at line 442 of file Platform.cpp.
const std::string sierra::Env::working_directory | ( | ) |
std::ostream & sierra::Env::output | ( | ) |
Function output returns the processor output log stream. This stream is connected via an mpi_filebuf to processor 0. Upon output_flush() the output from all processors is collected on processor 0 in a sequential by process and is logged to output file in a non-jumbled manner.
std::ostream & sierra::Env::outputP0 | ( | ) |
std::ostream & sierra::Env::outputNull | ( | ) |
const char * sierra::Env::section_separator | ( | ) |
Function output_open opens an output file on processor zero for synchronous data output from all processors via the mpi_filebuf class. The output is synchronized via the output_flush() function and maintain in the output stream list so that it is flushed and closed on application rundown.
Must be executed concurrently on all processor in the current Env::parallel_comm() group.
filename | a char const pointer to the path of file to open. |
const char * sierra::Env::subsection_separator | ( | ) |
std::string sierra::Env::section_title | ( | const std::string & | title | ) |
Function section_title returns a section title. The title has date and time concatenated and right justified to the length of the section_separator. The date and time is 20 characters wide, so adjust your titles accordingly.
title | a std::string const reference to the title string. |
void sierra::Env::output_flush | ( | ) |
Function output_flush flushes all output on all currently open synchronous outptu files which were opened via output_open.
Must be executed concurrently on all processor in the current Env::parallel_comm() group.
void sierra::Env::output_flush | ( | std::ostream & | stream | ) |
Function output_flush synchronously flushes stream which was created using an mpi_filebuf.
Must be executed concurrently on all processor in the current Env::parallel_comm() group.
stream | a std::ostream reference to the synchronous output stream to flush. |
MPI_Comm sierra::Env::parallel_comm | ( | ) |
MPI_Comm sierra::Env::parallel_world_comm | ( | ) |
int sierra::Env::peer_group | ( | ) |
int sierra::Env::parallel_fluid_master | ( | ) |
int sierra::Env::parallel_lag_master | ( | ) |
int sierra::Env::parallel_size | ( | ) |
int sierra::Env::parallel_rank | ( | ) |
std::string sierra::Env::hostname | ( | ) |
Function hostname returns the hostname of the host running the application.
Definition at line 454 of file Platform.cpp.
std::string sierra::Env::domainname | ( | ) |
Function domainname returns the domainname of the domain running the application.
Definition at line 463 of file Platform.cpp.
std::string sierra::Env::username | ( | ) |
Function username returns the username of the user running the application.
Definition at line 493 of file Platform.cpp.
std::string sierra::Env::hardware | ( | ) |
Function hardware returns the hardware type of the host running the application.
Definition at line 509 of file Platform.cpp.
std::string sierra::Env::osname | ( | ) |
Function osname returns the operating system nameof the host running the application.
Definition at line 525 of file Platform.cpp.
std::string sierra::Env::osversion | ( | ) |
Function osversion returns the hardware type of the host running the application.
Definition at line 541 of file Platform.cpp.
int sierra::Env::pid | ( | ) |
Function pid returns the process id of the process running the application.
Definition at line 557 of file Platform.cpp.
int sierra::Env::pgrp | ( | ) |
Function pgrp returns the process group id of the process running the application.
Definition at line 564 of file Platform.cpp.
void sierra::Env::get_heap_info | ( | size_t & | heap_size, |
size_t & | largest_free | ||
) |
Member function get_heap_info returns the amount of heap memory used in bytes and the largest free block of memory in bytes.
heap_size | a size_t returns the amount of heap memory used in bytes. |
largest_free | a size_t returns the largest free block of memory. |
Definition at line 295 of file Platform.cpp.
|
inline |
Function get_heap_usage returns the number of bytes used by the heap.
Definition at line 152 of file Platform.hpp.
size_t sierra::Env::get_available_memory | ( | ) |
Function get_available_memory returns an estimation of the amount of memory available to the process.
Definition at line 358 of file Platform.cpp.
void sierra::Env::get_memory_info | ( | size_t & | memory_usage, |
size_t & | faults | ||
) |
Function get_memory_info returns the total memory usage of the process and the number of page faults accumulated by the process.
memory_usage | a size_t reference to receive the number of bytes currently used by the process. |
faults | a size_t reference to treceive the number of page faults incurred by the process. |
Definition at line 386 of file Platform.cpp.
bool sierra::Env::path_exists | ( | const std::string & | path | ) |
Function path_exists returns true if the path exists.
path | a String const reference to the path to have existence tested. |
Definition at line 585 of file Platform.cpp.
bool sierra::Env::path_access | ( | const std::string & | path, |
int | mode | ||
) |
Function path_access returns true if the process has permission to access path with the specified mode.
path | a String const reference to the path to check for mode access. |
mode | an int value of the mode to test. |
Definition at line 575 of file Platform.cpp.
bool sierra::Env::path_read_access | ( | const std::string & | path | ) |
Function path_read_access returns true if the process has read access to the path.
path | a String const reference to the path to check for read access. |
Definition at line 593 of file Platform.cpp.
bool sierra::Env::path_write_access | ( | const std::string & | path | ) |
Function path_write_access returns true if the process has write access to the path.
path | a String const reference to the path to check for write access. |
Definition at line 601 of file Platform.cpp.
bool sierra::Env::read_lock | ( | int | fd | ) |
Function read_lock returns true if the process was able to place a shared lock on the specified file descriptor.
fd | an int value of the file description to attempt to lock. |
Definition at line 652 of file Platform.cpp.
bool sierra::Env::write_lock | ( | int | fd | ) |
Function write_lock returns true if the process was able to place an exclusive lock on the specified file descriptor.
fd | an int value of the file description to attempt to lock. |
Definition at line 628 of file Platform.cpp.
bool sierra::Env::append_lock | ( | int | fd | ) |
Function append_lock returns true if the process was able to place an exclusive lock on the end of the specified file descriptor. Existing records may still be accessed.
fd | an int value of the file description to attempt to lock. |
Definition at line 660 of file Platform.cpp.
bool sierra::Env::release_lock | ( | int | fd | ) |
Function release_lock returns true if the process was able to release a lock previously palced on the specified file descriptor.
fd | an int value of the file description to have the lock released. |
Definition at line 640 of file Platform.cpp.
sigjmp_buf * sierra::Env::get_sigjmpbuf | ( | ) |
Function get_sigjmpbuf enables signal handling and returns a pointer to the jump buffer for ::sigsetjmp and ::siglongjmp().
if (::sigsetjmp(*sierra::Env::get_signalException(), 1)) throw sierra::RuntimeError(sierra::Env::get_signal_message());
Definition at line 257 of file Signal.cpp.
const std::string & sierra::Env::get_signal_message | ( | ) |
Function disable_siglongjmp disables the long jump buffer. When signals are received, they return to the caller without long jumping to the set jump point.
Function get_signal_message returns the message associated with the most recent signal.
Definition at line 271 of file Signal.cpp.
bool sierra::Env::shutdown_requested | ( | ) |
Function shutdown_requested returns true if an application shutdown has requested via the request_shutdown has been called.