From db1b0ca35c5ff076f1e067130ba597e96a23db56 Mon Sep 17 00:00:00 2001 From: siyuan0322 Date: Tue, 6 Dec 2022 22:08:06 +0800 Subject: [PATCH 1/3] enable compiling pregel app on local vm --- analytical_engine/core/app/pregel/pregel_context.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/analytical_engine/core/app/pregel/pregel_context.h b/analytical_engine/core/app/pregel/pregel_context.h index 79a99ac51486..c12fcc7ca2f1 100644 --- a/analytical_engine/core/app/pregel/pregel_context.h +++ b/analytical_engine/core/app/pregel/pregel_context.h @@ -88,10 +88,13 @@ class PregelContext * @tparam VID_T VID type * @tparam COMPUTE_CONTEXT_T */ -template -class PregelContext, COMPUTE_CONTEXT_T> - : public LabeledVertexDataContext, - typename COMPUTE_CONTEXT_T::vd_t> { +template +class PregelContext, + COMPUTE_CONTEXT_T> + : public LabeledVertexDataContext< + vineyard::ArrowFragment, + typename COMPUTE_CONTEXT_T::vd_t> { using fragment_t = vineyard::ArrowFragment; using vid_t = typename fragment_t::vid_t; using vd_t = typename COMPUTE_CONTEXT_T::vd_t; From 133a4e380d8ad2b25a50a0b5d261792446591b0c Mon Sep 17 00:00:00 2001 From: siyuan0322 Date: Tue, 6 Dec 2022 22:51:12 +0800 Subject: [PATCH 2/3] add cpp pregel type --- coordinator/gscoordinator/utils.py | 4 ++-- python/graphscope/framework/app.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/coordinator/gscoordinator/utils.py b/coordinator/gscoordinator/utils.py index 6a314a7550a8..daeb819aa0e8 100644 --- a/coordinator/gscoordinator/utils.py +++ b/coordinator/gscoordinator/utils.py @@ -370,7 +370,7 @@ def compile_app( "Skip running llvm4jni since env var LLVM4JNI_HOME not found or run.sh not found under LLVM4JNI_HOME" ) logger.info(" ".join(cmake_commands)) - elif app_type != "cpp_pie": + elif app_type not in ("cpp_pie", "cpp_pregel"): if app_type == "cython_pregel": pxd_name = "pregel" cmake_commands += ["-DCYTHON_PREGEL_APP=True"] @@ -1467,7 +1467,7 @@ def _codegen_app_info(attr, meta_file: str, java_class_path: str): for app in config_yaml["app"]: if app["algo"] == algo: app_type = app["type"] # cpp_pie or cython_pregel or cython_pie, java_pie - if app_type == "cpp_pie": + if app_type in ("cpp_pie", "cpp_pregel"): return ( app_type, app["src"], diff --git a/python/graphscope/framework/app.py b/python/graphscope/framework/app.py index 098570205cb8..1db4c8d5236f 100644 --- a/python/graphscope/framework/app.py +++ b/python/graphscope/framework/app.py @@ -149,7 +149,7 @@ class AppAssets(DAGNode): Assets includes an algorithm name, and gar (for user defined algorithm), a context type (one of 'tensor', 'vertex_data', 'vertex_property', 'labeled_vertex_data', 'dynamic_vertex_data', 'labeled_vertex_property'), - and its type (one of `cpp_pie`, `cython_pie`, `cython_pregel`), + and its type (one of `cpp_pie`, `cpp_pregel`, `cython_pie`, `cython_pregel`), The instance of this class can be passed to init :class:`graphscope.framework.app.AppDAGNode` """ @@ -246,7 +246,7 @@ def context_type(self): @property def type(self): - """Algorithm type, one of `cpp_pie`, `cython_pie`, `java_pie` or `cython_pregel`. + """Algorithm type, one of `cpp_pie`, `cpp_pregel`, `cython_pie`, `java_pie` or `cython_pregel`. Returns: str: Algorithm type of this asset. @@ -389,7 +389,7 @@ def __call__(self, *args, **kwargs): if not isinstance(self._graph, DAGNode) and not self._graph.loaded(): raise RuntimeError("The graph is not loaded") - if self._app_assets.type in ["cython_pie", "cython_pregel", "java_pie"]: + if self._app_assets.type in ["cpp_pregel", "cython_pie", "cython_pregel", "java_pie"]: # cython app support kwargs only check_argument( not args, "Only support using keyword arguments in cython app." From 5f72aabf7bf46adda869cc38b70a8af04d69644b Mon Sep 17 00:00:00 2001 From: siyuan0322 Date: Tue, 6 Dec 2022 23:17:32 +0800 Subject: [PATCH 3/3] format --- python/graphscope/framework/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/graphscope/framework/app.py b/python/graphscope/framework/app.py index 1db4c8d5236f..aad4a28b489c 100644 --- a/python/graphscope/framework/app.py +++ b/python/graphscope/framework/app.py @@ -389,7 +389,12 @@ def __call__(self, *args, **kwargs): if not isinstance(self._graph, DAGNode) and not self._graph.loaded(): raise RuntimeError("The graph is not loaded") - if self._app_assets.type in ["cpp_pregel", "cython_pie", "cython_pregel", "java_pie"]: + if self._app_assets.type in [ + "cpp_pregel", + "cython_pie", + "cython_pregel", + "java_pie", + ]: # cython app support kwargs only check_argument( not args, "Only support using keyword arguments in cython app."