Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] MPI_PROC_NULL
From: jody (jody.xha_at_[hidden])
Date: 2009-02-12 17:00:46


Hi

In my application i use MPI_PROC_NULL
as an argument in MPI_Sendrecv to simplify the
program (i.e. no special cases for borders)
With 1.3 it works, but under 1.3.1a0r20520
i get the following error:
[jody_at_localhost 3D]$ mpirun -np 2 ./sr
[localhost.localdomain:29253] *** An error occurred in MPI_Sendrecv
[localhost.localdomain:29253] *** on communicator MPI_COMM_WORLD
[localhost.localdomain:29253] *** MPI_ERR_RANK: invalid rank
[localhost.localdomain:29253] *** MPI_ERRORS_ARE_FATAL (goodbye)
[localhost.localdomain:29252] *** An error occurred in MPI_Sendrecv
[localhost.localdomain:29252] *** on communicator MPI_COMM_WORLD
[localhost.localdomain:29252] *** MPI_ERR_RANK: invalid rank
[localhost.localdomain:29252] *** MPI_ERRORS_ARE_FATAL (goodbye)

According to the MPI-book it shpuld be ok to use MPI_PROC_NULL in such cases.
Is there a rreason why this doesn't work anymore?

Here's a code which reproduces the problem:

[jody_at_localhost 3D]$ cat sr.cpp
#include <stdio.h>

#include "mpi.h"

int main(int iArgC, char *apArgV[]) {
    int iRank;
    int iSize;

    MPI_Init(&iArgC, &apArgV);

    MPI_Comm_size(MPI_COMM_WORLD, &iSize);
    MPI_Comm_rank(MPI_COMM_WORLD, &iRank);

    MPI_Status st;
    MPI_Sendrecv(&iRank, 1, MPI_INT, MPI_PROC_NULL, 77,
                 &iSize, 1, MPI_INT, 1, 77, MPI_COMM_WORLD, &st);

    MPI_Finalize();
    return 0;
}

Thank You
  Jody