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

Implement grin interface for flex #3010

Merged
merged 35 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
deb8e2d
add grin interface for flex
liulx20 Jul 12, 2023
e877065
add pk interfaces
liulx20 Jul 13, 2023
d704f7f
add grin interfaces for flex
liulx20 Jul 13, 2023
3d18997
add grin interfaces for flex
liulx20 Jul 13, 2023
f99ef2a
implement get_edge_num_by_type interfaces
liulx20 Jul 14, 2023
b8aa2ac
add test.c
liulx20 Jul 14, 2023
799825e
mv grin to graph_db
liulx20 Jul 14, 2023
8318312
rm include
liulx20 Jul 14, 2023
1d50c68
rm include
liulx20 Jul 14, 2023
10859f3
update libgrape-lite version
liulx20 Jul 14, 2023
dddeb54
Redesign the data structure for vertex
liulx20 Jul 14, 2023
17c2cb6
remove not supported feature
liulx20 Jul 14, 2023
4f40457
Remove unnecessary dependencies
liulx20 Jul 17, 2023
543c726
use raw pointer instead of shared_ptr
liulx20 Jul 17, 2023
9f9dadf
GRIN_VERTEX_PROPERTY as u32
liulx20 Jul 18, 2023
d647eac
GRIN_VERTEX_PROPERTY as u32
liulx20 Jul 18, 2023
1e2f3fd
add note
liulx20 Jul 18, 2023
6c69f78
Redesigned adj iter
liulx20 Jul 18, 2023
fc263ea
use SCNd64 for int64
liulx20 Jul 18, 2023
fdaf968
Adjusting the grin include directory
liulx20 Jul 18, 2023
16d5768
Adjusting the grin include directory
liulx20 Jul 18, 2023
5168b13
add CI
liulx20 Jul 18, 2023
d27a961
add CI
liulx20 Jul 18, 2023
9f76b69
add CI
liulx20 Jul 18, 2023
576aaae
add CI
liulx20 Jul 18, 2023
6e67c56
add CI
liulx20 Jul 18, 2023
ff245a6
add CI
liulx20 Jul 18, 2023
04aa88a
add CI
liulx20 Jul 18, 2023
6c283a4
add CI
liulx20 Jul 18, 2023
1f9bf47
add CI test
liulx20 Jul 18, 2023
9067405
add CI
liulx20 Jul 18, 2023
02d8a5a
Merge branch 'main' into add_grin
liulx20 Jul 18, 2023
b2dd5ea
add cache for vertex properties
liulx20 Jul 19, 2023
a5d9574
add cache for vertex properties
liulx20 Jul 19, 2023
5952524
Merge branch 'main' into add_grin
liulx20 Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/flex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,13 @@ jobs:
run: |
cd ${GITHUB_WORKSPACE}/flex
mkdir build && cd build
cmake .. && sudo make -j$(nproc)
cmake .. && sudo make -j$(nproc)

- name: GRIN on mutable csr test
run: |
git submodule update --init
cd flex/engines/graph_db/grin
mkdir build && cd build
cmake .. && sudo make -j$(nproc)
export FLEX_DATA_DIR=../../../../storages/rt_mutable_graph/modern_graph/
./run_grin_test
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "learning_engine/graph-learn"]
path = learning_engine/graph-learn
url = https://github.com/alibaba/graph-learn.git

[submodule "flex/grin"]
path = flex/grin
url = https://github.com/GraphScope/GRIN.git
6 changes: 6 additions & 0 deletions flex/engines/graph_db/database/transaction_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ inline void serialize_field(grape::InArchive& arc, const Any& prop) {
case PropertyType::kInt64:
arc << prop.value.l;
break;
case PropertyType::kDouble:
arc << prop.value.db;
break;
default:
LOG(FATAL) << "Unexpected property type";
}
Expand All @@ -60,6 +63,9 @@ inline void deserialize_field(grape::OutArchive& arc, Any& prop) {
case PropertyType::kInt64:
arc >> prop.value.l;
break;
case PropertyType::kDouble:
arc >> prop.value.db;
break;
default:
LOG(FATAL) << "Unexpected property type";
}
Expand Down
69 changes: 69 additions & 0 deletions flex/engines/graph_db/grin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
cmake_minimum_required(VERSION 3.1)

set(GRIN_READER_MAJOR_VERSION 0)
set(GRIN_READER_MINOR_VERSION 1)
set(GRIN_READER_VERSION ${GRIN_READER_MAJOR_VERSION}.${GRIN_READER_MINOR_VERSION})

project(grin_reader LANGUAGES C CXX VERSION ${GRIN_READER_VERSION})

# Set flags
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")

# ------------------------------------------------------------------------------
# find_libraries
# ------------------------------------------------------------------------------

find_package(libgrapelite REQUIRED)
include_directories(${LIBGRAPELITE_INCLUDE_DIRS})

include("../../../../flex/cmake/FindGFlags.cmake")
if (GFLAGS_FOUND)
include_directories(SYSTEM ${GFLAGS_INCLUDE_DIRS})
else ()
message(FATAL_ERROR "gflags not found")
endif ()

include("../../../../flex/cmake/FindGlog.cmake")
include_directories(SYSTEM ${GLOG_INCLUDE_DIRS})
if (GLOG_FOUND)
set(CMAKE_REQUIRED_INCLUDES "${GLOG_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${GLOG_LIBRARIES}")
endif ()

find_package(yaml-cpp REQUIRED)
include_directories(SYSTEM ${yaml-cpp_INCLUDE_DIRS})

#set(yaml-cpp_INCLUDE_DIRS "/usr/local/Cellar/yaml-cpp/0.7.0/include")
#include_directories(SYSTEM ${yaml-cpp_INCLUDE_DIRS})
#set(YAML_CPP_LIBRARIES "/usr/local/Cellar/yaml-cpp/0.7.0/lib/libyaml-cpp.0.7.0.dylib")


include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../..)
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../storages/rt_mutable_graph)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../utils/property)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

file(GLOB_RECURSE FILES_NEED_FORMAT "src/*.cc")

add_custom_target(grin_clformat
COMMAND clang-format --style=file -i ${FILES_NEED_FORMAT}
COMMENT "Running clang-format."
VERBATIM)

file(GLOB SOURCES "src/*.cc" "src/topology/*.cc" "src/property/*.cc" "src/index/*.cc" "src/common/*.cc" "../../../utils/property/*.cc" "../../../storages/rt_mutable_graph/*.cc")
add_library(flex_grin SHARED ${SOURCES})
target_link_libraries(flex_grin ${LIBGRAPELITE_LIBRARIES} ${GFLAGS_LIBRARIES} ${CMAKE_DL_LIBS} ${YAML_CPP_LIBRARIES})


add_executable(run_grin_test test/test.c)

target_include_directories(run_grin_test PRIVATE ${LIBGRAPELITE_INCLUDE_DIRS}/grape/analytical_apps fragment)
target_link_libraries(run_grin_test flex_grin ${LIBGRAPELITE_LIBRARIES} ${GFLAGS_LIBRARIES} ${CMAKE_DL_LIBS})
target_link_libraries(run_grin_test)