![]() |
|
Functions | |
void | empty_my_memory_usage_file () |
void | empty_total_memory_usage_file () |
void | doc_total_memory_usage (const std::string &prefix_string) |
void | empty_memory_usage_files () |
void | doc_memory_usage (const std::string &prefix_string) |
void | empty_top_file () |
void | run_continous_top (const std::string &comment) |
void | stop_continous_top (const std::string &comment) |
void | insert_comment_to_continous_top (const std::string &comment) |
Insert comment into running continuous top output. More... | |
Variables | |
bool | Suppress_mpi_synchronisation = true |
std::string | My_memory_usage_system_string = "ps aux" |
bool | Bypass_all_memory_usage_monitoring = false |
std::string | My_memory_usage_filename = "my_memory_usage.dat" |
std::string | Total_memory_usage_system_string |
std::string | Total_memory_usage_filename = "memory_usage.dat" |
std::string | Top_system_string = "while true; do top -b -n 2 ; done " |
std::string | Top_output_filename = "top_output.dat" |
///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// Namespace with helper functions to assess total memory usage on the fly using system() – details are very machine specific! This just provides the overall machinery with default settings for our own (linux machines). Uses the system command to spawn a command that computes the total memory usage on the machine where this is called. [Disclaimer: works on my machine(s) – no guarantees for any other platform; linux or not. MH]
///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// Namespace with helper functions to assess total memory usage on the fly using system() – details are very machine specific! This just provides the overall machinery with default settings for our own (linux machines). Uses the system command to spawn a command that computes the total memory usage on the machine where this is called. [Disclaimer: works on my machine(s) – no guarantees for any other platform; Linux or not. MH]
void oomph::MemoryUsage::doc_memory_usage | ( | const std::string & | prefix_string | ) |
Doc total and local memory usage, prepended by string (which allows identification from where the function is called, say). NOTE: Local memory usage only works if we have unistd.h header
Doc total and local memory usage, prepended by string (which allows identification from where the function is called, say)
References Bypass_all_memory_usage_monitoring, and doc_total_memory_usage().
void oomph::MemoryUsage::doc_total_memory_usage | ( | const std::string & | prefix_string | ) |
Doc total memory usage, prepended by string (which allows identification from where the function is called, say) that records memory usage in file whose name is specified by Total_memory_usage_filename. Data is appended to that file; wipe it with empty_memory_usage_file().
Doc total memory usage, prepended by string (which allows identification from where the function is called, say) that records mem usage in file whose name is specified by Total_memory_usage_filename. Data is appended to that file; wipe it with empty_memory_usage_file().
References Bypass_all_memory_usage_monitoring, oomph::MPI_Helpers::communicator_pt(), oomph::MPI_Helpers::mpi_has_been_initialised(), Suppress_mpi_synchronisation, tmp, Total_memory_usage_filename, and Total_memory_usage_system_string.
Referenced by doc_memory_usage().
void oomph::MemoryUsage::empty_memory_usage_files | ( | ) |
Function to empty file that records total and local memory usage in appropriate files
References Bypass_all_memory_usage_monitoring, empty_my_memory_usage_file(), empty_top_file(), and empty_total_memory_usage_file().
void oomph::MemoryUsage::empty_my_memory_usage_file | ( | ) |
Function to empty file that records my memory usage in file whose name is specified by My_memory_usage_filename.
References Bypass_all_memory_usage_monitoring, and My_memory_usage_filename.
Referenced by empty_memory_usage_files().
void oomph::MemoryUsage::empty_top_file | ( | ) |
Function to empty file that records continuous output from top in file whose name is specified by Top_output_filename
References Bypass_all_memory_usage_monitoring, Top_output_filename, and Top_system_string.
Referenced by empty_memory_usage_files().
void oomph::MemoryUsage::empty_total_memory_usage_file | ( | ) |
Function to empty file that records total memory usage in file whose name is specified by Total_memory_usage_filename.
References Bypass_all_memory_usage_monitoring, and Total_memory_usage_filename.
Referenced by empty_memory_usage_files().
void oomph::MemoryUsage::insert_comment_to_continous_top | ( | const std::string & | comment | ) |
Insert comment into running continuous top output.
References Bypass_all_memory_usage_monitoring, tmp, and Top_output_filename.
Referenced by run_continous_top(), and stop_continous_top().
void oomph::MemoryUsage::run_continous_top | ( | const std::string & | comment | ) |
Start running top continuously and output (append) into file specified by Top_output_filename. Wipe that file with empty_top_file() if you wish. Note that this is again quite Linux specific and unlikely to work on other operating systems. Insert optional comment into output file before starting.
Start running top continuously and output (append) into file specified by Top_output_filename. Wipe that file with empty_top_file() first if you wish. Note that this is again quite Linux specific and unlikely to work on other operating systems. Insert optional comment into output file before starting.
References Bypass_all_memory_usage_monitoring, oomph::MPI_Helpers::communicator_pt(), insert_comment_to_continous_top(), oomph::MPI_Helpers::mpi_has_been_initialised(), oomph::OomphCommunicator::my_rank(), oomph::Global_string_for_annotation::string(), Suppress_mpi_synchronisation, tmp, Top_output_filename, and Top_system_string.
void oomph::MemoryUsage::stop_continous_top | ( | const std::string & | comment | ) |
Stop running top continuously. Note that this is again quite Linux specific and unlikely to work on other operating systems. Insert optional comment into output file before stopping.
References Bypass_all_memory_usage_monitoring, oomph::MPI_Helpers::communicator_pt(), insert_comment_to_continous_top(), oomph::MPI_Helpers::mpi_has_been_initialised(), oomph::OomphCommunicator::my_rank(), oomph::Global_string_for_annotation::string(), Suppress_mpi_synchronisation, tmp, and Top_output_filename.
bool oomph::MemoryUsage::Bypass_all_memory_usage_monitoring = false |
Bool allowing quick bypassing of ALL operations related to memory usage monitoring – this allows the code to remain "instrumented" without incurring the heavy penalties associated with the system calls and i/o. Default setting: false.
Referenced by doc_memory_usage(), doc_total_memory_usage(), empty_memory_usage_files(), empty_my_memory_usage_file(), empty_top_file(), empty_total_memory_usage_file(), insert_comment_to_continous_top(), main(), run_continous_top(), and stop_continous_top().
std::string oomph::MemoryUsage::My_memory_usage_filename = "my_memory_usage.dat" |
String containing name of file in which we document my memory usage – you may want to change this to allow different processors to write to separate files (especially in mpi context). Note that file is appended to so it ought to be emptied (either manually or by calling helper function empty_memory_usage_file()
Referenced by empty_my_memory_usage_file().
std::string oomph::MemoryUsage::My_memory_usage_system_string = "ps aux" |
String containing system command that obtains memory usage of all processes. Default assignment for linux. [Disclaimer: works on my machine(s) – no guarantees for any other platform; linux or not. MH]
String containing system command that obtains memory usage of all processes. Default assignment for Linux. [Disclaimer: works on my machine(s) – no guarantees for any other platform; Linux or not. MH]
bool oomph::MemoryUsage::Suppress_mpi_synchronisation = true |
Boolean to suppress synchronisation of doc memory usage on processors (via mpi barriers). True (i.e. sync is suppressed) by default because not all processors may reach the relevant doc memory usage statements causing the code to hang).
Boolean to suppress synchronisation of doc memory usage on processors (via mpi barriers). True (i.e. sync is is suppressed by default because not all processors may execute the reach the relevant doc memory usage statements causing the code to hang).
Referenced by doc_total_memory_usage(), run_continous_top(), and stop_continous_top().
std::string oomph::MemoryUsage::Top_output_filename = "top_output.dat" |
String containing name of file in which we document "continuous" output from "top" (or equivalent)– you may want to change this to allow different processors to write to separate files (especially in mpi context). Note that file is appended to so it ought to be emptied (either manually or by calling helper function empty_top_file()
Referenced by empty_top_file(), insert_comment_to_continous_top(), run_continous_top(), and stop_continous_top().
String containing system command that runs "top" (or equivalent) "indefinitely" and writes to file specified in Top_output_filename. Default assignment for linux. [Disclaimer: works on my machine(s) – no guarantees for any other platform; linux or not. MH]
String containing system command that runs "top" (or equivalent) "indefinitely" and writes to file specified in Top_output_filename. Default assignment for Linux. [Disclaimer: works on my machine(s) – no guarantees for any other platform; Linux or not. MH]
Referenced by empty_top_file(), and run_continous_top().
std::string oomph::MemoryUsage::Total_memory_usage_filename = "memory_usage.dat" |
String containing name of file in which we document total memory usage – you may want to change this to allow different processors to write to separate files (especially in mpi context). Note that file is appended to so it ought to be emptied (either manually or by calling helper function empty_memory_usage_file()
Referenced by doc_total_memory_usage(), and empty_total_memory_usage_file().
std::string oomph::MemoryUsage::Total_memory_usage_system_string |
String containing system command that obtains total memory usage. Default assignment for linux. [Disclaimer: works on my machine(s) – no guarantees for any other platform; linux or not. MH]
String containing system command that obtains total memory usage. Default assignment for Linux. [Disclaimer: works on my machine(s) – no guarantees for any other platform; Linux or not. MH]
Referenced by doc_total_memory_usage().