From 3244129872e48b5c8c32f2b969da745e764a15e7 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 04:11:42 +0300 Subject: [PATCH 01/16] Add c++17 fallback for erase_if --- dccrg.hpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dccrg.hpp b/dccrg.hpp index cd0eb57..fc38e94 100644 --- a/dccrg.hpp +++ b/dccrg.hpp @@ -82,6 +82,20 @@ Namespace where all dccrg classes, functions, etc are defined. namespace dccrg { + /* Custom implementation of erase_if for C++17 */ + template + static inline + void erase_if(std::unordered_set v, F pred) { +#if __cplusplus >= 202002L + std::erase_if(v, pred); +#else + for(const auto& k:v) + if(pred(k)) + v.erase(k); +#endif + return; + } + static const int /*! @var */ @@ -9023,7 +9037,7 @@ template < unique_induced_refines.clear(); } - std::erase_if(cells_to_refine, [this](uint64_t cell){return !this->is_local(cell);}); + dccrg::erase_if(cells_to_refine, [this](uint64_t cell){return !this->is_local(cell);}); // add refines from all processes to cells_to_refine std::vector refines(this->cells_to_refine.begin(), this->cells_to_refine.end()); @@ -9355,7 +9369,7 @@ template < this->all_to_all_set(new_donts); } while (new_donts.size() > 0); - std::erase_if(old_donts, [this](uint64_t cell){return !this->is_local(cell);});; + dccrg::erase_if(old_donts, [this](uint64_t cell){return !this->is_local(cell);});; this->cells_not_to_refine = old_donts; this->all_to_all_set(this->cells_not_to_refine); From 23b5aa90f5ec8dae950c4e456ea059f28d56aa76 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 04:16:25 +0300 Subject: [PATCH 02/16] Fix get_cell_datatype Deprecate support for `get_mpi_datatype()` (i.e. without argument) and also `get_cell_mpi_datatype_basic`. Update related test files. --- dccrg_get_cell_datatype.hpp | 329 ++++-------------- .../get_cell_mpi_datatype.cpp | 125 ------- tests/get_cell_datatype/project_makefile | 15 +- tests/get_cell_datatype/run_time.cpp | 34 +- 4 files changed, 78 insertions(+), 425 deletions(-) delete mode 100644 tests/get_cell_datatype/get_cell_mpi_datatype.cpp diff --git a/dccrg_get_cell_datatype.hpp b/dccrg_get_cell_datatype.hpp index 7047118..c1357b2 100644 --- a/dccrg_get_cell_datatype.hpp +++ b/dccrg_get_cell_datatype.hpp @@ -28,87 +28,17 @@ along with dccrg. If not, see . #include "mpi.h" -#include "boost/function_types/property_tags.hpp" -#include "boost/mpl/vector.hpp" -#include "boost/tti/has_member_function.hpp" - - namespace dccrg { namespace detail { - -BOOST_TTI_HAS_MEMBER_FUNCTION(get_mpi_datatype) - - -/*! -Returns the MPI transfer info from given cell. - -Version for get_mpi_datatype(const uint64_t, ..., const int) const. -*/ -template< - class Cell_Data -> typename std::enable_if< - has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector< - const uint64_t, - const int, - const int, - const bool, - const int - >, - boost::function_types::const_qualified - >::value, - std::tuple< - void*, - int, - MPI_Datatype - > ->::type get_cell_mpi_datatype( - const Cell_Data& cell, - const uint64_t cell_id, - const int sender, - const int receiver, - const bool receiving, - const int neighborhood_id -) { - return cell.get_mpi_datatype( - cell_id, - sender, - receiver, - receiving, - neighborhood_id - ); -} - - /*! Returns the MPI transfer info from given cell. Version for get_mpi_datatype(const uint64_t, ..., const int). */ -template< - class Cell_Data -> typename std::enable_if< - has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector< - const uint64_t, - const int, - const int, - const bool, - const int - > - >::value, - std::tuple< - void*, - int, - MPI_Datatype - > ->::type get_cell_mpi_datatype( - Cell_Data& cell, +template +std::tuple get_cell_mpi_datatype( + Cell_Data_T& cell, const uint64_t cell_id, const int sender, const int receiver, @@ -124,136 +54,84 @@ template< ); } - -/*! -Returns the MPI transfer info from given cell. - -Version for get_mpi_datatype() const. -Gives precedence to get_mpi_datatype which takes arguments. -*/ -template< - class Cell_Data -> typename std::enable_if< - has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector<>, - boost::function_types::const_qualified - >::value - and not - has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector< - const uint64_t, - const int, - const int, - const bool, - const int - >, - boost::function_types::const_qualified - >::value, - std::tuple< - void*, - int, - MPI_Datatype - > ->::type get_cell_mpi_datatype( - const Cell_Data& cell, - const uint64_t /*cell_id*/, - const int /*sender*/, - const int /*receiver*/, - const bool /*receiving*/, - const int /*neighborhood_id*/ -) { - return cell.get_mpi_datatype(); -} - - -/*! -Returns the MPI transfer info from given cell. - -Version for get_mpi_datatype(). -Gives precedence to get_mpi_datatype which takes arguments. -*/ -template< - class Cell_Data -> typename std::enable_if< - has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector<> - >::value - and not - has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector< - const uint64_t, - const int, - const int, - const bool, - const int - > - >::value, - std::tuple< - void*, - int, - MPI_Datatype - > ->::type get_cell_mpi_datatype( - Cell_Data& cell, - const uint64_t /*cell_id*/, - const int /*sender*/, - const int /*receiver*/, - const bool /*receiving*/, - const int /*neighborhood_id*/ -) { - return cell.get_mpi_datatype(); -} - - -// give a human-readable error message -template std::tuple get_mpi_datatype_basic(Cell_Data&) { - static_assert( - not std::is_same::value, - "Cell_Data given to dccrg is not a supported type and " - "doesn't have get_mpi_datatype() member function either" - ); - return std::make_tuple(nullptr, -1, MPI_DATATYPE_NULL); +// Compatibility macros +#define UNUSED_GMD_ARGS \ + const uint64_t cell_id, \ + const int sender, \ + const int receiver, \ + const bool receiving, \ + const int neighborhood_id +#define DEFAULT_GMD_ARGS 0,0,0,0,0 +// struct types weapper +template +struct array_wrapper:std::array { + std::tuple + inline get_mpi_datatype(UNUSED_GMD_ARGS) { + auto cell = (std::array)(*this); + return std::make_tuple((void*) cell.data(), cell.size(), D); + } + T operator[] (std::size_t i) const { + return std::array::operator[](i); + } + T& operator[] (std::size_t i) { + return std::array::operator[](i); + } +}; +template // OS for std::ostream, w/o including header +OS& operator<< (OS& os, const array_wrapper x) { + return os << (std::array)x; } - -#define DCCRG_GET_MPI_DATATYPE_BASIC(CPP, MPI) \ - std::tuple< \ - void*, int, MPI_Datatype \ - > inline get_mpi_datatype_basic(CPP& cell) { \ - return std::make_tuple((void*) &cell, 1, MPI); \ +// primitive types weapper +template +struct wrapper { + T value; + /* + std::tuple + get_mpi_datatype(UNUSED_GCMD_ARGS) { + return std::make_tuple((void*)this, 1, MPI_##type); } -DCCRG_GET_MPI_DATATYPE_BASIC(char, MPI_CHAR) -DCCRG_GET_MPI_DATATYPE_BASIC(signed char, MPI_CHAR) -DCCRG_GET_MPI_DATATYPE_BASIC(unsigned char, MPI_UNSIGNED_CHAR) -DCCRG_GET_MPI_DATATYPE_BASIC(short int, MPI_SHORT) -DCCRG_GET_MPI_DATATYPE_BASIC(unsigned short int, MPI_UNSIGNED_SHORT) -DCCRG_GET_MPI_DATATYPE_BASIC(int, MPI_INT) -DCCRG_GET_MPI_DATATYPE_BASIC(unsigned int, MPI_UNSIGNED) -DCCRG_GET_MPI_DATATYPE_BASIC(long int, MPI_LONG) -DCCRG_GET_MPI_DATATYPE_BASIC(unsigned long int, MPI_UNSIGNED_LONG) -DCCRG_GET_MPI_DATATYPE_BASIC(long long int, MPI_LONG_LONG) -DCCRG_GET_MPI_DATATYPE_BASIC(unsigned long long int, MPI_UNSIGNED_LONG_LONG) -DCCRG_GET_MPI_DATATYPE_BASIC(float, MPI_FLOAT) -DCCRG_GET_MPI_DATATYPE_BASIC(double, MPI_DOUBLE) -DCCRG_GET_MPI_DATATYPE_BASIC(long double, MPI_LONG_DOUBLE) -DCCRG_GET_MPI_DATATYPE_BASIC(wchar_t, MPI_WCHAR) -DCCRG_GET_MPI_DATATYPE_BASIC(bool, MPI_CXX_BOOL) + */ +}; +template // OS for std::ostream, w/o including header +OS& operator<< (OS& os, const wrapper x) { + return os << x.value; +} +#define DCCRG_GET_MPI_DATATYPE_BASIC(T, type) \ + struct dccrg_##type:wrapper { \ + T value; \ + std::tuple \ + get_mpi_datatype(UNUSED_GMD_ARGS) { \ + return std::make_tuple((void*)this, 1, MPI_##type); \ + } \ + inline operator T() const { return this->value; } \ + dccrg_##type(const T x): value(x) {} \ + dccrg_##type() {} \ + }; +DCCRG_GET_MPI_DATATYPE_BASIC(char, CHAR) +//DCCRG_GET_MPI_DATATYPE_BASIC(signed char, CHAR) +DCCRG_GET_MPI_DATATYPE_BASIC(unsigned char, UNSIGNED_CHAR) +DCCRG_GET_MPI_DATATYPE_BASIC(short int, SHORT) +DCCRG_GET_MPI_DATATYPE_BASIC(unsigned short int, UNSIGNED_SHORT) +DCCRG_GET_MPI_DATATYPE_BASIC(int, INT) +DCCRG_GET_MPI_DATATYPE_BASIC(unsigned int, UNSIGNED) +DCCRG_GET_MPI_DATATYPE_BASIC(long int, LONG) +DCCRG_GET_MPI_DATATYPE_BASIC(unsigned long int, UNSIGNED_LONG) +DCCRG_GET_MPI_DATATYPE_BASIC(long long int, LONG_LONG) +DCCRG_GET_MPI_DATATYPE_BASIC(unsigned long long int, UNSIGNED_LONG_LONG) +DCCRG_GET_MPI_DATATYPE_BASIC(float, FLOAT) +DCCRG_GET_MPI_DATATYPE_BASIC(double, DOUBLE) +DCCRG_GET_MPI_DATATYPE_BASIC(long double, LONG_DOUBLE) +DCCRG_GET_MPI_DATATYPE_BASIC(wchar_t, WCHAR) +DCCRG_GET_MPI_DATATYPE_BASIC(bool, CXX_BOOL) #ifdef DCCRG_USER_COMPLEX -DCCRG_GET_MPI_DATATYPE_BASIC(std::complex, MPI_CXX_FLOAT_COMPLEX) -DCCRG_GET_MPI_DATATYPE_BASIC(std::complex, MPI_CXX_DOUBLE_COMPLEX) -DCCRG_GET_MPI_DATATYPE_BASIC(std::complex, MPI_CXX_LONG_DOUBLE_COMPLEX) +DCCRG_GET_MPI_DATATYPE_BASIC(std::complex, CXX_FLOAT_COMPLEX) +DCCRG_GET_MPI_DATATYPE_BASIC(std::complex, CXX_DOUBLE_COMPLEX) +DCCRG_GET_MPI_DATATYPE_BASIC(std::complex, CXX_LONG_DOUBLE_COMPLEX) #endif #undef DCCRG_GET_MPI_DATATYPE_BASIC #define DCCRG_GET_MPI_DATATYPE_ARRAY(CPP, MPI) \ - template std::tuple< \ + template std::tuple< \ void*, int, MPI_Datatype \ > inline get_mpi_datatype_basic(std::array& cell) { \ return std::make_tuple((void*) cell.data(), cell.size(), MPI); \ @@ -280,65 +158,6 @@ DCCRG_GET_MPI_DATATYPE_ARRAY(std::complex, MPI_CXX_LONG_DOUBLE_COMP #endif #undef DCCRG_GET_MPI_DATATYPE_ARRAY -/*! -Returns the MPI transfer info from given cell. - -Version for cell that doesn't have get_mpi_datatype(). -*/ -template< - class Cell_Data -> typename std::enable_if< - not has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector< - const uint64_t, - const int, - const int, - const bool, - const int - >, - boost::function_types::const_qualified - >::value - and not has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector< - const uint64_t, - const int, - const int, - const bool, - const int - > - >::value - and not has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector<>, - boost::function_types::const_qualified - >::value - and not has_member_function_get_mpi_datatype< - Cell_Data, - std::tuple, - boost::mpl::vector<> - >::value, - std::tuple< - void*, - int, - MPI_Datatype - > ->::type get_cell_mpi_datatype( - Cell_Data& cell, - const uint64_t /*cell_id*/, - const int /*sender*/, - const int /*receiver*/, - const bool /*receiving*/, - const int /*neighborhood_id*/ -) { - return get_mpi_datatype_basic(cell); -} - - }} // namespaces #endif diff --git a/tests/get_cell_datatype/get_cell_mpi_datatype.cpp b/tests/get_cell_datatype/get_cell_mpi_datatype.cpp deleted file mode 100644 index 0acbed6..0000000 --- a/tests/get_cell_datatype/get_cell_mpi_datatype.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* -Tests get_cell_mpi_datatype function of dccrg. - -Copyright 2014, 2015, 2016, 2018 Ilja Honkonen -Copyright 2018 Finnish Meteorological Institute - -Dccrg is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License version 3 -as published by the Free Software Foundation. - -Dccrg is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with dccrg. If not, see . -*/ - - -#include "cstdlib" -#include "iostream" -#include "tuple" - -#include "mpi.h" - -#include "dccrg_get_cell_datatype.hpp" - -int main(int /*argc*/, char** /*argv*/) { - void* address = NULL; - int count = -1; - MPI_Datatype datatype = MPI_DATATYPE_NULL; - - signed char char_; - std::tie(address, count, datatype) = dccrg::detail::get_cell_mpi_datatype(char_, 0, 0, 0, false, 0); - if (count != 1) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (address != &char_) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (datatype != MPI_CHAR) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - - short int sint_; - std::tie(address, count, datatype) = dccrg::detail::get_cell_mpi_datatype(sint_, 0, 0, 0, false, 0); - if (count != 1) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (address != &sint_) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (datatype != MPI_SHORT) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - - int int_; - std::tie(address, count, datatype) = dccrg::detail::get_cell_mpi_datatype(int_, 0, 0, 0, false, 0); - if (count != 1) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (address != &int_) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (datatype != MPI_INT) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - - unsigned long int ulong_; - std::tie(address, count, datatype) = dccrg::detail::get_cell_mpi_datatype(ulong_, 0, 0, 0, false, 0); - if (count != 1) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (address != &ulong_) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (datatype != MPI_UNSIGNED_LONG) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - - float float_; - std::tie(address, count, datatype) = dccrg::detail::get_cell_mpi_datatype(float_, 0, 0, 0, false, 0); - if (count != 1) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (address != &float_) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (datatype != MPI_FLOAT) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - - long double ldouble_; - std::tie(address, count, datatype) = dccrg::detail::get_cell_mpi_datatype(ldouble_, 0, 0, 0, false, 0); - if (count != 1) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (address != &ldouble_) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - if (datatype != MPI_LONG_DOUBLE) { - std::cerr << __FILE__ << ":" << __LINE__ << std::endl; - abort(); - } - - return EXIT_SUCCESS; -} diff --git a/tests/get_cell_datatype/project_makefile b/tests/get_cell_datatype/project_makefile index 20dac04..b561715 100644 --- a/tests/get_cell_datatype/project_makefile +++ b/tests/get_cell_datatype/project_makefile @@ -1,12 +1,10 @@ TESTS_GET_CELL_DATATYPE_EXECUTABLES = \ tests/get_cell_datatype/included.exe \ tests/get_cell_datatype/enable_if.exe \ - tests/get_cell_datatype/run_time.exe \ - tests/get_cell_datatype/get_cell_mpi_datatype.exe + tests/get_cell_datatype/run_time.exe TESTS_GET_CELL_DATATYPE_TESTS = \ - tests/get_cell_datatype/run_time.tst \ - tests/get_cell_datatype/get_cell_mpi_datatype.tst + tests/get_cell_datatype/run_time.tst tests/get_cell_datatype/executables: $(TESTS_GET_CELL_DATATYPE_EXECUTABLES) @@ -53,12 +51,3 @@ tests/get_cell_datatype/run_time.exe: \ tests/get_cell_datatype/run_time.tst: \ tests/get_cell_datatype/run_time.exe @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ - -tests/get_cell_datatype/get_cell_mpi_datatype.exe: \ - tests/get_cell_datatype/get_cell_mpi_datatype.cpp \ - $(TESTS_GET_CELL_DATATYPE_COMMON_DEPS) - $(TESTS_GET_CELL_DATATYPE_COMPILE_COMMAND) - -tests/get_cell_datatype/get_cell_mpi_datatype.tst: \ - tests/get_cell_datatype/get_cell_mpi_datatype.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ diff --git a/tests/get_cell_datatype/run_time.cpp b/tests/get_cell_datatype/run_time.cpp index 6001110..3841d6e 100644 --- a/tests/get_cell_datatype/run_time.cpp +++ b/tests/get_cell_datatype/run_time.cpp @@ -23,20 +23,6 @@ along with dccrg. If not, see . #include "dccrg_get_cell_datatype.hpp" -struct Cell1 { - std::tuple get_mpi_datatype() - { - return std::make_tuple((void*) NULL, 1, MPI_DATATYPE_NULL); - } -}; - -struct Cell2 { - std::tuple get_mpi_datatype() const - { - return std::make_tuple((void*) NULL, 2, MPI_DATATYPE_NULL); - } -}; - struct Cell3 { std::tuple get_mpi_datatype( const uint64_t /*cell_id*/, @@ -95,12 +81,7 @@ struct Cell6 { return std::make_tuple((void*) NULL, 7, MPI_DATATYPE_NULL); } - std::tuple get_mpi_datatype() const - { - return std::make_tuple((void*) NULL, 8, MPI_DATATYPE_NULL); - } - - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) NULL, 9, MPI_DATATYPE_NULL); } @@ -117,15 +98,10 @@ struct Cell7 { return std::make_tuple((void*) NULL, 10, MPI_DATATYPE_NULL); } - std::tuple get_mpi_datatype() const + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) const { return std::make_tuple((void*) NULL, 11, MPI_DATATYPE_NULL); } - - std::tuple get_mpi_datatype() - { - return std::make_tuple((void*) NULL, 12, MPI_DATATYPE_NULL); - } }; #define CHECK_DATATYPE_COUNT(cell, returned_count) \ @@ -152,12 +128,6 @@ int main(int /*argc*/, char** /*argv*/) int count = -1; MPI_Datatype datatype = MPI_DATATYPE_NULL; - Cell1 c1; - CHECK_DATATYPE_COUNT(c1, 1) - - const Cell2 c2; - CHECK_DATATYPE_COUNT(c2, 2) - Cell3 c3; CHECK_DATATYPE_COUNT(c3, 3) From 67af6de3a177418ce2dea9cff09f59b84a6d74e9 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 04:16:57 +0300 Subject: [PATCH 03/16] Bump C++ version to 17 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ed03521..3c79c2e 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ ENVIRONMENT_MAKEFILE = makefiles/homedir # # The lines below are not intended to be modified by users # -CXXFLAGS = -std=c++11 -W -Wall -Wextra -pedantic -O3 +CXXFLAGS = -std=c++17 -W -Wall -Wextra -pedantic -O3 include $(ENVIRONMENT_MAKEFILE) # filled by project makefiles From 946c73a3e0e3094ebfd520f4b2ad6aced27d6221 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 04:22:30 +0300 Subject: [PATCH 04/16] Fix constructor tests By adding UNUSED_GMD_ARGS to comply with the supported function signature; and re-added the copy constructor removed from commit `bb8a995`. --- dccrg.hpp | 94 +++++++++++++++++++++++++++++ tests/constructors/copy.cpp | 11 ++-- tests/constructors/project_makefile | 4 +- tests/constructors/simple.cpp | 2 +- 4 files changed, 103 insertions(+), 8 deletions(-) diff --git a/dccrg.hpp b/dccrg.hpp index fc38e94..8d97423 100644 --- a/dccrg.hpp +++ b/dccrg.hpp @@ -327,7 +327,101 @@ template < // Copy constructor is deleted, since copying the entire grid is typically a mistake +#ifdef COPY_TEST + /*! + Creates an instance of the grid based on another instance of the grid. + + Call this with all processes unless you really know what you are doing. + Must not be used while the instance being copied is updating remote + neighbor data or balancing the load. + The Cell_Data class can differ between the two grids. + The geometry of this grid must be compatible with the other + grid's geometry (it must have a copy contructor taking the + other grid's geometry as an argument). + + The following data is not included in the new dccrg instance: + - Other_Cell_Data, in other words the other grid's cell data + - refined/unrefined cells + - everything related to load balancing or remote neighbor updates + + A dccrg instance created this way is already initialized. + */ + template< + class Other_Cell_Data, + class Other_Geometry + > Dccrg(const Dccrg& other) : + topology_rw(other.topology), + mapping_rw(other.mapping), + geometry_rw(length, mapping, topology), + mapping_initialized(other.get_mapping_initialized()), + grid_initialized(other.get_initialized()), + neighborhood_length(other.get_neighborhood_length()), + max_tag(other.get_max_tag()), + send_single_cells(other.get_send_single_cells()), + comm(other.get_communicator()), + rank(uint64_t(other.get_rank())), + comm_size(uint64_t(other.get_comm_size())), + neighborhood_of(other.get_neighborhood_of()), + neighborhood_to(other.get_neighborhood_to()), + user_hood_of(other.get_user_hood_of()), + user_hood_to(other.get_user_hood_to()), + neighbors_to(other.get_all_neighbors_to()), + user_neigh_of(other.get_all_user_neigh_of()), + user_neigh_to(other.get_all_user_neigh_to()), + cell_process(other.get_cell_process()), + local_cells_on_process_boundary(other.get_local_cells_on_process_boundary_internal()), + remote_cells_on_process_boundary(other.get_remote_cells_on_process_boundary_internal()), + user_local_cells_on_process_boundary(other.get_user_local_cells_on_process_boundary()), + user_remote_cells_on_process_boundary(other.get_user_remote_cells_on_process_boundary()), + cells_to_send(other.get_cells_to_send()), + cells_to_receive(other.get_cells_to_receive()), + user_neigh_cells_to_send(other.get_user_neigh_cells_to_send()), + user_neigh_cells_to_receive(other.get_user_neigh_cells_to_receive()), + pin_requests(other.get_pin_requests()), + new_pin_requests(other.get_new_pin_requests()), + processes_per_part(other.get_processes_per_part()), + partitioning_options(other.get_partitioning_options()), + no_load_balancing(other.get_no_load_balancing()), + reserved_options(other.get_reserved_options()), + cell_weights(other.get_cell_weights()), + neighbor_processes(other.get_neighbor_processes()), + balancing_load(other.get_balancing_load()) + { + if (other.get_balancing_load()) { + std::cerr << __FILE__ << ":" << __LINE__ + << " Copy constructor called while the instance being copied is balancing load" + << std::endl; + abort(); + } + + if (!this->geometry_rw.set(other.geometry)) { + std::cerr << __FILE__ << ":" << __LINE__ + << " Couldn't set geometry while copy constructing" + << std::endl; + abort(); + } + + if (!this->mapping_rw.set_maximum_refinement_level(other.mapping.get_maximum_refinement_level())) { + std::cerr << __FILE__ << ":" << __LINE__ + << " Couldn't set maximum refinement level when copy constructing" + << std::endl; + abort(); + } + + this->zoltan = Zoltan_Copy(other.get_zoltan()); + + // default construct Other_Cell_Data of local cells + for (typename std::unordered_map::const_iterator + cell_item = other.get_cell_data().begin(); + cell_item != other.get_cell_data().end(); + cell_item++ + ) { + this->cell_data[cell_item->first]; + } + } +#else template< class Other_Cell_Data, class Other_Geometry > Dccrg(const Dccrg& other) = delete; +#endif /*! Initializes the instance of the grid with given parameters. diff --git a/tests/constructors/copy.cpp b/tests/constructors/copy.cpp index 87ce115..979d61a 100644 --- a/tests/constructors/copy.cpp +++ b/tests/constructors/copy.cpp @@ -37,7 +37,7 @@ Cell data in grid1. struct Cell1 { int data = -1; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) &(this->data), 1, MPI_INT); } @@ -49,7 +49,7 @@ Cell data in grid2. struct Cell2 { double data = -2; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->data), 1, MPI_DOUBLE); } @@ -74,6 +74,7 @@ int main(int argc, char* argv[]) return EXIT_FAILURE; } +{ // wrap all entities into a scope to force destructor before MPI_Finalize dccrg::Dccrg grid1; grid1 @@ -96,7 +97,7 @@ int main(int argc, char* argv[]) const std::unordered_set& remote_neighbors1 = grid1.get_remote_cells_on_process_boundary_internal(); - const std::unordered_map& cell_process1 + const std::unordered_map& cell_process1 = grid1.get_cell_process(); for (const auto& cell: remote_neighbors1) { @@ -148,7 +149,7 @@ int main(int argc, char* argv[]) const std::unordered_set& remote_neighbors2 = grid2.get_remote_cells_on_process_boundary_internal(); - const std::unordered_map& cell_process2 + const std::unordered_map& cell_process2 = grid2.get_cell_process(); for (const auto& cell: remote_neighbors2) { @@ -166,7 +167,7 @@ int main(int argc, char* argv[]) abort(); } } - +} MPI_Finalize(); return EXIT_SUCCESS; diff --git a/tests/constructors/project_makefile b/tests/constructors/project_makefile index 52c5976..3bd1084 100644 --- a/tests/constructors/project_makefile +++ b/tests/constructors/project_makefile @@ -46,9 +46,9 @@ tests/constructors/simple.exe: \ tests/constructors/copy.exe: \ tests/constructors/copy.cpp \ $(TESTS_CONSTRUCTORS_COMMON_DEPS) - $(TESTS_CONSTRUCTORS_COMPILE_COMMAND) + $(TESTS_CONSTRUCTORS_COMPILE_COMMAND) -DCOPY_TEST tests/constructors/copy.tst: \ tests/constructors/copy.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/constructors/simple.cpp b/tests/constructors/simple.cpp index 921966a..456b672 100644 --- a/tests/constructors/simple.cpp +++ b/tests/constructors/simple.cpp @@ -58,7 +58,7 @@ struct CellData { return *this; } - std::tuple get_mpi_datatype() { + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) &(this->data), 1, MPI_DOUBLE); } }; From 5e26e95ef6a6190ebee141a11e9c7948ea435593 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 04:28:31 +0300 Subject: [PATCH 05/16] Add makefile for development on hile --- makefiles/hile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 makefiles/hile diff --git a/makefiles/hile b/makefiles/hile new file mode 100644 index 0000000..99894b0 --- /dev/null +++ b/makefiles/hile @@ -0,0 +1,25 @@ +# Makefile for the case where all prerequisites are installed +# into your home directory according to the instructions at +# https://github.com/fmihpc/dccrg/wiki/Install +CXX = g++ +MPICXX = cc + +RUN = +MPIRUN = #mpiexec -n 3 + +CPPFLAGS = -I . -Wno-sign-compare -fsanitize=address + +BOOST_CPPFLAGS = -I $(HOME)/include +BOOST_LDFLAGS = -L $(HOME)/lib +BOOST_LIBS = -lboost_program_options + +LIBRARY_PREFIX = /turso/group/spacephysics/vlasiator/libraries/libraries-hile_cpu +ZOLTAN_CPPFLAGS = -isystem $(LIBRARY_PREFIX)/include +ZOLTAN_LDFLAGS = -L$(LIBRARY_PREFIX)/lib64 -lzoltan -Wl,-rpath=$(LIBRARY_PREFIX)/lib64 +#ZOLTAN_CPPFLAGS = -I $(pwd)/../../library-build/Zoltan/include +#ZOLTAN_LDFLAGS = -L $(pwd)/../../library-build/Zoltan/lib +ZOLTAN_LIBS = -lzoltan + +INC_PROFILE = -isystem $(LIBRARY_PREFIX)/include -D_ROCTX -I${ROCM_PATH}/include +LIB_PROFILE = -L$(LIBRARY_PREFIX)/lib -lnophiprof -Wl,-rpath=$(LIBRARY_PREFIX)/lib +CXXFLAGS += $(INC_PROFILE) $(LIB_PROFILE) -Wno-unused-parameter -Wno-sign-compare -ggdb From 606b244c5cdd14a912203d2377aba1127aa1cf96 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 04:31:42 +0300 Subject: [PATCH 06/16] Fix additional_cell_data tests Make get_cell_datatype conform with fnSig --- tests/additional_cell_data/neighbor_data1.cpp | 6 +++--- tests/additional_cell_data/neighbor_data2.cpp | 6 +++--- tests/additional_cell_data/test1.cpp | 6 +++--- tests/additional_cell_data/test2.cpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/additional_cell_data/neighbor_data1.cpp b/tests/additional_cell_data/neighbor_data1.cpp index 46ef232..4688702 100644 --- a/tests/additional_cell_data/neighbor_data1.cpp +++ b/tests/additional_cell_data/neighbor_data1.cpp @@ -31,7 +31,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) cerr << "Zoltan_Initialize failed" << endl; abort(); } - +{ // initialize grid Dccrg< Cell, @@ -106,7 +106,7 @@ int main(int argc, char* argv[]) } } } - +} MPI_Finalize(); return EXIT_SUCCESS; diff --git a/tests/additional_cell_data/neighbor_data2.cpp b/tests/additional_cell_data/neighbor_data2.cpp index fa55cf1..5539b82 100644 --- a/tests/additional_cell_data/neighbor_data2.cpp +++ b/tests/additional_cell_data/neighbor_data2.cpp @@ -31,7 +31,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } @@ -70,7 +70,7 @@ int main(int argc, char* argv[]) cerr << "Zoltan_Initialize failed" << endl; abort(); } - +{ // initialize grid Dccrg< Cell, @@ -111,7 +111,7 @@ int main(int argc, char* argv[]) } } } - +} MPI_Finalize(); return EXIT_SUCCESS; diff --git a/tests/additional_cell_data/test1.cpp b/tests/additional_cell_data/test1.cpp index a9be90d..074df73 100644 --- a/tests/additional_cell_data/test1.cpp +++ b/tests/additional_cell_data/test1.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } @@ -67,7 +67,7 @@ int main(int argc, char* argv[]) cerr << "Zoltan_Initialize failed" << endl; abort(); } - +{ // initialize grid Dccrg> grid; grid @@ -99,7 +99,7 @@ int main(int argc, char* argv[]) abort(); } } - +} MPI_Finalize(); return EXIT_SUCCESS; diff --git a/tests/additional_cell_data/test2.cpp b/tests/additional_cell_data/test2.cpp index ab01e5a..85a3565 100644 --- a/tests/additional_cell_data/test2.cpp +++ b/tests/additional_cell_data/test2.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } @@ -72,7 +72,7 @@ int main(int argc, char* argv[]) cerr << "Zoltan_Initialize failed" << endl; abort(); } - +{ // initialize grid Dccrg> grid; grid @@ -140,7 +140,7 @@ int main(int argc, char* argv[]) abort(); } } - +} MPI_Finalize(); return EXIT_SUCCESS; From c536c55d201ed5a7696a64ad9a8ca0fa177ed6af Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 04:45:20 +0300 Subject: [PATCH 07/16] Fixing game of life test - Conform to fnSig - Make sure to call ~Dccrg before MPI_Finalize - Wrap primitive type into wrapper - Disable array test as it hasn't bern finished yet - Suppress unused variable warning for this test --- dccrg.hpp | 3 ++ makefiles/hile | 1 + tests/game_of_life/cell.hpp | 2 + tests/game_of_life/game_of_life_test.cpp | 4 +- .../game_of_life/game_of_life_test_array.cpp | 2 +- tests/game_of_life/hierarchical_test.cpp | 2 +- tests/game_of_life/pinned_cells.cpp | 2 +- tests/game_of_life/project_makefile | 41 ++++++++++--------- tests/game_of_life/refined.cpp | 2 +- tests/game_of_life/refined2d.cpp | 2 +- tests/game_of_life/refined_scalability3d.cpp | 2 +- tests/game_of_life/scalability.cpp | 2 +- tests/game_of_life/scalability1d.cpp | 2 +- tests/game_of_life/scalability3d.cpp | 2 +- tests/game_of_life/unrefined2d.cpp | 4 +- 15 files changed, 40 insertions(+), 33 deletions(-) diff --git a/dccrg.hpp b/dccrg.hpp index 8d97423..2280e2d 100644 --- a/dccrg.hpp +++ b/dccrg.hpp @@ -4900,6 +4900,9 @@ template < } const int neighbor_ref_lvl = this->mapping.get_refinement_level(neighCell); +#ifdef DCCRG_SURPRESS_UNUSED_VAR + (void)neighbor_ref_lvl; //Suppress unused var +#endif return_neighbors.push_back({neighCell, {offsets[0], offsets[1], offsets[2]} }); } diff --git a/makefiles/hile b/makefiles/hile index 99894b0..d1a0f39 100644 --- a/makefiles/hile +++ b/makefiles/hile @@ -8,6 +8,7 @@ RUN = MPIRUN = #mpiexec -n 3 CPPFLAGS = -I . -Wno-sign-compare -fsanitize=address +CPPFLAGS += -DDCCRG_NO_STOP_REFINING_ERR -DDCCRG_SURPRESS_UNUSED_VAR BOOST_CPPFLAGS = -I $(HOME)/include BOOST_LDFLAGS = -L $(HOME)/lib diff --git a/tests/game_of_life/cell.hpp b/tests/game_of_life/cell.hpp index 1a317da..2737831 100644 --- a/tests/game_of_life/cell.hpp +++ b/tests/game_of_life/cell.hpp @@ -26,6 +26,8 @@ along with dccrg. If not, see . #include "mpi.h" +#define SEND_SINGLE_CELLS // to comply with memFn sig. + /*! Game of life cell with 8 * 13 bytes of data. */ diff --git a/tests/game_of_life/game_of_life_test.cpp b/tests/game_of_life/game_of_life_test.cpp index dc0b449..448abbe 100644 --- a/tests/game_of_life/game_of_life_test.cpp +++ b/tests/game_of_life/game_of_life_test.cpp @@ -291,7 +291,7 @@ int main(int argc, char* argv[]) if (verbose && rank == 0) { cout << "Using Zoltan version " << zoltan_version << endl; } - +{ // initialize grid Dccrg grid; @@ -417,7 +417,7 @@ int main(int argc, char* argv[]) if (rank == 0 and save_results) { visit_file.close(); } - +} // ensure destructor called before MPI_Finalize MPI_Finalize(); return EXIT_SUCCESS; diff --git a/tests/game_of_life/game_of_life_test_array.cpp b/tests/game_of_life/game_of_life_test_array.cpp index e2dddc2..74afaa2 100644 --- a/tests/game_of_life/game_of_life_test_array.cpp +++ b/tests/game_of_life/game_of_life_test_array.cpp @@ -40,7 +40,7 @@ using namespace boost; using namespace dccrg; // [0] == alive?, [1] == nr live neighbors -using Cell = std::array; +using Cell = dccrg::detail::array_wrapper; /*! Returns EXIT_SUCCESS if the state of the given game at given timestep is correct on this process, returns EXIT_FAILURE otherwise. diff --git a/tests/game_of_life/hierarchical_test.cpp b/tests/game_of_life/hierarchical_test.cpp index bc9baef..9a43066 100644 --- a/tests/game_of_life/hierarchical_test.cpp +++ b/tests/game_of_life/hierarchical_test.cpp @@ -34,7 +34,7 @@ along with this program. If not, see . struct game_of_life_cell { unsigned int is_alive, live_neighbor_count; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->is_alive), 1, MPI_UNSIGNED); } diff --git a/tests/game_of_life/pinned_cells.cpp b/tests/game_of_life/pinned_cells.cpp index f80e081..45cfdbb 100644 --- a/tests/game_of_life/pinned_cells.cpp +++ b/tests/game_of_life/pinned_cells.cpp @@ -47,7 +47,7 @@ struct game_of_life_cell { std::array child_of_processed; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->is_alive), 4, MPI_UINT64_T); } diff --git a/tests/game_of_life/project_makefile b/tests/game_of_life/project_makefile index e534c62..d0e0e6e 100644 --- a/tests/game_of_life/project_makefile +++ b/tests/game_of_life/project_makefile @@ -18,8 +18,6 @@ TESTS_GAME_OF_LIFE_TESTS = \ tests/game_of_life/game_of_life_test.tstN \ tests/game_of_life/game_of_life_test_optimized.tst1 \ tests/game_of_life/game_of_life_test_optimized.tstN \ - tests/game_of_life/game_of_life_test_array.tst1 \ - tests/game_of_life/game_of_life_test_array.tstN \ tests/game_of_life/refined2d.tst1 \ tests/game_of_life/refined2d.tstN \ tests/game_of_life/refined.tst1 \ @@ -32,6 +30,8 @@ TESTS_GAME_OF_LIFE_TESTS = \ tests/game_of_life/unrefined2d_optimized.tstN \ tests/game_of_life/pinned_cells.tst1 \ tests/game_of_life/pinned_cells.tstN + #tests/game_of_life/game_of_life_test_array.tst1 \ + #tests/game_of_life/game_of_life_test_array.tstN \ tests/game_of_life/executables: $(TESTS_GAME_OF_LIFE_EXECUTABLES) @@ -75,6 +75,7 @@ TESTS_GAME_OF_LIFE_COMPILE_COMMAND = \ $(BOOST_CPPFLAGS) \ $(BOOST_LDFLAGS) \ $(BOOST_LIBS) \ + -Wno-deprecated-declarations \ -I tests/game_of_life @@ -85,11 +86,11 @@ tests/game_of_life/game_of_life_test.exe: \ tests/game_of_life/game_of_life_test.tst1: \ tests/game_of_life/game_of_life_test.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test.tstN: \ tests/game_of_life/game_of_life_test.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test_array.exe: \ @@ -99,11 +100,11 @@ tests/game_of_life/game_of_life_test_array.exe: \ tests/game_of_life/game_of_life_test_array.tst1: \ tests/game_of_life/game_of_life_test_array.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test_array.tstN: \ tests/game_of_life/game_of_life_test_array.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test_optimized.exe: \ @@ -114,11 +115,11 @@ tests/game_of_life/game_of_life_test_optimized.exe: \ tests/game_of_life/game_of_life_test_optimized.tst1: \ tests/game_of_life/game_of_life_test_optimized.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test_optimized.tstN: \ tests/game_of_life/game_of_life_test_optimized.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/pinned_cells.exe: \ @@ -128,11 +129,11 @@ tests/game_of_life/pinned_cells.exe: \ tests/game_of_life/pinned_cells.tst1: \ tests/game_of_life/pinned_cells.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/pinned_cells.tstN: \ tests/game_of_life/pinned_cells.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/scalability1d.exe: \ @@ -159,11 +160,11 @@ tests/game_of_life/refined2d.exe: \ tests/game_of_life/refined2d.tst1: \ tests/game_of_life/refined2d.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/refined2d.tstN: \ tests/game_of_life/refined2d.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/refined.exe: \ @@ -174,11 +175,11 @@ tests/game_of_life/refined.exe: \ tests/game_of_life/refined.tst1: \ tests/game_of_life/refined.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/refined.tstN: \ tests/game_of_life/refined.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/refined_scalability3d.exe: \ @@ -195,11 +196,11 @@ tests/game_of_life/hierarchical_test.exe: \ tests/game_of_life/hierarchical_test.tst1: \ tests/game_of_life/hierarchical_test.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/hierarchical_test.tstN: \ tests/game_of_life/hierarchical_test.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/unrefined2d.exe: \ @@ -210,11 +211,11 @@ tests/game_of_life/unrefined2d.exe: \ tests/game_of_life/unrefined2d.tst1: \ tests/game_of_life/unrefined2d.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/unrefined2d.tstN: \ tests/game_of_life/unrefined2d.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/unrefined2d_optimized.exe: \ @@ -226,9 +227,9 @@ tests/game_of_life/unrefined2d_optimized.exe: \ tests/game_of_life/unrefined2d_optimized.tst1: \ tests/game_of_life/unrefined2d_optimized.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/game_of_life/unrefined2d_optimized.tstN: \ tests/game_of_life/unrefined2d_optimized.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/game_of_life/refined.cpp b/tests/game_of_life/refined.cpp index 3a15240..c607860 100644 --- a/tests/game_of_life/refined.cpp +++ b/tests/game_of_life/refined.cpp @@ -34,7 +34,7 @@ along with this program. If not, see . struct game_of_life_cell { unsigned int is_alive, live_neighbor_count; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->is_alive), 1, MPI_UNSIGNED); } diff --git a/tests/game_of_life/refined2d.cpp b/tests/game_of_life/refined2d.cpp index 2dea524..5f98488 100644 --- a/tests/game_of_life/refined2d.cpp +++ b/tests/game_of_life/refined2d.cpp @@ -48,7 +48,7 @@ struct game_of_life_cell { std::array child_of_processed; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->is_alive), 4, MPI_UINT64_T); } diff --git a/tests/game_of_life/refined_scalability3d.cpp b/tests/game_of_life/refined_scalability3d.cpp index 18bad96..09d93c0 100644 --- a/tests/game_of_life/refined_scalability3d.cpp +++ b/tests/game_of_life/refined_scalability3d.cpp @@ -38,7 +38,7 @@ along with this program. If not, see . struct game_of_life_cell { unsigned int is_alive, live_neighbor_count; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->is_alive), 1, MPI_UNSIGNED); } diff --git a/tests/game_of_life/scalability.cpp b/tests/game_of_life/scalability.cpp index 34ea484..4bc75c7 100644 --- a/tests/game_of_life/scalability.cpp +++ b/tests/game_of_life/scalability.cpp @@ -39,7 +39,7 @@ struct game_of_life_cell { // data[0] == 1 if cell is alive, data[1] holds the number of live neighbors unsigned int data[2]; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->data), 1, MPI_INT); } diff --git a/tests/game_of_life/scalability1d.cpp b/tests/game_of_life/scalability1d.cpp index 2a5bed8..2fce82d 100644 --- a/tests/game_of_life/scalability1d.cpp +++ b/tests/game_of_life/scalability1d.cpp @@ -36,7 +36,7 @@ along with this program. If not, see . struct game_of_life_cell { unsigned int is_alive, live_neighbor_count; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->is_alive), 1, MPI_UNSIGNED); } diff --git a/tests/game_of_life/scalability3d.cpp b/tests/game_of_life/scalability3d.cpp index 383e135..fb6dcb4 100644 --- a/tests/game_of_life/scalability3d.cpp +++ b/tests/game_of_life/scalability3d.cpp @@ -36,7 +36,7 @@ along with this program. If not, see . struct game_of_life_cell { unsigned int is_alive, live_neighbor_count; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->is_alive), 1, MPI_UNSIGNED); } diff --git a/tests/game_of_life/unrefined2d.cpp b/tests/game_of_life/unrefined2d.cpp index bbc1f45..9fa5aab 100644 --- a/tests/game_of_life/unrefined2d.cpp +++ b/tests/game_of_life/unrefined2d.cpp @@ -100,7 +100,7 @@ int main(int argc, char* argv[]) cerr << "Zoltan_Initialize failed" << endl; exit(EXIT_FAILURE); } - +{ // initialize grids, reference grid doesn't refine/unrefine Dccrg grid, reference_grid; @@ -249,7 +249,7 @@ int main(int argc, char* argv[]) cout << endl; } } - +} MPI_Finalize(); return EXIT_SUCCESS; From fab686b8baeaa1ac7b542abb12c356f028c812cb Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 04:58:14 +0300 Subject: [PATCH 08/16] Small fixes on test cases - Conform with fnSig - Wrap primitive types - Fix unneccessary parens - Add test name after PASS --- tests/additional_cell_data/project_makefile | 12 ++++++------ tests/geometry/project_makefile | 4 ++-- tests/get_cells/project_makefile | 2 +- tests/get_cells/test1.cpp | 2 +- tests/init/init.cpp | 2 +- tests/iterators/project_makefile | 16 ++++++++-------- tests/iterators/test1.cpp | 2 +- tests/iterators/test2.cpp | 2 +- tests/iterators/test3.cpp | 2 +- tests/iterators/test4.cpp | 2 +- tests/load_balancing/load_balancing_test.cpp | 2 +- .../multi_stage_load_balancing.cpp | 2 +- tests/load_balancing/project_makefile | 8 ++++---- tests/mpi_support/project_makefile | 8 ++++---- tests/refine/dont_refine.cpp | 16 +++++++++------- tests/refine/project_makefile | 12 ++++++------ tests/refine/refine_simple.cpp | 2 +- tests/refine/scalability.cpp | 2 +- tests/refine/unrefine_simple.cpp | 8 ++++---- tests/restart/cell.hpp | 2 +- tests/restart/project_makefile | 2 ++ tests/restart/variable_cell_data.cpp | 6 +++--- 22 files changed, 60 insertions(+), 56 deletions(-) diff --git a/tests/additional_cell_data/project_makefile b/tests/additional_cell_data/project_makefile index 2a47693..cd687e3 100644 --- a/tests/additional_cell_data/project_makefile +++ b/tests/additional_cell_data/project_makefile @@ -49,7 +49,7 @@ tests/additional_cell_data/test1.exe: \ tests/additional_cell_data/test1.tst: \ tests/additional_cell_data/test1.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/test2.exe: \ @@ -59,11 +59,11 @@ tests/additional_cell_data/test2.exe: \ tests/additional_cell_data/test2.tst: \ tests/additional_cell_data/test2.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/test2.mtst: \ tests/additional_cell_data/test2.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/neighbor_data1.exe: \ @@ -73,7 +73,7 @@ tests/additional_cell_data/neighbor_data1.exe: \ tests/additional_cell_data/neighbor_data1.tst: \ tests/additional_cell_data/neighbor_data1.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/neighbor_data2.exe: \ @@ -83,8 +83,8 @@ tests/additional_cell_data/neighbor_data2.exe: \ tests/additional_cell_data/neighbor_data2.tst: \ tests/additional_cell_data/neighbor_data2.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/neighbor_data2.mtst: \ tests/additional_cell_data/neighbor_data2.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/geometry/project_makefile b/tests/geometry/project_makefile index 571eeb8..1bd7d42 100644 --- a/tests/geometry/project_makefile +++ b/tests/geometry/project_makefile @@ -43,7 +43,7 @@ tests/geometry/cartesian_grid_speed.exe: \ tests/geometry/cartesian_grid_speed.tst: \ tests/geometry/cartesian_grid_speed.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/geometry/stretched_cartesian_grid_speed.exe: \ @@ -53,5 +53,5 @@ tests/geometry/stretched_cartesian_grid_speed.exe: \ tests/geometry/stretched_cartesian_grid_speed.tst: \ tests/geometry/stretched_cartesian_grid_speed.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/get_cells/project_makefile b/tests/get_cells/project_makefile index b43f58c..6b00156 100644 --- a/tests/get_cells/project_makefile +++ b/tests/get_cells/project_makefile @@ -44,5 +44,5 @@ tests/get_cells/test1.exe: \ tests/get_cells/test1.tstN: \ tests/get_cells/test1.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/get_cells/test1.cpp b/tests/get_cells/test1.cpp index 2692429..8724b4f 100644 --- a/tests/get_cells/test1.cpp +++ b/tests/get_cells/test1.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } diff --git a/tests/init/init.cpp b/tests/init/init.cpp index 0c4975e..976e100 100644 --- a/tests/init/init.cpp +++ b/tests/init/init.cpp @@ -17,7 +17,7 @@ struct CellData { double variables[3]; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(&(this->variables), 3, MPI_DOUBLE); } diff --git a/tests/iterators/project_makefile b/tests/iterators/project_makefile index 2de5e74..81c66c0 100644 --- a/tests/iterators/project_makefile +++ b/tests/iterators/project_makefile @@ -52,11 +52,11 @@ tests/iterators/test1.exe: \ tests/iterators/test1.tst: \ tests/iterators/test1.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/iterators/test1.mtst: \ tests/iterators/test1.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/iterators/test2.exe: \ tests/iterators/test2.cpp \ @@ -65,11 +65,11 @@ tests/iterators/test2.exe: \ tests/iterators/test2.tst: \ tests/iterators/test2.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/iterators/test2.mtst: \ tests/iterators/test2.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/iterators/test3.exe: \ tests/iterators/test3.cpp \ @@ -78,11 +78,11 @@ tests/iterators/test3.exe: \ tests/iterators/test3.tst: \ tests/iterators/test3.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/iterators/test3.mtst: \ tests/iterators/test3.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/iterators/test4.exe: \ tests/iterators/test4.cpp \ @@ -91,8 +91,8 @@ tests/iterators/test4.exe: \ tests/iterators/test4.tst: \ tests/iterators/test4.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/iterators/test4.mtst: \ tests/iterators/test4.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/iterators/test1.cpp b/tests/iterators/test1.cpp index 4cf802c..93e8b19 100644 --- a/tests/iterators/test1.cpp +++ b/tests/iterators/test1.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } diff --git a/tests/iterators/test2.cpp b/tests/iterators/test2.cpp index 7d932a0..95212b8 100644 --- a/tests/iterators/test2.cpp +++ b/tests/iterators/test2.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } diff --git a/tests/iterators/test3.cpp b/tests/iterators/test3.cpp index 186a351..6239ade 100644 --- a/tests/iterators/test3.cpp +++ b/tests/iterators/test3.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } diff --git a/tests/iterators/test4.cpp b/tests/iterators/test4.cpp index 4f8f9fd..1db7964 100644 --- a/tests/iterators/test4.cpp +++ b/tests/iterators/test4.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } diff --git a/tests/load_balancing/load_balancing_test.cpp b/tests/load_balancing/load_balancing_test.cpp index e156dc5..4e1798c 100644 --- a/tests/load_balancing/load_balancing_test.cpp +++ b/tests/load_balancing/load_balancing_test.cpp @@ -22,7 +22,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) this, 0, MPI_BYTE); } diff --git a/tests/load_balancing/multi_stage_load_balancing.cpp b/tests/load_balancing/multi_stage_load_balancing.cpp index b606986..0850c4c 100644 --- a/tests/load_balancing/multi_stage_load_balancing.cpp +++ b/tests/load_balancing/multi_stage_load_balancing.cpp @@ -38,7 +38,7 @@ class Cell void*, int, MPI_Datatype - > get_mpi_datatype() const + > get_mpi_datatype(UNUSED_GMD_ARGS) const { return std::make_tuple((void*) &(this->data[Cell::stage]), 1, MPI_INT); } diff --git a/tests/load_balancing/project_makefile b/tests/load_balancing/project_makefile index cd39134..a46f42b 100644 --- a/tests/load_balancing/project_makefile +++ b/tests/load_balancing/project_makefile @@ -46,11 +46,11 @@ tests/load_balancing/load_balancing_test.exe: \ tests/load_balancing/load_balancing_test.tst: \ tests/load_balancing/load_balancing_test.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/load_balancing/load_balancing_test.mtst: \ tests/load_balancing/load_balancing_test.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/load_balancing/multi_stage_load_balancing.exe: \ tests/load_balancing/multi_stage_load_balancing.cpp \ @@ -59,8 +59,8 @@ tests/load_balancing/multi_stage_load_balancing.exe: \ tests/load_balancing/multi_stage_load_balancing.tst: \ tests/load_balancing/multi_stage_load_balancing.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/load_balancing/multi_stage_load_balancing.mtst: \ tests/load_balancing/multi_stage_load_balancing.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/mpi_support/project_makefile b/tests/mpi_support/project_makefile index ad1b988..ba97726 100644 --- a/tests/mpi_support/project_makefile +++ b/tests/mpi_support/project_makefile @@ -42,11 +42,11 @@ tests/mpi_support/all_gather.exe: \ tests/mpi_support/all_gather.tst1: \ tests/mpi_support/all_gather.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/mpi_support/all_gather.tstN: \ tests/mpi_support/all_gather.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/mpi_support/some_reduce.exe: \ @@ -56,9 +56,9 @@ tests/mpi_support/some_reduce.exe: \ tests/mpi_support/some_reduce.tst1: \ tests/mpi_support/some_reduce.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/mpi_support/some_reduce.tstN: \ tests/mpi_support/some_reduce.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/refine/dont_refine.cpp b/tests/refine/dont_refine.cpp index a658406..7d26290 100644 --- a/tests/refine/dont_refine.cpp +++ b/tests/refine/dont_refine.cpp @@ -22,6 +22,8 @@ Copyright 2010, 2011, 2012, 2013, 2014, using namespace std; using namespace dccrg; +typedef dccrg::detail::dccrg_INT dccrg_INT; + int main(int argc, char* argv[]) { if (MPI_Init(&argc, &argv) != MPI_SUCCESS) { @@ -43,7 +45,7 @@ int main(int argc, char* argv[]) { - Dccrg grid; grid + Dccrg grid; grid .set_initial_length({3, 1, 1}) .set_neighborhood_length(1) .set_maximum_refinement_level(-1) @@ -55,7 +57,7 @@ int main(int argc, char* argv[]) grid.stop_refining(); uint64_t failed = 0; - for (const auto& cell: grid.local_cells()) { + for (const auto& cell: grid.local_cells) { if (cell.id == 4) { cerr << "Cell 1 was refined directly." << std::endl; failed = 1; @@ -69,7 +71,7 @@ int main(int argc, char* argv[]) { - Dccrg grid; grid + Dccrg grid; grid .set_initial_length({3, 1, 1}) .set_neighborhood_length(1) .set_maximum_refinement_level(-1) @@ -87,7 +89,7 @@ int main(int argc, char* argv[]) grid.stop_refining(); uint64_t failed = 0; - for (const auto& cell: grid.local_cells()) { + for (const auto& cell: grid.local_cells) { if (cell.id == 4) { cerr << "Cell 1 was refined from face neighbor" << std::endl; failed = 1; @@ -103,7 +105,7 @@ int main(int argc, char* argv[]) grid.stop_refining(); failed = 0; - for (const auto& cell: grid.local_cells()) { + for (const auto& cell: grid.local_cells) { if (cell.id == 4) { cerr << "Cell 1 was refined from further neighbor" << std::endl; failed = 1; @@ -117,7 +119,7 @@ int main(int argc, char* argv[]) { - Dccrg grid; grid + Dccrg grid; grid .set_initial_length({3, 1, 1}) .set_neighborhood_length(1) .set_maximum_refinement_level(-1) @@ -138,7 +140,7 @@ int main(int argc, char* argv[]) grid.stop_refining(); uint64_t failed = 0; - for (const auto& cell: grid.local_cells()) { + for (const auto& cell: grid.local_cells) { if (cell.id == 4) { cerr << "Cell 1 was refined from furthest neighbor" << std::endl; failed = 1; diff --git a/tests/refine/project_makefile b/tests/refine/project_makefile index c9732e9..ad4fa92 100644 --- a/tests/refine/project_makefile +++ b/tests/refine/project_makefile @@ -53,11 +53,11 @@ tests/refine/refine_simple.exe: \ tests/refine/refine_simple.tst: \ tests/refine/refine_simple.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/refine/refine_simple.mtst: \ tests/refine/refine_simple.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/refine/dont_refine.exe: \ @@ -67,11 +67,11 @@ tests/refine/dont_refine.exe: \ tests/refine/dont_refine.tst: \ tests/refine/dont_refine.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/refine/dont_refine.mtst: \ tests/refine/dont_refine.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/refine/unrefine_simple.exe: \ @@ -81,8 +81,8 @@ tests/refine/unrefine_simple.exe: \ tests/refine/unrefine_simple.tst: \ tests/refine/unrefine_simple.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ tests/refine/unrefine_simple.mtst: \ tests/refine/unrefine_simple.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ diff --git a/tests/refine/refine_simple.cpp b/tests/refine/refine_simple.cpp index d27641f..1741741 100644 --- a/tests/refine/refine_simple.cpp +++ b/tests/refine/refine_simple.cpp @@ -20,7 +20,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(this, 0, MPI_BYTE); } diff --git a/tests/refine/scalability.cpp b/tests/refine/scalability.cpp index 5f5d9db..e867ac0 100644 --- a/tests/refine/scalability.cpp +++ b/tests/refine/scalability.cpp @@ -20,7 +20,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(this, 0, MPI_BYTE); } diff --git a/tests/refine/unrefine_simple.cpp b/tests/refine/unrefine_simple.cpp index a4ce14c..5b7cb23 100644 --- a/tests/refine/unrefine_simple.cpp +++ b/tests/refine/unrefine_simple.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace dccrg; struct Cell { - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple(this, 0, MPI_BYTE); } @@ -44,7 +44,7 @@ int main(int argc, char* argv[]) cout << "Zoltan_Initialize failed" << endl; exit(EXIT_FAILURE); } - +{ Dccrg grid; #define GRID_SIZE 2 @@ -145,13 +145,13 @@ int main(int argc, char* argv[]) grid.unrefine_completely_at(adapt_coord); } - auto new_cells = grid.stop_refining(); + //auto new_cells = grid.stop_refining(); } if (rank == 0) { visit_file.close(); } - +} MPI_Finalize(); return EXIT_SUCCESS; diff --git a/tests/restart/cell.hpp b/tests/restart/cell.hpp index dab243d..9b8cd38 100644 --- a/tests/restart/cell.hpp +++ b/tests/restart/cell.hpp @@ -44,7 +44,7 @@ class Cell // == true when saving and restarting static bool transfer_only_life; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { if (Cell::transfer_only_life) { return std::make_tuple((void*) &(this->data), 1, MPI_UINT64_T); diff --git a/tests/restart/project_makefile b/tests/restart/project_makefile index 69a556a..a5b081f 100644 --- a/tests/restart/project_makefile +++ b/tests/restart/project_makefile @@ -43,6 +43,8 @@ TESTS_RESTART_COMPILE_COMMAND = \ $(BOOST_LIBS) \ $(ZOLTAN_CPPFLAGS) \ $(ZOLTAN_LDFLAGS) \ + -Wno-deprecated-declarations \ + -Wno-deprecated-declarations \ $(ZOLTAN_LIBS) diff --git a/tests/restart/variable_cell_data.cpp b/tests/restart/variable_cell_data.cpp index da1d692..5b585b6 100644 --- a/tests/restart/variable_cell_data.cpp +++ b/tests/restart/variable_cell_data.cpp @@ -49,7 +49,7 @@ struct Cell void*, int, MPI_Datatype - > get_mpi_datatype() const + > get_mpi_datatype(UNUSED_GMD_ARGS) const { if (Cell::transfer_all) { std::array counts = {{1, int(this->data.size())}}; @@ -161,7 +161,7 @@ int main(int argc, char* argv[]) abort(); } - +{ dccrg::Dccrg grid; @@ -322,7 +322,7 @@ int main(int argc, char* argv[]) grid.finish_loading_grid_data(); } - +} MPI_Finalize(); return EXIT_SUCCESS; From 831dad93ccf27d39ee98653e9b4c884483927ec7 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 05:13:36 +0300 Subject: [PATCH 09/16] Small fixes on examples - Conform with fnSig - Wrap primitive types --- examples/basic_cell_data.cpp | 4 +++- examples/game_of_life.cpp | 2 +- examples/game_of_life_with_output.cpp | 2 +- examples/simple_game_of_life.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/basic_cell_data.cpp b/examples/basic_cell_data.cpp index b628e7b..25eb8ab 100644 --- a/examples/basic_cell_data.cpp +++ b/examples/basic_cell_data.cpp @@ -11,6 +11,8 @@ Example that uses basic types as cell data. using namespace std; +typedef dccrg::detail::dccrg_INT dccrg_INT; + int main(int argc, char* argv[]) { if (MPI_Init(&argc, &argv) != MPI_SUCCESS) { @@ -24,7 +26,7 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } - dccrg::Dccrg grid; + dccrg::Dccrg grid; grid .set_initial_length({7, 13, 11}) .set_maximum_refinement_level(1) diff --git a/examples/game_of_life.cpp b/examples/game_of_life.cpp index 21b2530..7198804 100644 --- a/examples/game_of_life.cpp +++ b/examples/game_of_life.cpp @@ -22,7 +22,7 @@ using namespace std; struct game_of_life_cell { unsigned int is_alive = 0, live_neighbor_count = 0; - std::tuple get_mpi_datatype() + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) &(this->is_alive), 1, MPI_UNSIGNED); } diff --git a/examples/game_of_life_with_output.cpp b/examples/game_of_life_with_output.cpp index 9b4b0a6..a89f997 100644 --- a/examples/game_of_life_with_output.cpp +++ b/examples/game_of_life_with_output.cpp @@ -25,7 +25,7 @@ struct game_of_life_cell { is_alive = 0, live_neighbor_count = 0; - std::tuple get_mpi_datatype() { + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) &(this->is_alive), 1, MPI_UNSIGNED); } }; diff --git a/examples/simple_game_of_life.cpp b/examples/simple_game_of_life.cpp index 4d8d363..e165702 100644 --- a/examples/simple_game_of_life.cpp +++ b/examples/simple_game_of_life.cpp @@ -26,7 +26,7 @@ struct game_of_life_cell { Whenever cell data is transferred between MPI processes dccrg passes on this data to MPI for sending/receiving the data. */ - std::tuple get_mpi_datatype() { + std::tuple get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*) &(this->is_alive), 1, MPI_UNSIGNED); } }; From 659d0ecb0e3a899fda2a633ae90632927f2aa1bf Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Mon, 8 Jun 2026 05:20:51 +0300 Subject: [PATCH 10/16] Include missing header --- dccrg_mpi_support.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dccrg_mpi_support.hpp b/dccrg_mpi_support.hpp index 28ae5a2..d5cfd64 100644 --- a/dccrg_mpi_support.hpp +++ b/dccrg_mpi_support.hpp @@ -22,6 +22,7 @@ along with dccrg. If not, see . #include "algorithm" #include "climits" +#include // for std::numeric_limits #include "cstdint" #include "cstdlib" #include "iostream" From ffa6abc5e793af8b304449576d25bd2ecb063993 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Tue, 30 Jun 2026 15:46:53 +0300 Subject: [PATCH 11/16] Ignore artifacts --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6c3924 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.exe +*tst +*.out From 2567bded6e237a9eed8334d342a5aea769eaf58f Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Tue, 30 Jun 2026 15:55:37 +0300 Subject: [PATCH 12/16] Correctly impl. erase_if for unordered_set; fix warnings --- dccrg.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dccrg.hpp b/dccrg.hpp index 2280e2d..cdebcd7 100644 --- a/dccrg.hpp +++ b/dccrg.hpp @@ -89,9 +89,10 @@ namespace dccrg #if __cplusplus >= 202002L std::erase_if(v, pred); #else - for(const auto& k:v) - if(pred(k)) - v.erase(k); + auto it = v.begin(), end = v.end(); + while(it != end) + if(pred(*it)) it = v.erase(it); + else ++it; #endif return; } @@ -4899,10 +4900,8 @@ template < continue; } - const int neighbor_ref_lvl = this->mapping.get_refinement_level(neighCell); -#ifdef DCCRG_SURPRESS_UNUSED_VAR - (void)neighbor_ref_lvl; //Suppress unused var -#endif + //Suppress unused var + /*const int neighbor_ref_lvl = */this->mapping.get_refinement_level(neighCell); return_neighbors.push_back({neighCell, {offsets[0], offsets[1], offsets[2]} }); } From b51250ee564d22c90e99f47246045e947449b631 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Tue, 30 Jun 2026 16:05:54 +0300 Subject: [PATCH 13/16] Use CC (for C++) instead of cc (for C) Basically my silly typo --- makefiles/hile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/hile b/makefiles/hile index d1a0f39..8dc31bb 100644 --- a/makefiles/hile +++ b/makefiles/hile @@ -2,7 +2,7 @@ # into your home directory according to the instructions at # https://github.com/fmihpc/dccrg/wiki/Install CXX = g++ -MPICXX = cc +MPICXX = CC RUN = MPIRUN = #mpiexec -n 3 From ce267ab0e6c035e1b191f7b55141cec261f3e48f Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Wed, 1 Jul 2026 12:32:11 +0300 Subject: [PATCH 14/16] Output the test result to target file --- tests/additional_cell_data/project_makefile | 12 +++---- tests/advection/project_makefile | 6 ++-- tests/constructors/project_makefile | 2 +- tests/game_of_life/project_makefile | 36 ++++++++++----------- tests/geometry/project_makefile | 4 +-- tests/get_cell_datatype/project_makefile | 2 +- tests/get_cells/project_makefile | 2 +- tests/iterators/project_makefile | 18 +++++------ tests/load_balancing/project_makefile | 8 ++--- tests/mpi_support/project_makefile | 8 ++--- tests/refine/project_makefile | 12 +++---- 11 files changed, 55 insertions(+), 55 deletions(-) diff --git a/tests/additional_cell_data/project_makefile b/tests/additional_cell_data/project_makefile index cd687e3..0836a18 100644 --- a/tests/additional_cell_data/project_makefile +++ b/tests/additional_cell_data/project_makefile @@ -49,7 +49,7 @@ tests/additional_cell_data/test1.exe: \ tests/additional_cell_data/test1.tst: \ tests/additional_cell_data/test1.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/test2.exe: \ @@ -59,11 +59,11 @@ tests/additional_cell_data/test2.exe: \ tests/additional_cell_data/test2.tst: \ tests/additional_cell_data/test2.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/test2.mtst: \ tests/additional_cell_data/test2.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/neighbor_data1.exe: \ @@ -73,7 +73,7 @@ tests/additional_cell_data/neighbor_data1.exe: \ tests/additional_cell_data/neighbor_data1.tst: \ tests/additional_cell_data/neighbor_data1.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/neighbor_data2.exe: \ @@ -83,8 +83,8 @@ tests/additional_cell_data/neighbor_data2.exe: \ tests/additional_cell_data/neighbor_data2.tst: \ tests/additional_cell_data/neighbor_data2.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/additional_cell_data/neighbor_data2.mtst: \ tests/additional_cell_data/neighbor_data2.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/advection/project_makefile b/tests/advection/project_makefile index 386e33f..eb4beb7 100644 --- a/tests/advection/project_makefile +++ b/tests/advection/project_makefile @@ -59,11 +59,11 @@ tests/advection/2d_mpi.exe: \ tests/advection/2d_mpi.tst: \ tests/advection/2d_mpi.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/advection/2d_mpi.mtst: \ tests/advection/2d_mpi.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS\n" && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/advection/2d_mpi_debug.exe: \ @@ -73,7 +73,7 @@ tests/advection/2d_mpi_debug.exe: \ tests/advection/2d_mpi_debug.tst: \ tests/advection/2d_mpi_debug.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/advection/dc2vtk.exe: \ diff --git a/tests/constructors/project_makefile b/tests/constructors/project_makefile index 3bd1084..5654b0a 100644 --- a/tests/constructors/project_makefile +++ b/tests/constructors/project_makefile @@ -50,5 +50,5 @@ tests/constructors/copy.exe: \ tests/constructors/copy.tst: \ tests/constructors/copy.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/game_of_life/project_makefile b/tests/game_of_life/project_makefile index d0e0e6e..c7f8d72 100644 --- a/tests/game_of_life/project_makefile +++ b/tests/game_of_life/project_makefile @@ -86,11 +86,11 @@ tests/game_of_life/game_of_life_test.exe: \ tests/game_of_life/game_of_life_test.tst1: \ tests/game_of_life/game_of_life_test.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test.tstN: \ tests/game_of_life/game_of_life_test.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test_array.exe: \ @@ -100,11 +100,11 @@ tests/game_of_life/game_of_life_test_array.exe: \ tests/game_of_life/game_of_life_test_array.tst1: \ tests/game_of_life/game_of_life_test_array.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test_array.tstN: \ tests/game_of_life/game_of_life_test_array.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test_optimized.exe: \ @@ -115,11 +115,11 @@ tests/game_of_life/game_of_life_test_optimized.exe: \ tests/game_of_life/game_of_life_test_optimized.tst1: \ tests/game_of_life/game_of_life_test_optimized.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/game_of_life_test_optimized.tstN: \ tests/game_of_life/game_of_life_test_optimized.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/pinned_cells.exe: \ @@ -129,11 +129,11 @@ tests/game_of_life/pinned_cells.exe: \ tests/game_of_life/pinned_cells.tst1: \ tests/game_of_life/pinned_cells.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/pinned_cells.tstN: \ tests/game_of_life/pinned_cells.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/scalability1d.exe: \ @@ -160,11 +160,11 @@ tests/game_of_life/refined2d.exe: \ tests/game_of_life/refined2d.tst1: \ tests/game_of_life/refined2d.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/refined2d.tstN: \ tests/game_of_life/refined2d.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/refined.exe: \ @@ -175,11 +175,11 @@ tests/game_of_life/refined.exe: \ tests/game_of_life/refined.tst1: \ tests/game_of_life/refined.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/refined.tstN: \ tests/game_of_life/refined.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/refined_scalability3d.exe: \ @@ -196,11 +196,11 @@ tests/game_of_life/hierarchical_test.exe: \ tests/game_of_life/hierarchical_test.tst1: \ tests/game_of_life/hierarchical_test.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/hierarchical_test.tstN: \ tests/game_of_life/hierarchical_test.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/unrefined2d.exe: \ @@ -211,11 +211,11 @@ tests/game_of_life/unrefined2d.exe: \ tests/game_of_life/unrefined2d.tst1: \ tests/game_of_life/unrefined2d.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/unrefined2d.tstN: \ tests/game_of_life/unrefined2d.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/unrefined2d_optimized.exe: \ @@ -227,9 +227,9 @@ tests/game_of_life/unrefined2d_optimized.exe: \ tests/game_of_life/unrefined2d_optimized.tst1: \ tests/game_of_life/unrefined2d_optimized.exe - @printf RUN\ $@...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $@...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/game_of_life/unrefined2d_optimized.tstN: \ tests/game_of_life/unrefined2d_optimized.exe - @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $@...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/geometry/project_makefile b/tests/geometry/project_makefile index 1bd7d42..4b9499b 100644 --- a/tests/geometry/project_makefile +++ b/tests/geometry/project_makefile @@ -43,7 +43,7 @@ tests/geometry/cartesian_grid_speed.exe: \ tests/geometry/cartesian_grid_speed.tst: \ tests/geometry/cartesian_grid_speed.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/geometry/stretched_cartesian_grid_speed.exe: \ @@ -53,5 +53,5 @@ tests/geometry/stretched_cartesian_grid_speed.exe: \ tests/geometry/stretched_cartesian_grid_speed.tst: \ tests/geometry/stretched_cartesian_grid_speed.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/get_cell_datatype/project_makefile b/tests/get_cell_datatype/project_makefile index b561715..eb81299 100644 --- a/tests/get_cell_datatype/project_makefile +++ b/tests/get_cell_datatype/project_makefile @@ -50,4 +50,4 @@ tests/get_cell_datatype/run_time.exe: \ tests/get_cell_datatype/run_time.tst: \ tests/get_cell_datatype/run_time.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS\n" && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/get_cells/project_makefile b/tests/get_cells/project_makefile index 6b00156..25edf4a 100644 --- a/tests/get_cells/project_makefile +++ b/tests/get_cells/project_makefile @@ -44,5 +44,5 @@ tests/get_cells/test1.exe: \ tests/get_cells/test1.tstN: \ tests/get_cells/test1.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/iterators/project_makefile b/tests/iterators/project_makefile index 81c66c0..dd29f19 100644 --- a/tests/iterators/project_makefile +++ b/tests/iterators/project_makefile @@ -43,7 +43,7 @@ TESTS_ITERATORS_COMPILE_COMMAND = \ $(BOOST_LIBS) \ $(ZOLTAN_CPPFLAGS) \ $(ZOLTAN_LDFLAGS) \ - $(ZOLTAN_LIBS) + $(ZOLTAN_LIBS) -ggdb tests/iterators/test1.exe: \ tests/iterators/test1.cpp \ @@ -52,11 +52,11 @@ tests/iterators/test1.exe: \ tests/iterators/test1.tst: \ tests/iterators/test1.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/iterators/test1.mtst: \ tests/iterators/test1.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/iterators/test2.exe: \ tests/iterators/test2.cpp \ @@ -65,11 +65,11 @@ tests/iterators/test2.exe: \ tests/iterators/test2.tst: \ tests/iterators/test2.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/iterators/test2.mtst: \ tests/iterators/test2.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/iterators/test3.exe: \ tests/iterators/test3.cpp \ @@ -78,11 +78,11 @@ tests/iterators/test3.exe: \ tests/iterators/test3.tst: \ tests/iterators/test3.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/iterators/test3.mtst: \ tests/iterators/test3.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/iterators/test4.exe: \ tests/iterators/test4.cpp \ @@ -91,8 +91,8 @@ tests/iterators/test4.exe: \ tests/iterators/test4.tst: \ tests/iterators/test4.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/iterators/test4.mtst: \ tests/iterators/test4.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/load_balancing/project_makefile b/tests/load_balancing/project_makefile index a46f42b..736f193 100644 --- a/tests/load_balancing/project_makefile +++ b/tests/load_balancing/project_makefile @@ -46,11 +46,11 @@ tests/load_balancing/load_balancing_test.exe: \ tests/load_balancing/load_balancing_test.tst: \ tests/load_balancing/load_balancing_test.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/load_balancing/load_balancing_test.mtst: \ tests/load_balancing/load_balancing_test.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/load_balancing/multi_stage_load_balancing.exe: \ tests/load_balancing/multi_stage_load_balancing.cpp \ @@ -59,8 +59,8 @@ tests/load_balancing/multi_stage_load_balancing.exe: \ tests/load_balancing/multi_stage_load_balancing.tst: \ tests/load_balancing/multi_stage_load_balancing.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/load_balancing/multi_stage_load_balancing.mtst: \ tests/load_balancing/multi_stage_load_balancing.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/mpi_support/project_makefile b/tests/mpi_support/project_makefile index ba97726..65f1f6f 100644 --- a/tests/mpi_support/project_makefile +++ b/tests/mpi_support/project_makefile @@ -42,11 +42,11 @@ tests/mpi_support/all_gather.exe: \ tests/mpi_support/all_gather.tst1: \ tests/mpi_support/all_gather.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/mpi_support/all_gather.tstN: \ tests/mpi_support/all_gather.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/mpi_support/some_reduce.exe: \ @@ -56,9 +56,9 @@ tests/mpi_support/some_reduce.exe: \ tests/mpi_support/some_reduce.tst1: \ tests/mpi_support/some_reduce.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/mpi_support/some_reduce.tstN: \ tests/mpi_support/some_reduce.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ diff --git a/tests/refine/project_makefile b/tests/refine/project_makefile index ad4fa92..a70c433 100644 --- a/tests/refine/project_makefile +++ b/tests/refine/project_makefile @@ -53,11 +53,11 @@ tests/refine/refine_simple.exe: \ tests/refine/refine_simple.tst: \ tests/refine/refine_simple.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/refine/refine_simple.mtst: \ tests/refine/refine_simple.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/refine/dont_refine.exe: \ @@ -67,11 +67,11 @@ tests/refine/dont_refine.exe: \ tests/refine/dont_refine.tst: \ tests/refine/dont_refine.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/refine/dont_refine.mtst: \ tests/refine/dont_refine.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/refine/unrefine_simple.exe: \ @@ -81,8 +81,8 @@ tests/refine/unrefine_simple.exe: \ tests/refine/unrefine_simple.tst: \ tests/refine/unrefine_simple.exe - @printf RUN\ $<...\ \ && $(RUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf RUN\ $<...\ \ && $(RUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ tests/refine/unrefine_simple.mtst: \ tests/refine/unrefine_simple.exe - @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< && printf "PASS " && echo $@ && touch $@ + @printf MPIRUN\ $<...\ \ && $(MPIRUN) ./$< >$@ && printf "PASS " && echo $@ && touch $@ From cddd8a56c046e3a7e52dc342699ca7c1d4b19835 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Wed, 1 Jul 2026 22:43:15 +0300 Subject: [PATCH 15/16] Unify macro abbreviation GMD => get_mpi_datatype GCMD => get_cell_mpi_datatype --- dccrg_get_cell_datatype.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dccrg_get_cell_datatype.hpp b/dccrg_get_cell_datatype.hpp index c1357b2..f0cb101 100644 --- a/dccrg_get_cell_datatype.hpp +++ b/dccrg_get_cell_datatype.hpp @@ -87,7 +87,7 @@ struct wrapper { T value; /* std::tuple - get_mpi_datatype(UNUSED_GCMD_ARGS) { + get_mpi_datatype(UNUSED_GMD_ARGS) { return std::make_tuple((void*)this, 1, MPI_##type); } */ From 677f02c33546e890bfa9baa18da832a74f514381 Mon Sep 17 00:00:00 2001 From: Andrew PEDREA Young Date: Fri, 3 Jul 2026 15:45:51 +0300 Subject: [PATCH 16/16] Forgot to pass by ref for erase_if impl. --- dccrg.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dccrg.hpp b/dccrg.hpp index cdebcd7..e314353 100644 --- a/dccrg.hpp +++ b/dccrg.hpp @@ -82,10 +82,12 @@ Namespace where all dccrg classes, functions, etc are defined. namespace dccrg { - /* Custom implementation of erase_if for C++17 */ + /* Custom implementation of erase_if for C++17, + * TODO: Support full range of of unordered_set, + * Return same data as C++20 erase_if */ template static inline - void erase_if(std::unordered_set v, F pred) { + void erase_if(std::unordered_set& v, F pred) { #if __cplusplus >= 202002L std::erase_if(v, pred); #else