85 _arg(
"arg",
"arg",this,arg),
86 _vars(
"vars",
"vars",this),
90 _inlineMode(calcInline),
91 _remoteEvalErrorLoggingState(
RooAbsReal::PrintErrors),
94 _retrieveDispatched(
kFALSE), _evalCarry(0.)
113 _arg(
"arg",this,other._arg),
114 _vars(
"vars",this,other._vars),
116 _verboseClient(other._verboseClient),
117 _verboseServer(other._verboseServer),
118 _inlineMode(other._inlineMode),
119 _forceCalc(other._forceCalc),
120 _remoteEvalErrorLoggingState(other._remoteEvalErrorLoggingState),
123 _retrieveDispatched(
kFALSE), _evalCarry(other._evalCarry)
199 if (
_pipe->isChild()) {
207 GetName() <<
") server process terminating" << endl ;
215 GetName() <<
") successfully forked server process " <<
216 _pipe->pidOtherEnd() << endl ;
234 Int_t idx, index, numErrors ;
244 <<
") IPC fromClient> Terminate" << endl;
253 *
_pipe >> idx >> value >> isConst;
255 <<
") IPC fromClient> SendReal [" << idx <<
"]=" << value << endl ;
266 *
_pipe >> idx >> index;
268 <<
") IPC fromClient> SendCat [" << idx <<
"]=" << index << endl ;
275 <<
") IPC fromClient> Calculate" << endl ;
281 <<
") IPC fromClient> Calculate" << endl ;
291 <<
") IPC fromClient> Retrieve" << endl ;
297 <<
") IPC toClient> ReturnValue " <<
_value <<
" NumError " << numErrors << endl ;
301 std::string objidstr;
307 objidstr = oss2.str();
309 std::map<const RooAbsArg*,pair<string,list<EvalError> > >::const_iterator iter =
evalErrorIter();
312 list<EvalError>::const_iterator iter2 = iter->second.second.begin();
313 for (; iter->second.second.end() != iter2; ++iter2) {
315 *
_pipe << ptr << iter2->_msg << iter2->_srvval << objidstr;
317 <<
") IPC toClient> sending error log Arg " << iter->first <<
" Msg " << iter2->_msg << endl ;
334 *
_pipe >> code >> doTrack;
336 <<
") IPC fromClient> ConstOpt " << code <<
" doTrack = " << (doTrack?
"T":
"F") << endl ;
346 <<
") IPC fromClient> Verbose " << (flag?1:0) << endl ;
357 <<
") IPC fromClient> ApplyNLLW2 " << (flag?1:0) << endl ;
369 <<
") IPC fromClient> EnableOffset " << (flag?1:0) << endl ;
383 <<
") IPC fromClient> LogEvalError flag = " << flag2 << endl ;
390 <<
") IPC fromClient> Unknown message (code = " << msg <<
")" << endl ;
432 while((var = viter.
next())) {
433 saveVar = siter.
next() ;
436 Bool_t valChanged,constChanged ;
447 if ( valChanged || constChanged ||
_forceCalc) {
450 <<
") variable " <<
_vars.
at(i)->
GetName() <<
" changed" << endl ;
461 *
_pipe << msg << i << val << isC;
464 <<
") IPC toServer> SendReal [" << i <<
"]=" << val << (isC?
" (Constant)":
"") << endl ;
468 *
_pipe << msg << i << idx;
470 <<
") IPC toServer> SendCat [" << i <<
"]=" << idx << endl ;
479 <<
") IPC toServer> Calculate " << endl ;
489 <<
") IPC toServer> Retrieve " << endl ;
493 cout <<
"RooRealMPFE::calculate(" <<
GetName()
494 <<
") ERROR not in Client or Inline mode" << endl ;
543 return_value =
_arg ;
546 bool needflush =
false;
555 *
_pipe << msg << flag;
565 <<
") IPC toServer> Retrieve " << endl ;
576 cout <<
"RooRealMPFE::evaluate(" <<
GetName()
577 <<
") ERROR: unexpected message from server process: " << msg << endl ;
581 <<
") IPC fromServer> ReturnValue " << value << endl ;
584 <<
") IPC fromServer> NumErrors " << numError << endl ;
587 char *msgbuf1 = 0, *msgbuf2 = 0, *msgbuf3 = 0;
592 *
_pipe >> msgbuf1 >> msgbuf2 >> msgbuf3;
594 <<
") IPC fromServer> retrieving error log Arg " << ptr <<
" Msg " << msgbuf1 << endl ;
605 return_value = value ;
626 <<
") IPC toServer> Terminate " << endl;
633 std::cerr <<
"In " << __func__ <<
"(" << __FILE__
", " << __LINE__ <<
634 "): Server shutdown failed." << std::endl;
638 std::cerr <<
"In " << __func__ <<
"(" << __FILE__
", " <<
639 __LINE__ <<
"): Pipe has already shut down, not sending "
640 "Terminate to server." << std::endl;
666 *
_pipe << msg << op << doAlsoTracking;
668 <<
") IPC toServer> ConstOpt " << opcode << endl ;
690 *
_pipe << msg << serverFlag;
692 <<
") IPC toServer> Verbose " << (serverFlag?1:0) << endl ;
708 *
_pipe << msg << flag;
710 <<
") IPC toServer> ApplyNLLW2 " << (flag?1:0) << endl ;
737 *
_pipe << msg << flag;
739 <<
") IPC toServer> EnableOffset " << (flag?1:0) << endl ;
header file for BidirMMapPipe, a class which forks off a child process and serves as communications c...
R__EXTERN TSystem * gSystem
BidirMMapPipe creates a bidirectional channel between the current process and a child it forks.
void flush()
flush buffers with unwritten data
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Bool_t isValueDirty() const
virtual Bool_t isIdentical(const RooAbsArg &other, Bool_t assumeSameType=kFALSE)=0
void clearValueDirty() const
Bool_t isConstant() const
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
RooFIter fwdIterator() const R__SUGGEST_ALTERNATIVE("begin()
One-time forward iterator.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
void setConstant(Bool_t value=kTRUE)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
static Int_t numEvalErrorItems()
static void setHideOffset(Bool_t flag)
static Bool_t hideOffset()
static EvalErrorIter evalErrorIter()
static ErrorLoggingMode evalErrorLoggingMode()
Return current evaluation error logging mode.
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
void logEvalError(const char *message, const char *serverValueString=0) const
Log evaluation error message.
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
RooAbsTestStatistic is the abstract base class for all test statistics.
virtual Double_t getCarry() const
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooAbsArg * absArg() const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooCategory represents a fundamental (non-derived) discrete value object.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
virtual void removeAll()
Reimplementation of standard RooArgList::removeAll()
RooMPSentinel is a singleton class that keeps track of all parellel execution processes for goodness-...
void remove(RooRealMPFE &mpfe)
Remove given multi-processor front-end object from the sentinel.
void add(RooRealMPFE &mpfe)
Register given multi-processor front-end object with the sentinel.
Class RooNLLVar implements a -log(likelihood) calculation from a dataset and a PDF.
void applyWeightSquared(Bool_t flag)
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
RooRealMPFE is the multi-processor front-end for parallel calculation of RooAbsReal objects.
RooFit::BidirMMapPipe * _pipe
void calculate() const
Client-side function that instructs server process to start asynchronuous (re)calculation of function...
virtual Double_t getCarry() const
void applyNLLWeightSquared(Bool_t flag)
Control verbose messaging related to inter process communication on both client and server side.
void initialize()
Initialize the remote process and message passing pipes between current process and remote process.
virtual ~RooRealMPFE()
Destructor.
virtual Double_t evaluate() const
Send message to server process to retrieve output value If error were logged use logEvalError() on re...
void serverLoop()
Server loop of remote processes.
void standby()
Terminate remote server process and return front-end class to standby mode.
static RooMPSentinel _sentinel
void initVars()
Initialize list of variables of front-end argument 'arg'.
RooRealMPFE * _updateMaster
Flags if variable needs update on server-side.
void enableOffsetting(Bool_t flag)
Control verbose messaging related to inter process communication on both client and server side.
std::vector< Bool_t > _valueChanged
connection to child
virtual Double_t getValV(const RooArgSet *nset=0) const
If value needs recalculation and calculation has not beed started with a call to calculate() start it...
void doApplyNLLW2(Bool_t flag)
virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTracking=kTRUE)
Intercept call to optimize constant term in test statistics and forward it to object on server side.
std::vector< Bool_t > _constChanged
Flags if variable needs update on server-side.
Bool_t _retrieveDispatched
Update master.
RooAbsReal::ErrorLoggingMode _remoteEvalErrorLoggingState
void setVerbose(Bool_t clientFlag=kTRUE, Bool_t serverFlag=kTRUE)
Control verbose messaging related to inter process communication on both client and server side.
RooRealVar represents a variable that can be changed from the outside.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
const T & arg() const
Return reference to object held in proxy.
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
virtual const char * GetName() const
Returns name of object.
virtual int GetPid()
Get process id.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
void Initialize(Bool_t useTMVAStyle=kTRUE)