Commit 9a4a4d19 authored by Roel Aaij's avatar Roel Aaij Committed by Christoph Hasse
Browse files

Runtime sequence selection

parent 3ae2146e
......@@ -16,6 +16,7 @@ option(CPU_USE_REAL_HALF "Use half_t with uint16_t backend" OFF)
option(STANDALONE "Build Allen standalone" OFF)
option(TREAT_WARNINGS_AS_ERRORS "Treat all warnings as errors" OFF)
option(ALWAYS_DISPATCH_TO_DEFAULT "Dispatch architecture-specific functions always to default target" OFF)
set(SEQUENCE_BUILD_JOBS 1 CACHE STRING "Number of sequence build jobs" )
# --------
# Settings
......@@ -64,9 +65,12 @@ set_property(CACHE HIP_ARCH PROPERTY STRINGS gfx900 gfx902 gfx904 gfx906 gfx908
# Unrestricted options
# --------------------
# Configured sequence
set(SEQUENCE hlt1_pp_default CACHE STRING "Configured sequence")
message(STATUS "Configured sequence: " ${SEQUENCE})
# Sequences to build, SEQUENCE argument overrides SEQUENCES for now
set(SEQUENCES "hlt1_pp_(default|no_gec)\$" CACHE STRING "Sequences to build; \"all\" builds all sequences")
if (DEFINED SEQUENCE)
message(STATUS "The SEQUENCE argument is deprecated, please use SEQUENCES instead; note that SEQUENCES is a regex")
set(SEQUENCES "^${SEQUENCE}\$")
endif()
# Configured CPU architecture
set(CPU_ARCH native CACHE STRING "Target CPU architecture")
......@@ -294,6 +298,8 @@ if(TARGET_DEVICE STREQUAL "CUDA")
message(STATUS "Device architecture set to ${DEVICE_ARCHITECTURE}")
endif()
include(ConfigurationUtils)
# Setup project for the configured target
if(TARGET_DEVICE STREQUAL "CPU")
# This seems to be needed across compilers
......@@ -311,11 +317,16 @@ if(TARGET_DEVICE STREQUAL "CPU")
endforeach()
add_library(${ARGV})
install(TARGETS ${ARGV0} RUNTIME DESTINATION lib OPTIONAL)
install(TARGETS ${ARGV0} LIBRARY DESTINATION lib OPTIONAL)
target_compile_definitions(${ARGV0} PRIVATE ${TARGET_DEFINITION})
endfunction()
function(allen_add_device_library)
set(destination lib)
list(FIND ARGV STREAM is_stream)
list(FILTER ARGV EXCLUDE REGEX "STREAM")
foreach(arg IN LISTS ARGN)
if(${arg} MATCHES "\\.cu$")
set_source_files_properties(${arg} PROPERTIES LANGUAGE CXX)
......@@ -323,9 +334,14 @@ if(TARGET_DEVICE STREQUAL "CPU")
endforeach()
add_library(${ARGV})
if (NOT ${is_stream} EQUAL -1)
set(destination lib/sequences)
endif()
target_include_directories(${ARGV0} PUBLIC ${CPPGSL_INCLUDE_DIR})
target_compile_definitions(${ARGV0} PRIVATE ${TARGET_DEFINITION})
install(TARGETS ${ARGV0} DESTINATION lib OPTIONAL)
install(TARGETS ${ARGV0} LIBRARY DESTINATION ${destination} OPTIONAL)
endfunction()
function(allen_add_executable)
......@@ -387,22 +403,30 @@ elseif(TARGET_DEVICE STREQUAL "HIP")
add_library(${ARGV})
target_include_directories(${ARGV0} PRIVATE ${HIP_PATH}/include ${ROCM_PATH}/hsa/include)
target_compile_definitions(${ARGV0} PRIVATE ${TARGET_DEFINITION})
install(TARGETS ${ARGV0} RUNTIME DESTINATION bin OPTIONAL)
install(TARGETS ${ARGV0} LIBRARY DESTINATION lib)
endfunction()
#Define allen_add_device_library and allen_add_executable HIP specializations
function(allen_add_device_library)
set(destination lib)
list(FIND ARGV STREAM is_stream)
list(FILTER ARGV EXCLUDE REGEX "STREAM")
if (NOT ${is_stream} EQUAL -1)
set(destination lib/sequences)
endif()
hip_add_library(${ARGV} HIPCC_OPTIONS ${HIPCC_OPTIONS})
target_include_directories(${ARGV0} PRIVATE ${CPPGSL_INCLUDE_DIR} ${HIP_PATH}/include ${ROCM_PATH}/hsa/include)
target_compile_definitions(${ARGV0} PRIVATE ${TARGET_DEFINITION})
install(TARGETS ${ARGV0} DESTINATION lib OPTIONAL)
install(TARGETS ${ARGV0} LIBRARY DESTINATION ${destination})
endfunction()
function(allen_add_executable)
hip_add_executable(${ARGV} HIPCC_OPTIONS ${HIPCC_OPTIONS})
target_include_directories(${ARGV0} PRIVATE ${CPPGSL_INCLUDE_DIR} ${HIP_PATH}/include ${ROCM_PATH}/hsa/include)
target_compile_definitions(${ARGV0} PRIVATE ${TARGET_DEFINITION})
install(TARGETS ${ARGV0} RUNTIME DESTINATION bin OPTIONAL)
install(TARGETS ${ARGV0} RUNTIME DESTINATION bin)
endfunction()
elseif(TARGET_DEVICE STREQUAL "CUDA")
allen_project()
......@@ -427,18 +451,35 @@ elseif(TARGET_DEVICE STREQUAL "CUDA")
message(STATUS "Detected CUDA include directory: " ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
function(allen_add_host_library)
set(destination lib)
list(FIND ARGV STREAM is_stream)
list(FILTER ARGV EXCLUDE REGEX "STREAM")
if (NOT ${is_stream} EQUAL -1)
set(destination lib/sequences)
endif()
add_library(${ARGV})
target_include_directories(${ARGV0} PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
target_compile_definitions(${ARGV0} PRIVATE ${TARGET_DEFINITION})
install(TARGETS ${ARGV0} RUNTIME DESTINATION bin OPTIONAL)
install(TARGETS ${ARGV0} LIBRARY DESTINATION ${destination})
endfunction()
function(allen_add_device_library)
set(destination lib)
list(FIND ARGV STREAM is_stream)
list(FILTER ARGV EXCLUDE REGEX "STREAM")
if (NOT ${is_stream} EQUAL -1)
set(destination lib/sequences)
endif()
add_library(${ARGV})
set_target_properties(${ARGV0} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON)
target_include_directories(${ARGV0} PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
target_compile_definitions(${ARGV0} PRIVATE ${TARGET_DEFINITION})
install(TARGETS ${ARGV0} DESTINATION lib OPTIONAL)
install(TARGETS ${ARGV0} LIBRARY DESTINATION ${destination})
endfunction()
function(allen_add_executable)
......@@ -446,7 +487,7 @@ elseif(TARGET_DEVICE STREQUAL "CUDA")
set_target_properties(${ARGV0} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON)
target_include_directories(${ARGV0} PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
target_compile_definitions(${ARGV0} PRIVATE ${TARGET_DEFINITION})
install(TARGETS ${ARGV0} RUNTIME DESTINATION bin OPTIONAL)
install(TARGETS ${ARGV0} RUNTIME DESTINATION bin)
endfunction()
string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Wpedantic -Wnon-virtual-dtor -Wdouble-promotion")
......@@ -508,7 +549,7 @@ endif()
if (USE_ROOT)
if (GaudiProject_FOUND)
find_package(ROOT REQUIRED COMPONENTS Core Hist Tree RIO)
find_package(ROOT REQUIRED COMPONENTS Core Hist Tree RIO Thread)
find_package(TBB REQUIRED)
set(ALLEN_ROOT_DEFINITIONS WITH_ROOT ROOT_CXX17)
set(ALLEN_ROOT_LIBRARIES ${ROOT_LIBRARIES} ${TBB_LIBRARIES})
......@@ -520,9 +561,9 @@ if (USE_ROOT)
elseif($ENV{ROOTSYS}) # ROOT was compiled with configure/make
set(ALLEN_ROOT_CMAKE $ENV{ROOTSYS}/etc)
else()
message(FATAL "ROOTSYS must be set to use ROOT with a standalone build of Allen")
message(FATAL_ERROR "ROOTSYS must be set to use ROOT with a standalone build of Allen")
endif()
find_package(ROOT QUIET HINTS ${ALLEN_ROOT_CMAKE} NO_DEFAULT_PATH COMPONENTS Core Hist Tree)
find_package(ROOT QUIET HINTS ${ALLEN_ROOT_CMAKE} NO_DEFAULT_PATH COMPONENTS Core Hist Tree RIO Thread)
if (ROOT_FOUND)
message(STATUS "Compiling with ROOT: " ${ROOT_INCLUDE_DIRS})
......@@ -560,6 +601,21 @@ set(EXTERNAL_DIR "external")
find_package(Boost REQUIRED COMPONENTS iostreams)
# Determine which sequences to generate or copy configurations for
file(GLOB available_sequences "configuration/sequences/*.py")
set(BUILD_SEQUENCES "")
foreach(sequence_filename ${available_sequences})
get_filename_component(sequence ${sequence_filename} NAME_WE)
string(REGEX MATCH "${SEQUENCES}" sequence_matches ${sequence})
if (sequence_matches OR "${SEQUENCES}" STREQUAL "all")
list(APPEND BUILD_SEQUENCES ${sequence})
endif()
endforeach()
if(NOT BUILD_SEQUENCES)
message(FATAL_ERROR "No sequences selected to be built with pattern ${SEQUENCES}.")
endif()
include_directories(${CMAKE_SOURCE_DIR}/test/contracts/include)
include_directories(checker/tracking/include)
include_directories(device/PV/beamlinePV/include)
......@@ -572,7 +628,6 @@ endif()
add_subdirectory(backend)
add_subdirectory(device)
add_subdirectory(stream)
add_subdirectory(checker)
add_subdirectory(host)
add_subdirectory(mdf)
......@@ -580,6 +635,8 @@ add_subdirectory(integration)
add_subdirectory(zmq)
add_subdirectory(configuration)
add_subdirectory(stream)
#Make sure extra search paths get included as system to avoid
#warnings in external headers
if (DEFINED ENV{CPLUS_INCLUDE_PATH})
......@@ -637,20 +694,29 @@ include_directories(${Boost_INCLUDE_DIRS})
#Main Allen executable
file(GLOB common_sources "main/src/*.cpp")
file(GLOB common_device_sources "main/src/*.cu")
set(allen_lib_sources)
#Remove main.cpp from common_sources
foreach(source main Allen AllenThreads OutputHandler ZMQOutputSender MPISend)
foreach(source main Allen AllenThreads OutputHandler ZMQOutputSender MPISend StreamLoader RegisterConsumers)
get_filename_component(${source}_cpp_path ${CMAKE_CURRENT_SOURCE_DIR}/main/src/${source}.cpp ABSOLUTE)
list(REMOVE_ITEM common_sources "${${source}_cpp_path}")
endforeach()
set(allen_lib_sources
${Allen_cpp_path}
${AllenThreads_cpp_path}
${OutputHandler_cpp_path}
${ZMQOutputSender_cpp_path}
${RegisterConsumers_cpp_path}
${StreamLoader_cpp_path})
if (USE_MPI AND MPI_FOUND)
list(APPEND common_sources "main/src/MPISend.cpp")
list(APPEND allen_lib_sources "main/src/MPISend.cpp")
endif()
#common libraries
allen_add_host_library(Common STATIC ${common_sources})
allen_add_host_library(AllenCommon SHARED ${common_sources})
message(STATUS "CMAKE CXX FLAGS: " ${CMAKE_CXX_FLAGS})
......@@ -663,25 +729,35 @@ if(NOT Filesystem_FOUND)
else()
target_link_libraries(allen_fs INTERFACE std::filesystem)
endif()
target_link_libraries(Common mdf allen_fs nlohmann_json::nlohmann_json)
if(TARGET_DEVICE STREQUAL "CPU")
set_source_files_properties(${common_device_sources} PROPERTIES LANGUAGE CXX)
endif()
set(allen_lib_sources ${Allen_cpp_path}
${AllenThreads_cpp_path}
${OutputHandler_cpp_path}
${ZMQOutputSender_cpp_path})
if (TARGET_DEVICE STREQUAL "CUDA")
find_package(CUDAToolkit)
target_link_libraries(AllenCommon PUBLIC CUDA::cudart)
elseif(TARGET_DEVICE STREQUAL "HIP")
# find_package(hip) doesn't work as hip-targets.cmake is not relocatable
find_library(hip_runtime_lib amdhip64 HINTS ${HIP_PATH}/lib REQUIRED)
target_link_libraries(AllenCommon PUBLIC ${hip_runtime_lib})
endif()
target_link_libraries(AllenCommon PUBLIC mdf allen_fs nlohmann_json::nlohmann_json)
allen_add_device_library(AllenLib SHARED ${allen_lib_sources})
allen_add_host_library(AllenLib SHARED ${allen_lib_sources})
# Required packages
find_package(Threads REQUIRED)
if (TARGET_DEVICE STREQUAL "CUDA")
find_package(CUDAToolkit)
target_link_libraries(AllenLib PUBLIC CUDA::cudart)
endif()
target_link_libraries(AllenLib PUBLIC
Stream
Common
StreamUtils
AllenCommon
TrackChecking
PVChecking
CheckClustering
......@@ -690,7 +766,8 @@ target_link_libraries(AllenLib PUBLIC
NonEventData
AllenZMQ
HostCombiners
Threads::Threads)
Threads::Threads
${CMAKE_DL_LIBS})
if (USE_MPI AND MPI_FOUND)
get_filename_component(MPI_LIBRARY_DIR ${MPI_mpi_LIBRARY} DIRECTORY)
......
......@@ -4,9 +4,9 @@
###############################################################################
import os
from functools import partial
from GaudiPython.Bindings import AppMgr, gbl
from Configurables import LHCbApp, CondDB, ApplicationMgr
from Allen.config import setup_allen_non_event_data_service
from GaudiPython.Bindings import AppMgr, gbl
import argparse
# Load Allen entry point and helpers
......@@ -22,7 +22,7 @@ interpreter.Declare("#include <{}>".format(header_path))
interpreter.Declare("#include <Dumpers/PyAllenHelper.h>")
default_configuration = os.path.join(os.environ['ALLEN_INSTALL_DIR'],
'constants', 'Sequence.json')
'constants', 'hlt1_pp_default.json')
# Handle commandline arguments
parser = argparse.ArgumentParser()
......@@ -43,6 +43,7 @@ parser.add_argument("-m", dest="reserve", default="1024")
parser.add_argument("-v", dest="verbosity", default="3")
parser.add_argument("-p", dest="print_memory", default="0")
parser.add_argument("-i", dest="import_fwd", default="")
parser.add_argument("--sequence", dest="sequence", default="hlt1_pp_default")
parser.add_argument(
"--mdf",
dest="mdf",
......@@ -95,18 +96,21 @@ updater = gbl.cast_updater(svc)
# options map
options = gbl.std.map("std::string", "std::string")()
for flag, value in (("g", args.det_folder), ("params", args.param_folder),
("n", args.n_events), ("o", args.event_offset),
("t",
args.threads), ("r",
args.repetitions), ("configuration",
args.configuration),
("c", args.check), ("m", args.reserve), ("v",
args.verbosity),
("p", args.print_memory), ("i", args.import_fwd),
("mdf",
args.mdf), ("cpu-offload",
args.cpu_offload), ("disable-run-changes",
args.disable_run_changes),
("n", args.n_events), ("o",
args.event_offset), ("t",
args.threads),
("r",
args.repetitions), ("configuration",
args.configuration), ("c",
args.check),
("m", args.reserve), ("v",
args.verbosity), ("p",
args.print_memory),
("i", args.import_fwd), ("sequence",
args.sequence), ("mdf", args.mdf),
("cpu-offload",
args.cpu_offload), ("disable-run-changes",
args.disable_run_changes),
("monitoring-save-period",
args.mon_save_period), ("monitoring-filename",
args.mon_filename),
......
......@@ -26,4 +26,8 @@ skip_options = BlockSkipper("Requested options:",
skip_rates = BlockSkipper("rate_validator validation:", "Inclusive:")
preprocessor = LHCbPreprocessor + remove_throughput + skip_options + skip_rates
skip_sequence = BlockSkipper("Sequence:",
"Starting timer for throughput measurement")
preprocessor = (LHCbPreprocessor + remove_throughput + skip_options +
skip_rates + skip_sequence)
......@@ -2,17 +2,6 @@ Call Allen from Gaudi, event loop directed by Moore
=============================
The software can be compiled either based on the nightlies or by compiling the full stack, as described [here](https://gitlab.cern.ch/lhcb/Allen/-/blob/master/readme.md#call-allen-with-gaudi-steer-event-loop-from-moore).
The default HLT1 sequence is `hlt1_pp_default`. If you would like to use a different sequence when compiling Allen, you can pass CMake arguments by adding the following lines to `utils/config.json`
```
{
"cmakeFlags": {
"Allen": "-DSTANDALONE=OFF -DSEQUENCE=my_other_sequence"
}
}
```
Note that `make Allen/purge` is required to pick up the changed CMake variables, if you had already compiled Allen inside the stack before.
Call the executable from within the stack directory as in the following examples:
```
./Moore/run gaudirun.py Moore/Hlt/Moore/tests/options/default_input_and_conds_hlt1.py Moore/Hlt/RecoConf/options/hlt1_reco_allen_track_reconstruction.py
......@@ -42,6 +31,32 @@ To check the muon identification efficiency and misID efficiency:
The scripts in `Moore/Hlt/RecoConf/scripts/` can be used to produce plots of the various efficiencies and resolutions from the ROOT files produced by one of the previous calls to Moore.
Running a different sequence
------------------------------
To run a different sequence, the function call that sets up the
control flow can be wrapped using a `with` statement:
```python
with sequence.bind(sequence="hlt1_pp_no_gec"):
run_allen(options)
```
A different set of configuration parameters can be configured in the
same way:
```python
with sequence.bind(json="/path/to/custom/config.json"):
run_allen(options)
```
To obtain a JSON file that contains all configurable parameters, the
following can be used:
```console
./Moore/run Allen --write-configuration 1
```
This will write a file `config.json` in the current working
directory, which can be used to rerun with a different set of cuts
without rebuilding.
Call HLT1 selection efficiency script in MooreAnalysis
------------------------------
......
......@@ -12,6 +12,7 @@
#include "RunAllen.h"
#include "ROOTService.h"
#include <StreamLoader.h>
DECLARE_COMPONENT(RunAllen)
......@@ -101,35 +102,10 @@ StatusCode RunAllen::initialize()
// Initialize stream
const bool print_memory_usage = false;
const unsigned start_event_offset = 0;
const size_t reserve_mb = 10; // to do: how much do we need maximally for one event?
const unsigned required_memory_alignment =
64; // 64 bytes is equivalent to 512-bit alignment (currently widest vectors)
m_stream_wrapper.reset(new StreamWrapper());
m_stream_wrapper->initialize_streams(
m_number_of_streams,
print_memory_usage,
start_event_offset,
reserve_mb,
reserve_mb, // host memory same as "device"
required_memory_alignment,
m_constants,
configuration_reader.params());
// Initialize host buffers (where Allen output is stored)
m_host_buffers_manager.reset(
new HostBuffersManager(m_n_buffers, 2, m_line_names.size(), m_do_check, m_stream_wrapper->errorevent_line));
m_stream_wrapper->initialize_streams_host_buffers_manager(m_host_buffers_manager.get());
// Initialize input provider
const size_t number_of_slices = 1;
const size_t events_per_slice = 1;
const size_t n_events = 1;
m_tes_input_provider.reset(
new TESProvider<BankTypes::VP, BankTypes::UT, BankTypes::FT, BankTypes::MUON, BankTypes::ODIN>(
number_of_slices, events_per_slice, n_events));
// Get HLT1 selection names from configuration and initialize rate counters
auto selection_params = configuration_reader.params("gather_selections");
if (selection_params.empty()) {
......@@ -153,6 +129,43 @@ StatusCode RunAllen::initialize()
debug() << endmsg;
}
// find the name of the error event line
auto it = std::find_if(m_line_names.begin(), m_line_names.end(), [](std::string_view line_name) {
return line_name.find("ErrorEvent") != std::string::npos;
});
auto const error_line = std::distance(m_line_names.begin(), it);
// Load the algorithm sequence factory
bool validation_sequence = false;
std::tie(m_stream_factory, validation_sequence) = Allen::load_stream(m_sequence.value());
if (!m_stream_factory) {
error() << "Failed to load sequence " << m_sequence.value() << endmsg;
return StatusCode::FAILURE;
}
else if (validation_sequence) {
error() << "A validation sequence cannot be used with the RunAllen wrapper." << endmsg;
return StatusCode::FAILURE;
}
else {
info() << "Loaded sequence: " << m_sequence.value() << endmsg;
}
// Initialize host buffers (where Allen output is stored)
m_host_buffers_manager.reset(new HostBuffersManager(m_n_buffers, 2, m_line_names.size(), m_do_check, error_line));
// Instantiate the sequence
m_stream = (*m_stream_factory)(
print_memory_usage, reserve_mb, reserve_mb, required_memory_alignment, m_constants, m_host_buffers_manager.get());
m_stream->configure_algorithms(configuration_reader.params());
// Initialize input provider
const size_t number_of_slices = 1;
const size_t events_per_slice = 1;
const size_t n_events = 1;
m_tes_input_provider.reset(
new TESProvider<BankTypes::VP, BankTypes::UT, BankTypes::FT, BankTypes::MUON, BankTypes::ODIN>(
number_of_slices, events_per_slice, n_events));
m_hlt1_line_rates.reserve(m_line_names.size());
for (unsigned i = 0; i < m_line_names.size(); ++i) {
const std::string name = m_line_names[i] + "Decision";
......@@ -195,8 +208,7 @@ std::tuple<bool, HostBuffers, LHCb::HltDecReports> RunAllen::operator()(
root_service.get()};
const unsigned buf_idx = m_n_buffers - 1;
const unsigned stream_index = m_number_of_streams - 1;
Allen::error cuda_rv = m_stream_wrapper->run_stream(stream_index, buf_idx, runtime_options);
Allen::error cuda_rv = m_stream->run(buf_idx, runtime_options);
if (cuda_rv != Allen::error::success) {
error() << "Allen exited with errorCode " << rv << endmsg;
// how to exit a filter with failure?
......
......@@ -26,7 +26,8 @@
#include "HostBuffersManager.cuh"
#include "RuntimeOptions.h"
#include "BankTypes.h"
#include "StreamWrapper.cuh"
#include "IStream.h"
#include "StreamLoader.h"
#include "Logger.h"
#include "TESProvider.h"
#include "HltDecReport.cuh"
......@@ -57,22 +58,23 @@ private:
LHCb::RawBank::EcalPacked,
LHCb::RawBank::HcalPacked};
std::vector<std::string> m_line_names;
const unsigned m_number_of_streams = 1;
const unsigned m_number_of_repetitions = 1;
const bool m_cpu_offload = true;
const unsigned m_n_buffers = 1;
const bool m_do_check = true;
std::unique_ptr<StreamWrapper> m_stream_wrapper;
Allen::StreamFactory m_stream_factory;
std::unique_ptr<Allen::IStream> m_stream;
std::unique_ptr<HostBuffersManager> m_host_buffers_manager;
std::unique_ptr<TESProvider<BankTypes::VP, BankTypes::UT, BankTypes::FT, BankTypes::MUON, BankTypes::ODIN>>
m_tes_input_provider;
Gaudi::Property<std::string> m_sequence {this, "Sequence", "hlt1_pp_default"};
Gaudi::Property<unsigned> m_tck {this, "TCK", 0};
Gaudi::Property<std::string> m_updaterName {this, "UpdaterName", "AllenUpdater"};
Gaudi::Property<std::string> m_json {this, "JSON", "${ALLEN_INSTALL_DIR}/constants/Sequence.json"};
Gaudi::Property<std::string> m_json {this, "JSON", "${ALLEN_INSTALL_DIR}/constants/hlt1_pp_default.json"};
Gaudi::Property<std::string> m_paramDir {this, "ParamDir", "${ALLEN_PROJECT_ROOT}/input/parameters"};
// If set to false, events are only filtered by the GEC
......
......@@ -53,7 +53,6 @@ AllenUpdater DEBUG Updating UTBoards
AllenUpdater DEBUG Updating UTGeometry
AllenUpdater DEBUG Updating UTLookupTables
AllenUpdater DEBUG Updating VeloGeometry
Starting timer for throughput measurement
Input complete
Processing complete
EventLoopMgr INFO Histograms converted successfully according to request.
......
###############################################################################
# (c) Copyright 2018-2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the Apache License #
# version 2 (Apache-2.0), copied verbatim in the file "LICENSE". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
set_property(GLOBAL PROPERTY STREAM_DEPENDENT_SOURCES "")
function(filter_sequence_sources target)
get_target_property(sources ${target} SOURCES)
set(sources_updated FALSE)
get_property(stream_dependent_sources GLOBAL PROPERTY STREAM_DEPENDENT_SOURCES)
foreach(source_file ${sources})
get_source_file_property(stream_dependent ${source_file} DIRECTORY ${CMAKE_SOURCE_DIR} STREAM_DEPENDENT)
if (stream_dependent)
list(REMOVE_ITEM sources ${source_file})
list(APPEND stream_dependent_sources ${source_file})
set(sources_updated TRUE)
endif()
endforeach()
if (${sources_updated})
set_property(TARGET ${target} PROPERTY SOURCES ${sources})
set_property(GLOBAL PROPERTY STREAM_DEPENDENT_SOURCES ${stream_dependent_sources})
endif()
endfunction()
......@@ -11,7 +11,6 @@ set(ALLEN_CORE_DIR ${PROJECT_SEQUENCE_DIR}/AllenCore)
set(ALLEN_PARSER_DIR ${PROJECT_SEQUENCE_DIR}/parser)
set(ALGORITHMS_OUTPUTFILE ${SEQUENCE_DEFINITION_DIR}/algorithms.py)
set(ALGORITHMS_GENERATION_SCRIPT ${ALLEN_PARSER_DIR}/ParseAlgorithms.py)
file(MAKE_DIRECTORY ${SEQUENCE_DEFINITION_DIR})
file(MAKE_DIRECTORY ${ALLEN_PARSER_DIR})
# We need a Python 3 interpreter
......@@ -21,73 +20,95 @@ find_package(Python3 REQUIRED)
find_package(LibClang QUIET)
set(MINIMUM_REQUIRED_LIBCLANG_VERSION 9)
if(LIBCLANG_FOUND AND "${LIBCLANG_MAJOR_VERSION}" LESS ${MINIMUM_REQUIRED_LIBCLANG_VERSION})
message(STATUS "libClang version found (${LIBCLANG_VERSION}) does not meet minimum version requirement (${MINIMUM_REQUIRED_LIBCLANG_VERSION})")
if(${LIBCLANG_FOUND} AND "${LIBCLANG_MAJOR_VERSION}" GREATER_EQUAL ${MINIMUM_REQUIRED_LIBCLANG_VERSION})
set(LIBCLANG_MINIMUM_VERSION_FOUND TRUE)
else()
set(LIBCLANG_MINIMUM_VERSION_FOUND FALSE)
endif()
if(NOT LIBCLANG_FOUND OR "${LIBCLANG_MAJOR_VERSION}" LESS ${MINIMUM_REQUIRED_LIBCLANG_VERSION})
if(NOT LIBCLANG_MINIMUM_VERSION_FOUND)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# In macOS, libClang typically exists even if llvm-config does not exist.
# Attempt default directory
set(LIBCLANG_LIBDIR /Library/Developer/CommandLineTools/usr/lib)
set(LIBCLANG_ALTERNATIVE_FOUND ON)
elseif(EXISTS /cvmfs/sft.cern.ch)
# As a last resource, try a hard-coded directory in cvmfs
set(LIBCLANG_LIBDIR /cvmfs/sft.cern.ch/lcg/releases/clang/10.0.0-62e61/x86_64-centos7/lib)
set(LIBCLANG_ALTERNATIVE_FOUND ON)