Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaudi
Gaudi
Commits
710844c5
Commit
710844c5
authored
5 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
non-reentrant interfaces for GaudiPython
see
#75
parent
da4ff18d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!973
Misc fixes for GaudiMP
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiPython/python/GaudiPython/Pythonizations.py
+31
-0
31 additions, 0 deletions
GaudiPython/python/GaudiPython/Pythonizations.py
with
31 additions
and
0 deletions
GaudiPython/python/GaudiPython/Pythonizations.py
+
31
−
0
View file @
710844c5
...
...
@@ -518,3 +518,34 @@ if six.PY2:
else
:
# Behaviour is like Python 3+ dict
gbl
.
Gaudi
.
Utils
.
MapBase
.
items
=
__mapbase_iteritems__
#############################################################################
# Helpers for re-entrant interfaces
##############################################################################
# GaudiPython is inherently single threaded and it's unpractical to use the
# new re-entrant interfaces. Moreover a lot of existing code (like GaudiMP)
# expects the old signatures.
gbl
.
gInterpreter
.
Declare
(
"""
#ifndef REENTINTERFACES_PYTHON_HELPERS
#define REENTINTERFACES_PYTHON_HELPERS
#include <GaudiKernel/IAlgorithm.h>
#include <GaudiKernel/IEventProcessor.h>
#include <GaudiKernel/ThreadLocalContext.h>
namespace GaudiPython::Helpers {
StatusCode executeEvent( IEventProcessor* self ) {
return self->executeEvent( self->createEventContext() );
}
bool isExecuted( IAlgorithm* self ) {
return self->execState( Gaudi::Hive::currentContext() ).state() == AlgExecState::State::Done;
}
bool filterPassed( IAlgorithm* self ) {
return self->execState( Gaudi::Hive::currentContext() ).filterPassed();
}
}
#endif
"""
)
gbl
.
IEventProcessor
.
executeEvent
=
gbl
.
GaudiPython
.
Helpers
.
executeEvent
gbl
.
IAlgorithm
.
isExecuted
=
gbl
.
GaudiPython
.
Helpers
.
isExecuted
gbl
.
IAlgorithm
.
filterPassed
=
gbl
.
GaudiPython
.
Helpers
.
filterPassed
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment