Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] 2 GB limitation of MPI_File_write_all
From: Eric Chamberland (Eric.Chamberland_at_[hidden])
Date: 2012-10-19 14:31:48


I get this error when trying to write 360 000 000 000 MPI_LONG:

with Openmpi-1.4.5:
ERROR Returned by MPI_File_write_all: 35
ERROR_string Returned by MPI_File_write_all: MPI_ERR_IO: input/output error

with Openmpi-1.6.2:
ERROR Returned by MPI_File_write_all: 13
ERROR_string Returned by MPI_File_write_all: MPI_ERR_ARG: invalid
argument of some other kind

First, the error in 1.6.2 seems to be less usefull to understand what
happened for the user...

Second, am I wrong to try to write that much MPI_LONG? Is this
limitation documented or to be fixed?



Here is the code:

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

int main (int argc, char *argv[])
     MPI_Datatype filetype;
     MPI_File fh;
     long *local_array;
     MPI_Status status;

     MPI_Init( &argc, &argv );

     int nb_proc = 0;
     MPI_Comm_size( MPI_COMM_WORLD, &nb_proc );
     if (nb_proc != 1) {
       printf( "Test code for 1 process!\n" );
       MPI_Abort( MPI_COMM_WORLD, 1 );
     int size=90000000*4;
     local_array = new long[size];

     MPI_File_open(MPI_COMM_WORLD, "2.6Gb",
       MPI_INFO_NULL, &fh);

     int ierr = MPI_File_write_all(fh, local_array, size, MPI_LONG,
     if (ierr != MPI_SUCCESS) {
       printf("ERROR Returned by MPI_File_write_all: %d\n",ierr);
       char* lCharPtr = new char[MPI_MAX_ERROR_STRING];
       int lLongueur = 0;
       MPI_Error_string(ierr,lCharPtr, &lLongueur);
       printf("ERROR_string Returned by MPI_File_write_all: %s\n",lCharPtr);
       MPI_Abort( MPI_COMM_WORLD, 1 );


     return 0;