Commit 5685f037 authored by Paul Jean Schutze's avatar Paul Jean Schutze
Browse files

Merge branch 'fix_g4_mt' into 'v2.0-stable'

Cherry-Pick Bugfixes to 2.0-Stable

See merge request !567
parents 6c2cb997 e7f91f94
Pipeline #3194062 passed with stages
in 58 minutes and 38 seconds
......@@ -15,7 +15,9 @@ if [ "$(uname)" = "Linux" ]; then
elif [ "$(uname)" = "Darwin" ]; then
MACOS_MAJOR=$(sw_vers -productVersion | awk -F '.' '{print $1}')
MACOS_MINOR=$(sw_vers -productVersion | awk -F '.' '{print $2}')
if [ $MACOS_MAJOR = "11" ] || [ "${MACOS_MAJOR}.${MACOS_MINOR}" = "10.15" ]; then
if [ $MACOS_MAJOR = "11" ]; then
OS=mac11
elif [ "${MACOS_MAJOR}.${MACOS_MINOR}" = "10.15" ]; then
OS=mac1015
else
echo "Unsupported version of macOS ${MACOS_MAJOR}.${MACOS_MINOR}"
......@@ -28,7 +30,7 @@ fi
# Determine is you have CVMFS installed
CVMFS_MOUNT=""
if [ "$OS" = mac1015 ]; then
if [ "$OS" = mac1015 ] || [ "$OS" = mac11 ] ; then
CVMFS_MOUNT="/Users/Shared"
fi
......@@ -48,7 +50,7 @@ fi
# Determine which LCG version to use
DEFAULT_LCG="LCG_99"
DEFAULT_LCG="LCG_101"
if [ -z ${ALLPIX_LCG_VERSION} ]; then
echo "No explicit LCG version set, using ${DEFAULT_LCG}."
......@@ -66,14 +68,14 @@ if [ -z ${COMPILER_TYPE} ]; then
fi
fi
if [ ${COMPILER_TYPE} = "gcc" ]; then
COMPILER_VERSION="gcc10"
COMPILER_VERSION="gcc11"
echo "Compiler type set to GCC, version ${COMPILER_VERSION}."
fi
if [ ${COMPILER_TYPE} = "llvm" ]; then
if [ "$(uname)" = "Darwin" ]; then
COMPILER_VERSION="clang120"
else
COMPILER_VERSION="clang10"
COMPILER_VERSION="clang12"
fi
echo "Compiler type set to LLVM, version ${COMPILER_VERSION}."
fi
......
......@@ -3,7 +3,7 @@ on:
pull_request:
types: [opened, reopened, edited, ready_for_review, synchronize]
env:
LCG_VERSION: LCG_99
LCG_VERSION: LCG_101
jobs:
compile-centos7:
strategy:
......
......@@ -3,7 +3,7 @@ on:
pull_request:
types: [opened, reopened, edited, ready_for_review, synchronize]
env:
LCG_VERSION: LCG_99
LCG_VERSION: LCG_101
jobs:
format:
......
......@@ -69,6 +69,8 @@ stages:
# Hidden key to define the default compile job:
.compile:
variables:
ALLPIX_BUILD_ENV: "CI/CD"
stage: compilation
needs: []
script:
......@@ -152,7 +154,7 @@ fmt:cc7-llvm-lint:
extends: .format
script:
- cmake -GNinja -DCMAKE_CXX_FLAGS="-Werror" -DBUILD_LCIOWriter=ON -DCMAKE_BUILD_TYPE=RELEASE -DLCIO_DIR=$LCIO_DIR ..
- ninja check-lint
- ninja check-lint 2> /dev/null
fmt:cmake-lint:
extends: .format
......@@ -415,7 +417,7 @@ cmp:doxygen:
script:
- source ../.ci/init_x86_64.sh
- cmake -DBUILD_DOCS_ONLY=ON ..
- make Allpix-reference
- make Allpix-reference 1> /dev/null
- mv reference/html ../public/reference
# Compile LaTeX user manual:
......@@ -564,26 +566,29 @@ deploy-cvmfs:
- rm -f allpix-squared-*.tar.gz
retry: 1
deploy-docker-latest:
.deploy-docker:
stage: deployment
tags:
- docker-image-build
image:
name: gitlab-registry.cern.ch/ci-tools/docker-image-builder
entrypoint: [""]
dependencies: []
only:
- schedules@allpix-squared/allpix-squared
script:
- "echo" # unused but this line is required by GitLab CI
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/$DOCKER_FILE --destination $IMAGE_DESTINATION
- echo "Image pushed successfully to ${IMAGE_DESTINATION}"
deploy-docker-latest:
extends: .deploy-docker
variables:
TO: gitlab-registry.cern.ch/allpix-squared/allpix-squared
IMAGE_DESTINATION: ${CI_REGISTRY_IMAGE}:latest
ALLPIX_BUILD_ENV: "Docker"
only:
- schedules@allpix-squared/allpix-squared
deploy-docker-tag:
stage: deployment
tags:
- docker-image-build
dependencies: []
extends: .deploy-docker
variables:
IMAGE_DESTINATION: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}
ALLPIX_BUILD_ENV: "Docker"
only:
- tags@allpix-squared/allpix-squared
script:
- "echo" # unused but this line is required by GitLab CI
variables:
TO: gitlab-registry.cern.ch/allpix-squared/allpix-squared:${CI_COMMIT_TAG}
......@@ -5,7 +5,7 @@
// | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_|
// |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____|
// __/ | https://github.com/Neargye/magic_enum
// |___/ version 0.7.2
// |___/ version 0.7.3
//
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
// SPDX-License-Identifier: MIT
......@@ -34,7 +34,7 @@
#define MAGIC_ENUM_VERSION_MAJOR 0
#define MAGIC_ENUM_VERSION_MINOR 7
#define MAGIC_ENUM_VERSION_PATCH 2
#define MAGIC_ENUM_VERSION_PATCH 3
#include <array>
#include <cassert>
......@@ -45,6 +45,10 @@
#include <type_traits>
#include <utility>
#if defined(MAGIC_ENUM_CONFIG_FILE)
#include MAGIC_ENUM_CONFIG_FILE
#endif
#if !defined(MAGIC_ENUM_USING_ALIAS_OPTIONAL)
#include <optional>
#endif
......@@ -139,7 +143,7 @@ namespace magic_enum {
static_assert(MAGIC_ENUM_RANGE_MAX > MAGIC_ENUM_RANGE_MIN,
"MAGIC_ENUM_RANGE_MAX must be greater than MAGIC_ENUM_RANGE_MIN.");
// If need cunstom names for enum, add specialization enum_name for necessary enum type.
// If need custom names for enum, add specialization enum_name for necessary enum type.
template <typename E> constexpr string_view enum_name(E) noexcept {
static_assert(std::is_enum_v<E>, "magic_enum::customize::enum_name requires enum type.");
......
......@@ -13,7 +13,7 @@ IF(COMMAND CMAKE_POLICY)
ENDIF(COMMAND CMAKE_POLICY)
# Set default version
SET(ALLPIX_VERSION "v2.0.2")
SET(ALLPIX_VERSION "v2.0.3")
# Set default build type
IF(NOT CMAKE_BUILD_TYPE)
......@@ -44,6 +44,11 @@ PROJECT(
ADD_DEFINITIONS(-DALLPIX_PROJECT_NAME="${CMAKE_PROJECT_NAME}" -DALLPIX_PROJECT_VERSION="${ALLPIX_VERSION}"
-DALLPIX_BUILD_TIME="${BUILD_TIME}")
# Read possible build environment
IF(DEFINED ENV{ALLPIX_BUILD_ENV})
ADD_DEFINITIONS(-DALLPIX_BUILD_ENV=\"$ENV{ALLPIX_BUILD_ENV}\")
ENDIF()
# Include a generated configuration file
# FIXME: this should be combined with the ADD_DEFINITIONS
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake.h" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY)
......@@ -274,9 +279,9 @@ ADD_RUNTIME_DEP(thisroot.sh)
###################################
# Set the clang-format version required by the CI for correct formatting:
SET(CLANG_FORMAT_VERSION "10")
SET(CLANG_FORMAT_VERSION "12")
# Set the clang-tidy version of the linter required by the CI:
SET(CLANG_TIDY_VERSION "10")
SET(CLANG_TIDY_VERSION "12")
# Set the source files to clang-format (FIXME: determine this better)
FILE(
......@@ -350,6 +355,7 @@ ADD_SUBDIRECTORY(src/modules)
# Build geant4 interface library if needed by modules
IF(${ALLPIX_BUILD_GEANT4_INTERFACE})
ADD_SUBDIRECTORY(src/tools/geant4)
ADD_DEFINITIONS(-DALLPIX_GEANT4_AVAILABLE)
ENDIF()
# Build the executable
......
......@@ -119,6 +119,7 @@ The following authors, in alphabetical order, have developed or contributed to A
* Ondrej Theiner, Charles University, @otheiner
* Annika Vauth, University of Hamburg, @avauth
* Mateus Vicente Barreto Pinto, CERN, @mvicente
* Håkan Wennlöf, DESY, @hwennlof
* Andy Wharton, Lancaster University, @awharton
* Morag Williams, University of Glasgow, @williamm
......
......@@ -43,6 +43,7 @@ The following authors, in alphabetical order, have developed or contributed to \
\item Ondrej Theiner, Charles University
\item Annika Vauth, University of Hamburg
\item Mateus Vicente Barreto Pinto, CERN
\item Håkan Wennlöf, DESY
\item Andy Wharton, Lancaster University
\item Morag Williams, University of Glasgow
\end{itemize}
......
......@@ -98,7 +98,7 @@ Since the framework serves a wide community, modules should be as generic as pos
Furthermore, it may be beneficial to split up modules to support the modular design of \apsq.
Before starting the development of a new module, it is essential to carefully read the documentation of the framework module manager which can be found in Section~\ref{sec:module_manager}.
The basic steps ti implement a new module, hereafter referred to as \parameter{ModuleName}, are the following:
The basic steps to implement a new module, hereafter referred to as \parameter{ModuleName}, are the following:
\begin{enumerate}
\item Initialization of the code for the new module, using the script \file{etc/scripts/make_module.sh} in the repository.
The script will ask for the name of the model and the type (unique or detector-specific).
......
......@@ -725,7 +725,7 @@ A FIFO-like unsorted queue for events to be processed, and a second, priority-or
The former is constantly filled with new events to be processed by the main thread, while the latter is used to temporarily buffer events which wait to be picked up in the correct sequence by a \texttt{SequentialModule}.
By default modules are assumed to not operate in a thread-safe way and therefore cannot participate in multithreaded processing of events.
Therefore each module each module must explicitly enable multithreading in its constructor in order to signal its multithreading capabilities to \apsq.
Therefore each module must explicitly enable multithreading in its constructor in order to signal its multithreading capabilities to \apsq.
To support multithreading, the module \texttt{run()} method should be re-entrant and any shared member variables should be protected.
If multithreading is enabled in the run configuration, the module manager will check if all the loaded modules support multithreading.
In case one or more modules do not support multithreading, a warning is printed and the feature is disabled. Modules can inform themselves about the decision via the \texttt{multithreadingEnabled()} method.
......
......@@ -219,7 +219,7 @@ The model should exist in the search path described in Section~\ref{sec:detector
See Section~\ref{sec:models_geometry} for details.
\item The \parameter{orientation} specified as X-Y-Z extrinsic Euler angles.
This means the detector is rotated first around the world's X-axis, then around the world's Y-axis and then around the world's Z-axis.
Alternatively the orientation can be set as Z-Y-X or X-Z-X extrinsic Euler angles, refer to Section~\ref{sec:models_geometry} for details.
Alternatively the orientation can be set as Z-Y-X or Z-X-Z extrinsic Euler angles, refer to Section~\ref{sec:models_geometry} for details.
\end{itemize}
In addition to these required parameters, the following parameters allow to randomly misalign the respective detector from its initial position. The values are interpreted as width of a normal distribution centered around zero.
......
......@@ -15,7 +15,7 @@ Furthermore, the continuous integration of the project ensures correct building
\section{Supported Compilers}
\label{sec:compilers}
\apsq relies on functionality from the {\CPP}17 standard and therefore requires a {\CPP}17-compliant compiler.
This comprises for example GCC\,7+, LLVM/Clang\,4.0+ and AppleClang\,10.0+. A detailed list of supported compilers can be found at~\cite{cppcompilersupport}.
This comprises for example GCC\,9+, LLVM/Clang\,4.0+ and AppleClang\,10.0+. A detailed list of supported compilers can be found at~\cite{cppcompilersupport}.
\section{Prerequisites}
\label{sec:prerequisites}
......@@ -30,7 +30,10 @@ In addition, some modules implement I/O using ROOT libraries.
The latest stable release of ROOT\,6 is recommended and older versions, such as ROOT\,5.x, are not supported.
Please refer to~\cite{rootinstallation} for instructions on how to install ROOT.
ROOT has several components of which the \parameter{GenVector} package is required to run \apsq.
This package is included in the default build.
This package is included in the default build. ROOT needs to be built using {\CPP}17, which is accomplished by supplying the CMake flag
\begin{verbatim}
-DCMAKE_CXX_STANDARD=17
\end{verbatim}
\item Boost.Random\,1.64.0 or later~\cite{boostrandom}:
Random number generator and distribution library of the Boost project, used in order to get cross-platform portable, STL-compatible random number distributions.
While STL random number generators are portable and guarantee to deliver the same random number sequence given the same seed, random distributions are not, and their implementation is platform-dependent leading to different simulation results with the same seed.
......@@ -43,7 +46,7 @@ The following dependencies are needed to compile the standard installation:
\begin{itemize}
\item Geant4~\cite{geant4}: Simulates the desired particles and their interactions with matter, depositing charges in the detectors with the help of the constructed geometry.
See the instructions in~\cite{geant4installation} for details on how to install the software.
All Geant4 data sets are required to run the modules successfully.
All Geant4 data sets are required to run the modules successfully, and Geant4 must be built using {\CPP}17. For multithreading to be possible, this must also be enabled in the Geant4 installation.
It is recommended to enable the Geant4 Qt extensions to allow visualization of the detector setup and the simulated particle tracks.
A recommended set of CMake flags to build a Geant4 package suitable for usage with \apsq are:
\begin{verbatim}
......@@ -53,6 +56,8 @@ A recommended set of CMake flags to build a Geant4 package suitable for usage wi
-DGEANT4_USE_XM=ON
-DGEANT4_USE_OPENGL_X11=ON
-DGEANT4_USE_SYSTEM_CLHEP=OFF
-DGEANT4_BUILD_CXXSTD=17
-DGEANT4_BUILD_MULTITHREADED=ON
\end{verbatim}
\item Eigen3~\cite{eigen3}: Vector package used to perform Runge-Kutta integration, used in some of the charge carrier propagation modules.
Eigen is available in almost all Linux distributions through the package manager.
......
......@@ -172,7 +172,7 @@ This job requires a private API token to be set as secret project variable throu
The project documentation is deployed to the project's EOS space at \dir{/eos/project/a/allpix-squared/www/} for publication on the project website.
This comprises both the PDF and HTML versions of the user manual (subdirectory \dir{usermanual}) as well as the Doxygen code reference (subdirectory \dir{reference/}).
The documentation is only published only for new tagged versions of the framework.
The documentation is only published for new tagged versions of the framework.
The CI jobs uses the \parameter{ci-web-deployer} Docker image from the CERN GitLab CI tools to access EOS, which requires a specific file structure of the artifact.
All files in the artifact's \dir{public/} folder will be published to the \dir{www/} folder of the given project.
......
......@@ -297,7 +297,7 @@ month={Aug},
month = feb
}
@online{cppcompilersupport,
author = {{\CPP}~Reference},
author = {C++~Reference},
title = {Compiler support for {\CPP}17},
url = {https://en.cppreference.com/w/cpp/compiler_support/17},
year = {2021},
......
......@@ -39,7 +39,7 @@ RUN pip3 install --upgrade pip && \
pip3 install numpy matplotlib scipy pandas
# Add layer for ROOT6
ENV ROOT6_VERSION 6.24.00
ENV ROOT6_VERSION 6.24.06
ENV ROOTSYS="/opt/root6"
ENV PATH="$ROOTSYS/bin:$PATH"
......@@ -87,8 +87,8 @@ RUN mkdir -p ${ROOTSYS}/{src,build} && \
RUN apt-get install -y libxerces-c-dev
# Add layer for Geant4
ENV GEANT4_VERSION 10.07
ENV GEANT4_VERSION_PATH 10.7.0
ENV GEANT4_VERSION 10.07.p02
ENV GEANT4_VERSION_PATH 10.7.2
ENV GEANT4DIR="/opt/geant4"
ENV PATH="$GEANT4DIR/bin:$PATH"
......@@ -97,7 +97,7 @@ ENV G4NEUTRONHPDATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/G4NDL4.
ENV G4LEDATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/G4EMLOW7.13"
ENV G4LEVELGAMMADATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/PhotonEvaporation5.7"
ENV G4RADIOACTIVEDATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/RadioactiveDecay5.6"
ENV G4PARTICLEXSDATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/G4PARTICLEXS3.1"
ENV G4PARTICLEXSDATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/G4PARTICLEXS3.1.1"
ENV G4PIIDATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/G4PII1.3"
ENV G4REALSURFACEDATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/RealSurface2.2"
ENV G4SAIDXSDATA="$GEANT4DIR/share/Geant4-${GEANT4_VERSION_PATH}/data/G4SAIDDATA2.0"
......
......@@ -5,6 +5,7 @@ size = 100mm 100mm 100mm
position = 200mm 200mm 0mm
orientation = 0 0deg 0deg
material = "lead"
role = "passive"
# Placement of a box made of lead
[box2]
......@@ -13,15 +14,17 @@ size = 100mm 100mm 100mm
position = 0mm 200mm 0mm
orientation = 0 0deg 0deg
material = "lead"
role = "passive"
# Placement of a box made of lead, with a hollow opening
[box3]
type = "box"
size = 100mm 100mm 100mm
inner_size = 80mm 80mm
inner_size = 80mm 80mm 100mm
position = -200mm 200mm 0mm
orientation = 0 0deg 0deg
material = "lead"
role = "passive"
# Placement of a box made of aluminum, inside box1
[box4]
......@@ -30,7 +33,8 @@ size = 50mm 50mm 50mm
position = 0mm 0mm -0mm
orientation = 0 0deg 0deg
material = "aluminum"
mother_volume = box1_log
mother_volume = box1
role = "passive"
# Placement of a box made of the world material, inside box2
[box5]
......@@ -39,7 +43,8 @@ size = 50mm 50mm 50mm
position = 0mm 0mm -0mm
orientation = 0 0deg 0deg
material = "world_material"
mother_volume = box2_log
mother_volume = box2
role = "passive"
# Placement of a cylinder made of lead, with a hollow opening
[cylinder1]
......@@ -50,6 +55,7 @@ length = 100mm
position = 200mm 0mm 0mm
orientation = 0 0deg 0deg
material = "lead"
role = "passive"
# Placement of a cylinder made of lead
[cylinder2]
......@@ -59,6 +65,7 @@ length = 100mm
position = 0mm 0mm 0mm
orientation = 0 0deg 0deg
material = "lead"
role = "passive"
# Placement of a cylinder made of lead, with a hollow opening, starting the building at an angle of 60deg and continue for 270deg
[cylinder3]
......@@ -71,6 +78,7 @@ arc_length = 270deg
position = -200mm 0mm 0mm
orientation = 0 0deg 0deg
material = "lead"
role = "passive"
# Placement of a cylinder made of the world material, inside cylinder2
[cylinder4]
......@@ -80,7 +88,8 @@ length = 50mm
position = 0mm 0mm 0mm
orientation = 0 0deg 0deg
material = "world_material"
mother_volume = cylinder2_log
mother_volume = cylinder2
role = "passive"
# Placement of a sphere made of lead
[sphere1]
......@@ -89,6 +98,7 @@ outer_radius = 50mm
position = 200mm -200mm 0mm
orientation = 0 0deg 0deg
material = "lead"
role = "passive"
# Placement of a sphere made of lead, with a hollow opening, starting the building at a phi angle of 90deg and continue for 180deg.
[sphere2]
......@@ -100,6 +110,7 @@ arc_length_phi = 180deg
position = 0mm -200mm 0mm
orientation = 0 0deg 0deg
material = "lead"
role = "passive"
# Placement of a sphere made of lead, starting the building at a theta angle of 0deg and continue for 45deg.
[sphere3]
......@@ -109,6 +120,7 @@ arc_length_theta = 45deg
position = -200mm -200mm 0mm
orientation = 0 -90deg 0deg
material = "lead"
role = "passive"
......
# Timepix4 with 2x448x256 pixel matrices, three hidden peripheries
# Here, additional 450um excess are added at top and bottom edge for wire-bond pads.
# Remove for TSV chip version.
type = "hybrid"
number_of_pixels = 448 512
pixel_size = 55um 55um
sensor_thickness = 300um
sensor_excess = 1mm
bump_sphere_radius = 9.0um
bump_cylinder_radius = 7.0um
bump_height = 20.0um
chip_thickness = 700um
chip_excess_left = 30um
chip_excess_right = 30um
chip_excess_top = 450um
chip_excess_bottom = 450um
[support]
thickness = 1.76mm
size = 47mm 79mm
offset = 0 -17.25mm
......@@ -167,6 +167,11 @@ void ModuleManager::load(Messenger* messenger, ConfigManager* conf_manager, Geom
LOG(ERROR) << "Library could not be loaded: one of its dependencies is missing" << std::endl
<< "The name of the missing library is " << problem_lib << std::endl
<< "Please make sure the library is properly initialized and try again";
} else if(lib_error != nullptr && std::strstr(lib_error, "undefined symbol") != nullptr) {
LOG(ERROR) << "Library could not be loaded: library version does not match framework (undefined symbols)"
<< std::endl
<< "The name of the problematic library is " << problem_lib << std::endl
<< "Please make sure the library is compiled against the correct framework version";
} else {
LOG(ERROR) << "Library could not be loaded: it is not available" << std::endl
<< " - Did you enable the library during building? " << std::endl
......
......@@ -51,7 +51,7 @@ namespace allpix {
/**
* @brief Erases the queue and release waiting threads on destruction
*/
~SafeQueue();
~SafeQueue() { invalidate(); };
/**
* @brief Get the top value from the appropriate queue
......
......@@ -16,8 +16,6 @@ namespace allpix {
ThreadPool::SafeQueue<T>::SafeQueue(unsigned int max_standard_size, unsigned max_priority_size)
: max_standard_size_(max_standard_size), max_priority_size_(max_priority_size) {}
template <typename T> ThreadPool::SafeQueue<T>::~SafeQueue() { invalidate(); }
/*
* Block until a value is available if the wait parameter is set to true. The wait exits when the queue is invalidated.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment