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

Feature/codecleanup icrar #113

Merged
merged 51 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2652b39
Bug fix for MPI communication of extra properties
pelahi Oct 12, 2021
7369fb4
Code clean-up
pelahi Nov 1, 2021
9e2d987
Fix mismatch in header and properties written
pelahi Nov 1, 2021
351ac25
Improve how compilation options are set and stored
pelahi Nov 1, 2021
7a661c8
Minor fix when parsing config
pelahi Nov 1, 2021
42172de
Add Timer class for easy time tracking
rtobar Nov 12, 2020
6fb5517
Add utility code for formatting time and memory
rtobar Nov 12, 2020
fd0b038
Fixed mismatch in return argument between definition and implementation
pelahi Nov 1, 2021
d06094a
Update to ioutils
pelahi Nov 4, 2021
66758ef
Move non-positive particle density errors up
pelahi Nov 4, 2021
f8e2e07
Adding logger class
pelahi Nov 5, 2021
65c5f4b
Update to user interface
pelahi Nov 5, 2021
5350f1e
Merge branch 'bugfix/mpiextraprop' into feature/codecleanup-icrar
pelahi Nov 5, 2021
30144fa
Added Logger, Timer, and MemReport calss
pelahi Nov 5, 2021
d6fd892
Avoid memory leak on MPISetFilesRead calls
pelahi Nov 5, 2021
5ab1007
Minor bug fixes
pelahi Nov 8, 2021
2d6f453
Minor code clean-up of io routines
pelahi Nov 9, 2021
10e64a4
Update to HDF5 interface based on commits from icrar fork
pelahi Nov 17, 2021
fded81d
Bug fix
pelahi Nov 17, 2021
31696f2
Fixed improper const
pelahi Dec 20, 2021
ec04c4f
Restructure SO information collection and writing
pelahi Dec 20, 2021
3eefcf5
Adding logging information in local field
pelahi Jan 4, 2022
9d71740
Split memory usage collection and reporting
pelahi Jan 4, 2022
c95a8c9
Merge branch 'icrar-hdf5-update' into feature/codecleanup-icrar
pelahi Jan 4, 2022
12a1c90
Minor updates
pelahi Jan 4, 2022
5bc818a
Adding most bound BH ID and position to output
pelahi Jan 5, 2022
5efa0f7
Update to store entropy and temperature
pelahi Jan 5, 2022
f038dee
Update to SO calculations
pelahi Jan 10, 2022
16ee62a
Port SWIFT interface to use better logging
pelahi Jan 10, 2022
d2c9241
De-duplicate InitVelociraptor* functions
pelahi Jan 10, 2022
30571c3
Further logging improvements on swiftinterface.cxx
rtobar Nov 20, 2020
e3eee96
Updates to swift interface
pelahi Jan 10, 2022
a50b156
Merge branch 'feature/adding-calculations' into feature/codecleanup-i…
pelahi Jan 10, 2022
23770eb
Merge branch 'feature/icrar-swiftupdate' into feature/codecleanup-icrar
pelahi Jan 10, 2022
eb67850
Bug fix for spherical overdensity calculation of subhalos
pelahi Mar 14, 2022
38e532f
Feature/core binding report (#110)
pelahi Mar 21, 2022
7a341d6
Cleaned up mpi report of on what nodes code is running
pelahi Jun 20, 2022
3ece03b
Bug fix to HDF5 reading, improved error handling of HDF5 read
pelahi Jul 26, 2023
ccfd498
Logging now also reports function from which it is called
pelahi Jul 26, 2023
6bb7401
Bug fix for omp fof when running with mpi
pelahi Jul 26, 2023
4cfcfe6
Added the c++ standard to use
pelahi Jul 26, 2023
b9357e3
Bug fix for sending extra properties between MPI ranks
pelahi Jul 26, 2023
598d929
Minor fix to ensure MPI calls are all before finalize
pelahi Jul 26, 2023
ca9b1ec
Added clang formating standard
pelahi Jul 26, 2023
6e18165
Minor update to reading other formats related to mpi decomposition
pelahi Jul 27, 2023
5867d6b
Minor bug fix introduced in previous commit
pelahi Jul 28, 2023
3cb55d0
Update to allow VR to period wrap particles outside the periodic doma…
pelahi Jul 31, 2023
a024871
Fixes for z-mesh scaling with number of mpi processes
pelahi Jul 31, 2023
85187e0
Update to period wrap of input for gadget input
pelahi Aug 1, 2023
aaa0b2f
Minor update to binding report
pelahi Nov 2, 2023
78bdeea
Update to NBodylib used (#114)
pelahi Jan 4, 2024
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
192 changes: 192 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: BinPack
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Right
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# This file is part of VELOCIraptor.

cmake_minimum_required(VERSION 3.13)
set(CMAKE_CXX_STANDARD 14)

# We have the version here
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION VR_VERSION)
Expand Down Expand Up @@ -37,6 +38,14 @@ include (VRCMakeUtils)
# complation summary
include(VRCompilationMessages)

include(CTest)
enable_testing()

# Let the *_ROOT variables indicate where to find packages (cmake >= 3.12)
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()

#
# Options users can give on the command line via -D
#
Expand Down Expand Up @@ -75,6 +84,9 @@ vr_option(GADGET_SPH_INFO "Support for extra SPH information in Gadget" OFF)
vr_option(GADGET_STAR_INFO "Support for extra star information in Gadget" OFF)
vr_option(GADGET_BH_INFO "Support for extra black hole information in Gadget" OFF)

# Input data perodic wrapping
vr_option(PARTICLES_OUTSIDE_PERIOD_LIMIT "If particles are outside the periodic limit, wrap the positions before determining mpi domain" OFF)

# Particle data options
vr_option(USE_STAR "Use star particles" OFF)
vr_option(USE_GAS "Use gas particles" OFF)
Expand All @@ -91,6 +103,7 @@ vr_option(STRUCTURE_DEN "Calculate local density dist. only for particles in fie
vr_option(HALO_DEN "Like STRUCTURE_DEN, but se particles inside field objects" OFF)
vr_option(ZOOM_SIM "Used to run against simulations with a high resolution region" OFF)
vr_option(USE_SWIFT_INTERFACE "Used to compile the code with hooks for being called from the SWIFT Hydro nbody code" OFF)
vr_option(LOG_SOURCE_LOCATION "Append source code location to all logging statements" ON)


# Let's true to our word
Expand Down Expand Up @@ -173,6 +186,8 @@ vr_option_defines(GADGET_SPH_INFO EXTRASPHINFO)
vr_option_defines(GADGET_STAR_INFO EXTRASTARINFO)
vr_option_defines(GADGET_BH_INFO EXTRABHINFO)

vr_option_defines(PARTICLES_OUTSIDE_PERIOD_LIMIT PERIODWRAPINPUT)

vr_option_defines(USE_GAS GASON)
vr_option_defines(USE_STAR STARON)
vr_option_defines(USE_BH BHON)
Expand All @@ -187,6 +202,7 @@ vr_option_defines(ZOOM_SIM HIGHRES)
vr_option_defines(USE_LARGE_KDTREE LARGETREE)

vr_option_defines(USE_SWIFT_INTERFACE SWIFTINTERFACE)
vr_option_defines(LOG_SOURCE_LOCATION VR_LOG_SOURCE_LOCATION)

if (VR_USE_SWIFT_INTERFACE)
list(APPEND VR_INCLUDE_DIRS ${SWIFT_INCLUDE_DIR})
Expand Down Expand Up @@ -218,6 +234,14 @@ vr_nbodylib()
# compilation state
vr_compilation_summary()

#
# Store compilation flags for future reference
#
set(compilation_info_cxx "${CMAKE_CURRENT_BINARY_DIR}/compilation_info.cxx")
configure_file("src/compilation_info.cxx.in" ${compilation_info_cxx} @ONLY)



# Are we part of an outside build (i.e., of a treefrog build)?
# If so, we want to let the caller know what to include
set(_export OFF)
Expand Down
18 changes: 11 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ set(VR_SOURCES
allvars.cxx
bgfield.cxx
buildandsortarrays.cxx
"${compilation_info_cxx}"
endianutils.cxx
fofalgo.cxx
gadgetio.cxx
"${git_revision_cxx}"
haloproperties.cxx
hdfio.cxx
h5_output_file.cxx
h5_utils.cxx
io.cxx
localbgcomp.cxx
localfield.cxx
logging.cxx
mpigadgetio.cxx
mpihdfio.cxx
mpinchiladaio.cxx
Expand All @@ -39,29 +43,29 @@ set(VR_SOURCES
ui.cxx
unbind.cxx
utilities.cxx
vr_exceptions.cxx
)

add_library(velociraptor STATIC ${VR_SOURCES})
target_compile_definitions(velociraptor PRIVATE ${VR_DEFINES})
target_compile_definitions(velociraptor PUBLIC ${VR_DEFINES})
if (VR_CXX_FLAGS)
set_target_properties(velociraptor PROPERTIES COMPILE_FLAGS ${VR_CXX_FLAGS})
target_compile_options(velociraptor PUBLIC ${VR_CXX_FLAGS})
endif()
set_target_properties(velociraptor PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})


# Bringing NBodyLib objects into the velociraptor library
target_link_libraries(velociraptor nbodylib_iface)
target_link_libraries(velociraptor PUBLIC nbodylib_iface)

add_executable(stf main.cxx)
target_link_libraries(stf velociraptor ${VR_LIBS})

target_compile_definitions(stf PRIVATE ${VR_DEFINES})
if (VR_CXX_FLAGS)
set_target_properties(stf PROPERTIES COMPILE_FLAGS ${VR_CXX_FLAGS})
endif()
if (VR_LINK_FLAGS)
set_target_properties(stf PROPERTIES LINK_FLAGS ${VR_LINK_FLAGS})
endif()
set_target_properties(stf PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
sanitizer_options(velociraptor)

if (BUILD_TESTING)
add_subdirectory(tests)
endif()
Loading