Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] Open MPI 1.7.1 and nonblocking bcast questions
From: Christoph Niethammer (niethammer_at_[hidden])
Date: 2013-04-24 07:49:36


Currently I am investigating the new nonblocking collectives introduced in
MPI-3 which are implemented in Open MPI 1.7.1. As a first try I took

According to the MPI-3 spec my understanding is that MPI_Ibcast + MPI_Wait
should be equivalent to a MPI_Bcast - except, that the algorithms used within
the the MPI implementation may differe.

I wrote a simple example code:

#include <stdio.h>
#include <mpi.h>

int main(int argc, char *argv[9]) {
    MPI_Init(&argc, &argv);
    MPI_Comm comm = MPI_COMM_WORLD /* MPI_COMM_SELF */;
    int root = 0;
    int array[100];
    MPI_Request request;
    MPI_Status status;

    MPI_Ibcast(array, 100, MPI_INT, root, comm, &request);
    MPI_Wait(&request, &status /* MPI_STATUS_IGNORE */);

    int count = -1;
    MPI_Get_count(&status, MPI_INT, &count);
    printf("%d - %d\n", 100, count);

    return 0;

I run the example with "mpirun -np 2 <app>"

And here the questions:
1) Is it allowed to use a status in the wait for this nonblocking bcast? The
spec does only show MPI_STATUS_IGNORE in the examples. And what should be the
count returned by Get_count when applied to the final status? Using the
MPI_Bcast does not provide to posibility to get this info at all.
The example output from all ranks is "100 - 0" - I would have expecte "100 -
100". Is this a bug in Open MPI 1.7.1?

2) When using MPI_COMM_SELF the code deadlocks while it does not do so when
using a normal MPI_Bcast. I did not have a look inside the Open MPI code yet
but I expect two different algorithms for MPI_Ibcast and MPI_Bcast where the
former may have a problem.

Thanks in advance for your feedback.

Best regards