CPUCruncher Class Reference

A class that implements a search for prime numbers. More...

#include <src/CPUCruncher.h>

Inheritance diagram for CPUCruncher:
Collaboration diagram for CPUCruncher:

Public Types

typedef tbb::concurrent_hash_map< std::string, unsigned int > CHM
 
- Public Types inherited from Algorithm
typedef Gaudi::PluginService::Factory< IAlgorithm *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
using base_class = CommonMessaging
 

Public Member Functions

virtual StatusCode execute ()
 the execution of the algorithm More...
 
virtual StatusCode initialize ()
 Its initialization. More...
 
virtual StatusCode finalize ()
 the finalization of the algorithm More...
 
double get_runtime () const
 
 CPUCruncher (const std::string &name, ISvcLocator *pSvc)
 
virtual ~CPUCruncher ()
 virtual & protected desctrustor More...
 
- Public Member Functions inherited from GaudiAlgorithm
StatusCode initialize () override
 standard initialization method More...
 
StatusCode execute () override
 standard execution method More...
 
StatusCode finalize () override
 standard finalization method More...
 
StatusCode sysExecute () override
 the generic actions for the execution. More...
 
void put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
void put (DataObject *object, const std::string &address, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type get (const std::string &location, const bool useRootInTES=true) const
 Templated access to the data from Gaudi Event Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getIfExists (const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
TYPE * getDet (IDataProviderSvc *svc, const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getDetIfExists (IDataProviderSvc *svc, const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
TYPE * getDet (const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getDetIfExists (const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
bool exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
template<class TYPE >
bool exist (const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
template<class TYPE >
bool existDet (IDataProviderSvc *svc, const std::string &location) const
 Check the existence of detector objects in the Gaudi Transient Detector Store. More...
 
template<class TYPE >
bool existDet (const std::string &location) const
 Check the existence of detector objects in the Gaudi Transient Detector Store. More...
 
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate (const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
 GaudiAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Standard constructor (protected) More...
 
 ~GaudiAlgorithm () override=default
 destructor, virtual and protected More...
 
SmartIF< INTupleSvc > & evtColSvc () const
 Access the standard event collection service. More...
 
 GaudiAlgorithm (const GaudiAlgorithm &)=delete
 
GaudiAlgorithmoperator= (const GaudiAlgorithm &)=delete
 
template<class T >
PropertydeclareProperty (const std::string &name, DataObjectHandle< T > &hndl, const std::string &doc="none") const
 
- Public Member Functions inherited from GaudiCommon< Algorithm >
Gaudi::Utils::GetData< TYPE >::return_type get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
Gaudi::Utils::GetData< TYPE >::return_type getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Quicker version of the get function which bypasses the check on the retrieved data. More...
 
bool exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
DataObjectput (IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
TOOL * tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
 Useful method for the easy location of tools. More...
 
TOOL * tool (const std::string &type, const IInterface *parent=0, bool create=true) const
 A useful method for the easy location of tools. More...
 
SmartIF< SERVICE > svc (const std::string &name, const bool create=true) const
 A useful method for the easy location of services. More...
 
IUpdateManagerSvcupdMgrSvc () const
 Short-cut to locate the Update Manager Service. More...
 
StatusCode Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
 Print the error message and return with the given StatusCode. More...
 
StatusCode Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
 Print the warning message and return with the given StatusCode. More...
 
StatusCode Info (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
 Print the info message and return with the given StatusCode. More...
 
StatusCode Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
 Print the message and return with the given StatusCode. More...
 
void Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Assertion - throw exception if the given condition is not fulfilled. More...
 
void Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Assertion - throw exception if the given condition is not fulfilled. More...
 
void Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and (re)-throw a given GaudiException. More...
 
void Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and (re)-throw a given exception. More...
 
void Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and throw an exception with the given message. More...
 
const Statisticscounters () const
 accessor to all counters More...
 
StatEntitycounter (const std::string &tag) const
 accessor to certain counter by name More...
 
bool typePrint () const
 Insert the actual C++ type of the algorithm/tool in the messages ? More...
 
bool propsPrint () const
 Print properties at initialization ? More...
 
bool statPrint () const
 Print statistical counters at finalization ? More...
 
bool errorsPrint () const
 Print error counters at finalization ? More...
 
long printStat (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of statistical counters More...
 
long printErrors (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of error counters More...
 
long printProps (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of properties More...
 
void registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=nullptr)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
void registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
void registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
 just to avoid conflicts with the version using a pointer to a template class. More...
 
void registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
StatusCode runUpdate ()
 asks the UpdateManagerSvc to perform an update of the instance (if needed) without waiting the next BeginEvent incident. More...
 
 GaudiCommon (const std::string &name, ISvcLocator *pSvcLocator)
 Algorithm constructor. More...
 
 GaudiCommon (const std::string &type, const std::string &name, const IInterface *parent)
 Tool constructor. More...
 
StatusCode initialize () override
 standard initialization method More...
 
StatusCode finalize () override
 standard finalization method More...
 
StatusCode release (const IInterface *interface) const
 Manual forced (and 'safe') release of the active tool or service. More...
 
const Servicesservices () const
 get the list of aquired services More...
 
const std::stringcontext () const
 Returns the "context" string. Used to identify different processing states. More...
 
const std::stringrootInTES () const
 Returns the "rootInTES" string. More...
 
const std::string fullTESLocation (const std::string &location, const bool useRootInTES) const
 Returns the full correct event location given the rootInTes settings. More...
 
- Public Member Functions inherited from Algorithm
 Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
 Constructor. More...
 
 ~Algorithm () override=default
 Destructor. More...
 
StatusCode sysStart () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysInitialize () override
 Initialization method invoked by the framework. More...
 
StatusCode sysReinitialize () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysRestart () override
 Restart method invoked by the framework. More...
 
StatusCode sysExecute () override
 The actions to be performed by the algorithm on an event. More...
 
StatusCode sysStop () override
 System stop. More...
 
StatusCode sysFinalize () override
 System finalization. More...
 
StatusCode sysBeginRun () override
 beginRun method invoked by the framework. More...
 
StatusCode sysEndRun () override
 endRun method invoked by the framework. More...
 
const std::stringname () const override
 The identifying name of the algorithm object. More...
 
const Gaudi::StringKeynameKey () const override
 
const std::stringtype () const override
 The type of the algorithm object. More...
 
void setType (const std::string &type) override
 
const std::stringversion () const override
 
unsigned int index () const override
 
StatusCode configure () override
 Dummy implementation of IStateful::configure() method. More...
 
StatusCode terminate () override
 Dummy implementation of IStateful::terminate() method. More...
 
StatusCode initialize () override
 the default (empty) implementation of IStateful::initialize() method More...
 
StatusCode start () override
 the default (empty) implementation of IStateful::start() method More...
 
StatusCode stop () override
 the default (empty) implementation of IStateful::stop() method More...
 
StatusCode finalize () override
 the default (empty) implementation of IStateful::finalize() method More...
 
StatusCode reinitialize () override
 the default (empty) implementation of IStateful::reinitialize() method More...
 
StatusCode restart () override
 the default (empty) implementation of IStateful::restart() method More...
 
Gaudi::StateMachine::State FSMState () const override
 returns the current state of the algorithm More...
 
Gaudi::StateMachine::State targetFSMState () const override
 returns the state the algorithm will be in after the ongoing transition More...
 
bool isExecuted () const override
 Has this algorithm been executed since the last reset? More...
 
void setExecuted (bool state) override
 Set the executed flag to the specified state. More...
 
void resetExecuted () override
 Reset the executed state of the Algorithm for the duration of the current event. More...
 
StatusCode beginRun () override
 Algorithm begin run. More...
 
StatusCode endRun () override
 Algorithm end run. This method is called at the end of the event loop. More...
 
bool isEnabled () const override
 Is this algorithm enabled or disabled? More...
 
bool filterPassed () const override
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
void setFilterPassed (bool state) override
 Set the filter passed flag to the specified state. More...
 
int errorCount () const
 Get the number of failures of the algorithm. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
SmartIF< IServiceservice (const std::string &name, const bool createIf=true, const bool quiet=false) const
 Return a pointer to the service identified by name (or "type/name") More...
 
template<class T >
SmartIF< T > service (const std::string &name, bool createIf=true, bool quiet=false) const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
SmartIF< IChronoStatSvc > & chronoSvc () const
 The standard Chrono & Stat service, Return a pointer to the service if present. More...
 
SmartIF< IChronoStatSvc > & chronoStatService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IDataProviderSvc > & detDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IConversionSvc > & detDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IDataProviderSvc > & eventDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IConversionSvc > & eventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< IHistogramSvc > & histogramDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
SmartIF< INTupleSvc > & ntupleService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IRndmGenSvc > & randSvc () const
 AIDA-based NTuple service Returns a pointer to the AIDATuple service if present. More...
 
SmartIF< IToolSvc > & toolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present. More...
 
SmartIF< IExceptionSvc > & exceptionSvc () const
 Get the exception Service. More...
 
SmartIF< IAlgContextSvc > & contextSvc () const
 get Algorithm Context Service More...
 
SmartIF< ITimelineSvc > & timelineSvc () const
 
SmartIF< ISvcLocator > & serviceLocator () const override
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
SmartIF< IHiveWhiteBoard > & whiteboard () const
 
bool registerContext () const
 register for Algorithm Context Service? More...
 
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
 Create a sub algorithm. More...
 
const std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
std::vector< Algorithm * > * subAlgorithms ()
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
StatusCode setProperty (const Property &p) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &s) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 Implementation of IProperty::setProperty. More...
 
StatusCode getProperty (Property *p) const override
 Implementation of IProperty::getProperty. More...
 
const PropertygetProperty (const std::string &name) const override
 Implementation of IProperty::getProperty. More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const override
 Implementation of IProperty::getProperties. More...
 
bool hasProperty (const std::string &name) const override
 Implementation of IProperty::hasProperty. More...
 
PropertyMgrgetPropertyMgr ()
 
StatusCode setProperties ()
 Set the algorithm's properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none") const
 
template<class T >
PropertydeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none") const
 
SmartIF< IMonitorSvc > & monitorSvc () const
 Access the monitor service. More...
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information. More...
 
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
 Declare monitoring information (special case) More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
EventContextgetContext () const
 get the context More...
 
void setContext (EventContext *context)
 set the context More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 
virtual const DataObjIDCollextraInputDeps () const override
 
virtual const DataObjIDCollextraOutputDeps () const override
 
virtual void acceptDHVisitor (IDataHandleVisitor *) const override
 
const DataObjIDCollinputDataObjs () const
 
const DataObjIDColloutputDataObjs () const
 
void commitHandles () override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 
const std::vector< IAlgTool * > & tools () const
 
bool isClonable () const override
 Specifies the clonability of the algorithm. More...
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
MSG::Level outputLevel () const __attribute__((deprecated))
 Backward compatibility function for getting the output level. More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Public Attributes

int evtslots = 10
 
tuple whiteboard
 
tuple eventloopmgr
 
tuple a1
 
tuple a2 = CPUCruncher("A2")
 
tuple a3 = CPUCruncher("A3")
 
tuple a4 = CPUCruncher("A4")
 
string EvtSel = 'NONE'
 
list ExtSvc = [whiteboard]
 
 EventLoop = eventloopmgr,
 
list TopAlg = [a1,a2,a3,a4]
 

Private Member Functions

 CPUCruncher ()
 the default constructor is disabled More...
 
 CPUCruncher (const CPUCruncher &)
 the copy constructor is disabled More...
 
CPUCruncheroperator= (const CPUCruncher &)
 the assignement operator is disabled More...
 
void findPrimes (const unsigned long int)
 The CPU intensive function. More...
 
void calibrate ()
 Calibrate. More...
 
long unsigned int getNCaliIters (double)
 

Private Attributes

double m_avg_runtime
 
double m_var_runtime
 
bool m_local_rndm_gen
 
bool m_shortCalib
 
const uint MAX_INPUTS = 40
 
const uint MAX_OUTPUTS = 10
 
std::vector< DataObjectHandle< DataObject > * > m_inputHandles
 
std::vector< DataObjectHandle< DataObject > * > m_outputHandles
 
std::vector< std::stringm_inpKeys
 
std::vector< std::stringm_outKeys
 
unsigned int m_rwRepetitions
 
bool m_sleepyExecution
 

Static Private Attributes

static std::vector< unsigned int > m_niters_vect
 
static std::vector< double > m_times_vect
 
static CHM m_name_ncopies_map
 

Additional Inherited Members

- Protected Types inherited from GaudiCommon< Algorithm >
using base_class = Algorithm
 
typedef std::map< std::string, StatEntityStatistics
 the actual type of general counters More...
 
typedef std::map< std::string, unsigned int > Counter
 the actual type error/warning counter More...
 
typedef std::vector< IAlgTool * > AlgTools
 storage for active tools More...
 
typedef std::vector< SmartIF< IService > > Services
 storage for active services More...
 
- Protected Member Functions inherited from GaudiCommon< Algorithm >
 ~GaudiCommon () override=default
 Destructor. More...
 
StatusCode releaseTool (const IAlgTool *tool) const
 manual forced (and 'safe') release of the tool More...
 
StatusCode releaseSvc (const IInterface *svc) const
 manual forced (and 'safe') release of the service More...
 
- Protected Member Functions inherited from Algorithm
virtual void declareInput (Gaudi::DataHandle *im) override
 
virtual void declareOutput (Gaudi::DataHandle *im) override
 
std::vector< IAlgTool * > & tools ()
 
bool isInitialized () const override
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const override
 Has the Algorithm already been finalized? More...
 
void setIndex (const unsigned int &idx) override
 set instantiation index of Alg More...
 
- Protected Member Functions inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
- Protected Attributes inherited from GaudiCommon< Algorithm >
SmartIF< ICounterSummarySvcm_counterSummarySvc
 a pointer to the CounterSummarySvc More...
 
std::vector< std::stringm_counterList
 list of counters to declare. Set by property CounterList. This can be a regular expression. More...
 
std::vector< std::stringm_statEntityList
 
- Protected Attributes inherited from Algorithm
EventContextm_event_context
 Event specific data for multiple event processing. More...
 
SmartIF< PropertyMgrm_propertyMgr
 For management of properties. More...
 
std::unique_ptr< IDataHandleVisitorm_updateDataHandles
 Hook for for derived classes to provide a custom visitor for data handles. More...
 
- Static Protected Attributes inherited from GaudiCommon< Algorithm >
static const bool IgnoreRootInTES
 Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
 
static const bool UseRootInTES
 Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
 

Detailed Description

A class that implements a search for prime numbers.

A lot of allocations are performed on purpose not to stress only the FP unit of the CPU.

Definition at line 19 of file CPUCruncher.h.

Member Typedef Documentation

typedef tbb::concurrent_hash_map<std::string,unsigned int> CPUCruncher::CHM

Definition at line 24 of file CPUCruncher.h.

Constructor & Destructor Documentation

CPUCruncher::CPUCruncher ( const std::string name,
ISvcLocator pSvc 
)

Definition at line 19 of file CPUCruncher.cpp.

20  :
22  false) {
23 
24  declareProperty("inpKeys", m_inpKeys);
25  declareProperty("outKeys", m_outKeys);
26 
27 
28  declareProperty("avgRuntime", m_avg_runtime,
29  "Average runtime of the module.");
30  declareProperty("varRuntime", m_var_runtime,
31  "Variance of the runtime of the module.");
32  declareProperty("localRndm", m_local_rndm_gen = true,
33  "Decide if the local random generator is to be used");
34  declareProperty("NIterationsVect", m_niters_vect,
35  "Number of iterations for the calibration.");
36  declareProperty("NTimesVect", m_times_vect,
37  "Number of seconds for the calibration.");
38  declareProperty("shortCalib", m_shortCalib = false,
39  "Enable coarse grained calibration");
40  declareProperty("RwRepetitions", m_rwRepetitions = 1,
41  "Increase access to the WB");
42  declareProperty("SleepyExecution", m_sleepyExecution = false,
43  "Sleep during execution instead of crunching");
44 
45  // Register the algo in the static concurrent hash map in order to
46  // monitor the # of copies
47  CHM::accessor name_ninstances;
48  m_name_ncopies_map.insert(name_ninstances, name);
49  name_ninstances->second += 1;
50 }
bool m_sleepyExecution
Definition: CPUCruncher.h:81
bool m_shortCalib
Definition: CPUCruncher.h:60
double m_avg_runtime
Definition: CPUCruncher.h:57
Property * declareProperty(const std::string &name, DataObjectHandle< T > &hndl, const std::string &doc="none") const
static std::vector< unsigned int > m_niters_vect
Definition: CPUCruncher.h:63
static CHM m_name_ncopies_map
Definition: CPUCruncher.h:78
static std::vector< double > m_times_vect
Definition: CPUCruncher.h:64
std::vector< std::string > m_outKeys
Definition: CPUCruncher.h:74
unsigned int m_rwRepetitions
Definition: CPUCruncher.h:76
std::vector< std::string > m_inpKeys
Definition: CPUCruncher.h:74
bool m_local_rndm_gen
Definition: CPUCruncher.h:59
double m_var_runtime
Definition: CPUCruncher.h:58
CPUCruncher::~CPUCruncher ( )
virtual

virtual & protected desctrustor

Definition at line 52 of file CPUCruncher.cpp.

52  {
53  for (uint i = 0; i < m_inputHandles.size(); ++i) {
54  delete m_inputHandles[i];
55  }
56 
58  for (uint i = 0; i < m_outputHandles.size(); ++i) {
59  delete m_outputHandles[i];
60  }
61 }
const uint MAX_OUTPUTS
Definition: CPUCruncher.h:69
T resize(T...args)
std::vector< DataObjectHandle< DataObject > * > m_inputHandles
Definition: CPUCruncher.h:71
T size(T...args)
std::vector< DataObjectHandle< DataObject > * > m_outputHandles
Definition: CPUCruncher.h:72
list i
Definition: ana.py:128
CPUCruncher::CPUCruncher ( )
private

the default constructor is disabled

CPUCruncher::CPUCruncher ( const CPUCruncher )
private

the copy constructor is disabled

Member Function Documentation

void CPUCruncher::calibrate ( )
private

Calibrate.

Definition at line 97 of file CPUCruncher.cpp.

97  {
98 
99  MsgStream log(msgSvc(), name());
105  m_niters_vect.push_back(1000);
106  m_niters_vect.push_back(1300);
107  m_niters_vect.push_back(1600);
108  m_niters_vect.push_back(2000);
109  m_niters_vect.push_back(2300);
110  m_niters_vect.push_back(2600);
111  m_niters_vect.push_back(3000);
112  m_niters_vect.push_back(3300);
113  m_niters_vect.push_back(3500);
114  m_niters_vect.push_back(3900);
115  m_niters_vect.push_back(4200);
116  m_niters_vect.push_back(5000);
117  m_niters_vect.push_back(6000);
118  m_niters_vect.push_back(8000);
119  m_niters_vect.push_back(10000);
120  m_niters_vect.push_back(12000);
121  m_niters_vect.push_back(15000);
122  m_niters_vect.push_back(17000);
123  m_niters_vect.push_back(20000);
124  m_niters_vect.push_back(25000);
125  m_niters_vect.push_back(30000);
126  m_niters_vect.push_back(35000);
127  m_niters_vect.push_back(40000);
128  m_niters_vect.push_back(60000);
129  if (!m_shortCalib){
130  m_niters_vect.push_back(100000);
131  m_niters_vect.push_back(200000);
132  }
133 
134 
136  m_times_vect[0]=0.;
137 
138 
139  log << MSG::INFO << "Starting calibration..." << endmsg;
140  for (unsigned int i=1;i<m_niters_vect.size();++i){
141  unsigned long niters=m_niters_vect[i];
142  unsigned int trials = 30;
143  do{
144  auto start_cali=tbb::tick_count::now();
145  findPrimes(niters);
146  auto stop_cali=tbb::tick_count::now();
147  double deltat = (stop_cali-start_cali).seconds();
148  m_times_vect[i]=deltat;
149  log << MSG::DEBUG << "Calibration: # iters = " << niters << " => " << deltat << endmsg;
150  trials--;
151  } while(trials > 0 and m_times_vect[i]<m_times_vect[i-1]); // make sure that they are monotonic
152  }
153  log << MSG::INFO << "Calibration finished!" << endmsg;
154 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
bool m_shortCalib
Definition: CPUCruncher.h:60
void findPrimes(const unsigned long int)
The CPU intensive function.
T resize(T...args)
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
T push_back(T...args)
static std::vector< unsigned int > m_niters_vect
Definition: CPUCruncher.h:63
static std::vector< double > m_times_vect
Definition: CPUCruncher.h:64
T size(T...args)
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
list i
Definition: ana.py:128
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode CPUCruncher::execute ( )
virtual

the execution of the algorithm

Definition at line 248 of file CPUCruncher.cpp.

249 {
250 
251  MsgStream logstream(msgSvc(), name());
252 
253  if (m_sleepyExecution) {
254  logstream << MSG::DEBUG << "Going to dream for: "<< m_avg_runtime << endmsg;
256 
257  tbb::tick_count starttbb=tbb::tick_count::now();
258  std::this_thread::sleep_for(dreamtime);
259  tbb::tick_count endtbb=tbb::tick_count::now();
260  // actual sleeping time can be longer due to scheduling or resource contention delays
261  const double actualDreamTime=(endtbb-starttbb).seconds();
262 
263  logstream << MSG::DEBUG << "Actual dreaming time was: "<< actualDreamTime << "s" << endmsg;
264 
265  return StatusCode::SUCCESS;
266  }
267 
268  float runtime;
269 
270  if (m_local_rndm_gen){
271  /* This will disappear with a thread safe random number generator svc
272  * Use box mueller to generate gaussian randoms
273  * The quality is not good for in depth study given that the generator is a
274  * linear congruent.
275  * Throw away basically a free number: we are in a cpu cruncher after all.
276  * The seed is taken from the clock, but we could assign a seed per module to
277  * ensure reproducibility.
278  *
279  * This is not an overkill but rather an exercise towards a thread safe
280  * random number generation.
281  */
282 
283  auto getGausRandom = [] (double mean, double sigma) -> double {
284 
285  unsigned int seed = std::clock();
286 
287  auto getUnifRandom = [] (unsigned int & seed) ->double {
288  // from numerical recipies
289  constexpr unsigned int m = 232;
290  constexpr unsigned int a = 1664525;
291  constexpr unsigned int c = 1013904223;
292  seed = (a * seed + c) % m;
293  const double unif = double(seed) / m;
294  return unif;
295  };
296 
297  const double unif1 = getUnifRandom(seed);
298  const double unif2 = getUnifRandom(seed);
299  const double normal = sqrt(-2.*log(unif1))*cos(2*M_PI*unif2);
300  return normal*sigma + mean;
301  };
302  runtime = fabs(getGausRandom( m_avg_runtime , m_var_runtime ));
303  //End Of temp block
304  } else {
305  // Should be a member.
307  runtime = std::fabs(rndmgaus());
308  }
309 
310  tbb::tick_count starttbb=tbb::tick_count::now();
311  logstream << MSG::DEBUG << "Runtime will be: "<< runtime << endmsg;
312  if (getContext())
313  logstream << MSG::DEBUG << "Start event " << getContext()->evt()
314  << " in slot " << getContext()->slot()
315  << " on pthreadID " << std::hex << pthread_self() << std::dec
316  << endmsg;
317 
318  for (auto & inputHandle: m_inputHandles){
319  if(!inputHandle->isValid())
320  continue;
321 
322  DataObject* obj = nullptr;
323  for (unsigned int i=0; i<m_rwRepetitions;++i){
324  obj = inputHandle->get();
325  }
326  if (obj == nullptr)
327  logstream << MSG::ERROR << "A read object was a null pointer." << endmsg;
328  }
329 
330  const unsigned long n_iters= getNCaliIters(runtime);
331  findPrimes( n_iters );
332 
333  for (auto & outputHandle: m_outputHandles){
334  if(!outputHandle->isValid())
335  continue;
336 
337  outputHandle->put(new DataObject());
338  }
339 
340  for (auto & inputHandle: m_inputHandles){
341  if(!inputHandle->isValid())
342  continue;
343 
344  for (unsigned int i=1; i<m_rwRepetitions;++i){
345  inputHandle->get();
346  }
347  }
348 
349  tbb::tick_count endtbb=tbb::tick_count::now();
350 
351  const double actualRuntime=(endtbb-starttbb).seconds();
352 
353  if (getContext())
354  logstream << MSG::DEBUG << "Finish event " << getContext()->evt()
355  // << " on pthreadID " << getContext()->m_thread_id
356  << " in " << actualRuntime << " seconds" << endmsg;
357 
358  logstream << MSG::DEBUG << "Timing: ExpectedRuntime= " << runtime
359  << " ActualRuntime= " << actualRuntime
360  << " Ratio= " << runtime/actualRuntime
361  << " Niters= " << n_iters << endmsg;
362 
363 
364  return StatusCode::SUCCESS ;
365 }
bool m_sleepyExecution
Definition: CPUCruncher.h:81
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
ContextID_t slot() const
Definition: EventContext.h:41
tuple c
Definition: gaudirun.py:391
void findPrimes(const unsigned long int)
The CPU intensive function.
T clock(T...args)
double m_avg_runtime
Definition: CPUCruncher.h:57
T sleep_for(T...args)
Parameters for the Gauss random number generation.
EventContext * getContext() const
get the context
Definition: Algorithm.h:571
long unsigned int getNCaliIters(double)
ContextEvt_t evt() const
Definition: EventContext.h:40
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
constexpr double m
Definition: SystemOfUnits.h:93
T cos(T...args)
SmartIF< IRndmGenSvc > & randSvc() const
AIDA-based NTuple service Returns a pointer to the AIDATuple service if present.
T fabs(T...args)
std::vector< DataObjectHandle< DataObject > * > m_inputHandles
Definition: CPUCruncher.h:71
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
T hex(T...args)
unsigned int m_rwRepetitions
Definition: CPUCruncher.h:76
T sqrt(T...args)
std::vector< DataObjectHandle< DataObject > * > m_outputHandles
Definition: CPUCruncher.h:72
bool m_local_rndm_gen
Definition: CPUCruncher.h:59
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
list i
Definition: ana.py:128
double m_var_runtime
Definition: CPUCruncher.h:58
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode CPUCruncher::finalize ( )
virtual

the finalization of the algorithm

Definition at line 369 of file CPUCruncher.cpp.

370 {
371  MsgStream log(msgSvc(), name());
372 
373  unsigned int ninstances;
374 
375  {
376  CHM::const_accessor const_name_ninstances;
377  m_name_ncopies_map.find(const_name_ninstances,name());
378  ninstances=const_name_ninstances->second;
379  }
380 
381  constexpr double s2ms=1000.;
382  // do not show repetitions
383  if (ninstances!=0){
384  log << MSG::INFO << "Summary: name= "<< name()
385  <<"\t avg_runtime= " << m_avg_runtime*s2ms
386  << "\t n_clones= " << ninstances << endmsg;
387 
388  CHM::accessor name_ninstances;
389  m_name_ncopies_map.find(name_ninstances,name());
390  name_ninstances->second=0;
391  }
392 
393  return GaudiAlgorithm::finalize () ;
394 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
double m_avg_runtime
Definition: CPUCruncher.h:57
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
static CHM m_name_ncopies_map
Definition: CPUCruncher.h:78
StatusCode finalize() override
standard finalization method
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void CPUCruncher::findPrimes ( const unsigned long int  n_iterations)
private

The CPU intensive function.

Definition at line 191 of file CPUCruncher.cpp.

191  {
192 
193 
194  MsgStream log(msgSvc(), name());
195 
196  // Flag to trigger the allocation
197  bool is_prime;
198 
199  // Let's prepare the material for the allocations
200  unsigned int primes_size=1;
201  unsigned long* primes = new unsigned long[primes_size];
202  primes[0]=2;
203 
204  unsigned long i = 2;
205 
206  // Loop on numbers
207  for (unsigned long int iiter=0;iiter<n_iterations;iiter++ ){
208  // Once at max, it returns to 0
209  i+=1;
210 
211  // Check if it can be divided by the smaller ones
212  is_prime = true;
213  for (unsigned long j=2;j<i && is_prime;++j){
214  if (i%j == 0){
215  is_prime = false;
216  }
217  }// end loop on numbers < than tested one
218  if (is_prime){
219  // copy the array of primes (INEFFICIENT ON PURPOSE!)
220  unsigned int new_primes_size = 1 + primes_size;
221  unsigned long* new_primes = new unsigned long[new_primes_size];
222 
223  for (unsigned int prime_index=0; prime_index<primes_size;prime_index++){
224  new_primes[prime_index]=primes[prime_index];
225  }
226  // attach the last prime
227  new_primes[primes_size]=i;
228 
229  // Update primes array
230  delete[] primes;
231  primes = new_primes;
232  primes_size=new_primes_size;
233  } // end is prime
234 
235  } // end of while loop
236 
237  // Fool Compiler optimisations:
238  for (unsigned int prime_index=0; prime_index<primes_size;prime_index++)
239  if (primes[prime_index] == 4)
240  log << "This does never happen, but it's necessary too fool aggressive compiler optimisations!"<< endmsg ;
241 
242  delete[] primes;
243 
244 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
list i
Definition: ana.py:128
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
double CPUCruncher::get_runtime ( ) const
inline

Definition at line 33 of file CPUCruncher.h.

33 { return m_avg_runtime; };
double m_avg_runtime
Definition: CPUCruncher.h:57
unsigned long CPUCruncher::getNCaliIters ( double  runtime)
private

Definition at line 156 of file CPUCruncher.cpp.

156  {
157 
158  unsigned int smaller_i=0;
159  double time=0.;
160  bool found=false;
161  // We know that the first entry is 0, so we start to iterate from 1
162  for (unsigned int i=1;i<m_times_vect.size();i++){
163  time = m_times_vect[i];
164  if (time>runtime){
165  smaller_i=i-1;
166  found=true;
167  break;
168  }
169  }
170 
171  // Case 1: we are outside the interpolation range, we take the last 2 points
172  if (not found)
173  smaller_i=m_times_vect.size()-2;
174 
175  // Case 2: we maeke a linear interpolation
176  // y=mx+q
177  const double x0=m_times_vect[smaller_i];
178  const double x1=m_times_vect[smaller_i+1];
179  const double y0=m_niters_vect[smaller_i];
180  const double y1=m_niters_vect[smaller_i+1];
181  const double m=(y1-y0)/(x1-x0);
182  const double q=y0-m*x0;
183 
184  const unsigned long nCaliIters = m * runtime + q ;
185  //always() << x0 << "<" << runtime << "<" << x1 << " Corresponding to " << nCaliIters << " iterations" << endmsg;
186 
187  return nCaliIters ;
188 }
static std::vector< unsigned int > m_niters_vect
Definition: CPUCruncher.h:63
constexpr double m
Definition: SystemOfUnits.h:93
static std::vector< double > m_times_vect
Definition: CPUCruncher.h:64
T size(T...args)
list i
Definition: ana.py:128
StatusCode CPUCruncher::initialize ( )
virtual

Its initialization.

Definition at line 63 of file CPUCruncher.cpp.

63  {
64  if (m_times_vect.size()==0){
65  calibrate();
66  }
67 
68  // This is a bit ugly. There is no way to declare a vector of DataObjectHandles, so
69  // we need to wait until initialize when we've read in the input and output key
70  // properties, and know their size, and then turn them
71  // into Handles and register them with the framework by calling declareProperty. We
72  // could call declareInput/declareOutput on them too.
73 
74  int i=0;
75  for (auto k: m_inpKeys) {
76  debug() << "adding input key " << k << endmsg;
78  declareProperty("dummy_in_" + std::to_string(i), *(m_inputHandles.back()) );
79  i++;
80  }
81 
82  i = 0;
83  for (auto k: m_outKeys) {
84  debug() << "adding output key " << k << endmsg;
86  declareProperty("dummy_out_" + std::to_string(i), *(m_outputHandles.back()) );
87  i++;
88  }
89 
90  return StatusCode::SUCCESS ;
91 }
T to_string(T...args)
Property * declareProperty(const std::string &name, DataObjectHandle< T > &hndl, const std::string &doc="none") const
void calibrate()
Calibrate.
Definition: CPUCruncher.cpp:97
T push_back(T...args)
static std::vector< double > m_times_vect
Definition: CPUCruncher.h:64
std::vector< DataObjectHandle< DataObject > * > m_inputHandles
Definition: CPUCruncher.h:71
T size(T...args)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
T back(T...args)
std::vector< std::string > m_outKeys
Definition: CPUCruncher.h:74
std::vector< std::string > m_inpKeys
Definition: CPUCruncher.h:74
std::vector< DataObjectHandle< DataObject > * > m_outputHandles
Definition: CPUCruncher.h:72
list i
Definition: ana.py:128
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
CPUCruncher& CPUCruncher::operator= ( const CPUCruncher )
private

the assignement operator is disabled

Member Data Documentation

tuple CPUCruncher.a1
Initial value:
1 = CPUCruncher("A1",
2  varRuntime=.1,
3  avgRuntime=.5,
4  shortCalib = True )

Definition at line 16 of file CPUCruncher.py.

tuple CPUCruncher.a2 = CPUCruncher("A2")

Definition at line 22 of file CPUCruncher.py.

tuple CPUCruncher.a3 = CPUCruncher("A3")

Definition at line 26 of file CPUCruncher.py.

tuple CPUCruncher.a4 = CPUCruncher("A4")

Definition at line 30 of file CPUCruncher.py.

CPUCruncher.EventLoop = eventloopmgr,

Definition at line 37 of file CPUCruncher.py.

tuple CPUCruncher.eventloopmgr
Initial value:
1 = HiveEventLoopMgr(MaxEventsParallel = evtslots,
2  MaxAlgosParallel = 20,
3  NumThreads = 8,
4  AlgosDependencies = [[],['a1'],['a1'],['a2','a3']])

Definition at line 11 of file CPUCruncher.py.

string CPUCruncher.EvtSel = 'NONE'

Definition at line 35 of file CPUCruncher.py.

int CPUCruncher.evtslots = 10

Definition at line 6 of file CPUCruncher.py.

list CPUCruncher.ExtSvc = [whiteboard]

Definition at line 36 of file CPUCruncher.py.

double CPUCruncher::m_avg_runtime
private

Definition at line 57 of file CPUCruncher.h.

std::vector<std::string> CPUCruncher::m_inpKeys
private

Definition at line 74 of file CPUCruncher.h.

std::vector<DataObjectHandle<DataObject> *> CPUCruncher::m_inputHandles
private

Definition at line 71 of file CPUCruncher.h.

bool CPUCruncher::m_local_rndm_gen
private

Definition at line 59 of file CPUCruncher.h.

CPUCruncher::CHM CPUCruncher::m_name_ncopies_map
staticprivate

Definition at line 78 of file CPUCruncher.h.

std::vector< unsigned int > CPUCruncher::m_niters_vect
staticprivate

Definition at line 63 of file CPUCruncher.h.

std::vector<std::string> CPUCruncher::m_outKeys
private

Definition at line 74 of file CPUCruncher.h.

std::vector<DataObjectHandle<DataObject> *> CPUCruncher::m_outputHandles
private

Definition at line 72 of file CPUCruncher.h.

unsigned int CPUCruncher::m_rwRepetitions
private

Definition at line 76 of file CPUCruncher.h.

bool CPUCruncher::m_shortCalib
private

Definition at line 60 of file CPUCruncher.h.

bool CPUCruncher::m_sleepyExecution
private

Definition at line 81 of file CPUCruncher.h.

std::vector< double > CPUCruncher::m_times_vect
staticprivate

Definition at line 64 of file CPUCruncher.h.

double CPUCruncher::m_var_runtime
private

Definition at line 58 of file CPUCruncher.h.

const uint CPUCruncher::MAX_INPUTS = 40
private

Definition at line 68 of file CPUCruncher.h.

const uint CPUCruncher::MAX_OUTPUTS = 10
private

Definition at line 69 of file CPUCruncher.h.

list CPUCruncher.TopAlg = [a1,a2,a3,a4]

Definition at line 38 of file CPUCruncher.py.

tuple CPUCruncher.whiteboard
Initial value:
1 = HiveWhiteBoard("EventDataSvc",
2  EventSlots = evtslots)

Definition at line 8 of file CPUCruncher.py.


The documentation for this class was generated from the following files: