Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • holau/Gaudi
  • dmagdali/Gaudi
  • pmunozpa/Gaudi
  • ssottoco/Gaudi
  • cvarni/Gaudi
  • mafila/Gaudi
  • admorris/Gaudi
  • staider/Gaudi
  • gunther/Gaudi
  • bstanisl/Gaudi
  • jtorasso/Gaudi
  • wochung/Gaudi
  • mveghel/Gaudi
  • averbyts/Gaudi
  • dguest/Gaudi
  • alboyer/Gaudi
  • dkonst/Gaudi
  • jcarcell/Gaudi
  • elmsheus/Gaudi
  • hpxgaudi/Gaudi
  • ganis/Gaudi
  • tadej/Gaudi
  • hahansen/Gaudi
  • juesseiv/Gaudi
  • imjelde/gaudida
  • jheuel/Gaudi
  • mimazure/Gaudi
  • masato/Gaudi
  • dcasperfaser/Gaudi
  • faser/offline/Gaudi
  • axu/Gaudi
  • sailer/Gaudi
  • amete/Gaudi
  • ponyisi/Gaudi
  • vavolkl/Gaudi
  • mstahl/Gaudi
  • wlampl/Gaudi
  • kreczko/Gaudi
  • emoyse/Gaudi
  • dhynds/Gaudi
  • sstahl/Gaudi
  • rcurrie/Gaudi
  • smh/Gaudi
  • valassi/Gaudi
  • bwynne/Gaudi_gaudi
  • abarton/Gaudi
  • tsulaia/gaudigaudi
  • mnowak/Gaudi
  • roiser/Gaudi
  • merrenst/Gaudi
  • mato/Gaudi
  • christos/Gaudi
  • goetz/Gaudi
  • goetz/AtlasGaudi
  • tsulaia/atlasgaudi
  • olupton/Gaudi
  • pseyfert/Gaudi
  • graemes/Gaudi
  • gianelle/Gaudi
  • akraszna/AtlasGaudi
  • cattanem/Gaudi
  • skluth/Gaudi
  • will/Gaudi
  • ssnyder/Gaudi
  • agonzale/Gaudi
  • leggett/AtlasGaudi
  • apearce/Gaudi
  • mnowak/Gaudi-ORIG
  • fwinkl/AtlasGaudi
  • bwynne/Gaudi_atlas
  • chamont/Gaudi
  • rmatev/Gaudi
  • lhcb/Gaudi
  • atlas/Gaudi
  • akraszna/GaudiGaudi
  • fwinkl/Gaudi
  • jonrob/Gaudi
  • azaborow/Gaudi
  • clemenci/Gaudi
  • hgraslan/Gaudi
  • srimanob/Gaudi
  • graven/Gaudi
  • hegner/Gaudi
  • gaudi/Gaudi
84 results
Show changes
Commits on Source (19)
Showing
with 449 additions and 167 deletions
......@@ -11,15 +11,19 @@ variables:
BINARY_TAG: "x86_64-centos7-gcc7-opt"
LCG_hostos: "x86_64-centos7"
LCG_release_area: "/cvmfs/sft.cern.ch/lcg/releases"
LCG_contrib: "/cvmfs/sft.cern.ch/lcg/contrib"
BUILDDIR: "build"
TESTS_REPORT: "test_report"
before_script:
- export PATH=/cvmfs/sft.cern.ch/lcg/contrib/CMake/3.8.1/Linux-x86_64/bin:/cvmfs/sft.cern.ch/lcg/contrib/ninja/1.7.1/x86_64-slc6:/cvmfs/sft.cern.ch/lcg/releases/Python/2.7.13-597a5/${BINARY_TAG}/bin:${PATH}
- export PATH=${LCG_contrib}/CMake/3.8.1/Linux-x86_64/bin:${LCG_contrib}/ninja/1.7.1/x86_64-slc6:${LCG_release_area}/Python/2.7.13-597a5/${BINARY_TAG}/bin:${PATH}
- export PATH=/cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/dev/InstallArea/scripts:${PATH}
- export PYTHONPATH=/cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/dev/InstallArea/python:${PYTHONPATH}
- export CMAKE_PREFIX_PATH=${LCG_release_area}:/cvmfs/projects.cern.ch/intelsw/psxe/linux/x86_64/2017/vtune_amplifier_xe
- export CCACHE_DIR=${PWD}/.ccache
# special environment required for LCG binutils
- export PATH=${LCG_contrib}/bintuils/2.28/${LCG_hostos}/bin:${PATH}
- export LD_LIBRARY_PATH=${LCG_contrib}/bintuils/2.28/${LCG_hostos}/lib:${LD_LIBRARY_PATH}
build:
tags:
......@@ -28,11 +32,11 @@ build:
script:
- curl -o artifacts.zip --location ${CI_PROJECT_URL}/-/jobs/artifacts/master/download?job=${CI_JOB_NAME}
- unzip -q artifacts.zip '.ccache/*' || true
- /cvmfs/sft.cern.ch/lcg/releases/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- echo 'set(CMAKE_USE_CCACHE ON CACHE BOOL "")' >> cache_preload.cmake
- echo 'set(clang_format_cmd "'$(which lcg-clang-format-${CLANG_FORMAT_VERSION})'" CACHE FILEPATH "")' >> cache_preload.cmake
- make BUILDDIR=${BUILDDIR}
- /cvmfs/sft.cern.ch/lcg/releases/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -s
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -s
artifacts:
paths:
- ${BUILDDIR}
......@@ -49,11 +53,11 @@ build-gcc62:
script:
- curl -o artifacts.zip --location ${CI_PROJECT_URL}/-/jobs/artifacts/master/download?job=${CI_JOB_NAME}
- unzip -q artifacts.zip '.ccache/*' || true
- /cvmfs/sft.cern.ch/lcg/releases/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- echo 'set(CMAKE_USE_CCACHE ON CACHE BOOL "")' >> cache_preload.cmake
- echo 'set(clang_format_cmd "'$(which lcg-clang-format-${CLANG_FORMAT_VERSION})'" CACHE FILEPATH "")' >> cache_preload.cmake
- make BUILDDIR=${BUILDDIR}
- /cvmfs/sft.cern.ch/lcg/releases/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -s
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -s
artifacts:
paths:
- ${BUILDDIR}
......@@ -67,7 +71,7 @@ test_headers:
script:
- curl -o artifacts.zip --location ${CI_PROJECT_URL}/-/jobs/artifacts/master/download?job=${CI_JOB_NAME}
- unzip -q artifacts.zip '.ccache/*' || true
- /cvmfs/sft.cern.ch/lcg/releases/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- export LCG_release_area=${LCG_release_area}:/cvmfs/lhcb.cern.ch/lib/lcg/external
- make BUILDDIR=${BUILDDIR} test_public_headers_build
- /cvmfs/sft.cern.ch/lcg/releases/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -s
......
......@@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Use `apply` in `Gaudi::Functional` ([mr !622][])
### Fixed
- Fix environment for Gitlab-CI
- Unset `GIT_DIR`/`GIT_WORK_TREE` before cloning `xenv` ([mr !669][])
- Add test and fix of version propagation in KeyedContainer move ([mr !663][], [issue #27][])
- Fixed the list of files used for formatting check in Gitlab-CI ([mr !664][])
......
......@@ -4,25 +4,18 @@
// Framework include files
#include "GaudiKernel/IAlgExecStateSvc.h"
#include "GaudiKernel/IAlgResourcePool.h"
#include "GaudiKernel/IDataManagerSvc.h"
#include "GaudiKernel/IEvtSelector.h"
#include "GaudiKernel/IHiveWhiteBoard.h"
#include "GaudiKernel/IIncidentListener.h"
#include "GaudiKernel/IIncidentSvc.h"
#include "GaudiKernel/IScheduler.h"
#include "GaudiKernel/MinimalEventLoopMgr.h"
// Standard includes
#include <functional>
#include "GaudiKernel/SmartIF.h"
// External Libraries
#include "tbb/concurrent_queue.h"
#include <boost/dynamic_bitset.hpp>
// Forward declarations
class IIncidentSvc;
struct IDataManagerSvc;
class IDataProviderSvc;
class HiveSlimEventLoopMgr : public extends<Service, IEventProcessor>
{
......
#!/usr/bin/env gaudirun.py
'''
A deliberately badly-configured job to demonstrate a crash in
sub-event scheduling.
The ViewTester is an algorithm specifically designed to create sub-event
contexts, pass them to the scheduler, and report on the current context.
The re-use of filter_alg causes the CF to "skip over" filter_alg2
This would then cause sub-events to be scheduled, but with the
"ShortCircuit" property of the hltStep node set True, the event can
be deleted before the sub-events have completed, causing the crash.
There is now protection in AvalancheScheduler against this crash,
but note that re-using algs in this way is still expected to cause
surprising CF behaviour.
'''
from Gaudi.Configuration import *
from Configurables import (HiveWhiteBoard, HiveSlimEventLoopMgr,
AvalancheSchedulerSvc, AlgResourcePool,
CPUCruncher, GaudiSequencer, Test__ViewTester)
# metaconfig -------------------------------------------------------------------
# It's confortable to collect the relevant parameters at the top of the optionfile
evtslots = 1
evtMax = 10
cardinality = 1
threads = 1
viewsPerEvt = 2
# -------------------------------------------------------------------------------
# The configuration of the whiteboard ------------------------------------------
# It is useful to call it EventDataSvc to replace the usual data service with
# the whiteboard transparently.
whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
# -------------------------------------------------------------------------------
# Event Loop Manager -----------------------------------------------------------
# It's called slim since it has less functionalities overall than the good-old
# event loop manager. Here we just set its outputlevel to DEBUG.
slimeventloopmgr = HiveSlimEventLoopMgr(
SchedulerName="AvalancheSchedulerSvc", OutputLevel=INFO)
# -------------------------------------------------------------------------------
# ForwardScheduler -------------------------------------------------------------
# We just decide how many algorithms in flight we want to have and how many
# threads in the pool. The default value is -1, which is for TBB equivalent
# to take over the whole machine.
scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=INFO)
# -------------------------------------------------------------------------------
# Algo Resource Pool -----------------------------------------------------------
# Nothing special here, we just set the debug level.
AlgResourcePool(OutputLevel=INFO)
# -------------------------------------------------------------------------------
filter_alg = CPUCruncher("filter_alg")
filter_alg.InvertDecision = False
filter_alg.avgRuntime = 0.0
filter_alg2 = CPUCruncher("filter_alg2")
filter_alg2.InvertDecision = True
filter_alg2.avgRuntime = 0.0
view_make_alg = Test__ViewTester("view_make_alg")
view_make_alg.baseViewName = 'view'
view_make_alg.viewNumber = viewsPerEvt
view_make_alg.viewNodeName = 'view_test_node'
view_test_alg = CPUCruncher("view_test_alg")
view_test_alg.InvertDecision = False
view_test_alg.avgRuntime = 1.0
for algo in [filter_alg, filter_alg2, view_make_alg, view_test_alg]:
algo.Cardinality = cardinality
algo.OutputLevel = INFO
view_test_node = GaudiSequencer("view_test_node",
Members=[view_test_alg],
Sequential=False,
OutputLevel=INFO)
view_make_node = GaudiSequencer("view_make_node",
Members=[filter_alg,
view_make_alg, view_test_node],
Sequential=True,
OutputLevel=INFO)
hltStep = GaudiSequencer("hltStep",
Members=[filter_alg, filter_alg2, view_make_node],
Sequential=True,
ShortCircuit=True,
ModeOR=False,
OutputLevel=INFO)
# Application Manager ----------------------------------------------------------
# We put everything together and change the type of message service
ApplicationMgr(EvtMax=evtMax,
EvtSel='NONE',
ExtSvc=[whiteboard],
EventLoop=slimeventloopmgr,
TopAlg=[hltStep],
MessageSvcType="InertMessageSvc")
# -------------------------------------------------------------------------------
......@@ -47,6 +47,22 @@ namespace
std::sort( v.begin(), v.end(), DataObjIDSorter() );
return v;
}
bool subSlotAlgsInStates( const EventSlot& slot, std::initializer_list<AlgsExecutionStates::State> const& testStates )
{
for ( const EventSlot& ss : slot.allSubSlots ) {
for ( auto state : testStates ) {
if ( ss.algsStates.algsPresent( state ) ) {
// There are sub-slot algs in this state
return true;
}
}
}
// No algs in any of the test states
return false;
}
}
//===========================================================================
......@@ -759,10 +775,11 @@ StatusCode AvalancheSchedulerSvc::updateStates( int si, const int algo_index, Ev
// Not complete because this would mean that the slot is already free!
if ( !thisSlot.complete && m_precSvc->CFRulesResolved( thisSlot ) &&
thisSlot.subSlotAlgsReady.empty() && // Account for sub-slot algs
!thisSlot.algsStates.algsPresent( AlgsExecutionStates::CONTROLREADY ) &&
!thisSlot.algsStates.algsPresent( AlgsExecutionStates::DATAREADY ) &&
!thisSlot.algsStates.algsPresent( AlgsExecutionStates::SCHEDULED ) ) {
!thisSlot.algsStates.algsPresent( AlgsExecutionStates::SCHEDULED ) &&
!subSlotAlgsInStates( thisSlot, {AlgsExecutionStates::CONTROLREADY, AlgsExecutionStates::DATAREADY,
AlgsExecutionStates::SCHEDULED} ) ) {
thisSlot.complete = true;
// if the event did not fail, add it to the finished events
......@@ -805,8 +822,8 @@ StatusCode AvalancheSchedulerSvc::isStalled( int iSlot )
EventSlot& thisSlot = m_eventSlots[iSlot];
if ( m_actionsQueue.empty() && m_algosInFlight == 0 && m_IOBoundAlgosInFlight == 0 &&
thisSlot.subSlotAlgsReady.empty() && // Account for sub-slot algs
( !thisSlot.algsStates.algsPresent( AlgsExecutionStates::DATAREADY ) ) ) {
( !thisSlot.algsStates.algsPresent( AlgsExecutionStates::DATAREADY ) ) &&
!subSlotAlgsInStates( thisSlot, {AlgsExecutionStates::DATAREADY, AlgsExecutionStates::SCHEDULED} ) ) {
info() << "About to declare a stall" << endmsg;
fatal() << "*** Stall detected! ***\n" << endmsg;
......@@ -906,8 +923,17 @@ void AvalancheSchedulerSvc::dumpSchedulerState( int iSlot )
// Mention sub slots
if ( slot.allSubSlots.size() ) {
outputMS << "\nNumber of sub-slots:" << slot.allSubSlots.size() << "\n";
outputMS << "Sub-slot algorithms ready:" << slot.subSlotAlgsReady.size() << "\n";
outputMS << "\nNumber of sub-slots: " << slot.allSubSlots.size() << "\n";
outputMS << "Sub-slot algorithms ready: " << slot.subSlotAlgsReady.size() << "\n\n";
auto slotID = slot.eventContext->valid() ? std::to_string( slot.eventContext->slot() ) : "[ctx invalid]";
for ( auto& ss : slot.allSubSlots ) {
outputMS << "[ slot: " << slotID << " sub-slot entry: " << ss.entryPoint << " event: "
<< ( ss.eventContext->valid() ? std::to_string( ss.eventContext->evt() ) : "[ctx invalid]" )
<< " ]:\n\n";
outputMS << m_precSvc->printState( ss ) << "\n";
}
}
}
}
......@@ -1153,6 +1179,7 @@ StatusCode AvalancheSchedulerSvc::scheduleEventView( EventContext const* sourceC
unsigned int lastIndex = topSlot.allSubSlots.size();
topSlot.allSubSlots.push_back( EventSlot( m_eventSlots[topSlotIndex], viewContext ) );
topSlot.allSubSlots.back().entryPoint = nodeName;
topSlot.allSubSlots.back().algsStates.reset();
// Store index of the new slot in lookup structures
topSlot.contextToSlot[viewContext] = lastIndex;
......
......@@ -2,13 +2,14 @@
#define GAUDIKERNEL_HISTOGRAMAGENT_H
#include "GaudiKernel/ClassID.h"
#include "GaudiKernel/DataObject.h"
#include "GaudiKernel/IDataSelector.h"
#include "GaudiKernel/IDataStoreAgent.h"
#include "GaudiKernel/IRegistry.h"
/** @class HistogramAgent HistogramAgent.h GaudiKernel/HistogramAgent.h
HistogramAgent base in charge of collecting all the refereces to
HistogramAgent base in charge of collecting all the references to
DataObjects in a transient store that passes some selection criteria. The
default behaviour is to collect all entries.
......
// FW includes
// Local includes
#include "GaudiHive/HiveSlimEventLoopMgr.h"
#include "HistogramAgent.h"
// Framework includes
#include "GaudiKernel/AppReturnCode.h"
#include "GaudiKernel/DataObject.h"
#include "GaudiKernel/DataSvc.h"
#include "GaudiKernel/IAlgManager.h"
#include "GaudiKernel/IChronoStatSvc.h"
#include "GaudiKernel/IConversionSvc.h"
#include "GaudiKernel/IDataManagerSvc.h"
#include "GaudiKernel/IDataProviderSvc.h"
#include "GaudiKernel/IEvtSelector.h"
#include "GaudiKernel/IIncidentListener.h"
#include "GaudiKernel/IIncidentSvc.h"
#include "GaudiKernel/Incident.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/SmartIF.h"
#include "HistogramAgent.h"
#include "GaudiHive/HiveSlimEventLoopMgr.h"
#include "GaudiKernel/Algorithm.h"
#include "GaudiKernel/EventContext.h"
#include <GaudiKernel/GaudiException.h>
#include <GaudiKernel/IScheduler.h>
#include "GaudiKernel/Incident.h"
// External libraries
#include <chrono>
......@@ -31,11 +15,11 @@
// Instantiation of a static factory class used by clients to create instances of this service
DECLARE_COMPONENT( HiveSlimEventLoopMgr )
#define ON_DEBUG if ( UNLIKELY( outputLevel() <= MSG::DEBUG ) )
#define ON_VERBOSE if ( UNLIKELY( outputLevel() <= MSG::VERBOSE ) )
#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
#define DEBUG_MSG ON_DEBUG debug()
#define DEBMSG ON_DEBUG debug()
#define VERMSG ON_VERBOSE verbose()
#define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) )
#define VERBOSE_MSG ON_VERBOSE verbose()
//--------------------------------------------------------------------------------------------
// Standard Constructor
......@@ -309,12 +293,12 @@ StatusCode HiveSlimEventLoopMgr::executeEvent( void* createdEvts_IntPtr )
// Check if event number is in blacklist
if ( LIKELY( m_blackListBS != nullptr ) ) { // we are processing a finite number of events, use bitset blacklist
if ( m_blackListBS->test( createdEvts ) ) {
verbose() << "Event " << createdEvts << " on black list" << endmsg;
VERBOSE_MSG << "Event " << createdEvts << " on black list" << endmsg;
return StatusCode::RECOVERABLE;
}
} else if ( std::binary_search( m_eventNumberBlacklist.begin(), m_eventNumberBlacklist.end(), createdEvts ) ) {
verbose() << "Event " << createdEvts << " on black list" << endmsg;
VERBOSE_MSG << "Event " << createdEvts << " on black list" << endmsg;
return StatusCode::RECOVERABLE;
}
......@@ -323,7 +307,7 @@ StatusCode HiveSlimEventLoopMgr::executeEvent( void* createdEvts_IntPtr )
return StatusCode::FAILURE;
}
verbose() << "Beginning to process event " << createdEvts << endmsg;
VERBOSE_MSG << "Beginning to process event " << createdEvts << endmsg;
// An incident may schedule a stop, in which case is better to exit before the actual execution.
// DP have to find out who shoots this
......@@ -342,7 +326,8 @@ StatusCode HiveSlimEventLoopMgr::executeEvent( void* createdEvts_IntPtr )
m_incidentSvc->fireIncident( std::make_unique<Incident>( name(), IncidentType::BeginEvent, *evtContext ) );
// Now add event to the scheduler
verbose() << "Adding event " << evtContext->evt() << ", slot " << evtContext->slot() << " to the scheduler" << endmsg;
VERBOSE_MSG << "Adding event " << evtContext->evt() << ", slot " << evtContext->slot() << " to the scheduler"
<< endmsg;
m_incidentSvc->fireIncident( std::make_unique<Incident>( name(), IncidentType::BeginProcessing, *evtContext ) );
......@@ -354,7 +339,7 @@ StatusCode HiveSlimEventLoopMgr::executeEvent( void* createdEvts_IntPtr )
<< endmsg;
}
createdEvts++;
++createdEvts;
return StatusCode::SUCCESS;
}
......@@ -428,7 +413,7 @@ StatusCode HiveSlimEventLoopMgr::nextEvent( int maxevt )
uint iteration = 0;
auto start_time = Clock::now();
while ( !loop_ended && ( maxevt < 0 || ( finishedEvts + skippedEvts ) < maxevt ) ) {
debug() << "work loop iteration " << iteration++ << endmsg;
DEBUG_MSG << "work loop iteration " << iteration++ << endmsg;
// if the created events did not reach maxevt, create an event
if ( ( newEvtAllowed || createdEvts == 0 ) && // Launch the first event alone
createdEvts >= 0 && // The events are not finished with an unlimited number of events
......@@ -439,7 +424,7 @@ StatusCode HiveSlimEventLoopMgr::nextEvent( int maxevt )
if ( 1 == createdEvts ) // reset counter to count from event 1
start_time = Clock::now();
debug() << "createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots() << endmsg;
DEBUG_MSG << "createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots() << endmsg;
// DP remove to remove the syscalls...
// if (0!=createdEvts){
// info() << "Event Number = " << createdEvts
......@@ -474,7 +459,7 @@ StatusCode HiveSlimEventLoopMgr::nextEvent( int maxevt )
// all the events were created but not all finished or the slots were
// all busy: the scheduler should finish its job
debug() << "Draining the scheduler" << endmsg;
DEBUG_MSG << "Draining the scheduler" << endmsg;
// Pull out of the scheduler the finished events
if ( drainScheduler( finishedEvts ).isFailure() ) loop_ended = true;
......@@ -564,18 +549,11 @@ StatusCode HiveSlimEventLoopMgr::drainScheduler( int& finishedEvts )
EventContext* finishedEvtContext( nullptr );
// Here we wait not to loose cpu resources
debug() << "Waiting for a context" << endmsg;
DEBUG_MSG << "Waiting for a context" << endmsg;
sc = m_schedulerSvc->popFinishedEvent( finishedEvtContext );
// We got past it: cache the pointer
if ( sc.isSuccess() ) {
debug() << "Context obtained" << endmsg;
} else {
// A problem occurred.
debug() << "Context not obtained: a problem in the scheduling?" << endmsg;
// return StatusCode::FAILURE;
}
DEBUG_MSG << "Context " << ( sc.isSuccess() ? "obtained" : "not obtained: a problem in the scheduling?" ) << endmsg;
finishedEvtContexts.push_back( finishedEvtContext );
// Let's see if we can pop other event contexts
......@@ -602,8 +580,8 @@ StatusCode HiveSlimEventLoopMgr::drainScheduler( int& finishedEvts )
m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndProcessing, *thisFinishedEvtContext ) );
m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndEvent, *thisFinishedEvtContext ) );
debug() << "Clearing slot " << thisFinishedEvtContext->slot() << " (event " << thisFinishedEvtContext->evt()
<< ") of the whiteboard" << endmsg;
DEBUG_MSG << "Clearing slot " << thisFinishedEvtContext->slot() << " (event " << thisFinishedEvtContext->evt()
<< ") of the whiteboard" << endmsg;
StatusCode sc = clearWBSlot( thisFinishedEvtContext->slot() );
if ( !sc.isSuccess() )
......@@ -611,7 +589,7 @@ StatusCode HiveSlimEventLoopMgr::drainScheduler( int& finishedEvts )
delete thisFinishedEvtContext;
finishedEvts++;
++finishedEvts;
}
return finalSC;
}
......
......@@ -247,39 +247,47 @@ namespace concurrency
StatusCode sc = StatusCode::SUCCESS;
// Create new, or fetch existent, AlgorithmNode
auto& algoName = algo->name();
auto itA = m_algoNameToAlgoNodeMap.find( algoName );
/// Create new, or fetch existent, AlgorithmNode
auto& algoName = algo->name();
concurrency::AlgorithmNode* algoNode;
auto itA = m_algoNameToAlgoNodeMap.find( algoName );
if ( itA != m_algoNameToAlgoNodeMap.end() ) {
algoNode = itA->second;
} else {
algoNode = new concurrency::AlgorithmNode( *this, algo, m_nodeCounter, m_algoCounter, inverted, allPass );
// Mirror the action above in the BGL-based graph
if ( m_enableAnalysis ) {
auto source =
boost::add_vertex( AlgoProps( algo, m_nodeCounter, m_algoCounter, inverted, allPass ), m_PRGraph );
boost::add_edge( source, node( parentName ), m_PRGraph );
}
m_algoNameToAlgoNodeMap[algoName] = algoNode;
// Mirror AlgorithmNode in the BGL-based graph
if ( m_enableAnalysis )
boost::add_vertex( AlgoProps( algo, m_nodeCounter, m_algoCounter, inverted, allPass ), m_PRGraph );
++m_nodeCounter;
++m_algoCounter;
m_algoNameToAlgoNodeMap[algoName] = algoNode;
ON_VERBOSE verbose() << "AlgoNode " << algoName << " added @ " << algoNode << endmsg;
ON_VERBOSE verbose() << "AlgorithmNode '" << algoName << "' added @ " << algoNode << endmsg;
registerIODataObjects( algo );
}
// Attach AlgorithmNode to its CF decision hub
/// Attach AlgorithmNode to its parent DecisionNode
auto itP = m_decisionNameToDecisionHubMap.find( parentName );
if ( itP != m_decisionNameToDecisionHubMap.end() ) {
auto parentNode = itP->second;
ON_VERBOSE verbose() << "Attaching AlgorithmNode '" << algo->name() << "' to DecisionNode '" << parentName << "'"
<< endmsg;
auto parentNode = itP->second;
parentNode->addDaughterNode( algoNode );
algoNode->addParentNode( parentNode );
// Mirror algorithm to CF parent relationship in the BGL-based graph
if ( m_enableAnalysis ) boost::add_edge( node( algo->name() ), node( parentName ), m_PRGraph );
ON_VERBOSE verbose() << "Attached AlgorithmNode '" << algo->name() << "' to parent DecisionNode '" << parentName
<< "'" << endmsg;
} else {
sc = StatusCode::FAILURE;
error() << "Requested DecisionNode '" << parentName << "' was not found" << endmsg;
error() << "Parent DecisionNode '" << parentName << "' was not found" << endmsg;
}
return sc;
......@@ -306,19 +314,19 @@ namespace concurrency
} else {
if ( !m_conditionsRealmEnabled ) {
dataNode = new concurrency::DataNode( *this, dataPath );
ON_VERBOSE verbose() << " DataNode for " << dataPath << " added @ " << dataNode << endmsg;
ON_VERBOSE verbose() << " DataNode " << dataPath << " added @ " << dataNode << endmsg;
// Mirror the action above in the BGL-based graph
if ( m_enableAnalysis ) boost::add_vertex( DataProps( dataPath ), m_PRGraph );
} else {
SmartIF<ICondSvc> condSvc{serviceLocator()->service( "CondSvc", false )};
if ( condSvc->isRegistered( dataPath ) ) {
dataNode = new concurrency::ConditionNode( *this, dataPath, condSvc );
ON_VERBOSE verbose() << " ConditionNode for " << dataPath << " added @ " << dataNode << endmsg;
ON_VERBOSE verbose() << " ConditionNode " << dataPath << " added @ " << dataNode << endmsg;
// Mirror the action above in the BGL-based graph
if ( m_enableAnalysis ) boost::add_vertex( CondDataProps( dataPath ), m_PRGraph );
} else {
dataNode = new concurrency::DataNode( *this, dataPath );
ON_VERBOSE verbose() << " DataNode for " << dataPath << " added @ " << dataNode << endmsg;
ON_VERBOSE verbose() << " DataNode " << dataPath << " added @ " << dataNode << endmsg;
// Mirror the action above in the BGL-based graph
if ( m_enableAnalysis ) boost::add_vertex( DataProps( dataPath ), m_PRGraph );
}
......@@ -347,39 +355,47 @@ namespace concurrency
StatusCode sc = StatusCode::SUCCESS;
auto& decisionHubName = decisionHubAlgo->name();
/// Create new, or fetch existent, DecisionNode
auto itP = m_decisionNameToDecisionHubMap.find( parentName );
concurrency::DecisionNode* parentNode;
if ( itP != m_decisionNameToDecisionHubMap.end() ) {
parentNode = itP->second;
auto itA = m_decisionNameToDecisionHubMap.find( decisionHubName );
concurrency::DecisionNode* decisionHubNode;
if ( itA != m_decisionNameToDecisionHubMap.end() ) {
decisionHubNode = itA->second;
} else {
decisionHubNode = new concurrency::DecisionNode( *this, m_nodeCounter, decisionHubName, modeConcurrent,
modePromptDecision, modeOR, allPass, isInverted );
m_decisionNameToDecisionHubMap[decisionHubName] = decisionHubNode;
auto& decisionHubName = decisionHubAlgo->name();
// Mirror the action above in the BGL-based graph
if ( m_enableAnalysis ) {
auto source = boost::add_vertex( DecisionHubProps( decisionHubName, m_nodeCounter, modeConcurrent,
modePromptDecision, modeOR, allPass, isInverted ),
m_PRGraph );
boost::add_edge( source, node( parentName ), m_PRGraph );
}
concurrency::DecisionNode* decisionHubNode;
++m_nodeCounter;
auto itA = m_decisionNameToDecisionHubMap.find( decisionHubName );
if ( itA != m_decisionNameToDecisionHubMap.end() ) {
decisionHubNode = itA->second;
} else {
decisionHubNode = new concurrency::DecisionNode( *this, m_nodeCounter, decisionHubName, modeConcurrent,
modePromptDecision, modeOR, allPass, isInverted );
m_decisionNameToDecisionHubMap[decisionHubName] = decisionHubNode;
ON_VERBOSE verbose() << "Decision hub node " << decisionHubName << " added @ " << decisionHubNode << endmsg;
// Mirror DecisionNode in the BGL-based graph
if ( m_enableAnalysis ) {
boost::add_vertex( DecisionHubProps( decisionHubName, m_nodeCounter, modeConcurrent, modePromptDecision, modeOR,
allPass, isInverted ),
m_PRGraph );
}
++m_nodeCounter;
ON_VERBOSE verbose() << "DecisionNode '" << decisionHubName << "' added @ " << decisionHubNode << endmsg;
}
/// Attach DecisionNode to its parent DecisionNode
auto itP = m_decisionNameToDecisionHubMap.find( parentName );
if ( itP != m_decisionNameToDecisionHubMap.end() ) {
auto parentNode = itP->second;
parentNode->addDaughterNode( decisionHubNode );
decisionHubNode->addParentNode( parentNode );
// Mirror DecisionNode-to-DecisionNode relationship in the BGL-based graph
if ( m_enableAnalysis ) boost::add_edge( node( decisionHubName ), node( parentName ), m_PRGraph );
ON_VERBOSE verbose() << "Attached DecisionNode '" << decisionHubName << "' to parent DecisionNode '" << parentName
<< "'" << endmsg;
} else {
sc = StatusCode::FAILURE;
error() << "Decision hub node " << parentName << ", requested to be parent, is not registered." << endmsg;
error() << "Parent DecisionNode '" << parentName << "' was not found" << endmsg;
}
return sc;
......
......@@ -181,9 +181,12 @@ StatusCode PrecedenceSvc::iterate( EventSlot& slot, const Cause& cause )
}
if ( UNLIKELY( m_dumpPrecTrace ) )
if ( UNLIKELY( CFRulesResolved( slot ) ) ) dumpPrecedenceTrace( slot );
if ( UNLIKELY( CFRulesResolved( slot.parentSlot ? *slot.parentSlot : slot ) ) )
dumpPrecedenceTrace( slot.parentSlot ? *slot.parentSlot : slot );
if ( UNLIKELY( m_dumpPrecRules ) )
if ( UNLIKELY( CFRulesResolved( slot ) ) ) dumpPrecedenceRules( slot );
if ( UNLIKELY( CFRulesResolved( slot.parentSlot ? *slot.parentSlot : slot ) ) )
dumpPrecedenceRules( slot.parentSlot ? *slot.parentSlot : slot );
return StatusCode::SUCCESS;
}
......
<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>gaudirun.py</text></argument>
<argument name="args"><set>
<text>-v</text>
<text>../../options/CFplusViewBug.py</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="timeout"><integer>120</integer></argument>
<argument name="reference"><text>refs/CFplusViewBug.ref</text></argument>
</extension>
# setting LC_ALL to "C"
# --> Including file '/workdir/Gaudi/GaudiHive/options/CFplusViewBug.py'
# <-- End of file '/workdir/Gaudi/GaudiHive/options/CFplusViewBug.py'
# Dumping all configurables and properties (different from default)
{'AlgResourcePool': {'OutputLevel': 3},
'ApplicationMgr': {'EventLoop': 'HiveSlimEventLoopMgr/HiveSlimEventLoopMgr',
'EvtMax': 10,
'EvtSel': 'NONE',
'ExtSvc': ['HiveWhiteBoard/EventDataSvc'],
'MessageSvcType': 'InertMessageSvc',
'TopAlg': ['GaudiSequencer/hltStep']},
'AvalancheSchedulerSvc': {'OutputLevel': 3, 'ThreadPoolSize': 1},
'EventDataSvc': {'EventSlots': 1},
'HiveSlimEventLoopMgr': {'OutputLevel': 3,
'SchedulerName': 'AvalancheSchedulerSvc'},
'filter_alg': {'Cardinality': 1,
'InvertDecision': False,
'OutputLevel': 3,
'avgRuntime': 0.0},
'filter_alg2': {'Cardinality': 1,
'InvertDecision': True,
'OutputLevel': 3,
'avgRuntime': 0.0},
'hltStep': {'Members': ['CPUCruncher/filter_alg',
'CPUCruncher/filter_alg2',
'GaudiSequencer/view_make_node'],
'ModeOR': False,
'OutputLevel': 3,
'Sequential': True,
'ShortCircuit': True},
'view_make_alg': {'Cardinality': 1,
'OutputLevel': 3,
'baseViewName': 'view',
'viewNodeName': 'view_test_node',
'viewNumber': 2},
'view_make_node': {'Members': ['CPUCruncher/filter_alg',
'Test::ViewTester/view_make_alg',
'GaudiSequencer/view_test_node'],
'OutputLevel': 3,
'Sequential': True},
'view_test_alg': {'Cardinality': 1,
'InvertDecision': False,
'OutputLevel': 3,
'avgRuntime': 1.0},
'view_test_node': {'Members': ['CPUCruncher/view_test_alg'],
'OutputLevel': 3,
'Sequential': False}}
MessageSvc INFO Activating in a separate thread
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr (GaudiCoreSvc v30r2)
running on bb169f195cdc on Wed Apr 25 18:39:35 2018
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
ThreadPoolSvc INFO no thread init tools attached
AvalancheSchedu... INFO Activating scheduler in a separate thread
AlgResourcePool INFO TopAlg list empty. Recovering the one of Application Manager
hltStep INFO Member list: CPUCruncher/filter_alg, CPUCruncher/filter_alg2, GaudiSequencer/view_make_node
RndmGenSvc.Engine INFO Generator engine type:CLHEP::RanluxEngine
RndmGenSvc.Engine INFO Current Seed:1234567 Luxury:3
RndmGenSvc INFO Using Random engine:HepRndm::Engine<CLHEP::RanluxEngine>
ToolSvc.Sequenc... INFO This machine has a speed about 3.45 times the speed of a 2.8 GHz Xeon.
filter_alg INFO Starting calibration...
filter_alg INFO Calibration finished!
view_make_node INFO Member list: CPUCruncher/filter_alg, Test::ViewTester/view_make_alg, GaudiSequencer/view_test_node
view_test_node INFO Member list: CPUCruncher/view_test_alg
AvalancheSchedu... INFO Found 4 algorithms
AvalancheSchedu... INFO Data Dependencies for Algorithms:
filter_alg
none
filter_alg2
none
view_make_alg
none
view_test_alg
none
PrecedenceSvc INFO Assembling CF and DF task precedence rules
PrecedenceSvc INFO PrecedenceSvc initialized successfully
AvalancheSchedu... INFO Concurrency level information:
AvalancheSchedu... INFO o Number of events in flight: 1
AvalancheSchedu... INFO o TBB thread pool size: 'ThreadPoolSize':1
HiveSlimEventLo...WARNING Unable to locate service "EventSelector"
HiveSlimEventLo...WARNING No events will be processed from external input.
HistogramPersis...WARNING Histograms saving not required.
HiveSlimEventLo... INFO Found 0 events in black list
ApplicationMgr INFO Application Manager Initialized successfully
ApplicationMgr INFO Application Manager Started successfully
HiveSlimEventLo... INFO Starting loop on events
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
view_make_alg INFO Running in whole event context
view_make_alg INFO Attached view0 to node view_test_node
view_make_alg INFO Attached view1 to node view_test_node
HiveSlimEventLo... INFO ---> Loop Finished (skipping 1st evt) - WSS 50.2734 total time 17638222770
HiveSlimEventLo... INFO 0 events were SKIPed
ApplicationMgr INFO Application Manager Stopped successfully
filter_alg INFO Summary: name= filter_alg avg_runtime= 0 n_clones= 1
filter_alg2 INFO Summary: name= filter_alg2 avg_runtime= 0 n_clones= 1
view_test_alg INFO Summary: name= view_test_alg avg_runtime= 1000 n_clones= 1
HiveSlimEventLo... INFO Histograms converted successfully according to request.
AvalancheSchedu... INFO Joining Scheduler thread
ToolSvc INFO Removing all tools created by ToolSvc
ToolSvc.Sequenc... INFO --------------------------------------------------------------------------------------------------
ToolSvc.Sequenc... INFO This machine has a speed about 3.45 times the speed of a 2.8 GHz Xeon.
ToolSvc.Sequenc... INFO Algorithm (millisec) | <user> | <clock> | min max sigma | entries | total (s) |
ToolSvc.Sequenc... INFO --------------------------------------------------------------------------------------------------
ToolSvc.Sequenc... INFO --------------------------------------------------------------------------------------------------
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
......@@ -598,15 +598,16 @@ private:
std::mutex m_lock; ///< for re-entrant Algs
bool m_filterPassed = true; ///< Filter passed flag
bool m_isExecuted = false; ///< Algorithm is executed flag
mutable bool m_toolHandlesInit = false; /// flag indicating whether ToolHandle tools have been added to m_tools
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::CONFIGURED; ///< Algorithm has been initialized flag
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::CONFIGURED; ///< Algorithm has been initialized flag
bool m_isFinalized; ///< Algorithm has been finalized flag
/// temporary flags to check if derived class's begin/endRun methods called
bool m_beginRunCalled;
bool m_endRunCalled;
/// implementation of service method
StatusCode service_i( const std::string& svcName, bool createIf, const InterfaceID& iid, void** ppSvc ) const;
StatusCode service_i( const std::string& svcType, const std::string& svcName, const InterfaceID& iid,
......
......@@ -10,6 +10,7 @@
#include "GaudiKernel/ClassID.h"
#include "GaudiKernel/IService.h"
#include <bitset>
#include <fcntl.h>
#include <functional>
#include <map>
......@@ -282,6 +283,7 @@ namespace Io
//
enum Action { OPEN = 0, CLOSE, REOPEN, OPEN_ERR, CLOSE_ERR, REOPEN_ERR, INVALID_ACTION };
using Action_bitmap = std::bitset<INVALID_ACTION + 1>;
inline std::ostream& operator<<( std::ostream& s, const Action& t )
{
......
......@@ -420,7 +420,7 @@ StatusCode Algorithm::sysBeginRun()
// Bypass the beginRun if the algorithm is disabled.
if ( !isEnabled() ) return StatusCode::SUCCESS;
warning() << "Algorithm::BeginRun is deprecated. Use Start instead" << endmsg;
m_beginRunCalled = true;
// lock the context service
Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr );
......@@ -461,12 +461,21 @@ StatusCode Algorithm::sysBeginRun()
Stat stat( chronoSvc(), "*UNKNOWN Exception*" );
sc = StatusCode::FAILURE;
}
if ( !isSequence() && m_beginRunCalled ) {
warning() << "Algorithm::BeginRun is deprecated. Use Start instead" << endmsg;
}
return sc;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
StatusCode Algorithm::beginRun() { return StatusCode::SUCCESS; }
StatusCode Algorithm::beginRun()
{
m_beginRunCalled = false;
return StatusCode::SUCCESS;
}
#pragma GCC diagnostic pop
// IAlgorithm implementation
......@@ -475,6 +484,7 @@ StatusCode Algorithm::sysEndRun()
// Bypass the endRun if the algorithm is disabled.
if ( !isEnabled() ) return StatusCode::SUCCESS;
m_endRunCalled = true;
// lock the context service
Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr );
......@@ -515,12 +525,21 @@ StatusCode Algorithm::sysEndRun()
Stat stat( chronoSvc(), "*UNKNOWN Exception*" );
sc = StatusCode::FAILURE;
}
if ( !isSequence() && m_endRunCalled ) {
warning() << "Algorithm::EndRun is deprecated. Use Stop instead" << endmsg;
}
return sc;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
StatusCode Algorithm::endRun() { return StatusCode::SUCCESS; }
StatusCode Algorithm::endRun()
{
m_endRunCalled = false;
return StatusCode::SUCCESS;
}
#pragma GCC diagnostic pop
StatusCode Algorithm::sysExecute( const EventContext& ctx )
......
......@@ -18,9 +18,6 @@ using namespace Io;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
namespace
{
bool get_bit( int f, unsigned int b ) { return f & ( 1 << b ); }
static const std::string s_empty = "";
constexpr struct to_name_t {
......@@ -137,8 +134,8 @@ StatusCode FileMgr::finalize()
if ( !m_files.empty() ) {
auto& log = warning();
log << "At finalize, the following files remained open:" << endl;
for ( const auto& itr : m_files ) log << *( itr.second ) << endl;
log << "At finalize, the following files remained open:\n";
for ( const auto& itr : m_files ) log << *( itr.second ) << '\n';
log << endmsg;
}
......@@ -152,14 +149,14 @@ StatusCode FileMgr::finalize()
debug() << "Saving log to \"" << m_logfile.value() << "\"" << endmsg;
for ( const auto& itr : m_files ) {
ofs << itr.second->name() << " " << itr.second->tech() << " " << itr.second->desc() << " "
<< itr.second->iflags() << endl;
<< itr.second->iflags() << '\n';
}
set<FileAttr> fs;
for ( const auto& it2 : m_oldFiles ) fs.insert( *it2 );
for ( const auto& it3 : fs ) {
ofs << it3.name() << " " << it3.tech() << " " << it3.desc() << " " << it3.iflags()
<< ( it3.isShared() ? " SHARED" : "" ) << endl;
<< ( it3.isShared() ? " SHARED" : "" ) << '\n';
}
ofs.close();
}
......@@ -389,8 +386,8 @@ open_t FileMgr::open( const IoTech& tech, const std::string& caller, const std::
r = 1;
} else {
warning() << "open call for file \"" << fname << "\" returned a pre-existing file with different"
<< " FileAttributes -" << endl
<< "old: " << *( itr->second ) << endl
<< " FileAttributes -\n"
<< "old: " << *( itr->second ) << '\n'
<< "new: " << *fa << endmsg;
r = 2;
}
......@@ -1026,10 +1023,10 @@ void* FileMgr::fptr( const Io::Fd& fd ) const
void FileMgr::listFiles() const
{
info() << "listing registered files [" << ( m_files.size() + m_oldFiles.size() ) << "]:" << endl;
info() << "listing registered files [" << ( m_files.size() + m_oldFiles.size() ) << "]:\n";
for ( auto& itr : m_files ) info() << itr.second << endl;
for ( auto& it2 : m_oldFiles ) info() << *it2 << endl;
for ( auto& itr : m_files ) info() << itr.second << '\n';
for ( auto& it2 : m_oldFiles ) info() << *it2 << '\n';
info() << endmsg;
}
......@@ -1088,9 +1085,9 @@ StatusCode FileMgr::getHandler( const std::string& fname, Io::FileHdlr& hdlr ) c
void FileMgr::listHandlers() const
{
info() << "Listing registered handlers:" << endl;
info() << "Listing registered handlers:\n";
for ( const auto& itr : m_handlers ) info() << " " << itr.first << endl;
for ( const auto& itr : m_handlers ) info() << " " << itr.first << '\n';
info() << endmsg;
}
......@@ -1120,7 +1117,7 @@ StatusCode FileMgr::regAction( bfcn_action_t bf, const Io::Action& a, const Io::
void FileMgr::listActions() const
{
info() << "listing registered actions" << endl;
info() << "listing registered actions\n";
for ( const auto& iit : m_actions ) {
Io::IoTech t = iit.first;
......@@ -1129,13 +1126,13 @@ void FileMgr::listActions() const
if ( !m.empty() ) {
info() << " --- Tech: ";
if ( t == Io::UNKNOWN ) {
info() << "ALL ---" << endl;
info() << "ALL ---\n";
} else {
info() << t << " ---" << endl;
info() << t << " ---\n";
}
for ( const auto& iia : m ) {
for ( const auto& it2 : iia.second ) {
info() << " " << iia.first << " " << it2.second << endl;
info() << " " << iia.first << " " << it2.second << '\n';
}
}
}
......@@ -1173,10 +1170,7 @@ StatusCode FileMgr::execActs( Io::FileAttr* fa, const std::string& caller, const
{
auto mitr = m.find( a );
if ( mitr == m.end() || mitr->second.empty() ) {
return StatusCode::SUCCESS;
}
if ( mitr == m.end() || mitr->second.empty() ) return StatusCode::SUCCESS;
ON_DEBUG
debug() << "executing " << mitr->second.size() << " " << a << " actions on " << *fa << " from " << caller << endmsg;
......@@ -1185,7 +1179,7 @@ StatusCode FileMgr::execActs( Io::FileAttr* fa, const std::string& caller, const
auto it2 = m_supMap.find( fa->name() );
if ( it2 != m_supMap.end() ) {
if ( get_bit( it2->second, a ) || get_bit( it2->second, Io::INVALID_ACTION ) ) {
if ( it2->second[a] || it2->second[Io::INVALID_ACTION] ) {
ON_DEBUG
debug() << " --> suppressing callback action for " << a << endmsg;
return StatusCode::SUCCESS;
......@@ -1210,7 +1204,6 @@ StatusCode FileMgr::execActs( Io::FileAttr* fa, const std::string& caller, const
bool FileMgr::accessMatch( const Io::IoFlags& fold, const Io::IoFlags& fnew, bool /*strict*/ ) const
{
ON_VERBOSE
verbose() << "accessMatch old: " << fold << " new: " << fnew << endmsg;
......@@ -1225,40 +1218,26 @@ void FileMgr::suppressAction( const std::string& f ) { return suppressAction( f,
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void FileMgr::suppressAction( const std::string& f, const Io::Action& a )
{
auto set_bit = []( int f, unsigned int b ) { return f | ( 1 << b ); };
auto i = m_supMap.find( f );
if ( i == m_supMap.end() ) {
m_supMap.emplace( f, set_bit( 0, a ) );
} else {
i->second = set_bit( i->second, a );
}
}
void FileMgr::suppressAction( const std::string& f, const Io::Action& a ) { m_supMap[f].set( a ); }
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void FileMgr::listSuppression() const
{
if ( m_supMap.empty() ) return;
info() << "listing suppressed file actions" << endl;
info() << "listing suppressed file actions\n";
for ( auto it2 = m_supMap.begin(); it2 != m_supMap.end(); ++it2 ) {
info() << " " << it2->first;
if ( get_bit( it2->second, Io::INVALID_ACTION ) ) {
info() << " ALL" << endl;
for ( const auto& sup : m_supMap ) {
info() << " " << sup.first;
if ( sup.second[Io::INVALID_ACTION] ) {
info() << " ALL\n";
} else {
for ( int i = 0; i < Io::INVALID_ACTION; ++i ) {
if ( get_bit( it2->second, i ) ) {
info() << " " << (Io::Action)i;
}
for ( unsigned i = 0; i != sup.second.size(); ++i ) {
if ( sup.second[i] ) info() << " " << (Io::Action)i;
}
info() << endl;
info() << '\n';
}
}
info() << endmsg;
}
......@@ -143,8 +143,7 @@ private:
std::map<IoTech, actionMap> m_actions;
typedef std::map<std::string, int> supMap;
supMap m_supMap;
std::map<std::string, Io::Action_bitmap> m_supMap;
std::string m_lastErrS;
int m_lastErr;
......