multiprocess-synchronizer


Namemultiprocess-synchronizer JSON
Version 0.0.2rc0 PyPI version JSON
download
home_pagehttps://github.com/sandyhouse/synchronizer
SummaryA library to synchronize multiple processes in a distributed system.
upload_time2024-11-25 03:23:54
maintainerLong LI
docs_urlNone
authorLong LI
requires_pythonNone
licenseApache 2.0
keywords synchronization distributed multiprocessing
VCS
bugtrack_url
requirements filelock
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

### shell

You can also use the `synchronizer` command:

```shell
synchronizer --shared_dir dir --rank 0 --num_processes 1
```


            

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/77/85/4d997ba0123f480c8694a813d4676446a45f417daea0870c2f2946334ad5/multiprocess_synchronizer-0.0.2rc0.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\n### shell\n\nYou can also use the `synchronizer` command:\n\n```shell\nsynchronizer --shared_dir dir --rank 0 --num_processes 1\n```\n\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "A library to synchronize multiple processes in a distributed system.",
    "version": "0.0.2rc0",
    "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": "c53eb0e45a607b2b5084b054ca923677d8336789d2f5ee29ef1297dc804b5154",
                "md5": "6fa59d45e7da8f272c941c601a2780a8",
                "sha256": "8831c3158d4e370c5f5058e673d470e4e73031dc8d6d651f3f76d33f1af9d062"
            },
            "downloads": -1,
            "filename": "multiprocess_synchronizer-0.0.2rc0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6fa59d45e7da8f272c941c601a2780a8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9257,
            "upload_time": "2024-11-25T03:23:53",
            "upload_time_iso_8601": "2024-11-25T03:23:53.581015Z",
            "url": "https://files.pythonhosted.org/packages/c5/3e/b0e45a607b2b5084b054ca923677d8336789d2f5ee29ef1297dc804b5154/multiprocess_synchronizer-0.0.2rc0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "77854d997ba0123f480c8694a813d4676446a45f417daea0870c2f2946334ad5",
                "md5": "4d68e536c02c45717cc41e2985a2b7b5",
                "sha256": "fb4fc527178700a8b3d91e8b3468b6ba781b5b0d70701e51569262123902ec0f"
            },
            "downloads": -1,
            "filename": "multiprocess_synchronizer-0.0.2rc0.tar.gz",
            "has_sig": false,
            "md5_digest": "4d68e536c02c45717cc41e2985a2b7b5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8074,
            "upload_time": "2024-11-25T03:23:54",
            "upload_time_iso_8601": "2024-11-25T03:23:54.540473Z",
            "url": "https://files.pythonhosted.org/packages/77/85/4d997ba0123f480c8694a813d4676446a45f417daea0870c2f2946334ad5/multiprocess_synchronizer-0.0.2rc0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-25 03:23:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sandyhouse",
    "github_project": "synchronizer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "filelock",
            "specs": []
        }
    ],
    "lcname": "multiprocess-synchronizer"
}
        
Elapsed time: 8.33859s