Skip to content

Commit 5910dac

Browse files
committed
Rename init_processes to singular form
1 parent 39851c6 commit 5910dac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

intermediate_source/dist_tuto.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ the following template.
4848
""" Distributed function to be implemented later. """
4949
pass
5050
51-
def init_processes(rank, size, fn, backend='tcp'):
51+
def init_process(rank, size, fn, backend='tcp'):
5252
""" Initialize the distributed environment. """
5353
os.environ['MASTER_ADDR'] = '127.0.0.1'
5454
os.environ['MASTER_PORT'] = '29500'
@@ -60,7 +60,7 @@ the following template.
6060
size = 2
6161
processes = []
6262
for rank in range(size):
63-
p = Process(target=init_processes, args=(rank, size, run))
63+
p = Process(target=init_process, args=(rank, size, run))
6464
p.start()
6565
processes.append(p)
6666
@@ -72,7 +72,7 @@ distributed environment, initialize the process group
7272
(``dist.init_process_group``), and finally execute the given ``run``
7373
function.
7474

75-
Let's have a look at the ``init_processes`` function. It ensures that
75+
Let's have a look at the ``init_process`` function. It ensures that
7676
every process will be able to coordinate through a master, using the
7777
same ip address and port. Note that we used the TCP backend, but we
7878
could have used
@@ -513,7 +513,7 @@ In order to test our newly installed backend, a few modifications are
513513
required.
514514

515515
1. Replace the content under ``if __name__ == '__main__':`` with
516-
``init_processes(0, 0, run, backend='mpi')``.
516+
``init_process(0, 0, run, backend='mpi')``.
517517
2. Run ``mpirun -n 4 python myscript.py``.
518518

519519
The reason for these changes is that MPI needs to create its own
@@ -577,7 +577,7 @@ the file system must support locking through
577577
`fcntl <http://man7.org/linux/man-pages/man2/fcntl.2.html>`__.
578578

579579
.. code:: python
580-
580+
nn
581581
dist.init_process_group(
582582
init_method='file:///mnt/nfs/sharedfile',
583583
rank=args.rank,

0 commit comments

Comments
 (0)