fork download
  1. #include <mpi.h>
  2. #include <iostream>
  3.  
  4.  
  5.  
  6. int main(int argc, char** argv) {
  7.  
  8. MPI_Init(&argc, &argv);
  9.  
  10. int worldSize;
  11. MPI_Comm_size(MPI_COMM_WORLD, &worldSize);
  12. int worldRank;
  13. MPI_Comm_rank(MPI_COMM_WORLD, &worldRank);
  14.  
  15. std::cout<<worldSize<<worldRank;
  16. MPI_Finalize();
  17. return 0;
  18. }
Success #stdin #stdout #stderr 0.25s 40600KB
stdin
1
2
88
42
99
stdout
Standard output is empty
stderr
Error: unexpected symbol in "int main"
Execution halted