Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

MPI exit code: 11

#include <iostream>
#include <cstdio>
#include <string>
#include <fstream>
#include <mpi.h>

double t1, t2;

int main(int argc, char* argv[])
{
    MPI_Init(NULL, NULL);
    
    int numProc;
    MPI_Comm_size(MPI_COMM_WORLD, &numProc);
    int rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    
    int N;
    std::string input;
    N = atoi(argv[1]);
    input = argv[2];
    
    t1 = MPI_Wtime();
    MPI_File fh;
    MPI_File_open(MPI_COMM_WORLD, input.c_str(), MPI_MODE_RDONLY, MPI_INFO_NULL, &fh);
    
    long long filesize;
    MPI_File_get_size(fh, &filesize);
    int bufsize = filesize / numProc;
    int nints = bufsize / sizeof(float);
    
    float* num = (float*)malloc(sizeof(float) * nints);
    
    MPI_File_seek(fh, rank * bufsize, MPI_SEEK_SET);
    MPI_File_read(fh, num, nints, MPI_FLOAT, NULL);
    
    MPI_File_close(&fh);
    t2 = MPI_Wtime();
    
    if(rank == 0)
    {
        std::cout.precision(16);
        std::cout << (double)t2 - t1 << std::endl;
    }
    
    MPI_Finalize();
    return 0;
}

The input file is a binary file. This is the error code.

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   PID 28932 RUNNING AT apollo31
=   EXIT CODE: 11
=   CLEANING UP REMAINING PROCESSES
=   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================

This message occurs at MPI_File_read, it works on my computer but not on the server I tested it on.

Link to post
Share on other sites
50 minutes ago, RexLee said:

The input file is a binary file. This is the error code.

51 minutes ago, RexLee said:

This message occurs at MPI_File_read, it works on my computer but not on the server I tested it on.

That's nice... So what do you expect us to do about it.

The single biggest problem in communication is the illusion that it has taken place.

Link to post
Share on other sites

So what does this error code mean and how should I fix it?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×