From b3760f5b1399b716c48f00e360825d73ac41531f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Thu, 12 Sep 2024 18:40:56 +0200
Subject: [PATCH] AthExHive: delete unused job options and update test
 definition

---
 .../AthenaExamples/AthExHive/CMakeLists.txt   |   6 +-
 .../AthExHive/share/AthExHiveOpts_MP.py       |  34 ----
 .../AthExHive/share/AthExHiveOpts_Serial.py   |  31 ----
 .../AthExHive/share/CircDataDep.py            | 131 ----------------
 .../AthExHive/share/DataLoopTest.py           | 146 ------------------
 .../AthExHive/share/RAthExHiveOpts.py         | 133 ----------------
 6 files changed, 3 insertions(+), 478 deletions(-)
 delete mode 100644 Control/AthenaExamples/AthExHive/share/AthExHiveOpts_MP.py
 delete mode 100644 Control/AthenaExamples/AthExHive/share/AthExHiveOpts_Serial.py
 delete mode 100644 Control/AthenaExamples/AthExHive/share/CircDataDep.py
 delete mode 100644 Control/AthenaExamples/AthExHive/share/DataLoopTest.py
 delete mode 100644 Control/AthenaExamples/AthExHive/share/RAthExHiveOpts.py

diff --git a/Control/AthenaExamples/AthExHive/CMakeLists.txt b/Control/AthenaExamples/AthExHive/CMakeLists.txt
index ccea3b36cf99..37a5a4fdfdd8 100644
--- a/Control/AthenaExamples/AthExHive/CMakeLists.txt
+++ b/Control/AthenaExamples/AthExHive/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( AthExHive )
@@ -30,9 +30,9 @@ atlas_install_runtime( share/condDb.txt )
 if( NOT XAOD_ANALYSIS )
    atlas_add_test( AthExHive_test
                    SCRIPT test/AthExHive_test.sh
-                   PROPERTIES TIMEOUT 300 )
+                   PROPERTIES PROCESSORS 4 TIMEOUT 300 )
 
    atlas_add_test( AthExHiveCond_test
                    SCRIPT test/AthExHiveCond_test.sh
-                   PROPERTIES TIMEOUT 300 )
+                   PROPERTIES PROCESSORS 3 TIMEOUT 300 )
 endif()
diff --git a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_MP.py b/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_MP.py
deleted file mode 100644
index 88b715257f96..000000000000
--- a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_MP.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-#  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
-#
-
-import AthenaCommon.AtlasUnixGeneratorJob
-
-# Full job is a list of algorithms
-from AthenaCommon.AlgSequence import AlgSequence
-job = AlgSequence()
-
-from SGComps.SGCompsConf import SGInputLoader
-job += SGInputLoader(OutputLevel=INFO, ShowEventDump=False)
-job.SGInputLoader.Load = { ('EventInfo','McEventInfo') }
-
-from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
-job += xAODMaker__EventInfoCnvAlg()
-
-from AthExHive.AthExHiveConf import *
-job += HiveAlgA(OutputLevel=DEBUG,Time=20)
-job += HiveAlgB(OutputLevel=DEBUG,Time=10)
-job += HiveAlgC(OutputLevel=DEBUG,Time=190)
-job += HiveAlgD(OutputLevel=DEBUG,Time=10)
-job += HiveAlgE(OutputLevel=DEBUG,Time=30)
-job += HiveAlgG(OutputLevel=DEBUG,Time=10)
-job += HiveAlgF(OutputLevel=DEBUG,Time=30)
-
-#from StoreGate.StoreGateConf import StoreGateSvc
-#svcMgr.StoreGateSvc.Dump=True
-
-#--------------------------------------------------------------
-# Event related parameters
-#--------------------------------------------------------------
-theApp.EvtMax = 100
-
diff --git a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_Serial.py b/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_Serial.py
deleted file mode 100644
index 497c211a5390..000000000000
--- a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_Serial.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-#
-
-import AthenaCommon.AtlasUnixGeneratorJob
-
-# Full job is a list of algorithms
-from AthenaCommon.AlgSequence import AlgSequence
-job = AlgSequence()
-
-from AthExHive.AthExHiveConf import *
-job+=HiveAlgA(OutputLevel=DEBUG,Time=20)
-job+=HiveAlgB(OutputLevel=DEBUG,Time=10)
-job+=HiveAlgC(OutputLevel=DEBUG,Time=190)
-job+=HiveAlgD(OutputLevel=DEBUG,Time=10)
-job+=HiveAlgE(OutputLevel=DEBUG,Time=30)
-job+=HiveAlgG(OutputLevel=DEBUG,Time=10)
-job+=HiveAlgF(OutputLevel=DEBUG,Time=30)
-
-job+=HiveAlgV(OutputLevel=DEBUG,Time=30)
-job.HiveAlgV.Key_RV = [ "a1", "a2", "d1", "e1", "c1" ]
-
-
-#from StoreGate.StoreGateConf import StoreGateSvc
-#svcMgr.StoreGateSvc.Dump=True
-
-#--------------------------------------------------------------
-# Event related parameters
-#--------------------------------------------------------------
-theApp.EvtMax = 10
-
diff --git a/Control/AthenaExamples/AthExHive/share/CircDataDep.py b/Control/AthenaExamples/AthExHive/share/CircDataDep.py
deleted file mode 100644
index ea5d66d48226..000000000000
--- a/Control/AthenaExamples/AthExHive/share/CircDataDep.py
+++ /dev/null
@@ -1,131 +0,0 @@
-#
-#  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
-#
-
-# 
-## can only run if Hive enabled
-#
-from AthenaCommon.Logging import log as msg
-
-from AthenaCommon.ConcurrencyFlags import jobproperties as jp
-nThreads = jp.ConcurrencyFlags.NumThreads()
-if (nThreads < 1) :
-   msg.fatal('numThreads must be >0. Did you set the --threads=N option?')
-   sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
-
-#
-## Override Setup for Hive
-#
-
-from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
-# svcMgr.AthenaHiveEventLoopMgr.OutputLevel = INFO
-
-from StoreGate.StoreGateConf import SG__HiveMgrSvc
-# svcMgr.EventDataSvc.OutputLevel = INFO
-
-from GaudiHive.GaudiHiveConf import AlgResourcePool
-# svcMgr += AlgResourcePool( OutputLevel = INFO );
-
-from AthenaCommon.AlgScheduler import AlgScheduler
-AlgScheduler.OutputLevel( INFO )
-AlgScheduler.ShowControlFlow( True )
-AlgScheduler.ShowDataDependencies( True )
-
-#------------------------------------------------------------------------------#
-#
-## Uncomment following to avoid long waits when segfaulting,
-## and add "Root.Stacktrace: no" to your .rootrc file
-#
-# import ROOT
-# ROOT.SetSignalPolicy( ROOT.kSignalFast )
-#------------------------------------------------------------------------------#
-
-#
-## AlgSequence
-#
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-
-from SGComps.SGCompsConf import SGInputLoader
-topSequence+=SGInputLoader(OutputLevel=DEBUG, ShowEventDump=False)
-topSequence.SGInputLoader.Load = { ('EventInfo','StoreGateSvc+McEventInfo') }
-
-from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
-topSequence += xAODMaker__EventInfoCnvAlg()
-
-from AthExHive.AthExHiveConf import *
-
-topSequence+=AlgT(OutputLevel=DEBUG)
-
-AlgT = topSequence.AlgT
-AlgT.Key_W1 = "t1"
-#
-## uncomment this line to force an explicit circular data dep in AlgT
-# AlgT.Key_R1 = "t1"
-
-#
-## implicit circular data dep with parent AlgT
-AlgT.Tool1 = HiveTool( "HiveTool1")
-AlgT.Tool1.Key_R1 = "t1"
-AlgT.Tool1.Key_W1 = "t2"
-
-#
-## implicit circular data dep with AlgT.HiveTool1
-AlgT.Tool2 = HiveTool( "HiveTool2" )
-AlgT.Tool2.Key_R1 = "t2"
-AlgT.Tool2.Key_W1 = "t3"
-
-#
-## implicit circular data dep with AlgT.HiveTool2
-AlgT.Tool3 = HiveTool( "HiveTool3" )
-AlgT.Tool3.Key_R1 = "t3"
-AlgT.Tool3.Key_W1 = "t4"
-
-
-#--------------------------------------------------------------
-# Event related parameters
-#--------------------------------------------------------------
-
-theApp.EvtMax = 2
-
-nProc = jp.ConcurrencyFlags.NumProcs()
-if (nProc > 0) :
-
-   #
-   ## Basic setup for MP/Hive
-   #
-   import AthenaCommon.AtlasUnixGeneratorJob
-
-   #
-   ## For MP/Hive we need to set the chunk size
-   #
-
-   from AthenaCommon.Logging import log as msg
-   if (theApp.EvtMax == -1) : 
-      msg.fatal('EvtMax must be >0 for hybrid configuration')
-      sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
-
-   if ( theApp.EvtMax % nProc != 0 ) :
-      msg.warning('EvtMax[%s] is not divisible by nProcs[%s]: MP Workers will not process all requested events',theApp.EvtMax,nProc)
-
-   chunkSize = int (theApp.EvtMax / nProc)
-
-   from AthenaMP.AthenaMPFlags import jobproperties as jps 
-   jps.AthenaMPFlags.PreCountedEvents=theApp.EvtMax
-   jps.AthenaMPFlags.ChunkSize= chunkSize
-
-   msg.info('AthenaMP workers will process %s events each',chunkSize)
-
-#
-## set which Algorithms can be cloned
-#
-
-#  set algCardinality = 1 to disable cloning for all Algs
-algCardinality = jp.ConcurrencyFlags.NumThreads()
-
-if (algCardinality != 1):
-   for alg in topSequence:
-       name = alg.name()
-       alg.Cardinality = algCardinality
-           
diff --git a/Control/AthenaExamples/AthExHive/share/DataLoopTest.py b/Control/AthenaExamples/AthExHive/share/DataLoopTest.py
deleted file mode 100644
index d0ab2037b560..000000000000
--- a/Control/AthenaExamples/AthExHive/share/DataLoopTest.py
+++ /dev/null
@@ -1,146 +0,0 @@
-#
-#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-#
-
-
-# 
-## can only run if Hive enabled
-#
-from AthenaCommon.Logging import log as msg
-
-from AthenaCommon.ConcurrencyFlags import jobproperties as jp
-nThreads = jp.ConcurrencyFlags.NumThreads()
-if (nThreads < 1) :
-   msg.fatal('numThreads must be >0. Did you set the --threads=N option?')
-   sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
-
-#
-## Override Setup for Hive
-#
-
-from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
-# svcMgr.AthenaHiveEventLoopMgr.OutputLevel = INFO
-
-from StoreGate.StoreGateConf import SG__HiveMgrSvc
-# svcMgr.EventDataSvc.OutputLevel = INFO
-
-from GaudiHive.GaudiHiveConf import AlgResourcePool
-# svcMgr += AlgResourcePool( OutputLevel = INFO );
-
-from AthenaCommon.AlgScheduler import AlgScheduler
-AlgScheduler.OutputLevel( INFO )
-AlgScheduler.ShowControlFlow( True )
-AlgScheduler.ShowDataDependencies( True )
-AlgScheduler.setDataLoaderAlg( "SGInputLoader" )
-
-
-# ThreadPoolService thread local initialization
-from GaudiHive.GaudiHiveConf import ThreadPoolSvc
-svcMgr += ThreadPoolSvc("ThreadPoolSvc")
-svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]
-
-from GaudiHive.GaudiHiveConf import AlgResourcePool
-svcMgr += AlgResourcePool(OutputLevel=DEBUG)
-
-#---------------------------------------------------------------------------------#
-
-#
-## Uncomment following to avoid long waits when segfaulting,
-## and add "Root.Stacktrace: no" to your .rootrc file
-#
-# import ROOT
-# ROOT.SetSignalPolicy( ROOT.kSignalFast )
-
-#---------------------------------------------------------------------------------#
-
-
-#
-## AlgSequence
-#
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-
-from SGComps.SGCompsConf import SGInputLoader
-topSequence+=SGInputLoader(OutputLevel=INFO, ShowEventDump=False)
-
-from AthExHive.AthExHiveConf import *
-HA = HiveAlgA("AlgA",OutputLevel=DEBUG,Time=20)
-HB = HiveAlgB("AlgB",OutputLevel=DEBUG,Time=10)
-HC = HiveAlgC("AlgC",OutputLevel=DEBUG,Time=190)
-HE = HiveAlgE("AlgE",OutputLevel=DEBUG,Time=10)
-
-# add a data loop in a sequence to test strict ordering
-from AthenaCommon.AlgSequence import AthSequencer
-alp = AthSequencer("LoopSeq", OutputLevel=DEBUG, Sequential=True)
-
-loopKey = "l2"
-HL1 = HiveAlgL1("AlgL1",OutputLevel=DEBUG,Key_W1=loopKey,Time=110)
-HL2 = HiveAlgL2("AlgL2",OutputLevel=DEBUG,Key_R1=loopKey,Key_U1=loopKey,Time=320)
-HL3 = HiveAlgL3("AlgL3",OutputLevel=DEBUG,Key_U1=loopKey,Time=120)
-
-# AlgM tests to see if sequence was ordered properly
-HM = HiveAlgM("AlgM",OutputLevel=DEBUG,Key_R2=loopKey,Offset=3,Time=30)
-
-alp += HL1
-# alp += HL2
-# alp += HL3
-alp += HM
-topSequence += alp
-
-topSequence += HA
-topSequence += HB
-topSequence += HC
-topSequence += HE
-
-
-#--------------------------------------------------------------
-# Event related parameters
-#--------------------------------------------------------------
-
-theApp.EvtMax = 10
-
-nProc = jp.ConcurrencyFlags.NumProcs()
-if (nProc > 0) :
-
-   #
-   ## Basic setup for MP/Hive
-   #
-   import AthenaCommon.AtlasUnixGeneratorJob
-
-   #
-   ## For MP/Hive we need to set the chunk size
-   #
-
-   from AthenaCommon.Logging import log as msg
-   if (theApp.EvtMax == -1) : 
-      msg.fatal('EvtMax must be >0 for hybrid configuration')
-      sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
-
-   if ( theApp.EvtMax % nProc != 0 ) :
-      msg.warning('EvtMax[%s] is not divisible by nProcs[%s]: MP Workers will not process all requested events',theApp.EvtMax,nProc)
-
-   chunkSize = int (theApp.EvtMax / nProc)
-
-   from AthenaMP.AthenaMPFlags import jobproperties as jps 
-   jps.AthenaMPFlags.PreCountedEvents=theApp.EvtMax
-   jps.AthenaMPFlags.ChunkSize= chunkSize
-
-   msg.info('AthenaMP workers will process %s events each',chunkSize)
-
-
-
-print "==========================================================================================\n"
-
-#
-## set which Algorithms can be cloned
-#
-
-#  set algCardinality = 1 to disable cloning for all Algs
-algCardinality = jp.ConcurrencyFlags.NumThreads()
-
-if (algCardinality != 1):
-   for alg in topSequence:
-       name = alg.name()
-       alg.Cardinality = algCardinality
-           
diff --git a/Control/AthenaExamples/AthExHive/share/RAthExHiveOpts.py b/Control/AthenaExamples/AthExHive/share/RAthExHiveOpts.py
deleted file mode 100644
index a6ea37435056..000000000000
--- a/Control/AthenaExamples/AthExHive/share/RAthExHiveOpts.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-#  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
-#
-
-
-# 
-## can only run if Hive enabled
-#
-from AthenaCommon.Logging import log as msg
-
-from AthenaCommon.ConcurrencyFlags import jobproperties as jp
-nThreads = jp.ConcurrencyFlags.NumThreads()
-if (nThreads < 1) :
-   msg.fatal('numThreads must be >0. Did you set the --threads=N option?')
-   sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
-
-#
-## Override Setup for Hive
-#
-
-from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
-# svcMgr.AthenaHiveEventLoopMgr.OutputLevel = INFO
-
-from StoreGate.StoreGateConf import SG__HiveMgrSvc
-# svcMgr.EventDataSvc.OutputLevel = INFO
-
-from GaudiHive.GaudiHiveConf import AlgResourcePool
-# svcMgr += AlgResourcePool( OutputLevel = INFO );
-
-from GaudiHive.GaudiHiveConf import ForwardSchedulerSvc
-svcMgr.ForwardSchedulerSvc.OutputLevel = INFO
-svcMgr.ForwardSchedulerSvc.CheckDependencies = True
-
-#
-## Override defaults for numStores and numAlgsInFlight 
-##   Otherwise these are BOTH EQUAL to the number of threads set with the 
-##   command line opt --threads=N
-#
-
-# numStores = 1
-# numAlgsInFlight = 1
-
-# svcMgr.EventDataSvc.NSlots = numStores
-# svcMgr.ForwardSchedulerSvc.MaxEventsInFlight = numStores
-# svcMgr.ForwardSchedulerSvc.MaxAlgosInFlight = numAlgsInFlight
-
-# ThreadPoolService thread local initialization
-# from GaudiHive.GaudiHiveConf import ThreadPoolSvc
-# svcMgr += ThreadPoolSvc("ThreadPoolSvc")
-# svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]
-
-#---------------------------------------------------------------------------------#
-
-#
-## Uncomment following to avoid long waits when segfaulting,
-## and add "Root.Stacktrace: no" to your .rootrc file
-#
-# import ROOT
-# ROOT.SetSignalPolicy( ROOT.kSignalFast )
-
-#---------------------------------------------------------------------------------#
-
-
-#
-## AlgSequence
-#
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-
-from SGComps.SGCompsConf import SGInputLoader
-topSequence+=SGInputLoader(OutputLevel=INFO, ShowEventDump=False)
-topSequence.SGInputLoader.Load = { ('EventInfo','McEventInfo') }
-
-from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
-topSequence += xAODMaker__EventInfoCnvAlg()
-
-from AthExHive.AthExHiveConf import *
-topSequence+=HiveAlgR(OutputLevel=DEBUG)
-topSequence+=HiveAlgA(OutputLevel=DEBUG,Time=20)
-topSequence+=HiveAlgB(OutputLevel=DEBUG,Time=10)
-topSequence+=HiveAlgC(OutputLevel=DEBUG,Time=190)
-
-#--------------------------------------------------------------
-# Event related parameters
-#--------------------------------------------------------------
-
-theApp.EvtMax = 20
-
-nProc = jp.ConcurrencyFlags.NumProcs()
-if (nProc > 0) :
-
-   #
-   ## Basic setup for MP/Hive
-   #
-   import AthenaCommon.AtlasUnixGeneratorJob
-
-   #
-   ## For MP/Hive we need to set the chunk size
-   #
-
-   from AthenaCommon.Logging import log as msg
-   if (theApp.EvtMax == -1) : 
-      msg.fatal('EvtMax must be >0 for hybrid configuration')
-      sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
-
-   if ( theApp.EvtMax % nProc != 0 ) :
-      msg.warning('EvtMax[%s] is not divisible by nProcs[%s]: MP Workers will not process all requested events',theApp.EvtMax,nProc)
-
-   chunkSize = int (theApp.EvtMax / nProc)
-
-   from AthenaMP.AthenaMPFlags import jobproperties as jps 
-   jps.AthenaMPFlags.PreCountedEvents=theApp.EvtMax
-   jps.AthenaMPFlags.ChunkSize= chunkSize
-
-   msg.info('AthenaMP workers will process %s events each',chunkSize)
-
-
-
-print "==========================================================================================\n"
-
-#
-## set which Algorithms can be cloned
-#
-
-#  set algCardinality = 1 to disable cloning for all Algs
-algCardinality = jp.ConcurrencyFlags.NumThreads()
-
-if (algCardinality != 1):
-   for alg in topSequence:
-       name = alg.name()
-       alg.Cardinality = algCardinality
-           
-- 
GitLab