MADNESS
0.10.1
|
This class collects and prints task profiling data. More...
#include <thread.h>
Public Member Functions | |
TaskProfiler () | |
Default constructor. More... | |
~TaskProfiler () | |
Destructor. More... | |
TaskEventList * | new_list (const std::size_t nmax) |
Create a new task event list. More... | |
void | write_to_file () |
Write the profile data to file. More... | |
Static Public Attributes | |
static const char * | output_file_name_ |
The output file name. More... | |
Private Member Functions | |
TaskProfiler (const TaskProfiler &)=delete | |
TaskProfiler & | operator= (const TaskProfiler &)=delete |
Private Attributes | |
TaskEventListBase * | head_ |
The head of the linked list of data. More... | |
TaskEventListBase * | tail_ |
The tail of the linked list of data. More... | |
Static Private Attributes | |
static Mutex | output_mutex_ |
Mutex used to lock the output file. More... | |
This class collects and prints task profiling data.
TaskProfiler
object, so only one thread will ever operate on this object at a time and all operations are inheirently thread safe.
|
privatedelete |
|
inline |
Default constructor.
|
inline |
Destructor.
References head_, and madness::profiling::TaskEventListBase::next().
|
inline |
Create a new task event list.
[in] | nmax | The maximum number of elements that the list can contain. |
References head_, madness::profiling::TaskEventListBase::insert(), and tail_.
Referenced by madness::ThreadPool::run_task(), and madness::ThreadPool::run_tasks().
|
privatedelete |
void madness::profiling::TaskProfiler::write_to_file | ( | ) |
Write the profile data to file.
The data is cleared after it is written to the file, so this function may be called more than once.
References SafeMPI::COMM_WORLD, SafeMPI::Intracomm::Get_rank(), head_, madness::profiling::TaskEventListBase::next(), output_file_name_, output_mutex_, madness::ThreadPool::size(), and tail_.
Referenced by madness::ThreadPool::end(), and madness::ThreadPool::thread_main().
|
private |
The head of the linked list of data.
Referenced by ~TaskProfiler(), new_list(), and write_to_file().
|
static |
The output file name.
This variable is initialized by ThreadPool::begin
and is assigned the value given by the environment variable MAD_TASKPROFILER_NAME
.
Referenced by madness::ThreadPool::begin(), and write_to_file().
|
staticprivate |
Mutex used to lock the output file.
Referenced by write_to_file().
|
private |
The tail of the linked list of data.
Referenced by new_list(), and write_to_file().