Tulip  5.2.1
Large graphs analysis and drawing
tlp::ThreadManager Class Reference

#include <ParallelTools.h>

Static Public Member Functions

static unsigned int getNumberOfProcs ()
 
static unsigned int getNumberOfThreads ()
 
static unsigned int getThreadNumber ()
 
template<typename ThreadFunction >
static void iterate (size_t maxId, const ThreadFunction &threadFunction)
 
template<typename runFunction >
static std::thread * launchThread (const runFunction &f)
 
static void setNumberOfThreads (unsigned int nbThreads)
 

Detailed Description

Static wrapper class around the std::thread.

Since
Tulip 5.2

Definition at line 68 of file ParallelTools.h.

Member Function Documentation

◆ getNumberOfProcs()

static unsigned int tlp::ThreadManager::getNumberOfProcs ( )
static

Returns the number of processors on the host system.

◆ getNumberOfThreads()

static unsigned int tlp::ThreadManager::getNumberOfThreads ( )
static

Returns the number of threads used by default in subsequent OpenMP parallel sections.

◆ getThreadNumber()

static unsigned int tlp::ThreadManager::getThreadNumber ( )
static

Returns the current thread number.

◆ iterate()

template<typename ThreadFunction >
static void tlp::ThreadManager::iterate ( size_t  maxId,
const ThreadFunction &  threadFunction 
)
inlinestatic

Parallel iteration of the same function over partitioned ranges between 0 and maxId

Definition at line 138 of file ParallelTools.h.

+ Here is the caller graph for this function:

◆ setNumberOfThreads()

static void tlp::ThreadManager::setNumberOfThreads ( unsigned int  nbThreads)
static

Sets the number of threads used by default in subsequent parallel sections.