fork download
  1. #include <iostream>
  2. #include <mpi.h>
  3.  
  4. int main(int argc, char* argv[]) {
  5. MPI_Init(&argc, &argv);
  6. int rank, size;
  7. MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  8. MPI_Comm_size(MPI_COMM_WORLD, &size);
  9. std::cout << "Hello, world! I am process " << rank << " of " << size << std::endl;
  10. MPI_Finalize();
  11. return 0;
  12. }
  13.  
  14.  
  15.  
Success #stdin #stdout #stderr 0.27s 40864KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: unexpected symbol in "int main"
Execution halted