Skip to content

Commit

Permalink
Merge pull request #133 from LLNL/release/v0.12
Browse files Browse the repository at this point in the history
Release/v0.12
  • Loading branch information
KIwabuchi authored Apr 14, 2021
2 parents e59606f + 969c7f4 commit fb02ff1
Show file tree
Hide file tree
Showing 22 changed files with 699 additions and 346 deletions.
30 changes: 18 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ install_boost:
script:
- hostname
- pwd
# - spack install boost@1.75.0
# - spack install boost@1.74.0
# - spack install boost@1.73.0
# - spack install boost@1.72.0
Expand Down Expand Up @@ -55,75 +56,80 @@ 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_gcc8.1_bst1.75.0:
extends: .build
variables:
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.75.0"

build_gcc8.1_bst1.74.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.74.0"

build_gcc8.1_bst1.73.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.73.0"

build_gcc8.1_bst1.72.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.72.0"

build_gcc8.1_bst1.71.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.71.0"

build_gcc8.1_bst1.70.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.70.0"

build_gcc8.1_bst1.69.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.69.0"

build_gcc8.1_bst1.68.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.68.0"

build_gcc8.1_bst1.67.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.67.0"

build_gcc8.1_bst1.66.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.66.0"

build_gcc8.1_bst1.65.1:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.65.1"

build_gcc8.1_bst1.65.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.65.0"

build_gcc8.1_bst1.64.0:
extends: .build
variables:
GCC_VERSION: "8.1.0"
GCC_VERSION: "8.3.1"
BOOST_VERSION: "1.64.0"
48 changes: 40 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif ()
# Configuration for building test, benchmark, example, etc.
# -------------------------------------------------------------------------------- #
cmake_minimum_required(VERSION 3.10) # gtest_discover_tests requires >= CMake 3.10
project(Metall VERSION 0.11)
project(Metall VERSION 0.12)
configure_file(MetallConfig.h.in MetallConfig.h)

include_directories(${PROJECT_BINARY_DIR})
Expand Down Expand Up @@ -52,14 +52,18 @@ set(INITIAL_SEGMENT_SIZE "0" CACHE STRING

# ---------- Experimental options ---------- #
option(USE_PRIVATE_MAP_AND_PWRITE "Use the private map segment storage and pwrite to sync data" OFF)
option(USE_PRIVATE_MAP_AND_MSYNC "Use the private map segment storage and msync to sync data" OFF)
option(USE_PRIVATE_MAP_AND_MSYNC_DIFF "Use the private map segment storage and msync to sync data" OFF)
option(USE_ANONYMOUS_NEW_MAP "Use the anonymous map when creating a new map region" OFF)
set(UMAP_ROOT "" CACHE PATH "UMap installed root directory")

option(ONLY_DOWNLOAD_GTEST "Only downloading Google Test" OFF)
option(SKIP_DOWNLOAD_GTEST "Skip downloading Google Test" OFF)
option(BUILD_NUMA "Build programs that require the NUMA policy library (numa.h)" OFF)
set(FREE_SMALL_OBJECT_SIZE_HINT "0" CACHE STRING
"Try to free the associated pages and file space when objects equal to or larger than that is deallocated")

set(MAX_COPY_THREADS "0" CACHE STRING
"The maximum number of threads to use to copy/clone files (use the internally defined value if 0 is specified)")
# -------------------------------------------------------------------------------- #

if (NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -176,28 +180,46 @@ if (USE_SORTED_BIN)
message(STATUS "Use VM space aware algorithm in the bin directory")
endif()

if (USE_PRIVATE_MAP_AND_MSYNC)
if (USE_PRIVATE_MAP_AND_MSYNC AND UMAP_ROOT)
if (USE_PRIVATE_MAP_AND_MSYNC_DIFF)
if (USE_PRIVATE_MAP_AND_MSYNC_DIFF AND UMAP_ROOT)
message(FATAL_ERROR "USE_PRIVATE_MAP_AND_MSYNC and UMAP_ROOT options cannot coexist")
endif()
if (USE_PRIVATE_MAP_AND_MSYNC AND USE_PRIVATE_MAP_AND_PWRITE)
if (USE_PRIVATE_MAP_AND_MSYNC_DIFF AND USE_PRIVATE_MAP_AND_PWRITE)
message(FATAL_ERROR "USE_PRIVATE_MAP_AND_MSYNC and USE_PRIVATE_MAP_AND_PWRITE options cannot coexist")
endif()
add_definitions(-DMETALL_USE_PRIVATE_MAP_AND_MSYNC)
add_definitions(-DMETALL_USE_PRIVATE_MAP_AND_MSYNC_DIFF)
message(STATUS "Use the private map segment storage")
endif()

if (USE_PRIVATE_MAP_AND_PWRITE)
if (USE_PRIVATE_MAP_AND_PWRITE AND UMAP_ROOT)
message(FATAL_ERROR "USE_PRIVATE_MAP_AND_PWRITE and UMAP_ROOT options cannot coexist")
endif()
if (USE_PRIVATE_MAP_AND_MSYNC AND USE_PRIVATE_MAP_AND_PWRITE)
if (USE_PRIVATE_MAP_AND_MSYNC_DIFF AND USE_PRIVATE_MAP_AND_PWRITE)
message(FATAL_ERROR "USE_PRIVATE_MAP_AND_MSYNC and USE_PRIVATE_MAP_AND_PWRITE options cannot coexist")
endif()
add_definitions(-DMETALL_USE_PRIVATE_MAP_AND_PWRITE)
message(STATUS "Use the private map segment storage")
endif()

if (USE_ANONYMOUS_NEW_MAP)
if (USE_ANONYMOUS_NEW_MAP AND UMAP_ROOT)
message(FATAL_ERROR "USE_ANONYMOUS_NEW_MAP and UMAP_ROOT options cannot coexist")
endif()

if (NOT (USE_PRIVATE_MAP_AND_MSYNC_DIFF OR USE_PRIVATE_MAP_AND_PWRITE))
message(FATAL_ERROR "USE_ANONYMOUS_NEW_MAP must be used with a private map mode")
endif()

add_definitions(-DMETALL_USE_ANONYMOUS_NEW_MAP)
message(STATUS "Use the anonymous map for new map region")
endif()

if (MAX_COPY_THREADS GREATER 0)
add_definitions(-DMETALL_MAX_COPY_THREADS=${MAX_COPY_THREADS})
message(STATUS "METALL_MAX_COPY_THREADS=${MAX_COPY_THREADS}")
endif ()

# -------------------------------------------------------------------------------- #
# Document (Doxygen)
# -------------------------------------------------------------------------------- #
Expand All @@ -213,6 +235,8 @@ endif ()
# -------------------------------------------------------------------------------- #
# Executables
# -------------------------------------------------------------------------------- #
include_directories(include)

# Requirements for GCC
if (NOT RUN_BUILD_AND_TEST_WITH_CI)
if (("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
Expand Down Expand Up @@ -261,15 +285,23 @@ endif ()


# ---------- Boost ---------- #
# Disable the boost-cmake feature (BoostConfig.cmake or boost-config.cmake) since
# there is a tricky behavior/issue especially in Boost 1.70.0.
set (Boost_NO_BOOST_CMAKE ON)

if (RUN_BUILD_AND_TEST_WITH_CI)
find_package(Boost)
else ()
find_package(Boost 1.64)
endif ()

if (Boost_FOUND)

# Just a sanity check
if (NOT Boost_INCLUDE_DIRS)
message(FATAL_ERROR "Something is wrong: Boost_INCLUDE_DIRS is empty although Boost_FOUND is true.")
endif()
include_directories(${Boost_INCLUDE_DIRS})
include_directories(include)

add_subdirectory(src)
add_subdirectory(example)
Expand Down
6 changes: 3 additions & 3 deletions bench/adjacency_list/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ if (OpenMP_CXX_FOUND)
endif ()

if (MEMKIND_ROOT)
include_directories(${MEMKIND_ROOT}/include)
add_executable(run_adj_list_bench_pmem run_adj_list_bench_pmem)
target_include_directories(run_adj_list_bench_pmem PUBLIC ${MEMKIND_ROOT}/include)
if (UNIX AND NOT APPLE)
find_library(LIBMEMKIND NAMES memkind PATHS ${MEMKIND_ROOT}/lib)
if (LIBMEMKIND)
link_libraries(${LIBMEMKIND})
target_link_libraries(run_adj_list_bench_pmem PUBLIC ${LIBMEMKIND})
else ()
message(FATAL_ERROR "Cannot find memkind library")
endif ()
endif ()
add_executable(run_adj_list_bench_pmem run_adj_list_bench_pmem)
if (OpenMP_CXX_FOUND)
target_link_libraries(run_adj_list_bench_pmem PUBLIC OpenMP::OpenMP_CXX)
endif ()
Expand Down
53 changes: 32 additions & 21 deletions bench/adjacency_list/bench_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ struct bench_options {
std::string adj_list_dump_file_name;
std::string edge_list_dump_file_name;

bool append{false}; // Append existing data store

std::string staging_location; // Copy data store

bool verbose{false};
};

Expand All @@ -65,7 +69,11 @@ inline void disp_options(const bench_options &option) {
std::cout << " " << name << std::endl;
}
}
std::cout << "segment_size (for Boost) : " << option.segment_size << std::endl;
std::cout << "segment_size (for Boost and pmem) : " << option.segment_size << std::endl;

std::cout << "Append existing data store : " << static_cast<int>(option.append) << std::endl;

std::cout << "Staging location : " << option.staging_location << std::endl;

if (option.input_file_name_list.empty()) {
std::cout << "seed: " << option.rmat.seed
Expand All @@ -86,7 +94,7 @@ inline void disp_options(const bench_options &option) {

inline auto parse_options(int argc, char **argv, bench_options *option) {
int p;
while ((p = ::getopt(argc, argv, "o:k:n:f:s:v:e:a:b:c:r:u:d:D:V")) != -1) {
while ((p = ::getopt(argc, argv, "o:k:n:f:s:v:e:a:b:c:r:u:d:D:VAS:")) != -1) {
switch (p) {
case 'o':option->datastore_path_list.clear();
boost::split(option->datastore_path_list, optarg, boost::is_any_of(":"));
Expand Down Expand Up @@ -125,6 +133,12 @@ inline auto parse_options(int argc, char **argv, bench_options *option) {
case 'u':option->rmat.undirected = static_cast<bool>(std::stoi(optarg));
break;

case 'A': option->append = true;
break;

case 'S': option->staging_location = optarg;
break;

case 'd': // dump constructed adjacency list at the end of benchmark
option->adj_list_dump_file_name = optarg;
break;
Expand Down Expand Up @@ -156,7 +170,8 @@ inline auto parse_options(int argc, char **argv, bench_options *option) {
template <typename adjacency_list_type>
inline auto run_bench_kv_file(const std::vector<std::string> &input_file_name_list,
const std::size_t chunk_size,
const closing_function_type &closing_function,
const std::function<void()> &preprocess,
const std::function<void()> &postprocess,
adjacency_list_type *adj_list,
std::ofstream *const ofs_save_edge,
const bool verbose = false) {
Expand All @@ -183,7 +198,7 @@ inline auto run_bench_kv_file(const std::vector<std::string> &input_file_name_li

if (count_read == 0) break;

total_elapsed_time += ingest_key_values(input_storage, closing_function, adj_list, verbose);
total_elapsed_time += ingest_key_values(input_storage, preprocess, postprocess, adj_list, verbose);

if (ofs_save_edge) {
for (const auto &list : input_storage) {
Expand All @@ -205,7 +220,8 @@ inline auto run_bench_kv_file(const std::vector<std::string> &input_file_name_li
template <typename adjacency_list_type>
inline auto run_bench_rmat_edge(const bench_options::rmat_option &rmat_option,
const std::size_t chunk_size,
const closing_function_type &closing_function,
const std::function<void()> &preprocess,
const std::function<void()> &postprocess,
adjacency_list_type *adj_list,
std::ofstream *const ofs_save_edge,
const bool verbose = false) {
Expand Down Expand Up @@ -251,7 +267,7 @@ inline auto run_bench_rmat_edge(const bench_options::rmat_option &rmat_option,
}
}

total_elapsed_time += ingest_key_values(input_storage, closing_function, adj_list, verbose);
total_elapsed_time += ingest_key_values(input_storage, preprocess, postprocess, adj_list, verbose);

if (ofs_save_edge) {
for (const auto &list : input_storage) {
Expand Down Expand Up @@ -297,11 +313,14 @@ inline void dump_adj_list(const adjacency_list_type &adj_list, const std::string
/// \brief Run Key-value insertion benchmark.
/// \tparam adjacency_list_type A type of the adjacent-list type to use.
/// \param options Benchmark options.
/// \param closing_function A function that is called after each chunk is inserted.
/// if '!closing_function' is true, it won't be called.
/// \param preprocess A function that is called after each chunk is inserted.
/// if '!preprocess' is true, it won't be called.
/// \param adj_list A pointer to a adjacently list object.
template <typename adjacency_list_type>
void run_bench(const bench_options &options, closing_function_type closing_function, adjacency_list_type *adj_list) {
void run_bench(const bench_options &options,
adjacency_list_type *adj_list,
const std::function<void()>& preprocess = std::function<void()>{},
const std::function<void()>& postprocess = std::function<void()>{}) {

std::cout << "Start key-value data ingestion" << std::endl;
print_omp_configuration();
Expand All @@ -321,15 +340,17 @@ void run_bench(const bench_options &options, closing_function_type closing_funct
std::cout << "Get inputs from an R-MAT edge generator (graph data)" << std::endl;
elapsed_time_sec = run_bench_rmat_edge(options.rmat,
options.chunk_size,
closing_function,
preprocess,
postprocess,
adj_list,
&ofs_save_edge,
options.verbose);
} else {
std::cout << "Get inputs from key-value files" << std::endl;
elapsed_time_sec = run_bench_kv_file(options.input_file_name_list,
options.chunk_size,
closing_function,
preprocess,
postprocess,
adj_list,
&ofs_save_edge,
options.verbose);
Expand All @@ -349,15 +370,5 @@ void run_bench(const bench_options &options, closing_function_type closing_funct
}
}

/// \brief Run Key-value insertion benchmark.
/// \tparam adjacency_list_type A type of the adjacent-list type to use.
/// \param options Benchmark options.
/// \param adj_list A pointer to a adjacently list object.
template <typename adjacency_list_type>
void run_bench(const bench_options &options, adjacency_list_type *adj_list) {
// Pass 'NULL' of closing_function_type so that it won't be called.
run_bench(options, closing_function_type(), adj_list);
}

}
#endif //METALL_BENCH_ADJACENCY_LIST_BENCH_DRIVER_HPP
Loading

0 comments on commit fb02ff1

Please sign in to comment.