Skip to content

Commit

Permalink
Merge pull request #132 from martinschwinzerl/feature/sc_interpol
Browse files Browse the repository at this point in the history
Released SixTrackLib v0.6.0
  • Loading branch information
martinschwinzerl authored Nov 5, 2020
2 parents 947643d + c2475f9 commit 6893b94
Show file tree
Hide file tree
Showing 382 changed files with 75,272 additions and 17,384 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,22 @@ message( STATUS "---- cmake_module_path: ${CMAKE_MODULE_PATH}" )

include(CheckLanguage)

include( SetupGit )
include( SetupFeatures )
include( SetupC99 )
include( SetupCxx )
include( SetupPython )
include( SetupGit )

# ------------------------------------------------------------------------------
# Unit-testing:

include( SetupUnitTesting )

# ------------------------------------------------------------------------------
# toml:

include( SetupToml )

# ------------------------------------------------------------------------------
# MPFR4:

Expand Down
33 changes: 20 additions & 13 deletions Settings.cmake.default
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ option( SIXTRACKL_BUILD_EXAMPLES "Build sixtracklib examples" OFF )
option( SIXTRACKL_ENABLE_PROGRAMM_TESTS "Enable programmatic unit-tests" OFF )
option( SIXTRACKL_ENABLE_BENCHMARK_TESTS "Enable benchmark tests" OFF )

# ------------------------------------------------------------------------------
# ---- SixTrackLib Features:

# Track features: allowed values are enabled, disabled, or skip:

set( SIXTRACKL_TRACK_BEAMBEAM4D "enabled" CACHE STRING "" )
set( SIXTRACKL_TRACK_BEAMBEAM6D "enabled" CACHE STRING "" )
set( SIXTRACKL_TRACK_SPACECHARGE "enabled" CACHE STRING "" )
set( SIXTRACKL_TRACK_TRICUB "disabled" CACHE STRING "" )

# Aperture check features: allowed values are always, never, conditional

set( SIXTRACKL_APERTURE_CHECK_AT_DRIFT "always" CACHE STRING "" )

# ------------------------------------------------------------------------------
# CPU/System architecture settings:

Expand All @@ -47,24 +61,15 @@ set( SIXTRACKL_DEFAULT_C99_FLAGS
set( SIXTRACKL_DEFAULT_CXX_FLAGS
"-Wall -Werror -pedantic -ansi -fno-fast-math" )

# ------------------------------------------------------------------------------
# ---- SixTrackLib Features:

option( SIXTRACKL_ENABLE_APERTURE_CHECK "Enable xy - aperture check" ON )


# ==============================================================================
# ==== Detailed settings:

# ------------------------------------------------------------------------------
# ---- SixTrackLib detailed features settings:

set( SIXTRACKL_APERTURE_X_LIMIT_VALUE "1.0"
CACHE STRING "Aperture check x limit" FORCE )

set( SIXTRACKL_APERTURE_Y_LIMIT_VALUE "1.0"
CACHE STRING "Aperture check y limit" FORCE )

set( SIXTRACKL_APERTURE_X_LIMIT_VALUE "1.0" CACHE STRING "" )
set( SIXTRACKL_APERTURE_Y_LIMIT_VALUE "1.0" CACHE STRING "" )
set( SIXTRACKL_APERTURE_CHECK_MIN_DRIFT_LENGTH "0.0" CACHE STRING "" )

# ------------------------------------------------------------------------------
# Installation detailed setings
Expand Down Expand Up @@ -117,6 +122,9 @@ endif()
# OpenCL 1.x related detailed settings

if( SIXTRACKL_ENABLE_OPENCL )
set( SIXTRACKL_OPENCL_DEFAULT_COMPILER_FLAGS "-w -Werror" CACHE STRING
"Default run-time compiler options for OpenCL" )

set( SIXTRACKL_MIN_OPENCL_VERSION "110" CACHE STRING
"Minimal expected OpenCL 1.x version" )

Expand Down Expand Up @@ -162,6 +170,5 @@ set( SIXTRACKL_CXX_NAMESPACE "sixtrack" CACHE STRING
set( SIXTRACKL_C_NAMESPACE_PREFIX "st_" CACHE STRING
"SixTrackLib C-Namespace prefix (default: st_)" )


# ==============================================================================
# end: Settings.cmake.default | Settings.cmake
50 changes: 50 additions & 0 deletions cmake/SetupAutoVecSIMD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,63 @@ if( NOT SIXTRACKL_CMAKE_SETUP_AUTOVEC_SIMD_FINISHED )
# and track its state:

list( APPEND SIXTRACKLIB_SUPPORTED_MODULES "AUTOVECTORIZATION" )
set( SIXTRACKL_C_ENABLED_AUTOVEC_FLAGS )
set( SIXTRACKL_C_DISABLED_AUTOVEC_FLAGS )

if( CMAKE_C_COMPILER_ID STREQUAL "Clang" )
set( SIXTRACKL_C_DISABLED_AUTOVEC_FLAGS -fno-slp-vectorize )
elseif( CMAKE_C_COMPILER_ID STREQUAL "GNU" )
set( SIXTRACKL_C_ENABLED_AUTOVEC_FLAGS
-ftree-vectorize -ftree-vectorizer-verbose=6
-fopt-info-loop
-fno-fast-math
--param vect-max-version-for-alias-checks=150 )
set( SIXTRACKL_DEFAULT_C_NOAUTOVEC_FLAGS -fno-tree-vectorize )
endif()

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

set( SIXTRACKL_CXX_ENABLED_AUTOVEC_FLAGS )
set( SIXTRACKL_CXX_DISABLED_AUTOVEC_FLAGS )

if( SIXTRACKL_ENABLE_CXX )
if( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
set( SIXTRACKL_CXX_DISABLED_AUTOVEC_FLAGS -fno-slp-vectorize )
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
set( SIXTRACKL_CXX_ENABLED_AUTOVEC_FLAGS
-ftree-vectorize -ftree-vectorizer-verbose=6
-fopt-info-loop
-fno-fast-math
--param vect-max-version-for-alias-checks=150 )
set( SIXTRACKL_CXX_DISABLED_AUTOVEC_FLAGS -fno-tree-vectorize )
endif()
endif()

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

set( SIXTRACKL_C99_AUTOVEC_FLAGS )
set( SIXTRACKL_CXX_AUTOVEC_FLAGS )

if( SIXTRACKL_ENABLE_AUTOVECTORIZATION )
list( APPEND SIXTRACKLIB_SUPPORTED_MODULES_VALUES "1" )
set( SIXTRACKL_C99_AUTOVEC_FLAGS ${SIXTRACKL_C_ENABLED_AUTOVEC_FLAGS} )

if( SIXTRACKL_ENABLE_CXX )
set( SIXTRACKL_CXX_AUTOVEC_FLAGS
${SIXTRACKL_CXX_ENABLED_AUTOVEC_FLAGS} )
endif()
else()
list( APPEND SIXTRACKLIB_SUPPORTED_MODULES_VALUES "0" )
set( SIXTRACKL_C99_AUTOVEC_FLAGS
${SIXTRACKL_C_DISABLED_AUTOVEC_FLAGS} )

if( SIXTRACKL_ENABLE_C99 )
set( SIXTRACKL_C99_AUTOVEC_FLAGS
${SIXTRACKL_C99_ENABLED_AUTOVEC_FLAGS} )
endif()
endif()

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

list( APPEND SIXTRACKLIB_SUPPORTED_MODULES "MANUAL_SIMD" )

Expand Down
13 changes: 4 additions & 9 deletions cmake/SetupC99.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ if( NOT SETUP_C99_FINISHED )
# --------------------------------------------------------------------------
# Prepare default c99 compiler flags

if( SIXTRACKL_DEFAULT_C99_FLAGS )
string( REPLACE " " ";" SIXTRL_C99_FLAGS
${SIXTRACKL_DEFAULT_C99_FLAGS} )

if( SIXTRL_C99_FLAGS )
set( SIXTRACKLIB_C99_FLAGS
${SIXTRACKLIB_C99_FLAGS} ${SIXTRL_C99_FLAGS} )
endif()
set( SIXTRACKLIB_C99_FLAGS )

if( SIXTRACKL_DEFAULT_C99_FLAGS )
string( REPLACE " " ";"
SIXTRACKLIB_C99_FLAGS ${SIXTRACKL_DEFAULT_C99_FLAGS} )
endif()

endif()
14 changes: 4 additions & 10 deletions cmake/SetupCxx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ if( NOT SETUP_CXX_FINISHED )
else()
list( APPEND SIXTRACKLIB_SUPPORTED_BINDINGS_VALUES "0" )
endif()

# --------------------------------------------------------------------------
# Prepare default cxx compiler flags


set( SIXTRACKLIB_CXX_FLAGS )
if( SIXTRACKL_DEFAULT_CXX_FLAGS )
string( REPLACE " " ";" SIXTRL_CXX_FLAGS
string( REPLACE " " ";" SIXTRACKLIB_CXX_FLAGS
${SIXTRACKL_DEFAULT_CXX_FLAGS} )

if( SIXTRL_CXX_FLAGS )
set( SIXTRACKLIB_CXX_FLAGS
${SIXTRACKLIB_CXX_FLAGS} ${SIXTRL_CXX_FLAGS} )
endif()

endif()

endif()
157 changes: 157 additions & 0 deletions cmake/SetupFeatures.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
if( NOT SETUP_SIXTRL_FEATURES_FINISHED )
set( SETUP_SIXTRL_FEATURES_FINISHED 1 )

# -------------------------------------------------------------------------
# Track features setup

set_property( CACHE SIXTRACKL_TRACK_BEAMBEAM4D
SIXTRACKL_TRACK_BEAMBEAM6D
SIXTRACKL_TRACK_SPACECHARGE
SIXTRACKL_TRACK_TRICUB
PROPERTY STRINGS enabled disabled skip )

set( SIXTRL_TRACK_MAP_ENABLED_VALUE "2" )
set( SIXTRL_TRACK_MAP_SKIP_VALUE "1" )
set( SIXTRL_TRACK_MAP_DISABLED_VALUE "0" )

set_property( CACHE SIXTRACKL_TRACK_BEAMBEAM4D PROPERTY HELPSTRING
"Track over beam-beam 4D beam element" )

if( SIXTRACKL_TRACK_BEAMBEAM4D )
if( "${SIXTRACKL_TRACK_BEAMBEAM4D}" STREQUAL "skip" )
set( SIXTRL_TRACK_BEAMBEAM4D_FLAG "${SIXTRL_TRACK_MAP_SKIP_VALUE}" )
set( SIXTRL_TRACK_BEAMBEAM4D_FLAG_STR "skip" )
elseif( "${SIXTRACKL_TRACK_BEAMBEAM4D}" STREQUAL "disabled" )
set( SIXTRL_TRACK_BEAMBEAM4D_FLAG "${SIXTRL_TRACK_MAP_DISABLED_VALUE}" )
set( SIXTRL_TRACK_BEAMBEAM4D_FLAG_STR "disabled" )
else()
set( SIXTRL_TRACK_BEAMBEAM4D_FLAG "${SIXTRL_TRACK_MAP_ENABLED_VALUE}" )
set( SIXTRL_TRACK_BEAMBEAM4D_FLAG_STR "enabled" )
endif()
endif()

set_property( CACHE SIXTRACKL_TRACK_BEAMBEAM6D PROPERTY HELPSTRING
"Track over beam-beam 6D beam element" )

if( SIXTRACKL_TRACK_BEAMBEAM6D )
if( "${SIXTRACKL_TRACK_BEAMBEAM6D}" STREQUAL "skip" )
set( SIXTRL_TRACK_BEAMBEAM6D_FLAG "${SIXTRL_TRACK_MAP_SKIP_VALUE}" )
set( SIXTRL_TRACK_BEAMBEAM6D_FLAG_STR "skip" )
elseif( "${SIXTRACKL_TRACK_BEAMBEAM6D}" STREQUAL "disabled" )
set( SIXTRL_TRACK_BEAMBEAM6D_FLAG "${SIXTRL_TRACK_MAP_DISABLED_VALUE}" )
set( SIXTRL_TRACK_BEAMBEAM6D_FLAG_STR "disabled" )
else()
set( SIXTRL_TRACK_BEAMBEAM6D_FLAG "${SIXTRL_TRACK_MAP_ENABLED_VALUE}" )
set( SIXTRL_TRACK_BEAMBEAM6D_FLAG_STR "enabled" )
endif()
endif()

set_property( CACHE SIXTRACKL_TRACK_SPACECHARGE PROPERTY HELPSTRING
"Track over frozen space-charge beam element" )

if( SIXTRACKL_TRACK_SPACECHARGE )
if( "${SIXTRACKL_TRACK_SPACECHARGE}" STREQUAL "skip" )
set( SIXTRL_TRACK_SC_FLAG "${SIXTRL_TRACK_MAP_SKIP_VALUE}" )
set( SIXTRL_TRACK_SC_FLAG_STR "skip" )
elseif( "${SIXTRACKL_TRACK_SPACECHARGE}" STREQUAL "disabled" )
set( SIXTRL_TRACK_SC_FLAG "${SIXTRL_TRACK_MAP_DISABLED_VALUE}" )
set( SIXTRL_TRACK_SC_FLAG_STR "disabled" )
else()
set( SIXTRL_TRACK_SC_FLAG "${SIXTRL_TRACK_MAP_ENABLED_VALUE}" )
set( SIXTRL_TRACK_SC_FLAG_STR "enabled" )
endif()
endif()

set_property( CACHE SIXTRACKL_TRACK_TRICUB PROPERTY HELPSTRING
"Track over tri-cub interpolation beam elements" )

if( SIXTRACKL_TRACK_TRICUB )
if( "${SIXTRACKL_TRACK_TRICUB}" STREQUAL "skip" )
set( SIXTRL_TRACK_TRICUB_FLAG "${SIXTRL_TRACK_MAP_SKIP_VALUE}" )
set( SIXTRL_TRACK_TRICUB_FLAG_STR "skip" )
elseif( "${SIXTRACKL_TRACK_TRICUB}" STREQUAL "disabled" )
set( SIXTRL_TRACK_TRICUB_FLAG "${SIXTRL_TRACK_MAP_DISABLED_VALUE}" )
set( SIXTRL_TRACK_TRICUB_FLAG_STR "disabled" )
else()
set( SIXTRL_TRACK_TRICUB_FLAG "${SIXTRL_TRACK_MAP_ENABLED_VALUE}" )
set( SIXTRL_TRACK_TRICUB_FLAG_STR "enabled" )
endif()
endif()

set( SIXTRL_TRACK_FEATURES_INSTALL_STR
"set( SIXTRL_TRACK_MAP_ENABLED_VALUE \"${SIXTRL_TRACK_MAP_ENABLED_VALUE}\" )
set( SIXTRL_TRACK_MAP_SKIP_VALUE \"${SIXTRL_TRACK_MAP_SKIP_VALUE}\" )
set( SIXTRL_TRACK_MAP_DISABLED_VALUE \"${SIXTRL_TRACK_MAP_DISABLED_VALUE}\" )
set( SIXTRL_TRACK_BEAMBEAM4D_FLAG \"${SIXTRL_TRACK_BEAMBEAM4D_FLAG}\" )
set( SIXTRL_TRACK_BEAMBEAM4D_FLAG_STR \"${SIXTRL_TRACK_BEAMBEAM4D_FLAG_STR}\" )
set( SIXTRL_TRACK_BEAMBEAM6D_FLAG \"${SIXTRL_TRACK_BEAMBEAM4D_FLAG}\" )
set( SIXTRL_TRACK_BEAMBEAM6D_FLAG_STR \"${SIXTRL_TRACK_BEAMBEAM4D_FLAG_STR}\" )
set( SIXTRL_TRACK_SPACECHARGE_FLAG \"${SIXTRL_TRACK_SPACECHARGE_FLAG}\" )
set( SIXTRL_TRACK_SPACECHARGE_FLAG_STR \"${SIXTRL_TRACK_SPACECHARGE_FLAG_STR}\" )
set( SIXTRL_TRACK_TRICUB_FLAG \"${SIXTRL_TRACK_TRICUB_FLAG}\"
set( SIXTRL_TRACK_TRICUB_FLAG_STR \"${SIXTRL_TRACK_TRICUB_FLAG_STR}\" )" )


# -------------------------------------------------------------------------
# Aperture check features:

set_property( CACHE SIXTRACKL_APERTURE_CHECK_AT_DRIFT PROPERTY HELPSTRING
"Perform an x-y aperture check at Drift and DriftExact beam elements" )

set_property( CACHE SIXTRACKL_APERTURE_CHECK_AT_DRIFT
PROPERTY STRINGS always conditional never )

set( SIXTRL_GLOBAL_APERATURE_CHECK_ALWAYS_VALUE "2" )
set( SIXTRL_GLOBAL_APERATURE_CHECK_CONDITIONAL_VALUE "1" )
set( SIXTRL_GLOBAL_APERATURE_CHECK_NEVER_VALUE "0" )

if( SIXTRACKL_APERTURE_CHECK_AT_DRIFT )
if( "${SIXTRACKL_APERTURE_CHECK_AT_DRIFT}" STREQUAL "never" )
set( SIXTRL_APERTURE_CHECK_AT_DRIFT_FLAG
"${SIXTRL_GLOBAL_APERATURE_CHECK_NEVER_VALUE}" )
set( SIXTRL_APERTURE_CHECK_AT_DRIFT_FLAG_STR "never" )
elseif( "${SIXTRACKL_APERTURE_CHECK_AT_DRIFT}" STREQUAL "conditional" )
set( SIXTRL_APERTURE_CHECK_AT_DRIFT_FLAG
"${SIXTRL_GLOBAL_APERATURE_CHECK_CONDITIONAL_VALUE}" )
set( SIXTRL_APERTURE_CHECK_AT_DRIFT_FLAG_STR "conditional" )
else()
set( SIXTRL_APERTURE_CHECK_AT_DRIFT_FLAG
"${SIXTRL_GLOBAL_APERATURE_CHECK_ALWAYS_VALUE}" )
set( SIXTRL_APERTURE_CHECK_AT_DRIFT_FLAG_STR "always" )
endif()
endif()

set_property( CACHE SIXTRACKL_APERTURE_X_LIMIT_VALUE PROPERTY ADVANCED )
set_property( CACHE SIXTRACKL_APERTURE_X_LIMIT_VALUE PROPERTY HELPSTRING
"Global aperture check limit for x [m]" )

set_property( CACHE SIXTRACKL_APERTURE_Y_LIMIT_VALUE PROPERTY ADVANCED )
set_property( CACHE SIXTRACKL_APERTURE_Y_LIMIT_VALUE PROPERTY HELPSTRING
"Global aperture check limit for y [m]" )

set_property( CACHE SIXTRACKL_APERTURE_CHECK_MIN_DRIFT_LENGTH
PROPERTY HELPSTRING
"Perform conditional aperture checks for Drift and DriftExact elements with lengths larger than this [m]" )

set_property( CACHE SIXTRACKL_APERTURE_CHECK_MIN_DRIFT_LENGTH
PROPERTY ADVANCED )

set( SIXTRL_APERTURE_CHECK_FEATURES_INSTALL_STR
"set( SIXTRL_GLOBAL_APERATURE_CHECK_ALWAYS_VALUE
\"${SIXTRL_GLOBAL_APERATURE_CHECK_ALWAYS_VALUE}\" )
set( SIXTRL_GLOBAL_APERATURE_CHECK_ALWAYS_VALUE_STR
\"${SIXTRL_GLOBAL_APERATURE_CHECK_ALWAYS_VALUE_STR}\" )
set( SIXTRL_GLOBAL_APERATURE_CHECK_CONDITIONAL_VALUE
\"${SIXTRL_GLOBAL_APERATURE_CHECK_CONDITIONAL_VALUE}\" )
set( SIXTRL_GLOBAL_APERATURE_CHECK_NEVER_VALUE
\"${SIXTRL_GLOBAL_APERATURE_CHECK_NEVER_VALUE}\" )
set( SIXTRL_APERTURE_CHECK_AT_DRIFT_FLAG
\"${SIXTRL_APERTURE_CHECK_AT_DRIFT_FLAG}\" )
set( SIXTRACKL_APERTURE_X_LIMIT_VALUE
\"${SIXTRACKL_APERTURE_X_LIMIT_VALUE}\" )
set( SIXTRACKL_APERTURE_Y_LIMIT_VALUE
\"${SIXTRACKL_APERTURE_Y_LIMIT_VALUE}\" )
set( SIXTRACKL_APERTURE_CHECK_MIN_DRIFT_LENGTH
\"${SIXTRACKL_APERTURE_CHECK_MIN_DRIFT_LENGTH}\" )" )

endif()
Loading

0 comments on commit 6893b94

Please sign in to comment.