| ID |
Date |
Author |
Topic |
Subject |
|
3053
|
10 Jun 2025 |
Stefan Ritt | Info | use of modified image showing MIDAS data format? |
> Hello, I'm currently writing a paper about making a dataset publicly available
> from the University of Minnesota and it's a MIDAS dataset.
>
> I'd like to use an image that shows the MIDAS data format (that's been slightly
> modified to fit in the paper) and am wondering (1) if I could get permission to do
> so and (2) what the preferred attribution would be.
Feel free to use whatever you like, the documentation is on the same open source license as midas itself.
Stefan |
|
3056
|
10 Jun 2025 |
Stefan Ritt | Info | History configuration changed |
Today the way the history system is configured has changed. Whenever one adds new equipment
variables, the logger has to add that variable to the history system. Previously, this happened during
startup of the logger and at run start. We have now a case in the Mu3e experiment where we have many
variables and the history configuration takes about 15 seconds, which delays data taking considerably.
After discussion with KO we decided to remove the history re-configuration at run start. This speeds up
the run start considerably, also for other experiments with many history variables. It means however that
once you add/remove/rename any equipment variable going into the history system, you have to restart the
logger for this to become active.
https://bitbucket.org/tmidas/midas/commits/c0a14c2d0166feb6b38c645947f2c5e0bef013d5
Stefan |
|
3057
|
11 Jun 2025 |
Stefan Ritt | Info | Frontend write cache size |
We had issues with the frontend write cache size and the way it was implemented in the frontend
framework mfe. Specifically, we had two equipments like in the experiment/examples/frontend.cxx, one
trigger event and one periodic event. While the trigger event sets the cache size correctly in the
equipment table, the periodic event (defined afterwards) overwrites the cache size to zero, causing slow
data taking.
The underlying problem is that one event buffer (usually "SYSTEM") can only have one cache size for all
events in one frontend. To avoid mishaps like that, I remove the write cache size from the equipment table
and instead defined a function which explicitly sets the cache size for a buffer. In your frontend_init() you
can now call
set_cache_size("SYSTEM", 10000000);
to set the cache size of the SYSTEM buffer. Note that 10 MiB is the minimum cache size. Especially for
smaller events, this dramatically can speed up your maximal DAQ rate.
Full commit is here:
https://bitbucket.org/tmidas/midas/commits/24fbf2c02037ae5f7db74d0cadab23cd4bfe3b13
Note that this only affects frontends using the mfe framework, NOT for those using the tmfe framework.
Stefan |
|
3060
|
19 Jun 2025 |
Stefan Ritt | Bug Report | History variables with leading spaces |
I added now code to the logger so it properly complains if there would be a leading space in a variable name.
Stefan
> By accident we had history variables with leading spaces. The history schema check then decides that this is a new variable (the leading space is not read from the history file) and starts a new file. We found this because the run start became slow due to the many, many history files created. It would be nice to just get an error if one has a malformed variable name like this.
>
> How to reproduce: Try to put a variable with a leading space in the name into the history, repeatedly start runs.
> Sugested fix: Produce an error if a history variable has a leading space. |
|
3061
|
23 Jun 2025 |
Stefan Ritt | Bug Report | Memory leak in mhttpd binary RPC code |
Since this memory leak is quite obvious, I pushed the fix to develop.
Stefan |
|
3064
|
21 Jul 2025 |
Stefan Ritt | Bug Report | Default write cache size for new equipments breaks compatibility with older equipments |
> Perhaps have:
>
> set_write_cache_size("SYSTEM", 0);
> set_write_cache_size("BUF1", bigsize);
>
> with an internal std::map<std::string,size_t>; for write cache size for each named buffer
Ok, this is implemented now in mfed.cxx and called from examples/experiment/frontend.cxx
Stefan |
|
3078
|
18 Sep 2025 |
Stefan Ritt | Suggestion | Get manalyzer to configure midas::odb when running offline |
> > Of course with this patch extending manalyzer to process two or more runs at the same time becomes impossible.
>
> Yes, I hadn't realised that was an option. For that to work I guess the aforementioned static members could be made thread local storage, and
> processing of each run kept to a specific thread. Although I could imagine user code making assumptions and breaking, like storing a midas::odb as a
> class member or something.
If we want to analyze several runs, I can easily add code to make this possible. In a new call to set_odb_source(), the previously allocated memory in that function can be freed. We can aldo make the memory handling
thread-specific, allowing several thread to analyze different runs at the same time. But I will only invest work there once it's really needed by someone.
Stefan |
|
3081
|
22 Sep 2025 |
Stefan Ritt | Suggestion | Get manalyzer to configure midas::odb when running offline |
I will work today on the odbxx API to make sure there are no memory leaks when you switch form one file to another. I talked to KO so he agreed that yo then commit your proposed change of manalyzer
Best,
Stefan |
|
3085
|
22 Sep 2025 |
Stefan Ritt | Suggestion | Get manalyzer to configure midas::odb when running offline |
> > I will work today on the odbxx API to make sure there are no memory leaks when you switch form one file to another. I talked to KO so he agreed that yo then commit your proposed change of manalyzer
>
> That, and add a "clear()" method that resets odbxx state to "empty". I will call odbxx.clear() everywhere where I call "delete fOdb;" (TARunInfo::dtor and other places).
No need for clear(), since no memory gets allocated by midas::odd::set_odb_source(). All it does is to remember the file name. When you instantiate a midas::odd object, the file gets loaded, and the midas::odd object gets initialized from the file contents. Then the buffer
gets deleted (actually it's a simple local variable). Of course this causes some overhead (each midas::odd() constructor reads the whole file), but since the OS will cache the file, it's probably not so bad.
Stefan |
|
3086
|
22 Sep 2025 |
Stefan Ritt | Suggestion | Get manalyzer to configure midas::odb when running offline |
> > > Of course with this patch extending manalyzer to process two or more runs at the same time becomes impossible.
> > Yes, I hadn't realised that was an option.
>
> It is an option I would like to keep open. Not too many use cases, but imagine a "split brain" experiment
> that has two MIDAS instances record data into two separate midas files. (if LIGO were to use MIDAS,
> consider LIGO Hanford and LIGO Livingston).
>
> Assuming data in these two data sets have common precision timestamps,
> our task is to assemble data from two input files into single physics events. The analyzer will need
> to read two input files, each file with it's run number, it's own ODB dump, etc, process the midas
> events (unpack, calibrate, filter, etc), look at the timestamps, assemble the data into physics events.
>
> This trivially generalizes into reading 2, 3, or more input files.
>
> > For that to work I guess the aforementioned static members could be made thread local storage, and
> > processing of each run kept to a specific thread. Although I could imagine user code making assumptions and breaking, like storing a midas::odb as a
> > class member or something.
>
> manalyzer is already multithreaded, if you will need to keep track of which thread should see which odbxx global object,
> seems like abuse of the thread-local storage idea and intent.
I made the global variables storing the file name of type "thread_local", so each thread gets it's own copy. This means however that each thread must then call midas::odb::set_odb_source() individually before
creating any midas::odb objects. Interestingly enough I just learned that thread_local (at least under linux) is almost zero overhead, since these variable are placed by the linker into a separate memory space which is
separate for each thread, so accessing them only means to add a memory offset.
Let's see how far we get with this...
Stefan |
|
3104
|
02 Oct 2025 |
Stefan Ritt | Forum | struct size mismatch of alarms |
Sorry to intervene there, but the FEs are usually compiled against libmidas.a . Therefore you have to compile midas, usually do a "make install" to update the libmidas.a/so, then recompile the FEs. You probably forgot the "make install".
Stefan |
|
3113
|
13 Nov 2025 |
Stefan Ritt | Bug Report | broken scroll on midas web pages |
I confirm the problem is there (at least under MacOSX Safari) and I will take care of it.
Stefan |
|
3114
|
13 Nov 2025 |
Stefan Ritt | Suggestion | Python sc_frontend.py Display and History variables |
> We would like to write an sc_frontend in Python instead of C++. All our drivers
> work correctly, as well as the creation of the database in the ODB, including the
> creation of Commons, Statistics, Variables, and Settings.
> However, we are unable to correctly create the database entries needed to manage
> History and Display.
>
> As we understand it, in C++ this is handled by setting the EQ_SLOW flag, which
> doesn’t seem to be implemented in the Python libraries.
> How can we manually create the necessary variables for Display and History?
I'm not an expert of the Python part of MIDAS (Ben Smith is), but I know that you have
functions to create keys and set values in the ODB, so you should be able to create
these things manually as you need them.
Stefan |
|
3116
|
14 Nov 2025 |
Stefan Ritt | Bug Report | broken scroll on midas web pages |
This problem was introduced by ZS in March 2023 with these commits:
https://bitbucket.org/tmidas/midas/commits/25b13f875ff1f7e2f4e987273c81d6356dd2ff53
https://bitbucket.org/tmidas/midas/commits/2a9e902e07156e12edecb5c2257e4dbd944f8377
by setting
d.style.position = "fixed";
which prevents the scrolling. I have no idea why this change was made, so it should be fixed by the original
author.
Stefan |
|
3132
|
24 Nov 2025 |
Stefan Ritt | Forum | Control external process from inside MIDAS |
Dear all,
Stefan wants to run an external EPICS driver process as a detached process and somehow "glue" it to midas to control it. Actually a similar requirement led to the development of MIDAS in the '90s. We had too many configuration files lying around, to many process to control and interact together with each other and so on. With the development of MIDAS I wanted to integrate all that. There is one ODB to control an parasitize everything, one central process handling to see if processes are alive, raise an alarm if they die, automatically restart them if necessary and so on. Doing this now externally again is orthogonal to the original design concept of MIDAS and will cause many problems. I therefore strongly recommend to to juggle around with systemctl and syslog, but to make everything a MIDAS process. It's simply a "cm_connect_experiment()" and "cm_disconnect_experiment()" in the end. Then you set
/programs/requited = y
and
/programs/start command = <cmd>
You can set the "alarm class" to raise an alarm if the program crashes, and you will see all messages if you use "cm_msg()" inside the program rather than "printf()". Injecting a separate .log file into the system will show things on the message page, but these messages do not go through the SYSMSG buffer, and cannot received by other programs. Maybe you noticed that mhttpd on the status page always shows the last message it received, which can be very helpful. To see if a program is running, you only need a cm_exist() call, which also exists for custom web pages.
Rather than investing time to re-invent the wheel here, better try to modify your EPICS driver process to become a midas process.
If you have an external process which you absolutely cannot modify, I would rather write a wrapper midas program to start the external process, intercept it's output via a pipe, and put its output properly into the midas message system with cm_msg(). In the main loop of your wrapper function you check the external process via whatever you want, and if it dies trigger an alarm or restart it from your wrapper program. You can then set an alarm on your wrapper program to make sure this one is always running.
Best regards,
StefanR |
|
3133
|
24 Nov 2025 |
Stefan Ritt | Info | switch midas to c++17 |
> > > Following discussions at the MIDAS workshop, we propose to move MIDAS from c++11 to c++17.
> > We shall move forward with this change.
>
> It is done. Last c++11 MIDAS is midas-2025-11-a (plus the db_delete_key merge).
>
> I notice the cmake does not actually pass "-std=c++17" to the c++ compiler, and on U-20, it is likely
> the default c++14 is used. cmake always does the wrong thing and this will need to be fixed later.
>
> K.O.
We should either use
set(CMAKE_CSS_STANDARD 17)
or
target_compile_features(<target> PUBLIC cxx_std_17)
but not mix both. We have already the second one for the midas library, like
target_compile_features(objlib PUBLIC cxx_std_17)
which correctly causes a
c++ -std=gnu++17 ...
(at leas in my case).
If the compiler flag is missing for a target, we should add the target_compile_feature above for that target.
Stefan |
|
3134
|
24 Nov 2025 |
Stefan Ritt | Bug Report | Cannot edit values in a subtree containing only a single array of BOOLs using the ODB web interface |
Can you please update to the latest develop versiokn of midas, and clear your browser cache so that the updated JavaScript midas library is loaded. Should be fixed by now. See attached screen shot where I changed every second value via the ODB editor.
Stefan
|
| Attachment 1: Screenshot_2025-11-24_at_15.32.12.png
|
|
|
3136
|
25 Nov 2025 |
Stefan Ritt | Bug Fix | ODB update, branch feature/db_delete_key merged into develop |
Thanks for the fixes, which I all approve.
There is still a "follow_links" in midas_c_compat.h line 70 for Python. Probably Ben has to look into that. Also
client.py has it.
Stefan |
|
3144
|
26 Nov 2025 |
Stefan Ritt | Info | switch midas to c++17 |
I switched from
target_compile_features(<target> PUBLIC css_std_17)
to
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) # optional: disables GNU extensions
Which is now global in the CMakeLists.txt, so we only have to deal with one location if we want to change it. It also turns off the g++ options. On my
Mac I get now a clean
-std=c++17
Please everybody test on your side. Change is committed.
Stefan |
|
3148
|
27 Nov 2025 |
Stefan Ritt | Bug Report | Error(?) in custom page documentation |
Indeed a bug. Fixed in commit
https://bitbucket.org/tmidas/midas/commits/5c1133df073f493d74d1fc4c03fbcfe80a3edae4
Stefan |