Skip to content
Snippets Groups Projects
Commit a5f79216 authored by Giovanna Lazzari Miotto's avatar Giovanna Lazzari Miotto :mushroom:
Browse files

fix: test: Use calo testfile for passthrough

parent 71ca3875
No related branches found
No related tags found
1 merge request!95refactor: config: Use single JSON5 file to configure multiple parallel streams
...@@ -116,6 +116,7 @@ function run_filedma_test() { ...@@ -116,6 +116,7 @@ function run_filedma_test() {
if [[ $(echo "${output_files}" | wc -l) -gt 1 ]]; then if [[ $(echo "${output_files}" | wc -l) -gt 1 ]]; then
# Since the list has been sorted, take the first (and "earliest") one with `head` # Since the list has been sorted, take the first (and "earliest") one with `head`
output_file=$(echo "${output_files}" | head -n 1) output_file=$(echo "${output_files}" | head -n 1)
stat $output_file
else else
# Single matched file # Single matched file
output_file="${output_files}" output_file="${output_files}"
...@@ -161,7 +162,7 @@ function run_all_tests () { ...@@ -161,7 +162,7 @@ function run_all_tests () {
gmt_failed=$? gmt_failed=$?
run_filedma_test "CALO" ${timeout_secs} "${CONFIG_DIR}/filedma-calo.json5" run_filedma_test "CALO" ${timeout_secs} "${CONFIG_DIR}/filedma-calo.json5"
calo_failed=$? calo_failed=$?
run_filedma_test "PASS_GMT" ${timeout_secs} "${CONFIG_DIR}/filedma-passthrough.json5" run_filedma_test "PASS_CALO" ${timeout_secs} "${CONFIG_DIR}/filedma-passthrough.json5"
passthrough_failed=$? passthrough_failed=$?
if [[ ${expects_output} = false ]]; then if [[ ${expects_output} = false ]]; then
......
...@@ -110,7 +110,7 @@ class ConfigMap { ...@@ -110,7 +110,7 @@ class ConfigMap {
} else if constexpr (std::is_same_v<T, uint32_t>) { } else if constexpr (std::is_same_v<T, uint32_t>) {
return static_cast<uint32_t>(std::stoul(str)); return static_cast<uint32_t>(std::stoul(str));
} else if constexpr (std::is_same_v<T, uint64_t>) { } else if constexpr (std::is_same_v<T, uint64_t>) {
return static_cast<uint32_t>(std::stoull(str)); return static_cast<uint64_t>(std::stoull(str));
} else if constexpr (std::is_same_v<T, int>) { } else if constexpr (std::is_same_v<T, int>) {
return static_cast<int>(std::stoi(str)); return static_cast<int>(std::stoi(str));
} else { } else {
...@@ -204,6 +204,9 @@ class Config { ...@@ -204,6 +204,9 @@ class Config {
friend std::ostream &operator<<(std::ostream &os, const Config &config) { friend std::ostream &operator<<(std::ostream &os, const Config &config) {
os << config.dict_ << std::endl; os << config.dict_ << std::endl;
os << "Number of input streams / output files: " << config.input_streams_.size() << std::endl; os << "Number of input streams / output files: " << config.input_streams_.size() << std::endl;
os << "Number of orbits per file: " << config.num_orbits_per_file_ << std::endl;
os << "Max file size: " << config.max_file_size_ << std::endl;
os << "Force write-out? " << (config.force_write_out_ ? "true" : "false") << std::endl;
return os; return os;
} }
......
...@@ -100,11 +100,12 @@ Pipeline::Pipeline(ConfigView conf_view, uint max_tokens_per_thread) ...@@ -100,11 +100,12 @@ Pipeline::Pipeline(ConfigView conf_view, uint max_tokens_per_thread)
} }
MultiPipeline::MultiPipeline(Config c) : conf_(std::move(c)) { MultiPipeline::MultiPipeline(Config c) : conf_(std::move(c)) {
LOG(DEBUG) << "Loaded configuration:";
LOG(DEBUG) << conf_;
uint32_t num_pipelines = conf_.input_streams_.size(); uint32_t num_pipelines = conf_.input_streams_.size();
for (uint32_t pipeline_id = 0; pipeline_id < num_pipelines; pipeline_id++) { for (uint32_t pipeline_id = 0; pipeline_id < num_pipelines; pipeline_id++) {
try { try {
pipelines_.emplace_back(ConfigView{conf_, pipeline_id}); pipelines_.emplace_back(ConfigView{conf_, pipeline_id});
LOG(DEBUG) << "-Configuration loaded";
LOG(DEBUG) << "-Pipeline set up"; LOG(DEBUG) << "-Pipeline set up";
} catch (std::invalid_argument &e) { } catch (std::invalid_argument &e) {
LOG(FATAL) << "-Configuration invalid! Error text is \"" << e.what() << "\" Bailing out."; LOG(FATAL) << "-Configuration invalid! Error text is \"" << e.what() << "\" Bailing out.";
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// "wzdma" for DMA driver from Wojciech M. Zabolotny // "wzdma" for DMA driver from Wojciech M. Zabolotny
// "filedma" for reading from file and simulating DMA // "filedma" for reading from file and simulating DMA
// "micronDMA" for PICO driver // "micronDMA" for PICO driver
// "tcpip" for TCP/IP input receving // "tcpip" for TCP/IP input receiving
input: "filedma", input: "filedma",
// DMA device // DMA device
dma_dev: "/dev/xdma0_c2h_0", dma_dev: "/dev/xdma0_c2h_0",
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
// Extra settings for "filedma" input // Extra settings for "filedma" input
input_files: [ input_files: [
// Must have at least the same cardinality as input_streams; kept isolated since `FileDMA` is a development feature // Must have at least the same cardinality as input_streams; kept isolated since `FileDMA` is a development feature
"test/data/gmt_testfile.dat" "test/data/calo_testfile.dat"
], ],
// Processing types (unpacking): // Processing types (unpacking):
// "PASS_THROUGH", "GMT", "CALO", "BRIL". // "PASS_THROUGH", "GMT", "CALO", "BRIL".
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
doZS: "yes", doZS: "yes",
// Output settings ///////////////////////////////////////////////// // Output settings /////////////////////////////////////////////////
output_filename_prefix: "scout_PASS0_GMT", output_filename_prefix: "scout_PASS_CALO",
output_filename_base: "test/data/run000000", output_filename_base: "test/data/run000000",
output_filename_suffix: ".dat", output_filename_suffix: "000000.dat",
max_file_size: 8589934592, max_file_size: 8589934592,
// Always write data to a file regardless of the run status // Always write data to a file regardless of the run status
output_force_write: "yes", output_force_write: "yes",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment