! $UWHPSC/codes/mpi/test1.f90
program test1
use mpi
implicit none
integer :: ierr, numprocs, proc_num
call mpi_init(ierr)
call mpi_comm_size(MPI_COMM_WORLD, numprocs, ierr)
call mpi_comm_rank(MPI_COMM_WORLD, proc_num, ierr)
print *, 'Hello from Process number', proc_num, &
' of ', numprocs, ' processes'
call mpi_finalize(ierr)
end program test1
I’m mac m1 user i have to run the above code in mac terminal i found error that is mentioned below i also install open-mpi using brew install open-mpi but still encounter these problem
MacBook-Air mpi % gfortran test1.f90
test1.f90:4:9:
4 | use mpi
| 1
Fatal Error: Cannot open module file ‘mpi.mod’ for reading at (1): No such file or directory
compilation terminated.
MacBook-Air mpi % mpif90 test1.f90
ld: warning: -commons use_dylibs is no longer supported, using error treatment instead
please provide solution to this problem
Abhishek Gond is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.