Skip to content

Commit

Permalink
#2291: Enable generation of LBDatafiles by all examples present in vt
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Jun 27, 2024
1 parent 4e81bf8 commit 6f543d4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-Dvt_tests_num_nodes="${VT_TESTS_NUM_NODES:-}" \
-Dvt_external_fmt="${VT_EXTERNAL_FMT:-0}" \
-Dvt_no_color_enabled="${VT_NO_COLOR_ENABLED:-0}" \
-Dvt_test_lb_schema="${TEST_LB_SCHEMA:-0}" \
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-17}" \
-DBUILD_SHARED_LIBS="${BUILD_SHARED_LIBS:-0}" \
"$VT"
Expand Down
1 change: 1 addition & 0 deletions cmake/configure_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ define_option(vt_werror_enabled "-Werror" "Build VT with -Werror enabled" OFF em
define_option(vt_build_tests "tests" "Build VT tests" ON empty_feature)
define_option(vt_build_tools "tools" "Build VT tools" ON empty_feature)
define_option(vt_build_examples "examples" "Build VT examples" ON empty_feature)
define_option(vt_test_lb_schema "lb schema tests" "Enable testing of LBDatafile schema" OFF empty_feature)

option(vt_external_fmt "Build VT with external fmt" OFF)
if(${vt_external_fmt})
Expand Down
18 changes: 16 additions & 2 deletions cmake/test_vt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ function(run_executable_with_mpi)
WRAPPER_EXECUTABLE
)
set(
multiValueArg
multiValueArgs
TARGET_ARGS
WRAPPER_ARGS
)
set(allKeywords ${noValOption} ${singleValArg} ${multiValueArg})

cmake_parse_arguments(
ARG "${noValOption}" "${singleValArg}" "${multiValueArgs}" ${ARGN}
)

# Stop the configurtion if there are any unparsed arguments
if (ARG_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "found unparsed arguments: ${ARG_UNPARSED_ARGUMENTS}")
endif()

if (NOT DEFINED ARG_EXECUTE_WITH_WRAPPER)
set(ARG_WRAPPER_EXECUTABLE "")
set(ARG_WRAPPER_ARGS "")
Expand Down Expand Up @@ -108,6 +112,16 @@ macro(add_test_for_example_vt test_target test_exec test_list)
list(APPEND EXEC_ARGS "--vt_trace")
endif()

# Append parameters required for the examples to output LBDatafiles.
if (vt_test_lb_schema)
list(APPEND EXEC_ARGS
"--vt_lb_interval=1"
"--vt_lb_data"
"--vt_lb_data_compress=false"
"--vt_lb_data_file=${test_name}_${PROC}_LBDatafile.%p.json"
"--vt_lb_data_dir=.")
endif()

run_executable_with_mpi(
TARGET_EXECUTABLE ${test_name}
TARGET_ARGS ${EXEC_ARGS}
Expand Down

0 comments on commit 6f543d4

Please sign in to comment.