Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement checkpoint/restart for RBC #800

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
cd8c08c
tidy up utility functions
rupertnash Jun 1, 2023
46f5d90
Simplify timers
rupertnash Jun 1, 2023
2b813f0
get colloids module compiling again
rupertnash Jun 2, 2023
5622a4f
slight modernisation of log
rupertnash Jun 2, 2023
cf1dca0
Improve timers a little
rupertnash Jun 2, 2023
1e48d49
Separate checkpointing out into its own Actor and update XML
rupertnash Jun 6, 2023
778875c
tidy up some numerical bits in util
rupertnash Jun 6, 2023
9d2ecf2
Modernise SiteDataBare a bit
rupertnash Jun 6, 2023
7fdb450
Add range for iteration of xml children
rupertnash Jun 9, 2023
f96bf4d
Update to TinyXML-2
rupertnash Jun 9, 2023
546b399
Separate the XML->SimConfig into own class
rupertnash Jun 28, 2023
f2e98b6
Ensure Catch2 version found is 2 not 3
rupertnash Aug 18, 2023
5f337c4
CMake: allow integers to be configured thru as such
rupertnash Aug 18, 2023
de7a8a4
Tidy CMake and use build_info more that macros
rupertnash Aug 18, 2023
a94a3c3
properly conceptify enumerate iterators
rupertnash Aug 18, 2023
93b119e
resolve XdrSerialisation optional
rupertnash Aug 18, 2023
217f01b
Bit of IWYU
rupertnash Aug 18, 2023
79ec2ca
Fix bug in file pressure iolet
rupertnash Aug 18, 2023
f8efea6
Have LocalPropertyOutput make a bit more data available to users for …
rupertnash Aug 18, 2023
5a50065
Fix null terminator bug in time pattern
rupertnash Aug 23, 2023
f4045de
Have timestep start at zero like any sane default
rupertnash Aug 23, 2023
eada3a0
tweak xml relative -> abs path
rupertnash Aug 23, 2023
3db7b99
Allow customisation of XML attribute serialisation
rupertnash Aug 24, 2023
4fc2828
Split SimConfigReader into its own files, add SimConfigWriter
rupertnash Aug 25, 2023
b0608b0
Rationalise RBC PRNGs
rupertnash Aug 25, 2023
615246d
Geometry tool: write xml in hexfloat to avoid loss of precision
rupertnash Aug 31, 2023
a914f2a
Add locale for correctly parsing hexadecimal floating point number
rupertnash Sep 6, 2023
ad7e216
Make RBC cell insert seed required
rupertnash Sep 12, 2023
3043c7f
Remove stress type from configuration #801
rupertnash Sep 12, 2023
4e1f589
minor mpi wrapper tidy to silence warnings
rupertnash Oct 5, 2023
f9c0c53
Remove cruft from test XML
rupertnash Oct 6, 2023
c76ef71
Mark the colloids as unmaintained
rupertnash Oct 9, 2023
6421b13
Have XML reading "consume" the doc to ensure no unknown stuff
rupertnash Oct 9, 2023
17df2ab
Silence warnings from HASSERT macro
rupertnash Oct 11, 2023
c941bc5
Use byte for raw data not char
rupertnash Oct 11, 2023
cdebe86
Tidy format description namespace
rupertnash Oct 26, 2023
b63d7de
Switch from mmHg to Pa for pressure inputs/outputs
rupertnash Nov 7, 2023
374ef27
Update extraction to write in lattice units and include scaling to ph…
rupertnash Nov 10, 2023
4e7fa05
Add output of RBC barycentres
rupertnash Nov 17, 2023
ac01628
Be consistent with centre/center
rupertnash Nov 17, 2023
e2d3116
Remove UB in wall cell pair iterator
rupertnash Dec 7, 2023
264741f
Tidy MPI CMake
rupertnash Dec 19, 2023
462e85c
Fix restart XML extraction path with extra quote marks
rupertnash Dec 20, 2023
af08256
Rename XML element for rbc templates from "cells" to "templates"
rupertnash Dec 20, 2023
9887f89
Switch domain and LBM to use indexes not counts for sites of differen…
rupertnash Jan 31, 2024
f99030b
Partially de-template StabilityTester and make master non-templated
rupertnash Feb 5, 2024
de0c2fd
Finish de-templating sim master, make RBC cope and move path manager …
rupertnash Jun 4, 2024
b4c1ba7
Minor MPI use tidying
rupertnash Jun 5, 2024
9d1cece
Rename SimulationMaster to Controller
rupertnash Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions CMake/HemeLbOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pass_group_declare(HEMELB)
pass_option(HEMELB HEMELB_CALLGRIND "Compile unit tests that use callgrind" OFF)
pass_option(HEMELB HEMELB_USE_KRUEGER_ORDERING "Use Krueger's LB-IBM algorithm reodering" ON)
pass_option(HEMELB HEMELB_BUILD_DEBUGGER "Build the built in debugger" ON)
pass_option(HEMELB HEMELB_BUILD_COLLOIDS "Build the colloids option" OFF)
pass_option(HEMELB HEMELB_BUILD_COLLOIDS "Build the UNMAINTAINED colloids option" OFF)
# pass_option(HEMELB HEMELB_DEBUGGER_IMPLEMENTATION "Which implementation to use for the debugger" none)
# mark_as_advanced(HEMELB_DEBUGGER_IMPLEMENTATION)
pass_option(HEMELB HEMELB_VALIDATE_GEOMETRY "Validate geometry" OFF)
Expand Down Expand Up @@ -99,5 +99,5 @@ pass_var(HEMELB METIS_INCLUDE_DIR)
pass_var(HEMELB METIS_LIBRARY)
pass_var(HEMELB ParMETIS_INCLUDE_DIR)
pass_var(HEMELB ParMETIS_LIBRARY)
pass_var(HEMELB TINYXML_INCLUDE_DIR)
pass_var(HEMELB TINYXML_LIBRARIES)
pass_var(HEMELB TINYXML2_INCLUDE_DIR)
pass_var(HEMELB TINYXML2_LIBRARIES)
39 changes: 35 additions & 4 deletions CMake/PassOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,54 @@ function(pass_option GROUP NAME DESC DEFAULT)
endfunction()


# Types for the cachevar functions below are the allowed CMake types
# (BOOL, FILEPATH, PATH, STRING, INTERNAL) plus INT.
# These helpers convert from these to supported types in CMake/C++.

# Note that std::filesystem::path is not constexpr so use ct_string for those
function(_pass_type_to_cpp type out_type out_val)
if (type STREQUAL "INT")
set(${out_type} "int" PARENT_SCOPE)
set(${out_val} "\${${NAME}}" PARENT_SCOPE)
elseif (type STREQUAL "BOOL")
set(${out_type} "bool" PARENT_SCOPE)
set(${out_val} "\${${NAME}}" PARENT_SCOPE)
else()
set(${out_type} "ct_string" PARENT_SCOPE)
set(${out_val} "\"\${${NAME}}\"" PARENT_SCOPE)
endif()
endfunction()

# CMake doesn't do numbers, use string
function(_pass_type_to_cachevar type outvar)
if (type STREQUAL "INT")
set(${outvar} "STRING" PARENT_SCOPE)
else()
set(${outvar} ${type} PARENT_SCOPE)
endif()
endfunction()

#
# Declare a cache variable
#
function(pass_cachevar GROUP NAME DEFAULT TYPE DESC)
set(${NAME} ${DEFAULT} CACHE ${TYPE} ${DESC})
_pass_type_to_cachevar(${TYPE} cache_type)
set(${NAME} ${DEFAULT} CACHE ${cache_type} ${DESC})
set(_${GROUP}_CACHEVARS "${_${GROUP}_CACHEVARS};${NAME}" PARENT_SCOPE)
string(REPLACE "HEMELB_" "" BASENAME "${NAME}")
set(_${GROUP}_CLSDEFN "${_${GROUP}_CLSDEFN} static constexpr ct_string ${BASENAME} = \"\${${NAME}}\";
_pass_type_to_cpp(${TYPE} cpp_type cpp_val)
set(_${GROUP}_CLSDEFN "${_${GROUP}_CLSDEFN} static constexpr ${cpp_type} ${BASENAME} = ${cpp_val};
" PARENT_SCOPE)
endfunction()

function(pass_cachevar_choice GROUP NAME DEFAULT TYPE DESC)
# ${ARGN} holds the choices
set(${NAME} ${DEFAULT} CACHE ${TYPE} ${DESC})
_pass_type_to_cachevar(${TYPE} cache_type)
set(${NAME} ${DEFAULT} CACHE ${cache_type} ${DESC})
set(_${GROUP}_CACHEVARS "${_${GROUP}_CACHEVARS};${NAME}" PARENT_SCOPE)
string(REPLACE "HEMELB_" "" BASENAME "${NAME}")
set(_${GROUP}_CLSDEFN "${_${GROUP}_CLSDEFN} static constexpr ct_string ${BASENAME} = \"\${${NAME}}\";
_pass_type_to_cpp(${TYPE} cpp_type cpp_val)
set(_${GROUP}_CLSDEFN "${_${GROUP}_CLSDEFN} static constexpr ${cpp_type} ${BASENAME} = ${cpp_val};
" PARENT_SCOPE)
set_property(CACHE ${NAME} PROPERTY STRINGS ${ARGN})
endfunction()
Expand Down
36 changes: 12 additions & 24 deletions Code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,11 @@ include(HemeLbOptions)

# Add warnings flags to development build types
if (HEMELB_USE_ALL_WARNINGS_GNU)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
endif()

# Definitions that are should be globally available
add_definitions(-DHEMELB_CODE)
add_definitions(-DHEMELB_COMPUTE_ARCHITECTURE=${HEMELB_COMPUTE_ARCHITECTURE})

if(HEMELB_VALIDATE_GEOMETRY)
add_definitions(-DHEMELB_VALIDATE_GEOMETRY)
endif()

if (HEMELB_USE_SSE3)
add_definitions(-DHEMELB_USE_SSE3)
Expand All @@ -47,33 +42,27 @@ if (HEMELB_CALLGRIND)
add_definitions(-DHEMELB_CALLGRIND)
endif()

if (HEMELB_USE_VELOCITY_WEIGHTS_FILE)
add_definitions(-DHEMELB_USE_VELOCITY_WEIGHTS_FILE)
endif()

if (HEMELB_USE_KRUEGER_ORDERING)
add_definitions(-DHEMELB_USE_KRUEGER_ORDERING)
endif()

list(APPEND CMAKE_PREFIX_PATH ${HEMELB_DEPENDENCIES_INSTALL_PREFIX})
# list(APPEND CMAKE_INCLUDE_PATH ${HEMELB_DEPENDENCIES_INSTALL_PREFIX}/include)
# list(APPEND CMAKE_LIBRARY_PATH ${HEMELB_DEPENDENCIES_INSTALL_PREFIX}/lib)

#--- Set up runtime search path for DLLs -----
if(HEMELB_DEPENDENCIES_SET_RPATH)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_INSTALL_RPATH "${HEMELB_DEPENDENCIES_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "${HEMELB_DEPENDENCIES_INSTALL_PREFIX}/lib")
endif()

include(build_environment)
include(platform_checks)
include(codesign)
include(mpi)
include(HemeLbDependency)

find_hemelb_dependency(Boost REQUIRED)
find_hemelb_dependency(TinyXML REQUIRED)
# We do NOT want the removed MPI 2 C++ bindings
# Requesting MPI 3 should be enough, but some configurations of
# e.g. OpenMPI enable them for C++ by default to be "helpful".
set(MPI_CXX_SKIP_MPICXX ON)
find_package(MPI 3 REQUIRED CXX)

find_hemelb_dependency(Boost REQUIRED)
find_hemelb_dependency(tinyxml2 REQUIRED)
find_hemelb_dependency(ParMETIS REQUIRED)
find_hemelb_dependency(CTemplate REQUIRED)
find_hemelb_dependency(ZLIB REQUIRED)
Expand Down Expand Up @@ -129,14 +118,13 @@ configure_file(build_info.h.in build_info.h)
include_directories("${PROJECT_BINARY_DIR}")

# ----------- HemeLB ------------------
if (APPLE)
add_definitions(-DHEMELB_CFG_ON_BSD -DHEMELB_CFG_ON_OSX)
endif()
if (HEMELB_USE_DEBUGGER)
# Force a debug build, because the debugger makes no sense without debug symbols
set(CMAKE_BUILD_TYPE Debug)
endif()

add_library(hemelb_sim OBJECT SimulationController.cc)
list(APPEND heme_libraries hemelb_sim)
add_executable(${HEMELB_EXECUTABLE} main.cc)
codesign(${HEMELB_EXECUTABLE})

Expand Down
Loading
Loading