# Synchronizer
This is a synchronization library used to synchronize multiple processes in distributed systems.
## Install
You can install this package with pip using the following command:
```shell
pip install multiprocess-synchronizer
```
## Usage
```python
from synchronizer import FileSystemSynchronizer
from multiprocessing import Process
def main(num_processes):
fs_sync = FileSystemSynchronizer('test', rank, world_size)
fs_sync.barrier()
if __name__ == "__main__":
main()
```
## FileSystemSynchronizer
```python
FileSystemSynchronizer(shared_dir, rank, world_size)
```
Parameters:
- shared_dir: A directory on a shared file system that can be accessed by all processes; **this directory must be empty**.
- rank: Rank id of the current process
- world_size: Total number of processes.
Raw data
{
"_id": null,
"home_page": "https://github.com/sandyhouse/synchronizer",
"name": "multiprocess-synchronizer",
"maintainer": "Long LI",
"docs_url": null,
"requires_python": null,
"maintainer_email": "lilong.albert@gmail.com",
"keywords": "synchronization, distributed, multiprocessing",
"author": "Long LI",
"author_email": "lilong.albert@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/40/a4/f86ffe29548aef79a5b7805aea9fdf312ca75038052d6fced8c1687cda81/multiprocess_synchronizer-0.0.1rc0.tar.gz",
"platform": null,
"description": "# Synchronizer\n\nThis is a synchronization library used to synchronize multiple processes in distributed systems.\n\n## Install\n\nYou can install this package with pip using the following command:\n\n```shell\npip install multiprocess-synchronizer\n```\n\n## Usage\n\n```python\nfrom synchronizer import FileSystemSynchronizer\nfrom multiprocessing import Process\n\n\ndef main(num_processes):\n fs_sync = FileSystemSynchronizer('test', rank, world_size)\n fs_sync.barrier()\n\nif __name__ == \"__main__\":\n main()\n```\n\n## FileSystemSynchronizer\n\n```python\nFileSystemSynchronizer(shared_dir, rank, world_size)\n```\n\nParameters:\n- shared_dir: A directory on a shared file system that can be accessed by all processes; **this directory must be empty**.\n- rank: Rank id of the current process\n- world_size: Total number of processes.\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "A library to synchronize multiple processes in a distributed system.",
"version": "0.0.1rc0",
"project_urls": {
"Download": "https://github.com/sandyhouse/synchronizer/releases",
"Homepage": "https://github.com/sandyhouse/synchronizer"
},
"split_keywords": [
"synchronization",
" distributed",
" multiprocessing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ca6d9218dfc54592fcac7a017dd579b143db77f2a9c34e33299d6e5fb79b6c9c",
"md5": "d4b240cd55a3eb7b00a3b25361575c76",
"sha256": "ddc8a287604d12ba3e70d3315a2b2cc6c9fcb3b36ddde44a000e36ac18424976"
},
"downloads": -1,
"filename": "multiprocess_synchronizer-0.0.1rc0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d4b240cd55a3eb7b00a3b25361575c76",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 8298,
"upload_time": "2024-11-12T02:37:02",
"upload_time_iso_8601": "2024-11-12T02:37:02.700023Z",
"url": "https://files.pythonhosted.org/packages/ca/6d/9218dfc54592fcac7a017dd579b143db77f2a9c34e33299d6e5fb79b6c9c/multiprocess_synchronizer-0.0.1rc0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "40a4f86ffe29548aef79a5b7805aea9fdf312ca75038052d6fced8c1687cda81",
"md5": "071119058bdafca935670c1bd13acd82",
"sha256": "327cbc0d483a351ad8f776b9f77fe9109a6596be54c63c3b1c34a8ddc28f6be8"
},
"downloads": -1,
"filename": "multiprocess_synchronizer-0.0.1rc0.tar.gz",
"has_sig": false,
"md5_digest": "071119058bdafca935670c1bd13acd82",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7601,
"upload_time": "2024-11-12T02:37:04",
"upload_time_iso_8601": "2024-11-12T02:37:04.275311Z",
"url": "https://files.pythonhosted.org/packages/40/a4/f86ffe29548aef79a5b7805aea9fdf312ca75038052d6fced8c1687cda81/multiprocess_synchronizer-0.0.1rc0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-12 02:37:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sandyhouse",
"github_project": "synchronizer",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "multiprocess-synchronizer"
}