From b3df834889f824c869322262af769e51d4a12336 Mon Sep 17 00:00:00 2001 From: Jonah Miller Date: Wed, 28 Aug 2024 16:36:05 -0600 Subject: [PATCH 1/3] formatting sweep with clang-format with the same specifications as singularity-eos --- .clang-format | 4 +- CMakeLists.txt | 5 ++ cmake/Format.cmake | 66 +++++++++++++++ doc/sphinx/src/developing.rst | 15 ++++ ports-of-call/portability.hpp | 77 +++++++++--------- ports-of-call/portable_arrays.hpp | 130 ++++++++++++------------------ ports-of-call/portable_errors.hpp | 94 +++++++++------------ script/format.sh | 44 ++++++++++ test/test_portsofcall.cpp | 59 ++++++-------- 9 files changed, 284 insertions(+), 210 deletions(-) create mode 100644 cmake/Format.cmake create mode 100755 script/format.sh diff --git a/.clang-format b/.clang-format index 35dacbbf..de33dbbe 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,4 @@ -ColumnLimit: 80 +ColumnLimit: 90 IndentWidth: 2 AccessModifierOffset: -1 @@ -7,4 +7,4 @@ AllowShortIfStatementsOnASingleLine: true AlwaysBreakTemplateDeclarations: true BinPackArguments: true BinPackParameters: true -ConstructorInitializerAllOnOneLineOrOnePerLine: false \ No newline at end of file +ConstructorInitializerAllOnOneLineOrOnePerLine: false diff --git a/CMakeLists.txt b/CMakeLists.txt index aa6239d3..97374563 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ option (PORTS_OF_CALL_BUILD_TESTING "Test the current installation") # CONFIGURATION LOGIC # ---------------------------------------- +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) # TARGET CONFIGURATION # ---------------------------------------- @@ -72,6 +73,10 @@ if(PORTS_OF_CALL_BUILD_TESTING) add_subdirectory(test) endif() +# FORMATTING +# ---------------------------------------- +include(Format) + # INSTALL & EXPORT # ---------------------------------------- diff --git a/cmake/Format.cmake b/cmake/Format.cmake new file mode 100644 index 00000000..b82f1246 --- /dev/null +++ b/cmake/Format.cmake @@ -0,0 +1,66 @@ +#========================================================================================= +# (C) (or copyright) 2021. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +#========================================================================================= + +find_program( + CLANG_FORMAT + NAMES + clang-format-12 # Debian package manager, among others, provide this name + clang-format-mp-12.0 # MacPorts + clang-format # Default name + ) + +if (CLANG_FORMAT AND NOT CLANG_FORMAT_VERSION) + # Get clang-format --version + execute_process( + COMMAND ${CLANG_FORMAT} --version + OUTPUT_VARIABLE CLANG_FORMAT_VERSION_OUTPUT) + + if (CLANG_FORMAT_VERSION_OUTPUT MATCHES "clang-format version ([0-9]+\.[0-9]+\.[0-9]+)") + set(CLANG_FORMAT_VERSION ${CMAKE_MATCH_1}) + message(STATUS "clang-format --version: " ${CLANG_FORMAT_VERSION}) + + set(CLANG_FORMAT_VERSION ${CLANG_FORMAT_VERSION} CACHE STRING "clang-format version") + endif() +endif() + +if (NOT CLANG_FORMAT_VERSION) + message( + WARNING + "Couldn't determine clang-format version. clang-format 12.0 is \ + expected - results on other versions may not be stable") + + set(CLANG_FORMAT_VERSION "0.0.0" CACHE STRING "clang-format version not found") +elseif (NOT (CLANG_FORMAT_VERSION VERSION_GREATER_EQUAL "12.0" AND + CLANG_FORMAT_VERSION VERSION_LESS "13.0")) + message( + WARNING + "clang-format version 12.0 is required - results on other \ + versions may not be stable") +endif() + +# Specifically trying to exclude external here - I'm not sure if there's a better way +set( + GLOBS + ${PROJECT_SOURCE_DIR}/spiner/[^\.]*.cpp ${PROJECT_SOURCE_DIR}/spiner/[^\.]*.hpp + ${PROJECT_SOURCE_DIR}/ports-of-call/[^\.]*.cpp ${PROJECT_SOURCE_DIR}/ports-of-call/[^\.]*.hpp + ${PROJECT_SOURCE_DIR}/test/[^\.]*.cpp ${PROJECT_SOURCE_DIR}/test/[^\.]*.hpp + ${PROJECT_SOURCE_DIR}/installtest/[^\.]*.cpp ${PROJECT_SOURCE_DIR}/installtest/[^\.]*.hpp +) + +file(GLOB_RECURSE FORMAT_SOURCES CONFIGURE_DEPENDS ${GLOBS}) + +if (CLANG_FORMAT) + add_custom_target(format_ports + COMMAND ${CLANG_FORMAT} -i ${FORMAT_SOURCES} + VERBATIM) +endif() diff --git a/doc/sphinx/src/developing.rst b/doc/sphinx/src/developing.rst index e3b4f3bf..c16de8fc 100644 --- a/doc/sphinx/src/developing.rst +++ b/doc/sphinx/src/developing.rst @@ -8,3 +8,18 @@ required. We do require the files be formatted using ``clang-format``. The format version is pinned 12. Please call ```clang-format`` on your files before merging them. +You may do so automatically either by making the ``format_ports`` +target in the build system, e.g., + +.. code-block:: bash + + mkdir -p ports-of-call/build + cd ports-of-call/build + cmake .. + make format_ports + +or you may call the ``format.sh`` script in the ``scripts`` +directory. This script supports two environment variables, ``CFM`` and +``VERBOSE``. ``CFM`` is the path (or name) of your ``clang-format`` +executable. ``VERBOSE=1`` will cause it to output all files it +modifies. diff --git a/ports-of-call/portability.hpp b/ports-of-call/portability.hpp index 40f9f72a..38bde3a2 100644 --- a/ports-of-call/portability.hpp +++ b/ports-of-call/portability.hpp @@ -58,7 +58,7 @@ #include "cuda.h" #define PORTABLE_FUNCTION __host__ __device__ #define PORTABLE_INLINE_FUNCTION __host__ __device__ inline -#define PORTABLE_FORCEINLINE_FUNCTION \ +#define PORTABLE_FORCEINLINE_FUNCTION \ __host__ __device__ inline __attribute__((always_inline)) #define PORTABLE_LAMBDA [=] __host__ __device__ void *PORTABLE_MALLOC(size_t size) { @@ -91,35 +91,37 @@ typedef float Real; typedef double Real; #endif -namespace PortsOfCall{ +namespace PortsOfCall { // compile-time constant to check if execution of memory space // will be done on the host or is offloaded #if defined(PORTABILITY_STRATEGY_KOKKOS) -constexpr bool EXECUTION_IS_HOST{Kokkos::SpaceAccessibility::accessible}; +constexpr bool EXECUTION_IS_HOST{ + Kokkos::SpaceAccessibility::accessible}; #elif defined(PORTABILITY_STRATEGY_CUDA) constexpr bool EXECUTION_IS_HOST{false}; #else constexpr bool EXECUTION_IS_HOST{true}; #endif // portable printf -template -PORTABLE_INLINE_FUNCTION void printf(char const * const format, Ts ... ts) { +template +PORTABLE_INLINE_FUNCTION void printf(char const *const format, Ts... ts) { // disable for hip #ifndef __HIPCC__ std::printf(format, ts...); #endif // __HIPCC__ return; } -} // PortsOfCall +} // namespace PortsOfCall template -void portableCopyToDevice(T * const to, T const * const from, size_t const size_bytes) { +void portableCopyToDevice(T *const to, T const *const from, size_t const size_bytes) { auto const length = size_bytes / sizeof(T); #ifdef PORTABILITY_STRATEGY_KOKKOS using UM = Kokkos::MemoryUnmanaged; using HS = Kokkos::HostSpace; - Kokkos::View from_v(from, length); - Kokkos::View to_v(to, length); + Kokkos::View from_v(from, length); + Kokkos::View to_v(to, length); deep_copy(to_v, from_v); #elif defined(PORTABILITY_STRATEGY_CUDA) cudaMemcpy(to, from, size_bytes, cudaMemcpyHostToDevice); @@ -132,13 +134,13 @@ void portableCopyToDevice(T * const to, T const * const from, size_t const size_ } template -void portableCopyToHost(T * const to, T const * const from, size_t const size_bytes) { +void portableCopyToHost(T *const to, T const *const from, size_t const size_bytes) { auto const length = size_bytes / sizeof(T); #ifdef PORTABILITY_STRATEGY_KOKKOS using UM = Kokkos::MemoryUnmanaged; using HS = Kokkos::HostSpace; - Kokkos::View from_v(from, length); - Kokkos::View to_v(to, length); + Kokkos::View from_v(from, length); + Kokkos::View to_v(to, length); deep_copy(to_v, from_v); #elif defined(PORTABILITY_STRATEGY_CUDA) cudaMemcpy(to, from, size_bytes, cudaMemcpyDeviceToHost); @@ -167,8 +169,7 @@ void portableFor(const char *name, int starty, int stopy, int startx, int stopx, Function function) { #ifdef PORTABILITY_STRATEGY_KOKKOS using Policy2D = Kokkos::MDRangePolicy>; - Kokkos::parallel_for(name, Policy2D({starty, startx}, {stopy, stopx}), - function); + Kokkos::parallel_for(name, Policy2D({starty, startx}, {stopy, stopx}), function); #else for (int iy = starty; iy < stopy; iy++) { for (int ix = startx; ix < stopx; ix++) { @@ -183,9 +184,8 @@ void portableFor(const char *name, int startz, int stopz, int starty, int stopy, int startx, int stopx, Function function) { #ifdef PORTABILITY_STRATEGY_KOKKOS using Policy3D = Kokkos::MDRangePolicy>; - Kokkos::parallel_for( - name, Policy3D({startz, starty, startx}, {stopz, stopy, stopx}), - function); + Kokkos::parallel_for(name, Policy3D({startz, starty, startx}, {stopz, stopy, stopx}), + function); #else for (int iz = startz; iz < stopz; iz++) { for (int iy = starty; iy < stopy; iy++) { @@ -199,13 +199,11 @@ void portableFor(const char *name, int startz, int stopz, int starty, int stopy, template void portableFor(const char *name, int starta, int stopa, int startz, int stopz, - int starty, int stopy, int startx, int stopx, - Function function) { + int starty, int stopy, int startx, int stopx, Function function) { #ifdef PORTABILITY_STRATEGY_KOKKOS using Policy4D = Kokkos::MDRangePolicy>; Kokkos::parallel_for( - name, - Policy4D({starta, startz, starty, startx}, {stopa, stopz, stopy, stopx}), + name, Policy4D({starta, startz, starty, startx}, {stopa, stopz, stopy, stopx}), function); #else for (int ia = starta; ia < stopa; ia++) { @@ -222,8 +220,8 @@ void portableFor(const char *name, int starta, int stopa, int startz, int stopz, template void portableFor(const char *name, int startb, int stopb, int starta, int stopa, - int startz, int stopz, int starty, int stopy, int startx, - int stopx, Function function) { + int startz, int stopz, int starty, int stopy, int startx, int stopx, + Function function) { #ifdef PORTABILITY_STRATEGY_KOKKOS using Policy5D = Kokkos::MDRangePolicy>; Kokkos::parallel_for(name, @@ -259,12 +257,12 @@ void portableReduce(const char *name, int start, int stop, Function function, } template -void portableReduce(const char *name, int starty, int stopy, int startx, - int stopx, Function function, T &reduced) { +void portableReduce(const char *name, int starty, int stopy, int startx, int stopx, + Function function, T &reduced) { #ifdef PORTABILITY_STRATEGY_KOKKOS using Policy2D = Kokkos::MDRangePolicy>; - Kokkos::parallel_reduce(name, Policy2D({starty, startx}, {stopy, stopx}), - function, reduced); + Kokkos::parallel_reduce(name, Policy2D({starty, startx}, {stopy, stopx}), function, + reduced); #else for (int iy = starty; iy < stopy; iy++) { for (int ix = startx; ix < stopx; ix++) { @@ -275,14 +273,12 @@ void portableReduce(const char *name, int starty, int stopy, int startx, } template -void portableReduce(const char *name, int startz, int stopz, int starty, - int stopy, int startx, int stopx, Function function, - T &reduced) { +void portableReduce(const char *name, int startz, int stopz, int starty, int stopy, + int startx, int stopx, Function function, T &reduced) { #ifdef PORTABILITY_STRATEGY_KOKKOS using Policy3D = Kokkos::MDRangePolicy>; - Kokkos::parallel_reduce( - name, Policy3D({startz, starty, startx}, {stopz, stopy, stopx}), function, - reduced); + Kokkos::parallel_reduce(name, Policy3D({startz, starty, startx}, {stopz, stopy, stopx}), + function, reduced); #else for (int iz = startz; iz < stopz; iz++) { for (int iy = starty; iy < stopy; iy++) { @@ -295,14 +291,13 @@ void portableReduce(const char *name, int startz, int stopz, int starty, } template -void portableReduce(const char *name, int starta, int stopa, int startz, - int stopz, int starty, int stopy, int startx, int stopx, - Function function, T &reduced) { +void portableReduce(const char *name, int starta, int stopa, int startz, int stopz, + int starty, int stopy, int startx, int stopx, Function function, + T &reduced) { #ifdef PORTABILITY_STRATEGY_KOKKOS using Policy4D = Kokkos::MDRangePolicy>; Kokkos::parallel_reduce( - name, - Policy4D({starta, startz, starty, startx}, {stopa, stopz, stopy, stopx}), + name, Policy4D({starta, startz, starty, startx}, {stopa, stopz, stopy, stopx}), function, reduced); #else for (int ia = starta; ia < stopa; ia++) { @@ -318,9 +313,9 @@ void portableReduce(const char *name, int starta, int stopa, int startz, } template -void portableReduce(const char *name, int startb, int stopb, int starta, - int stopa, int startz, int stopz, int starty, int stopy, - int startx, int stopx, Function function, T &reduced) { +void portableReduce(const char *name, int startb, int stopb, int starta, int stopa, + int startz, int stopz, int starty, int stopy, int startx, int stopx, + Function function, T &reduced) { #ifdef PORTABILITY_STRATEGY_KOKKOS using Policy5D = Kokkos::MDRangePolicy>; Kokkos::parallel_reduce(name, diff --git a/ports-of-call/portable_arrays.hpp b/ports-of-call/portable_arrays.hpp index 81a2ad6d..af8ecec7 100644 --- a/ports-of-call/portable_arrays.hpp +++ b/ports-of-call/portable_arrays.hpp @@ -45,25 +45,19 @@ class PortableMDArray { : pdata_(data), nx1_(nx1), nx2_(1), nx3_(1), nx4_(1), nx5_(1), nx6_(1) {} PORTABLE_FUNCTION PortableMDArray(T *data, int nx2, int nx1) noexcept - : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(1), nx4_(1), nx5_(1), nx6_(1) { - } + : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(1), nx4_(1), nx5_(1), nx6_(1) {} PORTABLE_FUNCTION PortableMDArray(T *data, int nx3, int nx2, int nx1) noexcept - : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(nx3), nx4_(1), nx5_(1), - nx6_(1) {} + : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(nx3), nx4_(1), nx5_(1), nx6_(1) {} PORTABLE_FUNCTION PortableMDArray(T *data, int nx4, int nx3, int nx2, int nx1) noexcept - : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(nx3), nx4_(nx4), nx5_(1), - nx6_(1) {} + : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(nx3), nx4_(nx4), nx5_(1), nx6_(1) {} PORTABLE_FUNCTION PortableMDArray(T *data, int nx5, int nx4, int nx3, int nx2, int nx1) noexcept - : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(nx3), nx4_(nx4), nx5_(nx5), - nx6_(1) {} + : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(nx3), nx4_(nx4), nx5_(nx5), nx6_(1) {} PORTABLE_FUNCTION - PortableMDArray(T *data, int nx6, int nx5, int nx4, int nx3, int nx2, - int nx1) noexcept - : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(nx3), nx4_(nx4), nx5_(nx5), - nx6_(nx6) {} + PortableMDArray(T *data, int nx6, int nx5, int nx4, int nx3, int nx2, int nx1) noexcept + : pdata_(data), nx1_(nx1), nx2_(nx2), nx3_(nx3), nx4_(nx4), nx5_(nx5), nx6_(nx6) {} // define copy constructor and overload assignment operator so both do deep // copies. @@ -73,14 +67,13 @@ class PortableMDArray { // public functions to allocate/deallocate memory for 1D-5D data PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx1) noexcept; PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx2, int nx1) noexcept; - PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx3, int nx2, - int nx1) noexcept; + PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx3, int nx2, int nx1) noexcept; PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx4, int nx3, int nx2, int nx1) noexcept; - PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx5, int nx4, int nx3, + PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx5, int nx4, int nx3, int nx2, + int nx1) noexcept; + PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx6, int nx5, int nx4, int nx3, int nx2, int nx1) noexcept; - PORTABLE_FUNCTION void NewPortableMDArray(T *data, int nx6, int nx5, int nx4, - int nx3, int nx2, int nx1) noexcept; // public function to swap underlying data pointers of two equally-sized // arrays @@ -128,8 +121,8 @@ class PortableMDArray { return 0; } - PORTABLE_INLINE_FUNCTION void Reshape(int nx6, int nx5, int nx4, int nx3, - int nx2, int nx1) { + PORTABLE_INLINE_FUNCTION void Reshape(int nx6, int nx5, int nx4, int nx3, int nx2, + int nx1) { assert(nx6 * nx5 * nx4 * nx3 * nx2 * nx1 == GetSize()); nx1_ = nx1; nx2_ = nx2; @@ -138,8 +131,7 @@ class PortableMDArray { nx5_ = nx5; nx6_ = nx6; } - PORTABLE_INLINE_FUNCTION void Reshape(int nx5, int nx4, int nx3, int nx2, - int nx1) { + PORTABLE_INLINE_FUNCTION void Reshape(int nx5, int nx4, int nx3, int nx2, int nx1) { Reshape(1, nx5, nx4, nx3, nx2, nx1); } PORTABLE_INLINE_FUNCTION void Reshape(int nx4, int nx3, int nx2, int nx1) { @@ -151,9 +143,7 @@ class PortableMDArray { PORTABLE_INLINE_FUNCTION void Reshape(int nx2, int nx1) { Reshape(1, 1, 1, 1, nx2, nx1); } - PORTABLE_INLINE_FUNCTION void Reshape(int nx1) { - Reshape(1, 1, 1, 1, 1, nx1); - } + PORTABLE_INLINE_FUNCTION void Reshape(int nx1) { Reshape(1, 1, 1, 1, 1, nx1); } PORTABLE_FORCEINLINE_FUNCTION bool IsShallowSlice() { return true; } PORTABLE_FORCEINLINE_FUNCTION bool IsEmpty() { return GetSize() < 1; } @@ -181,52 +171,45 @@ class PortableMDArray { // since T is typically a built-in type (versus "const T &" to avoid copying // for general types) PORTABLE_FORCEINLINE_FUNCTION T &operator()() const { return pdata_[0]; } - PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n) const { - return pdata_[n]; - } + PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n) const { return pdata_[n]; } PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int i) { return pdata_[i + nx1_ * n]; } PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int i) const { return pdata_[i + nx1_ * n]; } - PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int j, - const int i) { + PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int j, const int i) { return pdata_[i + nx1_ * (j + nx2_ * n)]; } PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int j, const int i) const { return pdata_[i + nx1_ * (j + nx2_ * n)]; } - PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int k, - const int j, const int i) { + PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int k, const int j, + const int i) { return pdata_[i + nx1_ * (j + nx2_ * (k + nx3_ * n))]; } - PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int k, - const int j, const int i) const { + PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int n, const int k, const int j, + const int i) const { return pdata_[i + nx1_ * (j + nx2_ * (k + nx3_ * n))]; } - PORTABLE_FORCEINLINE_FUNCTION T & - operator()(const int m, const int n, const int k, const int j, const int i) { + PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int m, const int n, const int k, + const int j, const int i) { return pdata_[i + nx1_ * (j + nx2_ * (k + nx3_ * (n + nx4_ * m)))]; } - PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int m, const int n, - const int k, const int j, - const int i) const { + PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int m, const int n, const int k, + const int j, const int i) const { return pdata_[i + nx1_ * (j + nx2_ * (k + nx3_ * (n + nx4_ * m)))]; } // int l?, int o? - PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int p, const int m, - const int n, const int k, - const int j, const int i) { - return pdata_[i + - nx1_ * (j + nx2_ * (k + nx3_ * (n + nx4_ * (m + nx5_ * p))))]; + PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int p, const int m, const int n, + const int k, const int j, const int i) { + return pdata_[i + nx1_ * (j + nx2_ * (k + nx3_ * (n + nx4_ * (m + nx5_ * p))))]; } - PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int p, const int m, - const int n, const int k, - const int j, const int i) const { - return pdata_[i + - nx1_ * (j + nx2_ * (k + nx3_ * (n + nx4_ * (m + nx5_ * p))))]; + PORTABLE_FORCEINLINE_FUNCTION T &operator()(const int p, const int m, const int n, + const int k, const int j, + const int i) const { + return pdata_[i + nx1_ * (j + nx2_ * (k + nx3_ * (n + nx4_ * (m + nx5_ * p))))]; } PortableMDArray &operator*=(T scale) { @@ -237,29 +220,25 @@ class PortableMDArray { PortableMDArray &operator+=(const PortableMDArray &other) { assert(GetSize() == other.GetSize()); - std::transform(pdata_, pdata_ + GetSize(), other.pdata_, pdata_, - std::plus()); + std::transform(pdata_, pdata_ + GetSize(), other.pdata_, pdata_, std::plus()); return *this; } PortableMDArray &operator-=(const PortableMDArray &other) { assert(GetSize() == other.GetSize()); - std::transform(pdata_, pdata_ + GetSize(), other.pdata_, pdata_, - std::minus()); + std::transform(pdata_, pdata_ + GetSize(), other.pdata_, pdata_, std::minus()); return *this; } // Checks that arrays point to same data with same shape // note this POINTER equivalence, not data equivalence bool operator==(const PortableMDArray &other) const; - bool operator!=(const PortableMDArray &other) const { - return !(*this == other); - } + bool operator!=(const PortableMDArray &other) const { return !(*this == other); } // (deferred) initialize an array with slice from another array PORTABLE_FUNCTION - void InitWithShallowSlice(const PortableMDArray &src, const int dim, - const int indx, const int nvar); + void InitWithShallowSlice(const PortableMDArray &src, const int dim, const int indx, + const int nvar); private: T *pdata_; @@ -301,8 +280,7 @@ PortableMDArray::operator=(const PortableMDArray &src) noexcept { template bool PortableMDArray::operator==(const PortableMDArray &rhs) const { return (pdata_ == rhs.pdata_ && nx1_ == rhs.nx1_ && nx2_ == rhs.nx2_ && - nx3_ == rhs.nx3_ && nx4_ == rhs.nx4_ && nx5_ == rhs.nx5_ && - nx6_ == rhs.nx6_); + nx3_ == rhs.nx3_ && nx4_ == rhs.nx4_ && nx5_ == rhs.nx5_ && nx6_ == rhs.nx6_); } //---------------------------------------------------------------------------------------- @@ -316,9 +294,8 @@ bool PortableMDArray::operator==(const PortableMDArray &rhs) const { template PORTABLE_FUNCTION void -PortableMDArray::InitWithShallowSlice(const PortableMDArray &src, - const int dim, const int indx, - const int nvar) { +PortableMDArray::InitWithShallowSlice(const PortableMDArray &src, const int dim, + const int indx, const int nvar) { pdata_ = src.pdata_; if (dim == 6) { nx6_ = nvar; @@ -377,8 +354,7 @@ PortableMDArray::InitWithShallowSlice(const PortableMDArray &src, // \brief allocate new 1D array with elements initialized to zero. template -PORTABLE_FUNCTION void -PortableMDArray::NewPortableMDArray(T *data, int nx1) noexcept { +PORTABLE_FUNCTION void PortableMDArray::NewPortableMDArray(T *data, int nx1) noexcept { nx1_ = nx1; nx2_ = 1; nx3_ = 1; @@ -393,8 +369,8 @@ PortableMDArray::NewPortableMDArray(T *data, int nx1) noexcept { // \brief 2d data allocation template -PORTABLE_FUNCTION void -PortableMDArray::NewPortableMDArray(T *data, int nx2, int nx1) noexcept { +PORTABLE_FUNCTION void PortableMDArray::NewPortableMDArray(T *data, int nx2, + int nx1) noexcept { nx1_ = nx1; nx2_ = nx2; nx3_ = 1; @@ -409,9 +385,8 @@ PortableMDArray::NewPortableMDArray(T *data, int nx2, int nx1) noexcept { // \brief 3d data allocation template -PORTABLE_FUNCTION void -PortableMDArray::NewPortableMDArray(T *data, int nx3, int nx2, - int nx1) noexcept { +PORTABLE_FUNCTION void PortableMDArray::NewPortableMDArray(T *data, int nx3, int nx2, + int nx1) noexcept { nx1_ = nx1; nx2_ = nx2; nx3_ = nx3; @@ -426,9 +401,8 @@ PortableMDArray::NewPortableMDArray(T *data, int nx3, int nx2, // \brief 4d data allocation template -PORTABLE_FUNCTION void -PortableMDArray::NewPortableMDArray(T *data, int nx4, int nx3, int nx2, - int nx1) noexcept { +PORTABLE_FUNCTION void PortableMDArray::NewPortableMDArray(T *data, int nx4, int nx3, + int nx2, int nx1) noexcept { nx1_ = nx1; nx2_ = nx2; nx3_ = nx3; @@ -443,9 +417,9 @@ PortableMDArray::NewPortableMDArray(T *data, int nx4, int nx3, int nx2, // \brief 5d data allocation template -PORTABLE_FUNCTION void -PortableMDArray::NewPortableMDArray(T *data, int nx5, int nx4, int nx3, - int nx2, int nx1) noexcept { +PORTABLE_FUNCTION void PortableMDArray::NewPortableMDArray(T *data, int nx5, int nx4, + int nx3, int nx2, + int nx1) noexcept { nx1_ = nx1; nx2_ = nx2; nx3_ = nx3; @@ -460,9 +434,9 @@ PortableMDArray::NewPortableMDArray(T *data, int nx5, int nx4, int nx3, // \brief 6d data allocation template -PORTABLE_FUNCTION void -PortableMDArray::NewPortableMDArray(T *data, int nx6, int nx5, int nx4, - int nx3, int nx2, int nx1) noexcept { +PORTABLE_FUNCTION void PortableMDArray::NewPortableMDArray(T *data, int nx6, int nx5, + int nx4, int nx3, int nx2, + int nx1) noexcept { nx1_ = nx1; nx2_ = nx2; nx3_ = nx3; diff --git a/ports-of-call/portable_errors.hpp b/ports-of-call/portable_errors.hpp index a3c4f6c2..66a6ad7a 100644 --- a/ports-of-call/portable_errors.hpp +++ b/ports-of-call/portable_errors.hpp @@ -36,33 +36,32 @@ // Use this as an assert with an error message. This assert is *not* // disabled when compiling for production. -#define PORTABLE_ALWAYS_REQUIRE(condition, message) \ - PortsOfCall::ErrorChecking::require(condition, #condition, message, \ - __FILE__, __LINE__) +#define PORTABLE_ALWAYS_REQUIRE(condition, message) \ + PortsOfCall::ErrorChecking::require(condition, #condition, message, __FILE__, __LINE__) // Use this to abort the program with an error message with file and // line number. -#define PORTABLE_ALWAYS_ABORT(message) \ +#define PORTABLE_ALWAYS_ABORT(message) \ PortsOfCall::ErrorChecking::abort(message, __FILE__, __LINE__) // Prints a warning with file and line number. -#define PORTABLE_ALWAYS_WARN(message) \ +#define PORTABLE_ALWAYS_WARN(message) \ PortsOfCall::ErrorChecking::warn(message, __FILE__, __LINE__) // Fills a char* array output with an error message // with file name and line number. Note there is no bounds checking // so make sure you allocate enough memory. -#define PORTABLE_ERROR_MESSAGE(message, output) \ +#define PORTABLE_ERROR_MESSAGE(message, output) \ PortsOfCall::ErrorChecking::error_msg(message, __FILE__, __LINE__, output) // Aborts the program with an error message with file and line number. // if PORTABILITY_STRATEGY_NONE is enabled, then this throws a C++ // exception. Otherwise exceptions are not used. #ifdef PORTABILITY_STRATEGY_NONE -#define PORTABLE_ALWAYS_THROW_OR_ABORT(message) \ +#define PORTABLE_ALWAYS_THROW_OR_ABORT(message) \ PortsOfCall::ErrorChecking::abort_throws(message, __FILE__, __LINE__) #else -#define PORTABLE_ALWAYS_THROW_OR_ABORT(message) \ +#define PORTABLE_ALWAYS_THROW_OR_ABORT(message) \ PortsOfCall::ErrorChecking::abort(message, __FILE__, __LINE__) #endif // PORTABILITY_STRATEGY_NONE @@ -73,8 +72,7 @@ #define PORTABLE_WARN(message) ((void)0) #define PORTABLE_THROW_OR_ABORT(message) ((void)0) #else -#define PORTABLE_REQUIRE(condition, message) \ - PORTABLE_ALWAYS_REQUIRE(condition, message) +#define PORTABLE_REQUIRE(condition, message) PORTABLE_ALWAYS_REQUIRE(condition, message) #define PORTABLE_ABORT(message) PORTABLE_ALWAYS_ABORT(message) #define PORTABLE_WARN(message) PORTABLE_ALWAYS_WARN(message) #define PORTABLE_THROW_OR_ABORT(message) PORTABLE_ALWAYS_THROW_OR_ABORT(message) @@ -106,17 +104,14 @@ namespace impl { // Prints an error message describing the failed condition in an // assert (the assertion is applied above in the macro) with file name // and line number. Then aborts. -PORTABLE_INLINE_FUNCTION void require(bool condition_bool, - const char *const condition, +PORTABLE_INLINE_FUNCTION void require(bool condition_bool, const char *const condition, const char *const message, - const char *const filename, - int const linenumber) { + const char *const filename, int const linenumber) { using PortsOfCall::printf; if (!condition_bool) { - printf( - "### ERROR\n Condition: %s\n Message: %s\n File: " - "%s\n Line number: %i\n", - condition, message, filename, linenumber); + printf("### ERROR\n Condition: %s\n Message: %s\n File: " + "%s\n Line number: %i\n", + condition, message, filename, linenumber); impl::abort(); } } @@ -126,28 +121,24 @@ inline void require(bool condition_bool, const char *const condition, require(condition_bool, condition, message.c_str(), filename, linenumber); } inline void require(bool condition_bool, const char *const condition, - std::stringstream const &message, - const char *const filename, int const linenumber) { + std::stringstream const &message, const char *const filename, + int const linenumber) { require(condition_bool, condition, message.str().c_str(), filename, linenumber); } // Prints an error message with file name and line number and then aborts. -[[noreturn]] PORTABLE_INLINE_FUNCTION void abort(const char *const message, - const char *const filename, - int const linenumber) { +[[noreturn]] PORTABLE_INLINE_FUNCTION void +abort(const char *const message, const char *const filename, int const linenumber) { using PortsOfCall::printf; - printf( - "### ERROR\n Message: %s\n File: %s\n Line number: %i\n", - message, filename, linenumber); + printf("### ERROR\n Message: %s\n File: %s\n Line number: %i\n", message, + filename, linenumber); impl::abort(); } [[noreturn]] inline void abort(std::stringstream const &message, - const char *const filename, - int const linenumber) { + const char *const filename, int const linenumber) { abort(message.str().c_str(), filename, linenumber); } -[[noreturn]] inline void abort(std::string const &message, - const char *const filename, +[[noreturn]] inline void abort(std::string const &message, const char *const filename, int const linenumber) { abort(message.c_str(), filename, linenumber); } @@ -155,35 +146,29 @@ inline void require(bool condition_bool, const char *const condition, // Prints an error message with file name and line number and then // throws an exception. [[noreturn]] inline void abort_throws(const char *const message, - const char *const filename, - int const linenumber) { + const char *const filename, int const linenumber) { std::stringstream msg; - msg << "### ERROR\n Message: " << message - << "\n File: " << filename << "\n Line number: " << linenumber - << std::endl; + msg << "### ERROR\n Message: " << message << "\n File: " << filename + << "\n Line number: " << linenumber << std::endl; throw std::runtime_error(msg.str().c_str()); } [[noreturn]] inline void abort_throws(std::string const &message, - const char *const filename, - int const linenumber) { + const char *const filename, int const linenumber) { abort_throws(message.c_str(), filename, linenumber); } [[noreturn]] inline void abort_throws(std::stringstream const &message, - const char *const filename, - int const linenumber) { + const char *const filename, int const linenumber) { abort_throws(message.str().c_str(), filename, linenumber); } // Prints an warning message with file name and line number and then // program continues. PORTABLE_INLINE_FUNCTION -void warn(const char *const message, const char *const filename, - int const linenumber) { +void warn(const char *const message, const char *const filename, int const linenumber) { using PortsOfCall::printf; - printf( - "### WARNING\n Message: %s\n File: %s\n Line number: " - "%i\n", - message, filename, linenumber); + printf("### WARNING\n Message: %s\n File: %s\n Line number: " + "%i\n", + message, filename, linenumber); } inline void warn(std::stringstream const &message, const char *const filename, int const linenumber) { @@ -199,19 +184,16 @@ inline void warn(std::string const &message, const char *const filename, PORTABLE_INLINE_FUNCTION void error_msg(const char *const input_message, const char *const filename, int const linenumber, char *output_message) { - std::sprintf( - output_message, - "### ERROR\n Message: %s\n File: %s\n Line number: %i\n", - input_message, filename, linenumber); -} -inline void error_msg(std::stringstream const &input_message, - const char *const filename, int const linenumber, - char *output_message) { + std::sprintf(output_message, + "### ERROR\n Message: %s\n File: %s\n Line number: %i\n", + input_message, filename, linenumber); +} +inline void error_msg(std::stringstream const &input_message, const char *const filename, + int const linenumber, char *output_message) { error_msg(input_message.str().c_str(), filename, linenumber, output_message); } -inline void error_msg(std::string const &input_message, - const char *const filename, int const linenumber, - char *output_message) { +inline void error_msg(std::string const &input_message, const char *const filename, + int const linenumber, char *output_message) { error_msg(input_message.c_str(), filename, linenumber, output_message); } diff --git a/script/format.sh b/script/format.sh new file mode 100755 index 00000000..746333ae --- /dev/null +++ b/script/format.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#------------------------------------------------------------------------------ +# © 2021-2023. Triad National Security, LLC. All rights reserved. This +# program was produced under U.S. Government contract 89233218CNA000001 +# for Los Alamos National Laboratory (LANL), which is operated by Triad +# National Security, LLC for the U.S. Department of Energy/National +# Nuclear Security Administration. All rights in the program are +# reserved by Triad National Security, LLC, and the U.S. Department of +# Energy/National Nuclear Security Administration. The Government is +# granted for itself and others acting on its behalf a nonexclusive, +# paid-up, irrevocable worldwide license in this material to reproduce, +# prepare derivative works, distribute copies to the public, perform +# publicly and display publicly, and to permit others to do so. +#------------------------------------------------------------------------------ + + +: ${CFM:=clang-format} +: ${VERBOSE:=0} + +if ! command -v ${CFM} &> /dev/null; then + >&2 echo "Error: No clang format found! Looked for ${CFM}" + exit 1 +else + CFM=$(command -v ${CFM}) + echo "Clang format found: ${CFM}" +fi + +# clang format major version +TARGET_CF_VRSN=12 +CF_VRSN=$(${CFM} --version) +echo "Note we assume clang format version ${TARGET_CF_VRSN}." +echo "You are using ${CF_VRSN}." +echo "If these differ, results may not be stable." + +echo "Formatting..." +REPO=$(git rev-parse --show-toplevel) +for f in $(git grep --untracked -ail res -- :/*.hpp :/*.cpp); do + if [ ${VERBOSE} -ge 1 ]; then + echo ${f} + fi + ${CFM} -style=file -i ${REPO}/${f} +done +echo "...Done" diff --git a/test/test_portsofcall.cpp b/test/test_portsofcall.cpp index 8fb615f4..e864752f 100644 --- a/test/test_portsofcall.cpp +++ b/test/test_portsofcall.cpp @@ -18,27 +18,25 @@ #define CATCH_CONFIG_RUNNER #include "catch2/catch.hpp" -TEST_CASE("EXECUTION_IS_HOST is set correctly", - "[PortsOfCall]") { +TEST_CASE("EXECUTION_IS_HOST is set correctly", "[PortsOfCall]") { // testing this is maybe nontrivial? auto isHost = PortsOfCall::EXECUTION_IS_HOST; #if defined(PORTABILITY_STRATEGY_KOKKOS) - auto checkHost = std::is_same::value; - REQUIRE( isHost == checkHost ); + auto checkHost = std::is_same::value; + REQUIRE(isHost == checkHost); #elif defined(PORTABILITY_STRATEGY_CUDA) - REQUIRE( isHost == false ); + REQUIRE(isHost == false); #else - REQUIRE( isHost == true ); + REQUIRE(isHost == true); #endif - } // this test is lifted directly from `spiner`; // and there appears to be a significant amount of // ports-of-call testing done there. -TEST_CASE("PortableMDArrays can be allocated from a pointer", - "[PortableMDArray]") { +TEST_CASE("PortableMDArrays can be allocated from a pointer", "[PortableMDArray]") { constexpr int N = 2; constexpr int M = 3; std::vector data(N * M); @@ -71,53 +69,48 @@ TEST_CASE("PortableMDArrays can be allocated from a pointer", aslc2.InitWithShallowSlice(a, 1, 0, 2); REQUIRE(aslc1 == aslc2); } - } PORTABLE_FORCEINLINE_FUNCTION -Real index_func(size_t i) { - return i*i + 2.0*i + 3.0; -} +Real index_func(size_t i) { return i * i + 2.0 * i + 3.0; } -TEST_CASE("portableCopy works with all portability strategies", - "[portableCopy]") { +TEST_CASE("portableCopy works with all portability strategies", "[portableCopy]") { // number of elements constexpr const size_t N = 32; // size in bytes - constexpr const size_t Nb = N*sizeof(Real); + constexpr const size_t Nb = N * sizeof(Real); // vector length N on host of Real std::vector b(N); // device pointer - Real* a = (Real*)PORTABLE_MALLOC(Nb); + Real *a = (Real *)PORTABLE_MALLOC(Nb); // set device values to 0 - portableFor("set to 0", 0, N, PORTABLE_LAMBDA(const int& i) - { - a[i] = 0.0; - }); - + portableFor( + "set to 0", 0, N, PORTABLE_LAMBDA(const int &i) { a[i] = 0.0; }); + // set host values to reference - for(size_t i = 0; i < N; ++i) { + for (size_t i = 0; i < N; ++i) { b[i] = index_func(i); } // copy data to device pointer portableCopyToDevice(a, b.data(), Nb); - + // check if device values match reference - int sum {0}; - portableReduce("check portableCopy", 0, N, 0, 0, 0, 0, - PORTABLE_LAMBDA(const int& i, const int &j, const int& k, int& isum) - { - if (a[i] != index_func(i)) { - isum += 1; - } - }, sum); + int sum{0}; + portableReduce( + "check portableCopy", 0, N, 0, 0, 0, 0, + PORTABLE_LAMBDA(const int &i, const int &j, const int &k, int &isum) { + if (a[i] != index_func(i)) { + isum += 1; + } + }, + sum); REQUIRE(sum == 0); // set b to 0 - for (auto& v : b) { + for (auto &v : b) { v = 0.0; } From 4bdc12f5eca769201fb9b591eeb07c09a2eb9150 Mon Sep 17 00:00:00 2001 From: Jonah Miller Date: Wed, 28 Aug 2024 16:41:00 -0600 Subject: [PATCH 2/3] extend developmetn docs a bit --- doc/sphinx/src/developing.rst | 118 ++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/doc/sphinx/src/developing.rst b/doc/sphinx/src/developing.rst index c16de8fc..7cef9845 100644 --- a/doc/sphinx/src/developing.rst +++ b/doc/sphinx/src/developing.rst @@ -23,3 +23,121 @@ directory. This script supports two environment variables, ``CFM`` and ``VERBOSE``. ``CFM`` is the path (or name) of your ``clang-format`` executable. ``VERBOSE=1`` will cause it to output all files it modifies. + +The docs are built but not deployed on PRs from forks, and the +internal tests will not be run automatically. So when the code is +ready for merge, you must ask a project maintainer to trigger the +remaining tests for you. + +Expectations for code review +----------------------------- + +From the perspective of the contributor +```````````````````````````````````````` + +Code review is an integral part of the development process +for ``ports-of-call``. You can expect at least one, perhaps many, +core developers to read your code and offer suggestions. +You should treat this much like scientific or academic peer review. +You should listen to suggestions but also feel entitled to push back +if you believe the suggestions or comments are incorrect or +are requesting too much effort. + +Reviewers may offer conflicting advice, if this is the case, it's an +opportunity to open a discussion and communally arrive at a good +approach. You should feel empowered to argue for which of the +conflicting solutions you prefer or to suggest a compromise. If you +don't feel strongly, that's fine too, but it's best to say so to keep +the lines of communication open. + +Big contributions may be difficult to review in one piece and you may +be requested to split your pull request into two or more separate +contributions. You may also receive many "nitpicky" comments about +code style or structure. These comments help keep a broad codebase, +with many contributors uniform in style and maintainable with +consistent expectations accross the code base. While there is no +formal style guide for now, the regular contributors have a sense for +the broad style of the project. You should take these stylistic and +"nitpicky" suggestions seriously, but you should also feel free to +push back. + +As with any creative endeavor, we put a lot of ourselves into our +code. It can be painful to receive criticism on your contribution and +easy to take it personally. While you should resist the urge to take +offense, it is also partly code reviewer's responsiblity to create a +constructive environment, as discussed below. + +Expectations of code reviewers +```````````````````````````````` + +A good code review builds a contribution up, rather than tearing it +down. Here are a few rules to keep code reviews constructive and +congenial: + +* You should take the time needed to review a contribution and offer + meaningful advice. Unless a contribution is very small, limit + the times you simply click "approve" with a "looks good to me." + +* You should keep your comments constructive. For example, rather than + saying "this pattern is bad," try saying "at this point, you may + want to try this other pattern." + +* Avoid language that can be misconstrued, even if it's common + notation in the commnunity. For example, avoid phrases like "code + smell." + +* Explain why you make a suggestion. In addition to saying "try X + instead of Y" explain why you like pattern X more than pattern Y. + +* A contributor may push back on your suggestion. Be open to the + possibility that you're either asking too much or are incorrect in + this instance. Code review is an opportunity for everyone to learn. + +* Don't just highlight what you don't like. Also highlight the parts + of the pull request you do like and thank the contributor for their + effort. + +Some notes on style and code architecture +`````````````````````````````````````````` + +* A major influence on code style and architecture is the + `ten rules for developing safety-critical code`_, by Gerard Holzmann. + Safety critical code is code that exists in a context where failure + implies serious harm. A flight controler on an airplane or + spacecraft or the microcontroller in a car are examples of + safety-critical contexts. ``ports-of-call`` is not safety-critical + but many of the coding habits advocated for by Holzmann produce + long-lived, easy to understand, easy to parse, and easy to maintain code. + And we take many of the rules to heart. Here are a few that are most + relevant to ``ports-of-call``. They have been adapted slightly to + our context. + + #. Avoid complex flow constructs such as gotos. + + #. All loops must have fixed bounds. This prevents runaway + code. (Note this implies that as a general rule, one should use + ``for`` loops, not ``while`` loops. It also implies one should + keep recursion to a minimum.) + + #. Heap memory allocation should only be performed at + initialization. Heap memory de-allocation should only be + performed at cleanup. + + #. Restrict the length of functions to a single printed page. + + #. Restrict the scope of data to the smallest possible. + + #. Limit pointer use to a single dereference. Avoid pointers of + pointers when possible. + + #. Be compiler warning aware. Try to address compiler warnings as + they come up. + +.. _ten rules for developing safety-critical code: http://web.eecs.umich.edu/~imarkov/10rules.pdf + +* ``ports-of-call`` is a modern C++ code + and both standard template library capabilities and template + metaprogramming are leveraged frequently. This can sometimes make + parsing the code difficult. If you see something you don't + understand, ask. It may be it can be refactored to be more simple or + better documented. From d3167f6831089688d535eb7fc2f72230525115aa Mon Sep 17 00:00:00 2001 From: Jonah Miller Date: Wed, 28 Aug 2024 16:46:04 -0600 Subject: [PATCH 3/3] CC --- cmake/Format.cmake | 2 +- ports-of-call/portability.hpp | 2 +- ports-of-call/portable_arrays.hpp | 2 +- ports-of-call/portable_errors.hpp | 2 +- script/format.sh | 2 +- test/test_portsofcall.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/Format.cmake b/cmake/Format.cmake index b82f1246..d9c8e76f 100644 --- a/cmake/Format.cmake +++ b/cmake/Format.cmake @@ -1,5 +1,5 @@ #========================================================================================= -# (C) (or copyright) 2021. Triad National Security, LLC. All rights reserved. +# (C) (or copyright) 2024. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contract 89233218CNA000001 for Los # Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC diff --git a/ports-of-call/portability.hpp b/ports-of-call/portability.hpp index 38bde3a2..5553d18d 100644 --- a/ports-of-call/portability.hpp +++ b/ports-of-call/portability.hpp @@ -2,7 +2,7 @@ #define _PORTABILITY_HPP_ // ======================================================================================== -// © (or copyright) 2019-2021. Triad National Security, LLC. All rights +// © (or copyright) 2019-2024. Triad National Security, LLC. All rights // reserved. This program was produced under U.S. Government contract // 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is // operated by Triad National Security, LLC for the U.S. Department of diff --git a/ports-of-call/portable_arrays.hpp b/ports-of-call/portable_arrays.hpp index af8ecec7..1de92125 100644 --- a/ports-of-call/portable_arrays.hpp +++ b/ports-of-call/portable_arrays.hpp @@ -6,7 +6,7 @@ // contributors Licensed under the 3-clause BSD License, see LICENSE file for // details // -// © (or copyright) 2019-2021. Triad National Security, LLC. All rights +// © (or copyright) 2019-2024. Triad National Security, LLC. All rights // reserved. This program was produced under U.S. Government contract // 89233218CNA000001 for Los Alamos National Laboratory (LANL), which // is operated by Triad National Security, LLC for the U.S. diff --git a/ports-of-call/portable_errors.hpp b/ports-of-call/portable_errors.hpp index 66a6ad7a..571b8d70 100644 --- a/ports-of-call/portable_errors.hpp +++ b/ports-of-call/portable_errors.hpp @@ -2,7 +2,7 @@ #define _PORTS_OF_CALL_PORTABLE_ERRORS_HPP_ // ======================================================================================== -// © (or copyright) 2023. Triad National Security, LLC. All rights +// © (or copyright) 2023-2024. Triad National Security, LLC. All rights // reserved. This program was produced under U.S. Government contract // 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is // operated by Triad National Security, LLC for the U.S. Department of diff --git a/script/format.sh b/script/format.sh index 746333ae..997cc4a1 100755 --- a/script/format.sh +++ b/script/format.sh @@ -1,7 +1,7 @@ #!/bin/bash #------------------------------------------------------------------------------ -# © 2021-2023. Triad National Security, LLC. All rights reserved. This +# © 2021-2024. Triad National Security, LLC. All rights reserved. This # program was produced under U.S. Government contract 89233218CNA000001 # for Los Alamos National Laboratory (LANL), which is operated by Triad # National Security, LLC for the U.S. Department of Energy/National diff --git a/test/test_portsofcall.cpp b/test/test_portsofcall.cpp index e864752f..ac505243 100644 --- a/test/test_portsofcall.cpp +++ b/test/test_portsofcall.cpp @@ -1,4 +1,4 @@ -// © (or copyright) 2019-2021. Triad National Security, LLC. All rights +// © (or copyright) 2019-2024. Triad National Security, LLC. All rights // reserved. This program was produced under U.S. Government contract // 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is // operated by Triad National Security, LLC for the U.S. Department of