nuklei::parallelizer Struct Reference

Classes

struct  na_print_accessor
 
struct  print_accessor
 

Public Types

enum  Type {
  OPENMP = 0, FORK, PTHREAD, SINGLE,
  UNKNOWN
}
 

Public Member Functions

 parallelizer (const int n, const Type &type=OPENMP, const unsigned long seed=0)
 
template<typename R , typename Callable >
std::vector< R > run (Callable callable) const
 
template<typename R , typename Callable , typename PrintAccessor >
std::vector< R > run (Callable callable, PrintAccessor pa) const
 

Static Public Attributes

static const Type defaultType = OPENMP
 
static const std::string TypeNames [] = { "openmp", "fork", "pthread", "single" }
 

Detailed Description

Definition at line 21 of file parallelizer_decl.h.

Constructor & Destructor Documentation

◆ parallelizer()

nuklei::parallelizer::parallelizer ( const int  n,
const Type &  type = OPENMP,
const unsigned long  seed = 0 
)
inline

If chosing the fork()-based implementation, make sure that your program consists of a single thread at the time run() is called, or you will run into problems (Google "forking a multithreaded program" to see why).

Definition at line 32 of file parallelizer_decl.h.


The documentation for this struct was generated from the following files:
© Copyright 2007-2013 Renaud Detry.
Distributed under the terms of the GNU General Public License (GPL).
(See accompanying file LICENSE.txt or copy at http://www.gnu.org/copyleft/gpl.html.)
Revised Sun Sep 13 2020 19:10:11.