Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] Bug MPI_Iscatter
From: Pierre Jolivet (jolivet_at_[hidden])
Date: 2013-11-21 17:19:50


Hello,
The following code doesn’t execute properly :
#include <mpi.h>

int main(int argc, char** argv) {
    int taskid, ntasks;
    MPI_Init(&argc, &argv);
    MPI_Request rq;

    MPI_Comm_rank(MPI_COMM_WORLD,&taskid);
    MPI_Comm_size(MPI_COMM_WORLD,&ntasks);
    double* r;
    int l = 0;
    if(taskid > 0)
        MPI_Iscatter(NULL, 0, MPI_DATATYPE_NULL, r, l, MPI_DOUBLE, 0, MPI_COMM_WORLD, &rq);
    MPI_Finalize();
}

Outcome:
*** An error occurred in MPI_Type_extent
*** MPI_ERR_TYPE: invalid datatype

Hotfix: change MPI_DATATYPE_NULL to something else.

Thanks for a quick fix.