Skip to content

Commit

Permalink
Merge pull request #35 from DUNE-DAQ/wpv_fixtests
Browse files Browse the repository at this point in the history
Fixes for 3.1
  • Loading branch information
willpvazquez authored Jul 22, 2022
2 parents 6b9595e + ba8938c commit 46e1b67
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 514 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.12)
project(lbrulibs VERSION 1.2.0)
project(lbrulibs VERSION 1.2.1)

find_package(daq-cmake REQUIRED)

Expand Down
6 changes: 3 additions & 3 deletions integtest/test_pacman-raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
confgen_name="daqconf_multiru_gen"
# The arguments to pass to the config generator, excluding the json
# output directory (the test framework handles that)
confgen_arguments=[ "--host-ru", "localhost", "-o", ".", "-n", str(number_of_data_producers), "--frontend-type", "pacman", "-b", "2500000", "-a", "2500000", "-t", "1.0" ]
confgen_arguments=[ "--host-ru", "localhost", "-o", ".", "-n", str(number_of_data_producers), "--frontend-type", "pacman", "-b", "2500000", "-a", "2500000", "-t", "1.0", "--op-env", "integtest" ]
# The commands to run in nanorc, as a list
nanorc_command_list="boot integration-test init conf start --resume-wait 1 101 wait ".split() + [str(run_duration)] + " stop --stop-wait 1 wait 2 scrap terminate".split()
nanorc_command_list="integtest-partition boot conf start 101 wait 1 enable_triggers wait ".split() + [str(run_duration)] + "disable_triggers wait 2 stop_run wait 2 scrap terminate".split()

# The tests themselves
def test_nanorc_success(run_nanorc):
Expand Down Expand Up @@ -57,7 +57,7 @@ def test_data_file(run_nanorc):

data_socket = 'tcp://127.0.0.1:5556'
#data_file = '../test/example-pacman-data.h5'
data_file = '/dune/data/users/srsoleti/full_spill_larndsim/neutrino.0_1634786172.larndsim.h5'
data_file = '/nfs/home/jpanduro/dunedaq-v3.1.0-1/sourcecode/lbrulibs/test/example-pacman-data.h5'

def hdf5ToPackets(datafile):
print("Reading from:",datafile)
Expand Down
6 changes: 3 additions & 3 deletions integtest/test_pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
# file. They're read by the "fixtures" in conftest.py to determine how
# to run the config generation and nanorc
# The name of the python module for the config generation
confgen_name="daqconf__multiru_gen"
confgen_name="daqconf_multiru_gen"
# The arguments to pass to the config generator, excluding the json
# output directory (the test framework handles that)
confgen_arguments=[ "--host-ru", "localhost", "-o", ".", "-n", str(number_of_data_producers), "--frontend-type", "pacman", "-b", "2500000", "-a", "2500000", "-t", "1.0" ]
# The commands to run in nanorc, as a list
nanorc_command_list="boot integration-test init conf start --resume-wait 1 101 wait ".split() + [str(run_duration)] + " stop --stop-wait 1 wait 2 scrap terminate".split()
nanorc_command_list="integtest-partition boot conf start 101 wait 1 enable_triggers wait ".split() + [str(run_duration)] + "disable_triggers wait 2 stop_run wait 2 scrap terminate".split()

# The tests themselves
def test_nanorc_success(run_nanorc):
Expand Down Expand Up @@ -57,7 +57,7 @@ def test_data_file(run_nanorc):

data_socket = 'tcp://127.0.0.1:5556'
#data_file = '../test/example-pacman-data.h5'
data_file = '/dune/data/users/srsoleti/full_spill_larndsim/neutrino.0_1634786172.larndsim.h5'
data_file = '/nfs/home/jpanduro/dunedaq-v3.1.0-1/sourcecode/lbrulibs/test/example-pacman-data.h5'

def hdf5ToPackets(datafile):
print("Reading from:",datafile)
Expand Down
22 changes: 16 additions & 6 deletions plugins/PacmanCardReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ bool usePUBSUB = 0;
/**
* @brief TRACE debug levels used in this source file
*/
enum
/*enum
{
TLVL_ENTER_EXIT_METHODS = 5,
TLVL_WORK_STEPS = 10,
TLVL_BOOKKEEPING = 15
};

*/
namespace dunedaq {
namespace lbrulibs {

Expand Down Expand Up @@ -66,25 +66,27 @@ void
PacmanCardReader::init(const data_t& args)
{
auto ini = args.get<appfwk::app::ModInit>();
TLOG(TLVL_WORK_STEPS) << "ini";
for (const auto& cr : ini.conn_refs) {
if (cr.dir != iomanager::connection::Direction::kOutput) {
// ers::error("Only output queues are supported in this module!");
TLOG(TLVL_WORK_STEPS) << "PacmanCardReader??? ";
continue;
} else {
TLOG_DEBUG(TLVL_WORK_STEPS) << "PacmanCardReader output queue is " << cr.uid;
TLOG(TLVL_WORK_STEPS) << "PacmanCardReader output queue is " << cr.uid;
const char delim = '_';
std::string target = cr.uid;
std::vector<std::string> words;
tokenize(target, delim, words);
if (usePUBSUB) {
TLOG_DEBUG(TLVL_WORK_STEPS) << "Creating ZMQLinkModel for target queue: " << target;
TLOG(TLVL_WORK_STEPS) << "Creating ZMQLinkModel for target queue: " << target;
m_zmqlink[0] = createZMQLinkModel(cr.uid); // FIX ME - need to resolve proper link ID rather than hard code to zero
if (m_zmqlink[0] == nullptr) {
ers::fatal(InitializationError(ERS_HERE, "CreateZMQLink failed to provide an appropriate model for queue!"));
}
m_zmqlink[0]->init(args, m_queue_capacity);
} else {
TLOG_DEBUG(TLVL_WORK_STEPS) << "Creating STREAMLinkModel for target queue: " << target;
TLOG(TLVL_WORK_STEPS) << "Creating STREAMLinkModel for target queue: " << target;
m_streamlink[0] = createSTREAMLinkModel(cr.uid); // FIX ME - need to resolve proper link ID rather than hard code to zero
if (m_streamlink[0] == nullptr) {
ers::fatal(InitializationError(ERS_HERE, "CreateSTREAMLink failed to provide an appropriate model for queue!"));
Expand All @@ -93,6 +95,10 @@ PacmanCardReader::init(const data_t& args)
}
}
}


m_cfg = args.get<pacmancardreader::Conf>();

}

void
Expand All @@ -109,13 +115,17 @@ PacmanCardReader::do_configure(const data_t& args)
//

// Configure components
TLOG(TLVL_WORK_STEPS) << "Configuring ZMQLinkHandler";
TLOG(TLVL_WORK_STEPS) << "Configuring LinkHandler";
if (usePUBSUB) {
TLOG(TLVL_WORK_STEPS) << "Using ZMQ Publish/Subscribe";
m_zmqlink[0]->set_ids(m_card_id, 0);
m_zmqlink[0]->conf(args);
} else {
TLOG(TLVL_WORK_STEPS) << "Using Raw TCP Stream";
m_streamlink[0]->set_ids(m_card_id,0);
TLOG(TLVL_WORK_STEPS) << "apply conf";
m_streamlink[0]->conf(args);
TLOG(TLVL_WORK_STEPS) << "finish conf";
}
}

Expand Down
Loading

0 comments on commit 46e1b67

Please sign in to comment.