fork download
  1. #include <mpi.h>
  2. #include <stdio.h>
  3.  
  4. int main(int argc, char** argv) {
  5. MPI_Init(&argc, &argv);
  6.  
  7. int world_size;
  8. MPI_Comm_size(MPI_COMM_WORLD, &world_size);
  9.  
  10. int world_rank;
  11. MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
  12.  
  13. printf("Hello from process %d of %d\n", world_rank, world_size);
  14.  
  15. MPI_Finalize();
  16. return 0;
  17. }
Success #stdin #stdout #stderr 0.25s 40568KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: unexpected symbol in "int main"
Execution halted