DUNE-DAQ / iomanager

Package providing a unified API
0 stars 0 forks source link

Subscribe to multiple inputs only subscribes to one #19

Closed philiprodrigues closed 2 years ago

philiprodrigues commented 2 years ago

(I'm filing this in iomanager because the same issue wasn't seen in 2.11.x, but it's possible the actual problem is in daqconf)

In the recent VD coldbox runs, we saw that TPWriter only writes TPs from one of the input links. This occurs with v3.0.0 but not with v2.11.1.

This can be reproduced in a test setup with, eg, this daqconf command:

daqconf_multiru_gen --host-ru localhost --host-df localhost -d frames.bin -o . -s 10 --number-of-data-producers 2 -t 2 --enable-software-tpg --enable-tpset-writing json_tpset_writing

Then the tpwriter_init.json file contains all of the relevant connections and conn_refs:

{
    "connections": [
        {
            "data_type": "",
            "service_type": "kSubscriber",
            "topics": [
                "topic_tpsets_ru0_link0"
            ],
            "uid": "tpsets_ru0_link0_sub",
            "uri": "tcp://{host_ruemu0}:12359"
        },
        {
            "data_type": "",
            "service_type": "kSubscriber",
            "topics": [
                "topic_tpsets_ru0_link1"
            ],
            "uid": "tpsets_ru0_link1_sub",
            "uri": "tcp://{host_ruemu0}:12360"
        }
    ],
    "modules": [
        {
            "data": {
                "conn_refs": [
                    {
                        "dir": "kInput",
                        "name": "tpset_source",
                        "uid": "tpsets_ru0_link0_sub"
                    },
                    {
                        "dir": "kInput",
                        "name": "tpset_source",
                        "uid": "tpsets_ru0_link1_sub"
                    }
                ]
            },
            "inst": "tpswriter",
            "plugin": "TPStreamWriter"
        }
    ]
}

but only the last item in the conn_refs is actually subscribed to. From the TPWriter log:

11:45:17.311               DEBUG_0          DAQModuleManager.hxx:46                                construct: TPStreamWriter : tpswriter
11:45:17.350               LOG              IOManager.hpp:171                                      Creating NetworkReceiverModel for service_name tpsets_ru0_link1_sub
11:45:17.350               LOG              Receiver.hpp:192                                       NetworkReceiverModel created with DT! ID: tpsets_ru0_link1_sub Addr: 0x7f51a6603480

but no corresponding log message for tpsets_ru0_link0_sub. If I swap the order of the two dictionaries in conn_refs in the json file, the log shows that tpsets_ru0_link0_sub is subscribed to.

eflumerf commented 2 years ago

It looks like there's an issue with the conn_refs, both have the same name, so I think they are hiding each other.

eflumerf commented 2 years ago

This will have to be a new feature, since neither iomanager or networkmanager support subscribing to topics that are on different connections in a single subscriber. (I believe that the underlying ipm and ZMQ implementations would support this behavior, though)

eflumerf commented 2 years ago

I believe this Issue will be made obsolete by https://github.com/DUNE-DAQ/daqconf/pull/116

bieryAtFnal commented 2 years ago

I also believe that this Issue has become obsolete with changes in daqconf, so I'm closing it.