fork download
  1. #include <stdio.h>
  2. #include "mpi.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. int size, rank, i;
  7. MPI_Init(&argc, &argv);
  8. MPI_Comm_size(MPI_COMM_WORLD,&size);
  9. MPI_Comm_rank(MPI_COMM_WORLD,&rank);
  10. if(rank ==0)
  11. {
  12. printf("Number of processes =%d\n",size);
  13. }
  14. printf("My number in MPI_COMM_WORLD =%d\n",rank);
  15. MPI_Finalize();
  16. return 0;
  17. }
Success #stdin #stdout #stderr 0.25s 40676KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error in library(Rmpi) : there is no package called ‘Rmpi’
Execution halted