Skip to content
Snippets Groups Projects
Commit bed590d4 authored by Scott Snyder's avatar Scott Snyder Committed by Edward Moyse
Browse files

AthenaKernel, etc: Fix input renaming for MT jobs.

parent d2ab7f48
No related branches found
No related tags found
No related merge requests found
Showing
with 6354 additions and 2893 deletions
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -534,7 +534,7 @@ AuxTypeRegistry::setInputRenameMap (const Athena::IInputRename::InputRenameMap_t
if (!map) return;
for (const auto& p : *map) {
sgkey_t from_sgkey = p.first;
sgkey_t to_sgkey = p.second;
sgkey_t to_sgkey = p.second.m_sgkey;
const std::string* from_str = pool.keyToString (from_sgkey);
if (!from_str) continue;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -350,7 +350,7 @@ void addto_renameMap (Athena::IInputRename::InputRenameMap_t& map,
CLID clid = 123;
sgkey_t from_key = pool.stringToKey (from, clid);
sgkey_t to_key = pool.stringToKey (to, clid);
map[from_key] = to_key;
map[from_key] = Athena::IInputRename::Rename { to_key, to };
}
#endif // NOT XAOD_STANDALONE
......
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -21,6 +21,7 @@
#include "SGTools/DataProxy.h"
#include "AthenaKernel/IStringPool.h"
#include "AthenaKernel/RCUObject.h"
#include "AthenaKernel/IInputRename.h"
#include "CxxUtils/checker_macros.h"
#include <string>
#include <unordered_map>
......@@ -72,8 +73,8 @@ public:
typedef void* castfn_t (SG::DataProxy*);
/// Input renaming map.
typedef std::unordered_map<SG::sgkey_t, SG::sgkey_t> InputRenameMap_t;
typedef Athena::RCUObject<InputRenameMap_t> InputRenameRCU_t;
typedef Athena::IInputRename::InputRenameMap_t InputRenameMap_t;
typedef Athena::IInputRename::InputRenameRCU_t InputRenameRCU_t;
/**
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -319,7 +319,7 @@ DataProxyHolder::toTransient (sgkey_t sgkey, IProxyDict* sg /*= 0*/)
Athena::RCURead<InputRenameMap_t> r (*s_inputRenameMap);
auto it = r->find (sgkey);
if (it != r->end())
sgkey = it->second;
sgkey = it->second.m_sgkey;
}
if (sgkey)
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -368,8 +368,8 @@ void initInputRename ATLAS_NOT_THREAD_SAFE ()
{
SG::StringPool sp;
auto m = std::make_unique<SG::DataProxyHolder::InputRenameMap_t>();
(*m)[sp.stringToKey("foox", fooclid)]
= sp.stringToKey("fooy", fooclid);
Athena::IInputRename::Rename ren { sp.stringToKey("fooy", fooclid), "fooy" };
(*m)[sp.stringToKey("foox", fooclid)] = ren;
Athena::RCUUpdate<SG::DataProxyHolder::InputRenameMap_t> u (inputRenameMap);
u.update (std::move (m));
SG::DataProxyHolder::setInputRenameMap (&inputRenameMap);
......
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -40,7 +40,12 @@ class IInputRename
{
public:
/// Type of the input rename map: sgkey_t -> sgkey_t.
typedef std::unordered_map<SG::sgkey_t, SG::sgkey_t> InputRenameMap_t;
struct Rename
{
SG::sgkey_t m_sgkey;
std::string m_key;
};
typedef std::unordered_map<SG::sgkey_t, Rename> InputRenameMap_t;
typedef RCUObject<InputRenameMap_t> InputRenameRCU_t;
DeclareInterfaceID (IInputRename,1,0);
......
......@@ -59,6 +59,9 @@ datamodel_run_test (xAODTestRead2b DEPENDS xAODTestRead)
datamodel_run_test (xAODTestTypelessRead DEPENDS xAODTestWrite)
datamodel_run_test (xAODTestRead3 DEPENDS xAODTestTypelessRead)
datamodel_run_test (xAODTestReadRename DEPENDS xAODTestWrite)
datamodel_run_test (xAODTestReadRenameMT
COMMAND "athena.py --thread=1"
DEPENDS xAODTestWrite)
datamodel_run_test (xAODTestReadFilter DEPENDS xAODTestWrite)
datamodel_run_test (xAODTestReadFilterRead DEPENDS xAODTestReadFilter)
datamodel_run_test (xAODTestReadARA
......
This diff is collapsed.
#
# $Id$
#
# File: DataModelRunTests/share/xAODReadRenameMT_jo.py
# Author: snyder@bnl.gov
# Date: Nov, 2018
# Purpose: Test reading xAOD objects data with renaming on input with hive.
#
FILECATALOG = 'xAODTestReadRenameMT_catalog.xml'
include ('DataModelRunTests/xAODTestReadRename_jo.py')
......@@ -82,5 +82,6 @@ ChronoStatSvc.StatPrintOutTable = FALSE
#svcMgr.ExceptionSvc.Catch = "None"
# Avoid races when running tests in parallel.
FILECATALOG = 'xAODTestReadRename_catalog.xml'
if 'FILECATALOG' not in globals():
FILECATALOG = 'xAODTestReadRename_catalog.xml'
include ('DataModelRunTests/setCatalog.py')
......@@ -223,6 +223,7 @@ PP="$PP"'|is still valid for| and sid '
PP="$PP"'|INFO Found MetaDataTools'
PP="$PP"'|INFO AthenaOutputStream'
PP="$PP"'|^DbSession.*INFO'
test=$1
......
This diff is collapsed.
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