Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMPWorkerExecutor< F, T, void > Class Template Reference

template<class F, class T>
class TMPWorkerExecutor< F, T, void >

Definition at line 169 of file TMPWorkerExecutor.h.

Public Member Functions

 TMPWorkerExecutor (F func, const std::vector< T > &args)
 
 TMPWorkerExecutor (F func, const std::vector< T > &args, void redfunc)
 
 ~TMPWorkerExecutor ()
 
 ~TMPWorkerExecutor ()
 
void HandleInput (MPCodeBufPair &msg)
 Handle a message with an EMPCode.
 
void HandleInput (MPCodeBufPair &msg)
 Handle a message with an EMPCode.
 
- Public Member Functions inherited from TMPWorker
 TMPWorker ()
 
 TMPWorker (const TMPWorker &)=delete
 
 TMPWorker (unsigned nWorkers, ULong64_t maxEntries)
 
virtual ~TMPWorker ()
 
unsigned GetNWorker () const
 
pid_t GetPid ()
 
TSocketGetSocket ()
 
virtual void Init (int fd, unsigned workerN)
 This method is called by children processes right after forking.
 
TMPWorkeroperator= (const TMPWorker &)=delete
 
void Run ()
 

Private Attributes

std::vector< T > fArgs
 a vector containing the arguments that must be passed to fFunc
 
std::vector< T > fArgs
 a vector containing the arguments that must be passed to fFunc
 
bool fCanReduce
 true if fReducedResult can be reduced with a new result, false until we have produced one result
 
F fFunc
 the function to be executed
 
F fFunc
 the function to be executed
 
void fRedFunc
 the reduce function
 
decltype(fFunc(fArgs.front())) fReducedResult
 the result of the execution
 

Additional Inherited Members

- Protected Member Functions inherited from TMPWorker
void SendError (const std::string &errmsg, unsigned int code=MPCode::kError)
 Error sender.
 
- Protected Attributes inherited from TMPWorker
std::string fId
 identifier string in the form W<nwrk>|P<proc id>
 
ULong64_t fMaxNEntries
 the maximum number of entries to be processed by this worker
 
unsigned fNWorkers
 the number of workers spawned
 
ULong64_t fProcessedEntries
 the number of entries processed by this worker so far
 

#include <TMPWorkerExecutor.h>

Inheritance diagram for TMPWorkerExecutor< F, T, void >:
[legend]

Constructor & Destructor Documentation

◆ TMPWorkerExecutor() [1/2]

template<class F, class T>
TMPWorkerExecutor< F, T, void >::TMPWorkerExecutor ( F func,
const std::vector< T > & args )
inline

Definition at line 171 of file TMPWorkerExecutor.h.

◆ ~TMPWorkerExecutor() [1/2]

template<class F, class T>
TMPWorkerExecutor< F, T, void >::~TMPWorkerExecutor ( )
inline

Definition at line 172 of file TMPWorkerExecutor.h.

◆ TMPWorkerExecutor() [2/2]

TMPWorkerExecutor< F, T, void >::TMPWorkerExecutor ( F func,
const std::vector< T > & args,
void redfunc )
inline

Definition at line 83 of file TMPWorkerExecutor.h.

◆ ~TMPWorkerExecutor() [2/2]

TMPWorkerExecutor< F, T, void >::~TMPWorkerExecutor ( )
inline

Definition at line 87 of file TMPWorkerExecutor.h.

Member Function Documentation

◆ HandleInput() [1/2]

void TMPWorkerExecutor< F, T, void >::HandleInput ( MPCodeBufPair & msg)
inlinevirtual

Handle a message with an EMPCode.

This method is called upon receiving a message with a code >= 1000 (i.e. EMPCode). It handles the most generic types of messages.
Classes inheriting from TMPWorker should implement their own HandleInput function, that should be able to handle codes specific to that application.
The appropriate version of the HandleInput method (TMPWorker's or the overriding version) is automatically called depending on the message code.

Reimplemented from TMPWorker.

Definition at line 89 of file TMPWorkerExecutor.h.

◆ HandleInput() [2/2]

template<class F, class T>
void TMPWorkerExecutor< F, T, void >::HandleInput ( MPCodeBufPair & msg)
inlinevirtual

Handle a message with an EMPCode.

This method is called upon receiving a message with a code >= 1000 (i.e. EMPCode). It handles the most generic types of messages.
Classes inheriting from TMPWorker should implement their own HandleInput function, that should be able to handle codes specific to that application.
The appropriate version of the HandleInput method (TMPWorker's or the overriding version) is automatically called depending on the message code.

Reimplemented from TMPWorker.

Definition at line 173 of file TMPWorkerExecutor.h.

Member Data Documentation

◆ fArgs [1/2]

std::vector<T> TMPWorkerExecutor< F, T, void >::fArgs
private

a vector containing the arguments that must be passed to fFunc

Definition at line 120 of file TMPWorkerExecutor.h.

◆ fArgs [2/2]

template<class F, class T>
std::vector<T> TMPWorkerExecutor< F, T, void >::fArgs
private

a vector containing the arguments that must be passed to fFunc

Definition at line 189 of file TMPWorkerExecutor.h.

◆ fCanReduce

bool TMPWorkerExecutor< F, T, void >::fCanReduce
private

true if fReducedResult can be reduced with a new result, false until we have produced one result

Definition at line 123 of file TMPWorkerExecutor.h.

◆ fFunc [1/2]

F TMPWorkerExecutor< F, T, void >::fFunc
private

the function to be executed

Definition at line 119 of file TMPWorkerExecutor.h.

◆ fFunc [2/2]

template<class F, class T>
F TMPWorkerExecutor< F, T, void >::fFunc
private

the function to be executed

Definition at line 188 of file TMPWorkerExecutor.h.

◆ fRedFunc

void TMPWorkerExecutor< F, T, void >::fRedFunc
private

the reduce function

Definition at line 121 of file TMPWorkerExecutor.h.

◆ fReducedResult

decltype(fFunc(fArgs.front())) TMPWorkerExecutor< F, T, void >::fReducedResult
private

the result of the execution

Definition at line 122 of file TMPWorkerExecutor.h.

  • core/multiproc/inc/TMPWorkerExecutor.h