Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,28 @@ option(IPPL_ENABLE_TESTS "Build integration tests in test/ directory" OFF)
option(IPPL_ENABLE_COVERAGE "Enable code coverage" OFF)
option(IPPL_ENABLE_NSYS_PROFILER "Enable Nvidia Nsys Profiler" OFF)
option(IPPL_ENABLE_SANITIZER "Enable sanitizer(s)" OFF)
option(IPPL_ENABLE_ALIGNED_COMMUNICATION_BUFFERS "Enable aligned memory buffersvfor communication"
OFF)
option(IPPL_USE_ALTERNATIVE_VARIANT
"Use modified variant implementation (required for CUDA 12.2 + GCC 12.3.0)" OFF)
option(IPPL_USE_STANDARD_FOLDERS "Put all generated binaries in bin/lib folders" OFF)
option(IPPL_MARK_FAILING_TESTS
"Prefix names of tests that are known to fail with 'known_fail' for filtering with ctest"
OFF)
option(IPPL_ENABLE_SCRIPTS "Generate job script templates for some benchmarks/tests" OFF)
option(IPPL_GPU_AWARE_MPI "Allow MPI to/from from device memory buffers" OFF)
# logging options
set(IPPL_LOG_LEVEL "off" CACHE STRING "Enable logging for messages of >=level")
set_property(
CACHE IPPL_LOG_LEVEL
PROPERTY STRINGS
off
trace
debug
info
warn
error
critical)

# "Build IPPL as a shared library (ON) or static library (OFF)" OFF) if(IPPL_DYL)
# set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE) message(WARNING "IPPL_DYL is deprecated; use
Expand Down Expand Up @@ -99,21 +114,6 @@ if(DEFINED USE_ALTERNATIVE_VARIANT)
set(IPPL_USE_ALTERNATIVE_VARIANT ${USE_ALTERNATIVE_VARIANT} CACHE BOOL "" FORCE)
endif()

# ------------------------------------------------------------------------------
# Debug: This tells the compiler to replace occurrences of ${<DIR>} with <x> in debug info and error
# messages.
# ------------------------------------------------------------------------------
add_compile_options(
$<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang,GNU>:-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.>
$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang,GNU>:-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.>)

if(DEFINED FETCHCONTENT_BASE_DIR)
add_compile_options(
$<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang,GNU>:-ffile-prefix-map=${FETCHCONTENT_BASE_DIR}=.3p>
$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang,GNU>:-ffile-prefix-map=${FETCHCONTENT_BASE_DIR}=.3p>
)
endif()

# ------------------------------------------------------------------------------
# Define sources for project
# ------------------------------------------------------------------------------
Expand Down
10 changes: 8 additions & 2 deletions alpine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ endfunction()

if(IPPL_ENABLE_TESTS)
# cmake-format: off
# Landau will write a CSV file to the data directory that we will validate later
make_directory("${PROJECT_BINARY_DIR}/alpine/data")
# Add the test
add_ippl_integration_test(LandauDamping
ARGS 16 16 16 10000000 10 FFT 0.01 LeapFrog --overallocate 2.0 --info 10
LABELS alpine integration)
ARGS "16" "16" "16" "10000000" "25" "FFT" "0.01" "LeapFrog" "--overallocate" "2.0" "--info" "10"
LABELS alpine integration
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/alpine/")
# cmake-format: on
else()
add_alpine_example(LandauDamping)
endif()

add_alpine_example(PenningTrap)
add_alpine_example(BumponTailInstability)

add_subdirectory(validation)
9 changes: 7 additions & 2 deletions alpine/LandauDamping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,22 @@ const char* TestName = "LandauDamping";
#include "Manager/datatypes.h"

#include "Utility/IpplTimings.h"
#include "Utility/Logging.h"

#include "LandauDampingManager.h"
#include "Manager/PicManager.h"

int main(int argc, char* argv[]) {
#if defined(SPDLOG_ACTIVE_LEVEL) && (SPDLOG_ACTIVE_LEVEL != SPDLOG_LEVEL_OFF)
spdlog::set_pattern("[%^%-8l%$]%t| %v");
spdlog::set_level(spdlog::level::trace);
#endif
ippl::initialize(argc, argv);
{
Inform msg(TestName);
Inform msg2all(TestName, INFORM_ALL_NODES);

static IpplTimings::TimerRef mainTimer = IpplTimings::getTimer("total");
static IpplTimings::TimerRef mainTimer = IpplTimings::getTimer("total");
static IpplTimings::TimerRef initializeTimer = IpplTimings::getTimer("initialize");
IpplTimings::startTimer(mainTimer);
IpplTimings::startTimer(initializeTimer);
Expand Down Expand Up @@ -82,7 +87,7 @@ int main(int argc, char* argv[]) {
manager.pre_run();

IpplTimings::stopTimer(initializeTimer);

manager.setTime(0.0);

msg << "Starting iterations ..." << endl;
Expand Down
23 changes: 23 additions & 0 deletions alpine/validation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -----------------------------------------------------------------------------
# validation check for LandauDamping test
# -----------------------------------------------------------------------------

if(BUILD_TESTING)
# Build the C++ correctness validation test
add_executable(LandauDampingCorrectness LandauDampingCorrectness.cpp)

message("Adding test: LandauDampingCorrectness")

# command line params are : output, reference, tolerance
add_test(
NAME LandauDampingCorrectnessValidation
COMMAND LandauDampingCorrectness "${PROJECT_BINARY_DIR}/alpine/data/FieldLandau_2_manager.csv"
"${PROJECT_SOURCE_DIR}/alpine/validation/FieldLandau_valid_result.csv" "4E-1"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/alpine/")

set_tests_properties(
LandauDampingCorrectnessValidation
PROPERTIES LABELS "validation;alpine" TIMEOUT 30
# This test should only run if the LandauDamping integration test passed
DEPENDS LandauDamping)
endif()
27 changes: 27 additions & 0 deletions alpine/validation/FieldLandau_valid_result.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
time, Ex_field_energy, Ex_max_norm
0.0000000000000000e+00 9.6742715140721582e+00 1.0825163128256524e-01
5.0000000000000003e-02 9.6368948973459112e+00 1.0808994906148438e-01
1.0000000000000001e-01 9.5415075224669970e+00 1.0740779743767520e-01
1.5000000000000002e-01 9.3882773328014082e+00 1.0630178072727425e-01
2.0000000000000001e-01 9.1791183371635334e+00 1.0482602738140372e-01
2.5000000000000000e-01 8.9172134334449193e+00 1.0306560288960222e-01
2.9999999999999999e-01 8.6061662103776140e+00 1.0113820775231776e-01
3.4999999999999998e-01 8.2505504653792148e+00 9.8691447720593309e-02
3.9999999999999997e-01 7.8550417931569703e+00 9.5598706257118735e-02
4.4999999999999996e-01 7.4249700904468465e+00 9.2872937917417214e-02
4.9999999999999994e-01 6.9653510910124385e+00 9.0033318617501135e-02
5.4999999999999993e-01 6.4822476651919327e+00 8.7257335757243495e-02
5.9999999999999998e-01 5.9816257151911403e+00 8.4644036660629890e-02
6.5000000000000002e-01 5.4696405485153790e+00 8.2154906259950061e-02
7.0000000000000007e-01 4.9535573676676501e+00 7.9019365369956629e-02
7.5000000000000011e-01 4.4392121571874581e+00 7.5190519676643197e-02
8.0000000000000016e-01 3.9321278953403862e+00 7.1054552970285123e-02
8.5000000000000020e-01 3.4384135389096344e+00 6.6356647790906387e-02
9.0000000000000024e-01 2.9638108812800437e+00 6.1694793644303261e-02
9.5000000000000029e-01 2.5131142881540285e+00 5.7498634682739851e-02
1.0000000000000002e+00 2.0909400590908556e+00 5.3113907328247389e-02
1.0500000000000003e+00 1.7017166009804880e+00 4.8965793799131234e-02
1.1000000000000003e+00 1.3486230947669464e+00 4.4410412852319857e-02
1.1500000000000004e+00 1.0343505136217537e+00 3.9926242617971765e-02
1.2000000000000004e+00 7.6105675926529781e-01 3.5819185614705762e-02
1.2500000000000004e+00 5.3020078549605387e-01 3.1521337179656390e-02
Loading