00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * @(#)root/roofitcore:$Id: RooMPSentinel.cxx 24285 2008-06-16 15:05:15Z wouter $ 00005 * Authors: * 00006 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * 00007 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * 00008 * * 00009 * Copyright (c) 2000-2005, Regents of the University of California * 00010 * and Stanford University. All rights reserved. * 00011 * * 00012 * Redistribution and use in source and binary forms, * 00013 * with or without modification, are permitted according to the terms * 00014 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * 00015 *****************************************************************************/ 00016 00017 ////////////////////////////////////////////////////////////////////////////// 00018 // 00019 // BEGIN_HTML 00020 // RooMPSentinel is a singleton class that keeps track of all 00021 // parellel execution processes for goodness-of-fit calculations. 00022 // The primary task of RooMPSentinel is to terminate all server processes 00023 // when the main ROOT process is exiting. 00024 // END_HTML 00025 // 00026 00027 00028 #include "RooFit.h" 00029 00030 #include "RooMPSentinel.h" 00031 #include "RooMPSentinel.h" 00032 #include "RooRealMPFE.h" 00033 00034 ClassImp(RooMPSentinel) 00035 ; 00036 00037 00038 //_____________________________________________________________________________ 00039 RooMPSentinel::RooMPSentinel() 00040 { 00041 // Constructor 00042 } 00043 00044 00045 00046 //_____________________________________________________________________________ 00047 RooMPSentinel::~RooMPSentinel() 00048 { 00049 // Destructor. Terminate all parallel processes still registered with 00050 // the sentinel 00051 00052 TIterator *iter = _mpfeSet.createIterator() ; 00053 RooRealMPFE* mpfe ; 00054 while((mpfe=(RooRealMPFE*)iter->Next())) { 00055 mpfe->standby() ; 00056 } 00057 delete iter ; 00058 } 00059 00060 00061 00062 //_____________________________________________________________________________ 00063 void RooMPSentinel::add(RooRealMPFE& mpfe) 00064 { 00065 // Register given multi-processor front-end object with the sentinel 00066 00067 _mpfeSet.add(mpfe,kTRUE) ; 00068 } 00069 00070 00071 00072 //_____________________________________________________________________________ 00073 void RooMPSentinel::remove(RooRealMPFE& mpfe) 00074 { 00075 // Remove given multi-processor front-end object from the sentinel 00076 00077 _mpfeSet.remove(mpfe,kTRUE) ; 00078 }