alibaba / alibaba/GraphScope

[Question] Where is graph.add_vertices() op Execute?

Open
#3,341 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.6k
Forks
468
Avg merge
29m
Merged PRs (30d)
1

Description

# **By reading the source code, there are two questions:**

Source Code:
```python
# Import the graphscope module
import graphscope
import os
# 单机验证 加载图数据 from HDFS
from graphscope.framework.loader import Loader
from graphscope.client.session import get_default_session

graphscope.set_option(show_log=True) # enable logging
graphscope.set_option(log_level='DEBUG')

# 拉起简单的任务
sess = graphscope.session( cluster_type='hosts',
enabled_engines='interactive',
vineyard_shared_mem='1Gi',
num_workers=2)
```

```python
# 客户端向Coordinator 发送RPC请求:创建图并加载图数据
graph = sess.g()

prefix = '/Users/jacky/.graphscope/datasets/ogbn_mag_small'
graph = (
graph.add_vertices(os.path.join(prefix, "paper.csv"), "paper")
)
```

# Questions:

- 1.Where is graph.add_vertices() op Execute?

From coordinator servicer _RunStep() i can't find add_vertices op run on where[analytical engine、interactive engine or coordinator]

```python

while not dag_manager.empty():
run_dag_on, dag, dag_bodies = dag_manager.next_dag()
error_code = error_codes_pb2.COORDINATOR_INTERNAL_ERROR
head, bodies = None, None
try:
# run on analytical engine
if run_dag_on == GSEngine.analytical_engine:
# need dag_bodies to load graph from pandas/numpy
error_code = error_codes_pb2.ANALYTICAL_ENGINE_INTERNAL_ERROR
head, bodies = self._operation_executor.run_on_analytical_engine(
dag, dag_bodies, loader_op_bodies
)
# run on interactive engine
elif run_dag_on == GSEngine.interactive_engine:
error_code = error_codes_pb2.INTERACTIVE_ENGINE_INTERNAL_ERROR
head, bodies = self._operation_executor.run_on_interactive_engine(
dag
)
# run on learning engine
elif run_dag_on == GSEngine.learning_engine:
error_code = error_codes_pb2.LEARNING_ENGINE_INTERNAL_ERROR
head, bodies = self._operation_executor.run_on_learning_engine(dag)
# run on coordinator
# 加载点边的 OP 是在哪里执行
elif run_dag_on == GSEngine.coordinator:
error_code = error_codes_pb2.COORDINATOR_INTERNAL_ERROR
head, bodies = self._operation_executor.run_on_coordinator(
dag, dag_bodies, loader_op_bodies
)
# merge the responses
responses[0].head.results.extend(head.head.results)
responses.extend(bodies)

```

- 2.How to build a source code reading development environment

Support breakpoint debugging: between client and coordinator

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.