[Documentation] How does `SingleNodeExecutor` touch the file system?
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- documentation, hpc
調査の方向性
SingleNodeExecutor、BaseExecutor、DependencyTaskScheduler、OneProcessTaskScheduler、および issue で名前が挙げられている task_scheduler.file ツールから始めます。resource_dict から送信とタスク実行を経て cache_directory を追跡し、その後、ファイルベースのキャッシュが選択される箇所と、それが create_file_executor とどのように異なるかを記録します。実行経路と不足している接続が明確に説明されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I'm trying to understand where SingleNodeExecutor with a cache_directory gets its instructions to actually write it's result to file.
For instance, consider the following:
from executorlib import SingleNodeExecutor
def foo(x):
return x + 1
with SingleNodeExecutor() as exe:
f = exe.submit(foo, 1, resource_dict={"cache_key": "my_key", "cache_directory": "my_dir"})
print("Result", f.result())
My understanding of the path of events is
Initialization:
SingleNodeExecutor.__init__triggersBaseExecutor.__init__with aDependencyTaskScheduleras its underlying_task_scheduler- That
DependencyTaskScheduleris initialized with aOneProcessTaskScheduleras itsexecutorarg, which gets stored in_process_kwargs["executor"]
Submission:
SingleNodeExecutor.submitis inherited directly fromBaseExecutor.submitBaseExecutor.submitpasses everything (including theresource_dictas a single kwarg) to the_task_scheduler.submit- Since
DependencyTaskScheduler._generate_dependency_graphhas fed through toFalsewith all the default values, this generates the future by a plainsuper()call toTaskSchedulerBase.submit TaskSchedulerBase.submitsends our information (function, args, kwargs, resource dict, empty future) toself._future_queue.put
Here I get out of my depth, but it seems to me like putting stuff on the future queues is activating the associated Thread, which all the TaskSchedulerBase children initialize in _set_process using a Thread taking some function and the _process_kwargs (which includes the _future_queue!). On that assumption, that means that the self._future_queue.put call we got to from TaskSchedulerBase.submit would route back to the Thread set in the DependencyTaskScheduler._set_process invocation -- i.e. _execute_tasks_with_dependencies
Continuing submission:
_execute_tasks_with_dependenciesindeed takes anexecutor, which isDependencyTaskScheduler._process_kwargs["executor"]i.e. ourOneProcessTaskScheduler; there's lots going on, but...- I don't see any reference to the cache, so I don't think the file system interaction is happening here
- It looks like we ultimately do a
executor_queue.putonto the underlyingOneProcessTaskScheduler._future_queue - I.e. we move to
_execute_task_in_separate_process
_execute_task_in_separate_processis in turn re-directing to_wrap_execute_task_in_separate_processand both of these are now taking aspawner: type[BaseSpawner]argument- But I'm at the end of the line, I don't see anything other than the default
MpiExecSpawnerbeing leveraged, and I never find any references to thecache_directoryor any of thetask_scheduler.filemodule tools
With the SlurmClusterExecutor we sometimes route through create_file_executor, in which case the file system connection is obvious, but in the other case we're still going through DependencyTaskScheduler -- this time with an SrunSpawner instead of a MpiExecSpawner. In this later case I also don't see the connection to file system tools, so I feel like I must be missing something at the diverging point: DependencyTaskScheduler.
What am I missing here? When does the SingleNodeExecutor figure out it needs to leverage the "cache_directory" field in the resource_dict?
- 主要言語
- Python
- スター
- 77
- フォーク
- 7
- 平均マージ
- 10時間 32分
- マージ済み PR(30日)
- 12
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pyiron/executorlib のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pyiron/executorlib#1054 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pyiron/executorlib#1032 ·
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pyiron/executorlib#1005 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
pyiron/executorlib#1049 · コメント 1 件 ·
-
documentation
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
pyiron/executorlib#999 · コメント 1 件 ·
pyiron/executorlib の issue をすべて見る
似ている issue
-
triage/confirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
NousResearch/hermes-agent#118866 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
apache/cloudstack#14222 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100