diff --git a/README.rst b/README.rst index f304c092e..4f437e47e 100644 --- a/README.rst +++ b/README.rst @@ -11,6 +11,7 @@ Ray Ray is a flexible, high-performance distributed execution framework. + Installation ------------ @@ -21,15 +22,41 @@ Installation .. _`Mac`: http://ray.readthedocs.io/en/latest/install-on-macosx.html +Example Program +--------------- + ++------------------------------------------------+----------------------------------------------+ +| **Basic Python** | **Distributed with Ray** | ++------------------------------------------------+----------------------------------------------+ +|.. code:: python |.. code-block:: python | +| | | +| import time | import time | +| | import ray | +| | | +| | ray.init() | +| | | +| | @ray.remote | +| def f(): | def f(): | +| time.sleep(1) | time.sleep(1) | +| return 1 | return 1 | +| | | +| # Execute f serially. | # Execute f in parallel. | +| results = [f() for i in range(4)] | object_ids = [f.remote() for i in range(4)] | +| | results = ray.get(object_ids) | ++------------------------------------------------+----------------------------------------------+ + + More Information ---------------- - `Mailing List`_ - `Documentation`_ +- `Tutorial`_ - `Blog`_ -- `HotOS paper`_ +- `Ray HotOS paper`_ .. _`Mailing List`: https://groups.google.com/forum/#!forum/ray-dev .. _`Documentation`: http://ray.readthedocs.io/en/latest/index.html +.. _`Tutorial`: https://github.com/ray-project/tutorial .. _`Blog`: https://ray-project.github.io/ -.. _`HotOS paper`: https://arxiv.org/abs/1703.03924 +.. _`Ray HotOS paper`: https://arxiv.org/abs/1703.03924 diff --git a/doc/source/index.rst b/doc/source/index.rst index 8635d308d..1110324a8 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -3,6 +3,28 @@ Ray *Ray is a flexible, high-performance distributed execution framework.* +Example Program +--------------- + ++------------------------------------------------+----------------------------------------------------+ +| **Basic Python** | **Distributed with Ray** | ++------------------------------------------------+----------------------------------------------------+ +|.. code:: python |.. code-block:: python | +| | | +| import time | import time | +| | import ray | +| | | +| | ray.init() | +| | | +| | @ray.remote | +| def f(): | def f(): | +| time.sleep(1) | time.sleep(1) | +| return 1 | return 1 | +| | | +| # Execute f serially. | # Execute f in parallel. | +| results = [f() for i in range(4)] | results = ray.get([f.remote() for i in range(4)]) | ++------------------------------------------------+----------------------------------------------------+ + .. toctree:: :maxdepth: 1 :caption: Installation