Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1ff79fb

Browse files
authored
Merge pull request#264 from LLNL/release/v0.24
Release/v0.24
2 parentsbf31ba8 +ec740f1 commit1ff79fb

File tree

10 files changed

+56
-28
lines changed

10 files changed

+56
-28
lines changed

‎CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif()
1717
# Metall general configuration
1818
# -------------------------------------------------------------------------------- #
1919
project(Metall
20-
VERSION0.23.1
20+
VERSION0.24
2121
DESCRIPTION"A persistent memory allocator for data-centric analytics"
2222
HOMEPAGE_URL"https://github.com/LLNL/metall")
2323

‎bench/data_structure/multithread_adjacency_list.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ class multithread_adjacency_list<_key_type, _value_type, _base_allocator_type>::
193193
return !(*this == other);
194194
}
195195

196-
referenceoperator++() {
196+
impl_const_key_iterator&operator++() {
197197
next();
198-
return *m_local_iterator;
198+
return *this;
199199
}
200200

201201
impl_const_key_iteratoroperator++(int) {

‎bench/data_structure/partitioned_multithread_adjacency_list.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ class partitioned_multithread_adjacency_list<local_adj_list_type, global_allocat
174174
return !(*this == other);
175175
}
176176

177-
referenceoperator++() {
177+
impl_key_iterator&operator++() {
178178
next();
179-
return *m_local_iterator;
179+
return *this;
180180
}
181181

182182
impl_key_iteratoroperator++(int) {

‎docs/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Metall"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = v0.23.1
41+
PROJECT_NUMBER = v0.24
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

‎include/metall/container/experimental/json/value.hpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,20 @@ class value {
142142
std::true_type>) {
143143
m_allocator = other.m_allocator;
144144
}
145-
m_data = other.m_data;
145+
146+
// Cannot do `m_data = other.m_data`
147+
// because std::variant calls the allocator-extended copy constructor of the holding data,
148+
// which ignores propagate_on_container_copy_assignment value.
149+
if (other.is_object()) {
150+
emplace_object() = other.as_object();
151+
}elseif (other.is_array()) {
152+
emplace_array() = other.as_array();
153+
}elseif (other.is_string()) {
154+
emplace_string() = other.as_string();
155+
}else {
156+
m_data = other.m_data;
157+
}
158+
146159
return *this;
147160
}
148161

‎include/metall/kernel/manager_kernel_impl.ipp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,13 @@ bool manager_kernel<chnk_no, chnk_sz>::priv_copy_data_store(const std::string &s
11731173
const std::string &dst_base_dir_path,
11741174
constbool use_clone,
11751175
constint num_max_copy_threads) {
1176+
if (!consistent(src_base_dir_path.data())) {
1177+
std::strings(
1178+
"Source directory is not consistnt (may not have closed properly or may still be open):" + src_base_dir_path);
1179+
logger::out(logger::level::error, __FILE__, __LINE__, s.c_str());
1180+
returnfalse;
1181+
}
1182+
11761183
const std::string src_top_dir =priv_make_top_dir_path(src_base_dir_path);
11771184
if (!mdtl::directory_exist(src_top_dir)) {
11781185
std::strings("Source directory does not exist:" + src_top_dir);

‎include/metall/stl_allocator.hpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@
1717

1818
namespacemetall {
1919

20-
/// \brief A STL compatible allocator
21-
/// \tparam T The type of the object
22-
/// \tparam metall_manager_kernel_type The type of the manager kernel
20+
/// \brief A STL compatible allocator.
21+
/// \tparam T A object type.
22+
/// \tparam metall_manager_kernel_type A manager kernel type.
23+
/// \warning
24+
/// This allocator does not define propagate_on_* types, as same as Boost.Interprocess.
25+
/// Those types are going to be std::false_type in std::allocator_traits.
26+
/// Therefore, this allocator is not propagated during containers' copy assignment, move assignment, or swap.
27+
/// This configuration enables users to copy containers between different Metall managers easier.
28+
/// On the other hand, performing the move assignment between two containers allocated by different Metall managers
29+
/// invokes copy operations instead of move operations.
30+
/// Also, swapping containers allocated by different Metall managers will result in undefined behavior.
2331
template<typename T,typename metall_manager_kernel_type>
2432
classstl_allocator {
2533

@@ -35,10 +43,6 @@ class stl_allocator {
3543
using const_void_pointer =typename std::pointer_traits<pointer>::template rebind<constvoid>;
3644
using difference_type =typename std::pointer_traits<pointer>::difference_type;
3745
using size_type =typename std::make_unsigned<difference_type>::type;
38-
using propagate_on_container_copy_assignment = std::true_type;
39-
using propagate_on_container_move_assignment = std::true_type;
40-
using propagate_on_container_swap = std::true_type;
41-
using is_always_equal = std::false_type;
4246
using manager_kernel_type = metall_manager_kernel_type;
4347

4448
/// \brief Makes another allocator type for type T2
@@ -133,12 +137,6 @@ class stl_allocator {
133137
voiddestroy(const pointer &ptr)const {
134138
priv_destroy(ptr);
135139
}
136-
/// \brief Obtains the copy-constructed version of the allocator a.
137-
/// \param a Allocator used by a standard container passed as an argument to a container copy constructor.
138-
/// \return The allocator to use by the copy-constructed standard containers.
139-
stl_allocatorselect_on_container_copy_construction(const stl_allocator &a) {
140-
returnstl_allocator(a);
141-
}
142140

143141
// ----------------------------------- This class's unique public functions ----------------------------------- //
144142
/// \brief Returns a pointer that points to manager kernel

‎include/metall/utility/metall_mpi_adaptor.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class metall_mpi_adaptor {
135135
}
136136

137137
/// \brief Copies a Metall datastore to another location.
138+
/// The behavior of copying a data store that is open without the read-only mode is undefined.
138139
/// \param source_dir_path A path to a source datastore.
139140
/// \param destination_dir_path A path to a destination datastore.
140141
/// \param comm A MPI communicator.
@@ -143,6 +144,15 @@ class metall_mpi_adaptor {
143144
staticboolcopy(constchar *source_dir_path,
144145
constchar *destination_dir_path,
145146
const MPI_Comm &comm = MPI_COMM_WORLD) {
147+
if (!consistent(source_dir_path, comm)) {
148+
if (priv_mpi_comm_rank(comm) ==0) {
149+
std::stringstream ss;
150+
ss <<"Source directory is not consistnt (may not have closed properly or may still be open):"
151+
<< source_dir_path;
152+
logger::out(logger::level::error, __FILE__, __LINE__, ss.str().c_str());
153+
}
154+
returnfalse;
155+
}
146156
priv_setup_root_dir(destination_dir_path, comm);
147157
constint rank =priv_mpi_comm_rank(comm);
148158
returnpriv_global_and(manager_type::copy(ds::make_local_dir_path(source_dir_path, rank).c_str(),

‎include/metall/version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// METALL_VERSION / 100 % 1000 // the minor version.
1515
/// METALL_VERSION % 100 // the patch level.
1616
/// \endcode
17-
#defineMETALL_VERSION2301
17+
#defineMETALL_VERSION2400
1818

1919
namespacemetall {
2020
/// \brief Variable type to handle a version data.

‎test/container/stl_allocator_test.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ TEST(StlAllocatorTest, Types) {
5151
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::size_type),typeid(alloc_t::size_type));
5252

5353
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::propagate_on_container_copy_assignment),
54-
typeid(alloc_t::propagate_on_container_copy_assignment));
54+
typeid(std::false_type));
5555
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::propagate_on_container_copy_assignment),
56-
typeid(std::true_type));
56+
typeid(std::false_type));
5757

5858
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::propagate_on_container_move_assignment),
59-
typeid(alloc_t::propagate_on_container_move_assignment));
59+
typeid(std::false_type));
6060
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::propagate_on_container_move_assignment),
61-
typeid(std::true_type));
61+
typeid(std::false_type));
6262

6363
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::propagate_on_container_swap),
64-
typeid(alloc_t::propagate_on_container_swap));
65-
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::propagate_on_container_swap),typeid(std::true_type));
64+
typeid(std::false_type));
65+
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::propagate_on_container_swap),typeid(std::false_type));
6666

6767
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::is_always_equal),
68-
typeid(alloc_t::is_always_equal));
68+
typeid(std::false_type));
6969
GTEST_ASSERT_EQ(typeid(std::allocator_traits<alloc_t>::is_always_equal),typeid(std::false_type));
7070

7171
using otherT =int;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp