diff --git a/Control/AthenaExamples/AthExHive/CMakeLists.txt b/Control/AthenaExamples/AthExHive/CMakeLists.txt index 4c4c8164ffef0dd82d7536064195bb58081e65de..700c7ef8b215c744539c817d955c1d485594badb 100644 --- a/Control/AthenaExamples/AthExHive/CMakeLists.txt +++ b/Control/AthenaExamples/AthExHive/CMakeLists.txt @@ -26,3 +26,13 @@ atlas_install_headers( AthExHive ) atlas_install_joboptions( share/*.py ) atlas_install_runtime( share/condDb.txt ) +atlas_add_test ( AthExHive_test + SCRIPT test/AthExHive_test.sh + PROPERTIES TIMEOUT 300 + ) + +atlas_add_test ( AthExHiveCond_test + SCRIPT test/AthExHiveCond_test.sh + PROPERTIES TIMEOUT 300 + ) + diff --git a/Control/AthenaExamples/AthExHive/share/CondAlgsOpts.py b/Control/AthenaExamples/AthExHive/share/CondAlgsOpts.py index 4567f7e8bcb6678b839706723b113f2c2921cf74..5082da018e43d5a2d4cf7c00aa16303f6fb53de8 100644 --- a/Control/AthenaExamples/AthExHive/share/CondAlgsOpts.py +++ b/Control/AthenaExamples/AthExHive/share/CondAlgsOpts.py @@ -43,7 +43,7 @@ AlgScheduler.EnableConditions( True ) AlgScheduler.setDataLoaderAlg( "SGInputLoader" ) from IOVSvc.IOVSvcConf import CondSvc -svcMgr += CondSvc( OutputLevel=DEBUG ) +svcMgr += CondSvc( OutputLevel=VERBOSE ) #-----------------------------------------------------------------------------# @@ -67,9 +67,6 @@ svcMgr += CondSvc( OutputLevel=DEBUG ) from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() -from SGComps.SGCompsConf import SGInputLoader -topSequence+=SGInputLoader(OutputLevel=DEBUG, ShowEventDump=False) - from AthExHive.AthExHiveConf import * topSequence+=AlgA(OutputLevel=DEBUG) topSequence+=AlgB(OutputLevel=DEBUG, Key_R1="a1", Key_W1="a3") @@ -78,20 +75,31 @@ topSequence+=AlgC("AlgC2", OutputLevel=DEBUG, Key_R1="a1", Key_CH="X2") topSequence+=AlgD("AlgD1", OutputLevel=DEBUG, Key_R1="a3", Key_CH1="X1", Key_CH2="X2") #topSequence+=AlgD("AlgD2", OutputLevel=DEBUG, Key_R1="a1", Key_CH1="Y1", Key_CH2="Y2") -topSequence+=CondAlgX("CondAlgX1", OutputLevel=DEBUG, Key_CH="X1", Key_DB="X1") -topSequence+=CondAlgX("CondAlgX2", OutputLevel=DEBUG, Key_CH="X2", Key_DB="X2") +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") + +condSeq+=CondAlgX("CondAlgX1", OutputLevel=DEBUG, Key_CH="X1", Key_DB="X1") +condSeq+=CondAlgX("CondAlgX2", OutputLevel=DEBUG, Key_CH="X2", Key_DB="X2") -topSequence+=CondAlgY("CondAlgY1", OutputLevel=DEBUG, Key_CH1="Y1", Key_CH2="Y2", Key_DB1="Y1", Key_DB2="Y2") +condSeq+=CondAlgY("CondAlgY1", OutputLevel=DEBUG, Key_CH1="Y1", Key_CH2="Y2", Key_DB1="Y1", Key_DB2="Y2") condDbFile = "condDb.txt" -import os.path -if (not os.path.isfile(condDbFile)): +import os +import string +for dir in string.split( (".:"+os.environ.get('DATAPATH')),":"): + cdb = os.path.join(dir,condDbFile) + if (os.path.isfile( cdb ) ) : + found = 1 + break + +if (found == 0): msg.fatal('ASCII condDb file \"' + condDbFile + '\" not found') sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR) +else: + msg.info( "using ASCIICondDb file from " + cdb ) - -svcMgr += ASCIICondDbSvc( OutputLevel=DEBUG, CondFile = condDbFile ) +svcMgr += ASCIICondDbSvc( OutputLevel=DEBUG, CondFile = cdb ) #-------------------------------------------------------------- diff --git a/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.cxx b/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.cxx index 7b411c0f9c22efb3863602335efbc7ca60c7647f..2804f468938c62338e3378afda6abb7f0a894cf5 100644 --- a/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.cxx +++ b/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.cxx @@ -212,13 +212,26 @@ ASCIICondDbSvc::parse(IOVEntryT<IASCIICondDbSvc::dbData_t>& ie, const std::strin if (m.size() != 6) { return false; } - // set run# and timestamp - EventIDBase start(std::stoi(m[1]), EventIDBase::UNDEFEVT, std::stoi(m[2])); - EventIDBase end(std::stoi(m[3]), EventIDBase::UNDEFEVT, std::stoi(m[4])); - - start.set_lumi_block(m_lbn); - end.set_lumi_block(m_lbn); - + // set run#, lumi and timestamp + // EventIDBase start(std::stoi(m[1]), EventIDBase::UNDEFEVT, std::stoi(m[2])); + // EventIDBase end(std::stoi(m[3]), EventIDBase::UNDEFEVT, std::stoi(m[4])); + // start.set_lumi_block(m_lbn); + // end.set_lumi_block(m_lbn); + + // set lumi and Timestamp + EventIDBase start(EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, + std::stoi(m[2])); + EventIDBase end(EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, + std::stoi(m[4])); + start.set_lumi_block(std::stoi(m[1])); + end.set_lumi_block(std::stoi(m[3])); + + // Set Run/Lumi + // EventIDBase start(std::stoi(m[1]), EventIDBase::UNDEFEVT); + // EventIDBase end(std::stoi(m[3]), EventIDBase::UNDEFEVT); + // start.set_lumi_block(std::stoi(m[2])); + // end.set_lumi_block(std::stoi(m[4])); + ie.setRange(EventIDRange(start,end)); IASCIICondDbSvc::dbData_t *v = new IASCIICondDbSvc::dbData_t( std::stof(m[5]) ); diff --git a/Control/AthenaExamples/AthExHive/test/AthExHiveCond_test.sh b/Control/AthenaExamples/AthExHive/test/AthExHiveCond_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..a791ac362f319c0b5f9ef00105fcdd6214a735b5 --- /dev/null +++ b/Control/AthenaExamples/AthExHive/test/AthExHiveCond_test.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# +# Script running the CondAlgsOpts.py test jobOptions for CTest. +# + +# Return the correct code: +set -e + +# Run the test: +athena.py --threads=1 AthExHive/CondAlgsOpts.py diff --git a/Control/AthenaExamples/AthExHive/test/AthExHive_test.sh b/Control/AthenaExamples/AthExHive/test/AthExHive_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..dbeaf49377428f4379d8c073c7041ee24378f742 --- /dev/null +++ b/Control/AthenaExamples/AthExHive/test/AthExHive_test.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# +# Script running the AthExHiveOpts.py test jobOptions for CTest. +# + +# Return the correct code: +set -e + +# Run the test: +athena.py --threads=4 AthExHive/AthExHiveOpts.py diff --git a/Control/IOVSvc/src/CondSvc.cxx b/Control/IOVSvc/src/CondSvc.cxx index 3abadfcf1f1723400f542d736552abf6b85a79d7..10e48b8a6b1bc5cf898aff05c8e89d527c912242 100644 --- a/Control/IOVSvc/src/CondSvc.cxx +++ b/Control/IOVSvc/src/CondSvc.cxx @@ -330,8 +330,8 @@ CondSvc::isValidID(const EventContext& ctx, const DataObjID& id) const { if (m_sgs->contains<CondContBase>( sk ) ) { CondContBase *cib; if (m_sgs->retrieve(cib, sk).isSuccess()) { - ATH_MSG_DEBUG("CondSvc::isValidID: now: " << ctx.eventID() << " id : " - << id << ": T"); + ATH_MSG_VERBOSE("CondSvc::isValidID: now: " << ctx.eventID() << " id : " + << id << (cib->valid(now) ? ": T" : ": F") ); return cib->valid(now); } }