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
  • 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
83 results
Show changes
Commits on Source (14)
Showing
with 155 additions and 162 deletions
...@@ -60,7 +60,7 @@ coding-conventions: ...@@ -60,7 +60,7 @@ coding-conventions:
stage: test stage: test
script: script:
- export LCG_release_area=${LCG_release_area}:/cvmfs/lhcb.cern.ch/lib/lcg/external - export LCG_release_area=${LCG_release_area}:/cvmfs/lhcb.cern.ch/lib/lcg/external
- sudo pip install autopep8 - sudo pip install autopep8==1.3.5
- make BUILDDIR=build apply-formatting - make BUILDDIR=build apply-formatting
- git diff > apply-formatting.patch - git diff > apply-formatting.patch
- git diff --stat --exit-code - git diff --stat --exit-code
......
...@@ -15,7 +15,7 @@ packages = ['GaudiCoreSvc', 'GaudiCommonSvc', 'GaudiSvc', 'GaudiAlg', ...@@ -15,7 +15,7 @@ packages = ['GaudiCoreSvc', 'GaudiCommonSvc', 'GaudiSvc', 'GaudiAlg',
'GaudiAud', 'GaudiPoolDb', 'RootHistCnv', 'GaudiUtils', 'GaudiAud', 'GaudiPoolDb', 'RootHistCnv', 'GaudiUtils',
'RootCnv'] 'RootCnv']
#--Loop open all listed packages and populate __all__ with the names and # --Loop open all listed packages and populate __all__ with the names and
# the local scope with the Configurable classes # the local scope with the Configurable classes
for package in packages: for package in packages:
try: try:
...@@ -30,7 +30,7 @@ for package in packages: ...@@ -30,7 +30,7 @@ for package in packages:
# ignore the configurables from missing packages. # ignore the configurables from missing packages.
pass pass
#--Fix some of the name idiosyncrasies in Gaudi # --Fix some of the name idiosyncrasies in Gaudi
aliases = { aliases = {
'EventDataSvc': 'EvtDataSvc', 'EventDataSvc': 'EvtDataSvc',
'DetectorDataSvc': 'DetDataSvc', 'DetectorDataSvc': 'DetDataSvc',
......
...@@ -228,7 +228,7 @@ class gaudimain(object): ...@@ -228,7 +228,7 @@ class gaudimain(object):
return "\n".join(out) return "\n".join(out)
def _writepickle(self, filename): def _writepickle(self, filename):
#--- Lets take the first file input file as the name of the pickle file # --- Lets take the first file input file as the name of the pickle file
import pickle import pickle
output = open(filename, 'wb') output = open(filename, 'wb')
# Dump only the the configurables that make sense to dump (not User ones) # Dump only the the configurables that make sense to dump (not User ones)
...@@ -379,7 +379,7 @@ class gaudimain(object): ...@@ -379,7 +379,7 @@ class gaudimain(object):
self.log.debug('gaudiPythonInit: done') self.log.debug('gaudiPythonInit: done')
def runSerial(self, attach_debugger): def runSerial(self, attach_debugger):
#--- Instantiate the ApplicationMgr------------------------------ # --- Instantiate the ApplicationMgr------------------------------
if (self.mainLoop or if (self.mainLoop or
os.environ.get('GAUDIRUN_USE_GAUDIPYTHON')): os.environ.get('GAUDIRUN_USE_GAUDIPYTHON')):
self.gaudiPythonInit() self.gaudiPythonInit()
......
...@@ -119,7 +119,7 @@ def getArgsFromQmt(qmtfile): ...@@ -119,7 +119,7 @@ def getArgsFromQmt(qmtfile):
return args return args
#--------------------------------------------------------------------- # ---------------------------------------------------------------------
if __name__ == "__main__": if __name__ == "__main__":
# ensure that we (and the subprocesses) use the C standard localization # ensure that we (and the subprocesses) use the C standard localization
if os.environ.get('LC_ALL') != 'C': if os.environ.get('LC_ALL') != 'C':
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "GaudiAlg/FunctionalDetails.h" #include "GaudiAlg/FunctionalDetails.h"
#include "GaudiAlg/FunctionalUtilities.h" #include "GaudiAlg/FunctionalUtilities.h"
#include "GaudiKernel/apply.h"
#include <utility> #include <utility>
namespace Gaudi namespace Gaudi
...@@ -23,7 +24,7 @@ namespace Gaudi ...@@ -23,7 +24,7 @@ namespace Gaudi
StatusCode execute() override final StatusCode execute() override final
{ {
try { try {
invoke( std::index_sequence_for<In...>{} ); Gaudi::apply( [&]( const auto&... i ) { ( *this )( details::deref( i.get() )... ); }, this->m_inputs );
} catch ( GaudiException& e ) { } catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg; ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
return e.code(); return e.code();
...@@ -33,13 +34,6 @@ namespace Gaudi ...@@ -33,13 +34,6 @@ namespace Gaudi
// ... instead, they must implement the following operator // ... instead, they must implement the following operator
virtual void operator()( const In&... ) const = 0; virtual void operator()( const In&... ) const = 0;
private:
template <std::size_t... I>
void invoke( std::index_sequence<I...> ) const
{
( *this )( details::deref( std::get<I>( this->m_inputs ).get() )... );
}
}; };
} }
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "GaudiAlg/FunctionalDetails.h" #include "GaudiAlg/FunctionalDetails.h"
#include "GaudiAlg/FunctionalUtilities.h" #include "GaudiAlg/FunctionalUtilities.h"
#include "GaudiKernel/apply.h"
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
...@@ -25,7 +26,9 @@ namespace Gaudi ...@@ -25,7 +26,9 @@ namespace Gaudi
StatusCode execute() override final StatusCode execute() override final
{ {
try { try {
invoke( std::index_sequence_for<In...>{} ); this->setFilterPassed( Gaudi::apply(
[&]( auto&... handles ) { return details::as_const( *this )( details::deref( handles.get() )... ); },
this->m_inputs ) );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} catch ( GaudiException& e ) { } catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg; ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
...@@ -35,15 +38,6 @@ namespace Gaudi ...@@ -35,15 +38,6 @@ namespace Gaudi
// ... instead, they must implement the following operator // ... instead, they must implement the following operator
virtual bool operator()( const In&... ) const = 0; virtual bool operator()( const In&... ) const = 0;
private:
// note: invoke is not const, as setFilterPassed is not (yet!) const
template <std::size_t... I>
void invoke( std::index_sequence<I...> )
{
auto pass = details::as_const( *this )( details::deref( std::get<I>( this->m_inputs ).get() )... );
this->setFilterPassed( pass );
}
}; };
} }
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "GaudiAlg/FunctionalDetails.h" #include "GaudiAlg/FunctionalDetails.h"
#include "GaudiAlg/FunctionalUtilities.h" #include "GaudiAlg/FunctionalUtilities.h"
#include "GaudiKernel/apply.h"
#include <utility> #include <utility>
namespace Gaudi namespace Gaudi
...@@ -23,7 +24,20 @@ namespace Gaudi ...@@ -23,7 +24,20 @@ namespace Gaudi
StatusCode execute() override final StatusCode execute() override final
{ {
try { try {
invoke( std::index_sequence_for<Out...>{} ); Gaudi::apply(
[&]( auto&... ohandle ) {
Gaudi::apply(
[&ohandle...]( auto&&... data ) {
#if __cplusplus < 201703L
(void)std::initializer_list<int>{
( details::put( ohandle, std::forward<decltype( data )>( data ) ), 0 )...};
#else
( details::put( ohandle, std::forward<decltype( data )>( data ) ), ... );
#endif
},
details::as_const( *this )() );
},
this->m_outputs );
} catch ( GaudiException& e ) { } catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg; ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
return e.code(); return e.code();
...@@ -33,14 +47,6 @@ namespace Gaudi ...@@ -33,14 +47,6 @@ namespace Gaudi
// ... instead, they must implement the following operator // ... instead, they must implement the following operator
virtual std::tuple<Out...> operator()() const = 0; virtual std::tuple<Out...> operator()() const = 0;
private:
template <std::size_t... O>
void invoke( std::index_sequence<O...> )
{
std::initializer_list<int>{
( details::put( std::get<O>( this->m_outputs ), std::get<O>( details::as_const( *this )() ) ), 0 )...};
}
}; };
template <typename Out, typename Traits_> template <typename Out, typename Traits_>
...@@ -51,10 +57,8 @@ namespace Gaudi ...@@ -51,10 +57,8 @@ namespace Gaudi
// derived classes are NOT allowed to implement execute ... // derived classes are NOT allowed to implement execute ...
StatusCode execute() override final StatusCode execute() override final
{ {
using details::as_const;
using details::put;
try { try {
put( std::get<0>( this->m_outputs ), as_const( *this )() ); details::put( std::get<0>( this->m_outputs ), details::as_const( *this )() );
} catch ( GaudiException& e ) { } catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg; ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
return e.code(); return e.code();
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define SCALAR_TRANSFORMER_H #define SCALAR_TRANSFORMER_H
#include "GaudiAlg/Transformer.h" #include "GaudiAlg/Transformer.h"
#include <utility>
namespace Gaudi namespace Gaudi
{ {
...@@ -19,14 +18,6 @@ namespace Gaudi ...@@ -19,14 +18,6 @@ namespace Gaudi
/// Access the scalar operator /// Access the scalar operator
const ScalarOp& scalarOp() const { return static_cast<const ScalarOp&>( *this ); } const ScalarOp& scalarOp() const { return static_cast<const ScalarOp&>( *this ); }
private:
/// Call the scalar operator with the objects obtained from the given tuple
template <typename Tuple, typename Scalar, std::size_t... I>
inline decltype( auto ) getScalar( const Tuple& t, const Scalar& s, std::index_sequence<I...> ) const
{
return s( details::deref( std::get<I>( t ) )... );
}
public: public:
using Transformer<Out( const In&... ), Traits_>::Transformer; using Transformer<Out( const In&... ), Traits_>::Transformer;
...@@ -37,10 +28,12 @@ namespace Gaudi ...@@ -37,10 +28,12 @@ namespace Gaudi
Out out; Out out;
out.reserve( inrange.size() ); out.reserve( inrange.size() );
auto& scalar = scalarOp(); auto& scalar = scalarOp();
for ( const auto&& i : inrange ) { for ( const auto&& tuple : inrange ) {
details::insert( out, getScalar( i, scalar, std::index_sequence_for<In...>{} ) ); /// Call the scalar operator with the objects obtained from the given tuple as arguments
details::insert(
out, Gaudi::apply( [&]( const auto&... i ) { return scalar( details::deref( i )... ); }, tuple ) );
} }
details::applyPostProcessing( scalar, out ); // awaiting a post-processor call details::applyPostProcessing( scalar, out );
return out; return out;
} }
}; };
...@@ -56,31 +49,6 @@ namespace Gaudi ...@@ -56,31 +49,6 @@ namespace Gaudi
/// Access the scalar operator /// Access the scalar operator
const ScalarOp& scalarOp() const { return static_cast<const ScalarOp&>( *this ); } const ScalarOp& scalarOp() const { return static_cast<const ScalarOp&>( *this ); }
private:
/// Reserve the given size in all output containers
template <typename Tuple, std::size_t... I>
inline void reserve( Tuple& t, const std::size_t resSize, std::index_sequence<I...> ) const
{
std::initializer_list<long unsigned int>{( std::get<I>( t ).reserve( resSize ), I )...};
}
/// Call the scalar operator with the objects obtained from the given tuple
template <typename Tuple, typename Scalar, std::size_t... I>
inline decltype( auto ) getScalar( const Tuple& t, const Scalar& s, std::index_sequence<I...> ) const
{
return s( details::deref( std::get<I>( t ) )... );
}
/// Insert the returned tuple of objects into the correct containers
template <typename InTuple, typename OutTuple, std::size_t... I>
void insert( InTuple&& in, OutTuple& out, std::index_sequence<I...> ) const
{
if ( in ) {
std::initializer_list<long unsigned int>{
( details::insert( std::get<I>( out ), std::move( std::get<I>( *in ) ) ), I )...};
}
}
public: public:
using MultiTransformer<std::tuple<Out...>( const In&... ), Traits_>::MultiTransformer; using MultiTransformer<std::tuple<Out...>( const In&... ), Traits_>::MultiTransformer;
...@@ -89,10 +57,36 @@ namespace Gaudi ...@@ -89,10 +57,36 @@ namespace Gaudi
{ {
const auto inrange = details::zip::const_range( in... ); const auto inrange = details::zip::const_range( in... );
std::tuple<Out...> out; std::tuple<Out...> out;
reserve( out, inrange.size(), std::index_sequence_for<Out...>{} ); Gaudi::apply(
[sz = inrange.size()]( auto&&... o ) {
#if __cplusplus < 201703L
(void)std::initializer_list<int>{( o.reserve( sz ), 0 )...};
#else
( o.reserve( sz ), ... );
#endif
},
out );
auto& scalar = scalarOp(); auto& scalar = scalarOp();
for ( const auto&& i : inrange ) { for ( const auto&& tuple : inrange ) {
insert( getScalar( i, scalar, std::index_sequence_for<In...>{} ), out, std::index_sequence_for<Out...>{} ); Gaudi::apply(
[&scalar, &tuple]( auto&... out ) {
/// Call the scalar operator with the objects obtained from the given tuple
auto data = Gaudi::apply(
[&scalar]( const auto&... args ) { return scalar( details::deref( args )... ); }, tuple );
if ( data ) {
Gaudi::apply(
[&out...]( auto&&... data ) {
#if __cplusplus < 201703L
(void)std::initializer_list<int>{
( details::insert( out, std::forward<decltype( data )>( data ) ), 0 )...};
#else
( details::insert( out, std::forward<decltype( data )>( data ) ), ... );
#endif
},
std::move( *data ) );
}
},
out );
} }
details::applyPostProcessing( scalar, out ); // awaiting a post-processor call details::applyPostProcessing( scalar, out ); // awaiting a post-processor call
return out; return out;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "GaudiAlg/FunctionalDetails.h" #include "GaudiAlg/FunctionalDetails.h"
#include "GaudiAlg/FunctionalUtilities.h" #include "GaudiAlg/FunctionalUtilities.h"
#include "GaudiKernel/apply.h"
namespace Gaudi namespace Gaudi
{ {
...@@ -51,7 +52,16 @@ namespace Gaudi ...@@ -51,7 +52,16 @@ namespace Gaudi
StatusCode execute() override final StatusCode execute() override final
{ {
try { try {
invoke( std::index_sequence_for<In...>{} ); // TODO:FIXME: how does operator() know the number and order of expected outputs?
using details::as_const;
auto out = Gaudi::apply(
[&]( auto&... ihandle ) { return as_const( *this )( as_const( *ihandle.get() )... ); }, this->m_inputs );
if ( out.size() != m_outputs.size() ) {
throw GaudiException( "Error during transform: expected " + std::to_string( m_outputs.size() ) +
" containers, got " + std::to_string( out.size() ) + " instead",
this->name(), StatusCode::FAILURE );
}
for ( unsigned i = 0; i != out.size(); ++i ) details::put( m_outputs[i], std::move( out[i] ) );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} catch ( GaudiException& e ) { } catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg; ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
...@@ -65,19 +75,6 @@ namespace Gaudi ...@@ -65,19 +75,6 @@ namespace Gaudi
virtual vector_of_<Out> operator()( const In&... ) const = 0; virtual vector_of_<Out> operator()( const In&... ) const = 0;
private: private:
template <std::size_t... I>
void invoke( std::index_sequence<I...> )
{
// TODO:FIXME: how does operator() know the number and order of expected outputs?
using details::as_const;
auto out = as_const( *this )( as_const( *std::get<I>( this->m_inputs ).get() )... );
if ( out.size() != m_outputs.size() ) {
throw GaudiException( "Error during transform: expected " + std::to_string( m_outputs.size() ) +
" containers, got " + std::to_string( out.size() ) + " instead",
this->name(), StatusCode::FAILURE );
}
for ( unsigned i = 0; i != out.size(); ++i ) details::put( m_outputs[i], std::move( out[i] ) );
}
template <typename T> template <typename T>
using OutputHandle = details::OutputHandle_t<Traits_, details::remove_optional_t<T>>; using OutputHandle = details::OutputHandle_t<Traits_, details::remove_optional_t<T>>;
std::vector<std::string> m_outputLocations; // TODO/FIXME for now: use a call-back to update the actual handles! std::vector<std::string> m_outputLocations; // TODO/FIXME for now: use a call-back to update the actual handles!
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "GaudiAlg/FunctionalDetails.h" #include "GaudiAlg/FunctionalDetails.h"
#include "GaudiAlg/FunctionalUtilities.h" #include "GaudiAlg/FunctionalUtilities.h"
#include "GaudiKernel/GaudiException.h" #include "GaudiKernel/GaudiException.h"
#include "GaudiKernel/apply.h"
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
...@@ -33,7 +34,12 @@ namespace Gaudi ...@@ -33,7 +34,12 @@ namespace Gaudi
StatusCode execute() override final StatusCode execute() override final
{ {
try { try {
invoke( std::index_sequence_for<In...>{} ); Gaudi::apply(
[&]( const auto&... i ) {
details::put( std::get<0>( this->m_outputs ),
details::as_const( *this )( details::deref( i.get() )... ) );
},
this->m_inputs );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} catch ( GaudiException& e ) { } catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg; ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
...@@ -43,14 +49,6 @@ namespace Gaudi ...@@ -43,14 +49,6 @@ namespace Gaudi
// instead they MUST implement this operator // instead they MUST implement this operator
virtual Out operator()( const In&... ) const = 0; virtual Out operator()( const In&... ) const = 0;
private:
template <std::size_t... I>
void invoke( std::index_sequence<I...> )
{
details::put( std::get<0>( this->m_outputs ),
details::as_const( *this )( details::deref( std::get<I>( this->m_inputs ).get() )... ) );
}
}; };
// //
...@@ -70,7 +68,24 @@ namespace Gaudi ...@@ -70,7 +68,24 @@ namespace Gaudi
StatusCode execute() override final StatusCode execute() override final
{ {
try { try {
invoke( std::index_sequence_for<In...>{}, std::index_sequence_for<Out...>{} ); Gaudi::apply(
[&]( auto&... ohandle ) {
Gaudi::apply(
[&ohandle...]( auto&&... data ) {
#if __cplusplus < 201703L
(void)std::initializer_list<int>{
( details::put( ohandle, std::forward<decltype( data )>( data ) ), 0 )...};
#else
( details::put( ohandle, std::forward<decltype( data )>( data ) ), ... );
#endif
},
Gaudi::apply(
[&]( auto&... ihandle ) {
return details::as_const( *this )( details::deref( ihandle.get() )... );
},
this->m_inputs ) );
},
this->m_outputs );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} catch ( GaudiException& e ) { } catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg; ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
...@@ -80,19 +95,6 @@ namespace Gaudi ...@@ -80,19 +95,6 @@ namespace Gaudi
// instead they MUST implement this operator // instead they MUST implement this operator
virtual std::tuple<Out...> operator()( const In&... ) const = 0; virtual std::tuple<Out...> operator()( const In&... ) const = 0;
private:
template <std::size_t... I, std::size_t... O>
void invoke( std::index_sequence<I...>, std::index_sequence<O...> )
{
auto out = details::as_const( *this )( details::deref( std::get<I>( this->m_inputs ).get() )... );
#if __cplusplus < 201703L
(void)std::initializer_list<int>{
( details::put( std::get<O>( this->m_outputs ), std::get<O>( std::move( out ) ) ), 0 )...};
#else
( details::put( std::get<O>( this->m_outputs ), std::get<O>( std::move( out ) ) ), ... );
#endif
}
}; };
// //
...@@ -112,7 +114,25 @@ namespace Gaudi ...@@ -112,7 +114,25 @@ namespace Gaudi
StatusCode execute() override final StatusCode execute() override final
{ {
try { try {
invoke( std::index_sequence_for<In...>{}, std::index_sequence_for<Out...>{} ); Gaudi::apply(
[&]( auto&... ohandle ) {
Gaudi::apply(
[&ohandle..., this]( bool passed, auto&&... data ) {
this->setFilterPassed( passed );
#if __cplusplus < 201703L
(void)std::initializer_list<int>{
( details::put( ohandle, std::forward<decltype( data )>( data ) ), 0 )...};
#else
( details::put( ohandle, std::forward<decltype( data )>( data ) ), ... );
#endif
},
Gaudi::apply(
[&]( auto&... ihandle ) {
return details::as_const( *this )( details::deref( ihandle.get() )... );
},
this->m_inputs ) );
},
this->m_outputs );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} catch ( GaudiException& e ) { } catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg; ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
...@@ -122,16 +142,6 @@ namespace Gaudi ...@@ -122,16 +142,6 @@ namespace Gaudi
// instead they MUST implement this operator // instead they MUST implement this operator
virtual std::tuple<bool, Out...> operator()( const In&... ) const = 0; virtual std::tuple<bool, Out...> operator()( const In&... ) const = 0;
private:
template <std::size_t... I, std::size_t... O>
void invoke( std::index_sequence<I...>, std::index_sequence<O...> )
{
auto out = details::as_const( *this )( details::deref( std::get<I>( this->m_inputs ).get() )... );
this->setFilterPassed( std::get<0>( out ) );
(void)std::initializer_list<int>{
( details::put( std::get<O>( this->m_outputs ), std::get<O + 1>( std::move( out ) ) ), 0 )...};
}
}; };
} }
} }
......
############################################################### ###############################################################
# Job options file # Job options file
#============================================================== # ==============================================================
from Gaudi.Configuration import * from Gaudi.Configuration import *
from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAuditor from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAuditor
...@@ -8,9 +8,9 @@ from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAu ...@@ -8,9 +8,9 @@ from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAu
from Configurables import GaudiExamplesCommonConf from Configurables import GaudiExamplesCommonConf
GaudiExamplesCommonConf() GaudiExamplesCommonConf()
#-------------------------------------------------------------- # --------------------------------------------------------------
# Testing Sequencers # Testing Sequencers
#-------------------------------------------------------------- # --------------------------------------------------------------
p1 = Prescaler('Prescaler1', PercentPass=50., OutputLevel=WARNING) p1 = Prescaler('Prescaler1', PercentPass=50., OutputLevel=WARNING)
p2 = Prescaler('Prescaler2', PercentPass=10., OutputLevel=WARNING) p2 = Prescaler('Prescaler2', PercentPass=10., OutputLevel=WARNING)
h = HelloWorld(OutputLevel=DEBUG) h = HelloWorld(OutputLevel=DEBUG)
...@@ -20,9 +20,9 @@ s1 = Sequencer('Sequence1', Members=[p1, h, c1]) ...@@ -20,9 +20,9 @@ s1 = Sequencer('Sequence1', Members=[p1, h, c1])
s2 = Sequencer('Sequence2', Members=[p2, h, c2]) s2 = Sequencer('Sequence2', Members=[p2, h, c2])
top = Sequencer('TopSequence', Members=[s1, s2], StopOverride=True) top = Sequencer('TopSequence', Members=[s1, s2], StopOverride=True)
#----------------------------------------------------------------- # -----------------------------------------------------------------
# Testing the new GaudiSequencer # Testing the new GaudiSequencer
#----------------------------------------------------------------- # -----------------------------------------------------------------
sand = GaudiSequencer('ANDSequence', sand = GaudiSequencer('ANDSequence',
Members=[HelloWorld('AND'), EventCounter('ANDCounter')], Members=[HelloWorld('AND'), EventCounter('ANDCounter')],
MeasureTime=1) MeasureTime=1)
...@@ -31,7 +31,7 @@ sor = GaudiSequencer('ORSequence', ...@@ -31,7 +31,7 @@ sor = GaudiSequencer('ORSequence',
MeasureTime=1, MeasureTime=1,
ModeOR=1) ModeOR=1)
#----------------------------------------------------------------- # -----------------------------------------------------------------
ApplicationMgr(TopAlg=[ParentAlg(), StopperAlg(StopCount=20), ApplicationMgr(TopAlg=[ParentAlg(), StopperAlg(StopCount=20),
top, sand, sor], top, sand, sor],
EvtMax=10, # events to be processed (default is 10) EvtMax=10, # events to be processed (default is 10)
......
############################################################### ###############################################################
# Job options file # Job options file
#============================================================== # ==============================================================
from Gaudi.Configuration import * from Gaudi.Configuration import *
from Configurables import MyAlgorithm, MyTool, MyGaudiAlgorithm from Configurables import MyAlgorithm, MyTool, MyGaudiAlgorithm
...@@ -58,9 +58,9 @@ ApplicationMgr(EvtMax=10, ...@@ -58,9 +58,9 @@ ApplicationMgr(EvtMax=10,
EvtSel='NONE', EvtSel='NONE',
HistogramPersistency='NONE', HistogramPersistency='NONE',
TopAlg=[myalg, mygalg]) TopAlg=[myalg, mygalg])
#-------------------------------------------------------------- # --------------------------------------------------------------
# Test circular tool dependencies (by Chris Jones) # Test circular tool dependencies (by Chris Jones)
#-------------------------------------------------------------- # --------------------------------------------------------------
from Configurables import TestToolAlg, TestTool from Configurables import TestToolAlg, TestTool
tA = TestTool('ToolA', Tools=['TestTool/ToolB'], OutputLevel=DEBUG) tA = TestTool('ToolA', Tools=['TestTool/ToolB'], OutputLevel=DEBUG)
......
############################################################### ###############################################################
# Job options file # Job options file
#============================================================== # ==============================================================
from Gaudi.Configuration import * from Gaudi.Configuration import *
from Configurables import MyAlgorithm, MyGaudiAlgorithm, ToolSvc, AlgResourcePool, HiveSlimEventLoopMgr, HiveWhiteBoard from Configurables import MyAlgorithm, MyGaudiAlgorithm, ToolSvc, AlgResourcePool, HiveSlimEventLoopMgr, HiveWhiteBoard
......
############################################################### ###############################################################
# Job options file # Job options file
#============================================================== # ==============================================================
from Gaudi.Configuration import * from Gaudi.Configuration import *
from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAuditor from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAuditor
...@@ -11,9 +11,9 @@ from GaudiConfig.ControlFlow import seq ...@@ -11,9 +11,9 @@ from GaudiConfig.ControlFlow import seq
from Configurables import GaudiExamplesCommonConf from Configurables import GaudiExamplesCommonConf
GaudiExamplesCommonConf() GaudiExamplesCommonConf()
#-------------------------------------------------------------- # --------------------------------------------------------------
# Testing Sequencers # Testing Sequencers
#-------------------------------------------------------------- # --------------------------------------------------------------
p1 = Prescaler('Prescaler1', PercentPass=50., OutputLevel=WARNING) p1 = Prescaler('Prescaler1', PercentPass=50., OutputLevel=WARNING)
p2 = Prescaler('Prescaler2', PercentPass=10., OutputLevel=WARNING) p2 = Prescaler('Prescaler2', PercentPass=10., OutputLevel=WARNING)
h = HelloWorld(OutputLevel=DEBUG) h = HelloWorld(OutputLevel=DEBUG)
...@@ -27,9 +27,9 @@ top = s1 >> s2 ...@@ -27,9 +27,9 @@ top = s1 >> s2
#s2 = Sequencer('Sequence2', Members = [p2, h, c2] ) #s2 = Sequencer('Sequence2', Members = [p2, h, c2] )
#top = Sequencer('TopSequence', Members = [s1, s2], StopOverride = True ) #top = Sequencer('TopSequence', Members = [s1, s2], StopOverride = True )
#----------------------------------------------------------------- # -----------------------------------------------------------------
# Testing the new GaudiSequencer # Testing the new GaudiSequencer
#----------------------------------------------------------------- # -----------------------------------------------------------------
sand = HelloWorld('AND') & EventCounter('ANDCounter') sand = HelloWorld('AND') & EventCounter('ANDCounter')
sor = HelloWorld('OR') | EventCounter('ORCounter') sor = HelloWorld('OR') | EventCounter('ORCounter')
# sand = GaudiSequencer( 'ANDSequence', # sand = GaudiSequencer( 'ANDSequence',
...@@ -46,7 +46,7 @@ print '# --- Configured Control Flow Expression:' ...@@ -46,7 +46,7 @@ print '# --- Configured Control Flow Expression:'
print '#', all print '#', all
print '# ---' print '# ---'
EventLoopMgr(PrintControlFlowExpression=True) EventLoopMgr(PrintControlFlowExpression=True)
#----------------------------------------------------------------- # -----------------------------------------------------------------
ApplicationMgr(TopAlg=[all], ApplicationMgr(TopAlg=[all],
EvtMax=10, # events to be processed (default is 10) EvtMax=10, # events to be processed (default is 10)
EvtSel='NONE', # do not use any event input EvtSel='NONE', # do not use any event input
......
#!/usr/bin/env gaudirun.py #!/usr/bin/env gaudirun.py
############################################################### ###############################################################
# Job options file # Job options file
#============================================================== # ==============================================================
from Gaudi.Configuration import * from Gaudi.Configuration import *
from Configurables import MyDataAlgorithm, DataCreator from Configurables import MyDataAlgorithm, DataCreator
......
#/////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////
# Job Options File in Python # Job Options File in Python
theApp.TopAlg = ['RandomNumberAlg'] theApp.TopAlg = ['RandomNumberAlg']
...@@ -8,15 +8,15 @@ MessageSvc = Service('MessageSvc') ...@@ -8,15 +8,15 @@ MessageSvc = Service('MessageSvc')
MessageSvc.OutputLevel = 3 MessageSvc.OutputLevel = 3
#-------------------------------------------------------------- # --------------------------------------------------------------
# Event related parameters # Event related parameters
#-------------------------------------------------------------- # --------------------------------------------------------------
theApp.EvtMax = 100 theApp.EvtMax = 100
theApp.EvtSel = "NONE" theApp.EvtSel = "NONE"
#-------------------------------------------------------------- # --------------------------------------------------------------
# Other Service Options # Other Service Options
#-------------------------------------------------------------- # --------------------------------------------------------------
# Histogram output file # Histogram output file
theApp.HistogramPersistency = 'ROOT' theApp.HistogramPersistency = 'ROOT'
......
############################################################### ###############################################################
# Job options file # Job options file
#============================================================== # ==============================================================
from Gaudi.Configuration import * from Gaudi.Configuration import *
from Configurables import MyGaudiAlgorithm from Configurables import MyGaudiAlgorithm
......
...@@ -12,9 +12,9 @@ importOptions("optsub1/dummy1.opts") ...@@ -12,9 +12,9 @@ importOptions("optsub1/dummy1.opts")
from Configurables import PropertyAlg, PropertyProxy from Configurables import PropertyAlg, PropertyProxy
#-------------------------------------------------------------- # --------------------------------------------------------------
# Algorithms Private Options # Algorithms Private Options
#-------------------------------------------------------------- # --------------------------------------------------------------
alg = PropertyAlg(OutputLevel=3, alg = PropertyAlg(OutputLevel=3,
Int=101, Int=101,
...@@ -58,9 +58,9 @@ alg = PropertyAlg(OutputLevel=3, ...@@ -58,9 +58,9 @@ alg = PropertyAlg(OutputLevel=3,
#proxy = PropertyProxy(String = "This is set by the proxy") #proxy = PropertyProxy(String = "This is set by the proxy")
proxy = PropertyProxy() proxy = PropertyProxy()
#-------------------------------------------------------------- # --------------------------------------------------------------
# Private Application Configuration options # Private Application Configuration options
#-------------------------------------------------------------- # --------------------------------------------------------------
app = ApplicationMgr() app = ApplicationMgr()
app.TopAlg = [alg] app.TopAlg = [alg]
# test for the multiple inclusion of the same alg # test for the multiple inclusion of the same alg
...@@ -68,16 +68,16 @@ app.TopAlg += [alg, proxy] ...@@ -68,16 +68,16 @@ app.TopAlg += [alg, proxy]
# test for the removal of an algorithm # test for the removal of an algorithm
app.TopAlg.remove(alg) app.TopAlg.remove(alg)
#-------------------------------------------------------------- # --------------------------------------------------------------
# Event related parameters # Event related parameters
#-------------------------------------------------------------- # --------------------------------------------------------------
app.EvtMax = 1 # events to be processed (default is 10) app.EvtMax = 1 # events to be processed (default is 10)
app.EvtSel = "NONE" # do not use any event input app.EvtSel = "NONE" # do not use any event input
app.HistogramPersistency = "NONE" app.HistogramPersistency = "NONE"
#-------------------------------------------------------------- # --------------------------------------------------------------
# MessageSvc Properties testing # MessageSvc Properties testing
#-------------------------------------------------------------- # --------------------------------------------------------------
msgSvc = MessageSvc() msgSvc = MessageSvc()
msgSvc.setDebug += ["EventLoopMgr"] msgSvc.setDebug += ["EventLoopMgr"]
msgSvc.setVerbose += ["MsgTest"] msgSvc.setVerbose += ["MsgTest"]
......
############################################################### ###############################################################
# Job options file # Job options file
#============================================================== # ==============================================================
from Gaudi.Configuration import * from Gaudi.Configuration import *
from Configurables import TAlgIS, TAlgDB, TemplatedAlg_int_std__vector_std__string_std__allocator_std__string_s_s_, TemplatedAlg_double_bool_ from Configurables import TAlgIS, TAlgDB, TemplatedAlg_int_std__vector_std__string_std__allocator_std__string_s_s_, TemplatedAlg_double_bool_
...@@ -14,7 +14,7 @@ is2 = TAlgIS('TAlgIS2', TProperty=100, RProperty=['string1', 'string2']) ...@@ -14,7 +14,7 @@ is2 = TAlgIS('TAlgIS2', TProperty=100, RProperty=['string1', 'string2'])
db1 = TemplatedAlg_double_bool_('TAlgDB1', TProperty=10.10, RProperty=True) db1 = TemplatedAlg_double_bool_('TAlgDB1', TProperty=10.10, RProperty=True)
db2 = TAlgDB('TAlgDB2', TProperty=10.10, RProperty=True) db2 = TAlgDB('TAlgDB2', TProperty=10.10, RProperty=True)
#----------------------------------------------------------------- # -----------------------------------------------------------------
ApplicationMgr(TopAlg=[is1, is2, db1, db2], ApplicationMgr(TopAlg=[is1, is2, db1, db2],
EvtMax=10, # events to be processed (default is 10) EvtMax=10, # events to be processed (default is 10)
EvtSel='NONE', # do not use any event input EvtSel='NONE', # do not use any event input
......
############################################################### ###############################################################
# Job options file # Job options file
#============================================================== # ==============================================================
from Gaudi.Configuration import * from Gaudi.Configuration import *
importOptions('AlgSequencer.py') importOptions('AlgSequencer.py')
#-------------------------------------------------------------- # --------------------------------------------------------------
# Enable Timing Histograms # Enable Timing Histograms
#-------------------------------------------------------------- # --------------------------------------------------------------
from Configurables import TimingAuditor, SequencerTimerTool from Configurables import TimingAuditor, SequencerTimerTool
TIMER = TimingAuditor("TIMER") TIMER = TimingAuditor("TIMER")
TIMER.addTool(SequencerTimerTool, name="TIMER") TIMER.addTool(SequencerTimerTool, name="TIMER")
TIMER.TIMER.HistoProduce = True TIMER.TIMER.HistoProduce = True
#-------------------------------------------------------------- # --------------------------------------------------------------
# Enable histograms output # Enable histograms output
#-------------------------------------------------------------- # --------------------------------------------------------------
RootHistSvc().OutputFile = 'timing_histos.root' RootHistSvc().OutputFile = 'timing_histos.root'
ApplicationMgr(HistogramPersistency='ROOT') ApplicationMgr(HistogramPersistency='ROOT')