From c148c8ebac5137c55d284e989f66bc959650863c Mon Sep 17 00:00:00 2001 From: asadchev Date: Mon, 28 Dec 2020 13:53:01 -0500 Subject: [PATCH 1/4] Boost 1.59 donwgrade and unit tests refactor --- INSTALL.md | 2 +- external/versions.cmake | 5 +++-- tests/CMakeLists.txt | 13 ++++++++++--- tests/bipartite_index_list.cpp | 2 +- tests/bitset.cpp | 2 +- tests/block_range.cpp | 2 +- tests/cutt.cpp | 2 +- tests/math_blas.cpp | 2 +- tests/math_outer.cpp | 2 +- tests/math_partial_reduce.cpp | 2 +- tests/math_transpose.cpp | 2 +- tests/meta.cpp | 2 +- tests/perm_index.cpp | 2 +- tests/permutation.cpp | 2 +- tests/random.cpp | 2 +- tests/range.cpp | 2 +- tests/s_t_t_contract_.cpp | 2 +- tests/symm_irrep.cpp | 2 +- tests/symm_permutation_group.cpp | 2 +- tests/symm_representation.cpp | 2 +- tests/t_s_t_contract_.cpp | 2 +- tests/t_t_t_contract_.cpp | 2 +- tests/t_tot_tot_contract_.cpp | 2 +- tests/tensor.cpp | 2 +- tests/tensor_of_tensor.cpp | 2 +- tests/tensor_shift_wrapper.cpp | 2 +- tests/tensor_tensor_view.cpp | 2 +- tests/tensor_um.cpp | 2 +- tests/tile_op_add.cpp | 2 +- tests/tile_op_contract_reduce.cpp | 2 +- tests/tile_op_mult.cpp | 2 +- tests/tile_op_noop.cpp | 2 +- tests/tile_op_scal.cpp | 2 +- tests/tile_op_scal_add.cpp | 2 +- tests/tile_op_scal_mult.cpp | 2 +- tests/tile_op_scal_subt.cpp | 2 +- tests/tile_op_subt.cpp | 2 +- tests/tiled_range.cpp | 2 +- tests/tiled_range1.cpp | 2 +- tests/tot_tot_tot_contract_.cpp | 2 +- tests/transform_iterator.cpp | 2 +- tests/type_traits.cpp | 2 +- ...{unit_test_config_h.in => unit_test_config.h.in} | 6 ++++-- tests/utility.cpp | 2 +- 44 files changed, 58 insertions(+), 48 deletions(-) rename tests/{unit_test_config_h.in => unit_test_config.h.in} (89%) diff --git a/INSTALL.md b/INSTALL.md index 3dc8fe3344..23ab7c60cc 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -25,7 +25,7 @@ $ cmake --build build --target install - [CMake](https://cmake.org/), version 3.15 or higher; if CUDA support is needed, CMake 3.18 or higher is required. - [Git](https://git-scm.com/) 1.8 or later (required to obtain TiledArray and MADNESS source code from GitHub) - [Eigen](http://eigen.tuxfamily.org/), version 3.3 or higher; if CUDA is enabled then 3.3.7 is required (will be downloaded automatically, if missing) -- [Boost libraries](www.boost.org/), version 1.68 or higher (will be downloaded automatically, if missing). The following principal Boost components are used: +- [Boost libraries](www.boost.org/), version 1.59 or higher (will be downloaded automatically, if missing). The following principal Boost components are used: - Boost.Iterator: header-only - Boost.Container: header-only - Boost.Test: header-only or (optionally) as a compiled library, *only used for unit testing* diff --git a/external/versions.cmake b/external/versions.cmake index c3e1e1722d..c2bbee9a8f 100644 --- a/external/versions.cmake +++ b/external/versions.cmake @@ -1,8 +1,9 @@ # for each dependency track both current and previous id (the variable for the latter must contain PREVIOUS) # to be able to auto-update them -set(TA_TRACKED_BOOST_VERSION 1.68) -set(TA_TRACKED_BOOST_PREVIOUS_VERSION 1.33) +# Boost explicitly downgraded to 1.59 from 1.68 +set(TA_TRACKED_BOOST_VERSION 1.59) +set(TA_TRACKED_BOOST_PREVIOUS_VERSION 1.68) set(TA_INSTALL_BOOST_VERSION 1.70.0) set(TA_INSTALL_BOOST_PREVIOUS_VERSION 1.70.0) set(TA_INSTALL_BOOST_URL_HASH 882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0bec5e9e3f..128dfa8d97 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -23,7 +23,7 @@ # CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/unit_test_config_h.in + ${CMAKE_CURRENT_SOURCE_DIR}/unit_test_config.h.in ${PROJECT_BINARY_DIR}/tests/unit_test_config.h ) @@ -158,9 +158,16 @@ add_test(build_${executable} "${CMAKE_COMMAND}" --build ${PROJECT_BINARY_DIR} -- # Add a test(s) if(ENABLE_MPI) + set (${executable}_np_1_args --run_test=!@distributed) + set (${executable}_np_2_args --run_test=!@serial) foreach(p RANGE 1 2) - add_test(NAME ${executable}-np-${p} - COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${p} ${MPIEXEC_PREFLAGS} $ --log_level=warning --show-progress ${MPIEXEC_POSTFLAGS}) + add_test( + NAME ${executable}-np-${p} + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${p} + ${MPIEXEC_PREFLAGS} + $ --log_level=warning --show-progress ${${executable}_np_${p}_args} + ${MPIEXEC_POSTFLAGS} + ) set_tests_properties(${executable}-np-${p} PROPERTIES DEPENDS build_${executable}) if (p GREATER 1) set_tests_properties(${executable}-np-${p} PROPERTIES ENVIRONMENT TA_UT_DISTRIBUTED=1) diff --git a/tests/bipartite_index_list.cpp b/tests/bipartite_index_list.cpp index 27bef73f09..8268d9206f 100644 --- a/tests/bipartite_index_list.cpp +++ b/tests/bipartite_index_list.cpp @@ -64,7 +64,7 @@ struct BipartiteIndexListFixture { }; BOOST_FIXTURE_TEST_SUITE(bipartite_index_list_suite, BipartiteIndexListFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) /* This unit test ensures that the typedefs are what we think they are. Since no * template meta-programming occurs in the class these tests serve more as a diff --git a/tests/bitset.cpp b/tests/bitset.cpp index 6153b6b972..bffc0ddc89 100644 --- a/tests/bitset.cpp +++ b/tests/bitset.cpp @@ -41,7 +41,7 @@ const std::size_t BitsetFixture::blocks = 11; // ============================================================================= // Bitset Test Suite -BOOST_FIXTURE_TEST_SUITE(bitset_suite, BitsetFixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(bitset_suite, BitsetFixture, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(size_constructor) { // Check for error free construction diff --git a/tests/block_range.cpp b/tests/block_range.cpp index c20fb4af3e..135c36d0b4 100644 --- a/tests/block_range.cpp +++ b/tests/block_range.cpp @@ -47,7 +47,7 @@ const Range BlockRangeFixture::r(std::array{{0, 1, 2}}, std::array{{5, 11, 8}}); BOOST_FIXTURE_TEST_SUITE(block_range_suite, BlockRangeFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) const auto target_count = 20; diff --git a/tests/cutt.cpp b/tests/cutt.cpp index 7cf5be738c..41f9ecb56a 100644 --- a/tests/cutt.cpp +++ b/tests/cutt.cpp @@ -43,7 +43,7 @@ struct cuTTFixture { int C; }; -BOOST_FIXTURE_TEST_SUITE(cutt_suite, cuTTFixture, TA_UT_SKIP_IF_DISTRIBUTED); +BOOST_FIXTURE_TEST_SUITE(cutt_suite, cuTTFixture, TA_UT_LABEL_SERIAL); BOOST_AUTO_TEST_CASE(cutt_gpu_mem) { int* a_host = (int*)std::malloc(A * A * sizeof(int)); diff --git a/tests/math_blas.cpp b/tests/math_blas.cpp index 44fcd896f7..2b3182889f 100644 --- a/tests/math_blas.cpp +++ b/tests/math_blas.cpp @@ -47,7 +47,7 @@ struct BlasFixture { const double BlasFixture::tol = 0.001; -BOOST_FIXTURE_TEST_SUITE(blas_suite, BlasFixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(blas_suite, BlasFixture, TA_UT_LABEL_SERIAL) typedef boost::mpl::list int_types; diff --git a/tests/math_outer.cpp b/tests/math_outer.cpp index 6b0b16fc1b..0e73a4ac03 100644 --- a/tests/math_outer.cpp +++ b/tests/math_outer.cpp @@ -63,7 +63,7 @@ struct OuterFixture { }; // OuterFixture BOOST_FIXTURE_TEST_SUITE(math_outer_suite, OuterFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(outer_kernel) { const std::vector reference = result; diff --git a/tests/math_partial_reduce.cpp b/tests/math_partial_reduce.cpp index 5f99bea4b0..202bd3031c 100644 --- a/tests/math_partial_reduce.cpp +++ b/tests/math_partial_reduce.cpp @@ -67,7 +67,7 @@ struct PartialReduceFixture { }; // PartialReduceFixture BOOST_FIXTURE_TEST_SUITE(math_partial_reduce_suite, PartialReduceFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(unary_row_reduce) { // Create a copy of the result for later use. diff --git a/tests/math_transpose.cpp b/tests/math_transpose.cpp index f8aefcc21c..9a486f105e 100644 --- a/tests/math_transpose.cpp +++ b/tests/math_transpose.cpp @@ -35,7 +35,7 @@ struct TransposeFixture { }; // TransposeFixture BOOST_FIXTURE_TEST_SUITE(transpose_suite, TransposeFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(copy) { const std::size_t m = 20; diff --git a/tests/meta.cpp b/tests/meta.cpp index 563236ed56..295d5e1c80 100644 --- a/tests/meta.cpp +++ b/tests/meta.cpp @@ -31,7 +31,7 @@ struct MetaFixture {}; // MetaFixture -BOOST_FIXTURE_TEST_SUITE(meta_suite, MetaFixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(meta_suite, MetaFixture, TA_UT_LABEL_SERIAL) double sin(double x) { return std::sin(x); } double cos(double x) { return std::cos(x); } diff --git a/tests/perm_index.cpp b/tests/perm_index.cpp index 7b25637d15..3ba48aa7a1 100644 --- a/tests/perm_index.cpp +++ b/tests/perm_index.cpp @@ -50,7 +50,7 @@ const std::array PermIndexFixture::finish = { {3ul, 5ul, 7ul, 11ul}}; BOOST_FIXTURE_TEST_SUITE(perm_index_suite, PermIndexFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(default_constructor) { BOOST_CHECK_NO_THROW(PermIndex x;); diff --git a/tests/permutation.cpp b/tests/permutation.cpp index e29c384a63..356c663eba 100644 --- a/tests/permutation.cpp +++ b/tests/permutation.cpp @@ -74,7 +74,7 @@ typedef boost::mpl::list ptypes0; typedef boost::mpl::list ptypes1; BOOST_FIXTURE_TEST_SUITE(permutation_suite, PermutationFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE_TEMPLATE(constructor, Permutation, ptypes0) { // check default constructor diff --git a/tests/random.cpp b/tests/random.cpp index a3333d3cb7..c5ffbf1a56 100644 --- a/tests/random.cpp +++ b/tests/random.cpp @@ -11,7 +11,7 @@ using true_types = boost::mpl::list, std::complex>; } // namespace -BOOST_AUTO_TEST_SUITE(can_make_random, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_AUTO_TEST_SUITE(can_make_random, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE_TEMPLATE(can_make_random_false, ValueType, false_types) { using can_make_random_t = CanMakeRandom; diff --git a/tests/range.cpp b/tests/range.cpp index 4029a1d500..0e9987220b 100644 --- a/tests/range.cpp +++ b/tests/range.cpp @@ -60,7 +60,7 @@ const RangeFixture::index RangeFixture::p4(GlobalFixture::dim, 4); const RangeFixture::index RangeFixture::p5(GlobalFixture::dim, 5); const RangeFixture::index RangeFixture::p6(GlobalFixture::dim, 6); -BOOST_FIXTURE_TEST_SUITE(range_suite, RangeFixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(range_suite, RangeFixture, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(dimension_accessor) { BOOST_CHECK_EQUAL_COLLECTIONS(r.lobound_data(), r.lobound_data() + r.rank(), diff --git a/tests/s_t_t_contract_.cpp b/tests/s_t_t_contract_.cpp index b677169d1e..c84c9c00d5 100644 --- a/tests/s_t_t_contract_.cpp +++ b/tests/s_t_t_contract_.cpp @@ -23,7 +23,7 @@ using namespace TiledArray; using namespace TiledArray::expressions; -BOOST_AUTO_TEST_SUITE(s_t_t_contract_fxn, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_AUTO_TEST_SUITE(s_t_t_contract_fxn, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(i_i) { Tensor lhs(Range{4}, {80, 36, 4, 36}); diff --git a/tests/symm_irrep.cpp b/tests/symm_irrep.cpp index cff1883c04..62ba0ba058 100644 --- a/tests/symm_irrep.cpp +++ b/tests/symm_irrep.cpp @@ -36,7 +36,7 @@ struct IrrepFixture { using TiledArray::Irrep; BOOST_FIXTURE_TEST_SUITE(symm_irrep_suite, IrrepFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { { diff --git a/tests/symm_permutation_group.cpp b/tests/symm_permutation_group.cpp index 62e16827dd..6660562596 100644 --- a/tests/symm_permutation_group.cpp +++ b/tests/symm_permutation_group.cpp @@ -121,7 +121,7 @@ struct PermutationGroupFixture { }; // PermutationGroupFixture BOOST_FIXTURE_TEST_SUITE(symm_group_suite, PermutationGroupFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // SymmetricGroup "degree" ctor diff --git a/tests/symm_representation.cpp b/tests/symm_representation.cpp index c1351d0182..91f171d5c7 100644 --- a/tests/symm_representation.cpp +++ b/tests/symm_representation.cpp @@ -97,7 +97,7 @@ U1_Operator identity() { } // namespace symmetry } // namespace TiledArray -BOOST_FIXTURE_TEST_SUITE(symm_representation_suite, GroupRepresentationFixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(symm_representation_suite, GroupRepresentationFixture, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // representation for permutation symmetry diff --git a/tests/t_s_t_contract_.cpp b/tests/t_s_t_contract_.cpp index 743313d162..26cd2acd12 100644 --- a/tests/t_s_t_contract_.cpp +++ b/tests/t_s_t_contract_.cpp @@ -23,7 +23,7 @@ using namespace TiledArray; using namespace TiledArray::expressions; -BOOST_AUTO_TEST_SUITE(t_s_t_contract_fxn, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_AUTO_TEST_SUITE(t_s_t_contract_fxn, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(i_i) { double lhs = 3.0; diff --git a/tests/t_t_t_contract_.cpp b/tests/t_t_t_contract_.cpp index 92e6505c4b..98a82eed34 100644 --- a/tests/t_t_t_contract_.cpp +++ b/tests/t_t_t_contract_.cpp @@ -23,7 +23,7 @@ using namespace TiledArray; using namespace TiledArray::expressions; -BOOST_AUTO_TEST_SUITE(t_t_t_contract_fxn, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_AUTO_TEST_SUITE(t_t_t_contract_fxn, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(ij_i_j) { Tensor lhs(Range{4}, {24, 95, 2, 37}); diff --git a/tests/t_tot_tot_contract_.cpp b/tests/t_tot_tot_contract_.cpp index fc1fdba5ca..12f85ffabc 100644 --- a/tests/t_tot_tot_contract_.cpp +++ b/tests/t_tot_tot_contract_.cpp @@ -23,7 +23,7 @@ using namespace TiledArray; using namespace TiledArray::expressions; -BOOST_AUTO_TEST_SUITE(t_tot_tot_contract_fxn, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_AUTO_TEST_SUITE(t_tot_tot_contract_fxn, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(ij_eq_i_k_times_j_k){ Tensor lhs_elem_0(Range{6}, {94, 83, 18, 33, 12, 74}); diff --git a/tests/tensor.cpp b/tests/tensor.cpp index 15c74aafe3..f8600053b5 100644 --- a/tests/tensor.cpp +++ b/tests/tensor.cpp @@ -31,7 +31,7 @@ const TensorFixture::range_type TensorFixture::r = make_range(81); -BOOST_FIXTURE_TEST_SUITE(tensor_suite, TensorFixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(tensor_suite, TensorFixture, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(default_constructor) { // check constructor diff --git a/tests/tensor_of_tensor.cpp b/tests/tensor_of_tensor.cpp index d06ddd0608..0f4683d174 100644 --- a/tests/tensor_of_tensor.cpp +++ b/tests/tensor_of_tensor.cpp @@ -164,7 +164,7 @@ const BipartitePermutation TensorOfTensorFixture::bperm(Permutation{1, 0, 3, 2}, 2); BOOST_FIXTURE_TEST_SUITE(tensor_of_tensor_suite, TensorOfTensorFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) #ifdef TILEDARRAY_HAS_BTAS typedef boost::mpl::list, bTensorI> itensor_types; diff --git a/tests/tensor_shift_wrapper.cpp b/tests/tensor_shift_wrapper.cpp index 9f777d514a..e3fa12a9d6 100644 --- a/tests/tensor_shift_wrapper.cpp +++ b/tests/tensor_shift_wrapper.cpp @@ -64,7 +64,7 @@ struct ShiftWrapperFixture { }; // ShiftWrapperFixture BOOST_FIXTURE_TEST_SUITE(tensor_shift_wrapper_suite, ShiftWrapperFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { BOOST_CHECK_NO_THROW(shift(t1)); diff --git a/tests/tensor_tensor_view.cpp b/tests/tensor_tensor_view.cpp index 114cb8d1ef..1a6262f45e 100644 --- a/tests/tensor_tensor_view.cpp +++ b/tests/tensor_tensor_view.cpp @@ -59,7 +59,7 @@ const std::array TensorViewFixture::lower_bound{{0, 1, 2}}; const std::array TensorViewFixture::upper_bound{{5, 7, 11}}; BOOST_FIXTURE_TEST_SUITE(tensor_view_suite, TensorViewFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(non_const_view) { for (auto lower_it = t.range().begin(); lower_it != t.range().end(); diff --git a/tests/tensor_um.cpp b/tests/tensor_um.cpp index c23e10e51e..310e04234f 100644 --- a/tests/tensor_um.cpp +++ b/tests/tensor_um.cpp @@ -88,7 +88,7 @@ struct TensorUMFixture { const TensorUMFixture::range_type TensorUMFixture::r = make_range(81); BOOST_FIXTURE_TEST_SUITE(tensor_um_suite, TensorUMFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(default_constructor) { // check constructor diff --git a/tests/tile_op_add.cpp b/tests/tile_op_add.cpp index bce6e0570c..b264ae15bf 100644 --- a/tests/tile_op_add.cpp +++ b/tests/tile_op_add.cpp @@ -50,7 +50,7 @@ struct AddFixture : public RangeFixture { }; // AddFixture BOOST_FIXTURE_TEST_SUITE(tile_op_add_suite, AddFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check that the constructors can be called without throwing exceptions diff --git a/tests/tile_op_contract_reduce.cpp b/tests/tile_op_contract_reduce.cpp index 2f39516a02..76d09ca6eb 100644 --- a/tests/tile_op_contract_reduce.cpp +++ b/tests/tile_op_contract_reduce.cpp @@ -77,7 +77,7 @@ struct ContractReduceFixture { } BOOST_FIXTURE_TEST_SUITE(tile_op_contract_reduce_suite, ContractReduceFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { BOOST_REQUIRE_NO_THROW((ContractReduce( diff --git a/tests/tile_op_mult.cpp b/tests/tile_op_mult.cpp index 2a783ae5f9..571d5287e5 100644 --- a/tests/tile_op_mult.cpp +++ b/tests/tile_op_mult.cpp @@ -50,7 +50,7 @@ struct MultFixture : public RangeFixture { }; // MultFixture BOOST_FIXTURE_TEST_SUITE(tile_op_mult_suite, MultFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check that the constructors can be called without throwing exceptions diff --git a/tests/tile_op_noop.cpp b/tests/tile_op_noop.cpp index bfbb37709c..95db0e2729 100644 --- a/tests/tile_op_noop.cpp +++ b/tests/tile_op_noop.cpp @@ -47,7 +47,7 @@ struct NoopFixture : public RangeFixture { }; // NoopFixture -BOOST_FIXTURE_TEST_SUITE(tile_op_noop_suite, NoopFixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(tile_op_noop_suite, NoopFixture, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check that the constructors can be called without throwing exceptions diff --git a/tests/tile_op_scal.cpp b/tests/tile_op_scal.cpp index 785965f039..b2684b278c 100644 --- a/tests/tile_op_scal.cpp +++ b/tests/tile_op_scal.cpp @@ -48,7 +48,7 @@ struct ScalFixture : public RangeFixture { }; // ScalFixture BOOST_FIXTURE_TEST_SUITE(tile_op_scal_neg_suite, ScalFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check that the constructors can be called without throwing exceptions diff --git a/tests/tile_op_scal_add.cpp b/tests/tile_op_scal_add.cpp index a1b7a01683..954976b8e7 100644 --- a/tests/tile_op_scal_add.cpp +++ b/tests/tile_op_scal_add.cpp @@ -50,7 +50,7 @@ struct ScalAddFixture : public RangeFixture { }; // AddFixture BOOST_FIXTURE_TEST_SUITE(tile_op_scal_add_suite, ScalAddFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check that the constructors can be called without throwing exceptions diff --git a/tests/tile_op_scal_mult.cpp b/tests/tile_op_scal_mult.cpp index fdd17ce7bf..3d055e9934 100644 --- a/tests/tile_op_scal_mult.cpp +++ b/tests/tile_op_scal_mult.cpp @@ -51,7 +51,7 @@ struct ScalMultFixture : public RangeFixture { }; // ScalMultFixture BOOST_FIXTURE_TEST_SUITE(tile_op_scal_mult_suite, ScalMultFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check that the constructors can be called without throwing exceptions diff --git a/tests/tile_op_scal_subt.cpp b/tests/tile_op_scal_subt.cpp index b5703608b6..473076d9ea 100644 --- a/tests/tile_op_scal_subt.cpp +++ b/tests/tile_op_scal_subt.cpp @@ -51,7 +51,7 @@ struct ScalSubtFixture : public RangeFixture { }; // SubtFixture BOOST_FIXTURE_TEST_SUITE(tile_op_scal_subt_suite, ScalSubtFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check that the constructors can be called without throwing exceptions diff --git a/tests/tile_op_subt.cpp b/tests/tile_op_subt.cpp index d78d31f1f2..300aad1656 100644 --- a/tests/tile_op_subt.cpp +++ b/tests/tile_op_subt.cpp @@ -50,7 +50,7 @@ struct SubtFixture : public RangeFixture { }; // SubtFixture BOOST_FIXTURE_TEST_SUITE(tile_op_subt_suite, SubtFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check that the constructors can be called without throwing exceptions diff --git a/tests/tiled_range.cpp b/tests/tiled_range.cpp index 8bacde44d6..14e47e3557 100644 --- a/tests/tiled_range.cpp +++ b/tests/tiled_range.cpp @@ -25,7 +25,7 @@ using namespace TiledArray; BOOST_FIXTURE_TEST_SUITE(tiled_range_suite, TiledRangeFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(accessor) { BOOST_CHECK_EQUAL(tr.tiles_range(), tiles_range); diff --git a/tests/tiled_range1.cpp b/tests/tiled_range1.cpp index c47f22bc30..0833b948f4 100644 --- a/tests/tiled_range1.cpp +++ b/tests/tiled_range1.cpp @@ -25,7 +25,7 @@ using namespace TiledArray; -BOOST_FIXTURE_TEST_SUITE(range1_suite, Range1Fixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(range1_suite, Range1Fixture, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(range_accessor) { BOOST_CHECK_EQUAL(tr1.tiles_range().first, tiles.first); diff --git a/tests/tot_tot_tot_contract_.cpp b/tests/tot_tot_tot_contract_.cpp index c4d1cdac5f..432cd2bfea 100644 --- a/tests/tot_tot_tot_contract_.cpp +++ b/tests/tot_tot_tot_contract_.cpp @@ -23,7 +23,7 @@ using namespace TiledArray; using namespace TiledArray::expressions; -BOOST_AUTO_TEST_SUITE(tot_tot_tot_contract_fxn, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_AUTO_TEST_SUITE(tot_tot_tot_contract_fxn, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(ij_k_eq_i_k_times_j_k) { Tensor lhs_elem_0(Range{6}, {23, 90, 76, 21, 13, 80}); diff --git a/tests/transform_iterator.cpp b/tests/transform_iterator.cpp index d1e48dbfe7..edda957e67 100644 --- a/tests/transform_iterator.cpp +++ b/tests/transform_iterator.cpp @@ -80,7 +80,7 @@ struct TransformIterFixture { std::vector TransformIterFixture::v1(make_vec(1)); std::vector TransformIterFixture::v2(make_vec(2)); -BOOST_FIXTURE_TEST_SUITE(transform_iterator_suite, TransformIterFixture, TA_UT_SKIP_IF_DISTRIBUTED) +BOOST_FIXTURE_TEST_SUITE(transform_iterator_suite, TransformIterFixture, TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(constructor) { // Check binary transform iterator constructor diff --git a/tests/type_traits.cpp b/tests/type_traits.cpp index 783b626911..105ae6ff72 100644 --- a/tests/type_traits.cpp +++ b/tests/type_traits.cpp @@ -42,7 +42,7 @@ struct TypeTraitsFixture { }; // TypeTraitsFixture BOOST_FIXTURE_TEST_SUITE(type_traits_suite, TypeTraitsFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(sanity) { constexpr bool double_has_value_type = diff --git a/tests/unit_test_config_h.in b/tests/unit_test_config.h.in similarity index 89% rename from tests/unit_test_config_h.in rename to tests/unit_test_config.h.in index 0342df6917..bd23b8414b 100644 --- a/tests/unit_test_config_h.in +++ b/tests/unit_test_config.h.in @@ -1,3 +1,5 @@ +/* AUTOMATICALLY GENERATED */ + /* * This file is a part of TiledArray. * Copyright (C) 2013 Virginia Tech @@ -56,7 +58,7 @@ #include "global_fixture.h" #include "iteration_test.h" -#define TA_UT_SKIP_IF_DISTRIBUTED *boost::unit_test::precondition(GlobalFixture::world_size_eq_1()) -#define TA_UT_SKIP_IF_SERIAL *boost::unit_test::precondition(GlobalFixture::world_size_gt_1()) +#define TA_UT_LABEL_DISTRIBUTED *boost::unit_test::label("distributed") +#define TA_UT_LABEL_SERIAL *boost::unit_test::label("serial") #endif // TILEDARRAY_CONFIG_H__INCLUDED diff --git a/tests/utility.cpp b/tests/utility.cpp index 12cb20d18f..3ca135a24e 100644 --- a/tests/utility.cpp +++ b/tests/utility.cpp @@ -37,7 +37,7 @@ struct UtilityFixture { }; // UtilityFixture BOOST_FIXTURE_TEST_SUITE(utility_suite, UtilityFixture, - TA_UT_SKIP_IF_DISTRIBUTED) + TA_UT_LABEL_SERIAL) BOOST_AUTO_TEST_CASE(vector) { std::vector array(10, 1); From b541302eeb8234bcea592923ff7a6ff38544bb77 Mon Sep 17 00:00:00 2001 From: asadchev Date: Mon, 28 Dec 2020 13:59:12 -0500 Subject: [PATCH 2/4] Rename examples/dgemm files --- examples/dgemm/CMakeLists.txt | 2 +- examples/dgemm/{blas.cpp => ta_blas.cpp} | 0 examples/dgemm/{eigen.cpp => ta_eigen.cpp} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename examples/dgemm/{blas.cpp => ta_blas.cpp} (100%) rename examples/dgemm/{eigen.cpp => ta_eigen.cpp} (100%) diff --git a/examples/dgemm/CMakeLists.txt b/examples/dgemm/CMakeLists.txt index c43464668e..47df67bf36 100644 --- a/examples/dgemm/CMakeLists.txt +++ b/examples/dgemm/CMakeLists.txt @@ -25,7 +25,7 @@ # Create example executable -foreach(_exec blas eigen ta_band ta_dense ta_sparse ta_dense_nonuniform +foreach(_exec ta_blas ta_eigen ta_band ta_dense ta_sparse ta_dense_nonuniform ta_dense_asymm ta_sparse_grow ta_dense_new_tile ta_cc_abcd) diff --git a/examples/dgemm/blas.cpp b/examples/dgemm/ta_blas.cpp similarity index 100% rename from examples/dgemm/blas.cpp rename to examples/dgemm/ta_blas.cpp diff --git a/examples/dgemm/eigen.cpp b/examples/dgemm/ta_eigen.cpp similarity index 100% rename from examples/dgemm/eigen.cpp rename to examples/dgemm/ta_eigen.cpp From 5bb5925599c5cb48ed365193d6c1147c9fa6d00a Mon Sep 17 00:00:00 2001 From: asadchev Date: Mon, 28 Dec 2020 14:03:15 -0500 Subject: [PATCH 3/4] Added bin/gitlab-ci.sh CI script --- bin/gitlab-ci.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 bin/gitlab-ci.sh diff --git a/bin/gitlab-ci.sh b/bin/gitlab-ci.sh new file mode 100755 index 0000000000..cb0f66990e --- /dev/null +++ b/bin/gitlab-ci.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +echo "$ $0 $@" + +if [ "$#" -lt 1 ]; then + echo "CMake project directory argument required" + exit 1 +fi + +project_dir=$1 +shift + +cmake_args="-DTA_BUILD_UNITTEST=TRUE" + +for arg in $@; do + cmake_args+=" -D$arg" +done + +cmake_build_target="cmake --build . --target " + +set -e +set -x + +# to run OpenMPI in docker as root +export OMPI_ALLOW_RUN_AS_ROOT=1 +export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 +export OMPI_MCA_btl_vader_single_copy_mechanism="none" + +cmake $project_dir $cmake_args + +$cmake_build_target tiledarray +$cmake_build_target examples +$cmake_build_target ta_test +$cmake_build_target check + From 1bc4a4e405baaa8c3b5b35892b1ad42036cf1b11 Mon Sep 17 00:00:00 2001 From: asadchev Date: Mon, 28 Dec 2020 14:03:47 -0500 Subject: [PATCH 4/4] Gitlab CI build using bin/gitlab-ci.sh --- .gitlab-ci.yml | 38 ++++++++++++-------------------- cmake/toolchains/gitlab-ci.cmake | 4 ---- 2 files changed, 14 insertions(+), 28 deletions(-) delete mode 100644 cmake/toolchains/gitlab-ci.cmake diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c192c2b7bd..caff407457 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,12 +4,6 @@ stages: default: tags: [ docker ] -variables: - # to run OpenMPI in docker - OMPI_ALLOW_RUN_AS_ROOT: 1 - OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 - OMPI_MCA_btl_vader_single_copy_mechanism: none - before_script: - echo 'localhost slots=8' > /etc/openmpi/openmpi-default-hostfile - apt-get install -yq intel-mkl-core-c-2020.4-304 @@ -18,36 +12,32 @@ before_script: build: stage: build timeout: 3h + interruptible: true image: valeevgroup/${IMAGE} variables: CXX: ${CXX} - TA_PYTHON : "TA_PYTHON=OFF" ENABLE_MKL : "ENABLE_MKL=OFF" ENABLE_SCALAPACK : "ENABLE_SCALAPACK=OFF" script: - mkdir build - cd build - - cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/gitlab-ci.cmake - -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - -D${TA_PYTHON} - -D${ENABLE_MKL} - -D${ENABLE_SCALAPACK} - - make tiledarray - - make examples - - make ta_test - - make check + - ../bin/gitlab-ci.sh .. + CMAKE_BUILD_TYPE=${BUILD_TYPE} + ${TA_PYTHON} + ${ENABLE_MKL} + ${ENABLE_SCALAPACK} + MPIEXEC_PREFLAGS="--allow-run-as-root" + blacs_LIBRARIES=scalapack-openmpi + scalapack_LIBRARIES=scalapack-openmpi + lapack_LIBRARIES=lapack parallel: matrix: - - CXX: [ g++ ] - IMAGE : [ "ubuntu:20.04" ] + - IMAGE : [ "ubuntu:20.04" ] + CXX: [ g++, clang++-9 ] BUILD_TYPE : [ "Release", "Debug" ] ENABLE_MKL : [ "ENABLE_MKL=ON", "ENABLE_MKL=OFF" ] ENABLE_SCALAPACK : [ "ENABLE_SCALAPACK=ON", "ENABLE_SCALAPACK=OFF" ] - - CXX: [ g++ ] - IMAGE : [ "ubuntu:20.04" ] + - IMAGE : [ "ubuntu:18.04", "ubuntu:20.04" ] + CXX: [ g++ ] BUILD_TYPE : [ "Release", "Debug" ] TA_PYTHON : [ "TA_PYTHON=ON" ] - - CXX: [ clang++-9 ] - IMAGE : [ "ubuntu:20.04" ] - BUILD_TYPE : [ "Release", "Debug" ] - ENABLE_MKL : [ "ENABLE_MKL=ON", "ENABLE_MKL=OFF" ] diff --git a/cmake/toolchains/gitlab-ci.cmake b/cmake/toolchains/gitlab-ci.cmake deleted file mode 100644 index bf0e0d0d31..0000000000 --- a/cmake/toolchains/gitlab-ci.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(TA_BUILD_UNITTEST TRUE) -set(blacs_LIBRARIES "scalapack-openmpi") -set(scalapack_LIBRARIES "scalapack-openmpi") -set(lapack_LIBRARIES "lapack")