From e59fa4bb4e4e5ed482cf41cde4d46e0659499cdc Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Fri, 14 Oct 2022 10:32:36 -0400 Subject: [PATCH 1/3] rewrite all examples to use TA_SCOPED_INITIALIZE to avoid uninitialized exists even when printing usage --- examples/cc/ccd.cpp | 5 +---- examples/cc/ccsd.cpp | 4 +--- examples/cuda/cuda_librett.cpp | 3 +-- examples/cuda/cuda_task.cpp | 4 +--- examples/dgemm/ta_band.cpp | 4 +--- examples/dgemm/ta_dense.cpp | 4 +--- examples/dgemm/ta_dense_asymm.cpp | 3 +-- examples/dgemm/ta_dense_new_tile.cpp | 3 +-- examples/dgemm/ta_dense_nonuniform.cpp | 4 +--- examples/dgemm/ta_sparse.cpp | 4 +--- examples/dgemm/ta_sparse_grow.cpp | 4 +--- examples/pmap_test/pmap.cpp | 3 +-- examples/vector_tests/ta_vector.cpp | 4 +--- examples/vector_tests/vector.cpp | 4 +--- 14 files changed, 14 insertions(+), 39 deletions(-) diff --git a/examples/cc/ccd.cpp b/examples/cc/ccd.cpp index 2560048d26..1f69e1dc3c 100644 --- a/examples/cc/ccd.cpp +++ b/examples/cc/ccd.cpp @@ -26,7 +26,7 @@ using namespace TiledArray::expressions; int main(int argc, char** argv) { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); std::string file_name = argv[1]; @@ -320,11 +320,8 @@ int main(int argc, char** argv) { } else { std::cout << "Unable to open file: " << file_name << "\n"; - // stop the madenss runtime - TiledArray::finalize(); return 1; } - TiledArray::finalize(); return 0; } diff --git a/examples/cc/ccsd.cpp b/examples/cc/ccsd.cpp index f06b53edf1..2844e32f28 100644 --- a/examples/cc/ccsd.cpp +++ b/examples/cc/ccsd.cpp @@ -26,7 +26,7 @@ using namespace TiledArray::expressions; int main(int argc, char** argv) { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); std::string file_name = argv[1]; @@ -1191,11 +1191,9 @@ int main(int argc, char** argv) { } } else { - TiledArray::finalize(); std::cout << "Unable to open file: " << file_name << "\n"; return 1; } - TiledArray::finalize(); return 0; } diff --git a/examples/cuda/cuda_librett.cpp b/examples/cuda/cuda_librett.cpp index a916bfc729..c513f41af1 100644 --- a/examples/cuda/cuda_librett.cpp +++ b/examples/cuda/cuda_librett.cpp @@ -36,12 +36,11 @@ const std::size_t N = 100; using namespace TiledArray; int main(int argc, char* argv[]) { - TiledArray::initialize(argc, argv); + TA_SCOPED_INITIALIZE(argc, argv); std::vector extent{N, N}; std::vector perm{1, 0}; - TiledArray::finalize(); return 0; } diff --git a/examples/cuda/cuda_task.cpp b/examples/cuda/cuda_task.cpp index 58561cb6ae..a019523b6e 100644 --- a/examples/cuda/cuda_task.cpp +++ b/examples/cuda/cuda_task.cpp @@ -117,7 +117,7 @@ int try_main(int argc, char** argv) { } int main(int argc, char* argv[]) { - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); try { // Initialize runtime try_main(argc, argv); @@ -132,7 +132,5 @@ int main(int argc, char* argv[]) { std::cerr << "unknown exception" << std::endl; } - TiledArray::finalize(); - return 0; } diff --git a/examples/dgemm/ta_band.cpp b/examples/dgemm/ta_band.cpp index 4506a4bcd6..d55550cebd 100644 --- a/examples/dgemm/ta_band.cpp +++ b/examples/dgemm/ta_band.cpp @@ -25,7 +25,7 @@ int main(int argc, char** argv) { try { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); // Get command line arguments if (argc < 2) { @@ -138,8 +138,6 @@ int main(int argc, char** argv) { << "\n"; } - TiledArray::finalize(); - } catch (TiledArray::Exception& e) { std::cerr << "!! TiledArray exception: " << e.what() << "\n"; rc = 1; diff --git a/examples/dgemm/ta_dense.cpp b/examples/dgemm/ta_dense.cpp index 76eeb9d4fb..93ccc10a90 100644 --- a/examples/dgemm/ta_dense.cpp +++ b/examples/dgemm/ta_dense.cpp @@ -40,7 +40,7 @@ int main(int argc, char** argv) { try { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); // Get command line arguments if (argc < 3) { @@ -102,8 +102,6 @@ int main(int argc, char** argv) { else gemm_(world, trange, repeat); - TiledArray::finalize(); - } catch (TiledArray::Exception& e) { std::cerr << "!! TiledArray exception: " << e.what() << "\n"; rc = 1; diff --git a/examples/dgemm/ta_dense_asymm.cpp b/examples/dgemm/ta_dense_asymm.cpp index ac586b9edf..d33fd6192a 100644 --- a/examples/dgemm/ta_dense_asymm.cpp +++ b/examples/dgemm/ta_dense_asymm.cpp @@ -23,7 +23,7 @@ int main(int argc, char** argv) { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); // Get command line arguments if (argc < 6) { @@ -183,6 +183,5 @@ int main(int argc, char** argv) { nullptr)); } - TiledArray::finalize(); return 0; } diff --git a/examples/dgemm/ta_dense_new_tile.cpp b/examples/dgemm/ta_dense_new_tile.cpp index f805467ea1..51646b86f0 100644 --- a/examples/dgemm/ta_dense_new_tile.cpp +++ b/examples/dgemm/ta_dense_new_tile.cpp @@ -40,7 +40,7 @@ int main(int argc, char** argv) { try { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); // Get command line arguments if (argc < 2) { @@ -147,7 +147,6 @@ int main(int argc, char** argv) { << " sec\nAverage GFLOPS = " << double(repeat) * flop / total_time << "\n"; - TiledArray::finalize(); } catch (TiledArray::Exception& e) { std::cerr << "!! TiledArray exception: " << e.what() << "\n"; rc = 1; diff --git a/examples/dgemm/ta_dense_nonuniform.cpp b/examples/dgemm/ta_dense_nonuniform.cpp index b2a02e86ce..e8fa4eacd3 100644 --- a/examples/dgemm/ta_dense_nonuniform.cpp +++ b/examples/dgemm/ta_dense_nonuniform.cpp @@ -26,7 +26,7 @@ int main(int argc, char** argv) { try { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); // Get command line arguments if (argc < 2) { @@ -141,8 +141,6 @@ int main(int argc, char** argv) { << " sec\nAverage GFLOPS = " << double(repeat) * flop / total_time << "\n"; - TiledArray::finalize(); - } catch (TiledArray::Exception& e) { std::cerr << "!! TiledArray exception: " << e.what() << "\n"; rc = 1; diff --git a/examples/dgemm/ta_sparse.cpp b/examples/dgemm/ta_sparse.cpp index 5541517f41..55326ad954 100644 --- a/examples/dgemm/ta_sparse.cpp +++ b/examples/dgemm/ta_sparse.cpp @@ -48,7 +48,7 @@ int main(int argc, char** argv) { try { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); // Get command line arguments if (argc < 2) { @@ -243,8 +243,6 @@ int main(int argc, char** argv) { print_results(world, app_gflops); } - TiledArray::finalize(); - } catch (TiledArray::Exception& e) { std::cerr << "!! TiledArray exception: " << e.what() << "\n"; rc = 1; diff --git a/examples/dgemm/ta_sparse_grow.cpp b/examples/dgemm/ta_sparse_grow.cpp index 9f7d9b920b..ea128814f4 100644 --- a/examples/dgemm/ta_sparse_grow.cpp +++ b/examples/dgemm/ta_sparse_grow.cpp @@ -33,7 +33,7 @@ int main(int argc, char** argv) { try { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); // Get command line arguments if (argc < 2) { @@ -199,8 +199,6 @@ int main(int argc, char** argv) { } } - TiledArray::finalize(); - } catch (TiledArray::Exception& e) { std::cerr << "!! TiledArray exception: " << e.what() << "\n"; rc = 1; diff --git a/examples/pmap_test/pmap.cpp b/examples/pmap_test/pmap.cpp index c2fde3b8a7..b4636690c7 100644 --- a/examples/pmap_test/pmap.cpp +++ b/examples/pmap_test/pmap.cpp @@ -55,7 +55,7 @@ void print_local(TiledArray::World& world, } int main(int argc, char** argv) { - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); std::size_t m = 20; std::size_t n = 10; @@ -101,7 +101,6 @@ int main(int argc, char** argv) { } print_local(world, hash_pmap); - TiledArray::finalize(); return 0; } diff --git a/examples/vector_tests/ta_vector.cpp b/examples/vector_tests/ta_vector.cpp index e57b43526c..f5e13412f0 100644 --- a/examples/vector_tests/ta_vector.cpp +++ b/examples/vector_tests/ta_vector.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) { try { // Initialize runtime - TiledArray::World& world = TiledArray::initialize(argc, argv); + TiledArray::World& world = TA_SCOPED_INITIALIZE(argc, argv); // Get command line arguments if (argc < 3) { @@ -86,8 +86,6 @@ int main(int argc, char** argv) { vector_test(world, trange, repeat); - TiledArray::finalize(); - } catch (TiledArray::Exception& e) { std::cerr << "!! TiledArray exception: " << e.what() << "\n"; rc = 1; diff --git a/examples/vector_tests/vector.cpp b/examples/vector_tests/vector.cpp index c4fe86ec5f..8c6f0865a4 100644 --- a/examples/vector_tests/vector.cpp +++ b/examples/vector_tests/vector.cpp @@ -36,7 +36,7 @@ #define EIGEN_NO_MALLOC int main(int argc, char** argv) { - auto& world = TiledArray::initialize(argc, argv); + auto& world = TA_SCOPED_INITIALIZE(argc, argv); const std::size_t repeat = 100; // Allocate some memory for tests @@ -522,7 +522,5 @@ int main(int argc, char** argv) { free(b); free(c); - TiledArray::finalize(); - return 0; } From 59505fb5a638bca9ee198a8261ee1604e438f753 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Fri, 14 Oct 2022 12:18:05 -0400 Subject: [PATCH 2/3] documented `TA_SCOPED_INITIALIZE` and `TA::{initialized,finalized}()` + added user-guide-1b example --- doc/devsamp/wiki/CMakeLists.txt | 2 +- doc/devsamp/wiki/user-guide-1b.cpp | 29 ++++++++++++++++++++++++++ doc/dox/dev/Basic-Programming.md | 33 ++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 doc/devsamp/wiki/user-guide-1b.cpp diff --git a/doc/devsamp/wiki/CMakeLists.txt b/doc/devsamp/wiki/CMakeLists.txt index 79dd021665..87345d39e1 100644 --- a/doc/devsamp/wiki/CMakeLists.txt +++ b/doc/devsamp/wiki/CMakeLists.txt @@ -17,7 +17,7 @@ # # List of all complete examples -set(wikiexamples user-guide-1;user-guide-1a;user-guide-2) +set(wikiexamples user-guide-1;user-guide-1a;user-guide-1b;user-guide-2) # if target examples-tiledarray does not exist yet, create it if (NOT TARGET examples-tiledarray) diff --git a/doc/devsamp/wiki/user-guide-1b.cpp b/doc/devsamp/wiki/user-guide-1b.cpp new file mode 100644 index 0000000000..b7a753fd87 --- /dev/null +++ b/doc/devsamp/wiki/user-guide-1b.cpp @@ -0,0 +1,29 @@ +#include + +int main(int argc, char* argv[]) { + assert(!TA::initialized()); + assert(!TA::finalized()); + + try { + // Initializes TiledArray + auto& world = TA_SCOPED_INITIALIZE(argc, argv); + + // Do some work here. + + assert(TA::initialized()); + assert(!TA::finalized()); + // if (argc > 1) throw ""; + } // TA::finalize() called when leaving this scope + // exceptional return + catch (...) { + assert(!TA::initialized()); + assert(TA::finalized()); + std::cerr << "oops!\n"; + return 1; + } + + // normal return + assert(!TA::initialized()); + assert(TA::finalized()); + return 0; +} diff --git a/doc/dox/dev/Basic-Programming.md b/doc/dox/dev/Basic-Programming.md index 00bb0b4e07..ee9f08cc4f 100644 --- a/doc/dox/dev/Basic-Programming.md +++ b/doc/dox/dev/Basic-Programming.md @@ -143,6 +143,39 @@ int main(int argc, char* argv[]) { return 0; } ``` +In complex initialization scenarios it is convenient to be able to introspect whether TiledArray has been initialized and/or finalized. Use `TA::initialized()` and `TA::finalized()` to query whether TiledArray is currently initialized and it it has been finalized, respectively. + +To make initialization of TiledArray easier in presence of exceptions (e.g., within a `try` block) or multiple return statements use macro `TA_SCOPED_INITIALIZE(argc,argv,...)` instead of calling `TA::{initialize,finalize}` explicitly: +```.cpp +#include + +int main(int argc, char* argv[]) { + assert(!TA::initialized()); + assert(!TA::finalized()); + + try { + // Initializes TiledArray + auto& world = TA_SCOPED_INITIALIZE(argc, argv); + + // Do some work here. + + assert(TA::initialized()); + assert(!TA::finalized()); + } // TA::finalize() called when leaving this scope + // exceptional return + catch (...) { + assert(!TA::initialized()); + assert(TA::finalized()); + std::cerr << "oops!\n"; + return 1; + } + + // normal return + assert(!TA::initialized()); + assert(TA::finalized()); + return 0; +} +``` ## Construct an array To construct a `DistArray` object, you must supply following the meta data: From 3c83b652ba90287ccf963bd90346c93238f9f9e2 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Fri, 14 Oct 2022 20:19:47 -0400 Subject: [PATCH 3/3] move TILEDARRAY_REVISION dependence into version.cpp to allow ccache do its job properly --- examples/cuda/ta_cc_abcd_cuda.cpp | 2 +- examples/dgemm/ta_cc_abcd.cpp | 2 +- examples/dgemm/ta_dense.cpp | 2 +- examples/dgemm/ta_dense_new_tile.cpp | 2 +- examples/dgemm/ta_dense_nonuniform.cpp | 2 +- examples/dgemm/ta_sparse.cpp | 2 +- examples/dgemm/ta_sparse_grow.cpp | 2 +- examples/vector_tests/ta_vector.cpp | 2 +- src/CMakeLists.txt | 7 +++++++ src/TiledArray/version.cpp | 14 ++++++++++++++ src/TiledArray/version.h.in | 18 ++++++++++-------- 11 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 src/TiledArray/version.cpp diff --git a/examples/cuda/ta_cc_abcd_cuda.cpp b/examples/cuda/ta_cc_abcd_cuda.cpp index 6a2ef26e5f..14a6320e3b 100644 --- a/examples/cuda/ta_cc_abcd_cuda.cpp +++ b/examples/cuda/ta_cc_abcd_cuda.cpp @@ -116,7 +116,7 @@ int main(int argc, char** argv) { if (world.rank() == 0) { std::cout << "TiledArray: CC T2.V term test..." - << "\nGit HASH: " << TILEDARRAY_REVISION + << "\nGit HASH: " << TiledArray::revision() << "\nNumber of nodes = " << world.size() << "\nocc size = " << n_occ << "\nocc nblocks = " << nblk_occ diff --git a/examples/dgemm/ta_cc_abcd.cpp b/examples/dgemm/ta_cc_abcd.cpp index 2d99c6c200..d37cdcbebe 100644 --- a/examples/dgemm/ta_cc_abcd.cpp +++ b/examples/dgemm/ta_cc_abcd.cpp @@ -116,7 +116,7 @@ int main(int argc, char** argv) { if (world.rank() == 0) std::cout << "TiledArray: CC T2.V term test..." - << "\nGit HASH: " << TILEDARRAY_REVISION + << "\nGit HASH: " << TiledArray::revision() << "\nNumber of nodes = " << world.size() << "\nocc size = " << n_occ << "\nocc nblocks = " << nblk_occ diff --git a/examples/dgemm/ta_dense.cpp b/examples/dgemm/ta_dense.cpp index 93ccc10a90..4435e68a31 100644 --- a/examples/dgemm/ta_dense.cpp +++ b/examples/dgemm/ta_dense.cpp @@ -75,7 +75,7 @@ int main(int argc, char** argv) { if (world.rank() == 0) std::cout << "TiledArray: dense matrix multiply test..." - << "\nGit HASH: " << TILEDARRAY_REVISION + << "\nGit HASH: " << TiledArray::revision() << "\nNumber of nodes = " << world.size() << "\nMatrix size = " << matrix_size << "x" << matrix_size << "\nBlock size = " << block_size diff --git a/examples/dgemm/ta_dense_new_tile.cpp b/examples/dgemm/ta_dense_new_tile.cpp index 51646b86f0..ffc317ae0e 100644 --- a/examples/dgemm/ta_dense_new_tile.cpp +++ b/examples/dgemm/ta_dense_new_tile.cpp @@ -74,7 +74,7 @@ int main(int argc, char** argv) { if (world.rank() == 0) std::cout << "TiledArray: dense matrix multiply test..." - << "\nGit HASH: " << TILEDARRAY_REVISION + << "\nGit HASH: " << TiledArray::revision() << "\nNumber of nodes = " << world.size() << "\nMatrix size = " << matrix_size << "x" << matrix_size << "\nBlock size = " << block_size diff --git a/examples/dgemm/ta_dense_nonuniform.cpp b/examples/dgemm/ta_dense_nonuniform.cpp index e8fa4eacd3..4258dc7a89 100644 --- a/examples/dgemm/ta_dense_nonuniform.cpp +++ b/examples/dgemm/ta_dense_nonuniform.cpp @@ -81,7 +81,7 @@ int main(int argc, char** argv) { if (world.rank() == 0) std::cout << "TiledArray: dense-nonuniform matrix multiply test..." - << "\nGit HASH: " << TILEDARRAY_REVISION + << "\nGit HASH: " << TiledArray::revision() << "\nNumber of nodes = " << world.size() << "\nMatrix size = " << matrix_size << "x" << matrix_size << "\nAverage block size = " << block_size diff --git a/examples/dgemm/ta_sparse.cpp b/examples/dgemm/ta_sparse.cpp index 55326ad954..e05ac10b05 100644 --- a/examples/dgemm/ta_sparse.cpp +++ b/examples/dgemm/ta_sparse.cpp @@ -86,7 +86,7 @@ int main(int argc, char** argv) { if (world.rank() == 0) std::cout << "TiledArray: block-sparse matrix multiply test..." - << "\nGit HASH: " << TILEDARRAY_REVISION + << "\nGit HASH: " << TiledArray::revision() << "\nNumber of nodes = " << world.size() << "\nMatrix size = " << matrix_size << "x" << matrix_size << "\nBlock size = " << block_size << "x" diff --git a/examples/dgemm/ta_sparse_grow.cpp b/examples/dgemm/ta_sparse_grow.cpp index ea128814f4..cccfba79e5 100644 --- a/examples/dgemm/ta_sparse_grow.cpp +++ b/examples/dgemm/ta_sparse_grow.cpp @@ -70,7 +70,7 @@ int main(int argc, char** argv) { if (world.rank() == 0) std::cout << "TiledArray: growing, block-sparse matrix multiply test..." - << "\nGit HASH: " << TILEDARRAY_REVISION + << "\nGit HASH: " << TiledArray::revision() << "\nNumber of nodes = " << world.size() << "\nBlock size = " << block_size << "x" << block_size << "\nMemory per matrix = " diff --git a/examples/vector_tests/ta_vector.cpp b/examples/vector_tests/ta_vector.cpp index f5e13412f0..89eab4689b 100644 --- a/examples/vector_tests/ta_vector.cpp +++ b/examples/vector_tests/ta_vector.cpp @@ -64,7 +64,7 @@ int main(int argc, char** argv) { if (world.rank() == 0) std::cout << "TiledArray: vector ops test..." - << "\nGit HASH: " << TILEDARRAY_REVISION + << "\nGit HASH: " << TiledArray::revision() << "\nNumber of nodes = " << world.size() << "\nMatrix size = " << matrix_size << "x" << matrix_size << "\nBlock size = " << block_size diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0b69b9b32..08167dfd1b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -225,11 +225,18 @@ TiledArray/sparse_shape.cpp TiledArray/tensor_impl.cpp TiledArray/array_impl.cpp TiledArray/dist_array.cpp +TiledArray/version.cpp TiledArray/util/backtrace.cpp TiledArray/util/bug.cpp TiledArray/math/linalg/basic.cpp TiledArray/math/linalg/rank-local.cpp ) +# feed TILEDARRAY_REVISION to TiledArray/version.cpp only to avoid recompiling everything +set_property( + SOURCE TiledArray/version.cpp + PROPERTY COMPILE_DEFINITIONS + TILEDARRAY_REVISION=\"${TILEDARRAY_REVISION}\" +) # the list of libraries on which TiledArray depends on, will be cached later # when FetchContent umpire: set(_TILEDARRAY_DEPENDENCIES MADworld TiledArray_Eigen BTAS::BTAS blaspp_headers umpire) diff --git a/src/TiledArray/version.cpp b/src/TiledArray/version.cpp new file mode 100644 index 0000000000..25db201e1a --- /dev/null +++ b/src/TiledArray/version.cpp @@ -0,0 +1,14 @@ +// +// Created by Eduard Valeyev on 10/14/22. +// + +#include + +namespace TiledArray { + +const char* revision() noexcept { + static const char revision[] = TILEDARRAY_REVISION; + return revision; +} + +} // namespace TiledArray diff --git a/src/TiledArray/version.h.in b/src/TiledArray/version.h.in index 9c033cb116..459ba72137 100644 --- a/src/TiledArray/version.h.in +++ b/src/TiledArray/version.h.in @@ -20,22 +20,24 @@ #ifndef TILEDARRAY_VERSION_H__INCLUDED #define TILEDARRAY_VERSION_H__INCLUDED -/* Defines a string with the Git SHA1 revision hash tag of TiledArray */ -#define TILEDARRAY_REVISION "@TILEDARRAY_REVISION@" - -/* TiledArray version X.Y.Z-id */ +/** TiledArray version X.Y.Z-id */ #define TILEDARRAY_VERSION "@TILEDARRAY_VERSION@" -/* TiledArray major version */ +/** TiledArray major version */ #define TILEDARRAY_MAJOR_VERSION @TILEDARRAY_MAJOR_VERSION@ -/* TiledArray minor version */ +/** TiledArray minor version */ #define TILEDARRAY_MINOR_VERSION @TILEDARRAY_MINOR_VERSION@ -/* TiledArray micro version */ +/** TiledArray micro version */ #define TILEDARRAY_MICRO_VERSION @TILEDARRAY_MICRO_VERSION@ -/* TiledArray prerelease id */ +/** TiledArray prerelease id */ #define TILEDARRAY_PRERELEASE_ID "@TILEDARRAY_PRERELEASE_ID@" +namespace TiledArray { +/* \return a string with the Git SHA1 revision hash tag of TiledArray */ +const char* revision() noexcept; +} // namespace TiledArray + #endif // TILEDARRAY_VERSION_H__INCLUDED