82 _arg(
"arg",
"arg",this,arg),
83 _vars(
"vars",
"vars",this),
87 _inlineMode(calcInline),
88 _remoteEvalErrorLoggingState(
RooAbsReal::PrintErrors),
91 _retrieveDispatched(
kFALSE), _evalCarry(0.)
196 if (
_pipe->isChild()) {
204 GetName() <<
") server process terminating" << endl ;
212 GetName() <<
") successfully forked server process " <<
213 _pipe->pidOtherEnd() << endl ;
231 Int_t idx, index, numErrors ;
241 <<
") IPC fromClient> Terminate" << endl;
250 *
_pipe >> idx >> value >> isConst;
252 <<
") IPC fromClient> SendReal [" << idx <<
"]=" << value << endl ;
263 *
_pipe >> idx >> index;
265 <<
") IPC fromClient> SendCat [" << idx <<
"]=" << index << endl ;
272 <<
") IPC fromClient> Calculate" << endl ;
278 <<
") IPC fromClient> Calculate" << endl ;
288 <<
") IPC fromClient> Retrieve" << endl ;
294 <<
") IPC toClient> ReturnValue " <<
_value <<
" NumError " << numErrors << endl ;
298 std::string objidstr;
304 objidstr = oss2.str();
306 std::map<const RooAbsArg*,pair<string,list<EvalError> > >::const_iterator iter =
evalErrorIter();
309 list<EvalError>::const_iterator iter2 = iter->second.second.begin();
310 for (; iter->second.second.end() != iter2; ++iter2) {
312 *
_pipe << ptr << iter2->_msg << iter2->_srvval << objidstr;
314 <<
") IPC toClient> sending error log Arg " << iter->first <<
" Msg " << iter2->_msg << endl ;
331 *
_pipe >> code >> doTrack;
333 <<
") IPC fromClient> ConstOpt " << code <<
" doTrack = " << (doTrack?
"T":
"F") << endl ;
343 <<
") IPC fromClient> Verbose " << (flag?1:0) << endl ;
354 <<
") IPC fromClient> ApplyNLLW2 " << (flag?1:0) << endl ;
366 <<
") IPC fromClient> EnableOffset " << (flag?1:0) << endl ;
380 <<
") IPC fromClient> LogEvalError flag = " << flag2 << endl ;
387 <<
") IPC fromClient> Unknown message (code = " << msg <<
")" << endl ;
429 while((var = viter.
next())) {
430 saveVar = siter.
next() ;
433 Bool_t valChanged,constChanged ;
444 if ( valChanged || constChanged ||
_forceCalc) {
447 <<
") variable " <<
_vars.
at(i)->
GetName() <<
" changed" << endl ;
454 if (dynamic_cast<RooAbsReal*>(var)) {
458 *
_pipe << msg << i << val << isC;
461 <<
") IPC toServer> SendReal [" << i <<
"]=" << val << (isC?
" (Constant)":
"") << endl ;
462 }
else if (dynamic_cast<RooAbsCategory*>(var)) {
465 *
_pipe << msg << i << idx;
467 <<
") IPC toServer> SendCat [" << i <<
"]=" << idx << endl ;
476 <<
") IPC toServer> Calculate " << endl ;
486 <<
") IPC toServer> Retrieve " << endl ;
490 cout <<
"RooRealMPFE::calculate(" <<
GetName()
491 <<
") ERROR not in Client or Inline mode" << endl ;
540 return_value =
_arg ;
543 bool needflush =
false;
552 *
_pipe << msg << flag;
562 <<
") IPC toServer> Retrieve " << endl ;
573 cout <<
"RooRealMPFE::evaluate(" <<
GetName()
574 <<
") ERROR: unexpected message from server process: " << msg << endl ;
578 <<
") IPC fromServer> ReturnValue " << value << endl ;
581 <<
") IPC fromServer> NumErrors " << numError << endl ;
584 char *msgbuf1 = 0, *msgbuf2 = 0, *msgbuf3 = 0;
589 *
_pipe >> msgbuf1 >> msgbuf2 >> msgbuf3;
591 <<
") IPC fromServer> retrieving error log Arg " << ptr <<
" Msg " << msgbuf1 << endl ;
593 logEvalError(reinterpret_cast<RooAbsReal*>(ptr),msgbuf3,msgbuf1,msgbuf2) ;
602 return_value =
value ;
623 <<
") IPC toServer> Terminate " << endl;
630 std::cerr <<
"In " << __func__ <<
"(" << __FILE__
", " << __LINE__ <<
631 "): Server shutdown failed." << std::endl;
635 std::cerr <<
"In " << __func__ <<
"(" << __FILE__
", " <<
636 __LINE__ <<
"): Pipe has already shut down, not sending " 637 "Terminate to server." << std::endl;
663 *
_pipe << msg << op << doAlsoTracking;
665 <<
") IPC toServer> ConstOpt " << opcode << endl ;
687 *
_pipe << msg << serverFlag;
689 <<
") IPC toServer> Verbose " << (serverFlag?1:0) << endl ;
705 *
_pipe << msg << flag;
707 <<
") IPC toServer> ApplyNLLW2 " << (flag?1:0) << endl ;
734 *
_pipe << msg << flag;
736 <<
") IPC toServer> EnableOffset " << (flag?1:0) << endl ;
void clearValueDirty() const
void calculate() const
Client-side function that instructs server process to start asynchronuous (re)calculation of function...
virtual const char * GetName() const
Returns name of object.
virtual int GetPid()
Get process id.
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, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
void initVars()
Initialize list of variables of front-end argument 'arg'.
static EvalErrorIter evalErrorIter()
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
header file for BidirMMapPipe, a class which forks off a child process and serves as communications c...
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
static Int_t numEvalErrorItems()
void initialize()
Initialize the remote process and message passing pipes between current process and remote process...
RooRealMPFE * _updateMaster
Flags if variable needs update on server-side.
void applyNLLWeightSquared(Bool_t flag)
Control verbose messaging related to inter process communication on both client and server side...
static void setHideOffset(Bool_t flag)
void applyWeightSquared(Bool_t flag)
Bool_t _retrieveDispatched
Update master.
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
Vc_ALWAYS_INLINE void free(T *p)
Frees memory that was allocated with Vc::malloc.
std::vector< Bool_t > _constChanged
Flags if variable needs update on server-side.
void flush()
flush buffers with unwritten data
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
virtual ~RooRealMPFE()
Destructor.
void serverLoop()
Server loop of remote processes.
virtual Bool_t isIdentical(const RooAbsArg &other, Bool_t assumeSameType=kFALSE)=0
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
virtual Double_t getCarry() const
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual Double_t getCarry() const
void setVerbose(Bool_t clientFlag=kTRUE, Bool_t serverFlag=kTRUE)
Control verbose messaging related to inter process communication on both client and server side...
RooRealMPFE(const char *name, const char *title, RooAbsReal &arg, Bool_t calcInline=kFALSE)
Construct front-end object for object 'arg' whose evaluation will be calculated asynchronously in a s...
void Initialize(Bool_t useTMVAStyle=kTRUE)
R__EXTERN TSystem * gSystem
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
RooAbsArg * at(Int_t idx) const
void setConstant(Bool_t value=kTRUE)
void logEvalError(const char *message, const char *serverValueString=0) const
Log evaluation error message.
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
void standby()
Terminate remote server process and return front-end class to standby mode.
RooAbsArg * absArg() const
BidirMMapPipe creates a bidirectional channel between the current process and a child it forks...
static Bool_t hideOffset()
std::vector< Bool_t > _valueChanged
connection to child
void enableOffsetting(Bool_t flag)
Control verbose messaging related to inter process communication on both client and server side...
void remove(RooRealMPFE &mpfe)
Remove given multi-processor front-end object from the sentinel.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooFIter fwdIterator() const
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...
void add(RooRealMPFE &mpfe)
Register given multi-processor front-end object with the sentinel.
static ErrorLoggingMode evalErrorLoggingMode()
Return current evaluation error logging mode.
RooAbsReal::ErrorLoggingMode _remoteEvalErrorLoggingState
Bool_t isValueDirty() const
virtual Double_t evaluate() const
Send message to server process to retrieve output value If error were logged use logEvalError() on re...
virtual void removeAll()
Reimplementation of standard RooArgList::removeAll()
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...
void doApplyNLLW2(Bool_t flag)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
const RooAbsReal & arg() const
Bool_t isConstant() const
RooFit::BidirMMapPipe * _pipe
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...
static RooMPSentinel _sentinel