Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate pthash to optimize vertex map memory usage. #162

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
if (APPLE)
set(CMAKE_MACOSX_RPATH ON)
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Werror -Wl,-rpath,$ORIGIN")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Werror -Wl,-rpath,$ORIGIN -march=native")
endif ()
if (USE_SIMD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -march=native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2")
endif ()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -g")
Expand Down
21 changes: 14 additions & 7 deletions grape/fragment/basic_fragment_mutator.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,11 @@ class BasicFragmentMutator {

auto builder = vm_ptr_->GetLocalBuilder();
for (auto& buffers : got_vertices_to_add_) {
foreach_rval(buffers,
[this, &builder](internal_oid_t&& id, vdata_t&& data) {
vid_t gid;
builder.add_local_vertex(id, gid);
parsed_vertices_to_add_.emplace_back(gid, std::move(data));
});
foreach_helper(
buffers,
[&builder](const internal_oid_t& id) { builder.add_vertex(id); },
make_index_sequence<1>{});
}
got_vertices_to_add_.clear();

for (auto& buffers : got_edges_to_add_) {
foreach_helper(
Expand All @@ -215,6 +212,16 @@ class BasicFragmentMutator {
}
builder.finish(*vm_ptr_);

for (auto& buffers : got_vertices_to_add_) {
foreach_rval(buffers, [this](internal_oid_t&& id, vdata_t&& data) {
vid_t gid;
if (vm_ptr_->_GetGid(id, gid)) {
parsed_vertices_to_add_.emplace_back(gid, std::move(data));
}
});
}
got_vertices_to_add_.clear();

for (auto& buffers : got_edges_to_add_) {
foreach_rval(buffers, [this](internal_oid_t&& src, internal_oid_t&& dst,
edata_t&& data) {
Expand Down
Loading
Loading