fork download
  1. #include <mpi.h>
  2. #include <string.h>
  3. #include <iostream>
  4.  
  5. int main(int argc, char** argv) {
  6. MPI_Init(&argc, &argv);
  7.  
  8. MPI_Comm comm = MPI_COMM_WORLD;
  9.  
  10. int size;
  11. MPI_Comm_size(comm, &size);
  12.  
  13. int rank;
  14. MPI_Comm_rank(comm, &rank);
  15.  
  16. std::cout << "Процес " << rank << " із " << size << " процесів\n";
  17.  
  18. MPI_Finalize();
  19. return 0;
  20. }
Success #stdin #stdout #stderr 0.32s 40700KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: unexpected symbol in "int main"
Execution halted