-
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 #216 from LLNL/release/v0.20
Release/v0.20
- Loading branch information
Showing
13 changed files
with
959 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This CITATION.cff file was generated with cffinit. | ||
# Visit https://bit.ly/cffinit to generate yours today! | ||
|
||
cff-version: 1.2.0 | ||
title: >- | ||
Metall: A Persistent Memory Allocator for | ||
Data-Centric Analytics | ||
message: >- | ||
If you use this software, please cite it using the | ||
metadata from this file. | ||
type: software | ||
authors: | ||
- given-names: Keita | ||
family-names: Iwabuchi | ||
email: [email protected] | ||
affiliation: ' Lawrence Livermore National Laboratory' | ||
orcid: 'https://orcid.org/0000-0002-9395-0843' | ||
- given-names: 'Roger ' | ||
family-names: Pearce | ||
affiliation: Lawrence Livermore National Laboratory | ||
- given-names: Maya | ||
family-names: Gokhale | ||
affiliation: Lawrence Livermore National Laboratory | ||
identifiers: | ||
- type: url | ||
value: 'https://doi.org/10.11578/dc.20190410.1' | ||
repository-code: 'https://github.com/LLNL/metall' | ||
abstract: >- | ||
Metall is a persistent memory allocator built on | ||
top of the memory-mapped file mechanism. | ||
Metall enables applications to transparently | ||
allocate custom C++ data structures into various | ||
types of persistent memories. |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
project(myproject) | ||
project(myproject LANGUAGES C CXX) | ||
|
||
# Metall requires C++ 17 | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
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,44 @@ | ||
// 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 <iostream> | ||
#include <metall/metall.hpp> | ||
#include <metall/container/vector.hpp> | ||
#include <metall/container/experimental/json/json.hpp> | ||
|
||
using namespace metall::container; | ||
using namespace metall::container::experimental; | ||
|
||
int main() { | ||
// Metall JSON container works like the other containers w.r.t. allocation, i.e., | ||
// it takes an allocator type in its template parameter and an allocator object in its constructors. | ||
using json_value_type = json::value<metall::manager::allocator_type<std::byte>>; | ||
// Need to use scoped_allocator as this is a multi-layer container. | ||
using vector_json_type = vector<json_value_type, metall::manager::scoped_allocator_type<json_value_type>>; | ||
|
||
// An example input json strings. | ||
std::vector<std::string> json_string_list{R"({"name": "Alice", "list": [0, 1]})", | ||
R"({"name": "Brad", "list": [2, 3]})"}; | ||
|
||
// Create a vector-of-json object | ||
{ | ||
metall::manager manager(metall::create_only, "./test"); | ||
auto *vec = manager.construct<vector_json_type>(metall::unique_instance)(manager.get_allocator()); | ||
for (const auto &json_string: json_string_list) { | ||
vec->emplace_back(json::parse(json_string, manager.get_allocator())); | ||
} | ||
} | ||
|
||
// Reattach the vector-of-json object created above. | ||
{ | ||
metall::manager manager(metall::open_read_only, "./test"); | ||
auto *vec = manager.find<vector_json_type>(metall::unique_instance).first; | ||
for (const auto &json: *vec) { | ||
json::pretty_print(std::cout, json); // Show contents. | ||
} | ||
} | ||
|
||
return 0; | ||
} |
Oops, something went wrong.