diff --git a/orte/test/mpi/Makefile b/orte/test/mpi/Makefile index 0fa80583df..214dbf545a 100644 --- a/orte/test/mpi/Makefile +++ b/orte/test/mpi/Makefile @@ -1,4 +1,4 @@ -PROGS = mpi_no_op mpi_barrier hello hello_nodename abort multi_abort simple_spawn concurrent_spawn spawn_multiple mpi_spin delayed_abort loop_spawn loop_child bad_exit pubsub hello_barrier segv accept connect hello_output hello_show_help crisscross read_write ziatest slave_spawn slave cell_spawn +PROGS = mpi_no_op mpi_barrier hello hello_nodename abort multi_abort simple_spawn concurrent_spawn spawn_multiple mpi_spin delayed_abort loop_spawn loop_child bad_exit pubsub hello_barrier segv accept connect hello_output hello_show_help crisscross read_write ziatest slave_spawn slave cell_spawn reduce-hang all: $(PROGS) diff --git a/orte/test/mpi/reduce-hang.c b/orte/test/mpi/reduce-hang.c new file mode 100644 index 0000000000..46469a11a6 --- /dev/null +++ b/orte/test/mpi/reduce-hang.c @@ -0,0 +1,30 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + long count = 0; + int i = 8, j; + int self; + int do_barrier = 0; + + if (getenv("DO_BARRIER")) { + do_barrier = 1; + } + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &self); + while (1) { + MPI_Reduce(&i, &j, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + if (do_barrier) { + MPI_Barrier(MPI_COMM_WORLD); + } + if (0 == (++count % 10000)) { + fprintf(stderr, "%ld still going at %d\n", self, count); + } + } + MPI_Finalize(); + + return 0; +}