Skip to content
Snippets Groups Projects
Commit 946f4587 authored by Duc Ta's avatar Duc Ta
Browse files

Merge branch 'numprocs' into '24.0'

StoreGate: add SG::HiveMgrSvc::setNumProcs helper

See merge request atlas/athena!69886
parents e7b33ac4 7abcf430
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef STOREGATE_HIVEMGRSVC_H
......@@ -19,17 +19,17 @@
class StoreGateSvc;
class ISvcLocator;
class HltEventLoopMgr; // for friend declaration
/** @class HiveMgrSvc
* @brief A service that manages a multi-event collection of StoreGateSvc
* It implements the IHiveWhiteBoard interface
*
* $Id: SGHiveMgrSvc.h 794852 2017-01-31 23:24:04Z leggett $
**/
namespace SG {
class HiveMgrSvc : public extends<Service, IHiveWhiteBoard> {
friend class TestSGHiveMgrSvc;
friend class ::HltEventLoopMgr;
public:
//@{ @name IHiveWhiteBoard implementation
/** Activate an given 'slot' for all subsequent calls within the
......@@ -106,12 +106,21 @@ public:
virtual ~HiveMgrSvc() {}
private:
/** Set number of concurrent processes
*
* This can only be called by "friends" of this class. Its sole purpose
* is to have a common entry point within ATLAS to call the private
* methods of Gaudi::ConcurrencyFlags.
*
* @param numProcs [IN] Number of concurrent processes
*/
static void setNumProcs(size_t numProcs);
ServiceHandle<StoreGateSvc> m_hiveStore;
size_t m_nSlots; //property settable also by setNumberOfStores
std::vector<SG::HiveEventSlot> m_slots;
std::mutex m_mutex; //< protects m_slots access
std::atomic<size_t> m_freeSlots {0};
//maybe ServiceHandle<ActiveStoreSvc> m_active;
};
} //namespace SG
......
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#include "GaudiKernel/ConcurrencyFlags.h"
......@@ -8,7 +8,7 @@
#include "AthenaKernel/StoreID.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/tools/SGImplSvc.h"
#include "SGHiveMgrSvc.h"
#include "StoreGate/SGHiveMgrSvc.h"
using namespace SG;
......@@ -24,6 +24,18 @@ HiveMgrSvc::HiveMgrSvc(const std::string& name,
}
/** Set number of concurrent processes
*
* This can only be called by "friends" of this class. Its sole purpose
* is to have a common entry point within ATLAS to call the private
* methods of Gaudi::ConcurrencyFlags.
*
* @param numProcs [IN] Number of concurrent processes
*/
void HiveMgrSvc::setNumProcs(size_t numProcs)
{
Gaudi::Concurrency::ConcurrencyFlags::setNumProcs(numProcs);
}
/** Activate an given 'slot' for all subsequent calls within the
* same thread id.
......
......@@ -2,7 +2,7 @@
#include "StoreGate/ActiveStoreSvc.h"
#include "StoreGate/tools/SGImplSvc.h"
#include "StoreGate/SegMemSvc.h"
#include "../SGHiveMgrSvc.h"
#include "StoreGate/SGHiveMgrSvc.h"
DECLARE_COMPONENT( ActiveStoreSvc )
DECLARE_COMPONENT( StoreGateSvc )
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
/***************************************************************************
......@@ -14,7 +14,7 @@
#include "TestTools/initGaudi.h"
#include "TestTools/SGassert.h"
#include "GaudiKernel/IHiveWhiteBoard.h"
#include "../src/SGHiveMgrSvc.h"
#include "StoreGate/SGHiveMgrSvc.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/SGtests.h"
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#undef NDEBUG
......@@ -10,7 +10,7 @@
#include "TestTools/initGaudi.h"
#include "TestTools/SGassert.h"
#include "GaudiKernel/IHiveWhiteBoard.h"
#include "../src/SGHiveMgrSvc.h"
#include "StoreGate/SGHiveMgrSvc.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/SGtests.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment