Skip to content

Conversation

@drwootton
Copy link

Clang static analysis reported a possible zerodivide exception at ompi/mca/coll/base/coll_base_topo.c:62 (calculate_num_nodes_up_to_level)

I was able to get this exception with the program

#include <mpi.h>
char buff[4096];
int main(int argc, char *argv[]) {
MPI_Init(&argc, &argv);
MPI_Bcast(buff, sizeof buff, MPI_CHAR, 0, MPI_COMM_WORLD);
MPI_Finalize();
}

Using the command

mpirun -n 2 --mca coll_adapt_bcast_algorithm 6 --mca coll_adapt_priority 99 bcast

The calculate_num_nodes_up_to_level function is called from ompi_coll_base_topo_build_tree. The exception occurs because fanout is set to one in this case.

This is a cherry pick of #11103 from the main branch

Signed-off-by: David Wootton [email protected]
(cherry picked from commit a74927f)

with MPI_Bcast in 2 tasks using --mca coll_adapt_bcast_algorithm 6
and --mca coll_adapt_priority 99

Resolve review comments

Signed-off-by: David Wootton <[email protected]>
(cherry picked from commit a74927f)
@drwootton drwootton requested a review from jjhursey November 28, 2022 19:17
@drwootton drwootton self-assigned this Nov 28, 2022
@jjhursey jjhursey requested a review from bosilca November 28, 2022 19:36
@awlauria awlauria merged commit 55503bb into open-mpi:v5.0.x Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants