Commit d84cf50a authored by Peter van Gemmeren's avatar Peter van Gemmeren
Browse files

Allow setting and printing of ROOT Domain attributes for Input.


Former-commit-id: 30eed811
parent 39dacd64
......@@ -62,14 +62,14 @@ AthenaEventLoopMgr.OutputLevel = INFO
# Turn on the tree cache for the CollectionTree - tree cache only
# works for one tree. And set tree cache size - default is 10 MB (10 000 000)
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
# Set number of events for learning before turning on cache - default is 5
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = '6'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = '6'" ]
# Print out values - must have PoolSvc in info mode
svcMgr.PoolSvc.OutputLevel = INFO
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_SIZE = 'int'" ]
# Print out for each event the number of bytes read and the number of
# read calls. With the tree cache, one should see jumps in the bytes
......@@ -78,8 +78,8 @@ svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
# tree (CollectionTree) - and we read some things from other trees, so
# one does see a small increase event-by-event.
svcMgr.PoolSvc.OutputLevel = INFO
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "READ_CALLS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; READ_CALLS = 'int'" ]
# No stats printout
......
......@@ -32,9 +32,6 @@ def _configureReadAthenaPool():
# Load the basic services
import AthenaPoolCnvSvc.AthenaPool
# Switch off TTreeCache for POOLContainerForm (most of the time only first entry is needed
#svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = 'POOLContainerForm'; TREE_CACHE = '0'" ]
# Load ProxyProviderSvc
if not hasattr (svcMgr, 'ProxyProviderSvc'):
svcMgr += CfgMgr.ProxyProviderSvc()
......
......@@ -52,11 +52,14 @@ svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '<fileName>'; <attri
# Set Container Attribute
svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '<fileName>'; ContainerName = '<type>/<key>'; <attributeName> = '<value>'" ]
# Set Input Database Attribute - set attribute for each incoming file/db
# Set Input Database Attribute - set attribute for domain
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "<attributeName> = '<value>'" ]
# Set Input Database Attribute - set attribute for each incoming file/db
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; <attributeName> = '<value>'" ]
# Set Input Database Attribute - set attribute for each incoming file/db for a particular container/tree
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = '<treeName>'; <attributeName> = '<value>'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = '<treeName>'; <attributeName> = '<value>'" ]
# To get an Attribute value printed to the log while commit, use the same syntax as for
# setting attributes, but replace the <value> with its <dataType> (int, DbLonglong, double).
......
......@@ -110,9 +110,9 @@ StatusCode AthenaPoolCnvSvc::initialize() {
// Extracting OUTPUT POOL ItechnologySpecificAttributes for Domain, Database and Container.
extractPoolAttributes(m_poolAttr, &m_containerAttr, &m_databaseAttr, &m_domainAttr);
// Extracting INPUT POOL ItechnologySpecificAttributes for Domain, Database and Container.
extractPoolAttributes(m_inputPoolAttr, &m_inputAttr, &m_inputAttr);
extractPoolAttributes(m_inputPoolAttr, &m_inputAttr, &m_inputAttr, &m_inputAttr);
// Extracting the INPUT POOL ItechnologySpecificAttributes which are to be printed for each event
extractPoolAttributes(m_inputPoolAttrPerEvent, &m_inputAttrPerEvent, &m_inputAttrPerEvent);
extractPoolAttributes(m_inputPoolAttrPerEvent, &m_inputAttrPerEvent, &m_inputAttrPerEvent, &m_inputAttrPerEvent);
if (!m_inputPoolAttrPerEvent.value().empty()) {
// Setup incident for EndEvent to print out attributes each event
ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", name());
......@@ -121,6 +121,12 @@ StatusCode AthenaPoolCnvSvc::initialize() {
incSvc->addListener(this, "EndEvent", pri);
ATH_MSG_DEBUG("Subscribed to EndEvent for printing out input file attributes.");
}
pool::DbType dbType = m_dbType;
m_dbType = pool::DbType(pool::ROOTTREE_StorageType);
if (!processPoolAttributes(m_inputAttr, "", IPoolSvc::kInputStream, false, true, true).isSuccess()) {
ATH_MSG_DEBUG("setInputAttribute failed setting POOL domain attributes.");
}
m_dbType = dbType;
m_doChronoStat = m_skipFirstChronoCommit.value() ? false : true;
return(StatusCode::SUCCESS);
}
......@@ -859,12 +865,15 @@ StatusCode AthenaPoolCnvSvc::cleanUp() {
StatusCode AthenaPoolCnvSvc::setInputAttributes(const std::string& fileName) {
// Set attributes for input file
m_lastFileName = fileName; // Save file name for printing attributes per event
pool::DbType dbType = m_dbType;
m_dbType = pool::DbType(pool::ROOTTREE_StorageType);
if (!processPoolAttributes(m_inputAttr, m_lastFileName, IPoolSvc::kInputStream, false, true, false).isSuccess()) {
ATH_MSG_DEBUG("setInputAttribute failed setting POOL database/container attributes.");
}
if (!processPoolAttributes(m_inputAttr, m_lastFileName, IPoolSvc::kInputStream, true, false).isSuccess()) {
ATH_MSG_DEBUG("setInputAttribute failed getting POOL database/container attributes.");
}
m_dbType = dbType;
return(StatusCode::SUCCESS);
}
//______________________________________________________________________________
......@@ -993,9 +1002,12 @@ StatusCode AthenaPoolCnvSvc::readData() const {
//______________________________________________________________________________
void AthenaPoolCnvSvc::handle(const Incident& incident) {
if (incident.type() == "EndEvent") {
pool::DbType dbType = m_dbType;
m_dbType = pool::DbType(pool::ROOTTREE_StorageType);
if (!processPoolAttributes(m_inputAttrPerEvent, m_lastFileName, IPoolSvc::kInputStream).isSuccess()) {
ATH_MSG_DEBUG("handle EndEvent failed process POOL database attributes.");
}
m_dbType = dbType;
}
}
//______________________________________________________________________________
......@@ -1144,7 +1156,7 @@ StatusCode AthenaPoolCnvSvc::processPoolAttributes(std::vector<std::vector<std::
std::string data = (*iter)[1];
const std::string& file = (*iter)[2];
const std::string& cont = (*iter)[3];
if ((file == fileName || (file.substr(0, 1) == "*"
if (!fileName.empty() && (file == fileName || (file.substr(0, 1) == "*"
&& file.find("," + fileName + ",") == std::string::npos))) {
if (data == "int" || data == "DbLonglong" || data == "double" || data == "string") {
if (doGet) {
......
......@@ -52,13 +52,13 @@ svcMgr.EventSelector.SkipEventSequence = [ 9, 10 ]; # // skip two more events
#Switch Off for TAG - start
# Turn on the tree cache for the CollectionTree - tree cache only works for one tree.
# Set number of events for learning before turning on cache - default is 5
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = '6'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = '6'" ]
# And set tree cache size - default is 10 MB (10 000 000)
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
# Print out values - must have PoolSvc in info mode
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_SIZE = 'int'" ]
# Print out for each event the number of bytes read and the number of
# read calls. With the tree cache, one should see jumps in the bytes
......@@ -66,8 +66,8 @@ svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
# event. However, the cache only works on one tree - the main event
# tree (CollectionTree) - and we read some things from other trees, so
# one does see a small increase event-by-event.
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "READ_CALLS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; READ_CALLS = 'int'" ]
#Switch Off for TAG - end
from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__QueryTag
......
......@@ -51,13 +51,13 @@ svcMgr.EventSelector.SkipEventSequence = [ 9, 10 ]; # // skip two more events
#Switch Off for TAG - start
# Turn on the tree cache for the CollectionTree - tree cache only works for one tree.
# Set number of events for learning before turning on cache - default is 5
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = '6'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = '6'" ]
# And set tree cache size - default is 10 MB (10 000 000)
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
# Print out values - must have PoolSvc in info mode
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_SIZE = 'int'" ]
# Print out for each event the number of bytes read and the number of
# read calls. With the tree cache, one should see jumps in the bytes
......@@ -65,8 +65,8 @@ svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
# event. However, the cache only works on one tree - the main event
# tree (CollectionTree) - and we read some things from other trees, so
# one does see a small increase event-by-event.
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "READ_CALLS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; READ_CALLS = 'int'" ]
#Switch Off for TAG - end
from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__QueryTag
......
......@@ -52,13 +52,13 @@ svcMgr.EventSelector.SkipEventSequence = [ 9, 10 ]; # // skip two more events
#Switch Off for TAG - start
# Turn on the tree cache for the CollectionTree - tree cache only works for one tree.
# Set number of events for learning before turning on cache - default is 5
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = '6'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = '6'" ]
# And set tree cache size - default is 10 MB (10 000 000)
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
# Print out values - must have PoolSvc in info mode
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_SIZE = 'int'" ]
# Print out for each event the number of bytes read and the number of
# read calls. With the tree cache, one should see jumps in the bytes
......@@ -66,8 +66,8 @@ svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
# event. However, the cache only works on one tree - the main event
# tree (CollectionTree) - and we read some things from other trees, so
# one does see a small increase event-by-event.
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "READ_CALLS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; READ_CALLS = 'int'" ]
#Switch Off for TAG - end
from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__QueryTag
......
......@@ -51,13 +51,13 @@ svcMgr.EventSelector.SkipEventSequence = [ 9, 10 ]; # // skip two more events
#Switch Off for TAG - start
# Turn on the tree cache for the CollectionTree - tree cache only works for one tree.
# Set number of events for learning before turning on cache - default is 5
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = '6'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = '6'" ]
# And set tree cache size - default is 10 MB (10 000 000)
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
# Print out values - must have PoolSvc in info mode
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_SIZE = 'int'" ]
# Print out for each event the number of bytes read and the number of
# read calls. With the tree cache, one should see jumps in the bytes
......@@ -65,8 +65,8 @@ svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
# event. However, the cache only works on one tree - the main event
# tree (CollectionTree) - and we read some things from other trees, so
# one does see a small increase event-by-event.
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "READ_CALLS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; READ_CALLS = 'int'" ]
#Switch Off for TAG - end
from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__QueryTag
......
......@@ -51,13 +51,13 @@ svcMgr.EventSelector.CollectionType = "ExplicitROOT"
"""
# Turn on the tree cache for the CollectionTree - tree cache only works for one tree.
# Set number of events for learning before turning on cache - default is 5
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = '6'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = '6'" ]
# And set tree cache size - default is 10 MB (10 000 000)
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
# Print out values - must have PoolSvc in info mode
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_SIZE = 'int'" ]
# Print out for each event the number of bytes read and the number of
# read calls. With the tree cache, one should see jumps in the bytes
......@@ -65,8 +65,8 @@ svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "TREE_CACHE_SIZE = 'int'" ]
# event. However, the cache only works on one tree - the main event
# tree (CollectionTree) - and we read some things from other trees, so
# one does see a small increase event-by-event.
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "READ_CALLS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; READ_CALLS = 'int'" ]
"""
from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__QueryTag
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment