Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] likely bad return from MPI_File_c2f
From: Lisandro Dalcin (dalcinl_at_[hidden])
Date: 2009-02-10 17:06:23


Try to run the trivial program below. I MPI_File_c2f(MPI_FILE_NULL)
returns "-1" (minus one), however it seems the routine should return
"0" (zero).

#include <mpi.h>
#include <stdio.h>
int main()
{
  MPI_Fint i;
  MPI_File f;
  MPI_Init(0,0);
  i = MPI_File_c2f(MPI_FILE_NULL);
  printf("MPI_File_c2f(MPI_FILE_NULL) -> %d\n", i);
  f = MPI_File_f2c(0);
  printf("MPI_File_f2c(0) == MPI_FILE_NULL -> %s\n", (f ==
MPI_FILE_NULL)?"yes":"no");
  MPI_Finalize();
}

-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594