Metadata-Version: 2.1
Name: multiprocess-synchronizer
Version: 0.0.2rc0
Summary: A library to synchronize multiple processes in a distributed system.
Home-page: https://github.com/sandyhouse/synchronizer
Download-URL: https://github.com/sandyhouse/synchronizer/releases
Author: Long LI
Author-email: lilong.albert@gmail.com
Maintainer: Long LI
Maintainer-email: lilong.albert@gmail.com
License: Apache 2.0
Keywords: synchronization,distributed,multiprocessing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Information Technology
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Environment :: Console
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE

# 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
```

