@@ -48,7 +48,7 @@ the following template.
48
48
""" Distributed function to be implemented later. """
49
49
pass
50
50
51
- def init_processes (rank , size , fn , backend = ' tcp' ):
51
+ def init_process (rank , size , fn , backend = ' tcp' ):
52
52
""" Initialize the distributed environment. """
53
53
os.environ[' MASTER_ADDR' ] = ' 127.0.0.1'
54
54
os.environ[' MASTER_PORT' ] = ' 29500'
@@ -60,7 +60,7 @@ the following template.
60
60
size = 2
61
61
processes = []
62
62
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))
64
64
p.start()
65
65
processes.append(p)
66
66
@@ -72,7 +72,7 @@ distributed environment, initialize the process group
72
72
(``dist.init_process_group ``), and finally execute the given ``run ``
73
73
function.
74
74
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
76
76
every process will be able to coordinate through a master, using the
77
77
same ip address and port. Note that we used the TCP backend, but we
78
78
could have used
@@ -513,7 +513,7 @@ In order to test our newly installed backend, a few modifications are
513
513
required.
514
514
515
515
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') ``.
517
517
2. Run ``mpirun -n 4 python myscript.py ``.
518
518
519
519
The reason for these changes is that MPI needs to create its own
@@ -577,7 +577,7 @@ the file system must support locking through
577
577
`fcntl <http://man7.org/linux/man-pages/man2/fcntl.2.html >`__.
578
578
579
579
.. code :: python
580
-
580
+ nn
581
581
dist.init_process_group(
582
582
init_method='file:///mnt/nfs/sharedfile',
583
583
rank=args.rank,
0 commit comments