-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from LLNL/release/v0.21
Release/v0.21
- Loading branch information
Showing
20 changed files
with
305 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ install_boost: | |
script: | ||
- hostname | ||
- pwd | ||
# - spack install [email protected] | ||
# - spack install [email protected] | ||
# - spack install [email protected] | ||
# - spack install [email protected] | ||
# - spack install [email protected] | ||
|
@@ -58,6 +60,18 @@ install_boost: | |
- export METALL_TEST_DIR="/dev/shm/metall_test-${CI_CONCURRENT_ID}-${CI_PIPELINE_IID}" | ||
- srun -N1 -ppdebug bash ./scripts/CI/build_and_test.sh | ||
|
||
build_gcc10.2.1_bst1.79.0: | ||
extends: .build | ||
variables: | ||
GCC_VERSION: "10.2.1" | ||
BOOST_VERSION: "1.79.0" | ||
|
||
build_gcc10.2.1_bst1.78.0: | ||
extends: .build | ||
variables: | ||
GCC_VERSION: "10.2.1" | ||
BOOST_VERSION: "1.78.0" | ||
|
||
build_gcc10.2.1_bst1.77.0: | ||
extends: .build | ||
variables: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if (Boost_VERSION_STRING VERSION_GREATER_EQUAL "1.75") | ||
add_metall_executable(string_key_store string_key_store.cpp) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright 2022 Lawrence Livermore National Security, LLC and other Metall Project Developers. | ||
// See the top-level COPYRIGHT file for details. | ||
// | ||
// SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
#include <metall/metall.hpp> | ||
#include <metall/container/string_key_store.hpp> | ||
#include <metall/container/experimental/json/json.hpp> | ||
|
||
namespace mc = metall::container; | ||
namespace mj = mc::experimental::json; | ||
|
||
// Example of a string-key-store with int value. | ||
void int_store_example(); | ||
|
||
// Example of a string-key-store with JSON value. | ||
void json_store_example(); | ||
|
||
int main() { | ||
int_store_example(); | ||
json_store_example(); | ||
} | ||
|
||
void int_store_example() { | ||
using int_store_type = mc::string_key_store<int>; | ||
{ | ||
metall::manager manager(metall::create_only, "./string_key_store_obj"); | ||
|
||
// Allocate an instance of the int-store which accept duplicate keys by default. | ||
auto *store = manager.construct<int_store_type>("int-store")(manager.get_allocator()); | ||
|
||
store->insert("a"); // Insert with the default value | ||
store->insert("b", 0); // Insert with a value | ||
store->insert("b", 1); // Insert another element with an existing key | ||
} | ||
|
||
{ | ||
metall::manager manager(metall::open_read_only, "./string_key_store_obj"); | ||
auto *store = manager.find<int_store_type>("int-store").first; | ||
|
||
// Iterate over all elements | ||
for (auto loc = store->begin(); loc != store->end(); ++loc) { | ||
std::cout << store->key(loc) << " : " << store->value(loc) << std::endl; | ||
} | ||
} | ||
} | ||
|
||
void json_store_example() { | ||
using json_type = mj::value<metall::manager::allocator_type<std::byte>>; | ||
using json_store_type = mc::string_key_store<json_type>; | ||
{ | ||
metall::manager manager(metall::open_only, "./string_key_store_obj"); | ||
|
||
const bool unique = true; | ||
const uint64_t hash_seed = 123; | ||
auto *store = manager.construct<json_store_type>("json-store")(unique, hash_seed, manager.get_allocator()); | ||
|
||
store->insert("a", | ||
mj::parse(R"({"name":"Alice"})", manager.get_allocator())); | ||
|
||
store->insert("b", | ||
mj::parse(R"({"name":"N/A"})", manager.get_allocator())); | ||
store->insert("b", | ||
mj::parse(R"({"name":"Bob"})", manager.get_allocator())); // Overwrite | ||
} | ||
|
||
{ | ||
metall::manager manager(metall::open_read_only, "./string_key_store_obj"); | ||
auto *store = manager.find<json_store_type>("json-store").first; | ||
|
||
// Use find() to locate elements. | ||
std::cout << "a : " << mj::serialize(store->value(store->find("a"))) << std::endl; | ||
std::cout << "b : " << mj::serialize(store->value(store->find("b"))) << std::endl; | ||
} | ||
} |
137 changes: 0 additions & 137 deletions
137
include/metall/container/experimental/json/detail/string_view.hpp
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.