Skip to content

Commit 55ef856

Browse files
committed
minor: add UNSAFE_BROADCAST to warning
1 parent 05ff24e commit 55ef856

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pylops_mpi/DistributedArray.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@ class DistributedArray:
6666
.. warning:: When setting the partition of the DistributedArray to
6767
:obj:`pylops_mpi.Partition.BROADCAST`, it is crucial to be aware
6868
that any attempts to make arrays different from rank to rank will be
69-
overwritten by the actions of rank 0. This means that if you modify
70-
the DistributedArray on a specific rank, and are using broadcast to
71-
synchronize the arrays across all ranks, the modifications made by other
72-
ranks will be discarded and overwritten with the value at rank 0.
73-
69+
overwritten by the actions of rank 0. This is accomplished internally
70+
by broadcasting the content of rank 0 every time a modification of
71+
the array is attempted. Such a behaviour does however incur a cost
72+
as communication may be not needed if the user ensures not to modify
73+
the content of the array in different ranks in a different way. To
74+
avoid broadcasting, one can use :obj:`pylops_mpi.Partition.UNSAFE_BROADCAST`
75+
instead.
76+
7477
Parameters
7578
----------
7679
global_shape : :obj:`tuple` or :obj:`int`

0 commit comments

Comments
 (0)