Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooRealMPFE.cxx
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*****************************************************************************
4 * Project: RooFit *
5 * Package: RooFitCore *
6 * @(#)root/roofitcore:$Id$
7 * Authors: *
8 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
9 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
10 * *
11 * Copyright (c) 2000-2005, Regents of the University of California *
12 * and Stanford University. All rights reserved. *
13 * *
14 * Redistribution and use in source and binary forms, *
15 * with or without modification, are permitted according to the terms *
16 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
17 *****************************************************************************/
18
19/**
20\file RooRealMPFE.cxx
21\class RooRealMPFE
22\ingroup Roofitcore
23
24Multi-processor front-end for parallel calculation
25of RooAbsReal objects. Each RooRealMPFE forks a process that calculates
26the value of the proxies RooAbsReal object. The (re)calculation of
27the proxied object is started asynchronously with the calculate() option.
28A subsequent call to getVal() will return the calculated value when available
29If the calculation is still in progress when getVal() is called it blocks
30the calling process until the calculation is done. The forked calculation process
31is terminated when the front-end object is deleted
32Simple use demonstration
33
34~~~{.cpp}
35RooAbsReal* slowFunc ;
36
37double val = slowFunc->getVal() // Evaluate slowFunc in current process
38
39RooRealMPFE mpfe("mpfe","frontend to slowFunc",*slowFunc) ;
40mpfe.calculate() ; // Start calculation of slow-func in remote process
41 // .. do other stuff here ..
42double val = mpfe.getVal() // Wait for remote calculation to finish and retrieve value
43~~~
44
45For general multiprocessing in ROOT, please refer to the TProcessExecutor class.
46
47**/
48
49#include "Riostream.h"
50
51#ifndef _WIN32
52#include "BidirMMapPipe.h"
53#endif
54
55#include <cstdlib>
56#include <memory>
57#include <sstream>
58#include "RooRealMPFE.h"
59#include "RooArgSet.h"
60#include "RooAbsCategory.h"
61#include "RooRealVar.h"
62#include "RooCategory.h"
63#include "RooMsgService.h"
64#include "RooNLLVar.h"
65
66#include "Rtypes.h"
67#include "TSystem.h"
68
69
70class RooRealMPFE ;
71
72// RooMPSentinel is a singleton class that keeps track of all
73// parallel execution processes for goodness-of-fit calculations.
74// The primary task of RooMPSentinel is to terminate all server processes
75// when the main ROOT process is exiting.
76struct RooMPSentinel {
77
78 static RooMPSentinel& instance();
79
81
82 void add(RooRealMPFE& mpfe) ;
83 void remove(RooRealMPFE& mpfe) ;
84
86};
87
88RooMPSentinel& RooMPSentinel::instance() {
89 static RooMPSentinel inst;
90 return inst;
91}
92
93
94using std::string, std::ostringstream, std::list;
95using namespace RooFit;
96
97
98////////////////////////////////////////////////////////////////////////////////
99/// Construct front-end object for object 'arg' whose evaluation will be calculated
100/// asynchronously in a separate process. If calcInline is true the value of 'arg'
101/// is calculate synchronously in the current process.
102
103RooRealMPFE::RooRealMPFE(const char *name, const char *title, RooAbsReal& arg, bool calcInline) :
104 RooAbsReal(name,title),
105 _state(Initialize),
106 _arg("arg","arg",this,arg),
107 _vars("vars","vars",this),
113 _pipe(nullptr),
114 _updateMaster(nullptr),
116{
117#ifdef _WIN32
118 _inlineMode = true;
119#endif
120 initVars() ;
121 RooMPSentinel::instance().add(*this) ;
122
123}
124
125
126
127////////////////////////////////////////////////////////////////////////////////
128/// Copy constructor. Initializes in clean state so that upon eval
129/// this instance will create its own server processes
130
131RooRealMPFE::RooRealMPFE(const RooRealMPFE& other, const char* name) :
133 _state(Initialize),
134 _arg("arg",this,other._arg),
135 _vars("vars",this,other._vars),
142 _pipe(nullptr),
143 _updateMaster(nullptr),
145{
146 initVars() ;
147 RooMPSentinel::instance().add(*this) ;
148}
149
150
151
152////////////////////////////////////////////////////////////////////////////////
153/// Destructor
154
155RooRealMPFE::~RooRealMPFE()
156{
157 if (_state==Client) standby();
158 RooMPSentinel::instance().remove(*this);
159}
160
161
162
163////////////////////////////////////////////////////////////////////////////////
164/// Initialize list of variables of front-end argument 'arg'
165
166void RooRealMPFE::initVars()
167{
168 // Empty current lists
169 _vars.removeAll() ;
170 _saveVars.removeAll() ;
171
172 // Retrieve non-constant parameters
173 std::unique_ptr<RooArgSet> vars{_arg->getParameters(RooArgSet())};
174 // RooArgSet *ncVars = vars->selectByAttrib("Constant", false);
175 RooArgList varList(*vars) ;
176
177 // Save in lists
178 _vars.add(varList) ;
179 _saveVars.addClone(varList) ;
180 _valueChanged.resize(_vars.size()) ;
181 _constChanged.resize(_vars.size()) ;
182
183 // Force next calculation
184 _forceCalc = true ;
185}
186
187double RooRealMPFE::getCarry() const
188{
189 if (_inlineMode) {
190 RooAbsTestStatistic* tmp = dynamic_cast<RooAbsTestStatistic*>(_arg.absArg());
191 if (tmp) return tmp->getCarry();
192 else return 0.;
193 } else {
194 return _evalCarry;
195 }
196}
197
198////////////////////////////////////////////////////////////////////////////////
199/// Initialize the remote process and message passing
200/// pipes between current process and remote process
201
202void RooRealMPFE::initialize()
203{
204 // Trivial case: Inline mode
205 if (_inlineMode) {
206 _state = Inline ;
207 return ;
208 }
209
210#ifndef _WIN32
211 // Clear eval error log prior to forking
212 // to avoid confusions...
213 clearEvalErrorLog() ;
214 // Fork server process and setup IPC
215 _pipe = new BidirMMapPipe();
216
217 if (_pipe->isChild()) {
218 // Start server loop
219 _state = Server ;
220 serverLoop();
221
222 // Kill server at end of service
223 if (_verboseServer) ccoutD(Minimization) << "RooRealMPFE::initialize(" <<
224 GetName() << ") server process terminating" << std::endl ;
225
226 delete _arg.absArg();
227 delete _pipe;
228 _exit(0) ;
229 } else {
230 // Client process - fork successful
231 if (_verboseClient) {
232 ccoutD(Minimization) << "RooRealMPFE::initialize(" << GetName() << ") successfully forked server process "
233 << _pipe->pidOtherEnd() << std::endl;
234 }
235 _state = Client ;
237 }
238#endif // _WIN32
239}
240
241
242
243////////////////////////////////////////////////////////////////////////////////
244/// Server loop of remote processes. This function will return
245/// only when an incoming TERMINATE message is received.
246
247void RooRealMPFE::serverLoop()
248{
249#ifndef _WIN32
250 int msg ;
251
252 Int_t idx;
253 Int_t index;
255 double value ;
256 bool isConst ;
257
258 clearEvalErrorLog() ;
259
260 while(*_pipe && !_pipe->eof()) {
261 *_pipe >> msg;
262 if (Terminate == msg) {
263 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
264 << ") IPC fromClient> Terminate" << std::endl;
265 // send terminate acknowledged to client
266 *_pipe << msg << BidirMMapPipe::flush;
267 break;
268 }
269
270 switch (msg) {
271 case SendReal:
272 {
273 *_pipe >> idx >> value >> isConst;
274 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
275 << ") IPC fromClient> SendReal [" << idx << "]=" << value << std::endl ;
276 RooRealVar* rvar = static_cast<RooRealVar*>(_vars.at(idx)) ;
277 rvar->setVal(value) ;
278 if (rvar->isConstant() != isConst) {
279 rvar->setConstant(isConst) ;
280 }
281 }
282 break ;
283
284 case SendCat:
285 {
286 *_pipe >> idx >> index;
287 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
288 << ") IPC fromClient> SendCat [" << idx << "]=" << index << std::endl ;
289 (static_cast<RooCategory*>(_vars.at(idx)))->setIndex(index) ;
290 }
291 break ;
292
293 case Calculate:
294 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
295 << ") IPC fromClient> Calculate" << std::endl ;
296 _value = _arg ;
297 break ;
298
300 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
301 << ") IPC fromClient> Calculate" << std::endl ;
302
304 _value = _arg ;
306 break ;
307
308 case Retrieve:
309 {
310 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
311 << ") IPC fromClient> Retrieve" << std::endl ;
313 numErrors = numEvalErrors();
314 *_pipe << msg << _value << getCarry() << numErrors;
315
316 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
317 << ") IPC toClient> ReturnValue " << _value << " NumError " << numErrors << std::endl ;
318
319 if (numErrors) {
320 // Loop over errors
321 std::string objidstr;
322 {
323 ostringstream oss2;
324 // Format string with object identity as this cannot be evaluated on the other side
325 oss2 << "PID" << gSystem->GetPid() << "/";
326 printStream(oss2,kName|kClassName|kArgs,kInline);
327 objidstr = oss2.str();
328 }
329 std::map<const RooAbsArg*,std::pair<string,list<EvalError> > >::const_iterator iter = evalErrorIter();
330 const RooAbsArg* ptr = nullptr;
331 for (int i = 0; i < numEvalErrorItems(); ++i) {
332 list<EvalError>::const_iterator iter2 = iter->second.second.begin();
333 for (; iter->second.second.end() != iter2; ++iter2) {
334 ptr = iter->first;
335 *_pipe << ptr << iter2->_msg << iter2->_srvval << objidstr;
336 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
337 << ") IPC toClient> sending error log Arg " << iter->first << " Msg " << iter2->_msg << std::endl ;
338 }
339 }
340 // let other end know that we're done with the list of errors
341 ptr = nullptr;
342 *_pipe << ptr;
343 // Clear error list on local side
344 clearEvalErrorLog();
345 }
346 *_pipe << BidirMMapPipe::flush;
347 }
348 break;
349
350 case ConstOpt:
351 {
352 bool doTrack ;
353 int code;
354 *_pipe >> code >> doTrack;
355 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
356 << ") IPC fromClient> ConstOpt " << code << " doTrack = " << (doTrack?"T":"F") << std::endl ;
357 ((RooAbsReal&)_arg.arg()).constOptimizeTestStatistic(static_cast<RooAbsArg::ConstOpCode>(code),doTrack) ;
358 break ;
359 }
360
361 case Verbose:
362 {
363 bool flag ;
364 *_pipe >> flag;
365 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
366 << ") IPC fromClient> Verbose " << (flag?1:0) << std::endl ;
368 }
369 break ;
370
371
372 case ApplyNLLW2:
373 {
374 bool flag ;
375 *_pipe >> flag;
376 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
377 << ") IPC fromClient> ApplyNLLW2 " << (flag?1:0) << std::endl ;
378
379 // Do application of weight-squared here
381 }
382 break ;
383
384 case EnableOffset:
385 {
386 bool flag ;
387 *_pipe >> flag;
388 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
389 << ") IPC fromClient> EnableOffset " << (flag?1:0) << std::endl ;
390
391 // Enable likelihoof offsetting here
392 ((RooAbsReal&)_arg.arg()).enableOffsetting(flag) ;
393 }
394 break ;
395
396 case LogEvalError:
397 {
398 int iflag2;
399 *_pipe >> iflag2;
402 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
403 << ") IPC fromClient> LogEvalError flag = " << flag2 << std::endl ;
404 }
405 break ;
406
407
408 default:
409 if (_verboseServer) std::cout << "RooRealMPFE::serverLoop(" << GetName()
410 << ") IPC fromClient> Unknown message (code = " << msg << ")" << std::endl ;
411 break ;
412 }
413 }
414
415#endif // _WIN32
416}
417
418
419
420////////////////////////////////////////////////////////////////////////////////
421/// Client-side function that instructs server process to start
422/// asynchronous (re)calculation of function value. This function
423/// returns immediately. The calculated value can be retrieved
424/// using getVal()
425
426void RooRealMPFE::calculate() const
427{
428
429 // Start asynchronous calculation of arg value
430 if (_state==Initialize) {
431 const_cast<RooRealMPFE*>(this)->initialize() ;
432 }
433
434 // Inline mode -- Calculate value now
435 if (_state==Inline) {
436 _value = _arg ;
437 clearValueDirty() ;
438 }
439
440#ifndef _WIN32
441 // Compare current value of variables with saved values and send changes to server
442 if (_state==Client) {
443 Int_t i(0) ;
444
445 //for (i=0 ; i<_vars.size() ; i++) {
446 RooAbsArg *var;
448 for (std::size_t j=0 ; j<_vars.size() ; j++) {
449 var = _vars.at(j);
450 saveVar = _saveVars.at(j);
451
452 //bool valChanged = !(*var==*saveVar) ;
453 bool valChanged;
454 bool constChanged;
455 if (!_updateMaster) {
456 valChanged = !var->isIdentical(*saveVar,true) ;
457 constChanged = (var->isConstant() != saveVar->isConstant()) ;
460 } else {
461 valChanged = _updateMaster->_valueChanged[i] ;
462 constChanged = _updateMaster->_constChanged[i] ;
463 }
464
466 if (_verboseClient) std::cout << "RooRealMPFE::calculate(" << GetName()
467 << ") variable " << _vars.at(i)->GetName() << " changed" << std::endl ;
468 if (constChanged) {
469 (static_cast<RooRealVar*>(saveVar))->setConstant(var->isConstant()) ;
470 }
471 saveVar->copyCache(var) ;
472
473 // send message to server
474 if (dynamic_cast<RooAbsReal*>(var)) {
475 int msg = SendReal ;
476 double val = (static_cast<RooAbsReal*>(var))->getVal() ;
477 bool isC = var->isConstant() ;
478 *_pipe << msg << i << val << isC;
479
480 if (_verboseServer) std::cout << "RooRealMPFE::calculate(" << GetName()
481 << ") IPC toServer> SendReal [" << i << "]=" << val << (isC?" (Constant)":"") << std::endl ;
482 } else if (dynamic_cast<RooAbsCategory*>(var)) {
483 int msg = SendCat ;
484 UInt_t idx = (static_cast<RooAbsCategory*>(var))->getCurrentIndex() ;
485 *_pipe << msg << i << idx;
486 if (_verboseServer) std::cout << "RooRealMPFE::calculate(" << GetName()
487 << ") IPC toServer> SendCat [" << i << "]=" << idx << std::endl ;
488 }
489 }
490 i++ ;
491 }
492
493 int msg = hideOffset() ? Calculate : CalculateNoOffset;
494 *_pipe << msg;
495 if (_verboseServer) std::cout << "RooRealMPFE::calculate(" << GetName()
496 << ") IPC toServer> Calculate " << std::endl ;
497
498 // Clear dirty state and mark that calculation request was dispatched
499 clearValueDirty() ;
501 _forceCalc = false ;
502
503 msg = Retrieve ;
504 *_pipe << msg << BidirMMapPipe::flush;
505 if (_verboseServer) std::cout << "RooRealMPFE::evaluate(" << GetName()
506 << ") IPC toServer> Retrieve " << std::endl ;
508
509 } else if (_state!=Inline) {
510 std::cout << "RooRealMPFE::calculate(" << GetName()
511 << ") ERROR not in Client or Inline mode" << std::endl ;
512 }
513
514
515#endif // _WIN32
516}
517
518
519
520
521////////////////////////////////////////////////////////////////////////////////
522/// If value needs recalculation and calculation has not been started
523/// with a call to calculate() start it now. This function blocks
524/// until remote process has finished calculation and returns
525/// remote value
526
527double RooRealMPFE::getValV(const RooArgSet* /*nset*/) const
528{
529
530 if (isValueDirty()) {
531 // Cache is dirty, no calculation has been started yet
532 calculate() ;
533 _value = evaluate() ;
534 } else if (_calcInProgress) {
535 // Cache is clean and calculation is in progress
536 _value = evaluate() ;
537 } else {
538 // Cache is clean and calculated value is in cache
539 }
540
541 return _value ;
542}
543
544
545
546////////////////////////////////////////////////////////////////////////////////
547/// Send message to server process to retrieve output value
548/// If error were logged use logEvalError() on remote side
549/// transfer those errors to the local eval error queue.
550
551double RooRealMPFE::evaluate() const
552{
553 // Retrieve value of arg
554 double return_value = 0;
555 if (_state==Inline) {
556 return_value = _arg ;
557 } else if (_state==Client) {
558#ifndef _WIN32
559 bool needflush = false;
560 int msg;
561 double value;
562
563 // If current error logging state is not the same as remote state
564 // update the remote state
565 if (evalErrorLoggingMode() != _remoteEvalErrorLoggingState) {
566 msg = LogEvalError ;
567 RooAbsReal::ErrorLoggingMode flag = evalErrorLoggingMode() ;
568 *_pipe << msg << flag;
569 needflush = true;
570 _remoteEvalErrorLoggingState = evalErrorLoggingMode() ;
571 }
572
573 if (!_retrieveDispatched) {
574 msg = Retrieve ;
575 *_pipe << msg;
576 needflush = true;
577 if (_verboseServer) std::cout << "RooRealMPFE::evaluate(" << GetName()
578 << ") IPC toServer> Retrieve " << std::endl ;
579 }
580 if (needflush) *_pipe << BidirMMapPipe::flush;
582
583
585
586 *_pipe >> msg >> value >> _evalCarry >> numError;
587
588 if (msg!=ReturnValue) {
589 std::cout << "RooRealMPFE::evaluate(" << GetName()
590 << ") ERROR: unexpected message from server process: " << msg << std::endl ;
591 return 0 ;
592 }
593 if (_verboseServer) std::cout << "RooRealMPFE::evaluate(" << GetName()
594 << ") IPC fromServer> ReturnValue " << value << std::endl ;
595
596 if (_verboseServer) std::cout << "RooRealMPFE::evaluate(" << GetName()
597 << ") IPC fromServer> NumErrors " << numError << std::endl ;
598 if (numError) {
599 // Retrieve remote errors and feed into local error queue
600 char *msgbuf1 = nullptr;
601 char *msgbuf2 = nullptr;
602 char *msgbuf3 = nullptr;
603 RooAbsArg *ptr = nullptr;
604 while (true) {
605 *_pipe >> ptr;
606 if (!ptr) break;
607 *_pipe >> msgbuf1 >> msgbuf2 >> msgbuf3;
608 if (_verboseServer) std::cout << "RooRealMPFE::evaluate(" << GetName()
609 << ") IPC fromServer> retrieving error log Arg " << ptr << " Msg " << msgbuf1 << std::endl ;
610
611 logEvalError(reinterpret_cast<RooAbsReal*>(ptr),msgbuf3,msgbuf1,msgbuf2) ;
612 }
613 std::free(msgbuf1);
614 std::free(msgbuf2);
615 std::free(msgbuf3);
616 }
617
618 // Mark end of calculation in progress
621#endif // _WIN32
622 }
623
624 return return_value;
625}
626
627
628
629////////////////////////////////////////////////////////////////////////////////
630/// Terminate remote server process and return front-end class
631/// to standby mode. Calls to calculate() or evaluate() after
632/// this call will automatically recreated the server process.
633
634void RooRealMPFE::standby()
635{
636#ifndef _WIN32
637 if (_state==Client) {
638 if (_pipe->good()) {
639 // Terminate server process ;
640 if (_verboseServer) std::cout << "RooRealMPFE::standby(" << GetName()
641 << ") IPC toServer> Terminate " << std::endl;
642 int msg = Terminate;
643 *_pipe << msg << BidirMMapPipe::flush;
644 // read handshake
645 msg = 0;
646 *_pipe >> msg;
647 if (Terminate != msg || 0 != _pipe->close()) {
648 std::cerr << "In " << __func__ << "(" << __FILE__ ", " << __LINE__ <<
649 "): Server shutdown failed." << std::endl;
650 }
651 } else {
652 if (_verboseServer) {
653 std::cerr << "In " << __func__ << "(" << __FILE__ ", " <<
654 __LINE__ << "): Pipe has already shut down, not sending "
655 "Terminate to server." << std::endl;
656 }
657 }
658 // Close pipes
659 delete _pipe;
660 _pipe = nullptr;
661
662 // Revert to initialize state
663 _state = Initialize;
664 }
665#endif // _WIN32
666}
667
668
669
670////////////////////////////////////////////////////////////////////////////////
671/// Intercept call to optimize constant term in test statistics
672/// and forward it to object on server side.
673
674void RooRealMPFE::constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTracking)
675{
676#ifndef _WIN32
677 if (_state==Client) {
678
679 int msg = ConstOpt ;
680 int op = opcode;
681 *_pipe << msg << op << doAlsoTracking;
682 if (_verboseServer) std::cout << "RooRealMPFE::constOptimize(" << GetName()
683 << ") IPC toServer> ConstOpt " << opcode << std::endl ;
684
685 initVars() ;
686 }
687#endif // _WIN32
688
689 if (_state==Inline) {
690 ((RooAbsReal&)_arg.arg()).constOptimizeTestStatistic(opcode,doAlsoTracking) ;
691 }
692}
693
694
695
696////////////////////////////////////////////////////////////////////////////////
697/// Control verbose messaging related to inter process communication
698/// on both client and server side
699
700void RooRealMPFE::setVerbose(bool clientFlag, bool serverFlag)
701{
702#ifndef _WIN32
703 if (_state==Client) {
704 int msg = Verbose ;
705 *_pipe << msg << serverFlag;
706 if (_verboseServer) std::cout << "RooRealMPFE::setVerbose(" << GetName()
707 << ") IPC toServer> Verbose " << (serverFlag?1:0) << std::endl ;
708 }
709#endif // _WIN32
711}
712
713
714////////////////////////////////////////////////////////////////////////////////
715/// Control verbose messaging related to inter process communication
716/// on both client and server side
717
718void RooRealMPFE::applyNLLWeightSquared(bool flag)
719{
720#ifndef _WIN32
721 if (_state==Client) {
722 int msg = ApplyNLLW2 ;
723 *_pipe << msg << flag;
724 if (_verboseServer) std::cout << "RooRealMPFE::applyNLLWeightSquared(" << GetName()
725 << ") IPC toServer> ApplyNLLW2 " << (flag?1:0) << std::endl ;
726 }
727#endif // _WIN32
729}
730
731
732////////////////////////////////////////////////////////////////////////////////
733
734void RooRealMPFE::doApplyNLLW2(bool flag)
735{
736 RooNLLVar* nll = dynamic_cast<RooNLLVar*>(_arg.absArg()) ;
737 if (nll) {
738 nll->applyWeightSquared(flag) ;
739 }
740}
741
742
743////////////////////////////////////////////////////////////////////////////////
744/// Control verbose messaging related to inter process communication
745/// on both client and server side
746
747void RooRealMPFE::enableOffsetting(bool flag)
748{
749#ifndef _WIN32
750 if (_state==Client) {
751 int msg = EnableOffset ;
752 *_pipe << msg << flag;
753 if (_verboseServer) std::cout << "RooRealMPFE::enableOffsetting(" << GetName()
754 << ") IPC toServer> EnableOffset " << (flag?1:0) << std::endl ;
755 }
756#endif // _WIN32
757 ((RooAbsReal&)_arg.arg()).enableOffsetting(flag) ;
758}
759
760
761
762////////////////////////////////////////////////////////////////////////////////
763/// Destructor. Terminate all parallel processes still registered with
764/// the sentinel
765
766RooMPSentinel::~RooMPSentinel()
767{
768 for(auto * mpfe : static_range_cast<RooRealMPFE*>(_mpfeSet)) {
769 mpfe->standby() ;
770 }
771}
772
773
774
775////////////////////////////////////////////////////////////////////////////////
776/// Register given multi-processor front-end object with the sentinel
777
778void RooMPSentinel::add(RooRealMPFE& mpfe)
779{
780 _mpfeSet.add(mpfe,true) ;
781}
782
783
784
785////////////////////////////////////////////////////////////////////////////////
786/// Remove given multi-processor front-end object from the sentinel
787
788void RooMPSentinel::remove(RooRealMPFE& mpfe)
789{
790 _mpfeSet.remove(mpfe,true) ;
791}
792
793/// \endcond
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
static Roo_reg_AGKInteg1D instance
#define ccoutD(a)
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:61
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
char name[80]
Definition TGX11.cxx:148
@ kName
R__EXTERN TSystem * gSystem
Definition TSystem.h:582
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:76
bool isConstant() const
Check if the "Constant" attribute is set.
Definition RooAbsArg.h:283
virtual bool isIdentical(const RooAbsArg &other, bool assumeSameType=false) const =0
A space to attach TBranches.
void setConstant(bool value=true)
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
static void setHideOffset(bool flag)
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Object to represent discrete states.
Definition RooCategory.h:28
Variable that can be changed from the outside.
Definition RooRealVar.h:37
void setVal(double value) override
Set value of variable to 'value'.
virtual int GetPid()
Get process id.
Definition TSystem.cxx:720
RooCmdArg Verbose(bool flag=true)
double nll(double pdf, double weight, int binnedL, int doBinOffset)
Definition MathFuncs.h:452
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:72
void evaluate(typename Architecture_t::Tensor_t &A, EActivationFunction f)
Apply the given activation function to each value in the given tensor A.
Definition Functions.h:98
void initialize(typename Architecture_t::Matrix_t &A, EInitialization m)
Definition Functions.h:282
void Initialize(Bool_t useTMVAStyle=kTRUE)
Definition tmvaglob.cxx:176