Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
calng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
calibration
calng
Commits
810047ae
Commit
810047ae
authored
3 years ago
by
David Hammer
Browse files
Options
Downloads
Patches
Plain Diff
Add shmem-aware TrainMatcher, clean up more from merging bridge
parent
100581b4
No related branches found
No related tags found
1 merge request
!12
Snapshot: field test deployed version as of end of run 202201
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
setup.py
+1
-0
1 addition, 0 deletions
setup.py
src/calng/CalibrationManager.py
+2
-19
2 additions, 19 deletions
src/calng/CalibrationManager.py
src/calng/ShmemTrainMatcher.py
+26
-0
26 additions, 0 deletions
src/calng/ShmemTrainMatcher.py
with
29 additions
and
19 deletions
setup.py
+
1
−
0
View file @
810047ae
...
...
@@ -32,6 +32,7 @@ setup(name='calng',
'
ManualDsscGeometry = calng.ManualDsscGeometry:ManualDsscGeometry
'
,
'
ManualJungfrauGeometry = calng.ManualJungfrauGeometry:ManualJungfrauGeometry
'
,
'
ShmemToZMQ = calng.ShmemToZMQ:ShmemToZMQ
'
,
'
ShmemTrainMatcher = calng.ShmemTrainMatcher:ShmemTrainMatcher
'
,
'
DetectorAssembler = calng.DetectorAssembler:DetectorAssembler
'
,
],
...
...
This diff is collapsed.
Click to expand it.
src/calng/CalibrationManager.py
+
2
−
19
View file @
810047ae
...
...
@@ -71,15 +71,7 @@ class ClassIdsNode(Configurable):
displayedName
=
'
Group matcher class
'
,
description
=
'
Device class to use for matching the stream output of a
'
'
module group.
'
,
defaultValue
=
'
TrainMatcher
'
,
accessMode
=
AccessMode
.
INITONLY
,
assignment
=
Assignment
.
MANDATORY
)
bridgeClass
=
String
(
displayedName
=
'
Bridge class
'
,
description
=
'
Device class to use for bridging the stream output out
'
'
of Karabo.
'
,
defaultValue
=
'
ShmemToZmq
'
,
defaultValue
=
'
ShmemTrainMatcher
'
,
accessMode
=
AccessMode
.
INITONLY
,
assignment
=
Assignment
.
MANDATORY
)
...
...
@@ -110,14 +102,6 @@ class DeviceIdsNode(Configurable):
accessMode
=
AccessMode
.
INITONLY
,
assignment
=
Assignment
.
MANDATORY
)
bridgeSuffix
=
String
(
displayedName
=
'
Bridge suffix
'
,
description
=
'
Suffix for group bridge device IDs. The formatting
'
'
placeholder
\'
group
\'
may be used.
'
,
defaultValue
=
'
BRIDGE_G{group}
'
,
accessMode
=
AccessMode
.
INITONLY
,
assignment
=
Assignment
.
MANDATORY
)
assemblerSuffix
=
String
(
displayedName
=
'
Assembler suffix
'
,
description
=
'
Suffix for assembler device IDs. The formatting
'
...
...
@@ -1209,8 +1193,7 @@ class CalibrationManager(DeviceClientBase, Device):
device_id_templates
=
{}
class_args
=
(
self
.
detectorType
.
value
.
lower
().
capitalize
(),)
for
role
in
[
'
correction
'
,
'
groupMatcher
'
,
'
bridge
'
,
'
assembler
'
]:
for
role
in
[
'
correction
'
,
'
groupMatcher
'
,
'
assembler
'
]:
class_ids
[
role
]
=
getattr
(
self
.
classIds
,
f
'
{
role
}
Class
'
).
value
.
format
(
*
class_args
)
device_id_templates
[
role
]
=
f
'
{
self
.
_device_id_root
}
/
'
+
\
...
...
This diff is collapsed.
Click to expand it.
src/calng/ShmemTrainMatcher.py
0 → 100644
+
26
−
0
View file @
810047ae
from
karabo.bound
import
KARABO_CLASSINFO
from
TrainMatcher
import
TrainMatcher
from
.
import
shmem_utils
from
._version
import
version
as
deviceVersion
@KARABO_CLASSINFO
(
"
ShmemTrainMatcher
"
,
deviceVersion
)
class
ShmemTrainMatcher
(
TrainMatcher
.
TrainMatcher
):
def
initialization
(
self
):
super
().
initialization
()
self
.
_shmem_handler
=
shmem_utils
.
ShmemCircularBufferReceiver
()
def
on_matched_data
(
self
,
train_id
,
sources
):
for
source
,
(
data
,
timestamp
)
in
sources
.
items
():
if
data
.
has
(
"
calngShmemPaths
"
):
shmem_paths
=
list
(
data
[
"
calngShmemPaths
"
])
data
.
erase
(
"
calngShmemPaths
"
)
for
shmem_path
in
shmem_paths
:
if
not
data
.
has
(
shmem_path
):
self
.
log
.
INFO
(
f
"
Hash from
{
source
}
did not have
{
shmem_path
}
"
)
continue
dereferenced
=
self
.
_shmem_handler
.
get
(
data
[
shmem_path
])
data
[
shmem_path
]
=
dereferenced
super
().
on_matched_data
(
train_id
,
sources
)
This diff is collapsed.
Click to expand it.
David Hammer
@hammerd
mentioned in commit
3566342d
·
2 years ago
mentioned in commit
3566342d
mentioned in commit 3566342d031db1bb435b6430f100afdbaaa6c4bf
Toggle commit list
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