92using std::cout, std::endl, std::string, std::ostringstream, std::list, std::pair;
107 _vars(
"vars",
"vars",this),
191 if (tmp)
return tmp->getCarry();
215 _pipe =
new BidirMMapPipe();
217 if (
_pipe->isChild()) {
225 GetName() <<
") server process terminating" << endl ;
227 delete _arg.absArg();
234 <<
_pipe->pidOtherEnd() << endl;
265 <<
") IPC fromClient> Terminate" << endl;
267 *
_pipe << msg << BidirMMapPipe::flush;
276 <<
") IPC fromClient> SendReal [" << idx <<
"]=" <<
value << endl ;
289 <<
") IPC fromClient> SendCat [" << idx <<
"]=" <<
index << endl ;
296 <<
") IPC fromClient> Calculate" << endl ;
302 <<
") IPC fromClient> Calculate" << endl ;
312 <<
") IPC fromClient> Retrieve" << endl ;
318 <<
") IPC toClient> ReturnValue " <<
_value <<
" NumError " << numErrors << endl ;
322 std::string objidstr;
326 oss2 <<
"PID" <<
gSystem->GetPid() <<
"/";
328 objidstr = oss2.str();
330 std::map<const RooAbsArg*,pair<string,list<EvalError> > >::const_iterator iter =
evalErrorIter();
333 list<EvalError>::const_iterator iter2 = iter->second.second.begin();
334 for (; iter->second.second.end() != iter2; ++iter2) {
336 *
_pipe << ptr << iter2->_msg << iter2->_srvval << objidstr;
338 <<
") IPC toClient> sending error log Arg " << iter->first <<
" Msg " << iter2->_msg << endl ;
347 *
_pipe << BidirMMapPipe::flush;
355 *
_pipe >> code >> doTrack;
357 <<
") IPC fromClient> ConstOpt " << code <<
" doTrack = " << (doTrack?
"T":
"F") << endl ;
367 <<
") IPC fromClient> Verbose " << (flag?1:0) << endl ;
378 <<
") IPC fromClient> ApplyNLLW2 " << (flag?1:0) << endl ;
390 <<
") IPC fromClient> EnableOffset " << (flag?1:0) << endl ;
404 <<
") IPC fromClient> LogEvalError flag = " << flag2 << endl ;
411 <<
") IPC fromClient> Unknown message (code = " << msg <<
")" << endl ;
452 for (std::size_t j=0 ; j<
_vars.size() ; j++) {
469 if ( valChanged || constChanged ||
_forceCalc) {
472 <<
") variable " <<
_vars.at(
i)->GetName() <<
" changed" << endl ;
483 *
_pipe << msg <<
i << val << isC;
486 <<
") IPC toServer> SendReal [" <<
i <<
"]=" << val << (isC?
" (Constant)":
"") << endl ;
489 UInt_t idx = (
static_cast<RooAbsCategory*
>(var))->getCurrentIndex() ;
490 *
_pipe << msg <<
i << idx;
492 <<
") IPC toServer> SendCat [" <<
i <<
"]=" << idx << endl ;
501 <<
") IPC toServer> Calculate " << endl ;
509 *
_pipe << msg << BidirMMapPipe::flush;
511 <<
") IPC toServer> Retrieve " << endl ;
515 cout <<
"RooRealMPFE::calculate(" <<
GetName()
516 <<
") ERROR not in Client or Inline mode" << endl ;
563 double return_value = 0;
565 return_value =
_arg ;
568 bool needflush =
false;
577 *
_pipe << msg << flag;
587 <<
") IPC toServer> Retrieve " << endl ;
589 if (needflush) *
_pipe << BidirMMapPipe::flush;
598 cout <<
"RooRealMPFE::evaluate(" <<
GetName()
599 <<
") ERROR: unexpected message from server process: " << msg << endl ;
603 <<
") IPC fromServer> ReturnValue " <<
value << endl ;
606 <<
") IPC fromServer> NumErrors " << numError << endl ;
609 char *msgbuf1 =
nullptr;
610 char *msgbuf2 =
nullptr;
611 char *msgbuf3 =
nullptr;
616 *
_pipe >> msgbuf1 >> msgbuf2 >> msgbuf3;
618 <<
") IPC fromServer> retrieving error log Arg " << ptr <<
" Msg " << msgbuf1 << endl ;
629 return_value =
value ;
650 <<
") IPC toServer> Terminate " << endl;
652 *
_pipe << msg << BidirMMapPipe::flush;
657 std::cerr <<
"In " << __func__ <<
"(" << __FILE__
", " << __LINE__ <<
658 "): Server shutdown failed." << std::endl;
662 std::cerr <<
"In " << __func__ <<
"(" << __FILE__
", " <<
663 __LINE__ <<
"): Pipe has already shut down, not sending "
664 "Terminate to server." << std::endl;
690 *
_pipe << msg << op << doAlsoTracking;
692 <<
") IPC toServer> ConstOpt " << opcode << endl ;
699 ((
RooAbsReal&)
_arg.arg()).constOptimizeTestStatistic(opcode,doAlsoTracking) ;
714 *
_pipe << msg << serverFlag;
716 <<
") IPC toServer> Verbose " << (serverFlag?1:0) << endl ;
732 *
_pipe << msg << flag;
734 <<
") IPC toServer> ApplyNLLW2 " << (flag?1:0) << endl ;
747 nll->applyWeightSquared(flag) ;
761 *
_pipe << msg << flag;
763 <<
") IPC toServer> EnableOffset " << (flag?1:0) << endl ;
true
Register systematic variations for multiple existing columns using auto-generated tags.
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
return
Invalidate stored TCling state for declarations included in transaction âTâ.
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
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
RooAbsArg()
Default constructor.
A space to attach TBranches.
void setConstant(bool value=true)
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
static Int_t numEvalErrorItems()
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
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=nullptr) const
Log evaluation error message.
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
Implements a -log(likelihood) calculation from a dataset and a PDF.
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,...
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.
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
friend class RooAbsTestStatistic
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.
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
RooRealMPFE(const char *name, const char *title, RooAbsReal &arg, bool calcInline=false)
Construct front-end object for object 'arg' whose evaluation will be calculated asynchronously in a s...
double getValV(const RooArgSet *nset=nullptr) const override
If value needs recalculation and calculation has not been started with a call to calculate() start it...
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
const char * GetName() const override
Returns name of object.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
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.
static RooMPSentinel & instance()
~RooMPSentinel()
Destructor.