Poster of Linux kernelThe best gift for a Linux geek
Threads

Threads

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

Threads -  

SYNOPSIS


 

Classes


class atomic

class task_scheduler_init

class split

class spin_mutex

class BlockedRange

class scalable_allocator
 

Typedefs


typedef tbb::task_scheduler_init task_scheduler_init

typedef tbb::split split

typedef tbb::spin_mutex spin_mutex
 

Functions


template<typename Range , typename Body > void parallel_for (const Range &range, const Body &body)

template<typename Range , typename Body , typename Partitioner > void parallel_for (const Range &range, const Body &body, const Partitioner &partitioner)

template<typename Range , typename Body > void parallel_reduce (const Range &range, Body &body)

template<typename Range , typename Body , typename Partitioner > void parallel_reduce (const Range &range, Body &body, const Partitioner &partitioner)
 

Variables


spin_mutex spin_mtx
 

Detailed Description

The Threads namespace is for wrapper functions for common general multithreading algorithms and tasks.  

Typedef Documentation

 

typedef tbb::spin_mutex Threads::spin_mutexSpin mutex. Implements mutual exclusion by busy-waiting in user space for the lock to be acquired.

Definition at line 185 of file threads.h.  

typedef tbb::split Threads::splitDummy 'splitting object' used to distinguish splitting constructors from copy constructors.

Definition at line 64 of file threads.h.  

typedef tbb::task_scheduler_init Threads::task_scheduler_initScheduler to manage threads.

Definition at line 55 of file threads.h.  

Function Documentation

 

template<typename Range , typename Body > void Threads::parallel_for (const Range &range, const Body &body) [inline]Exectue the provided function object in parallel on the specified range.

Definition at line 75 of file threads.h.

References PerfLog::disable_logging(), PerfLog::enable_logging(), libMesh::n_threads(), and libMesh::perflog.

Referenced by MeshCommunication::assign_global_indices(), DofMap::create_dof_constraints(), PatchRecoveryErrorEstimator::estimate_error(), parallel_for(), and System::project_vector().

  {
#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
    if (libMesh::n_threads() > 1)
      libMesh::perflog.disable_logging();
#endif   

    if (libMesh::n_threads() > 1)
      tbb::parallel_for (range, body, tbb::auto_partitioner());

    else 
      body(range);

#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
    if (libMesh::n_threads() > 1)
      libMesh::perflog.enable_logging();
#endif
  }
 

template<typename Range , typename Body , typename Partitioner > void Threads::parallel_for (const Range &range, const Body &body, const Partitioner &partitioner) [inline]Exectue the provided function object in parallel on the specified range with the specified partitioner.

Definition at line 103 of file threads.h.

References PerfLog::disable_logging(), PerfLog::enable_logging(), libMesh::n_threads(), parallel_for(), and libMesh::perflog.

  { 
#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
    if (libMesh::n_threads() > 1)
      libMesh::perflog.disable_logging();
#endif   
    
    if (libMesh::n_threads() > 1)
      tbb::parallel_for (range, body, partitioner); 

    else
      body(range);

#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
    if (libMesh::n_threads() > 1)
      libMesh::perflog.enable_logging();
#endif
  }
 

template<typename Range , typename Body > void Threads::parallel_reduce (const Range &range, Body &body) [inline]Exectue the provided reduction operation in parallel on the specified range.

Definition at line 131 of file threads.h.

References PerfLog::disable_logging(), PerfLog::enable_logging(), libMesh::n_threads(), and libMesh::perflog.

Referenced by MeshTools::bounding_box(), DofMap::compute_sparsity(), parallel_reduce(), MeshTools::processor_bounding_box(), System::project_vector(), MeshTools::total_weight(), and MeshTools::weight().

  { 
#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
    if (libMesh::n_threads() > 1)
      libMesh::perflog.disable_logging();
#endif   

    if (libMesh::n_threads() > 1)
      tbb::parallel_reduce (range, body, tbb::auto_partitioner()); 

    else
      body(range);

#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
    if (libMesh::n_threads() > 1)
      libMesh::perflog.enable_logging();
#endif
  }
 

template<typename Range , typename Body , typename Partitioner > void Threads::parallel_reduce (const Range &range, Body &body, const Partitioner &partitioner) [inline]Exectue the provided reduction operation in parallel on the specified range with the specified partitioner.

Definition at line 159 of file threads.h.

References PerfLog::disable_logging(), PerfLog::enable_logging(), libMesh::n_threads(), parallel_reduce(), and libMesh::perflog.

  { 
#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
    if (libMesh::n_threads() > 1)
      libMesh::perflog.disable_logging();
#endif   

       if (libMesh::n_threads() > 1)
         tbb::parallel_reduce (range, body); 

       else
         body(range);

#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
    if (libMesh::n_threads() > 1)
      libMesh::perflog.enable_logging();
#endif
  }
 

Variable Documentation

 

Threads::spin_mutex Threads::spin_mtxA spin mutex object which

Definition at line 30 of file threads.C.

Referenced by FEBase::compute_periodic_constraints(), FEBase::compute_proj_constraints(), DofMap::constrain_p_dofs(), ReferenceCounter::increment_constructor_count(), ReferenceCounter::increment_destructor_count(), and System::ProjectVector::operator()().  

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Classes
Typedefs
Functions
Variables
Detailed Description
Typedef Documentation
typedef tbb::spin_mutex Threads::spin_mutexSpin mutex. Implements mutual exclusion by busy-waiting in user space for the lock to be acquired.
typedef tbb::split Threads::splitDummy 'splitting object' used to distinguish splitting constructors from copy constructors.
typedef tbb::task_scheduler_init Threads::task_scheduler_initScheduler to manage threads.
Function Documentation
template<typename Range , typename Body > void Threads::parallel_for (const Range &range, const Body &body) [inline]Exectue the provided function object in parallel on the specified range.
template<typename Range , typename Body , typename Partitioner > void Threads::parallel_for (const Range &range, const Body &body, const Partitioner &partitioner) [inline]Exectue the provided function object in parallel on the specified range with the specified partitioner.
template<typename Range , typename Body > void Threads::parallel_reduce (const Range &range, Body &body) [inline]Exectue the provided reduction operation in parallel on the specified range.
template<typename Range , typename Body , typename Partitioner > void Threads::parallel_reduce (const Range &range, Body &body, const Partitioner &partitioner) [inline]Exectue the provided reduction operation in parallel on the specified range with the specified partitioner.
Variable Documentation
Threads::spin_mutex Threads::spin_mtxA spin mutex object which
Author

This document was created by man2html, using the manual pages.
Time: 21:57:24 GMT, April 16, 2011