mpi - An error occurred in MPI_Send on a NULL communicator -


#include <stdio.h> #include <mpi.h>  #define n 100  void send(int* data, int n){   int status;   mpi_send(data, n, mpi_int, 1, 0, mpi_comm_world); }  int main(int argc, char * argv[]) {   mpi_init(&argc, &argv);    int data[n];   send(data, n);    mpi_finalize();   return 0; } 

i compiled withl: mpicc -o3 program.c -o out. compiled. when run by: mpirun -np 2 ./out i've got error:

*** error occurred in mpi_send *** on null communicator *** mpi_errors_are_fatal (processes in communicator abort, ***    , potentially mpi job)  local abort before mpi_init completed successfully; not able aggregate error messages, , not able guarantee other processes killed! 

please solve issue. in advance :)


Comments