[Documentation] Explain serial and parallel submission
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
ドキュメントファイルもエントリーポイントも指定されていません。まず executor の使用方法に関するドキュメントを見つけ、次に提供されている SingleNodeExecutor の例を使って、シリアルおよび並列での送信、依存関係の順序、待機時間の違い、max_workers を説明してください。推奨される送信順序と、その結果として生じる実行動作が明確になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
This can be illustrated with the following examples:
from time import sleep
from executorlib import SingleNodeExecutor
def wait_function(i, j, dependency):
sleep(i)
return [i, j]
def get_results(future_lst):
"""sort results based on time of completion"""
result_lst, tmp_lst = [], []
while len(future_lst) > 0:
for f in future_lst:
if f.done():
result_lst.append(f.result())
else:
tmp_lst.append(f)
future_lst = tmp_lst
tmp_lst = []
return result_lst
with SingleNodeExecutor(max_workers=2) as exe:
future_lst = []
for i in range(5):
f = None
for j in range(4):
f = exe.submit(wait_function, i=i, j=j, dependency=f)
future_lst.append(f)
print(get_results(future_lst=future_lst))
>>> [[0, 0], [1, 0], [2, 0], [3, 0], [0, 1], [1, 1], [4, 0], [2, 1], [0, 2], [3, 1], [1, 2], [2, 2], [0, 3], [4, 1], [1, 3], [3, 2], [2, 3], [4, 2], [3, 3], [4, 3]]
The wait time of the tasks depends only on the i parameter. In addition, functions with increasing j parameter depend on each other, so [1, 1] can only be executed once [1, 0] is completed. Given the structure of the loops the functions are submitted as follows:
[
[0, 0], [1, 0], [2, 0], [3, 0], [4, 0],
[0, 1], [1, 1], [2, 1], [3, 1], [4, 1],
[0, 2], [1, 2], [2, 2], [3, 2], [4, 2],
[0, 3], [1, 3], [2, 3], [3, 3], [4, 3],
]
But the execution order differs, starting with [0, 0], [1, 0], [2, 0], [3, 0] followed by [0, 1], [1, 1] and [4, 0]. The reason is the varying wait time. [0, 0], [1, 0], [2, 0], [3, 0], [4, 0] wait 0 seconds while [0, 1], [1, 1], [2, 1], [3, 1], [4, 1] wait 1 second and so on. Finally, only two tasks can be executed at the same time as the number of workers is restricted to max_workers=2.
In analogy:
with SingleNodeExecutor(max_workers=2) as exe:
future_lst = []
for j in range(4):
f = None
for i in range(5):
f = exe.submit(wait_function, i=i, j=j, dependency=f)
future_lst.append(f)
print(get_results(future_lst=future_lst))
>>> [[0, 0], [0, 1], [0, 2], [0, 3], [1, 0], [1, 1], [1, 2], [1, 3], [2, 1], [2, 0], [2, 2], [2, 3], [3, 0], [3, 1], [3, 2], [3, 3], [4, 0], [4, 1], [4, 2], [4, 3]]
Here the execution is transposed:
[
[0, 0], [0, 1], [0, 2], [0, 3],
[1, 0], [1, 1], [1, 2], [1, 3],
[2, 0], [2, 1], [2, 2], [2, 3],
[3, 0], [3, 1], [3, 2], [3, 3],
[4, 0], [4, 1], [4, 2], [4, 3],
]
As the executed tasks have the same run time the execution order equals the submission order, which is the recommended case.
- 主要言語
- Python
- スター
- 77
- フォーク
- 9
- 平均マージ
- 7時間 9分
- マージ済み PR(30日)
- 13
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pyiron/executorlib のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pyiron/executorlib#1054 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pyiron/executorlib#1032 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pyiron/executorlib#1005 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
pyiron/executorlib#1072 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
pyiron/executorlib#1049 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
pyiron/executorlib の issue をすべて見る
似ている issue
-
#bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
apache/superset#44923 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
lawndoc/stack-back#123 ·
-
Add: Entuneオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AbdelStark/awesome-typesafe-jev#187 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
repowise-dev/repowise#2966 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信