KASKADE 7 development version
Classes | Namespaces | Typedefs | Functions | Variables
threading.hh File Reference
#include <fstream>
#include <functional>
#include <future>
#include <map>
#include <mutex>
#include <queue>
#include <utility>
#include <vector>
#include <boost/thread/condition_variable.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
#include "utilities/kalloc.hh"
#include "utilities/timing.hh"

Go to the source code of this file.

Classes

class  Kaskade::ConcurrentQueue< T >
 A concurrent fifo queue. More...
 
class  Kaskade::NumaThreadPool
 Implementation of thread pools suitable for parallelization of (more or less) memory-bound algorithms (not only) on NUMA machines. More...
 
class  Kaskade::NumaAllocator< T >
 An STL allocator that uses memory of a specific NUMA node only. More...
 
struct  Kaskade::NumaAllocator< T >::rebind< U >
 
class  Kaskade::Mutex
 A utility class implementing appropriate copy semantics for boost mutexes. More...
 

Namespaces

namespace  Kaskade
 
 

Typedefs

typedef std::packaged_task< void()> Kaskade::Task
 Abstract interface for tasks to be scheduled for concurrent execution. More...
 
typedef std::future< void > Kaskade::Ticket
 Abstract waitable job ticket for submitted tasks. More...
 

Functions

void Kaskade::equalWeightRanges (std::vector< size_t > &x, size_t n)
 Computes partitioning points such that the sum of weights in each partition is roughly the same. More...
 
template<class BlockIndex , class Index >
Index Kaskade::uniformWeightRangeStart (BlockIndex i, BlockIndex n, Index m)
 Computes partitioning points of ranges for uniform weight distributions. More...
 
template<class Index >
Index Kaskade::uniformWeightRange (Index j, Index n, Index m)
 Computes the range in which an index is to be found when partitioned for uniform weights. More...
 
template<class Func >
void Kaskade::parallelFor (Func const &f, int maxTasks=std::numeric_limits< int >::max())
 A parallel for loop that executes the given functor in parallel on different CPUs. More...
 
template<class Func >
void Kaskade::parallelFor (size_t first, size_t last, Func const &f, size_t nTasks=std::numeric_limits< size_t >::max())
 A parallel for loop that executes the given functor in parallel on different CPUs. More...
 
template<class Func >
void Kaskade::parallelForNodes (Func const &f, int maxTasks=std::numeric_limits< int >::max())
 A parallel for loop that executes the given functor in parallel on different NUMA nodes. More...
 
void Kaskade::runInBackground (std::function< void()> &f)
 Executes a function in a child process. More...
 

Variables

std::mutex Kaskade::DuneQuadratureRulesMutex
 A global lock for the Dune::QuadratureRules factory, which is not thread-safe as of 2015-01-01. More...
 
boost::mutex Kaskade::refElementMutex
 A global lock for the Dune::GenericReferenceElement singletons, which are not thread-safe. More...