84 _arg(
"arg",
"arg",this,arg),
85 _vars(
"vars",
"vars",this),
86 _calcInProgress(false),
87 _verboseClient(false),
88 _verboseServer(false),
89 _inlineMode(calcInline),
90 _remoteEvalErrorLoggingState(
RooAbsReal::PrintErrors),
93 _retrieveDispatched(false), _evalCarry(0.)
112 _arg(
"arg",this,other._arg),
113 _vars(
"vars",this,other._vars),
114 _calcInProgress(false),
115 _verboseClient(other._verboseClient),
116 _verboseServer(other._verboseServer),
117 _inlineMode(other._inlineMode),
118 _forceCalc(other._forceCalc),
119 _remoteEvalErrorLoggingState(other._remoteEvalErrorLoggingState),
122 _retrieveDispatched(false), _evalCarry(other._evalCarry)
206 GetName() <<
") server process terminating" << endl ;
214 GetName() <<
") successfully forked server process " <<
243 <<
") IPC fromClient> Terminate" << endl;
245 *
_pipe << msg << BidirMMapPipe::flush;
254 <<
") IPC fromClient> SendReal [" << idx <<
"]=" <<
value << endl ;
267 <<
") IPC fromClient> SendCat [" << idx <<
"]=" <<
index << endl ;
274 <<
") IPC fromClient> Calculate" << endl ;
280 <<
") IPC fromClient> Calculate" << endl ;
290 <<
") IPC fromClient> Retrieve" << endl ;
296 <<
") IPC toClient> ReturnValue " <<
_value <<
" NumError " << numErrors << endl ;
300 std::string objidstr;
306 objidstr = oss2.str();
308 std::map<const RooAbsArg*,pair<string,list<EvalError> > >::const_iterator iter =
evalErrorIter();
311 list<EvalError>::const_iterator iter2 = iter->second.second.begin();
312 for (; iter->second.second.end() != iter2; ++iter2) {
314 *
_pipe << ptr << iter2->_msg << iter2->_srvval << objidstr;
316 <<
") IPC toClient> sending error log Arg " << iter->first <<
" Msg " << iter2->_msg << endl ;
325 *
_pipe << BidirMMapPipe::flush;
333 *
_pipe >> code >> doTrack;
335 <<
") IPC fromClient> ConstOpt " << code <<
" doTrack = " << (doTrack?
"T":
"F") << endl ;
345 <<
") IPC fromClient> Verbose " << (flag?1:0) << endl ;
356 <<
") IPC fromClient> ApplyNLLW2 " << (flag?1:0) << endl ;
368 <<
") IPC fromClient> EnableOffset " << (flag?1:0) << endl ;
382 <<
") IPC fromClient> LogEvalError flag = " << flag2 << endl ;
389 <<
") IPC fromClient> Unknown message (code = " << msg <<
")" << endl ;
431 while((var = viter.
next())) {
432 saveVar = siter.
next() ;
435 bool valChanged,constChanged ;
446 if ( valChanged || constChanged ||
_forceCalc) {
449 <<
") variable " <<
_vars.
at(i)->
GetName() <<
" changed" << endl ;
460 *
_pipe << msg << i << val << isC;
463 <<
") IPC toServer> SendReal [" << i <<
"]=" << val << (isC?
" (Constant)":
"") << endl ;
467 *
_pipe << msg << i << idx;
469 <<
") IPC toServer> SendCat [" << i <<
"]=" << idx << endl ;
478 <<
") IPC toServer> Calculate " << endl ;
486 *
_pipe << msg << BidirMMapPipe::flush;
488 <<
") IPC toServer> Retrieve " << endl ;
492 cout <<
"RooRealMPFE::calculate(" <<
GetName()
493 <<
") ERROR not in Client or Inline mode" << endl ;
540 double return_value = 0;
542 return_value =
_arg ;
545 bool needflush =
false;
554 *
_pipe << msg << flag;
564 <<
") IPC toServer> Retrieve " << endl ;
566 if (needflush) *
_pipe << BidirMMapPipe::flush;
575 cout <<
"RooRealMPFE::evaluate(" <<
GetName()
576 <<
") ERROR: unexpected message from server process: " << msg << endl ;
580 <<
") IPC fromServer> ReturnValue " <<
value << endl ;
583 <<
") IPC fromServer> NumErrors " << numError << endl ;
586 char *msgbuf1 = 0, *msgbuf2 = 0, *msgbuf3 = 0;
591 *
_pipe >> msgbuf1 >> msgbuf2 >> msgbuf3;
593 <<
") IPC fromServer> retrieving error log Arg " << ptr <<
" Msg " << msgbuf1 << endl ;
604 return_value =
value ;
625 <<
") IPC toServer> Terminate " << endl;
627 *
_pipe << msg << BidirMMapPipe::flush;
632 std::cerr <<
"In " << __func__ <<
"(" << __FILE__
", " << __LINE__ <<
633 "): Server shutdown failed." << std::endl;
637 std::cerr <<
"In " << __func__ <<
"(" << __FILE__
", " <<
638 __LINE__ <<
"): Pipe has already shut down, not sending "
639 "Terminate to server." << std::endl;
665 *
_pipe << msg << op << doAlsoTracking;
667 <<
") IPC toServer> ConstOpt " << opcode << endl ;
689 *
_pipe << msg << serverFlag;
691 <<
") IPC toServer> Verbose " << (serverFlag?1:0) << endl ;
707 *
_pipe << msg << flag;
709 <<
") IPC toServer> ApplyNLLW2 " << (flag?1:0) << endl ;
736 *
_pipe << msg << flag;
738 <<
") IPC toServer> EnableOffset " << (flag?1:0) << endl ;
header file for BidirMMapPipe, a class which forks off a child process and serves as communications c...
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
R__EXTERN TSystem * gSystem
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
virtual void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true)=0
bool isConstant() const
Check if the "Constant" attribute is set.
void clearValueDirty() const
bool isValueDirty() const
virtual bool isIdentical(const RooAbsArg &other, bool assumeSameType=false) const =0
RooArgSet * getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
A space to attach TBranches.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
Int_t getSize() const
Return the number of elements in the collection.
virtual RooAbsArg * addClone(const RooAbsArg &var, bool silent=false)
Add a clone of the specified argument to list.
RooFIter fwdIterator() const
One-time forward iterator.
void setConstant(bool value=true)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
static Int_t numEvalErrorItems()
static EvalErrorIter evalErrorIter()
static ErrorLoggingMode evalErrorLoggingMode()
Return current evaluation error logging mode.
double _value
Cache for current value of object.
static void setHideOffset(bool flag)
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 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
Return pointer to contained argument.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooCategory is an object to represent discrete states.
void removeAll() override
Remove all argument inset using remove(const RooAbsArg&).
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
BidirMMapPipe creates a bidirectional channel between the current process and a child it forks.
bool good() const
status of stream is good
bool isChild() const
return if this end of the pipe is the child end
bool eof() const
true if end-of-file
int close()
flush buffers, close pipe
pid_t pidOtherEnd() const
return PID of the process on the other end of the pipe
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 flag) override
Disables or enables the usage of squared weights.
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
! connection to child
RooArgList _saveVars
Copy of variables.
void calculate() const
Client-side function that instructs server process to start asynchronuous (re)calculation of function...
void initialize()
Initialize the remote process and message passing pipes between current process and remote process.
void serverLoop()
Server loop of remote processes.
void standby()
Terminate remote server process and return front-end class to standby mode.
static RooMPSentinel _sentinel
RooListProxy _vars
Variables.
void applyNLLWeightSquared(bool flag)
Control verbose messaging related to inter process communication on both client and server side.
void initVars()
Initialize list of variables of front-end argument 'arg'.
RooRealMPFE * _updateMaster
! Update master
void doApplyNLLW2(bool flag)
bool _retrieveDispatched
!
void setVerbose(bool clientFlag=true, bool serverFlag=true)
Control verbose messaging related to inter process communication on both client and server side.
std::vector< bool > _constChanged
! Flags if variable needs update on server-side
double evaluate() const override
Send message to server process to retrieve output value If error were logged use logEvalError() on re...
void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTracking=true) override
Intercept call to optimize constant term in test statistics and forward it to object on server side.
double getValV(const RooArgSet *nset=0) const override
If value needs recalculation and calculation has not beed started with a call to calculate() start it...
virtual double getCarry() const
std::vector< bool > _valueChanged
! Flags if variable needs update on server-side
void enableOffsetting(bool flag) override
Control verbose messaging related to inter process communication on both client and server side.
RooRealProxy _arg
Function to calculate in parallel process.
~RooRealMPFE() override
Destructor.
RooAbsReal::ErrorLoggingMode _remoteEvalErrorLoggingState
RooRealVar represents a variable that can be changed from the outside.
void setVal(double value) override
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.
const char * GetName() const override
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)