JDFTx  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AutoThreadCount Class Reference

Maintain thread timing statistics and automatically choose the optimum number of threads. More...

#include <Thread.h>

Public Member Functions

 AutoThreadCount (int minThreads=1, int minStats=3, const char *name=0, FILE *fpLog=stdout)
 

Friends

template<typename Callable , typename... Args>
void threadLaunch (AutoThreadCount *, Callable *, size_t, Args...args)
 

Detailed Description

Maintain thread timing statistics and automatically choose the optimum number of threads.

Constructor & Destructor Documentation

AutoThreadCount::AutoThreadCount ( int  minThreads = 1,
int  minStats = 3,
const char *  name = 0,
FILE *  fpLog = stdout 
)
Parameters
minThreadsminimum number of threads to try
minStatsminimum number of tries for each thread count
nameif given, print debug messages & stats with that header
fpLogdebug logging stream

Friends And Related Function Documentation

template<typename Callable , typename... Args>
void threadLaunch ( AutoThreadCount ,
Callable *  ,
size_t  ,
Args...  args 
)
friend

Same as threadLaunch(int nThreads, Callable* func, size_t nJobs, Args... args) but with nThreads automatically adjusted over multiple runs using an AutoThreadCount object If the AutoThreadCount pointer is null, as many threads as processors will be launched


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