Skip to content

Add three new ZMQ publishers for TP results / Retrieve TP results #2230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 13, 2025

Conversation

MichaelHuth
Copy link
Collaborator

@MichaelHuth MichaelHuth commented Aug 15, 2024

Publishers added:
testpulse results live
testpulse results 1s update
testpulse results 5s update
testpulse results 10s update

The TP results from TP analysis are packed in a JSON in TP_TSAnalysis and published to ZMQ.
The time information when the next publishing is due is stored in the TUFXOP.

PUB_Publish was changed to be threadsafe and added an optional argument to control if the JSON should be released.

Close #2157

@MichaelHuth MichaelHuth self-assigned this Aug 15, 2024
@MichaelHuth MichaelHuth force-pushed the feature/2230-Add_zeromq_pub_filters_for_TP branch 4 times, most recently from 33d4401 to 716f021 Compare August 20, 2024 17:09
@MichaelHuth

This comment was marked as outdated.

@t-b

This comment was marked as outdated.

@MichaelHuth MichaelHuth force-pushed the feature/2230-Add_zeromq_pub_filters_for_TP branch 2 times, most recently from 96f6592 to 9c33299 Compare August 22, 2024 11:51
@MichaelHuth MichaelHuth assigned t-b and unassigned MichaelHuth Aug 22, 2024
@t-b

This comment was marked as off-topic.

@t-b t-b assigned MichaelHuth and unassigned t-b Aug 22, 2024
@MichaelHuth

This comment was marked as outdated.

@MichaelHuth MichaelHuth force-pushed the feature/2230-Add_zeromq_pub_filters_for_TP branch from ef494e7 to e82cd88 Compare August 25, 2024 18:11
@MichaelHuth MichaelHuth assigned t-b and unassigned MichaelHuth Aug 25, 2024
@t-b

This comment was marked as outdated.

@MichaelHuth MichaelHuth force-pushed the feature/2230-Add_zeromq_pub_filters_for_TP branch from e82cd88 to 82d748d Compare September 3, 2024 12:50
@t-b t-b assigned MichaelHuth and unassigned t-b Sep 3, 2024
@MichaelHuth MichaelHuth force-pushed the feature/2230-Add_zeromq_pub_filters_for_TP branch 2 times, most recently from 28dcb99 to e86dda8 Compare September 3, 2024 22:39
@MichaelHuth MichaelHuth assigned t-b and unassigned MichaelHuth Sep 3, 2024
@t-b

This comment was marked as outdated.

@ben-at-allen
Copy link

@t-b ok yeah it’s probably pulling it in right now as float 64. I can’t access the system right now but I will verify as soon as I can. It’s a one-liner numpy.frombuffer command so I’m sure it’s just that.

@t-b t-b force-pushed the feature/2230-Add_zeromq_pub_filters_for_TP branch from fe29626 to 8bd3794 Compare April 5, 2025 12:44
@t-b
Copy link
Collaborator

t-b commented Apr 5, 2025

Fixed conflicts and linted with new ipt version.

MichaelHuth and others added 11 commits April 5, 2025 15:25
- extended the TPAnalysisInput structure

This is a preparation commit for adding zeromq publishers that include
some of that information.
- the data is published from the TP analysis thread including additional
information available in the thread through the previous commit.
- The additional values are also returned by the thread and collected in
the async buffer as well then in TPResult and in TPStorage.
- The involved waves and their respective getters were adapted with new
elements that the additional data can be stored.
- As most of the elements store the same information, thus a constant
was introduced with a dimension label list that is used as helper for
the wave creation in the getter functions.
- The four publishers publish the same json, just with a different period.
  There is a filter for live, 1s, 5s and 10s publishing interval.

- See PUB_TPResult for JSON description

- publisher is called from TP_TSAnalysis thread
This prevent misleading naming and it more fitting to the functionality
the function actually implements
Added TP_GetStoredTP and TP_GetStoredTPsFromCycle that allow to get
information about a TP by tpMarker or TPs by cycle id and headstage.

- both functions allow to recreate the DA wave for the TPs with the flag includeDAC
- the returned data includes the AD, DA data as well as metadata for
  each returned TP (from TPStorage).

- These TP functions use the same TP utility function.
Add a message type which not only publishes the TP properties but also the
raw AD data.
@t-b t-b force-pushed the feature/2230-Add_zeromq_pub_filters_for_TP branch from 8bd3794 to 6c7cc38 Compare April 5, 2025 13:26
@t-b t-b assigned t-b and unassigned ben-at-allen Apr 10, 2025
This is a test suite hook, so there is no need to call the global test
begin hook.

We call TestBeginCommon() form TEST_BEGIN_OVERRIDE() in UTF_Basic.ipf
already.
@t-b
Copy link
Collaborator

t-b commented Apr 11, 2025

@ben-at-allen I've fixed the unexpected TP message from the databrowser. And also added a test to catch errors like that in the future. Thanks for the report.

@t-b t-b assigned ben-at-allen and unassigned t-b Apr 11, 2025
@ben-at-allen
Copy link

Thanks @t-b ! I forgot to respond here but that older issue where I was only getting half the data back from the test pulse was on my end. Everything looks good now. Thanks again. I'll pull this new update and put it onto the rig later today or Monday. Thanks.

t-b added 2 commits April 11, 2025 21:39
Since 1c43237 (PUB: Add four publishers to publish TP data, 2024-08-23)
we are sending out TP messages after doing TP analysis.

But we are also using TP_TSAnalysis from within SweepFormula, so this
needs to be made configurable.
In the last commit we fixed and issue where the resuse of code in
SweepFormula triggered a ZeroMQ message. This is unexpected and wasteful.

So let's ensure that we only ever get heartbeat messages for all tests
except UTF_ZeroMQPublishing.ipf.

We are doing that only when expensive tests are enabled. This was never
used for Basic.pxp but the builtin procedure window already has it, and
the github workflow sets it as well.
@t-b t-b force-pushed the feature/2230-Add_zeromq_pub_filters_for_TP branch from 9c40a77 to 5b0bbdd Compare April 11, 2025 19:40
@t-b
Copy link
Collaborator

t-b commented Apr 11, 2025

@ben-at-allen You want version 5b0bbdd (tests/Basic: Ensure that we don't get unexpected ZeroMQ messages, 2025-04-11) as I just had to fix something.

@t-b
Copy link
Collaborator

t-b commented Apr 13, 2025

From https://aiephys.slack.com/archives/C07LLQEDKU0/p1744410706950439:

Ok Mies has been updated and tested on Rig 5

So I'm merging this.

@t-b t-b merged commit b2ab744 into main Apr 13, 2025
20 checks passed
@t-b t-b deleted the feature/2230-Add_zeromq_pub_filters_for_TP branch April 13, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend zeromq PUB filters for TP updates
6 participants