+.. _cfg=smpi/barrier-collectives:
+
+Add a barrier in all collectives
+................................
+
+**Option** ``smpi/barrier-collectives`` **default:** off
+
+This option adds a simple barrier in all collectives operation to catch dangerous
+code that may or may not work depending on the MPI implementation. It is disabled
+by default, and activated by the `-analyze` flag of smpirun.
+
+For example, the following code works with OpenMPI while it deadlocks in MPICH and
+Intel MPI. It seems to mean that OpenMPI has a "fire and forget" implementation for
+Broadcast.
+
+.. code-block:: C
+
+ if (rank == 0) {
+ MPI_Bcast(buf1, buff_size, MPI_CHAR, 0, newcom);
+ MPI_Send(&buf2, buff_size, MPI_CHAR, 1, tag, newcom);
+ } else if (rank==1) {
+ MPI_Recv(&buf2, buff_size, MPI_CHAR, 0, tag, newcom, MPI_STATUS_IGNORE);
+ MPI_Bcast(buf1, buff_size, MPI_CHAR, 0, newcom);
+ }
+
+.. _cfg=smpi/barrier-finalization: