Skip to content

Commit

Permalink
[networkx] Remove experimental flag of the networkx module (#273)
Browse files Browse the repository at this point in the history
* rename EXPERIMENTAL_ON to NETWORKX and update the tutorials.
  • Loading branch information
acezen authored Apr 30, 2021
1 parent 72e79dd commit 76c0d8f
Show file tree
Hide file tree
Showing 265 changed files with 507 additions and 495 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
--shm-size 4096m
strategy:
matrix:
experimental: [ON, OFF]
networkx: [ON, OFF]

steps:
- name: Install Dependencies
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
cd build
cmake .. -DCMAKE_PREFIX_PATH=/opt/graphscope \
-DCMAKE_INSTALL_PREFIX=/opt/graphscope \
-DEXPERIMENTAL_ON=${{ matrix.experimental }}
-DNETWORKX=${{ matrix.networkx }}
make -j`nproc`
make install
cd ${GITHUB_WORKSPACE}
Expand All @@ -123,7 +123,7 @@ jobs:
../test/app_tests.sh --test_dir ${GITHUB_WORKSPACE}/gstest
- name: Upload Artifact
if: matrix.experimental == 'ON'
if: matrix.networkx == 'ON'
uses: actions/upload-artifact@v2
with:
name: gae-${{ github.sha }}
Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:
--shm-size 4096m
strategy:
matrix:
experimental: [ON, OFF]
networkx: [ON, OFF]
steps:
- name: Install Dependencies
run: |
Expand Down Expand Up @@ -310,7 +310,7 @@ jobs:
uses: mxschmitt/action-tmate@v2

- name: App Test with Expr Off
if: matrix.experimental == 'OFF'
if: matrix.networkx == 'OFF'
run: |
# prelaunch the etcd
/usr/local/bin/etcd --data-dir=/dev/shm/default.etcd &
Expand All @@ -323,23 +323,23 @@ jobs:
pkill -TERM etcd || true
- name: Upload Coverage
if: matrix.experimental == 'OFF'
if: matrix.networkx == 'OFF'
uses: codecov/codecov-action@v1
with:
file: ./python/coverage.xml
fail_ci_if_error: true

- name: App Test with Expr On
if: matrix.experimental == 'ON'
if: matrix.networkx == 'ON'
run: |
# prelaunch the etcd
/usr/local/bin/etcd --data-dir=/dev/shm/default.etcd &
export GS_TEST_DIR='/root/gstest'
python3 -m pytest --exitfirst -s -v python/graphscope/experimental/nx/tests/classes
python3 -m pytest --exitfirst -s -v python/graphscope/experimental/nx/tests/test_nx.py
python3 -m pytest --exitfirst -s -v python/graphscope/experimental/nx/tests/algorithms/builtin \
python/graphscope/experimental/nx/tests/test_utils.py
python3 -m pytest --exitfirst -s -v python/graphscope/nx/tests/classes
python3 -m pytest --exitfirst -s -v python/graphscope/nx/tests/test_nx.py
python3 -m pytest --exitfirst -s -v python/graphscope/nx/tests/algorithms/builtin \
python/graphscope/nx/tests/test_utils.py
pkill -TERM etcd || true
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
WORKING_DIR := $(dir $(MKFILE_PATH))

VERSION ?= 0.1.0
INSTALL_PREFIX ?= /usr/local
VERSION ?= 0.1.0
INSTALL_PREFIX ?= /usr/local

# GAE build options
EXPERIMENTAL_ON ?= OFF
NETWORKX ?= OFF

# client build options
WITH_LEARNING_ENGINE ?= OFF
WITH_LEARNING_ENGINE ?= OFF

.PHONY: all
all: graphscope
Expand Down Expand Up @@ -52,7 +52,7 @@ coordinator: client
gae:
mkdir -p $(WORKING_DIR)/analytical_engine/build
cd $(WORKING_DIR)/analytical_engine/build && \
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) -DEXPERIMENTAL_ON=$(EXPERIMENTAL_ON) .. && \
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) -DNETWORKX=$(NETWORKX) .. && \
make -j`nproc` && \
sudo make install

Expand Down
14 changes: 8 additions & 6 deletions analytical_engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ if (POLICY CMP0048)
endif ()
project(analytical_engine LANGUAGES C CXX VERSION ${GRAPHSCOPE_ANALYTICAL_VERSION})

option(EXPERIMENTAL_ON "experimental on?" OFF)
option(NETWORKX "networkx on?" ON)
option(BUILD_TESTS "Build unit test" ON)

if (EXPERIMENTAL_ON)
if (NETWORKX)
add_definitions(-DNETWORKX)
# TODO: need by vineyard, remove when vineyard version update.
add_definitions(-DEXPERIMENTAL_ON)
endif ()

Expand Down Expand Up @@ -119,7 +121,7 @@ include_directories(${Protobuf_INCLUDE_DIRS})
include("cmake/FindGRPC.cmake")
include_directories(${GRPC_INCLUDE_DIR})

if (EXPERIMENTAL_ON)
if (NETWORKX)
include("cmake/FindFolly.cmake")
include("cmake/FindDoubleConversion.cmake")
if (FOLLY_FOUND)
Expand Down Expand Up @@ -163,7 +165,7 @@ if (${LIBUNWIND_FOUND})
target_link_libraries(grape_engine PRIVATE ${LIBUNWIND_LIBRARIES})
endif ()

if (EXPERIMENTAL_ON)
if (NETWORKX)
target_include_directories(grape_engine PUBLIC ${FOLLY_ROOT_DIR}/include)
target_link_libraries(grape_engine PRIVATE ${FOLLY_LIBRARIES} ${DOUBLE_CONVERSION_LIBRARY})
endif ()
Expand All @@ -173,7 +175,7 @@ if (BUILD_TESTS)
add_executable(run_app test/run_app.cc)
target_include_directories(run_app PRIVATE ${LIBGRAPELITE_INCLUDE_DIRS}/grape/analytical_apps utils apps)
target_link_libraries(run_app ${LIBGRAPELITE_LIBRARIES} ${GFLAGS_LIBRARIES} ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${VINEYARD_LIBRARIES})
if (EXPERIMENTAL_ON)
if (NETWORKX)
target_include_directories(run_app PUBLIC ${FOLLY_ROOT_DIR}/include)
target_link_libraries(run_app ${FOLLY_LIBRARIES} ${DOUBLE_CONVERSION_LIBRARY})
endif ()
Expand Down Expand Up @@ -226,7 +228,7 @@ if (BUILD_TESTS)

add_vineyard_app(projected_graph_benchmarks SRCS benchmarks/projected_graph_benchmarks.cc)

if (EXPERIMENTAL_ON)
if (NETWORKX)
add_vineyard_app(test_convert SRCS test/test_convert.cc)
target_include_directories(test_convert PRIVATE ${FOLLY_ROOT_DIR}/include)
target_link_libraries(test_convert ${FOLLY_LIBRARIES} ${DOUBLE_CONVERSION_LIBRARY})
Expand Down
4 changes: 2 additions & 2 deletions analytical_engine/core/app/app_invoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <string>
#include <type_traits>

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX
#include "folly/dynamic.h"
#endif
#include "glog/logging.h"
Expand Down Expand Up @@ -112,7 +112,7 @@ struct ArgsUnpacker<std::string> {
}
};

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX
/**
* @brief A specialized ArgsUnpacker with folly::dynamic type
*/
Expand Down
6 changes: 3 additions & 3 deletions analytical_engine/core/context/tensor_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <utility>
#include <vector>

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX
#include "folly/dynamic.h"
#endif

Expand Down Expand Up @@ -54,7 +54,7 @@ inline InArchive& operator<<(InArchive& in_archive,
return in_archive;
}

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX
inline InArchive& operator<<(
InArchive& in_archive, const gs::trivial_tensor_t<folly::dynamic>& tensor) {
size_t size = tensor.size();
Expand Down Expand Up @@ -471,7 +471,7 @@ class TensorContextWrapper : public ITensorContextWrapper {
std::shared_ptr<context_t> ctx_;
};

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX
/**
* @brief This is the specialized TensorContextWrapper for folly::dynamic type
* of oid
Expand Down
2 changes: 1 addition & 1 deletion analytical_engine/core/fragment/dynamic_fragment.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_FRAGMENT_H_
#define ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_FRAGMENT_H_

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX
#include <cassert>
#include <cstddef>

Expand Down
4 changes: 2 additions & 2 deletions analytical_engine/core/fragment/dynamic_fragment_reporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_FRAGMENT_REPORTER_H_
#define ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_FRAGMENT_REPORTER_H_

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX

#include <map>
#include <memory>
Expand Down Expand Up @@ -375,5 +375,5 @@ class DynamicGraphReporter : public grape::Communicator {
};
} // namespace gs

#endif // EXPERIMENTAL_ON
#endif // NETWORKX
#endif // ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_FRAGMENT_REPORTER_H_
4 changes: 2 additions & 2 deletions analytical_engine/core/fragment/dynamic_fragment_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_FRAGMENT_VIEW_H_
#define ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_FRAGMENT_VIEW_H_

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX

#include <memory>
#include <string>
Expand Down Expand Up @@ -320,5 +320,5 @@ class DynamicFragmentView : public DynamicFragment {
};

} // namespace gs
#endif // EXPERIMENTAL_ON
#endif // NETWORKX
#endif // ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_FRAGMENT_VIEW_H_
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_PROJECTED_FRAGMENT_H_
#define ANALYTICAL_ENGINE_CORE_FRAGMENT_DYNAMIC_PROJECTED_FRAGMENT_H_

#ifdef EXPERIMENTAL_ON
#ifdef NETWORKX

#include <map>
#include <memory>
Expand Down
Loading

0 comments on commit 76c0d8f

Please sign in to comment.