Skip to content
Open
18 changes: 13 additions & 5 deletions sixtracklib/common/internal/track_job_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ namespace SIXTRL_CXX_NAMESPACE
return this->doTrackUntilTurn( until_turn );
}

_this_t::track_status_t TrackJobBase::trackUntil(
_this_t::size_type const until_turn )
{
return this->doTrackUntilTurn( until_turn );
}

_this_t::track_status_t TrackJobBase::trackElemByElem(
_this_t::size_type const until_turn )
{
Expand Down Expand Up @@ -443,7 +449,7 @@ namespace SIXTRL_CXX_NAMESPACE
return this->m_type_str.c_str();
}

bool TrackJobBase::hasDeviceIdStr() const SIXTRL_RESTRICT
bool TrackJobBase::hasDeviceIdStr() const SIXTRL_NOEXCEPT
{
return ( !this->m_device_id_str.empty() );
}
Expand Down Expand Up @@ -707,15 +713,15 @@ namespace SIXTRL_CXX_NAMESPACE
return size_t{ 0 };
}

_this_t::buffer_t* TrackJobBase::ptrOutputBuffer() SIXTRL_RESTRICT
_this_t::buffer_t* TrackJobBase::ptrOutputBuffer() SIXTRL_NOEXCEPT
{
using ptr_t = _this_t::buffer_t*;

return const_cast< ptr_t >( static_cast< _this_t const& >(
*this ).ptrOutputBuffer() );
}

_this_t::buffer_t* TrackJobBase::ptrOutputBuffer() const SIXTRL_RESTRICT
_this_t::buffer_t* TrackJobBase::ptrOutputBuffer() const SIXTRL_NOEXCEPT
{
SIXTRL_ASSERT(
( this->m_ptr_output_buffer == nullptr ) ||
Expand All @@ -726,7 +732,7 @@ namespace SIXTRL_CXX_NAMESPACE
}

_this_t::c_buffer_t*
TrackJobBase::ptrCOutputBuffer() SIXTRL_RESTRICT
TrackJobBase::ptrCOutputBuffer() SIXTRL_NOEXCEPT
{
using ptr_t = _this_t::c_buffer_t*;

Expand All @@ -735,7 +741,7 @@ namespace SIXTRL_CXX_NAMESPACE
}

_this_t::c_buffer_t const*
TrackJobBase::ptrCOutputBuffer() const SIXTRL_RESTRICT
TrackJobBase::ptrCOutputBuffer() const SIXTRL_NOEXCEPT
{
SIXTRL_ASSERT(
( this->m_ptr_output_buffer == nullptr ) ||
Expand Down Expand Up @@ -1334,6 +1340,8 @@ namespace SIXTRL_CXX_NAMESPACE
_this_t::ptr_elem_by_elem_config_t;

SIXTRL_ASSERT( particles_buffer != nullptr );
( void )particles_buffer;

SIXTRL_ASSERT( !::NS(Buffer_needs_remapping)( particles_buffer ) );

SIXTRL_ASSERT( ( ::NS(Buffer_get_num_of_objects)( particles_buffer ) ==
Expand Down
13 changes: 8 additions & 5 deletions sixtracklib/common/internal/track_job_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ namespace SIXTRL_CXX_NAMESPACE
SIXTRL_HOST_FN track_status_t track(
size_type const until_turn );

SIXTRL_HOST_FN track_status_t trackUntil(
size_type const until_turn );

SIXTRL_HOST_FN track_status_t trackElemByElem(
size_type const until_turn_elem_by_elem );

Expand Down Expand Up @@ -192,7 +195,7 @@ namespace SIXTRL_CXX_NAMESPACE
SIXTRL_HOST_FN std::string const& typeStr() const SIXTRL_NOEXCEPT;
SIXTRL_HOST_FN char const* ptrTypeStr() const SIXTRL_NOEXCEPT;

SIXTRL_HOST_FN bool hasDeviceIdStr() const SIXTRL_RESTRICT;
SIXTRL_HOST_FN bool hasDeviceIdStr() const SIXTRL_NOEXCEPT;
SIXTRL_HOST_FN std::string const& deviceIdStr() const SIXTRL_NOEXCEPT;
SIXTRL_HOST_FN char const* ptrDeviceIdStr() const SIXTRL_NOEXCEPT;

Expand Down Expand Up @@ -266,13 +269,13 @@ namespace SIXTRL_CXX_NAMESPACE

SIXTRL_HOST_FN size_type numElemByElemTurns() const SIXTRL_NOEXCEPT;

SIXTRL_HOST_FN buffer_t* ptrOutputBuffer() SIXTRL_RESTRICT;
SIXTRL_HOST_FN buffer_t* ptrOutputBuffer() const SIXTRL_RESTRICT;
SIXTRL_HOST_FN buffer_t* ptrOutputBuffer() SIXTRL_NOEXCEPT;
SIXTRL_HOST_FN buffer_t* ptrOutputBuffer() const SIXTRL_NOEXCEPT;

SIXTRL_HOST_FN c_buffer_t* ptrCOutputBuffer() SIXTRL_RESTRICT;
SIXTRL_HOST_FN c_buffer_t* ptrCOutputBuffer() SIXTRL_NOEXCEPT;

SIXTRL_HOST_FN c_buffer_t const*
ptrCOutputBuffer() const SIXTRL_RESTRICT;
ptrCOutputBuffer() const SIXTRL_NOEXCEPT;

/* ----------------------------------------------------------------- */

Expand Down
1 change: 1 addition & 0 deletions sixtracklib/sixtracklib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

#include "sixtracklib/cuda/argument.hpp"
#include "sixtracklib/cuda/controller.hpp"
#include "sixtracklib/cuda/track_job.hpp"

#endif /* defined( SIXTRACKLIB_ENABLE_MODULE_OPENCL ) */

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ if( SIXTRACKL_ENABLE_PYTHON )
endif()

# Enable benchmarking tests
if( SIXTRACKL_ENABLE_TIMING_TESTS )
if( SIXTRACKL_ENABLE_BENCHMARK_TESTS )
add_subdirectory( benchmark )
endif()
20 changes: 9 additions & 11 deletions tests/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# tests/benchmark/CMakeLists.txt

if( SIXTRACKL_ENABLE_TIMING_TESTS )
set( TOMLC99_HEADERS toml.h )
set( TOMLC99_SOURCES toml.c )

set( BENCHMARK_LINK_LIBRARIES sixtrack_test sixtrack m dl )
add_library( ext_tomlc99 OBJECT ${TOMLC99_HEADERS} ${TOMLC99_SOURCES} )

add_subdirectory( common )
set( RUN_BENCHMARK_CXX_HEADERS )
set( RUN_BENCHMARK_CXX_SOURCES run_benchmark_cxx.cpp )

if( SIXTRACKL_ENABLE_OPENCL )
add_subdirectory( opencl )
endif()
add_executable( run_benchmark_cxx
${RUN_BENCHMARK_CXX_HEADERS} ${RUN_BENCHMARK_CXX_SOURCES}
$<TARGET_OBJECTS:ext_tomlc99> )

if( SIXTRACKL_ENABLE_CUDA )
add_subdirectory( cuda )
endif()

endif()
target_link_libraries( run_benchmark_cxx sixtrack_test sixtrack )

#end: tests/benchmark/CMakeLists.txt
44 changes: 44 additions & 0 deletions tests/benchmark/benchmark_template.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Example configuration for a benchmark run
name = "lhc_no_bb"
git_hash = "9da9a68"
git_branch = "benchmark"
output_path = "."

# Target configuration - configure the node to run the benchmark on
[target]
arch = "opencl"
node_id = "0.0"
config_str = ""
optimized = 1

x_stddev = 0.0 # All std deviations are relative, i.e.
y_stddev = 0.0 # sigma_x = < x > * x_stddev
px_stddev = 0.0 # sigma_y = < y > * y_stddev, etc.
py_stddev = 0.0 # stddev == 0.0 will be ignored and does not cause any
zeta_stddev = 0.0 # overhead
delta_stdev = 0.0

# Tracking configuration - configure the track items and the data sources
[track]
path_particle_dump = "../tests/testdata/lhc_no_bb/particles_dump.bin"
path_lattice_dump = "../tests/testdata/lhc_no_bb/beam_elements.bin"

num_particles = [
1, 2, 4, 8, 16, 32, 64,
128, 256, 512, 1024, 2048, 4096, 8192,
10000, 20000, 40000, 65536, 100000, 200000, 400000,
1000000, 2000000, 4000000, 8000000, 10000000, 20000000, 40000000, ]

num_turns = [
100, 100, 100, 100, 100, 50, 50,
50, 50, 20, 20, 20, 10, 10,
5, 5, 5, 5, 5, 5, 5,
2, 2, 2, 2, 2, 2, 2 ]

num_repetitions = [
10, 10, 10, 10, 10, 10, 10,
5, 5, 5, 5, 5, 5, 5,
3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3 ]

# end: benchmark_template.config
Loading