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

Commit2a4c78a

Browse files
authored
Merge pull request#257 from LLNL/release/v0.23
Release/v0.23
2 parentseec3d07 +730bccf commit2a4c78a

File tree

35 files changed

+1453
-535
lines changed

35 files changed

+1453
-535
lines changed

‎.github/workflows/ci-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI Test
33
on:[push, pull_request]
44

55
jobs:
6-
bst1-79-0:
6+
bst1-80-0:
77
runs-on:ubuntu-latest
88
env:
99
METALL_LIMIT_MAKE_PARALLELS:8
@@ -12,9 +12,9 @@ jobs:
1212
-name:Test
1313
run:|
1414
pushd /dev/shm
15-
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz
15+
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz
1616
mkdir boost
17-
tar xfboost_1_79_0.tar.gz -C boost --strip-components 1
17+
tar xfboost_1_80_0.tar.gz -C boost --strip-components 1
1818
export BOOST_ROOT=${PWD}/boost
1919
popd
2020
export METALL_TEST_DIR=${GITHUB_JOB}

‎.gitlab-ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ install_boost:
2727
script:
2828
-hostname
2929
-pwd
30+
# - spack install boost@1.80.0
3031
# - spack install boost@1.79.0
3132
# - spack install boost@1.78.0
3233
# - spack install boost@1.77.0
@@ -60,6 +61,12 @@ install_boost:
6061
-export METALL_TEST_DIR="/dev/shm/metall_test-${CI_CONCURRENT_ID}-${CI_PIPELINE_IID}"
6162
-srun -N1 -ppdebug bash ./scripts/CI/build_and_test.sh
6263

64+
build_gcc10.2.1_bst1.80.0:
65+
extends:.build
66+
variables:
67+
GCC_VERSION:"10.2.1"
68+
BOOST_VERSION:"1.80.0"
69+
6370
build_gcc10.2.1_bst1.79.0:
6471
extends:.build
6572
variables:

‎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.22
20+
VERSION0.23
2121
DESCRIPTION"A persistent memory allocator for data-centric analytics"
2222
HOMEPAGE_URL"https://github.com/LLNL/metall")
2323

‎bench/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ add_subdirectory(simple_alloc)
22
add_subdirectory(adjacency_list)
33
add_subdirectory(bfs)
44
add_subdirectory(rand_engine)
5-
add_subdirectory(mapping)
5+
add_subdirectory(mapping)
6+
add_subdirectory(container)
7+
add_subdirectory(offset_ptr)

‎bench/container/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_metall_executable(run_vector_benchrun_vector_bench.cpp)
2+
add_metall_executable(run_map_benchrun_map_bench.cpp)
3+
add_metall_executable(run_unordered_map_benchrun_unordered_map_bench.cpp)

‎bench/container/bench_common.hpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright 2022 Lawrence Livermore National Security, LLC and other Metall Project Developers.
2+
// See the top-level COPYRIGHT file for details.
3+
//
4+
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
6+
#ifndef METALL_BENCH_CONTAINER_BENCH_COMMON_HPP
7+
#defineMETALL_BENCH_CONTAINER_BENCH_COMMON_HPP
8+
9+
#include<vector>
10+
#include<utility>
11+
#include<random>
12+
13+
#include<metall/utility/random.hpp>
14+
15+
#include"../bench/adjacency_list/edge_generator/rmat_edge_generator.hpp"
16+
17+
namespacemdtl= metall::mtlldetail;
18+
19+
using rmat_generator_type = edge_generator::rmat_edge_generator;
20+
21+
voidgen_edges(const std::size_t vertex_scale,
22+
const std::size_t num_edges,
23+
std::vector<std::pair<uint64_t,uint64_t>> &buf) {
24+
rmat_generator_typermat_generator(123, vertex_scale, num_edges,0.57,0.19,0.19,true,false);
25+
26+
buf.reserve(num_edges);
27+
for (auto itr = rmat_generator.begin(); itr != rmat_generator.end(); ++itr) {
28+
buf.emplace_back(*itr);
29+
}
30+
}
31+
32+
voidgen_random_values(const std::size_t num_values,
33+
std::vector<std::pair<uint64_t,uint64_t>> &buf) {
34+
metall::utility::rand_1024rnd_generator(std::random_device{}());
35+
36+
buf.reserve(num_values);
37+
for (std::size_t i =0; i < num_values; ++i) {
38+
buf.emplace_back(rnd_generator(),rnd_generator());
39+
}
40+
}
41+
42+
template<typename input_container_type,typename inserter_func>
43+
voidrun_bench(const input_container_type &inputs,const inserter_func &inserter) {
44+
constauto start =mdtl::elapsed_time_sec();
45+
for (constauto &kv: inputs) {
46+
inserter(kv);
47+
}
48+
constauto elapsed_time =mdtl::elapsed_time_sec(start);
49+
std::cout <<"Took (s)\t" << elapsed_time << std::endl;
50+
}
51+
52+
template<typename input_container_type,typename preprocessor_func,typename inserter_func>
53+
voidrun_bench(const input_container_type &inputs,const preprocessor_func& preprocessor,const inserter_func &inserter) {
54+
constauto start =mdtl::elapsed_time_sec();
55+
preprocessor();
56+
for (constauto &kv: inputs) {
57+
inserter(kv);
58+
}
59+
constauto elapsed_time =mdtl::elapsed_time_sec(start);
60+
std::cout <<"Took (s)\t" << elapsed_time << std::endl;
61+
}
62+
63+
#endif//METALL_BENCH_CONTAINER_BENCH_COMMON_HPP

‎bench/container/run_map_bench.cpp

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright 2022 Lawrence Livermore National Security, LLC and other Metall Project Developers.
2+
// See the top-level COPYRIGHT file for details.
3+
//
4+
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
6+
/// \brief Benchmarks the STL map container using different allocators.
7+
/// Usage:
8+
/// ./run_map_bench
9+
/// # modify the values in the main(), if needed.
10+
11+
#include<iostream>
12+
#include<map>
13+
#include<boost/container/map.hpp>
14+
#include<metall/container/map.hpp>
15+
#include<metall/metall.hpp>
16+
#include<metall/detail/time.hpp>
17+
18+
#include"bench_common.hpp"
19+
20+
intmain() {
21+
std::size_t scale =17;
22+
std::size_t num_inputs = (1ULL << scale) *16;
23+
std::vector<std::pair<uint64_t,uint64_t>> inputs;
24+
25+
//gen_edges(scale, num_inputs, inputs);
26+
gen_random_values(num_inputs, inputs);
27+
std::cout <<"Generated inputs\t" << inputs.size() << std::endl;
28+
29+
{
30+
std::map<uint64_t,uint64_t> map;
31+
32+
constauto start =mdtl::elapsed_time_sec();
33+
for (constauto &kv: inputs) {
34+
map[kv.first];
35+
map[kv.second];
36+
}
37+
constauto elapsed_time =mdtl::elapsed_time_sec(start);
38+
std::cout <<"map took (s)\t" << elapsed_time << std::endl;
39+
}
40+
41+
{
42+
boost::container::map<uint64_t,uint64_t> map;
43+
44+
constauto start =mdtl::elapsed_time_sec();
45+
for (constauto &kv: inputs) {
46+
map[kv.first];
47+
map[kv.second];
48+
}
49+
constauto elapsed_time =mdtl::elapsed_time_sec(start);
50+
std::cout <<"Boost map took (s)\t" << elapsed_time << std::endl;
51+
}
52+
53+
{
54+
metall::managermngr(metall::create_only,"/tmp/metall");
55+
metall::container::map<uint64_t,uint64_t>map(mngr.get_allocator());
56+
57+
constauto start =mdtl::elapsed_time_sec();
58+
for (constauto &kv: inputs) {
59+
map[kv.first];
60+
map[kv.second];
61+
}
62+
constauto elapsed_time =mdtl::elapsed_time_sec(start);
63+
std::cout <<"Boost map with Metall took (s)\t" << elapsed_time << std::endl;
64+
}
65+
66+
return0;
67+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright 2022 Lawrence Livermore National Security, LLC and other Metall Project Developers.
2+
// See the top-level COPYRIGHT file for details.
3+
//
4+
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
6+
/// \brief Benchmarks the STL map container using different allocators.
7+
/// Usage:
8+
/// ./run_map_bench
9+
/// # modify the values in the main(), if needed.
10+
11+
#include<iostream>
12+
#include<unordered_map>
13+
#include<boost/unordered_map.hpp>
14+
#include<metall/container/unordered_map.hpp>
15+
#include<metall/metall.hpp>
16+
#include<metall/detail/time.hpp>
17+
18+
#include"bench_common.hpp"
19+
20+
intmain() {
21+
std::size_t scale =17;
22+
std::size_t num_inputs = (1ULL << scale) *16;
23+
std::vector<std::pair<uint64_t,uint64_t>> inputs;
24+
25+
//gen_edges(scale, num_inputs, inputs);
26+
gen_random_values(num_inputs, inputs);
27+
std::cout <<"Generated inputs\t" << inputs.size() << std::endl;
28+
29+
{
30+
std::unordered_map<uint64_t,uint64_t> map;
31+
32+
constauto start =mdtl::elapsed_time_sec();
33+
for (constauto &kv: inputs) {
34+
map[kv.first];
35+
map[kv.second];
36+
}
37+
constauto elapsed_time =mdtl::elapsed_time_sec(start);
38+
std::cout <<"unordered_map took (s)\t" << elapsed_time << std::endl;
39+
}
40+
41+
{
42+
boost::unordered_map<uint64_t,uint64_t> map;
43+
44+
constauto start =mdtl::elapsed_time_sec();
45+
for (constauto &kv: inputs) {
46+
map[kv.first];
47+
map[kv.second];
48+
}
49+
constauto elapsed_time =mdtl::elapsed_time_sec(start);
50+
std::cout <<"Boost unordered_map took (s)\t" << elapsed_time << std::endl;
51+
}
52+
53+
{
54+
metall::managermngr(metall::create_only,"/tmp/metall");
55+
metall::container::unordered_map<uint64_t,uint64_t>map(mngr.get_allocator());
56+
57+
constauto start =mdtl::elapsed_time_sec();
58+
for (constauto &kv: inputs) {
59+
map[kv.first];
60+
map[kv.second];
61+
}
62+
constauto elapsed_time =mdtl::elapsed_time_sec(start);
63+
std::cout <<"Boost unordered_map with Metall took (s)\t" << elapsed_time << std::endl;
64+
}
65+
66+
return0;
67+
}

‎bench/container/run_vector_bench.cpp

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Copyright 2022 Lawrence Livermore National Security, LLC and other Metall Project Developers.
2+
// See the top-level COPYRIGHT file for details.
3+
//
4+
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
6+
/// \brief Benchmarks the STL map container using different allocators.
7+
/// Usage:
8+
/// ./run_map_bench
9+
/// # modify the values in the main(), if needed.
10+
11+
#include<iostream>
12+
#include<vector>
13+
#include<boost/container/vector.hpp>
14+
#include<metall/container/vector.hpp>
15+
#include<metall/metall.hpp>
16+
#include<metall/detail/time.hpp>
17+
18+
#include"bench_common.hpp"
19+
20+
intmain() {
21+
std::size_t scale =22;
22+
std::size_t num_inputs = (1ULL << scale) *16;
23+
std::vector<std::pair<uint64_t,uint64_t>> inputs;
24+
25+
gen_random_values(num_inputs, inputs);
26+
std::cout <<"Generated inputs\t" << inputs.size() << std::endl;
27+
28+
{
29+
std::cout <<"vector (push_back)" << std::endl;
30+
std::vector<std::pair<uint64_t,uint64_t>> vec;
31+
run_bench(inputs, [&vec](constauto &kv) { vec.push_back(kv); });
32+
}
33+
34+
{
35+
std::cout <<"Boost vector (push_back)" << std::endl;
36+
boost::container::vector<std::pair <uint64_t,uint64_t>>
37+
vec;
38+
run_bench(inputs, [&vec](constauto &kv) { vec.push_back(kv); });
39+
}
40+
41+
{
42+
std::cout <<"Boost vector (push_back) with Metall" << std::endl;
43+
metall::managermngr(metall::create_only,"/tmp/metall");
44+
metall::container::vector<std::pair<uint64_t,uint64_t>>vec(mngr.get_allocator());
45+
run_bench(inputs, [&vec](constauto &kv) { vec.push_back(kv); });
46+
}
47+
std::cout << std::endl;
48+
49+
{
50+
std::cout <<"vector ([])" << std::endl;
51+
std::vector<std::pair<uint64_t,uint64_t>> vec;
52+
std::size_t index =0;
53+
run_bench(inputs,
54+
[&vec, &inputs]() { vec.resize(inputs.size()); },
55+
[&vec, &index](constauto &kv) { vec[index++] = kv; });
56+
}
57+
58+
{
59+
std::cout <<"Boost ([]) vector" << std::endl;
60+
boost::container::vector<std::pair <uint64_t,uint64_t>>
61+
vec;
62+
std::size_t index =0;
63+
run_bench(inputs,
64+
[&vec, &inputs]() { vec.resize(inputs.size()); },
65+
[&vec, &index](constauto &kv) { vec[index++] = kv; });
66+
}
67+
68+
{
69+
std::cout <<"Boost vector ([]) with Metall" << std::endl;
70+
metall::managermngr(metall::create_only,"/tmp/metall");
71+
metall::container::vector<std::pair<uint64_t,uint64_t>>vec(mngr.get_allocator());
72+
std::size_t index =0;
73+
run_bench(inputs,
74+
[&vec, &inputs]() { vec.resize(inputs.size()); },
75+
[&vec, &index](constauto &kv) { vec[index++] = kv; });
76+
}
77+
return0;
78+
}

‎bench/mapping/run_mapping_bench.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2019 Lawrence Livermore National Security, LLC and other Metall Project Developers.
2+
// See the top-level COPYRIGHT file for details.
3+
//
4+
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
6+
/// \brief Benchmarks file mapping backends.
7+
/// Usage:
8+
/// ./run_mapping_bench
9+
/// # modify some values in the main function, if needed.
10+
111
#include<iostream>
212
#include<random>
313
#include<string>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp