Skip to content

Commit

Permalink
Merge pull request #5877 from wthrowe/atomic_printf
Browse files Browse the repository at this point in the history
Make Parallel::printf atomic
  • Loading branch information
knelli2 committed Apr 18, 2024
2 parents e2d014a + 855cee2 commit eb45036
Show file tree
Hide file tree
Showing 112 changed files with 584 additions and 155 deletions.
2 changes: 1 addition & 1 deletion docs/DevGuide/CodeReviewGuide.md
Expand Up @@ -83,7 +83,7 @@ Code Quality Items:
* All commits for performance changes provide quantitative evidence and the
tests used to obtain said evidence.
* Never include `<iostream>`, use `Parallel::printf` inside
`Parallel/Printf.hpp` instead, which is safe to use in parallel.
`Parallel/Printf/Printf.hpp` instead, which is safe to use in parallel.
* When using charm++ nodelocks include `<converse.h>` instead of `<lrtslock.h>`.
* Do not add anything to [the `std` namespace]
(http://en.cppreference.com/w/cpp/language/extending_std).
Expand Down
2 changes: 1 addition & 1 deletion src/ControlSystem/Actions/PrintCurrentMeasurement.hpp
Expand Up @@ -6,7 +6,7 @@
#include "ControlSystem/Tags/SystemTags.hpp"
#include "DataStructures/DataBox/DataBox.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/PrettyType.hpp"

namespace control_system::Actions {
Expand Down
1 change: 1 addition & 0 deletions src/ControlSystem/CMakeLists.txt
Expand Up @@ -56,6 +56,7 @@ target_link_libraries(
Interpolation
Logging
Parallel
Printf
Serialization
Time
Utilities
Expand Down
2 changes: 1 addition & 1 deletion src/ControlSystem/ControlErrors/Size.hpp
Expand Up @@ -31,7 +31,7 @@
#include "Options/Auto.hpp"
#include "Options/String.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/ProtocolHelpers.hpp"
#include "Utilities/TMPL.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/ControlSystem/ControlErrors/Size/Update.hpp
Expand Up @@ -15,7 +15,7 @@
#include "Domain/Structure/ObjectLabel.hpp"
#include "IO/Logging/Verbosity.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/Gsl.hpp"

namespace control_system::size {
Expand Down
1 change: 0 additions & 1 deletion src/ControlSystem/Measurements/BNSCenterOfMass.hpp
Expand Up @@ -22,7 +22,6 @@
#include "NumericalAlgorithms/LinearOperators/DefiniteIntegral.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Invoke.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Reduction.hpp"
#include "ParallelAlgorithms/Actions/FunctionsOfTimeAreReady.hpp"
#include "ParallelAlgorithms/Events/Tags.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/ControlSystem/RunCallbacks.hpp
Expand Up @@ -10,7 +10,7 @@
#include "DataStructures/DataBox/DataBox.hpp"
#include "DataStructures/LinkedMessageId.hpp"
#include "IO/Logging/Verbosity.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/Interpolation/Protocols/PostInterpolationCallback.hpp"
#include "Utilities/PrettyType.hpp"
#include "Utilities/ProtocolHelpers.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/ControlSystem/Systems/Expansion.hpp
Expand Up @@ -25,6 +25,7 @@
#include "DataStructures/LinkedMessageQueue.hpp"
#include "Domain/Structure/ObjectLabel.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/Actions/UpdateMessageQueue.hpp"
#include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
#include "Utilities/ErrorHandling/Assert.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/ControlSystem/Systems/Rotation.hpp
Expand Up @@ -24,6 +24,7 @@
#include "DataStructures/LinkedMessageQueue.hpp"
#include "Domain/Structure/ObjectLabel.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/Actions/UpdateMessageQueue.hpp"
#include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
#include "Utilities/ErrorHandling/Assert.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/ControlSystem/Systems/Shape.hpp
Expand Up @@ -27,6 +27,7 @@
#include "NumericalAlgorithms/SphericalHarmonics/Strahlkorper.hpp"
#include "NumericalAlgorithms/SphericalHarmonics/Tags.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/Actions/UpdateMessageQueue.hpp"
#include "Utilities/GetOutput.hpp"
#include "Utilities/ProtocolHelpers.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/ControlSystem/Systems/Size.hpp
Expand Up @@ -26,7 +26,7 @@
#include "Domain/Structure/ObjectLabel.hpp"
#include "NumericalAlgorithms/SphericalHarmonics/Tags.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/Actions/UpdateMessageQueue.hpp"
#include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
#include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/ControlSystem/Systems/Translation.hpp
Expand Up @@ -23,6 +23,7 @@
#include "DataStructures/LinkedMessageQueue.hpp"
#include "Domain/Structure/ObjectLabel.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/Actions/UpdateMessageQueue.hpp"
#include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
#include "Utilities/PrettyType.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/ControlSystem/Trigger.hpp
Expand Up @@ -16,6 +16,7 @@
#include "Parallel/ArrayComponentId.hpp"
#include "Parallel/Callback.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTrigger.hpp"
#include "Utilities/ErrorHandling/Assert.hpp"
#include "Utilities/GetOutput.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/ControlSystem/UpdateControlSystem.hpp
Expand Up @@ -26,7 +26,7 @@
#include "Domain/Tags.hpp"
#include "IO/Logging/Verbosity.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/MakeString.hpp"
#include "Utilities/StdHelpers.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/Elliptic/Amr/Actions.hpp
Expand Up @@ -15,7 +15,7 @@
#include "NumericalAlgorithms/Spectral/Mesh.hpp"
#include "Parallel/AlgorithmExecution.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/Amr/Protocols/Projector.hpp"
#include "ParallelAlgorithms/Amr/Tags.hpp"
#include "Utilities/ProtocolHelpers.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/Elliptic/CMakeLists.txt
Expand Up @@ -24,6 +24,7 @@ target_link_libraries(
EventsAndTriggers
LinearOperators
ParallelAmr
Printf
Serialization
Utilities
)
Expand Down
1 change: 1 addition & 0 deletions src/Elliptic/DiscontinuousGalerkin/CMakeLists.txt
Expand Up @@ -34,6 +34,7 @@ target_link_libraries(
FunctionsOfTime
LinearOperators
ParallelAmr
Printf
Spectral
Utilities
INTERFACE
Expand Down
2 changes: 1 addition & 1 deletion src/Elliptic/DiscontinuousGalerkin/DgElementArray.hpp
Expand Up @@ -31,7 +31,7 @@
#include "Parallel/Local.hpp"
#include "Parallel/ParallelComponentHelpers.hpp"
#include "Parallel/Phase.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Parallel/Protocols/ArrayElementsAllocator.hpp"
#include "Parallel/Tags/Parallelization.hpp"
#include "Utilities/Literals.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/Evolution/CMakeLists.txt
Expand Up @@ -37,6 +37,7 @@ target_link_libraries(
ErrorHandling
InitialDataUtilities
Options
Printf
Serialization
Spectral
Time
Expand Down
1 change: 1 addition & 0 deletions src/Evolution/Deadlock/CMakeLists.txt
Expand Up @@ -18,6 +18,7 @@ target_link_libraries(
DataStructures
DiscontinuousGalerkin
Parallel
Printf
Time
Utilities
)
2 changes: 1 addition & 1 deletion src/Evolution/Deadlock/PrintDgElementArray.hpp
Expand Up @@ -14,7 +14,7 @@
#include "Evolution/DiscontinuousGalerkin/MortarTags.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/OutputInbox.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Time/Tags/Time.hpp"
#include "Time/Tags/TimeStep.hpp"
#include "Time/Tags/TimeStepId.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/Evolution/DiscontinuousGalerkin/DgElementArray.hpp
Expand Up @@ -28,7 +28,7 @@
#include "Parallel/Local.hpp"
#include "Parallel/ParallelComponentHelpers.hpp"
#include "Parallel/Phase.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Parallel/Tags/Parallelization.hpp"
#include "Utilities/Literals.hpp"
#include "Utilities/Numeric.hpp"
Expand Down
Expand Up @@ -26,6 +26,7 @@ set(LIBS_TO_LINK
ParallelAmr
ParallelInterpolation
PhaseControl
Printf
Serialization
Time
Utilities
Expand Down
Expand Up @@ -82,7 +82,7 @@
#include "Parallel/PhaseControl/Factory.hpp"
#include "Parallel/PhaseControl/VisitAndReturn.hpp"
#include "Parallel/PhaseDependentActionList.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Parallel/Protocols/RegistrationMetavariables.hpp"
#include "Parallel/Reduction.hpp"
#include "ParallelAlgorithms/Actions/AddComputeTags.hpp"
Expand Down
Expand Up @@ -32,7 +32,7 @@
#include "Parallel/Invoke.hpp"
#include "Parallel/MemoryMonitor/MemoryMonitor.hpp"
#include "Parallel/PhaseControl/ExecutePhaseChange.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Parallel/Protocols/RegistrationMetavariables.hpp"
#include "ParallelAlgorithms/Actions/FunctionsOfTimeAreReady.hpp"
#include "ParallelAlgorithms/Amr/Projectors/CopyFromCreatorOrLeaveAsIs.hpp"
Expand Down
Expand Up @@ -20,7 +20,6 @@
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Invoke.hpp"
#include "Parallel/Local.hpp"
#include "Parallel/Printf.hpp"
#include "Time/SelfStart.hpp"
#include "Time/TimeStepId.hpp"
#include "Utilities/ErrorHandling/Error.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/Evolution/Systems/Cce/CMakeLists.txt
Expand Up @@ -71,6 +71,7 @@ target_link_libraries(
Observer
Options
ParallelInterpolation
Printf
Serialization
Spectral
Utilities
Expand Down
2 changes: 1 addition & 1 deletion src/Evolution/Systems/Cce/Events/ObserveTimeStep.hpp
Expand Up @@ -15,7 +15,7 @@
#include "Options/String.hpp"
#include "Parallel/GlobalCache.hpp"
#include "Parallel/Invoke.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
#include "Time/Time.hpp"
#include "Utilities/Serialization/CharmPupable.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/Evolution/Systems/Cce/Initialize/InitializeJ.hpp
Expand Up @@ -17,7 +17,7 @@
#include "NumericalAlgorithms/Spectral/SwshInterpolation.hpp"
#include "Options/String.hpp"
#include "Parallel/NodeLock.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/Serialization/CharmPupable.hpp"
#include "Utilities/TMPL.hpp"
Expand Down
Expand Up @@ -15,7 +15,6 @@
#include "NumericalAlgorithms/Spectral/Basis.hpp"
#include "NumericalAlgorithms/Spectral/Quadrature.hpp"
#include "NumericalAlgorithms/Spectral/Spectral.hpp"
#include "Parallel/Printf.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/MakeString.hpp"
#include "Utilities/Serialization/CharmPupable.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/Evolution/Systems/Cce/Initialize/ZeroNonSmooth.cpp
Expand Up @@ -11,7 +11,6 @@
#include "DataStructures/Tensor/TypeAliases.hpp"
#include "Evolution/Systems/Cce/Initialize/InitializeJ.hpp"
#include "NumericalAlgorithms/Spectral/SwshInterpolation.hpp"
#include "Parallel/Printf.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/MakeString.hpp"
#include "Utilities/Serialization/CharmPupable.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/Evolution/Systems/Cce/OptionTags.hpp
Expand Up @@ -18,7 +18,7 @@
#include "NumericalAlgorithms/Interpolation/SpanInterpolator.hpp"
#include "Options/Auto.hpp"
#include "Options/String.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/PrettyType.hpp"

namespace Cce {
Expand Down
1 change: 1 addition & 0 deletions src/Executables/ConvertComposeTable/CMakeLists.txt
Expand Up @@ -18,4 +18,5 @@ target_link_libraries(
H5
Informer
IO
Printf
)
Expand Up @@ -9,7 +9,7 @@
#include "IO/ComposeTable.hpp"
#include "IO/H5/EosTable.hpp"
#include "IO/H5/File.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"

// Charm looks for this function but since we build without a main function or
// main module we just have it be empty
Expand Down
1 change: 1 addition & 0 deletions src/Executables/Examples/HelloWorld/CMakeLists.txt
Expand Up @@ -17,6 +17,7 @@ target_link_libraries(
Informer
Options
Parallel
Printf
SystemUtilities
Utilities
)
Expand Up @@ -15,7 +15,7 @@
#include "Parallel/ParallelComponentHelpers.hpp"
#include "Parallel/Phase.hpp"
#include "Parallel/PhaseDependentActionList.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/System/ParallelInfo.hpp"
#include "Utilities/TMPL.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/Executables/Examples/HelloWorldNoCharm/CMakeLists.txt
Expand Up @@ -13,5 +13,5 @@ target_link_libraries(
${EXECUTABLE}
PRIVATE
DataStructures
Parallel # Only for printf
Printf
)
2 changes: 1 addition & 1 deletion src/Executables/Examples/HelloWorldNoCharm/HelloWorld.cpp
Expand Up @@ -2,7 +2,7 @@
// See LICENSE.txt for details.

#include "DataStructures/DataVector.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"

// Charm looks for this function but since we build without a main function or
// main module we just have it be empty
Expand Down
Expand Up @@ -16,6 +16,6 @@ target_link_libraries(
Boost::program_options
DataStructures
Hydro
Parallel
Printf
Utilities
)
Expand Up @@ -14,7 +14,7 @@
#include "DataStructures/DataVector.hpp"
#include "Options/Options.hpp"
#include "Options/ParseOptions.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp"
#include "PointwiseFunctions/Hydro/Tags.hpp"
#include "PointwiseFunctions/Hydro/Units.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/Executables/ParallelInfo/CMakeLists.txt
Expand Up @@ -28,6 +28,6 @@ target_link_libraries(
Charmxx::main
ErrorHandling
Informer
Parallel
Printf
SystemUtilities
)
2 changes: 1 addition & 1 deletion src/Executables/ParallelInfo/ParallelInfo.cpp
Expand Up @@ -9,7 +9,7 @@
#include <string>

#include "Informer/InfoFromBuild.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/ErrorHandling/Error.hpp"
#include "Utilities/Math.hpp"
#include "Utilities/System/Exit.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/Executables/ReduceCceWorldtube/CMakeLists.txt
Expand Up @@ -17,6 +17,7 @@ target_link_libraries(
Cce
GeneralRelativity
Informer
Printf
Spectral
)

Expand Down
2 changes: 1 addition & 1 deletion src/Executables/ReduceCceWorldtube/ReduceCceWorldtube.cpp
Expand Up @@ -18,7 +18,7 @@
#include "Evolution/Systems/Cce/WorldtubeBufferUpdater.hpp"
#include "NumericalAlgorithms/Spectral/SwshCoefficients.hpp"
#include "NumericalAlgorithms/Spectral/SwshCollocation.hpp"
#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/TMPL.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/Executables/TimeStepperSummary/CMakeLists.txt
Expand Up @@ -15,7 +15,7 @@ target_link_libraries(
Boost::boost
Boost::program_options
ErrorHandling
Parallel
Printf
Time
Utilities
)
2 changes: 1 addition & 1 deletion src/Executables/TimeStepperSummary/TimeStepperSummary.cpp
Expand Up @@ -11,7 +11,7 @@
#include <utility>
#include <vector>

#include "Parallel/Printf.hpp"
#include "Parallel/Printf/Printf.hpp"
#include "Time/TimeSteppers/Factory.hpp"
#include "Utilities/Algorithm.hpp"
#include "Utilities/ErrorHandling/Assert.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/IO/H5/CMakeLists.txt
Expand Up @@ -66,6 +66,7 @@ target_link_libraries(
PRIVATE
Informer
IO
Printf
)

add_subdirectory(Python)

0 comments on commit eb45036

Please sign in to comment.